[hidden] { display: none !important; }

:root {
  color-scheme: light;
  --ink: #2d2d2d;
  --muted: #737373;
  --soft: #9a8dae;
  --line: #e0d5f0;
  --surface: #ffffff;
  --surface-soft: #f5f0ff;
  --page: #f5f0ff;
  --nav: #ffffff;
  --nav-soft: #ede4ff;
  --accent: #7b2fbe;
  --accent-dark: #6b28a6;
  --cyan-soft: #e7fbfc;
  --purple: #7b2fbe;
  --magenta: #ff6b9d;
  --coral: #ff7043;
  --gold: #ffc857;
  --warning: #b86615;
  --danger: #b42318;
  --blue: #00c4cc;
  --grid-rgb: 123, 47, 190;
  --page-top: #ffffff;
  --page-end: #f5f0ff;
  --button-hover: #6b28a6;
  --nav-glow: rgba(123, 47, 190, 0.08);
  --brand-glow: rgba(123, 47, 190, 0.2);
  --nav-ink: var(--ink);
  --nav-muted: var(--muted);
  --nav-active: var(--accent-dark);
  --glow-a: 255, 107, 157;
  --glow-b: 0, 196, 204;
  --shadow-sm: 0 2px 8px rgba(45, 45, 45, 0.08);
  --shadow-md: 0 8px 24px rgba(45, 45, 45, 0.12);
  --shadow-lg: 0 18px 48px rgba(45, 45, 45, 0.15);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-theme="sky"] {
  --ink: #10263c;
  --muted: #5c748f;
  --soft: #8ba4b8;
  --line: #cfe2f5;
  --surface-soft: #f5fbff;
  --page: #eef8ff;
  --nav: #123451;
  --nav-soft: #1d4c73;
  --accent: #3ab7ff;
  --accent-dark: #146da3;
  --cyan-soft: #e2f6ff;
  --purple: #6d7df7;
  --gold: #f5c84b;
  --warning: #bd6c20;
  --blue: #226fd6;
  --grid-rgb: 58, 183, 255;
  --page-top: #ffffff;
  --page-end: #e4f3ff;
  --button-hover: #68c9ff;
  --nav-glow: rgba(58, 183, 255, 0.12);
  --brand-glow: rgba(58, 183, 255, 0.26);
  --nav-ink: #f4fbff;
  --nav-muted: #b8d4e8;
  --nav-active: #ffffff;
  --glow-a: 58, 183, 255;
  --glow-b: 109, 125, 247;
}

body[data-theme="emerald"] {
  --ink: #132820;
  --muted: #60776f;
  --soft: #90a59e;
  --line: #d3e6dc;
  --surface-soft: #f5fcf8;
  --page: #f0faf5;
  --nav: #143329;
  --nav-soft: #1f4a3c;
  --accent: #31c58d;
  --accent-dark: #177352;
  --cyan-soft: #e2f8ee;
  --purple: #5277dd;
  --gold: #f1c84d;
  --warning: #b96e22;
  --blue: #2d75bd;
  --grid-rgb: 49, 197, 141;
  --page-top: #ffffff;
  --page-end: #e5f5ed;
  --button-hover: #55d4a3;
  --nav-glow: rgba(49, 197, 141, 0.12);
  --brand-glow: rgba(49, 197, 141, 0.24);
  --nav-ink: #f3fff9;
  --nav-muted: #b8d9cc;
  --nav-active: #ffffff;
  --glow-a: 49, 197, 141;
  --glow-b: 82, 119, 221;
}

body[data-theme="violet"] {
  --ink: #211d36;
  --muted: #6e6687;
  --soft: #9a92ae;
  --line: #ddd8f2;
  --surface-soft: #fbf9ff;
  --page: #f5f2ff;
  --nav: #251f45;
  --nav-soft: #342b62;
  --accent: #8b7cff;
  --accent-dark: #5748c7;
  --cyan-soft: #f0edff;
  --purple: #8b7cff;
  --gold: #f1c84d;
  --warning: #b86c20;
  --blue: #406fce;
  --grid-rgb: 139, 124, 255;
  --page-top: #ffffff;
  --page-end: #ece8fb;
  --button-hover: #a094ff;
  --nav-glow: rgba(139, 124, 255, 0.13);
  --brand-glow: rgba(139, 124, 255, 0.25);
  --nav-ink: #f7f5ff;
  --nav-muted: #c7c1e2;
  --nav-active: #ffffff;
  --glow-a: 139, 124, 255;
  --glow-b: 111, 104, 217;
}

body[data-theme="gold"] {
  --ink: #2b2517;
  --muted: #776b54;
  --soft: #a89b81;
  --line: #eadfca;
  --surface-soft: #fffdf7;
  --page: #fbf6e8;
  --nav: #342918;
  --nav-soft: #4b3a20;
  --accent: #f2c94c;
  --accent-dark: #9b6917;
  --cyan-soft: #fff5cf;
  --purple: #6f68d9;
  --gold: #f2c94c;
  --warning: #b86718;
  --blue: #336db3;
  --grid-rgb: 242, 201, 76;
  --page-top: #fffef9;
  --page-end: #f5ecd1;
  --button-hover: #f7d76f;
  --nav-glow: rgba(242, 201, 76, 0.14);
  --brand-glow: rgba(242, 201, 76, 0.28);
  --nav-ink: #fffaf0;
  --nav-muted: #d8c9a8;
  --nav-active: #ffffff;
  --glow-a: 242, 201, 76;
  --glow-b: 188, 128, 49;
}

body[data-theme="mono"] {
  --ink: #171717;
  --muted: #66645f;
  --soft: #96938c;
  --line: #deddd8;
  --surface-soft: #f5f5f2;
  --page: #efefeb;
  --nav: #171717;
  --nav-soft: #2b2b2a;
  --accent: #252525;
  --accent-dark: #080808;
  --cyan-soft: #eeeeea;
  --purple: #353535;
  --magenta: #76716b;
  --coral: #7e563d;
  --gold: #a98c56;
  --warning: #805c22;
  --blue: #465a68;
  --grid-rgb: 37, 37, 37;
  --page-top: #fbfbfa;
  --page-end: #e8e8e3;
  --button-hover: #000000;
  --nav-glow: rgba(255, 255, 255, 0.05);
  --brand-glow: rgba(255, 255, 255, 0.16);
  --nav-ink: #f7f7f4;
  --nav-muted: #b8b7b2;
  --nav-active: #ffffff;
  --glow-a: 40, 40, 40;
  --glow-b: 150, 145, 135;
}

body[data-theme="navy"] {
  --ink: #15253b;
  --muted: #64748b;
  --soft: #94a3b8;
  --line: #d8e1eb;
  --surface-soft: #f3f7fb;
  --page: #edf3f8;
  --nav: #10243d;
  --nav-soft: #1b395c;
  --accent: #1f6feb;
  --accent-dark: #174ea6;
  --cyan-soft: #e5f5fb;
  --purple: #5b62d6;
  --magenta: #d45788;
  --coral: #e36f4f;
  --gold: #d6a73a;
  --warning: #ad681c;
  --blue: #1f6feb;
  --grid-rgb: 31, 111, 235;
  --page-top: #fbfdff;
  --page-end: #e5edf5;
  --button-hover: #1557b0;
  --nav-glow: rgba(67, 142, 225, 0.13);
  --brand-glow: rgba(104, 177, 255, 0.22);
  --nav-ink: #f4f8fc;
  --nav-muted: #afc1d4;
  --nav-active: #ffffff;
  --glow-a: 31, 111, 235;
  --glow-b: 77, 160, 184;
}

