:root {
  --app-font: "Mina", sans-serif;
  --display-font: "Mina", sans-serif;
  --bg: linear-gradient(180deg, #edf2fa 0%, #f7f9fc 100%);
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-soft: #f8fafc;
  --line: #d7deea;
  --line-soft: #e9eef5;
  --ink: #111827;
  --muted: #667085;
  --muted-strong: #475467;
  --primary: #0f4ad7;
  --primary-strong: #0b3bb3;
  --primary-soft: #edf3ff;
  --primary-rgb: 15, 74, 215;
  --ok: #0f7a52;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --err: #b42318;
  --err-soft: #fef3f2;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

:root[data-font="sora"] {
  --app-font: "Sora", sans-serif;
  --display-font: "Sora", sans-serif;
}

:root[data-font="ibm-plex"] {
  --app-font: "IBM Plex Sans", sans-serif;
  --display-font: "IBM Plex Sans", sans-serif;
}

:root[data-font="libre-franklin"] {
  --app-font: "Libre Franklin", sans-serif;
  --display-font: "Libre Franklin", sans-serif;
}

:root[data-font="manrope"] {
  --app-font: "Manrope", sans-serif;
  --display-font: "Manrope", sans-serif;
}

:root[data-font="roboto-condensed"] {
  --app-font: "Roboto Condensed", sans-serif;
  --display-font: "Roboto Condensed", sans-serif;
}

:root[data-accent="red"] {
  --primary: #c9302c;
  --primary-strong: #a61f1a;
  --primary-soft: #fff1f1;
  --primary-rgb: 201, 48, 44;
}

:root[data-accent="gray"] {
  --primary: #475569;
  --primary-strong: #334155;
  --primary-soft: #f1f5f9;
  --primary-rgb: 71, 85, 105;
}

:root[data-accent="green"] {
  --primary: #087443;
  --primary-strong: #065f46;
  --primary-soft: #ecfdf3;
  --primary-rgb: 8, 116, 67;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--app-font);
}

body.app-body {
  background: #eef3f8;
}

body.product-ui {
  background: #f4f7fb;
}

.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.app-mark {
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}

.app-mark strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.03em;
}

.app-mark span {
  color: var(--muted);
  font-size: 11px;
}

.app-nav {
  display: grid;
  gap: 4px;
}

.app-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted-strong);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.app-nav a:hover,
.app-nav a.active {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.app-main {
  min-width: 0;
  padding: 16px 18px 28px;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.module-actionbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.module-kicker {
  margin: 0 0 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.module-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.module-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.app-title h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.app-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.module-actions,
.app-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.language-switch {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.language-switch label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.language-switch span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.language-switch select {
  width: auto;
  min-width: 104px;
  height: 34px;
  margin: 0;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.product-top-actions .language-switch span {
  display: none;
}

.product-top-actions .language-switch select {
  height: 38px;
  border-color: rgba(203,213,225,.92);
  background: rgba(255,255,255,.92);
}

.auth-language-switch span {
  display: none;
}

.auth-language-switch select {
  min-width: 96px;
  height: 30px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.visual-settings {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.visual-settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 95;
  display: none;
  width: 286px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}

.visual-settings.open .visual-settings-panel {
  display: block;
}

.visual-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.visual-panel-head strong {
  display: block;
  font-size: 13px;
  line-height: 1.1;
}

.visual-panel-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.visual-field {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.visual-field label,
.visual-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.visual-field select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-family: var(--app-font);
  font-size: 12px;
  font-weight: 700;
}

.accent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.accent-option {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 54px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #fff;
  color: var(--muted-strong);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.accent-option:hover,
.accent-option.active {
  border-color: rgba(var(--primary-rgb), .42);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), .16), 0 8px 22px rgba(var(--primary-rgb), .10);
}

.accent-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.08);
}

.accent-blue { background: #0f4ad7; }
.accent-red { background: #c9302c; }
.accent-gray { background: #475569; }
.accent-green { background: #087443; }

.visual-reset {
  width: 100%;
  margin-top: 11px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--muted-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.visual-reset:hover {
  color: var(--primary);
  border-color: rgba(var(--primary-rgb), .38);
}

.auth-visual-toggle {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-tools .visual-settings-panel {
  top: calc(100% + 8px);
  right: -2px;
}

.module-actions .tabs {
  margin-top: 0;
}

.module-actions form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.module-actions .btn-primary,
.module-actions .btn-secondary,
.module-actions .btn-danger {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.module-actions select,
.module-actions input {
  width: auto;
  min-width: 128px;
  height: 32px;
  margin: 0;
  font-size: 12px;
}

.app-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.app-tab {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.app-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.app-tab-panel {
  display: none;
}

.app-tab-panel.active {
  display: block;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.34);
}

.app-modal.show {
  display: flex;
}

.app-modal-card {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
  padding: 16px;
}

.product-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 56px 1fr;
}

.product-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 18% 0%, rgba(59,130,246,.18), transparent 34%),
    linear-gradient(100deg, #070d18 0%, #111c31 48%, #07111f 100%);
  backdrop-filter: blur(18px);
  color: #fff;
}

.product-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 260px;
}

.product-brand strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.product-brand span,
.product-user {
  color: #9aa8bd;
  font-size: 12px;
}

.top-menu {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.top-menu a,
.top-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c3ccda;
  text-decoration: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.top-menu a:hover,
.top-menu a.active,
.top-menu button:hover {
  background: #fff;
  color: #07111f;
  box-shadow: 0 1px 5px rgba(15,23,42,.08);
}

.product-body {
  display: grid;
  grid-template-columns: 238px minmax(0,1fr);
  min-height: calc(100vh - 56px);
}

.product-sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  padding: 14px 12px;
  border-right: 1px solid #d9e2ef;
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--primary-rgb), .16), transparent 32%),
    linear-gradient(180deg, #091426 0%, #101827 58%, #07111f 100%);
  backdrop-filter: blur(12px);
  color: #dce5f2;
}

.side-section-label {
  padding: 8px 10px;
  color: #7f90a8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.side-primary-action {
  padding: 0 4px 12px;
}

.sidebar-primary-btn {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-soft) 100%);
  color: #07111f;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), .20);
}

.sidebar-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(var(--primary-rgb), .28);
}

.sidebar-primary-btn .nav-icon {
  width: 16px;
  height: 16px;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  color: #c7d1e0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.side-tree {
  position: relative;
  margin: -2px 0 8px 19px;
  padding: 3px 0 0 18px;
}

.side-tree::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  bottom: 13px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(148,163,184,.38), rgba(148,163,184,.06));
}

.side-tree-item {
  position: relative;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 0;
  color: #aebbd0;
  text-decoration: none;
  font-size: 11px;
  font-weight: 750;
  border-radius: 13px;
}

.side-tree-item .tree-branch {
  position: absolute;
  left: -18px;
  top: 16px;
  width: 16px;
  height: 1px;
  background: rgba(148,163,184,.38);
}

.side-tree-item .tree-node {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  border: 2px solid rgba(var(--primary-rgb), .70);
  background: #0f1b2d;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .10);
}

.side-tree-item .tree-label {
  min-width: 0;
  flex: 1;
}

.side-tree-item strong {
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 10px;
  border: 1px solid rgba(255,255,255,.08);
}

.side-tree-item.active,
.side-tree-item:hover {
  color: #fff;
}

.side-tree-item.active .tree-node,
.side-tree-item:hover .tree-node {
  background: rgb(var(--primary-rgb));
  border-color: rgba(255,255,255,.82);
  box-shadow: 0 0 0 5px rgba(var(--primary-rgb), .18);
}

.side-tree-item.active strong,
.side-tree-item:hover strong {
  background: rgba(var(--primary-rgb), .26);
  border-color: rgba(var(--primary-rgb), .34);
}