body[data-theme="mist"] {
  --ink: #263640;
  --muted: #6a7c86;
  --soft: #95a4ac;
  --line: #d6e0e4;
  --surface-soft: #f4f8f9;
  --page: #edf3f4;
  --nav: #f8fbfb;
  --nav-soft: #dce9eb;
  --accent: #628b99;
  --accent-dark: #3e6673;
  --cyan-soft: #e1eff1;
  --purple: #6d789a;
  --magenta: #ad7084;
  --coral: #b9735b;
  --gold: #b79755;
  --warning: #9a6428;
  --blue: #557a91;
  --grid-rgb: 98, 139, 153;
  --page-top: #fcfefe;
  --page-end: #e5edef;
  --button-hover: #789eaa;
  --nav-glow: rgba(98, 139, 153, 0.09);
  --brand-glow: rgba(98, 139, 153, 0.2);
  --nav-ink: var(--ink);
  --nav-muted: var(--muted);
  --nav-active: var(--accent-dark);
  --glow-a: 98, 139, 153;
  --glow-b: 109, 120, 154;
}

body[data-theme="terracotta"] {
  --ink: #372923;
  --muted: #806d64;
  --soft: #aa978d;
  --line: #eadbd3;
  --surface-soft: #fcf7f3;
  --page: #f8f0eb;
  --nav: #402b25;
  --nav-soft: #5b3c33;
  --accent: #c66549;
  --accent-dark: #93452f;
  --cyan-soft: #f5e8df;
  --purple: #7d6c8d;
  --magenta: #c86f78;
  --coral: #d86b4b;
  --gold: #ca9b4a;
  --warning: #a66124;
  --blue: #587d91;
  --grid-rgb: 198, 101, 73;
  --page-top: #fffdfb;
  --page-end: #f2e5dd;
  --button-hover: #d5795e;
  --nav-glow: rgba(198, 101, 73, 0.13);
  --brand-glow: rgba(230, 139, 111, 0.24);
  --nav-ink: #fff8f4;
  --nav-muted: #d9beb4;
  --nav-active: #ffffff;
  --glow-a: 198, 101, 73;
  --glow-b: 202, 155, 74;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 8%, rgba(var(--glow-a), 0.14), transparent 28%),
    radial-gradient(circle at 84% 0%, rgba(var(--glow-b), 0.13), transparent 30%),
    linear-gradient(180deg, var(--page-top) 0%, var(--page) 55%, var(--page-end) 100%);
  background-size: auto;
  color: var(--ink);
  font-family:
    "Canva Sans", Circular, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(var(--grid-rgb), 0.1), transparent 34%),
    var(--nav);
  color: var(--nav-ink);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 12px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  padding: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(124, 58, 237, 0.14);
  box-shadow: 0 0 24px var(--brand-glow);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  letter-spacing: 0;
}

.brand span,
.account-card label,
.account-card span {
  color: var(--nav-muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 9px 10px;
  color: var(--nav-ink);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 700;
}

.nav-item.active,
.nav-item:hover {
  background: var(--nav-soft);
  color: var(--nav-active);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm);
}

.nav-icon,
.btn-icon {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
}

.nav-icon {
  background: rgba(var(--grid-rgb), 0.16);
  color: currentColor;
}

.account-card {
  width: 100%;
  min-width: 0;
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(var(--grid-rgb), 0.08), rgba(255, 255, 255, 0) 48%),
    #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.account-card select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  color: #ffffff;
  background: var(--nav-soft);
}

.account-card label,
.account-card span {
  color: var(--muted);
}

.maker-box {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(123, 47, 190, 0.1), rgba(255, 107, 157, 0.08));
}

.maker-title {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.maker-logo-link {
  display: block;
  width: min(100%, 148px);
  justify-self: center;
  border-radius: 12px;
  overflow: hidden;
}

.maker-logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2383 / 860;
  object-fit: contain;
}

.maker-site {
  line-height: 1;
}

.maker-version {
  line-height: 1;
}

.maker-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.maker-box span,
.maker-contact strong {
  color: var(--muted);
  font-size: 12px;
}

.maker-box a:not(.maker-logo-link),
.support-panel a {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.maker-box a:not(.maker-logo-link):hover,
.support-panel a:hover {
  text-decoration: underline;
}

.maker-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(123, 47, 190, 0.14);
}

.maker-contact a,
.maker-contact strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.support-panel {
  gap: 12px;
  padding: 28px;
  border-color: rgba(123, 47, 190, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(123, 47, 190, 0.04), rgba(255, 255, 255, 0) 38%),
    #ffffff;
}

.support-brand {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.support-logo-link {
  display: block;
}

.support-logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.support-brand h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.support-brand span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.support-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 2px;
}