.side-nav a:hover,
.side-nav a.active {
  background: linear-gradient(90deg, rgba(var(--primary-rgb), .24), rgba(255,255,255,.075));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.side-nav-secondary a {
  min-height: 32px;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-session {
  display: grid;
  gap: 4px;
  padding: 10px;
  color: #c7d1e0;
  font-size: 12px;
}

.sidebar-session strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.sidebar-session span {
  color: #94a3b8;
}

.top-exit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-menu .nav-icon {
  width: 15px;
  height: 15px;
}

.product-main {
  min-width: 0;
  padding: 18px 22px 30px;
}

.editorial-marquee {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid #d8e3ff;
  border-radius: 14px;
  background: linear-gradient(90deg, #ffffff 0%, #eef5ff 100%);
  color: var(--ink);
}

.editorial-marquee strong {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-right: 1px solid #d8e3ff;
  color: var(--primary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(255,255,255,.72);
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.marquee-track {
  min-width: 0;
  white-space: normal;
  animation: none;
  font-size: 13px;
  color: var(--muted-strong);
  line-height: 1.45;
  padding: 9px 12px 9px 0;
}

@keyframes newsroom-marquee {
  0% { transform: translateX(25%); }
  100% { transform: translateX(-100%); }
}

.monitor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 14px;
  align-items: stretch;
}

.feed-tabs,
.workflow-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.workflow-tabs {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe;
}

.workflow-panel {
  display: none;
  padding: 14px;
}

.workflow-panel.active {
  display: block;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.template-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
}

.app-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast[data-type="err"] {
  background: var(--err);
}

a { color: var(--primary); }

.shell {
  max-width: 1840px;
  margin: 0 auto;
  padding: 16px 18px 32px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.brand {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 7px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-btn,
.ghost-btn,
.text-btn,
.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: border-color .14s ease, background .14s ease, transform .14s ease, box-shadow .14s ease;
}

.nav-btn:hover,
.ghost-btn:hover,
.text-btn:hover,
.small-btn:hover {
  border-color: #c0cadb;
  background: #fff;
  transform: translateY(-1px);
}

.small-btn {
  height: 32px;
  font-size: 12px;
  padding: 0 10px;
}

.btn-primary,
.btn-danger,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease, background .14s ease;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-danger {
  background: #d92d20;
  border-color: #d92d20;
  color: #fff;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: .56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel-pad,
.card-pad {
  padding: 16px;
}

.section-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.section-subtitle,
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.flash {
  margin: 8px 0 14px;
  font-size: 13px;
  font-weight: 700;
}

.flash.ok { color: var(--ok); }
.flash.warn { color: var(--warn); }
.flash.err { color: var(--err); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 460px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.summary-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 12px;
}

.summary-label {
  color: #728099;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.summary-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.summary-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control,
select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

textarea { resize: vertical; }

label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.field { margin-bottom: 12px; }

.field:last-child { margin-bottom: 0; }

.field-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ops-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ops-card {
  padding: 14px;
}

.ops-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.ops-table th,
.ops-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  background: #fff;
}

.ops-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .06em;
  background: #f9fbfd;
}

.ops-table td {
  overflow-wrap: anywhere;
}

.nowrap {
  white-space: nowrap;
}

.module-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.compact-form {
  display: grid;
  gap: 9px;
}

.field-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mail-shell {
  overflow: hidden;
}

.mail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 10px;
}

.mail-body {
  border-top: 1px solid var(--line-soft);
  background: var(--surface-strong);
}

.table-wrap {
  overflow: auto;
  border-top: 1px solid var(--line-soft);
}

.mail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.mail-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f9fbfd;
  color: #6b778d;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.mail-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink);
}

.mail-table tbody tr {
  transition: background .14s ease, box-shadow .14s ease;
}

.mail-table tbody tr:hover {
  background: #fbfcff;
}

.mail-table tbody tr:last-child td {
  border-bottom: 0;
}

.mail-row-link {
  text-decoration: none;
  color: inherit;
}

.title-cell {
  font-family: var(--display-font);
  font-size: 16px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.title-cell.compact {
  font-size: 14px;
}

.subline {
  margin-top: 4px;
  color: #7a8598;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.badge-neutral,
.status.pending {
  background: #f3f5f8;
  color: #475467;
  border-color: #e6e9ef;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #d6e4ff;
}

.status.verified,
.status.approval-none,
.status.approval-approved {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: #ccefdc;
}

.status.caution,
.status.approval-requested {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: #f7e3b0;
}

.status.rejected,
.status.approval-rejected {
  background: var(--err-soft);
  color: var(--err);
  border-color: #f7c6c2;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  background: #f3f5f8;
  color: #475467;
  vertical-align: middle;
}

.status-icon.pending {
  background: #f3f5f8;
  color: #667085;
  border-color: #e6e9ef;
}

.status-icon.verified,
.status-icon.approval-none,
.status-icon.approval-approved {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: #ccefdc;
}

.status-icon.caution,
.status-icon.approval-requested {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: #f7e3b0;
}

.status-icon.rejected,
.status-icon.approval-rejected {
  background: var(--err-soft);
  color: var(--err);
  border-color: #f7c6c2;
}

.status-box {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
  text-align: center;
}

.status-box .label {
  display: block;
  margin-bottom: 6px;
  color: #758198;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.online-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 4px;
  border-radius: 50%;
  background: #98a2b3;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
  vertical-align: middle;
}

.online-dot.online {
  background: #12b76a;
  animation: pulse-online 1.8s ease-in-out infinite;
}

.online-dot.offline {
  background: #98a2b3;
}

@keyframes pulse-online {
  0% { opacity: .95; box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.55); }
  70% { opacity: .55; box-shadow: 0 0 0 8px rgba(18, 183, 106, 0.05); }
  100% { opacity: .95; box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}

.alerts-wrap { position: relative; display: flex; align-items: center; }

.alerts-toggle {
  width: 38px;
  min-width: 38px;
  padding: 0;
  position: relative;
}

.alerts-count {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
}

.alerts-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 380px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(15, 23, 40, 0.12);
  padding: 8px;
  z-index: 1200;
  display: none;
}

.alerts-dropdown.show { display: block; }

.alerts-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.alerts-readall {
  width: auto;
  margin: 0;
}

.alert-item {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid #e6e9ef;
  border-radius: var(--radius-md);
  padding: 10px 11px;
  margin-bottom: 8px;
  background: #fff;
  transition: box-shadow .12s ease, border-color .12s ease, transform .12s ease;
}

.alert-item:hover {
  border-color: #cdd8ec;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.alert-item.unread {
  border-color: #cad8ff;
  background: #f6f9ff;
}

.alert-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.alert-msg {
  font-size: 12px;
  color: #344054;
  margin-bottom: 4px;
}

.alert-time {
  font-size: 11px;
  color: #7a8598;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.34);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.show { display: flex; }

.modal-card {
  width: min(760px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  padding: 20px;
}

.modal-card.narrow { width: min(540px, 92vw); }

.modal-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 4px solid #dbe8ff;
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.editor-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.editor-sidebar {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 12px;
}

.sidebar-card,
.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.sidebar-card { padding: 14px; }
.content-card { overflow: hidden; }

.content-card .content-pad { padding: 16px; }

.headline {
  margin: 0;
  font-family: var(--display-font);
  font-size: 38px;
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #728099;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
}

.meta-table td {
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
  vertical-align: top;
  font-size: 13px;
}

.meta-table tr:first-child td {
  border-top: 0;
}

.meta-table td:first-child {
  width: 180px;
  color: #667085;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 700;
  padding-right: 14px;
}

.stack {
  display: grid;
  gap: 14px;
}

.content-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.story-box {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
}

.story-box .box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe;
}

.story-box .box-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.story-box .box-body {
  padding: 14px;
}

.plain-text,
.readonly-text {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.68;
  color: var(--ink);
}

.readonly-text {
  min-height: 180px;
}

.comment-list,
.timeline-list,
.revision-list {
  display: grid;
  gap: 10px;
}

.feed-item,
.timeline-item,
.revision-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
}

.item-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.legal {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #dbe0ea;
  color: #667085;
  font-size: 12px;
  text-align: center;
  line-height: 1.45;
}

.centered-footer {
  max-width: 1840px;
  margin: 0 auto;
  padding: 0 18px 24px;
}

@media (max-width: 1320px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .product-topbar {
    position: static;
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
  }

  .top-menu {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .product-body {
    grid-template-columns: 1fr;
  }

  .product-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .monitor-grid,
  .step-grid {
    grid-template-columns: 1fr;
  }

  .app-frame {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .editor-layout,
  .ops-grid {
    grid-template-columns: 1fr;
  }

  .module-actionbar {
    grid-template-columns: 1fr;
  }

  .module-actions {
    justify-content: flex-start;
  }

  .editor-sidebar {
    position: static;
  }

  .content-grid-2,
  .field-grid-2,
  .field-grid-3,
  .row-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 16px 14px 28px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .actions {
    justify-content: flex-start;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .headline {
    font-size: 32px;
  }

  .brand h1 {
    font-size: 24px;
  }
}

/* Product shell refresh: one consistent application frame for every module. */
body.product-ui {
  background:
    radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.10), transparent 360px),
    linear-gradient(180deg, #eef3f9 0%, #f8fafc 48%, #f3f6fb 100%);
  font-size: 13px;
}

body.product-ui .product-shell {
  grid-template-rows: 58px 1fr;
}

body.product-ui .product-topbar {
  background: linear-gradient(90deg, #07111f 0%, #101b2d 58%, #0b1320 100%);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16);
}

body.product-ui .product-sidebar {
  border-right: 1px solid rgba(148, 163, 184, .22);
  background:
    linear-gradient(180deg, #0b1627 0%, #101827 100%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04);
}

body.product-ui .product-main {
  padding: 18px 20px 28px;
}

body.product-ui .embedded-shell,
body.product-ui .shell {
  max-width: none;
  padding: 0;
}

body.product-ui .panel,
body.product-ui .content-card,
body.product-ui .sidebar-card,
body.product-ui .story-box,
body.product-ui .ops-card {
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.055);
}

body.product-ui .mail-header,
body.product-ui .box-head {
  background: transparent;
}

body.product-ui .mail-table,
body.product-ui .ops-table,
body.product-ui .users-table {
  font-size: 12px;
}

body.product-ui .mail-table th,
body.product-ui .ops-table th,
body.product-ui .users-table th {
  color: #64748b;
  background: #f8fafc;
  font-size: 10px;
  letter-spacing: .07em;
}

body.product-ui .mail-table td,
body.product-ui .ops-table td,
body.product-ui .users-table td {
  border-bottom-color: #e8edf5;
}

body.product-ui .title-cell {
  font-family: var(--display-font);
  font-size: 15px;
  line-height: 1.18;
  font-weight: 700;
}

body.product-ui .title-cell.compact {
  font-size: 13px;
}

body.product-ui .headline {
  font-size: clamp(28px, 3vw, 46px);
  line-height: .98;
}

body.product-ui .editor-layout {
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 14px;
}

body.product-ui .editor-sidebar {
  top: 74px;
}

body.product-ui .source-body {
  max-height: 360px;
  overflow: auto;
}

body.product-ui .editor-textarea {
  min-height: 220px;
  max-height: 420px;
  resize: vertical;
}

body.product-ui .workflow-tabs {
  position: sticky;
  top: 58px;
  z-index: 20;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
}

body.product-ui .app-topbar {
  align-items: center;
}

body.product-ui .module-actionbar {
  background: rgba(255, 255, 255, .9);
}

body.product-ui .app-title h1 {
  font-size: 22px;
}

body.product-ui .centered-footer,
body.product-ui .footer-shell {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