.support-contact-grid div {
  min-width: 0;
  min-height: 68px;
  padding: 14px 18px;
  border: 1px solid rgba(123, 47, 190, 0.16);
  border-radius: 18px;
  background: rgba(123, 47, 190, 0.07);
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.support-contact-grid span,
.support-contact-grid strong {
  display: block;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.support-contact-grid a,
.support-contact-grid strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.wechat-link {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(123, 47, 190, 0.18);
  border-radius: 9999px;
  padding: 6px 12px;
  background: #ffffff;
}

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

.local-stats span {
  min-width: 0;
  padding: 9px 8px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.local-stats strong {
  display: block;
  color: var(--accent-dark);
  font-size: 16px;
  line-height: 1.2;
}

.local-config-btn {
  width: 100%;
  min-height: 34px;
  border-color: rgba(123, 47, 190, 0.18);
  background: rgba(123, 47, 190, 0.08);
  color: var(--accent-dark);
}

.account-meta {
  display: grid;
  gap: 6px;
}

.account-meta span {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(123, 47, 190, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#syncStatus {
  color: var(--accent-dark);
  font-weight: 800;
}

.login-box {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(139, 235, 255, 0.16);
}

.login-box input {
  min-height: 34px;
  width: 100%;
  border: 1px solid rgba(139, 235, 255, 0.2);
  border-radius: 8px;
  padding: 7px 9px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.login-box input::placeholder {
  color: #a8d6df;
}

.login-box .btn {
  width: 100%;
  box-shadow: none;
}

.main {
  min-width: 0;
  padding: clamp(18px, 2.2vw, 32px);
}

.topbar {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1440px;
  margin: 0 auto 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.title-block {
  min-width: 240px;
}

.page-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.topbar p,
.section-bar p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.top-actions,
.toolbar,
.modal-actions,
.panel-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 540px;
}

.btn {
  min-height: 42px;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.link-btn:hover,
.icon-btn:hover,
.nav-item:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.link-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn.is-loading {
  border-color: rgba(123, 47, 190, 0.26);
  background: rgba(123, 47, 190, 0.09);
  color: var(--accent-dark);
  opacity: 1;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--button-hover);
}

.btn.secondary,
.btn.compact {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn.secondary:hover,
.btn.compact:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.btn.danger,
.btn.compact.danger {
  color: var(--danger);
  border-color: #f4b4ae;
  background: #fff6f5;
}

.btn.danger:hover,
.btn.compact.danger:hover {
  background: #fee4e2;
  border-color: #ee8b83;
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.compact {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.18);
}

.btn.secondary .btn-icon {
  background: #e7faff;
  color: var(--muted);
}

.view {
  display: none;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  padding-bottom: 44px;
}

.active-view {
  display: block;
  animation: none;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.pipeline-overview {
  margin-top: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

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

.pipeline-summary article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.pipeline-summary article.risk {
  border-color: rgba(255, 111, 61, 0.32);
  background: rgba(255, 111, 61, 0.07);
}

.pipeline-summary span,
.pipeline-summary strong,
.pipeline-summary small {
  display: block;
}

.pipeline-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pipeline-summary strong {
  margin: 5px 0;
  color: var(--ink);
  font-size: 24px;
}

.pipeline-summary small {
  color: var(--soft);
  font-size: 11px;
  line-height: 1.35;
}

.metric,
.panel,
.table-wrap,
.section-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.metric:hover,
.panel:hover,
.section-bar:hover {
  border-color: rgba(var(--grid-rgb), 0.26);
  box-shadow: var(--shadow-md);
}

.next-step {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(var(--grid-rgb), 0.11), rgba(var(--glow-b), 0.06) 42%, transparent),
    var(--surface);
  color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.next-step div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.next-step span {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 2px 8px;
  background: rgba(var(--grid-rgb), 0.1);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.next-step strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.next-step small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.next-step .btn {
  flex: 0 0 auto;
}

.metric {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: var(--line);
}

.metric-leads::before {
  background: var(--accent);
}

.metric-hot::before {
  background: var(--magenta);
}

.metric-draft::before {
  background: var(--blue);
}

.metric-sent::before {
  background: var(--coral);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  color: var(--accent-dark);
  line-height: 1;
}

.metric small {
  color: var(--soft);
  font-size: 12px;
}

.dashboard-grid,
.settings-grid,
.acquisition-grid,
.automation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 12px;
  margin-top: 12px;
}

.panel {
  padding: 18px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 13px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 15px 16px;
}

.priority-list,
.activity-log,
.draft-board,
.strategy-list,
.acquisition-results,
.queue-list,
.auto-send-summary {
  display: grid;
  gap: 10px;
}

.draft-board,
.acquisition-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.priority-item,
.activity-item,
.draft-card,
.discovery-card,
.queue-item,
.strategy-list div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.priority-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  align-items: center;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.queue-item strong,
.queue-item span,
.queue-item small {
  display: block;
}

.queue-item span,
.queue-item small {
  color: var(--muted);
  font-size: 13px;
}

.queue-item small {
  margin-top: 5px;
}

.queue-item.has-warning {
  background: #fff7f4;
  border-color: rgba(255, 112, 67, 0.28);
}

.auto-send-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.auto-send-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.auto-send-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.priority-item.enhanced {
  grid-template-columns: minmax(180px, 1fr) max-content max-content minmax(116px, max-content);
  column-gap: 10px;
}

.priority-item.enhanced > div:first-child,
.queue-item > div:first-child,
.draft-card header > div,
.discovery-card header > div,
.company-cell {
  min-width: 0;
}

.priority-item:hover,
.draft-card:hover,
.discovery-card:hover {
  border-color: rgba(123, 47, 190, 0.35);
  box-shadow: var(--shadow-sm);
}

.priority-item strong,
.priority-item span,
.activity-item span,
.draft-card span,
.discovery-card span,
.strategy-list span {
  display: block;
}

.priority-item span,
.activity-item,
.draft-card .meta,
.discovery-card span,
.strategy-list span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.priority-item strong,
.priority-item span,
.queue-item strong,
.queue-item span,
.queue-item small,
.draft-card h2,
.draft-card .meta,
.discovery-card h2,
.discovery-card span,
.company-cell strong,
.company-cell span,
td {
  overflow-wrap: anywhere;
}

.acquisition-results-head {
  margin-top: 12px;
}

.acquisition-summary {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.strategy-list div {
  padding: 12px;
}

.strategy-list strong {
  display: block;
  margin-bottom: 5px;
}

.discovery-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.acquisition-risk {
  grid-column: 1 / -1;
  margin-top: 0;
}

.discovery-card.is-muted {
  opacity: 0.62;
}

.discovery-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.discovery-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.line-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.discovery-meta {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.workflow-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-checks span {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid rgba(var(--grid-rgb), 0.18);
  border-radius: 9999px;
  background: rgba(var(--grid-rgb), 0.08);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.acquisition-funnel {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.acquisition-progress {
  grid-column: 1 / -1;
  border: 1px solid rgba(var(--grid-rgb), 0.18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(var(--grid-rgb), 0.07), rgba(255, 255, 255, 0) 52%),
    #ffffff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.progress-head {
  min-height: 68px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-head span,
.progress-item span,
.progress-item small {
  color: var(--muted);
  font-size: 12px;
}

.progress-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
}

.progress-head small {
  flex: 0 0 auto;
  border: 1px solid rgba(123, 47, 190, 0.16);
  border-radius: 9999px;
  padding: 5px 9px;
  background: rgba(123, 47, 190, 0.07);
  color: var(--accent-dark);
  font-weight: 900;
}

.progress-log {
  max-height: 260px;
  overflow: auto;
  display: grid;
}

.progress-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: start;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(123, 47, 190, 0.09);
}

.progress-item:last-child {
  border-bottom: 0;
}

.progress-item.is-active {
  background: rgba(0, 194, 255, 0.07);
}

.progress-item strong,
.progress-item small {
  display: block;
}

.progress-item strong {
  color: var(--ink);
  font-size: 13px;
}

.progress-item small {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.progress-item em {
  align-self: center;
  min-width: 48px;
  border-radius: 9999px;
  padding: 4px 8px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.risk-flags span {
  border-color: rgba(255, 112, 67, 0.25);
  background: rgba(255, 112, 67, 0.08);
  color: #9d3f1d;
}

.score {
  width: clamp(38px, 4.2vw, 48px);
  min-height: 30px;
  border-radius: 9999px;
  display: inline-grid;
  place-items: center;
  background: var(--cyan-soft);
  color: #12666a;
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.activity-log {
  max-height: 338px;
  overflow: auto;
  padding-right: 2px;
}

.activity-item {
  position: relative;
  padding: 10px 12px 10px 28px;
}

.activity-item strong,
.activity-item small {
  display: block;
}

.activity-item strong {
  color: var(--ink);
  font-size: 12px;
  margin-bottom: 3px;
}

.activity-item small {
  margin-top: 5px;
  color: var(--soft);
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.bulk-action-bar {
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(123, 47, 190, 0.2);
  border-radius: 16px;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.bulk-action-bar strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.search-box {
  min-width: min(440px, 100%);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 0 12px;
}

.search-box span {
  color: var(--soft);
  font-weight: 900;
}

.search-box input {
  min-height: 40px;
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}

.toolbar select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  background: var(--surface);
  color: var(--ink);
}

.toolbar select {
  width: auto;
  min-width: 142px;
  min-height: 40px;
  background: #ffffff;
}

.secret-input {
  -webkit-text-security: disc;
}

.table-wrap {
  overflow: auto;
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-soft);
  font-weight: 900;
}

tbody tr {
  background: var(--surface);
}

tbody tr:hover {
  background: rgba(var(--grid-rgb), 0.055);
}

tbody tr.is-selected {
  background: var(--surface-soft);
}

tbody tr.is-overdue .company-cell strong::after {
  content: "待跟进";
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 9999px;
  background: #fff2ed;
  color: var(--coral);
  font-size: 11px;
  font-weight: 900;
}

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

th,
td {
  overflow-wrap: normal;
}

td:nth-last-child(-n + 5),
th:nth-last-child(-n + 5) {
  white-space: nowrap;
}

.company-cell strong,
.company-cell span {
  overflow-wrap: anywhere;
}

.contact-cell strong,
.contact-cell > span,
.next-action-cell strong,
.next-action-cell span,
.outreach-status,
.score-stack strong,
.score-stack span {
  display: block;
}

.contact-cell strong,
.next-action-cell strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12px;
}

.contact-cell > span,
.next-action-cell span,
.outreach-status,
.score-stack span {
  color: var(--muted);
  font-size: 11px;
}

.next-action-cell {
  min-width: 190px;
  white-space: normal !important;
}

.score-stack {
  min-width: 76px;
}

.score-stack strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.outreach-status {
  margin-top: 5px;
}

.select-col {
  width: 44px;
  text-align: center;
}

.select-col input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.company-cell strong,
.company-cell span {
  display: block;
}

.company-cell strong {
  margin-bottom: 3px;
}

.company-cell span {
  color: var(--muted);
  font-size: 12px;
}

.lead-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.lead-issues span,
.email-warning {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 9999px;
  padding: 2px 7px;
  color: #9d3f1d;
  background: #fff2ed;
  font-size: 11px;
  font-weight: 900;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-width: clamp(56px, 6.2vw, 78px);
  min-height: 28px;
  border-radius: 9999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  background: #eef1f4;
  color: var(--muted);
}

.status.new {
  background: var(--surface-soft);
  color: var(--accent-dark);
}

.status.drafted {
  background: #f0edff;
  color: var(--accent-dark);
}

.status.approved {
  background: #fff0f6;
  color: #b82763;
}

.status.sent {
  background: var(--cyan-soft);
  color: #12666a;
}

.status.replied {
  background: #fff2ed;
  color: #9d3f1d;
}

.status.blocked {
  background: #fee4e2;
  color: var(--danger);
}

.status.verified,
.status.contacted {
  background: var(--cyan-soft);
  color: #12666a;
}

.status.meeting,
.status.proposal,
.status.opportunity {
  background: #f0edff;
  color: var(--accent-dark);
}

.status.won {
  background: #e6f8ed;
  color: #187245;
}

.status.lost,
.status.disqualified {
  background: #fee4e2;
  color: var(--danger);
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.priority-item .row-actions,
.queue-item .row-actions {
  justify-content: flex-end;
}

.link-btn {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 9999px;
  color: var(--accent-dark);
  background: transparent;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.link-btn:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}

.link-btn.primary-action {
  border-color: rgba(123, 47, 190, 0.18);
  background: var(--surface-soft);
}

.link-btn.danger {
  color: var(--danger);
}

.link-btn.danger:hover {
  border-color: #f4b4ae;
  background: #fff1f0;
}

.row-menu {
  position: relative;
}

.row-menu summary {
  list-style: none;
}

.row-menu summary::-webkit-details-marker {
  display: none;
}

.row-menu summary::after {
  content: "v";
  margin-left: 6px;
  color: var(--soft);
  font-size: 10px;
}

.row-menu[open] summary {
  background: var(--surface-soft);
  border-color: var(--line);
}

.row-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 4;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.menu-action {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 10px;
  padding: 6px 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.menu-action:hover {
  background: var(--surface-soft);
}

.menu-action.danger {
  color: var(--danger);
}

.menu-action.danger:hover {
  background: #fff1f0;
}

.draft-card {
  padding: 15px;
  display: grid;
  gap: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.draft-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.draft-card pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 14px;
  line-height: 1.58;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
}

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

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-grid textarea {
  resize: vertical;
}

#draftBody {
  min-height: 320px;
  line-height: 1.55;
}

.wide {
  grid-column: 1 / -1;
}

.settings-grid .panel > h2 {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.check-list {
  display: grid;
  gap: 11px;
}

.theme-picker {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.theme-picker select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(var(--grid-rgb), 0.12), transparent 38%),
    var(--surface);
}

.theme-picker::after {
  content: "切换后自动保存，下次打开继续使用";
  color: var(--soft);
  font-size: 11px;
  font-weight: 600;
}

.check-list label {
  min-height: 38px;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.check-list input {
  accent-color: var(--accent);
}

.notice {
  margin-top: 14px;
  border-radius: 16px;
  padding: 13px;
  display: grid;
  gap: 6px;
  background: #fff7f4;
  color: #7d3419;
  border: 1px solid rgba(255, 112, 67, 0.24);
}

.config-checklist,
.wizard-steps {
  display: grid;
  gap: 10px;
}

.config-modal {
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.config-checklist {
  margin-bottom: 12px;
}

.config-checklist span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.config-checklist strong {
  color: var(--ink);
}

.config-checklist .is-ready strong {
  color: var(--accent-dark);
}

.config-checklist .is-missing strong {
  color: var(--warning);
}

#configDialog {
  width: min(860px, calc(100vw - 28px));
}

.wizard-steps section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.wizard-steps h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.field-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.field-actions .muted {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-dir-structure {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
}

.recommended-dir {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(123, 47, 190, 0.2);
  border-radius: 16px;
  background: var(--surface-soft);
}

.recommended-dir strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.recommended-dir span {
  color: var(--muted);
  font-size: 13px;
}

.advanced-dir {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.advanced-dir summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.advanced-dir .form-grid {
  margin-top: 10px;
}

.data-dir-structure code {
  color: var(--ink);
  overflow-wrap: anywhere;
}

dialog {
  width: min(780px, calc(100vw - 28px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  animation: dialog-in 0.2s ease-out;
}

dialog::backdrop {
  background: rgba(20, 24, 30, 0.48);
  backdrop-filter: blur(5px);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  padding: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.development-modal {
  width: min(820px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
}

.development-content {
  display: grid;
  gap: 14px;
}

.development-content section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.development-content h3 {
  margin: 0 0 10px;
}

.development-content p,
.development-content ul {
  margin: 6px 0 0;
  line-height: 1.65;
}

.development-risks {
  border-color: rgba(255, 111, 61, 0.32) !important;
  background: rgba(255, 111, 61, 0.07) !important;
}

.decision-modal {
  display: grid;
  gap: 14px;
}

.decision-message {
  color: var(--ink);
  line-height: 1.55;
}

.decision-details {
  display: none;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.decision-details:not(:empty) {
  display: grid;
}

.decision-details strong {
  color: var(--ink);
}

.decision-details ul {
  margin: 0;
  padding-left: 18px;
}

.decision-details li + li {
  margin-top: 4px;
}

.decision-modal.is-danger #decisionConfirmBtn {
  color: #ffffff;
  background: var(--danger);
}

.decision-modal.is-danger #decisionConfirmBtn:hover {
  background: #8f1d14;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.empty strong,
.empty span {
  display: block;
}

.empty strong {
  color: var(--ink);
  margin-bottom: 6px;
}

.action-empty {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.email-warning {
  display: inline-flex;
  margin-top: 4px;
}

.check-inline {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px !important;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease-spring), transform 0.2s var(--ease-spring);
}

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

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .priority-item.enhanced {
    grid-template-columns: minmax(0, 1fr) max-content max-content;
  }

  .priority-item.enhanced .row-actions {
    grid-column: 1 / -1;
  }

  .draft-board,
  .acquisition-results {
    grid-template-columns: 1fr;
  }

  .settings-grid .support-brand {
    grid-template-columns: 1fr;
  }

  .settings-grid .support-logo-link {
    max-width: 220px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    padding: 12px;
    gap: 12px;
  }

  .brand {
    padding: 0;
    border-bottom: 0;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  .nav-item {
    justify-content: center;
    min-width: 0;
    font-size: 13px;
  }

  .priority-item.enhanced {
    grid-template-columns: 1fr;
  }

  .priority-item.enhanced .score,
  .priority-item.enhanced .status,
  .priority-item.enhanced .row-actions {
    justify-self: start;
  }

  .nav-item.active {
    box-shadow: inset 0 -3px 0 var(--accent);
  }

  .nav-icon,
  .account-card {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .dashboard-grid,
  .settings-grid,
  .acquisition-grid,
  .automation-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .support-brand,
  .support-contact-grid {
    grid-template-columns: 1fr;
  }

  .support-logo-link {
    max-width: 180px;
  }

  .next-step {
    display: grid;
    align-items: stretch;
  }

  .next-step .btn {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 10px;
    justify-content: flex-start;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .top-actions .btn {
    min-width: 0;
    width: 100%;
    white-space: normal;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .active-view {
    animation: none;
  }

  .btn:hover,
  .link-btn:hover,
  .icon-btn:hover,
  .nav-item:hover {
    transform: none;
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 23px;
  }

  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .toolbar select,
  .search-box {
    width: 100%;
  }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions .btn:nth-child(3):last-child {
    grid-column: 1 / -1;
  }

  .section-bar,
  .toolbar,
  .bulk-action-bar {
    display: grid;
  }

  .bulk-action-bar .row-actions,
  .bulk-action-bar .btn {
    width: 100%;
  }

  .draft-card header,
  .discovery-card header,
  .queue-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .queue-item .score,
  .queue-item .row-actions,
  .draft-card header .status,
  .discovery-card header .score {
    justify-self: start;
  }

  .progress-head,
  .progress-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .progress-head small,
  .progress-item em {
    justify-self: start;
  }
}

/* ========== AUTH SCREEN ========== */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--page);
  padding: 20px;
}

.auth-card {
  width: min(400px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.auth-brand strong {
  font-size: 18px;
}

.auth-brand span {
  color: var(--muted);
  font-size: 13px;
}

.auth-card h2 {
  margin-bottom: 18px;
  font-size: 20px;
}

.auth-card form {
  display: grid;
  gap: 14px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

.auth-card input:focus {
  border-color: var(--accent);
}

.auth-card .btn.primary {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.auth-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  min-height: 1.2em;
}

.auth-toggle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-toggle a {
  color: var(--accent-dark);
  font-weight: 900;
  cursor: pointer;
}

.user-box {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(0, 194, 255, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 194, 255, 0.1), rgba(123, 47, 190, 0.08));
}

.user-box span {
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 900;
  color: var(--accent-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-box .btn {
  width: 100%;
  min-height: 34px;
  box-shadow: none;
}

/* ========== SALES OPERATIONS WORKSPACE ========== */

.ops-metric-grid,
.report-kpis,
.deal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.ops-metric-grid article,
.report-kpis article,
.deal-summary article {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
  box-shadow: var(--shadow-sm);
}

.ops-metric-grid span,
.report-kpis span,
.deal-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.ops-metric-grid strong,
.report-kpis strong,
.deal-summary strong {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.08;
}

.ops-metric-grid small,
.report-kpis small {
  color: var(--soft);
  font-size: 11px;
}

.mini-summary,
.knowledge-governance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.mini-summary strong,
.knowledge-governance strong { color: var(--ink); }
.risk-text { color: var(--danger); }

.task-board,
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.task-card,
.knowledge-card,
.ocr-card,
.deal-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.task-card {
  border-left: 1px solid var(--line);
}

.task-card.priority-high { border-left-color: var(--coral); }
.task-card.priority-normal { border-left-color: var(--accent); }
.task-card.priority-low { border-left-color: var(--blue); }
.task-card.overdue { background: color-mix(in srgb, var(--surface) 92%, var(--danger) 8%); }

.task-card-head,
.deal-card-head,
.knowledge-card-head,
.knowledge-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-card > strong { font-size: 15px; }
.task-card > span,
.task-card > small,
.deal-card small,
.knowledge-meta { color: var(--muted); font-size: 12px; }
.task-priority { color: var(--muted); font-size: 11px; font-weight: 850; }
.task-card p,
.deal-card p,
.knowledge-card p { margin: 0; color: var(--muted); line-height: 1.55; }

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-list .task-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding: 12px;
}

.compact-list .task-card-head,
.compact-list .task-card > strong,
.compact-list .task-card > span,
.compact-list .task-card > small { grid-column: 1; }
.compact-list .task-card .row-actions { grid-column: 2; grid-row: 1 / span 4; }

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-grid > .panel { min-width: 0; }
.dashboard-grid > .panel:last-child { grid-column: 1 / -1; }
.dashboard-grid .priority-item.enhanced { grid-template-columns: minmax(0, 1fr) max-content; }
.dashboard-grid .priority-item.enhanced .score,
.dashboard-grid .priority-item.enhanced .status { justify-self: start; }

.deal-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(248px, 1fr));
  gap: 12px;
  padding-bottom: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.deal-column {
  min-height: 280px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft) 90%, transparent);
}

.deal-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 900;
}

.deal-column-head strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-dark);
}

.deal-card { margin-bottom: 10px; padding: 13px; }
.deal-card.needs-attention { border-color: color-mix(in srgb, var(--warning) 55%, var(--line)); }
.deal-card h3 { margin: 0; font-size: 14px; }
.deal-card-head span { color: var(--muted); font-size: 11px; }
.deal-card-head strong { font-size: 13px; }
.deal-evidence {
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

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

.report-grid > *,
.compact-table { min-width: 0; max-width: 100%; }
.compact-table table { min-width: 520px; }

.wide-report { grid-column: 1 / -1; }
.funnel-report,
.forecast-report { display: grid; gap: 10px; }
.funnel-row {
  display: grid;
  grid-template-columns: 90px minmax(80px, 1fr) 38px 70px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.funnel-row > div {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-soft);
}

.funnel-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.funnel-row small { color: var(--muted); }
.forecast-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.forecast-row span { color: var(--muted); font-size: 12px; }
.forecast-row strong { text-align: right; overflow-wrap: anywhere; }
.forecast-row small { grid-column: 1 / -1; color: var(--soft); text-align: right; }

.quality-report {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.quality-report article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.quality-report article.risk { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.quality-report article.ok strong { color: #18864b; }
.quality-report article.risk strong { color: var(--danger); }

.knowledge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.knowledge-card h3 { margin: 0; font-size: 16px; }
.knowledge-type,
.review-state,
.tag-row span,
.governance-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 850;
}
.review-state.draft { color: var(--warning); }
.review-state.approved { color: #18864b; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.knowledge-meta { justify-content: flex-start; }
.knowledge-meta a { color: var(--accent-dark); font-weight: 800; text-decoration: none; }

.form-details {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}
.form-details summary { cursor: pointer; color: var(--accent-dark); font-weight: 900; }
.details-grid { margin-top: 14px; }

.governance-list { display: grid; gap: 10px; }
.governance-list > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.governance-list small { grid-column: 2; color: var(--muted); }
.governance-state.ok { color: #18864b; }
.governance-state.warn { color: var(--warning); }

.ocr-modal { width: min(820px, calc(100vw - 28px)); }
.ocr-progress {
  min-height: 22px;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
}
.ocr-inbox { display: grid; gap: 10px; max-height: 56vh; overflow: auto; }
.ocr-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.ocr-card > div:first-child { display: grid; gap: 5px; }
.ocr-card span,
.ocr-card small { color: var(--muted); font-size: 12px; }
.ocr-card.failed { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.small-empty { min-height: 80px; padding: 20px 8px; }

@media (max-width: 1100px) {
  .ops-metric-grid,
  .report-kpis,
  .deal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .ops-metric-grid,
  .report-kpis,
  .deal-summary,
  .dashboard-grid,
  .task-board,
  .knowledge-grid,
  .report-grid,
  .quality-report { grid-template-columns: minmax(0, 1fr); }
  .wide-report { grid-column: auto; }
  .dashboard-grid > .panel:last-child { grid-column: auto; }
  .compact-list .task-card,
  .ocr-card { grid-template-columns: 1fr; }
  .compact-list .task-card .row-actions { grid-column: 1; grid-row: auto; }
  .funnel-row { grid-template-columns: 74px minmax(70px, 1fr) 30px; }
  .funnel-row small { grid-column: 2 / -1; }
}

@media print {
  body { background: #fff !important; }
  .sidebar,
  .top-actions,
  .next-step,
  .nav-list,
  .toolbar,
  .btn,
  dialog { display: none !important; }
  .app-shell { display: block !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .view { display: none !important; }
  #reportsView { display: block !important; }
  .panel,
  .report-kpis article { break-inside: avoid; box-shadow: none; }
}
/* Keep native hidden elements hidden even when component display rules change. */
[hidden] {
  display: none !important;
}

/* ========== V1.4.3 PORCELAIN DESK VISUAL SYSTEM ========== */

body,
body[data-theme="sevinok"],
body[data-theme="sky"],
body[data-theme="emerald"],
body[data-theme="violet"],
body[data-theme="gold"],
body[data-theme="terracotta"] {
  --ink: #202637;
  --muted: #687083;
  --soft: #9299aa;
  --line: #dde2ea;
  --line-strong: #c5cdd9;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --page: #f1f3f7;
  --nav: #1d2230;
  --nav-soft: #2a3145;
  --nav-ink: #f8f9fc;
  --nav-muted: #aeb5c5;
  --nav-active: #ffffff;
  --accent: #4f5bd5;
  --accent-dark: #3742b3;
  --button-hover: #414dc1;
  --danger: #c94f52;
  --warning: #a66b1f;
  --success: #247a5d;
  --blue: #386fa6;
  --cyan-soft: #eef1f8;
  --shadow-sm: 0 1px 2px rgba(32, 38, 55, 0.05);
  --shadow-md: 0 12px 30px rgba(32, 38, 55, 0.11);
  --shadow-lg: 0 22px 58px rgba(32, 38, 55, 0.17);
  color-scheme: light;
}

body[data-theme="navy"] {
  --ink: #eef1f7;
  --muted: #aab1c1;
  --soft: #858da0;
  --line: #343b4c;
  --line-strong: #555e72;
  --surface: #191f2e;
  --surface-soft: #151b29;
  --page: #111522;
  --nav: #0d111b;
  --nav-soft: #222a3d;
  --nav-ink: #f8f9fc;
  --nav-muted: #a5adbd;
  --nav-active: #ffffff;
  --accent: #818cf8;
  --accent-dark: #a5b4fc;
  --button-hover: #6f7bea;
  --danger: #fb7185;
  --warning: #f0b65d;
  --success: #63c99c;
  --blue: #8bb8ff;
  --cyan-soft: #232a3c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

body[data-theme="mono"] {
  --ink: #17191d;
  --muted: #5f6269;
  --soft: #858991;
  --line: #d8dade;
  --line-strong: #b8bcc3;
  --surface: #ffffff;
  --surface-soft: #f5f5f4;
  --page: #ececea;
  --nav: #191b1f;
  --nav-soft: #2a2d32;
  --nav-ink: #f7f7f5;
  --nav-muted: #b5b6b8;
  --accent: #2c3036;
  --accent-dark: #111317;
  --button-hover: #111317;
}

body[data-theme="mist"] {
  --ink: #202637;
  --muted: #687083;
  --soft: #9299aa;
  --line: #dde2ea;
  --line-strong: #c5cdd9;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --page: #f1f3f7;
  --nav: #1d2230;
  --nav-soft: #2a3145;
  --nav-ink: #f8f9fc;
  --nav-muted: #aeb5c5;
  --nav-active: #ffffff;
  --accent: #4f5bd5;
  --accent-dark: #3742b3;
  --button-hover: #414dc1;
  --danger: #c94f52;
  --warning: #a66b1f;
  --success: #247a5d;
  --blue: #386fa6;
  --cyan-soft: #eef1f8;
}

* {
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

::selection {
  color: #ffffff;
  background: var(--accent);
}

html {
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-family: "Avenir Next", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.sidebar {
  height: 100dvh;
  gap: 0;
  padding: 0 14px 16px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--nav);
}

.brand {
  min-height: 76px;
  gap: 10px;
  padding: 16px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  padding: 2px;
  border: 0;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: none;
}

.brand strong {
  color: var(--nav-ink);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.brand span {
  margin-top: 1px;
  color: var(--nav-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-list {
  gap: 2px;
  padding: 14px 0;
}

.nav-item {
  min-height: 39px;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--nav-muted);
  font-size: 13px;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  color: var(--nav-ink);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transform: none;
}

.nav-item.active {
  color: var(--nav-active);
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--nav-soft);
  box-shadow: none;
}

.nav-icon {
  display: none;
}

.nav-item::before {
  content: "";
  width: 8px;
  height: 2px;
  flex: 0 0 8px;
  border-radius: 1px;
  background: #65788d;
}

.nav-item.active::before {
  width: 14px;
  flex-basis: 14px;
  background: var(--accent);
}

.account-card {
  margin-top: auto;
  gap: 9px;
  padding: 14px 6px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
  color: var(--nav-ink);
  box-shadow: none;
}

.local-stats {
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  overflow: hidden;
}

.local-stats span {
  padding: 8px 7px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.035);
  color: var(--nav-muted);
  box-shadow: none;
}

.local-stats span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.local-stats strong {
  color: var(--nav-ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.user-box span,
.account-card span,
.account-card label {
  color: var(--nav-muted);
  font-size: 11px;
  font-weight: 550;
}

.user-box {
  gap: 6px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
}

.local-config-btn {
  width: 100%;
  min-height: 32px;
  color: var(--nav-ink) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.local-config-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.account-meta {
  gap: 0;
}

.account-meta span {
  padding: 5px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--nav-muted);
}

#syncStatus {
  color: #d8e2ec;
  font-weight: 650;
}

.main {
  min-width: 0;
  padding: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 90px;
  max-width: none;
  margin: 0;
  padding: 20px 32px 18px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 1px 0 rgba(22, 35, 58, 0.02);
  backdrop-filter: none;
}

.title-block {
  min-width: 260px;
}

.page-kicker {
  display: none;
}

h1 {
  color: var(--ink);
  font-size: 25px;
  font-weight: 720;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

h2 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.topbar p,
.section-bar p {
  max-width: 70ch;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.top-actions {
  gap: 8px;
}

.top-actions .btn.primary ~ .btn.primary {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--surface);
}

.top-actions .btn.primary ~ .btn.primary:hover {
  color: var(--accent-dark);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.btn,
.icon-btn,
.link-btn {
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 100ms ease;
}

.btn {
  min-height: 38px;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  box-shadow: none;
}

.btn:hover,
.btn.secondary:hover,
.btn.compact:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  transform: none;
}

.btn:active,
.icon-btn:active,
.link-btn:active {
  transform: translateY(1px);
}

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

.btn.primary:hover {
  color: #ffffff;
  border-color: var(--button-hover);
  background: var(--button-hover);
}

.btn.secondary,
.btn.compact {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
}

.btn.compact {
  min-height: 31px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.btn:disabled,
.link-btn:disabled {
  color: var(--soft);
  opacity: 0.62;
}

.btn.is-loading {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.btn-icon {
  display: none;
}

.view {
  max-width: 1580px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

.active-view {
  animation: none;
}

.next-step {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  color: var(--ink);
  box-shadow: none;
}

.next-step div {
  display: contents;
}

.next-step span {
  min-height: 24px;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  padding: 3px 8px;
  background: var(--accent);
  color: #ffffff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.next-step strong {
  font-size: 14px;
  font-weight: 720;
}

.next-step small {
  grid-column: 2;
  margin-top: -8px;
  color: var(--muted);
  font-size: 12px;
}

.next-step .btn {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.metric-grid,
.ops-metric-grid,
.report-kpis,
.deal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.metric,
.ops-metric-grid article,
.report-kpis article,
.deal-summary article {
  min-height: 104px;
  padding: 15px 16px;
  align-content: space-between;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  transition: background 160ms ease;
}

.metric:last-child,
.ops-metric-grid article:last-child,
.report-kpis article:last-child,
.deal-summary article:last-child {
  border-right: 0;
}

.metric:hover,
.ops-metric-grid article:hover,
.report-kpis article:hover,
.deal-summary article:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  box-shadow: none;
  transform: none;
}

.metric::before {
  display: none;
}

.metric span,
.ops-metric-grid span,
.report-kpis span,
.deal-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.metric strong,
.ops-metric-grid strong,
.report-kpis strong,
.deal-summary strong {
  margin: 8px 0 4px;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 25px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
}

.metric small,
.ops-metric-grid small,
.report-kpis small,
.deal-summary small {
  color: var(--soft);
  font-size: 10px;
}

.pipeline-overview,
.panel,
.table-wrap,
.section-bar {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: none;
  transition: border-color 160ms ease;
}

.pipeline-overview:hover,
.panel:hover,
.table-wrap:hover,
.section-bar:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.pipeline-overview {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
}

.pipeline-overview > .panel-head {
  margin: 0;
  padding: 15px 16px 12px;
}

.pipeline-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.pipeline-summary article,
.pipeline-summary article.risk {
  min-height: 91px;
  padding: 13px 15px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.pipeline-summary article:nth-child(3n) {
  border-right: 0;
}

.pipeline-summary article:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.pipeline-summary article.risk {
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

.pipeline-summary span {
  font-size: 11px;
  font-weight: 650;
}

.pipeline-summary strong {
  margin: 5px 0;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.pipeline-summary article.risk strong {
  color: var(--danger);
}

.dashboard-grid,
.settings-grid,
.acquisition-grid,
.automation-grid,
.report-grid {
  gap: 14px;
  margin-top: 14px;
}

.dashboard-grid {
  grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
}

.panel {
  padding: 16px;
}

.panel-head {
  min-height: 37px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-bar {
  margin-bottom: 14px;
  padding: 14px 16px;
}

.priority-list,
.activity-log,
.draft-board,
.strategy-list,
.acquisition-results,
.queue-list,
.auto-send-summary,
.compact-list,
.governance-list {
  gap: 0;
}

.panel .priority-item,
.panel .activity-item,
.panel .compact-list .task-card,
.panel .strategy-list > div {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel .priority-item:last-child,
.panel .activity-item:last-child,
.panel .compact-list .task-card:last-child,
.panel .strategy-list > div:last-child {
  border-bottom: 0;
}

.priority-item {
  padding: 11px 4px;
}

.activity-item {
  padding: 10px 4px 10px 18px;
}

.activity-item::before {
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent);
  background: transparent;
}

.draft-card,
.discovery-card,
.queue-item,
.task-card,
.knowledge-card,
.ocr-card,
.deal-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: none;
}

.draft-card,
.discovery-card,
.task-card,
.knowledge-card,
.ocr-card {
  padding: 14px;
}

.task-card {
  border-left-width: 1px;
}

.task-card.priority-high,
.task-card.priority-normal,
.task-card.priority-low {
  border-left-color: var(--line);
}

.task-card.priority-high .task-priority {
  color: var(--danger);
}

.queue-item {
  padding: 12px;
}

.queue-item.has-warning,
.task-card.overdue {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--line));
  background: color-mix(in srgb, var(--warning) 5%, var(--surface));
}

.deal-board {
  gap: 10px;
}

.deal-column {
  min-height: 300px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.deal-column-head {
  padding: 3px 2px 9px;
}

.deal-column-head strong {
  width: 23px;
  height: 23px;
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.deal-card {
  margin-bottom: 8px;
  padding: 11px;
}

.deal-evidence,
.form-details,
.notice,
.data-dir-structure,
.recommended-dir,
.governance-list > div,
.quality-report article,
.mini-summary,
.knowledge-governance {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: none;
}

.notice {
  color: var(--muted);
}

.notice strong {
  color: var(--ink);
}

.check-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.check-list label {
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.check-list label:last-child {
  border-bottom: 0;
}

.quality-report {
  gap: 8px;
}

.quality-report article {
  padding: 11px;
}

.funnel-row > div {
  height: 7px;
  border-radius: 3px;
  background: var(--surface-soft);
}

.funnel-row i {
  border-radius: 3px;
  background: var(--accent);
}

.knowledge-type,
.review-state,
.tag-row span,
.governance-state,
.status,
.score,
.outreach-status,
.risk-flags span,
.workflow-checks span {
  border-radius: 5px;
  font-weight: 700;
}

.knowledge-type,
.tag-row span,
.governance-state {
  background: var(--surface-soft);
  color: var(--ink);
}

.review-state.approved,
.governance-state.ok,
.quality-report article.ok strong {
  color: var(--success);
}

.review-state.draft,
.governance-state.warn {
  color: var(--warning);
}

.status.new,
.status.drafted,
.status.approved,
.status.sent,
.status.replied,
.status.contacted,
.status.opportunity,
.status.won,
.status.disqualified,
.status.blocked {
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.status.approved,
.status.replied,
.status.won {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 28%, var(--line));
}

.status.blocked,
.status.disqualified {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.status.drafted,
.status.sent,
.status.contacted,
.status.opportunity {
  color: var(--blue);
}

.toolbar,
.bulk-action-bar {
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.search-box,
input,
select,
textarea,
.form-grid input,
.form-grid select,
.form-grid textarea,
.toolbar select,
.theme-picker select,
.auth-card input {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

input,
select,
.form-grid input,
.form-grid select,
.toolbar select,
.theme-picker select {
  min-height: 39px;
}

input::placeholder,
textarea::placeholder {
  color: var(--soft);
}

.search-box:focus-within,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}

th {
  height: 38px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

td {
  padding: 11px;
  border-bottom-color: var(--line);
  color: var(--ink);
  font-size: 12px;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
}

tbody tr.is-selected {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.link-btn {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--accent-dark);
  transform: none;
}

.link-btn.primary-action {
  color: var(--accent-dark);
}

.row-menu summary {
  border-radius: 6px;
}

.row-menu-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.menu-action:hover {
  background: var(--surface-soft);
}

dialog {
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(8, 18, 30, 0.58);
  backdrop-filter: none;
}

.icon-btn {
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.empty {
  min-height: 112px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: var(--nav);
  color: var(--nav-ink);
  box-shadow: var(--shadow-md);
}

.auth-screen {
  background: var(--page);
}

.auth-card {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-brand {
  border-bottom: 1px solid var(--line);
}

.maker-box,
.support-panel {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
}

.maker-box {
  background: var(--surface-soft);
}

.maker-contact,
.support-contact-grid div {
  border-color: var(--line);
}

.support-contact-grid div {
  border-radius: 8px;
  background: var(--surface-soft);
}

.wechat-link {
  border-color: var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .topbar {
    padding-inline: 24px;
  }

  .view {
    padding-inline: 24px;
  }

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

  .dashboard-grid > .panel:last-child {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow-x: clip;
  }

  .sidebar {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    padding: 0 16px;
    overflow: visible;
  }

  .brand {
    min-height: 62px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-list {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: 4px;
    padding: 9px 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .main,
  .topbar,
  .view,
  .title-block,
  .top-actions {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .nav-item {
    min-width: max-content;
    justify-content: flex-start;
    scroll-snap-align: start;
  }

  .account-card {
    display: none;
  }

  .topbar {
    position: static;
    min-height: 0;
    padding: 18px 20px;
  }

  .view {
    padding: 20px 20px 56px;
  }

  .metric-grid,
  .ops-metric-grid,
  .report-kpis,
  .deal-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(2),
  .ops-metric-grid article:nth-child(2),
  .report-kpis article:nth-child(2),
  .deal-summary article:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2),
  .ops-metric-grid article:nth-child(-n + 2),
  .report-kpis article:nth-child(-n + 2),
  .deal-summary article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .top-actions .btn {
    white-space: nowrap;
  }
}

@media (max-width: 680px) {
  .brand strong {
    font-size: 12px;
  }

  .nav-item {
    min-height: 44px;
    font-size: 12px;
  }

  .topbar {
    display: grid;
    gap: 14px;
    padding: 16px;
  }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .btn,
  .btn.compact,
  .icon-btn,
  .link-btn {
    min-height: 44px;
  }

  .icon-btn,
  .link-btn {
    min-width: 44px;
    justify-content: center;
  }

  .top-actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
  }

  .top-actions .btn:nth-child(3):last-child {
    grid-column: 1 / -1;
  }

  .view {
    padding: 16px 12px 48px;
  }

  .next-step {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .next-step small {
    grid-column: 2;
    margin-top: -7px;
  }

  .next-step .btn {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }

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

  .pipeline-summary article,
  .pipeline-summary article:nth-child(3n),
  .pipeline-summary article:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pipeline-summary article:last-child {
    border-bottom: 0;
  }

  .draft-board,
  .acquisition-results,
  .task-board,
  .knowledge-grid,
  .report-grid,
  .quality-report,
  .settings-grid,
  .acquisition-grid,
  .automation-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .pipeline-overview > .panel-head {
    padding: 13px;
  }
}

@media (max-width: 460px) {
  .metric-grid,
  .ops-metric-grid,
  .report-kpis,
  .deal-summary {
    grid-template-columns: 1fr;
  }

  .metric,
  .ops-metric-grid article,
  .report-kpis article,
  .deal-summary article,
  .metric:nth-child(2),
  .ops-metric-grid article:nth-child(2),
  .report-kpis article:nth-child(2),
  .deal-summary article:nth-child(2) {
    min-height: 86px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child,
  .ops-metric-grid article:last-child,
  .report-kpis article:last-child,
  .deal-summary article:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ========== V1.4.1 OVAI BRAND SYSTEM ========== */

.brand {
  min-height: 118px;
  display: block;
  padding: 14px 4px 13px;
}

.brand-site {
  display: grid;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.brand-logo-frame {
  display: block;
  width: 100%;
  height: 74px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.brand-product {
  display: block;
  padding-inline: 2px;
  color: var(--nav-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-site:hover .brand-logo-frame {
  border-color: rgba(255, 255, 255, 0.34);
}

.site-entry {
  min-height: 50px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--nav-ink);
  text-decoration: none;
}

.site-entry > span {
  color: var(--nav-muted);
  font-size: 10px;
  font-weight: 650;
}

.site-entry strong {
  color: var(--nav-ink);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

.site-entry strong span {
  color: var(--accent);
}

.site-entry:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.09);
}

.auth-brand {
  display: block;
}

.auth-brand .brand-site {
  width: min(100%, 300px);
  margin-inline: auto;
}

.auth-brand .brand-logo-frame {
  height: 108px;
  border-color: var(--line);
}

.auth-brand .brand-product {
  color: var(--muted);
  text-align: center;
}

.support-brand {
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 22px;
}

.support-logo-link {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.support-logo {
  width: 100%;
  height: 96px;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

.support-contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (max-width: 980px) {
  .brand {
    width: 184px;
    min-height: 76px;
    padding: 8px 0;
  }

  .brand-logo-frame {
    height: 52px;
  }

  .brand-product {
    display: none;
  }
}

@media (max-width: 680px) {
  .brand {
    width: 158px;
    min-height: 68px;
  }

  .brand-logo-frame {
    height: 48px;
  }

  .support-brand {
    grid-template-columns: 1fr;
  }

  .support-logo-link {
    width: min(100%, 210px);
  }
}

/* ========== V1.4.2 CUSTOMER MANAGEMENT ========== */

.customer-section-bar {
  align-items: end;
}

.data-note {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.customer-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.customer-summary article {
  min-height: 100px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 17px 18px;
  border-right: 1px solid var(--line);
}

.customer-summary article:last-child {
  border-right: 0;
}

.customer-summary article.risk {
  box-shadow: inset 0 3px 0 var(--danger);
}

.customer-summary span,
.customer-summary small {
  color: var(--muted);
  font-size: 11px;
}

.customer-summary strong {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.customer-management-toolbar {
  grid-template-columns: minmax(280px, 1.5fr) repeat(3, minmax(150px, 0.7fr));
  margin-bottom: 12px;
}

.customer-table-wrap {
  border-color: var(--line-strong);
  border-radius: 10px;
}

.customer-table {
  min-width: 1180px;
}

.customer-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
}

.customer-table th:nth-child(1) { width: 18%; }
.customer-table th:nth-child(2) { width: 17%; }
.customer-table th:nth-child(3) { width: 12%; }
.customer-table th:nth-child(4) { width: 16%; }
.customer-table th:nth-child(5) { width: 18%; }
.customer-table th:nth-child(6) { width: 10%; }
.customer-table th:nth-child(7) { width: 9%; }

.customer-row.attention-overdue {
  box-shadow: inset 3px 0 0 var(--danger);
}

.customer-row.attention-missing,
.customer-row.attention-stale {
  box-shadow: inset 3px 0 0 var(--warning);
}

.customer-identity,
.customer-contact,
.customer-score-cell,
.customer-progress-cell,
.customer-next-cell,
.customer-updated {
  vertical-align: top;
}

.customer-identity strong,
.customer-contact strong,
.customer-next-cell strong,
.customer-updated strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.customer-identity span,
.customer-contact span,
.customer-contact small,
.customer-identity small,
.customer-next-cell small,
.customer-updated span,
.customer-updated small,
.customer-progress-cell small,
.customer-score-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.customer-identity a {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.customer-identity a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.customer-score-head,
.customer-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-score-head strong {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 19px;
  line-height: 1;
}

.customer-score-head span,
.customer-stage-head strong {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-meter,
.customer-progress-track {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}

.score-meter i,
.customer-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.customer-progress-track i {
  background: var(--success);
}

.attention-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-bottom: 7px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 720;
}

.attention-label.overdue {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

.attention-label.missing,
.attention-label.stale {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
}

.attention-label.ready {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, var(--line));
}

.customer-row-actions {
  display: grid;
  gap: 6px;
}

.customer-row-actions .btn {
  width: 100%;
  min-height: 32px;
  padding-inline: 8px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .customer-management-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-management-toolbar .search-box {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .customer-section-bar {
    align-items: start;
  }

  .customer-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-summary article,
  .customer-summary article:nth-child(2) {
    min-height: 86px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .customer-summary article:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .customer-summary article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .customer-management-toolbar {
    grid-template-columns: 1fr;
  }

  .customer-management-toolbar .search-box {
    grid-column: auto;
  }
}

/* ========== V1.4.4 REFINED TYPOGRAPHY ========== */

body {
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.56;
  letter-spacing: -0.004em;
}

h1 {
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.018em;
}

h2,
h3,
.panel-head h2,
.section-bar h2 {
  font-weight: 560;
  line-height: 1.4;
  letter-spacing: -0.006em;
}

strong,
b {
  font-weight: 560;
}

.topbar p,
.section-bar p,
.muted,
.notice,
.empty,
.customer-identity span,
.customer-contact span,
.customer-contact small,
.customer-identity small,
.customer-next-cell small,
.customer-updated span,
.customer-updated small,
.customer-progress-cell small,
.customer-score-cell small {
  font-weight: 400;
  line-height: 1.55;
}

.nav-item {
  font-weight: 480;
  letter-spacing: 0.006em;
}

.nav-item.active {
  font-weight: 560;
}

.brand-product,
.site-entry > span,
.site-entry strong,
.user-box span,
.account-card span,
.account-card label,
.data-note,
#syncStatus {
  font-weight: 500;
}

.btn,
.btn.compact,
.btn.secondary,
.icon-btn,
.link-btn,
.menu-action,
.row-menu summary {
  font-weight: 520;
  letter-spacing: 0;
}

.btn.primary {
  font-weight: 560;
}

.next-step span,
.next-step strong,
.pipeline-summary span,
.auto-send-summary span,
.task-priority,
.theme-picker,
.form-details summary,
.advanced-dir summary,
.auth-toggle a,
.auth-error,
.maker-box a:not(.maker-logo-link),
.support-panel a,
.support-contact-grid strong {
  font-weight: 520;
}

.next-step strong {
  font-weight: 580;
}

.metric span,
.ops-metric-grid span,
.report-kpis span,
.deal-summary span,
.customer-summary span,
.customer-summary small,
.knowledge-type,
.review-state,
.tag-row span,
.governance-state,
.status,
.score,
.outreach-status,
.risk-flags span,
.workflow-checks span,
.attention-label {
  font-weight: 500;
  letter-spacing: 0.008em;
}

.metric strong,
.ops-metric-grid strong,
.report-kpis strong,
.deal-summary strong,
.customer-summary strong,
.customer-score-head strong,
.pipeline-summary strong {
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

th {
  font-weight: 520;
  letter-spacing: 0.035em;
}

td {
  font-weight: 400;
  line-height: 1.5;
}

.customer-identity strong,
.customer-contact strong,
.customer-next-cell strong,
.customer-updated strong,
.priority-item strong,
.activity-item strong,
.task-card strong,
.deal-card strong,
.knowledge-card strong,
.draft-card strong,
.queue-item strong {
  font-weight: 530;
  letter-spacing: -0.004em;
}

label,
.form-grid label,
.settings-form label,
.customer-score-head span,
.customer-stage-head strong {
  font-weight: 500;
}

input,
select,
textarea {
  font-weight: 400;
  letter-spacing: 0;
}

/* ========== V1.5.0 TEAM WORKSPACE ========== */

.auth-card label,
.auth-error,
.auth-toggle a {
  font-weight: 500;
}

.auth-card {
  width: min(430px, calc(100vw - 32px));
}

.auth-brand .brand-site {
  width: 100%;
}

.team-panel {
  grid-column: 1 / -1;
}

.team-member-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.team-member {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 120px 70px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
}

.team-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
  font-size: 13px;
  font-weight: 600;
}

.team-member div {
  display: grid;
  gap: 2px;
}

.team-member strong {
  font-size: 14px;
  font-weight: 550;
}

.team-member small,
.team-member-status {
  color: var(--muted);
  font-size: 12px;
}

.team-role {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.team-invite-form {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.team-invite-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.team-invite-form input,
.team-invite-form select,
.team-invite-form .btn {
  min-height: 40px;
}

.team-invite-form .form-error {
  grid-column: 1 / -1;
  min-height: 1em;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .team-invite-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-invite-form .btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .team-member {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .team-role,
  .team-member-status {
    grid-column: 2;
  }

  .team-invite-form {
    grid-template-columns: 1fr;
  }
}
