@import url("dpsti-tokens.css?v=85");

:root {
  /* ── DPSTI Design System · Product tier (light, iOS-native) ──
     品牌色直接引用 dpsti-tokens.css 原语（vendor 自标准令牌文件），
     语义值与标准产品层一致；主操作色 = 产品蓝 --c-blue。      */
  --bg: #EEF1F5;
  --surface: #ffffff;
  --surface2: #F4F6F9;
  --surface1: #ffffff;
  --card-bg: #ffffff;
  --border: rgba(11,15,23,.07);
  --border-hover: rgba(11,15,23,.12);
  --text: #0B0F17;
  --text-2: #6B7685;
  --text2: #6B7685;
  --text-3: #98A1B0;
  --text-muted: #98A1B0;
  --primary: var(--c-blue);
  --primary-hover: #0066D6;
  --primary-light: var(--c-blue-tint);
  --primary-bg: var(--c-blue-tint);
  --danger: var(--c-red);
  --danger-light: var(--c-red-tint);
  --success: var(--c-green);
  --success-light: var(--c-green-tint);
  --warning: var(--c-orange);
  --warning-light: var(--c-orange-tint);
  --sidebar-w: 296px;
  /* Legacy alias kept so existing `var(--radius)` call sites keep working;
     it now points at the design-system token instead of carrying its own copy
     of the number. */
  --radius: var(--radius-md);
  /* NOTE: this block used to redefine --radius-lg: 22px and --radius-xl: 28px,
     shadowing dpsti-tokens.css (16px / 22px) -- and because these declarations
     come after the @import, app.css won. The token NAMES were therefore lying:
     writing var(--radius-lg) got you the design system's "xl" size. Removed so
     dpsti-tokens.css is the single source of truth. Anything that genuinely
     needs 22px should say var(--radius-xl), which is what 22px means. */
  /* DPSTI product shadows（蓝灰调） */
  --shadow: 0 1px 3px rgba(16,28,52,.06);
  --shadow-md: 0 8px 26px rgba(16,28,52,.08);
  --shadow-lg: 0 22px 54px rgba(16,28,52,.14);
  /* DPSTI motion（240ms ease-out，无回弹） */
  --transition: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.14s cubic-bezier(0.16, 1, 0.3, 1);
  /* DPSTI type：等宽 = SF Mono 栈；数据/标签使用 */
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, 'Cascadia Code', monospace;
}

:root {
  --fol-bg: #EEF1F5;
  --fol-bg-2: #E7ECF2;
  --fol-surface: #FFFFFF;
  --fol-surface-2: #F4F6F9;
  --fol-border: rgba(11,15,23,.07);
  --fol-fg: #0B0F17;
  --fol-fg-2: #6B7685;
  --fol-fg-3: #98A1B0;
  --fol-brand: #0A84FF;
  --fol-brand-tint: #E5F1FF;
  --fol-shadow-sm: 0 1px 3px rgba(16,28,52,.06);
  --platform-bg: #0A0E16;
  --platform-bg-2: #0E131D;
  --platform-surface: #161D2B;
  --platform-fg: #EAF2F5;
  --platform-fg-2: #9DACBE;
  --platform-brand: #15CFE8;
}

html[data-theme="dark"] {
  /* DPSTI Platform dark（ink navy 系，非纯黑） */
  --bg: var(--ink-900);
  --surface: var(--ink-750);
  --surface2: var(--ink-700);
  --surface1: var(--ink-750);
  --card-bg: var(--ink-750);
  --border: rgba(255,255,255,.09);
  --border-hover: rgba(255,255,255,.16);
  --text: #EAF2F5;
  --text-2: #9DACBE;
  --text2: #9DACBE;
  --text-3: #62718A;
  --text-muted: #62718A;
  --primary: var(--cyan-400);
  --primary-hover: var(--cyan-300);
  --primary-light: rgba(21,207,232,.16);
  --primary-bg: rgba(21,207,232,.16);
  --danger-light: rgba(255,59,48,.16);
  --success-light: rgba(52,199,89,.14);
  --warning-light: rgba(255,159,10,.16);
  --shadow: 0 1px 4px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 32px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.6), 0 4px 16px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE  — Apple-style commercial design
═══════════════════════════════════════════════════════════════ */

#login-screen {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 60% -10%, rgba(10,132,255,.14) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at -10% 80%, rgba(8,145,178,.10) 0%, transparent 60%),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
}
html[data-theme="dark"] #login-screen {
  background:
    radial-gradient(ellipse 80% 60% at 60% -10%, rgba(10,132,255,.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at -10% 80%, rgba(8,145,178,.14) 0%, transparent 60%),
    linear-gradient(180deg, #000 0%, #0c0c0e 100%);
}
.landing-shell {
  width: min(1200px, calc(100% - 48px));
  padding: 24px 0 80px;
}

/* ── Header ── */
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px 0 32px;
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.folia-logo-lg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #0066D6 0%, #0A84FF 50%, #32ADE6 100%);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(10,132,255, .32), 0 2px 6px rgba(10,132,255,.2);
  letter-spacing: -.02em;
}
#landing-brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}
#landing-brand-subtitle { color: var(--text-2); font-size: .88rem; }
.landing-actions, .landing-cta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ── Eyebrow pill ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(10,132,255, .1);
  border: 1px solid rgba(10,132,255, .2);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ── Hero ── */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: var(--space-5);
  align-items: stretch;
  margin-top: 8px;
}
.landing-copy,
.landing-showcase,
.landing-feature-card,
.pricing-card {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(210, 210, 215, .9);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 2px 8px rgba(0,0,0,.04), 0 16px 40px rgba(0,0,0,.06);
}
html[data-theme="dark"] .landing-copy,
html[data-theme="dark"] .landing-showcase,
html[data-theme="dark"] .landing-feature-card,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .landing-stat,
html[data-theme="dark"] .user-chip,
html[data-theme="dark"] .user-menu {
  background: rgba(28, 28, 30, .88);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: 0 2px 8px rgba(0,0,0,.3), 0 16px 40px rgba(0,0,0,.4);
}
.landing-copy {
  border-radius: var(--radius-2xl);
  padding: 44px 48px;
}
#landing-hero-title {
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -.045em;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
}
#landing-hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 580px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Showcase panel ── */
.landing-showcase {
  border-radius: var(--radius-2xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: center;
  background:
    linear-gradient(150deg, rgba(10,132,255,.08), rgba(8,145,178,.05)),
    rgba(255,255,255,.85);
}
.landing-stat {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(210,210,215,.9);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.landing-stat:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.landing-stat span {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.landing-stat strong {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -.05em;
  color: var(--text);
  line-height: 1;
}

/* ── Sections ── */
.landing-section { margin-top: 64px; }
.landing-section-head {
  text-align: center;
  margin-bottom: 40px;
}
.landing-section-head h3 {
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 12px;
}
.landing-section-head p {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}
.landing-section-eyebrow {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(10,132,255,.1);
  color: var(--primary);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ── Feature grid ── */
.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
.landing-feature-card {
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.landing-feature-card:hover { transform: translateY(-3px); box-shadow: 0 4px 20px rgba(0,0,0,.1), 0 12px 40px rgba(0,0,0,.06); }
.landing-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(10,132,255,.15), rgba(10,132,255,.08));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.text-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0 8px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: rgba(10,132,255,.14);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hero-proof-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 14px;
}
.hero-proof-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface2);
  color: var(--text-2);
  font-size: .78rem;
  font-weight: 600;
}
.hero-proof-item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22,163,74,.12);
}
.landing-feature-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -.02em;
  color: var(--text);
}
.landing-feature-card p { color: var(--text-2); font-size: .9rem; line-height: 1.55; }

/* ── How it works ── */
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}
.how-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow);
}
.how-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.how-step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 12px rgba(10,132,255,.35);
}
.how-step h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -.02em;
}
.how-step p { color: var(--text-2); font-size: .88rem; line-height: 1.55; }

/* ── Pricing ── */
.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}
.pricing-card {
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.pricing-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.pricing-name {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 12px;
}
.pricing-price {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -.05em;
  margin-bottom: 6px;
  color: var(--text);
  line-height: 1;
}
.pricing-period {
  font-size: .82rem;
  color: var(--text-2);
  margin-bottom: 20px;
}
.pricing-desc { color: var(--text-2); font-size: .88rem; line-height: 1.5; margin-bottom: 24px; }
.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: 28px;
}
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: .875rem;
  color: var(--text-2);
}
.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: .05rem;
}
.pricing-cta { width: 100%; justify-content: center; padding: .7rem 1rem; font-size: .9rem; border-radius: var(--radius-md); }
.pricing-card-featured {
  background: linear-gradient(160deg, #0066D6 0%, #0A84FF 60%, #32ADE6 100%) !important;
  border-color: transparent !important;
  color: #fff;
  box-shadow: 0 8px 32px rgba(10,132,255,.4), 0 2px 8px rgba(10,132,255,.3) !important;
  position: relative;
  overflow: visible;
}
.pricing-card-featured .pricing-name { color: rgba(255,255,255,.7); }
.pricing-card-featured .pricing-price { color: #fff; }
.pricing-card-featured .pricing-period { color: rgba(255,255,255,.65); }
.pricing-card-featured .pricing-desc { color: rgba(255,255,255,.8); }
.pricing-card-featured .pricing-features li { color: rgba(255,255,255,.85); }
.pricing-card-featured .pricing-features li::before { color: #86efac; }
.pricing-card-featured .pricing-cta { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.25); backdrop-filter: blur(8px); }
.pricing-card-featured .pricing-cta:hover { background: rgba(255,255,255,.25); }
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #f59e0b, #f97316);
  color: white;
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(249,115,22,.4);
}

/* ── Testimonials ── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
html[data-theme="dark"] .testimonial-card { background: rgba(28,28,30,.88); border-color: rgba(255,255,255,.1); }
.testimonial-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.testimonial-stars { color: #f59e0b; font-size: 1rem; letter-spacing: .05em; margin-bottom: 14px; }
.testimonial-quote { font-size: .9rem; color: var(--text-2); line-height: 1.65; margin-bottom: 20px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: var(--space-3); }
.testimonial-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; color: white; flex-shrink: 0; }
.testimonial-name { font-weight: 600; font-size: .875rem; color: var(--text); }
.testimonial-role { font-size: .78rem; color: var(--text-3); }

/* ── Trust bar ── */
.trust-bar {
  margin-top: 56px;
  text-align: center;
}
.trust-bar-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 24px;
}
.trust-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-10);
  flex-wrap: wrap;
  opacity: .45;
  filter: grayscale(1);
}
.trust-logo { font-size: 1rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }

/* ── FAQ ── */
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
.faq-item { background: var(--surface); border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  gap: var(--space-4);
  transition: background var(--transition-fast);
}
.faq-question:hover { background: var(--surface2); }
.faq-chevron { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; transition: transform var(--transition-fast), background var(--transition-fast); }
.faq-chevron svg { width: 12px; height: 12px; color: var(--text-2); }
.faq-answer { padding: 0 24px 18px; font-size: .9rem; color: var(--text-2); line-height: 1.65; display: none; }
.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-chevron { transform: rotate(180deg); background: var(--primary-light); }
.faq-item.open .faq-chevron svg { color: var(--primary); }

/* ── Landing footer ── */
.landing-footer {
  margin-top: 80px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}
.landing-footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-10);
  margin-bottom: 48px;
}
.footer-brand-col .footer-logo { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 14px; }
.footer-brand-col .footer-logo-mark { width: 36px; height: 36px; border-radius: var(--radius-md); background: linear-gradient(135deg,#0A84FF,#32ADE6); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 1rem; }
.footer-brand-col .footer-logo-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.footer-brand-col p { font-size: .875rem; color: var(--text-2); line-height: 1.6; max-width: 260px; }
.footer-col-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 16px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-links a { font-size: .875rem; color: var(--text-2); text-decoration: none; transition: color var(--transition-fast); }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-3); flex-wrap: wrap; gap: var(--space-3); }
.footer-bottom-links { display: flex; gap: var(--space-5); }
.footer-bottom-links a { color: var(--text-3); text-decoration: none; }
.footer-bottom-links a:hover { color: var(--text-2); }
.modal-sm { max-width: 420px; width: min(420px, calc(100vw - 32px)); }
.auth-shell {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  min-height: 560px;
}
.auth-shell-login .auth-aside {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 35%),
    linear-gradient(160deg, #0066D6, #0A84FF 60%, #32ADE6);
}
.auth-shell-register .auth-aside {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 34%),
    linear-gradient(160deg, #0f172a, #0066D6 42%, #0A84FF 100%);
}
.auth-aside {
  color: #fff;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-6);
}
.auth-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.16);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-headline {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -.04em;
}
.auth-copy {
  color: rgba(255,255,255,.82);
  font-size: .94rem;
  line-height: 1.7;
}
.auth-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}
.auth-mini-stats div,
.auth-benefits li {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
}
.auth-mini-stats strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.auth-mini-stats span {
  font-size: .78rem;
  color: rgba(255,255,255,.74);
}
.auth-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.auth-benefits li {
  color: rgba(255,255,255,.86);
  font-size: .88rem;
  line-height: 1.55;
}
.auth-benefits li::before {
  content: '•';
  margin-right: 8px;
  color: #bfdbfe;
}
.auth-panel {
  background: var(--surface);
  padding: 28px 30px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-panel-header {
  padding: 0 0 18px;
  border-bottom: none;
}
.auth-panel-eyebrow {
  font-size: .78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.auth-panel-header h3 {
  font-size: 1.7rem;
  letter-spacing: -.03em;
}
.auth-panel-body {
  padding: 0;
  max-width: 420px;
}
.auth-switch-copy {
  font-size: .85rem;
  color: var(--text-2);
  margin-top: 12px;
}
.auth-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.auth-link-btn:hover { text-decoration: underline; }
.btn-full { width: 100%; justify-content: center; }
#login-screen .error-msg { margin-top: 12px; }

.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem 2rem; width: 100%; max-width: 360px; box-shadow: var(--shadow-md); text-align: center; }
#login-logo-wrap img { width: 56px; height: 56px; border-radius: var(--radius-md); object-fit: contain; margin-bottom: .75rem; }
.login-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: .25rem; }
.login-sub { color: var(--text-2); margin-bottom: 1.5rem; font-size: .9rem; }
.error-msg { color: var(--danger); font-size: .85rem; margin-top: .5rem; }

/* Layout */
#main-app { display: flex; height: 100vh; overflow: hidden; }
#sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: .9rem 1rem; display: flex; align-items: center; gap: .7rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition-fast); }
.sidebar-header:hover { background: var(--surface2); }
.logo-mark-sm { width: 30px; height: 30px; border-radius: var(--radius-sm); background: linear-gradient(135deg,#0A84FF,#32ADE6); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: .85rem; flex-shrink: 0; box-shadow: 0 2px 6px rgba(10,132,255,.35); }
.sidebar-household-name { font-weight: 700; font-size: .875rem; line-height: 1.2; letter-spacing: -0.01em; }
.sidebar-username { font-size: .74rem; color: var(--text-3); }
/* nav-links: no flex:1 — use .nav-spacer to push bottom items down */
.nav-links { list-style: none; padding: .3rem .5rem; }
.nav-links-bottom { padding: .3rem .5rem .25rem; }
.nav-spacer { flex: 1; min-height: .5rem; }
.nav-link { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-weight: 500; transition: background var(--transition-fast), color var(--transition-fast); font-size: .875rem; }
.nav-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-footer { padding: .75rem 1rem; border-top: 1px solid var(--border); }
#app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
html[data-theme="dark"] #app-main {
  background: var(--bg);
}
#app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(245, 245, 247, .92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
html[data-theme="dark"] #app-topbar {
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(20px) saturate(180%);
}
.topbar-page-meta { min-width: 0; }
.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.topbar-subtitle {
  color: var(--text-2);
  font-size: .88rem;
  margin-top: 2px;
}
.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}
.user-chip-avatar, #user-menu-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}
.user-chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #0A84FF, #0891b2);
}
#user-menu-logo {
  object-fit: cover;
  border: 1px solid var(--border);
}
.user-chip-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.97);
  box-shadow: 0 24px 60px rgba(15,23,42,.16);
  padding: 10px;
}
.user-menu-section {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.user-menu-section:last-child { border-bottom: none; }
.user-menu-label {
  color: var(--text-3);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.user-menu-name {
  font-weight: 700;
  font-size: 1rem;
}
.user-menu-email {
  color: var(--text-2);
  font-size: .82rem;
  margin-top: 4px;
}
#content { flex: 1; overflow-y: auto; min-height: 0; }

/* Pages */
.page { padding: 1.5rem 2rem; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.page-header h2 { font-size: 1.3rem; font-weight: 700; }
.page > .page-header { justify-content: flex-end; }
.page > .page-header > div:first-child { display: none; }
.page > .page-header:has(> div:first-child:last-child) { display: none; }
.page-subtitle { font-size: .85rem; color: var(--text-2); margin-top: .2rem; }
.header-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Filters */
.filters-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; padding: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.filter-input, .filter-select { padding: .35rem .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .85rem; background: var(--bg); color: var(--text); }
.filter-input:focus, .filter-select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.filter-input { min-width: 180px; }

/* Receipts Grid */
.receipts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }

/* ── Trash list ──────────────────────────────────────────────────────────── */
.trash-list { display: flex; flex-direction: column; gap: 0; }
.trash-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .75rem; font-size: .78rem; color: var(--text-muted);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px 8px 0 0; border-bottom: none;
}
.trash-row {
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: .75rem;
  padding: .6rem .75rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-top: none; transition: background .12s;
}
.trash-row:last-child { border-radius: 0 0 8px 8px; }
.trash-row:hover { background: var(--surface2); }
.trash-thumb {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: var(--radius-xs); border: 1px solid var(--border); cursor: pointer; flex-shrink: 0;
}
.trash-thumb-empty {
  width: 48px; height: 48px; border-radius: var(--radius-xs); border: 1px solid var(--border);
  background: var(--surface2); display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; color: var(--text-muted);
}
.trash-row-info { cursor: pointer; min-width: 0; }
.trash-row-vendor { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash-row-meta { display: flex; flex-wrap: wrap; gap: .4rem .75rem; font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
.trash-row-amt  { color: var(--text); font-weight: 500; }
.trash-row-was  { font-style: italic; }
.trash-row-actions { flex-shrink: 0; }
.receipt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast); overflow: hidden; position: relative; box-shadow: var(--shadow); }
.receipt-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.receipt-card.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px var(--primary); }
.receipt-thumb { width: 100%; height: 120px; object-fit: cover; background: var(--surface2); display: block; }
.receipt-thumb-placeholder { width: 100%; height: 120px; background: var(--surface2); display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.receipt-thumb-placeholder svg { width: 32px; height: 32px; }
.receipt-info { padding: .6rem; }
.receipt-vendor { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-date { font-size: .78rem; color: var(--text-2); }
.receipt-amount { font-weight: 700; font-size: .95rem; color: var(--primary); margin-top: .2rem; }
.receipt-badge { position: absolute; top: .4rem; right: .4rem; font-size: .7rem; font-weight: 600; padding: .15rem .4rem; border-radius: var(--radius-pill); }
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-extracted { background: #dbeafe; color: #0066D6; }
.badge-reviewed { background: var(--success-light); color: var(--success); }
.receipt-select-box { position: absolute; top: .4rem; left: .4rem; width: 18px; height: 18px; border-radius: var(--radius-xs); border: 2px solid var(--border); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.receipt-card.selected .receipt-select-box { background: var(--primary); border-color: var(--primary); }
.receipt-select-box::after { content: ''; display: none; width: 5px; height: 9px; border: 2px solid white; border-top: none; border-left: none; transform: rotate(45deg) translate(-1px,-1px); }
.receipt-card.selected .receipt-select-box::after { display: block; }
.owner-tag { position: absolute; bottom: .4rem; right: .4rem; width: 20px; height: 20px; border-radius: 50%; font-size: .72rem; font-weight: 700; color: white; display: flex; align-items: center; justify-content: center; }

/* Reports */
.reports-list { display: flex; flex-direction: column; gap: .75rem; }
.report-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.report-row:hover { border-color: var(--border-hover); }
.report-info { flex: 1; }
.report-title { font-weight: 600; }
.report-meta { font-size: .82rem; color: var(--text-2); margin-top: .2rem; }
.report-amount { font-weight: 700; font-size: 1.05rem; margin-right: .5rem; }

/* Settings — tab shell */
#page-settings { padding: 0; height: 100%; overflow: hidden; }
/* Settings' second-level nav is a continuation of #sidebar, not a panel that
   happens to live inside the workspace body.
   It already carried the sidebar's own treatment (background: var(--surface),
   border-right: 1px solid var(--border)) -- what made it read as a floating
   card was #content's inline/top padding pushing it away from the sidebar, so
   the page background showed through the seam between them. Zeroing that
   padding while this page is visible lets the rail sit flush against the
   sidebar and run the full height, so the two read as one continuous nav.
   Same #content:has(...) pattern used for .designed-page and receipt detail. */
#content:has(> #page-settings:not(.hidden)) {
  padding: 0;
  overflow: hidden;
}

#page-settings { height: 100%; padding: 0; overflow: hidden; }

/* .stg-content zeroes its own padding-inline further down (full-width shell
   pass), on the assumption that #content supplies the gutter. Now that this
   page owns the whole content box, the gutter has to come back here or the
   settings body would sit flush against the nav rail. Same clamp #content uses,
   so settings lines up with every other page. */
#content:has(> #page-settings:not(.hidden)) .stg-content {
  padding-inline: clamp(18px, 2vw, 32px);
}

.stg-shell { display: flex; height: 100%; }
.stg-nav { width: 192px; flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; padding: .5rem .4rem; background: var(--surface); }
.stg-nav-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: .9rem .75rem .25rem; }
/* geometry deliberately identical to .nav-link in #sidebar (gap .6rem, padding
   .55rem .75rem, --radius-sm) so an item here and an item there are the same
   object at two levels, not two different components */
.stg-nav-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .75rem; border-radius: var(--radius-sm); border: none; background: none; color: var(--text-2); font-size: .875rem; font-weight: 500; cursor: pointer; text-align: left; transition: background var(--transition-fast), color var(--transition-fast); margin-bottom: 1px; }
.stg-nav-item:hover { background: var(--surface2); color: var(--text); }
.stg-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.stg-nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.stg-content { flex: 1; overflow-y: auto; padding: 1.75rem 2rem; background: var(--bg); }
.stg-tab { max-width: 680px; display: flex; flex-direction: column; gap: 1.25rem; }
.stg-tab-header { margin-bottom: .1rem; }
.stg-tab-header h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.stg-tab-header p { font-size: .85rem; color: var(--text-2); margin-top: .3rem; }

/* Settings — cards */
.settings-sections { display: flex; flex-direction: column; gap: 1.25rem; max-width: 680px; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.settings-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

/* Provider cards */
.provider-card { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.provider-card:last-child { border-bottom: none; }
.pvc-badge { font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: var(--radius-pill); flex-shrink: 0; }
.pvc-cloud { background: #dbeafe; color: #0066D6; }
.pvc-local { background: #dcfce7; color: #15803d; }

/* ── AI Provider Wizard Modal ─────────────────────────────────────────────── */
.pvm-wizard-box { max-width: 640px; width: 100%; }
.pvm-wizard-body { display: flex; flex-direction: column; gap: 0; padding: 0; overflow-y: auto; max-height: 72vh; }

/* Numbered section wrapper */
.pvm-section { display: flex; gap: 0; padding: 1.1rem 1.5rem 1rem; border-bottom: 1px solid var(--border); }
.pvm-section:last-child { border-bottom: none; }
.pvm-section-num { width: 24px; height: 24px; min-width: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: .05rem; margin-right: .75rem; flex-shrink: 0; }
.pvm-section-content { flex: 1; min-width: 0; }
.pvm-section-title { font-weight: 600; font-size: .88rem; margin-bottom: .65rem; color: var(--text); }

/* Provider type selection cards */
.pvm-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.pvm-type-card { border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: .7rem .75rem .65rem; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .1s; background: var(--surface); }
.pvm-type-card:hover { border-color: var(--primary); background: var(--surface2); }
.pvm-type-card.selected { border-color: var(--primary); background: #eff6ff; box-shadow: 0 0 0 2px rgba(10,132,255,.15); }
.pvm-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(10,132,255,.12);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .45rem;
  line-height: 1;
}
.pvm-type-name { font-weight: 700; font-size: .88rem; color: var(--text); line-height: 1.2; }
.pvm-type-sub { font-size: .72rem; color: var(--primary); font-weight: 600; margin: .1rem 0 .3rem; }
.pvm-type-desc { font-size: .75rem; color: var(--text-2); line-height: 1.35; }

/* Help boxes inside each config panel */
.pvm-help-box { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: .9rem; }
.pvm-help-title { font-weight: 700; font-size: .86rem; color: #0369a1; margin-bottom: .35rem; }
.pvm-help-steps { margin: .25rem 0 .5rem; padding-left: 1.1rem; font-size: .83rem; color: var(--text); line-height: 1.6; }
.pvm-help-steps li { margin-bottom: .15rem; }
.pvm-help-note { margin-top: .5rem; background: rgba(0,0,0,.04); border-radius: var(--radius-sm); padding: .4rem .6rem; font-size: .8rem; line-height: 1.5; }
.pvm-help-link { display: inline-block; margin-top: .4rem; font-size: .82rem; color: #0369a1; font-weight: 600; text-decoration: none; }
.pvm-help-link:hover { text-decoration: underline; }

/* URL builder (host + port inputs) */
.pvm-url-builder { margin-top: .1rem; }
.pvm-url-row { display: flex; gap: .5rem; align-items: flex-end; }
.pvm-url-host { flex: 1; margin: 0 !important; }
.pvm-url-port { width: 88px; margin: 0 !important; }
.pvm-url-preview { margin-top: .45rem; padding: .35rem .55rem; background: var(--surface2); border-radius: var(--radius-sm); font-size: .8rem; color: var(--text-2); word-break: break-all; }
.pvm-url-preview code { color: var(--text); font-size: .8rem; }

/* Test status message */
.pvm-test-msg { margin-top: .6rem; padding: .45rem .7rem; border-radius: var(--radius-sm); font-size: .85rem; line-height: 1.45; white-space: pre-wrap; }
.pvm-test-msg.pvm-ok  { background: #dcfce7; color: #166534; }
.pvm-test-msg.pvm-err { background: #fee2e2; color: #991b1b; }
.pvm-test-msg.pvm-info { background: #fef9c3; color: #713f12; }

/* Model picker radio list */
.pvm-model-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .65rem; }
.pvm-model-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .12s, background .1s; background: var(--surface); }
.pvm-model-item:hover { border-color: var(--primary); background: var(--surface2); }
.pvm-model-item.selected { border-color: var(--primary); background: #eff6ff; }
.pvm-model-item input[type=radio] { accent-color: var(--primary); flex-shrink: 0; width: 15px; height: 15px; cursor: pointer; }
.pvm-model-info { flex: 1; min-width: 0; }
.pvm-model-name { font-weight: 600; font-size: .86rem; color: var(--text); }
.pvm-model-desc { font-size: .75rem; color: var(--text-2); margin-top: .05rem; }
.pvm-model-badge { font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: var(--radius-pill); background: #dbeafe; color: #0066D6; flex-shrink: 0; }
.card-header-row h3 { margin-bottom: 0; }
.logo-upload-wrap { display: flex; align-items: center; gap: 1rem; }
#logo-preview img { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: contain; border: 1px solid var(--border); }
.member-row, .provider-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.member-row:last-child, .provider-row:last-child { border-bottom: none; }
.avatar-circle { width: 32px; height: 32px; border-radius: 50%; font-weight: 700; font-size: .82rem; color: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.member-info { flex: 1; }
.member-name { font-weight: 500; }
.member-meta { font-size: .78rem; color: var(--text-2); }
.provider-badge { font-size: .72rem; padding: .1rem .4rem; border-radius: var(--radius-pill); background: var(--success-light); color: var(--success); font-weight: 600; }
.color-swatches { display: flex; gap: .4rem; flex-wrap: wrap; }
.color-swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.color-swatch.selected { border-color: var(--text); }
.hint { font-size: .8rem; color: var(--text-2); margin-top: .75rem; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; }
.field label { font-size: .82rem; font-weight: 500; color: var(--text-2); }
.field input, .field select, .field textarea { padding: .45rem .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; background: var(--surface); color: var(--text); transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.field-row { display: flex; gap: .75rem; }
.field-row .field { flex: 1; }
.input-row { display: flex; gap: .5rem; align-items: center; }
.input-row input { flex: 1; }
.checkbox-field { flex-direction: row; align-items: center; }
.checkbox-field label { display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .9rem; color: var(--text); font-weight: 400; }

/* Buttons — Apple-style */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .48rem .95rem; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast); white-space: nowrap; text-decoration: none; letter-spacing: -0.01em; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 1px 3px rgba(10,132,255,.3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 2px 8px rgba(10,132,255,.4); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn-secondary:hover:not(:disabled) { background: var(--surface2); border-color: var(--border-hover); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.btn-sm { padding: .32rem .65rem; font-size: .8rem; border-radius: var(--radius-sm); }

@media (max-width: 768px) {
  #app-topbar {
    padding: 12px 16px 12px 60px;
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .landing-header { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
}
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-light); }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; }
.btn-full { width: 100%; justify-content: center; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-box { position: relative; background: var(--surface); border-radius: var(--radius-xl); box-shadow: 0 24px 64px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08); width: 100%; max-width: 520px; display: flex; flex-direction: column; max-height: 90vh; border: 1px solid var(--border); }
.modal-lg { max-width: 880px; }
.modal-sm { max-width: 420px; }
.auth-modal-box { max-width: 920px; padding: 0; overflow: hidden; }
.auth-modal-box-wide { max-width: 1020px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.05rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-2); padding: .2rem .4rem; border-radius: var(--radius-xs); }
.modal-close:hover { background: var(--surface2); }
.modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.spacer { flex: 1; }

/* Receipt modal layout */
.receipt-modal-body { display: flex; gap: 1.25rem; }
.receipt-image-pane { width: 360px; flex-shrink: 0; }
.receipt-image-pane img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); max-height: 600px; object-fit: contain; background: var(--surface2); }
.receipt-fields-pane { flex: 1; min-width: 0; }
.extract-banner { background: var(--warning-light); border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: .5rem .75rem; font-size: .85rem; color: var(--warning); display: flex; align-items: center; justify-content: space-between; margin-bottom: .85rem; }
.report-summary { background: var(--surface2); border-radius: var(--radius); padding: .75rem 1rem; font-size: .88rem; margin-top: .5rem; }
.report-summary strong { display: block; font-size: 1rem; margin-bottom: .25rem; }

/* Toast — z-index must exceed the receipt split-pane modal (1100) so toasts
   remain visible while the full-screen receipt editor is open. */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: #1e293b; color: white; padding: .6rem 1.25rem; border-radius: var(--radius-pill); font-size: .88rem; box-shadow: var(--shadow-md); z-index: 1200; white-space: nowrap; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* Empty state — Apple-style */
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 380px; padding: 3rem 2rem; text-align: center; }
.empty-state-icon { width: 72px; height: 72px; color: var(--border); margin-bottom: 1.5rem; }
.empty-state-icon svg { width: 100%; height: 100%; }
.empty-state h4 { font-size: 1.05rem; font-weight: 600; color: var(--text-2); margin-bottom: .4rem; letter-spacing: -.01em; }
.empty-state p { font-size: .85rem; color: var(--text-3); max-width: 240px; line-height: 1.55; }

/* Overview recent receipts strip */
.overview-recent { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-top: 1rem; }
.overview-recent-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .9rem; display: flex; align-items: center; justify-content: space-between; }
.ov-recent-scroll { display: flex; gap: .75rem; overflow-x: auto; padding: 1rem; scrollbar-width: none; min-height: 145px; align-items: flex-start; }
.ov-recent-scroll::-webkit-scrollbar { display: none; }
.ov-rc { flex: 0 0 128px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ov-rc:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.ov-rc-thumb { height: 76px; background: var(--surface2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ov-rc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ov-rc-info { padding: .4rem .5rem .5rem; }
.ov-rc-merchant { font-size: .75rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ov-rc-date { font-size: .68rem; color: var(--text-3); margin-top: .1rem; }
.ov-rc-amount { font-size: .82rem; font-weight: 700; color: var(--primary); margin-top: .15rem; }
.ov-recent-empty { display: flex; align-items: center; justify-content: center; width: 100%; color: var(--text-3); font-size: .85rem; padding: 2.5rem 1rem; }

/* Pool switcher (sidebar) */
.pool-switcher-wrap { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.pool-switcher-label { font-size: .72rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.pool-switcher { width: 100%; padding: .35rem .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .85rem; background: var(--bg); color: var(--text); cursor: pointer; }
.pool-switcher:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

/* Pool tag on receipt cards */
.pool-tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 600; padding: .1rem .4rem; border-radius: var(--radius-pill); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool-tag.unassigned { background: var(--surface2); color: var(--text-3); }

/* Claimed badge on receipt cards */
.claimed-badge { display: inline-flex; align-items: center; font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: var(--radius-pill); }
.claimed-badge.fully { background: #fef3c7; color: #92400e; }
.claimed-badge.partial { background: #dbeafe; color: #1e40af; }

/* Reconciled (100% claimed) receipt card state */
.receipt-card.reconciled { opacity: .55; }
.receipt-card.reconciled .receipt-select-box { cursor: not-allowed; background: var(--surface2); }
.receipt-card.reconciled:hover { border-color: var(--border); box-shadow: none; }

/* Receipt card meta row (pool tag + claimed badge together) */
.receipt-meta-row { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }

/* PDF icon on receipt cards (small) */
.pdf-icon-sm { display: flex; align-items: center; justify-content: center; color: var(--danger); }
.pdf-icon-sm svg { width: 14px; height: 14px; }

/* PDF placeholder in receipt modal image pane */
.pdf-placeholder { width: 100%; height: 420px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; color: var(--text-2); }
.pdf-placeholder svg { width: 56px; height: 56px; color: var(--danger); opacity: .7; }
.pdf-placeholder span { font-size: .88rem; font-weight: 500; }

/* Per-receipt claim amount table in report creation modal */
.rm-receipts-wrap { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .85rem; }
.rm-receipts-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.rm-receipts-table th { position: sticky; top: 0; background: var(--surface2); padding: .4rem .6rem; text-align: left; font-weight: 600; font-size: .78rem; color: var(--text-2); border-bottom: 1px solid var(--border); }
.rm-receipts-table td { padding: .4rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rm-receipts-table tr:last-child td { border-bottom: none; }
.rm-receipts-table input[type="number"] { width: 90px; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: .85rem; background: var(--bg); color: var(--text); }
.rm-receipts-table input[type="number"]:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

/* Claim summary bar below report receipts table */
.claim-summary { display: flex; align-items: center; gap: 1.25rem; background: var(--surface2); border-radius: var(--radius-sm); padding: .55rem .85rem; font-size: .85rem; margin-bottom: .85rem; }
.claim-summary span { color: var(--text-2); }
.claim-summary strong { color: var(--text); }
.claim-summary .claim-total { font-size: 1rem; font-weight: 700; color: var(--primary); }

/* Claim history panel in receipt detail modal */
.claim-history { margin-top: .85rem; }
.claim-history-title { font-size: .78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4rem; }
.claim-history-item { display: flex; align-items: center; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.claim-history-item:last-child { border-bottom: none; }
.claim-history-item .ch-amount { font-weight: 700; color: var(--primary); min-width: 60px; }
.claim-history-item .ch-report { flex: 1; color: var(--text); }
.claim-history-item .ch-date { color: var(--text-3); font-size: .78rem; }

/* Pool color dot (used in pool lists in settings) */
.pool-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* Pool row in settings */
.pool-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.pool-row:last-child { border-bottom: none; }
.pool-info { flex: 1; }
.pool-name { font-weight: 500; }
.pool-meta { font-size: .78rem; color: var(--text-2); }

/* Member checkboxes inside pool modal */
.members-checks { display: flex; flex-direction: column; gap: .3rem; max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .75rem; }
.member-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem 0; font-size: .88rem; }
.member-check input[type="checkbox"] { cursor: pointer; accent-color: var(--primary); width: 15px; height: 15px; }

/* Recycle bin section receipt rows */
.recycle-row { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.recycle-row:last-child { border-bottom: none; }
.recycle-row .recycle-info { flex: 1; }
.recycle-row .recycle-vendor { font-weight: 500; }
.recycle-row .recycle-meta { font-size: .78rem; color: var(--text-2); }

/* Inbox settings inline layout */
.inbox-path-row { display: flex; gap: .5rem; align-items: center; }
.inbox-path-row input { flex: 1; }
.inbox-status { font-size: .82rem; margin-top: .4rem; padding: .3rem .6rem; border-radius: var(--radius-xs); }
.inbox-status.ok { background: var(--success-light); color: var(--success); }
.inbox-status.err { background: var(--danger-light); color: var(--danger); }

/* Report row receipt count badge */
.receipt-count-badge { display: inline-flex; align-items: center; font-size: .75rem; padding: .1rem .45rem; border-radius: var(--radius-pill); background: var(--surface2); color: var(--text-2); font-weight: 600; }

/* Change password section separator */
.section-divider { border: none; border-top: 1px solid var(--border); margin: .75rem 0; }

/* ── v0.3 additions ──────────────────────────────────────────────────────── */

/* Folia logo */
.folia-logo-lg { display: flex; align-items: center; gap: .6rem; }
.folia-logo-lg .logo-mark { width: 44px; height: 44px; border-radius: var(--radius-md); background: linear-gradient(135deg,#0A84FF,#32ADE6); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 1.25rem; flex-shrink: 0; }
.folia-logo-lg .logo-text { font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; }
.folia-logo-sm { display: flex; align-items: center; gap: .5rem; padding: .9rem 1rem .6rem; }
.folia-logo-sm .logo-mark-sm { width: 28px; height: 28px; border-radius: var(--radius-sm); background: linear-gradient(135deg,#0A84FF,#32ADE6); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.folia-logo-sm .logo-name { font-weight: 800; font-size: .95rem; letter-spacing: -.01em; }

/* Sidebar pool switcher (item-based) */
.pool-sw-item { display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem; border-radius: var(--radius-sm); font-size: .83rem; cursor: pointer; color: var(--text-2); transition: background .12s, color .12s; }
.pool-sw-item:hover { background: var(--surface2); color: var(--text); }
.pool-sw-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.pool-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* Bucket section label in sidebar nav */
.bucket-section-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: .7rem .85rem .2rem; }

/* Sidebar nav item (bucket navigation) */
.nav-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .75rem; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); font-size: .875rem; font-weight: 500; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item .nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.nav-item .nav-label { flex: 1; }

/* Bucket count badges */
.bucket-count { display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 .3rem; border-radius: var(--radius-pill); background: var(--primary); color: white; }
.nav-item[data-bucket="inbox"]     .bucket-count { background: #0A84FF; }
.nav-item[data-bucket="pending"]   .bucket-count { background: #0891b2; }
.nav-item[data-bucket="ready"]     .bucket-count { background: #16a34a; }
.nav-item[data-bucket="processed"] .bucket-count { background: #d97706; }
.nav-item[data-bucket="archived"]  .bucket-count { background: #94a3b8; }
.nav-item[data-bucket="trash"]     .bucket-count { background: #dc2626; }

/* Status dots (small colored indicators on cards / overview) */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sd-inbox     { background: #0A84FF; }
.sd-pending   { background: #0891b2; }
.sd-ready     { background: #16a34a; }
.sd-processed { background: #d97706; }
.sd-archived  { background: #94a3b8; }
.sd-trash, .sd-deleted { background: #dc2626; }

/* Status pills (used in receipt modal) */
.status-pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: var(--radius-pill); text-transform: capitalize; }
.sp-inbox     { background: #E5F1FF; color: #0A84FF; }
.sp-pending   { background: #ecfeff; color: #0891b2; }
.sp-ready     { background: #f0fdf4; color: #16a34a; }
.sp-processed { background: #fffbeb; color: #d97706; }
.sp-archived  { background: #f1f5f9; color: #64748b; }
.sp-trash     { background: #fef2f2; color: #dc2626; }

/* Type badges (payment / refund / invoice / statement) */
.type-badge { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: var(--radius-pill); }
.tb-payment   { background: #eff6ff; color: #0066D6; }
.tb-refund    { background: #f0fdf4; color: #16a34a; }
.tb-invoice   { background: #faf5ff; color: #32ADE6; }
.tb-statement { background: #f8fafc; color: #64748b; }

/* Receipt card v0.3 */
.card-img-wrap { width: 100%; height: 110px; overflow: hidden; background: var(--surface2); border-bottom: 1px solid var(--border); }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: .65rem .75rem; }
.card-top { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .3rem; }
.card-merchant { font-weight: 600; font-size: .875rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.card-date { font-size: .76rem; color: var(--text-2); }
.card-amount { font-weight: 700; font-size: .95rem; color: var(--primary); }
.card-footer { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.project-tag { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; padding: .1rem .35rem; border-radius: var(--radius-pill); border: 1px solid transparent; }

/* Overview page */
.overview-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow); }
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-card-inbox     .stat-icon { background: #E5F1FF; color: #0A84FF; }
.stat-card-pending   .stat-icon { background: #ecfeff; color: #0891b2; }
.stat-card-ready     .stat-icon { background: #f0fdf4; color: #16a34a; }
.stat-card-amount    .stat-icon { background: #fff7ed; color: #d97706; }
.stat-icon svg { width: 22px; height: 22px; flex-shrink: 0; }
.stat-body { flex: 1; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--text-2); margin-top: .15rem; }
.stat-card-inbox     .stat-value { color: #0A84FF; }
.stat-card-pending   .stat-value { color: #0891b2; }
.stat-card-ready     .stat-value { color: #16a34a; }
.stat-card-amount    .stat-value { color: #d97706; }

/* Overview panels */
.overview-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .overview-panels { grid-template-columns: 1fr; } }
.overview-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.panel-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .9rem; }
.panel-body { padding: .5rem .75rem; }
.attention-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .25rem; border-bottom: 1px solid var(--border); cursor: pointer; font-size: .85rem; transition: background .1s; }
.attention-item:last-child { border-bottom: none; }
.attention-item:hover { background: var(--surface2); }
.ai-merchant { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-date { color: var(--text-2); font-size: .78rem; min-width: 72px; text-align: right; }
.ai-amount { font-weight: 700; min-width: 64px; text-align: right; color: var(--primary); }
.pool-summary-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .25rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
.pool-summary-row:last-child { border-bottom: none; }
.psn { flex: 1; font-weight: 500; }
.psc { color: var(--text-2); font-size: .8rem; }

/* View toggle */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-btn { background: var(--surface); border: none; padding: .35rem .65rem; cursor: pointer; font-size: .82rem; color: var(--text-2); transition: background .12s, color .12s; }
.view-btn:hover { background: var(--surface2); }
.view-btn.active { background: var(--primary); color: white; }

/* Data table (table view) */
.table-scroll-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th { position: sticky; top: 0; background: var(--surface2); padding: .5rem .75rem; text-align: left; font-weight: 600; font-size: .78rem; color: var(--text-2); border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none; }
.data-table th:hover { background: var(--border); color: var(--text); }
.data-table td { padding: .45rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.col-check { width: 32px; }

/* Tax grid in receipt modal */
.tax-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
.tax-grid .field { margin-bottom: 0; }

/* Claim summary inline (in receipt modal) */
.rm-claim-summary { margin-top: .75rem; }
.csi-row { display: flex; align-items: center; gap: .5rem; font-size: .82rem; padding: .3rem 0; border-bottom: 1px solid var(--border); }
.csi-row:last-child { border-bottom: none; }
.csi-row span:first-child { flex: 1; color: var(--text-2); }
.csi-row .num { min-width: 80px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.csi-row.csi-header span { font-weight: 700; font-size: .76rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.csi-row.csi-available { font-weight: 700; }
.csi-row.csi-available span:first-child { color: var(--text); }
.csi-row .negative { color: var(--danger); }

/* Bucket title on receipts page */
#bucket-title { font-size: 1.3rem; font-weight: 800; }

/* Keep-open toggle in report modal */
.rem-toggle { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .82rem; color: var(--text-2); white-space: nowrap; }
.rem-toggle input[type="checkbox"] { accent-color: var(--success); }
.rep-remaining-cell { visibility: hidden; }

/* Report modal total display */
#rep-total-display { font-size: 1.25rem; font-weight: 800; color: var(--primary); }

/* Project row in settings */
.project-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.project-row:last-child { border-bottom: none; }
.prj-name { font-weight: 500; flex: 1; }
.prj-pool { font-size: .8rem; color: var(--text-2); min-width: 80px; }
.prj-count { font-size: .8rem; color: var(--text-3); min-width: 80px; text-align: right; }

/* PDF placeholder variants */
.pdf-placeholder.large { height: 320px; font-size: .95rem; font-weight: 600; }
.pdf-placeholder.large small { font-size: .78rem; font-weight: 400; color: var(--text-3); }

/* Empty note (inline empty text) */
.empty-note { color: var(--text-3); font-size: .85rem; padding: .75rem 0; text-align: center; }

/* btn-danger */
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

/* Ledger page */
#page-ledger .table-scroll-wrap { max-height: calc(100vh - 220px); overflow-y: auto; }
.ldg-totals-row td { background: var(--surface2); font-weight: 700; font-size: .85rem; padding: .5rem .75rem; border-top: 2px solid var(--border); position: sticky; bottom: 0; }
.ldg-totals-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--primary); }
.sortable { cursor: pointer; user-select: none; }
.sort-icon { font-size: .7rem; color: var(--text-3); margin-left: .2rem; }
.data-table tr[data-deleted="1"] td { opacity: .5; }

/* ── Invoices page ─────────────────────────────────────────────────────────── */
.invoices-list { display: flex; flex-direction: column; gap: .75rem; }
.inv-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.inv-row:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.inv-row-info { flex: 1; min-width: 0; }
.inv-row-number { font-weight: 700; font-size: .95rem; }
.inv-row-client { font-size: .82rem; color: var(--text-2); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-row-dates  { font-size: .78rem; color: var(--text-3); margin-top: .1rem; }
.inv-row-amount { font-weight: 800; font-size: 1.1rem; color: var(--primary); min-width: 100px; text-align: right; }
.inv-status-pill { font-size: .7rem; font-weight: 700; padding: .15rem .55rem; border-radius: var(--radius-pill); text-transform: uppercase; flex-shrink: 0; }
.isp-draft { background: #f1f5f9; color: #64748b; }
.isp-sent  { background: #dbeafe; color: #0066D6; }
.isp-paid  { background: #dcfce7; color: #15803d; }
.isp-void  { background: #fee2e2; color: #dc2626; }

/* ── Invoice editor modal ──────────────────────────────────────────────────── */
.inv-modal-box { max-width: 820px; }
.inv-modal-body { display: flex; flex-direction: column; gap: 1rem; }
.inv-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.inv-section-title { font-size: .82rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75rem; }
.inv-from-to { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.inv-from-to .inv-section { margin: 0; }
.inv-from-to .field { margin-bottom: .6rem; }
.inv-from-to textarea { resize: vertical; }

/* Line items table inside modal */
.inv-items-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.inv-items-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.inv-items-table th { background: var(--surface2); padding: .4rem .6rem; text-align: left; font-size: .78rem; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.inv-items-table td { padding: .35rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.inv-items-table tr:last-child td { border-bottom: none; }
.inv-items-table input[type="text"], .inv-items-table input[type="number"] { width: 100%; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: .85rem; background: var(--bg); color: var(--text); }
.inv-items-table input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.inv-items-table .td-num input { text-align: right; }
.inv-item-remove { background: none; border: none; cursor: pointer; color: var(--text-3); padding: .2rem .4rem; border-radius: var(--radius-xs); font-size: .9rem; line-height: 1; transition: color .12s, background .12s; }
.inv-item-remove:hover { color: var(--danger); background: var(--danger-light); }

/* Tax + totals row */
.inv-tax-total-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.inv-tax-section { }
.inv-totals-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0; }
.inv-total-row { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.inv-total-row:last-child { border-bottom: none; }
.inv-total-row span:first-child { color: var(--text-2); }
.inv-total-row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-grand-total { margin-top: .25rem; padding-top: .5rem; border-top: 2px solid var(--primary) !important; }
.inv-grand-total span:first-child { font-weight: 700; color: var(--text); font-size: 1rem; }
.inv-grand-total span:last-child { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.data-table tr[data-deleted="1"] { background: #fff5f5; }

/* ── Multi-currency FX row in receipt modal ──────────────────────────────── */
.fx-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; padding: .6rem .75rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); margin-bottom: .5rem; }
.fx-row .field { margin-bottom: 0; }
.input-row { display: flex; align-items: center; gap: .5rem; }
.input-row input { flex: 1; min-width: 0; }
.fx-hint { font-size: .78rem; color: var(--text-2); white-space: nowrap; align-self: center; }

/* ── Billing entity rows in settings ─────────────────────────────────────── */
.entity-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.entity-row:last-child { border-bottom: none; }
.entity-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; overflow: hidden; }
.entity-icon img { width: 100%; height: 100%; object-fit: contain; }
.entity-info { flex: 1; min-width: 0; }
.entity-name { font-weight: 600; font-size: .9rem; }
.entity-meta { font-size: .78rem; color: var(--text-2); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-default-badge { font-size: .68rem; font-weight: 700; padding: .1rem .45rem; border-radius: var(--radius-pill); background: #dbeafe; color: #0066D6; text-transform: uppercase; flex-shrink: 0; }
.entity-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* ── Entity logo upload in modal ─────────────────────────────────────────── */
.entity-logo-upload-wrap { display: flex; align-items: center; gap: .75rem; }
.entity-logo-preview { width: 68px; height: 68px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface2); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.entity-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ── Sidebar logo image override ─────────────────────────────────────────── */
.logo-mark-sm { overflow: hidden; }
.logo-mark-sm img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.logo-mark-sm img.hidden { display: none; }

/* ── Expense category rows in settings ───────────────────────────────────── */
.cat-row { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.cat-row:last-child { border-bottom: none; }
.cat-row.cat-inactive { opacity: .5; }
.cat-code { font-size: .72rem; font-weight: 700; padding: .1rem .4rem; border-radius: var(--radius-xs); background: var(--surface2); color: var(--text-2); text-transform: uppercase; flex-shrink: 0; font-family: var(--font-mono); }
.cat-info { flex: 1; min-width: 0; }
.cat-name { font-weight: 600; font-size: .88rem; }
.cat-desc { font-size: .76rem; color: var(--text-2); margin-top: .05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.cat-toggle { font-size: .75rem; padding: .2rem .55rem; }

/* ── Settings section header with add button ─────────────────────────────── */
.stg-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.stg-section-header h3 { margin: 0; font-size: .95rem; font-weight: 700; }
.stg-subsection { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; }
.stg-subsection h4 { font-size: .8rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .6rem; }

/* ── Currency table in settings ───────────────────────────────────────────── */
.currency-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.currency-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.currency-table th { background: var(--surface2); padding: .45rem .75rem; text-align: left; font-size: .78rem; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); }
.currency-table td { padding: .4rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.currency-table tr:last-child td { border-bottom: none; }
.currency-table tr:hover td { background: var(--surface2); }
.currency-code { font-weight: 700; font-family: var(--font-mono); font-size: .88rem; }
.currency-actions { display: flex; gap: .35rem; }

/* ── Receipt split-pane detail ────────────────────────────────────────────── */
/* This used to be `position: fixed; inset: 0; z-index: 1100`, i.e. a full-screen
   overlay that covered the sidebar and topbar. It is now a normal page inside
   the app shell (#page-receipt-detail lives in <main id="content">), so it must
   size itself to the content area instead of the viewport. The split panes keep
   their own internal scrolling, so the page itself does not scroll. */
/* Fill the content area exactly -- do not scroll.
   The first attempt used `height: calc(100dvh - 60px - 42px)`, i.e. a guess at
   the height of the app chrome. The guess was too small, the page overflowed
   #content, and #content (overflow-y: auto) scrolled it -- so the "fixed"
   viewer still slid under the topbar. Guessing chrome height is the wrong
   approach: the numbers drift the moment the header or padding changes.
   Instead take the height #content already has (it is flex:1 in a flex column,
   so its height is definite), zero that page's share of #content's padding, and
   stop #content scrolling while this page is the visible one. */
#content:has(> #page-receipt-detail:not(.hidden)) {
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
}

#page-receipt-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding-block: 0;
  overflow: hidden;
}
.receipt-split-modal {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
/* Top navigation bar */
.rsm-topbar { display: flex; align-items: center; justify-content: space-between; padding: .5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; height: 44px; }
.rsm-back-btn { display: flex; align-items: center; gap: .3rem; background: none; border: none; cursor: pointer; color: var(--text); font-size: .88rem; font-weight: 600; padding: .3rem .5rem; border-radius: var(--radius-sm); transition: background .12s; }
.rsm-back-btn:hover { background: var(--surface2); }
.rsm-topbar-title { font-size: .9rem; font-weight: 600; color: var(--text-2); }
/* Split pane body below topbar */
.rsm-split-body { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.rsm-preview { flex: 1 1 65%; display: flex; flex-direction: column; background: #1e1e1e; min-width: 0; }
.rsm-preview-toolbar { display: flex; justify-content: space-between; align-items: center; padding: .5rem .75rem; background: rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.1); flex-shrink: 0; }
.rsm-preview-toolbar .btn-ghost { color: rgba(255,255,255,.7); }
.rsm-preview-toolbar .btn-ghost:hover { color: #fff; background: rgba(255,255,255,.1); }
.rsm-preview-body {
  --rsm-zoom: 1;
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  min-height: 0;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.24) transparent;
}
.rsm-preview-body::-webkit-scrollbar { width: 8px; height: 8px; }
.rsm-preview-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: var(--radius-pill); }
.rsm-preview-body.has-pdf { padding: 0; }
.rsm-preview-body img {
  width: calc(100% * var(--rsm-zoom));
  max-width: none;
  height: auto;
  border-radius: var(--radius-xs);
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  display: block;
  flex: 0 0 auto;
}
.rsm-preview-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.rsm-zoom-btn {
  min-width: 30px;
  height: 26px;
  justify-content: center;
  font-weight: 800;
}
.rsm-no-file { color: rgba(255,255,255,.35); display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: auto; padding-top: 3rem; }
.rsm-claim-strip { background: rgba(255,255,255,.05); border-top: 1px solid rgba(255,255,255,.1); padding: .6rem .75rem; font-size: .78rem; color: rgba(255,255,255,.65); flex-shrink: 0; }
#rm-folia {
  max-height: 44px;
  overflow: hidden;
  padding: .35rem .75rem;
}
#rm-folia.is-open {
  max-height: 248px;
}
#rm-folia-viewer {
  display: none;
  height: 208px;
  min-height: 0;
  margin-top: .45rem;
}
#rm-folia.is-open #rm-folia-viewer {
  display: block;
}
#rm-folia-viewer folia-viewer {
  display: block;
  height: 100%;
  min-height: 0;
}
.rsm-folia-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.78);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 750;
}
.rsm-folia-toggle b {
  color: rgba(255,255,255,.54);
  font-size: .72rem;
}
.rsm-form { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border); overflow: hidden; }
.rsm-form-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.rsm-form-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.rsm-form-body { flex: 1; overflow-y: auto; padding: .5rem .75rem .75rem; display: flex; flex-direction: column; gap: 0; }
/* Sections inside receipt modal — same style as inline review panel */
.rsm-form-body .wf-review-section { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.rsm-form-body .wf-review-section:last-of-type { border-bottom: none; }
/* Slightly wider label column to fit Chinese labels */
.rsm-form-body .wf-field-row { grid-template-columns: 84px 1fr; }
.rsm-form-body .wf-field-row.indented { margin-left: 1rem; grid-template-columns: 74px 1fr; }
.rsm-form-footer { display: flex; align-items: center; gap: .4rem; padding: .65rem 1rem; border-top: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }

/* ── Tax validation traffic light ───────────────────────────────────────── */
.rm-tax-check {
  display: flex; align-items: center; gap: .45rem;
  margin-top: .4rem; padding: .28rem .55rem;
  border-radius: var(--radius-sm); font-size: .74rem;
  background: var(--surface2); color: var(--text-muted);
  transition: background .15s, color .15s;
}
.rm-tax-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--border); transition: background .15s;
}
.rm-tax-dot.tc-green { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.2); }
.rm-tax-dot.tc-red   { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.2); }
.rm-tax-check.tc-green { background: rgba(34,197,94,.07); color: #16a34a; }
.rm-tax-check.tc-red   { background: rgba(239,68,68,.07); color: #dc2626; }

@media (max-width: 680px) {
  .receipt-split-modal { flex-direction: column; }
  .rsm-preview { flex: 0 0 45vh; }
  .rsm-form { width: 100%; border-left: none; border-top: 1px solid var(--border); }
}

/* ── Invoice document-style editor ───────────────────────────────────────── */
.inv-doc-shell { position: fixed; inset: 0; z-index: 1100; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.inv-doc-toolbar { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; gap: .75rem; }
.inv-doc-toolbar-title { font-weight: 700; font-size: .95rem; color: var(--text-2); }
.inv-status-select { font-size: .78rem; padding: .2rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg); color: var(--text); cursor: pointer; }
.inv-entity-bar { display: flex; align-items: center; gap: .5rem; padding: .45rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface2); flex-shrink: 0; min-height: 40px; }
.inv-entity-tab { font-size: .82rem; padding: .25rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-pill); cursor: pointer; background: var(--bg); color: var(--text-2); white-space: nowrap; transition: all .12s; }
.inv-entity-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.inv-entity-tab:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.inv-doc-scroll { flex: 1; overflow-y: auto; background: #e8e8e8; padding: 2rem 1rem; }
.inv-doc-page { max-width: 800px; margin: 0 auto; background: #fff; border-radius: var(--radius-xs); box-shadow: 0 2px 16px rgba(0,0,0,.12); padding: 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.inv-doc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; }
.inv-doc-header-left { flex: 1; }
.inv-doc-heading { font-size: 2rem; font-weight: 900; color: #1a1a1a; letter-spacing: -.02em; line-height: 1; }
.inv-doc-number-input { border: none; border-bottom: 1px dashed #ccc; background: transparent; font-size: .95rem; color: #555; width: 100%; max-width: 260px; padding: .2rem 0; margin-top: .4rem; outline: none; }
.inv-doc-number-input:focus { border-bottom-color: var(--primary); }
.inv-doc-logo-area { width: 110px; height: 80px; border: 1.5px dashed #ccc; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; overflow: hidden; transition: border-color .15s; position: relative; }
.inv-doc-logo-area:hover { border-color: var(--primary); }
.inv-doc-no-logo { font-size: .78rem; color: #aaa; text-align: center; pointer-events: none; }
.inv-doc-logo-area img { width: 100%; height: 100%; object-fit: contain; }
.inv-doc-meta { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; }
.inv-doc-from-to { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.inv-doc-address-block { display: flex; flex-direction: column; gap: .3rem; }
.inv-addr-label { font-size: .72rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .06em; }
.inv-doc-address-block textarea { border: none; background: #f9f9f9; border-radius: var(--radius-xs); padding: .5rem; font-size: .85rem; color: #333; resize: none; width: 100%; font-family: inherit; line-height: 1.5; min-height: 90px; outline: none; border: 1px solid transparent; transition: border-color .12s; }
.inv-doc-address-block textarea:focus { border-color: var(--primary); background: #fff; }
.inv-doc-dates { display: flex; flex-direction: column; gap: .5rem; min-width: 170px; }
.inv-date-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.inv-date-row label { font-size: .78rem; color: #888; white-space: nowrap; }
.inv-date-row input, .inv-date-row select { font-size: .82rem; border: 1px solid #e0e0e0; border-radius: var(--radius-xs); padding: .2rem .4rem; background: #f9f9f9; color: #333; }
.inv-doc-items { }
.inv-doc-items .inv-items-table { background: #f9f9f9; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid #e8e8e8; }
.inv-doc-items .inv-items-table th { background: #f0f0f0; color: #666; font-size: .75rem; }
.inv-doc-items .inv-items-table td input { background: transparent; }
.inv-doc-bottom { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; }
.inv-doc-notes textarea { width: 100%; border: 1px solid #e0e0e0; border-radius: var(--radius-sm); padding: .6rem .75rem; font-size: .85rem; color: #333; resize: vertical; font-family: inherit; background: #f9f9f9; outline: none; min-height: 80px; }
.inv-doc-notes textarea:focus { border-color: var(--primary); background: #fff; }
.inv-doc-totals { min-width: 260px; display: flex; flex-direction: column; gap: .5rem; }
.inv-tax-controls { background: #f5f5f5; border-radius: var(--radius-sm); padding: .5rem .6rem; display: flex; flex-direction: column; gap: .3rem; }
.inv-tax-line { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: #555; }
.inv-tax-label-input { border: none; background: transparent; font-size: .82rem; color: #333; width: 55px; outline: none; border-bottom: 1px dashed #ccc; padding: .1rem 0; }
.inv-tax-label-input:focus { border-bottom-color: var(--primary); }
.inv-tax-rate-input { border: none; background: transparent; font-size: .82rem; color: #333; width: 40px; text-align: right; outline: none; border-bottom: 1px dashed #ccc; padding: .1rem 0; }
.inv-tax-rate-input:focus { border-bottom-color: var(--primary); }
.inv-doc-terms textarea { width: 100%; border: none; border-top: 1px dashed #ddd; padding: .5rem 0; font-size: .82rem; color: #888; font-family: inherit; background: transparent; resize: none; outline: none; }
.inv-doc-terms textarea:focus { color: #333; }

/* ── Category table in settings ───────────────────────────────────────────── */
.cat-table-card { padding: 0 !important; overflow: hidden; }
.cat-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cat-table th { background: var(--surface2); padding: .5rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }
.cat-table td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cat-table tr:last-child td { border-bottom: none; }
.cat-table tr:hover td { background: var(--surface2); }
.cat-table tr.cat-disabled td { opacity: .45; }
.cat-tname { font-weight: 600; font-size: .9rem; }
.cat-tdesc { font-size: .82rem; color: var(--text-2); }
.cat-color-cell { display: flex; align-items: center; gap: .5rem; }
.cat-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.cat-color-hex { font-size: .78rem; color: var(--text-2); font-family: var(--font-mono); }
.cat-tactions { display: flex; gap: .3rem; }
.cat-tactions .btn { padding: .2rem .45rem; font-size: .8rem; color: var(--text-2); }
.cat-tactions .btn:hover { color: var(--primary); }
.cat-tactions .btn-del:hover { color: var(--danger) !important; }

/* Color picker in category modal */
.cm-color-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cm-color-input { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: none; flex-shrink: 0; }
.cm-color-swatches { display: flex; gap: .35rem; flex-wrap: wrap; }
.cm-swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .12s, border-color .12s; flex-shrink: 0; }
.cm-swatch:hover { transform: scale(1.2); }
.cm-swatch.selected { border-color: var(--text); transform: scale(1.15); }

/* ── Invoice settings tables ──────────────────────────────────────────────── */
.inv-stg-card { margin-bottom: .75rem; padding: 0 !important; overflow: hidden; }
.inv-stg-card .stg-section-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.inv-stg-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.inv-stg-table th { background: var(--surface2); padding: .5rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.inv-stg-table td { padding: .55rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.inv-stg-table tr:last-child td { border-bottom: none; }
.inv-stg-table tr:hover td { background: var(--surface2); }
.inv-stg-table tr.inv-stg-inactive td { opacity: .45; }
.inv-stg-name { font-weight: 600; }
.inv-stg-calc { font-size: .8rem; color: var(--text-2); }
.inv-stg-actions { display: flex; gap: .3rem; }
.inv-stg-actions .btn { padding: .2rem .45rem; font-size: .8rem; color: var(--text-2); }
.inv-stg-actions .btn:hover { color: var(--primary); }
.inv-stg-actions .btn-del:hover { color: var(--danger) !important; }
.inv-stg-badge { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: var(--radius-pill); background: var(--primary); color: #fff; font-weight: 600; }

/* ── Dynamic extra lines in invoice editor ────────────────────────────────── */
.inv-extra-lines-area { background: #f5f5f5; border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
/* Three-section structure */
.inv-extra-section { border-bottom: 1px solid #e8e8e8; }
.inv-extra-section:last-child { border-bottom: none; }
.inv-extra-section-header { display: flex; align-items: center; justify-content: space-between; padding: .3rem .55rem; background: #efefef; }
.inv-extra-section-rows { padding: .1rem .3rem; display: flex; flex-direction: column; gap: .05rem; }
.inv-extra-empty { font-size: .78rem; color: #aaa; padding: .25rem .25rem; font-style: italic; }
/* Row within a section */
.inv-extra-line { display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: #555; padding: .2rem .2rem; }
.inv-extra-label { flex: 1; min-width: 0; font-size: .82rem; color: #444; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-extra-type-badge { font-size: .68rem; padding: .1rem .45rem; border-radius: var(--radius-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0; }
.inv-extra-type-badge.tax { background: #dbeafe; color: #0066D6; }
.inv-extra-type-badge.fee { background: #dcfce7; color: #15803d; }
.inv-extra-type-badge.discount { background: #fef9c3; color: #854d0e; }
.inv-extra-val { width: 64px; text-align: right; border: none; background: transparent; font-size: .82rem; color: #333; outline: none; border-bottom: 1px dashed #ccc; padding: .1rem 0; }
.inv-extra-val:focus { border-bottom-color: var(--primary); }
.inv-extra-unit { font-size: .78rem; color: #888; width: 18px; flex-shrink: 0; }
.inv-extra-del { background: none; border: none; cursor: pointer; color: #bbb; font-size: 1rem; line-height: 1; padding: 0 .2rem; transition: color .1s; flex-shrink: 0; }
.inv-extra-del:hover { color: var(--danger); }
.inv-extra-lines-actions { display: flex; gap: .35rem; padding-top: .25rem; }
.btn-xs { font-size: .75rem !important; padding: .18rem .55rem !important; }

/* ── @media print ─────────────────────────────────────────────────────────── */
@media print {
  body > *:not(.inv-doc-shell) { display: none !important; }
  .inv-doc-shell { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex !important; flex-direction: column; }
  .inv-doc-toolbar, .inv-entity-bar { display: none !important; }
  .inv-doc-scroll { overflow: visible !important; background: #fff !important; padding: 0 !important; }
  .inv-doc-page { box-shadow: none !important; margin: 0 !important; max-width: none !important; border-radius: 0 !important; padding: 1.5cm !important; }
  .inv-extra-del, .inv-extra-lines-actions, #btn-inv-add-item { display: none !important; }
  .inv-doc-address-block textarea, .inv-doc-notes textarea, .inv-doc-terms textarea { border: none !important; background: transparent !important; }
  .inv-items-table td input { border: none !important; background: transparent !important; }
  .inv-doc-number-input { border: none !important; }
  .inv-date-row input, .inv-date-row select { border: none !important; background: transparent !important; }
  .inv-extra-val { border: none !important; }
}

/* ── AI Extraction Prompt (settings) ──────────────────────────────────────── */
.ai-prompt-status {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .75rem; margin-bottom: 12px;
  background: var(--surface2); border-radius: var(--radius-sm);
  font-size: .82rem; color: var(--text2);
}
.ai-prompt-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #22c55e;
}
.ai-status-custom  { color: #32ADE6; font-weight: 600; }
.ai-status-default { color: #0891b2; font-weight: 600; }

.ai-prompt-default-wrap { margin-bottom: 4px; }
.ai-prompt-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: .82rem; padding: 0;
  margin-bottom: 8px; text-decoration: underline; text-underline-offset: 3px;
}
.ai-prompt-toggle:hover { color: var(--primary-dark, #0066D6); }

.ai-prompt-family-tabs {
  display: flex; gap: .35rem; margin-bottom: 8px; flex-wrap: wrap;
}
.ai-pfam-tab {
  font-size: .75rem; padding: .25rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface2);
  cursor: pointer; color: var(--text2); transition: all .15s;
}
.ai-pfam-tab.active,
.ai-pfam-tab:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

.ai-prompt-preview {
  width: 100%; height: 220px; resize: vertical;
  font-family: var(--font-mono); font-size: .75rem;
  padding: .65rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text2); line-height: 1.55;
}

.ai-prompt-editor {
  width: 100%; height: 200px; resize: vertical;
  font-family: var(--font-mono); font-size: .78rem;
  padding: .65rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); line-height: 1.6; margin-top: 6px;
  transition: border-color .15s;
}
.ai-prompt-editor:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,132,255,.1);
}

/* ── Product / Service Catalog (settings) ─────────────────────────────────── */
.prod-search-wrap { margin-bottom: 12px; }
.prod-search-wrap input {
  width: 100%; padding: .45rem .75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: .85rem;
}
.prod-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 0; border-bottom: 1px solid var(--border);
}
.prod-card:last-child { border-bottom: none; }
.prod-card-info { flex: 1; min-width: 0; }
.prod-card-name {
  font-weight: 600; font-size: .9rem;
  display: flex; align-items: baseline; gap: .5rem;
}
.prod-card-code {
  font-weight: 400; font-size: .72rem; color: var(--text2);
  background: var(--surface2); padding: .1rem .4rem;
  border-radius: var(--radius-xs); font-family: var(--font-mono);
}
.prod-card-meta {
  display: flex; gap: .75rem; font-size: .78rem;
  color: var(--text2); margin-top: .15rem; flex-wrap: wrap;
}
.prod-card-unit {
  background: #dbeafe; color: #0066D6;
  padding: .1rem .4rem; border-radius: var(--radius-xs); font-size: .7rem; font-weight: 600;
}
.prod-card-price { color: var(--text); font-weight: 500; }
.prod-card-desc  { font-style: italic; }

/* ── Invoice line item: catalog button + unit column ─────────────────────── */
.item-desc-wrap {
  display: flex; align-items: center; gap: .3rem;
}
.item-desc-wrap .item-desc { flex: 1; }
.item-catalog-btn {
  background: none; border: none; cursor: pointer;
  font-size: .95rem; padding: 0 .15rem; opacity: .55;
  transition: opacity .15s; flex-shrink: 0; line-height: 1;
}
.item-catalog-btn:hover { opacity: 1; }

/* ── Product picker floating panel ──────────────────────────────────────── */
.prod-picker-panel {
  position: absolute; z-index: 9999;
  width: 300px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  overflow: hidden;
}
.prod-picker-search {
  padding: .5rem;
  border-bottom: 1px solid var(--border);
}
.prod-picker-search input {
  width: 100%; padding: .38rem .65rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .83rem; background: var(--surface2); color: var(--text);
}
.prod-picker-list { max-height: 220px; overflow-y: auto; }
.prod-picker-item {
  padding: .55rem .75rem; cursor: pointer;
  transition: background .1s; border-bottom: 1px solid var(--border);
}
.prod-picker-item:last-child { border-bottom: none; }
.prod-picker-item:hover { background: var(--surface2); }
.prod-picker-item-name { font-size: .85rem; font-weight: 600; }
.prod-picker-item-meta { font-size: .75rem; color: var(--text2); margin-top: .1rem; }
.prod-picker-empty { padding: .75rem; font-size: .82rem; color: var(--text2); text-align: center; }
.prod-picker-footer {
  padding: .4rem .5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}

/* ── AI Workflow Tabs ─────────────────────────────────────────────────────── */
/* ── Workflow tab bar — Apple-style underline tabs ─────────────────────── */
.wf-tab-bar {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
  flex-wrap: wrap; overflow-x: auto;
}
.wf-tab {
  display: flex; align-items: center; gap: var(--space-1);
  padding: .55rem 1rem; border-radius: 0; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: transparent; color: var(--text2);
  cursor: pointer; font-size: .82rem; font-weight: 500;
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.wf-tab:hover  { color: var(--text); }
.wf-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.wf-tab-icon   { width: 15px; height: 15px; flex-shrink: 0; }
.wf-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--radius-pill); font-size: .72rem; font-weight: 700;
  background: var(--border); color: var(--text2);
}
.wf-tab.active .wf-badge { background: rgba(10,132,255,.15); color: var(--primary); }
.wf-tab:not(.active) .wf-badge-blue   { background: #dbeafe; color: #0066D6; }
.wf-tab:not(.active) .wf-badge-orange { background: #fef3c7; color: #d97706; }
.wf-tab:not(.active) .wf-badge-green  { background: #dcfce7; color: #16a34a; }
.wf-badge.hidden { display: none; }

/* ── Workflow rows ───────────────────────────────────────────────────────── */
.wf-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
  min-height: 72px;
}
.wf-row:hover { background: var(--surface2); }
.wf-row:last-child { border-bottom: none; }

.wf-row-thumb   {
  width: 72px; height: 72px;
  flex-shrink: 0; cursor: pointer;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
}
.wf-thumb-img   { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }
.wf-thumb-placeholder { display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); background: var(--surface2); border-radius: var(--radius-sm); padding: 4px 8px; }

.wf-row-info    { flex: 1; min-width: 0; cursor: pointer; }
.wf-row-vendor  { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-row-meta    { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.wf-row-amount  { font-weight: 700; font-size: 1rem; color: var(--text); }
.wf-row-actions { display: flex; gap: .4rem; flex-shrink: 0; flex-wrap: nowrap; align-items: center; }
.wf-row-status  { flex-shrink: 0; }
.wf-row-select  { flex-shrink: 0; display: flex; align-items: center; }
.wf-row-conf    { flex-shrink: 0; }
.wf-err-text    { color: var(--danger); font-size: .75rem; }

/* Pending row — inline review expands below the row */
.wf-row-pending { flex-wrap: wrap; align-items: center; }
.wf-row-pending > .wf-inline-review { width: 100%; }
.wf-inline-review { display: none; width: 100%; margin-top: .5rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.wf-inline-review.open { display: block; }
.wf-high-conf { border-left: 3px solid var(--success, #22c55e); }

/* ── 5-stage Preparing pipeline track ───────────────────────────────────── */
.wf-stage-track {
  display: flex; align-items: flex-start; gap: 0;
  margin-top: .45rem; padding: .15rem 0;
}
.stage-node { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.stage-node-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--border); border: 2px solid var(--border); flex-shrink: 0; transition: background .2s;
}
.stage-node-label { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.stage-connector  { flex: 1; min-width: 10px; height: 2px; background: var(--border); margin-top: 3px; transition: background .2s; }
.stage-node.done .stage-node-dot   { background: #22c55e; border-color: #22c55e; }
.stage-node.done .stage-node-label { color: #16a34a; font-weight: 600; }
.stage-connector.done { background: #22c55e; }
.stage-node.active .stage-node-dot {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,132,255,.2);
  animation: stage-pulse 1.2s ease-in-out infinite;
}
.stage-node.active .stage-node-label { color: var(--primary); font-weight: 700; }
@keyframes stage-pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(10,132,255,.18); }
  50%     { box-shadow: 0 0 0 5px rgba(10,132,255,.32); }
}
.wf-spin-label { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--text-muted); }

/* ── Status chips ─────────────────────────────────────────────────────────── */
.wf-status-chip { font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: var(--radius-pill); white-space: nowrap; }
.wf-chip-queued    { background: #E5F1FF; color: #0A84FF; }
.wf-chip-inbox     { background: var(--surface2); color: var(--text2); }
.wf-chip-processing { background: #fef9c3; color: #a16207; }
.wf-chip-escalated  { background: #fef3c7; color: #d97706; }
.wf-chip-confirmed  { background: #dcfce7; color: #16a34a; }
.wf-spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Confidence badge ─────────────────────────────────────────────────────── */
.conf-badge { font-size: .72rem; font-weight: 700; padding: .18rem .5rem; border-radius: var(--radius-pill); }
.conf-high  { background: #dcfce7; color: #16a34a; }
.conf-mid   { background: #fef3c7; color: #d97706; }
.conf-low   { background: #fee2e2; color: #dc2626; }

/* ── 批量修订 (Batch Review) Panel ───────────────────────────────────────── */
/* When a pending row has an open review panel, span it across the full card grid */
.wf-row-pending:has(.wf-inline-review.open) {
  grid-column: 1 / -1;
}

.wf-inline-review {
  border-top: 2px solid var(--primary);
  background: var(--card-bg);
  padding: 0;
  overflow: hidden;
}

.wf-review-panel {
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: 0;
  background: var(--card-bg);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  height: min(760px, calc(100dvh - 148px));
  min-height: min(520px, calc(100dvh - 148px));
}
@media (max-width: 700px) {
  .wf-review-panel { grid-template-columns: 1fr; height: min(760px, calc(100dvh - 132px)); }
}

/* ── Left column: confidence + full-width scrollable image ── */
.wf-review-left {
  display: flex; flex-direction: column;
  background: #1a1a2e;          /* dark background — receipt "lightbox" feel */
  border-right: 1px solid var(--border);
  min-height: 0;
  overflow: hidden;
}

/* Confidence strip — top of left column */
.wf-conf-strip {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .75rem;
  background: rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
/* Conf strip items — white text on dark left column */
.wf-conf-label { font-size: .68rem; color: rgba(255,255,255,.5); white-space: nowrap; }
.wf-conf-bar-wrap { flex: 1; height: 5px; background: rgba(255,255,255,.12); border-radius: var(--radius-pill); overflow: hidden; }
.wf-conf-bar { height: 100%; border-radius: var(--radius-pill); transition: width .4s; }
.wf-conf-pct   { font-size: .78rem; font-weight: 700; min-width: 32px; text-align: right; color: #fff; }
.wf-conf-model { font-size: .72rem; color: rgba(255,255,255,.4); flex-shrink: 0; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Image container — 100% width, natural height, scrollable.
   position:relative is required so the OCR text layer sits on top. */
.review-img-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;             /* scroll when receipt is taller than viewport */
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: #0d0d1a;          /* very dark bg for receipt contrast */
  /* custom scrollbar on dark bg */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.review-img-wrap::-webkit-scrollbar { width: 5px; }
.review-img-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: var(--radius-pill); }

/* Receipt image fills full width, natural height — no letterbox */
.wf-preview-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.review-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  transform-origin: top left;
  z-index: 2;
}

.review-text-layer span {
  position: absolute;
  display: block;
  overflow: hidden;
  color: transparent;
  border-radius: var(--radius-xs);
  line-height: 1;
  white-space: nowrap;
}

.review-text-layer span.is-active {
  background: rgba(255, 214, 10, .38);
  box-shadow: 0 0 0 1px rgba(255, 159, 10, .8), 0 0 0 4px rgba(255, 214, 10, .16);
}

.review-text-layer span.is-fallback {
  background: rgba(255, 214, 10, .22);
  box-shadow: 0 0 0 1px rgba(255, 159, 10, .68);
}

/* ── Right column: flex column, body scrolls, actions sticky ── */
.wf-review-right {
  display: flex; flex-direction: column;
  overflow: hidden;       /* inner body handles its own scroll */
  background: var(--card-bg);
  min-height: 0;
}

/* Right column header bar with actions */
.wf-review-right-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .9rem .4rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  gap: .5rem;
}
.wf-review-right-header .wf-review-title {
  font-size: .75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.wf-review-right-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: .6rem .9rem;
  overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 0;
}

/* ── Field groups in review panel ──────────────────────────────────────── */
.wf-review-section {
  display: flex; flex-direction: column; gap: .35rem;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.wf-review-section:last-of-type { border-bottom: none; }
.wf-review-section-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: .1rem;
  display: flex; align-items: center; gap: .35rem;
}
.wf-review-section-title::before {
  content: ''; display: block; width: 3px; height: 11px;
  background: var(--primary); border-radius: var(--radius-xs); flex-shrink: 0;
}

/* Field rows */
.wf-field-row {
  display: grid; grid-template-columns: 78px 1fr;
  gap: .4rem; align-items: center;
  border-radius: var(--radius-xs); padding: 1px 3px;
  transition: background .1s;
}
.wf-field-row.indented   { margin-left: 1rem; grid-template-columns: 68px 1fr; }
.wf-field-row.wf-field-row-tall { align-items: flex-start; padding-top: .25rem; }
/* Highlight row + its input when hovering a field that has a bbox */
.wf-field-row[data-field]:hover { background: rgba(10,132,255,.05); cursor: crosshair; }
.wf-field-row[data-field]:hover .wf-field-label { color: var(--primary); }
.wf-field-row[data-field]:hover .wf-field-input { border-color: var(--primary); }

.wf-field-label { font-size: .74rem; color: var(--text-muted); white-space: nowrap; user-select: none; }
.wf-field-input {
  width: 100%; padding: .28rem .5rem; font-size: .82rem;
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  background: var(--card-bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.wf-field-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(10,132,255,.12); }
select.wf-field-input { appearance: auto; padding-right: .25rem; }
textarea.wf-field-input { resize: vertical; min-height: 52px; }
/* Primary amount row stands out slightly */
.wf-field-row-primary .wf-field-label { font-weight: 600; color: var(--text); }
.wf-field-row-primary .wf-field-total { font-weight: 700; font-size: .9rem; }

/* Action bar — sticky at bottom of right column */
.wf-review-actions {
  display: flex; gap: .5rem; flex-wrap: wrap;
  padding: .65rem .9rem;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  position: sticky; bottom: 0; z-index: 2;
}

/* ── Batch bar ─────────────────────────────────────────────────────────────── */
.wf-batch-bar { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; background: #eff6ff; border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid #bfdbfe; font-size: .82rem; }
.wf-batch-bar label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.wf-processing-note { font-size: .8rem; color: var(--text2); padding: .4rem; margin-bottom: 8px; }
.wf-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3.5rem 2rem; gap: .75rem; text-align: center;
}
.wf-empty-icon {
  width: 52px; height: 52px; border-radius: var(--radius-lg);
  background: var(--surface2); display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; line-height: 1; margin-bottom: .25rem;
}
.wf-empty-title { font-size: .95rem; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.wf-empty-sub   { font-size: .82rem; color: var(--text2); max-width: 220px; line-height: 1.5; }

/* ── AI Providers sub-tab — Apple segmented control ────────────────────── */
.ai-sub-nav {
  display: flex; gap: 0; padding: 3px;
  background: var(--surface2, #f1f5f9);
  border-radius: var(--radius-md); margin-bottom: 20px;
}
.ai-sub-tab-btn {
  flex: 1; padding: .45rem .6rem;
  border: none; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-2, #64748b); font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: all .15s; white-space: nowrap; text-align: center;
  letter-spacing: -.01em;
}
.ai-sub-tab-btn:hover { color: var(--text, #0f172a); }
.ai-sub-tab-btn.active {
  background: var(--surface, #fff); color: var(--text, #0f172a); font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.10), 0 0 0 .5px rgba(0,0,0,.05);
}
.ai-sub-panel { animation: fadeIn .15s ease; }
.wf-high-conf { border-left: 3px solid #22c55e; }

/* ── OCR / Layout provider panels ─────────────────────────────────────── */
.aprov-panel {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.aprov-panel-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 1rem;
}
.aprov-panel-info { flex: 1; }
.aprov-panel-title {
  font-size: .95rem; font-weight: 700;
  color: var(--text, #0f172a); margin-bottom: .25rem;
}
.aprov-panel-desc { font-size: .8rem; color: var(--text-2, #64748b); line-height: 1.5; }
.aprov-list { display: flex; flex-direction: column; }
.aprov-list .provider-card:last-child { border-bottom: none; }
.aprov-list .hint { font-size: .8rem; color: var(--text-3, #94a3b8); padding: .5rem 0; }
.aprov-active-row {
  display: flex; align-items: center; gap: .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
  flex-wrap: wrap;
}
.aprov-active-label {
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-2, #64748b); white-space: nowrap;
  flex-shrink: 0;
}
.aprov-active-select {
  flex: 1; min-width: 160px;
  font-size: .83rem; padding: .38rem .65rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm); background: var(--bg, #f8fafc);
  color: var(--text, #0f172a); cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center;
  padding-right: 1.8rem;
}
.aprov-active-select:focus {
  outline: none; border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ── LLM Provider Library ──────────────────────────────────────────────── */
.llm-lib {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md); padding: 1.25rem;
  margin-bottom: 1rem;
}
.llm-lib-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.llm-lib-title {
  font-size: .95rem; font-weight: 700;
  color: var(--text, #0f172a); margin-right: .5rem;
}
.llm-lib-hint {
  font-size: .75rem; color: var(--text-2, #64748b);
}
.llm-lib-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.llm-lib-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border, #e2e8f0);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm); overflow: hidden;
}
.llm-lib-col {
  background: var(--bg, #f8fafc);
  padding: .85rem;
}
.llm-lib-col:first-child { border-radius: 8px 0 0 8px; }
.llm-lib-col:last-child  { border-radius: 0 8px 8px 0; }
.llm-lib-col-head {
  display: flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-2, #64748b);
  margin-bottom: .65rem;
}
.llm-lib-col-head svg { width: 13px; height: 13px; flex-shrink: 0; opacity: .7; }
.llm-lib-list .provider-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm); padding: .6rem .75rem;
  margin-bottom: .45rem;
}
.llm-lib-list .provider-card:last-child { margin-bottom: 0; }
.llm-lib-list > .hint {
  font-size: .78rem; color: var(--text-3, #94a3b8);
  padding: .25rem 0; line-height: 1.5;
}

/* ── LLM Role Assignment ───────────────────────────────────────────────── */
.llm-roles-section {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md); padding: 1.25rem;
}
.llm-roles-title {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-2, #64748b);
  margin-bottom: .9rem;
}
.llm-same-warning {
  display: flex; align-items: center; gap: .5rem;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius-sm); padding: .6rem .9rem;
  font-size: .8rem; color: #92400e;
  margin-bottom: .9rem;
}
.llm-same-warning svg { width: 14px; height: 14px; flex-shrink: 0; stroke: #d97706; }
.llm-role-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .85rem;
}
@media (max-width: 720px) { .llm-role-grid { grid-template-columns: 1fr; } }
.llm-role-card {
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md); padding: 1rem;
  display: flex; flex-direction: column; gap: .65rem;
  background: var(--bg, #f8fafc);
  transition: border-color .15s, box-shadow .15s;
}
.llm-role-card:focus-within {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.llm-role-std:focus-within { border-color: #93c5fd; }
.llm-role-exp:focus-within { border-color: #c4b5fd; }
.llm-role-top { display: flex; align-items: flex-start; gap: .65rem; }
.llm-role-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 3px;
}
.llm-dot-std { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.llm-dot-exp { background: #32ADE6; box-shadow: 0 0 0 3px rgba(50,173,230,.15); }
.llm-role-name {
  font-size: .88rem; font-weight: 700;
  color: var(--text, #0f172a); line-height: 1.2;
}
.llm-role-subdesc {
  font-size: .75rem; color: var(--text-2, #64748b);
  line-height: 1.45; margin-top: .15rem;
}
.llm-role-select {
  width: 100%; font-size: .82rem; padding: .38rem .65rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm); background: var(--surface, #fff);
  color: var(--text, #0f172a); cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center;
  padding-right: 1.8rem;
}
.llm-role-select:focus {
  outline: none; border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.llm-role-select optgroup { font-style: normal; font-size: .75rem; color: #94a3b8; }
.llm-role-trigger {
  display: flex; align-items: center; gap: .35rem;
  font-size: .72rem; color: var(--text-3, #94a3b8);
  padding-top: .1rem;
}
.llm-role-trigger svg { width: 10px; height: 10px; flex-shrink: 0; }

/* ── Escalation modal ─────────────────────────────────────────────────────── */
.escalation-options { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 8px; }
.escalation-card { padding: .85rem; border-radius: var(--radius-md); border: 2px solid var(--border); cursor: pointer; transition: all .15s; }
.escalation-card:hover { border-color: var(--primary); background: #eff6ff; }
.escalation-card.selected { border-color: var(--primary); background: #eff6ff; }
.escalation-card-icon  {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--surface2);
  color: var(--primary);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}
.escalation-card-title { font-weight: 700; font-size: .88rem; margin-bottom: .2rem; }
.escalation-card-desc  { font-size: .78rem; color: var(--text2); }
.escalation-history    { background: var(--surface2); border-radius: var(--radius-sm); padding: .5rem .75rem; margin-bottom: 12px; font-size: .78rem; }
.escalation-history-title { font-weight: 700; margin-bottom: 6px; color: var(--text2); }
.escalation-history-row { display: flex; gap: .5rem; align-items: center; padding: .2rem 0; }
.esc-hist-num   { color: var(--text2); min-width: 24px; }
.esc-hist-model { flex: 1; color: var(--text); }
.esc-hist-err   { font-size: .7rem; color: var(--danger); }

/* btn-warning (for escalation) */
.btn-warning { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.btn-warning:hover { background: #d97706; }

/* ── Processing mode toggle ─────────────────────────────────────────────────── */
.mode-toggle-group { display:flex; gap: var(--space-2); margin-top:6px; }
.mode-btn {
  flex:1; display:flex; flex-direction:column; align-items:flex-start; gap:3px;
  padding:12px 14px; border:2px solid var(--border); border-radius: var(--radius-sm);
  background:var(--card-bg); cursor:pointer; text-align:left;
  transition:border-color .15s, background .15s;
}
.mode-btn:hover  { border-color:var(--primary); }
.mode-btn.active {
  border-color:var(--primary);
  background:color-mix(in srgb, var(--primary) 8%, var(--card-bg));
}
.mode-icon  {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius: var(--radius-pill);
  background:rgba(10,132,255,.12);
  color:var(--primary);
  font-size:.74rem;
  font-weight:800;
  letter-spacing:.04em;
  line-height:1;
}
.mode-label { font-weight:600; font-size:.875rem; color:var(--text); }
.mode-desc  { font-size:.76rem; color:var(--text-muted); line-height:1.4; margin-top:2px; }

/* ── Stage progress indicators ──────────────────────────────────────────────── */
/* stage track duplicate rules removed — defined above */

/* ── Service provider rows ──────────────────────────────────────────────────── */
.sp-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); }
.sp-row:last-child { border-bottom:none; }
.provider-info   { display:flex; align-items:center; gap: var(--space-2); flex-wrap:wrap; }
.provider-name   { font-weight:500; }
.provider-actions{ display:flex; align-items:center; gap: var(--space-2); flex-shrink:0; }

/* .btn-warning — solid amber; defined above near escalation modal styles */

/* ── Settings section headings ──────────────────────────────────────────────── */
.stg-section-heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 1rem 0 .4rem;
  margin-top: .5rem;
}
.stg-section-heading:first-child { padding-top: 0; margin-top: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   AI 处理中 — 大动画科技感卡片
   ═══════════════════════════════════════════════════════════════════════════ */

.wf-ai-cards-wrap {
  display: flex; flex-direction: column; gap: 1rem;
  padding: .5rem 0;
}

/* ── Card shell ── */
.wf-ai-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #080818 0%, #0f0f2e 50%, #080d1f 100%);
  border: 1px solid rgba(10,132,255,.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1rem;
  box-shadow: 0 0 40px rgba(10,132,255,.1), inset 0 1px 0 rgba(255,255,255,.06);
}
/* Subtle radial glow at top center */
.wf-ai-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(10,132,255,.18) 0%, transparent 65%);
  pointer-events: none;
}
/* Moving grid lines for tech feel */
.wf-ai-card::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(10,132,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,132,255,.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none; opacity: .6;
}

/* ── Top bar: filename + chip ── */
.wf-ai-card-top {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.8rem;
}
.wf-ai-filename {
  font-size: .78rem; color: rgba(255,255,255,.45);
  font-family: ui-monospace, monospace; letter-spacing: .02em;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wf-ai-chip {
  font-size: .72rem; padding: .2rem .65rem;
  background: rgba(10,132,255,.2);
  color: #5AC8FA;
  border: 1px solid rgba(10,132,255,.45);
  border-radius: var(--radius-pill);
  letter-spacing: .05em;
  animation: ai-chip-pulse 2s ease-in-out infinite;
}
@keyframes ai-chip-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(10,132,255,.4); }
  50%       { opacity: .75; box-shadow: 0 0 0 5px rgba(10,132,255,0); }
}

/* ── Hero: concentric rings + stage name ── */
.wf-ai-hero {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: .5rem 0 1.25rem;
}
.wf-ai-rings {
  position: relative; width: 130px; height: 130px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.ai-ring {
  position: absolute; border-radius: 50%;
  border-style: solid;
  animation: ring-expand 2.6s ease-out infinite;
}
.ai-ring-1 { width: 54px;  height: 54px;  border-width: 2px; border-color: rgba(10,132,255,.85);  animation-delay: 0s; }
.ai-ring-2 { width: 88px;  height: 88px;  border-width: 1.5px; border-color: rgba(50,173,230,.55); animation-delay: .5s; }
.ai-ring-3 { width: 124px; height: 124px; border-width: 1px; border-color: rgba(59,130,246,.3);  animation-delay: 1s; }
@keyframes ring-expand {
  0%   { transform: scale(.88); opacity: .9; }
  60%  { transform: scale(1);   opacity: .25; }
  100% { transform: scale(.88); opacity: .9; }
}

.wf-ai-stage-label {
  position: relative; z-index: 2;
  font-size: .95rem; font-weight: 800;
  color: #E5F1FF; letter-spacing: .1em; text-transform: uppercase;
  text-shadow: 0 0 20px rgba(165,180,252,.7);
}

/* ── Scanning line ── */
.wf-ai-scan {
  width: 220px; height: 2px;
  background: linear-gradient(90deg, transparent 0%, #0A84FF 30%, #5AC8FA 50%, #0A84FF 70%, transparent 100%);
  border-radius: var(--radius-pill); margin-bottom: .9rem;
  animation: scan-breathe 1.8s ease-in-out infinite;
}
@keyframes scan-breathe {
  0%, 100% { opacity: .25; transform: scaleX(.35); }
  50%       { opacity: 1;   transform: scaleX(1); }
}

.wf-ai-stage-desc {
  font-size: .75rem; color: rgba(255,255,255,.38);
  letter-spacing: .03em; margin-bottom: .75rem;
}

/* ── Three bouncing dots ── */
.wf-ai-dots { display: flex; gap: .45rem; }
.ai-dot {
  width: 7px; height: 7px; border-radius: 50%;
  animation: dot-wave .9s ease-in-out infinite;
}
.ai-dot:nth-child(1) { background: #0A84FF; animation-delay: 0s; }
.ai-dot:nth-child(2) { background: #32ADE6; animation-delay: .18s; }
.ai-dot:nth-child(3) { background: #3b82f6; animation-delay: .36s; }
@keyframes dot-wave {
  0%, 80%, 100% { transform: scale(.65); opacity: .4; }
  40%            { transform: scale(1.25); opacity: 1; }
}

/* ── Pipeline track at bottom ── */
.wf-ai-pipeline {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; justify-content: center;
  padding: .9rem 1rem .2rem;
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: .5rem;
}
.ai-pipe-node {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  min-width: 72px;
}
.ai-pipe-dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent; transition: all .35s;
}
.ai-pipe-node.done  .ai-pipe-dot { background: #22c55e; border-color: #22c55e; }
.ai-pipe-node.active .ai-pipe-dot {
  background: #0A84FF; border-color: #5AC8FA;
  box-shadow: 0 0 0 4px rgba(10,132,255,.35);
  animation: pipe-active-glow 1.3s ease-in-out infinite;
}
@keyframes pipe-active-glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(10,132,255,.35); }
  50%       { box-shadow: 0 0 0 8px rgba(10,132,255,.1), 0 0 16px rgba(10,132,255,.4); }
}
.ai-pipe-label {
  font-size: .72rem; letter-spacing: .05em; text-align: center;
  color: rgba(255,255,255,.28); white-space: nowrap;
}
.ai-pipe-node.done   .ai-pipe-label { color: #86efac; }
.ai-pipe-node.active .ai-pipe-label { color: #5AC8FA; font-weight: 700; }

.ai-pipe-line {
  flex: 1; height: 1px; min-width: 16px; margin-bottom: 1.4rem;
  background: rgba(255,255,255,.12); transition: background .35s;
}
.ai-pipe-line.done { background: rgba(34,197,94,.6); }

/* ── Dashboard Analytics ────────────────────────────────────────────────── */
.dash-section { margin-top: 1.25rem; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.dash-header h3 { font-size: 1.05rem; font-weight: 700; }
.dash-header select { font-size: .82rem; padding: .3rem .6rem; }

.dash-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.dash-sum-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: .85rem 1rem; box-shadow: var(--shadow); }
.dash-sum-label { font-size: .72rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }
.dash-sum-value { font-size: 1.3rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.dash-sum-trend { font-size: .75rem; font-weight: 600; margin-top: .25rem; }
.dash-sum-trend.up { color: #dc2626; }
.dash-sum-trend.down { color: #16a34a; }
.dash-sum-trend.neutral { color: var(--text-3); }

.dash-chart-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-bottom: 1rem; overflow: hidden; }
.dash-chart-wrap h4 { font-size: .88rem; font-weight: 600; color: var(--text-2); margin-bottom: .75rem; }

.dash-bar-chart { display: flex; align-items: flex-end; gap: var(--space-1); height: 160px; padding-top: .5rem; }
.dash-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; cursor: default; }
.dash-bar-fill { width: 100%; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #0A84FF, #0A84FF); transition: height .4s ease; min-height: 2px; position: relative; }
.dash-bar-fill:hover { background: linear-gradient(180deg, #5AC8FA, #0A84FF); }
.dash-bar-label { font-size: .72rem; color: var(--text-3); margin-top: .3rem; white-space: nowrap; }
.dash-bar-tooltip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; font-size: .72rem; padding: .25rem .5rem; border-radius: var(--radius-xs); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; }
.dash-bar-fill:hover .dash-bar-tooltip { opacity: 1; }
.dash-bar-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: #1e293b; }

.dash-categories-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.25rem; }
.dash-categories-wrap h4 { font-size: .88rem; font-weight: 600; color: var(--text-2); margin-bottom: .75rem; }

.dash-cat-list { display: flex; flex-direction: column; gap: 0; }
.dash-cat-row { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.dash-cat-row:last-child { border-bottom: none; }
.dash-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-cat-name { flex: 1; font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-cat-bar-wrap { width: 120px; height: 6px; border-radius: var(--radius-xs); background: var(--surface2); overflow: hidden; flex-shrink: 0; }
.dash-cat-bar-inner { height: 100%; border-radius: var(--radius-xs); transition: width .4s ease; }
.dash-cat-amount { font-weight: 700; min-width: 80px; text-align: right; font-variant-numeric: tabular-nums; }
.dash-cat-count { font-size: .78rem; color: var(--text-3); min-width: 40px; text-align: right; }


/* ══════════════════════════════════════════════════════════════════════════════
   INBOX PAGE
══════════════════════════════════════════════════════════════════════════════ */

/* View toggle control */
.inbox-view-toggle {
  display: flex; gap: 0; padding: 2px;
  background: var(--surface2, #f1f5f9);
  border-radius: var(--radius-sm);
}
.ivt-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 28px;
  border: none; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-2, #64748b); cursor: pointer;
  transition: all .13s;
}
.ivt-btn svg { width: 14px; height: 14px; }
.ivt-btn:hover  { color: var(--text, #0f172a); }
.ivt-btn.active {
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ── List view ─── */
#inbox-list-view {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md); overflow: hidden;
}
.ib-row {
  display: grid;
  grid-template-columns: 36px 28px 1fr 160px 110px 100px;
  align-items: center;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  transition: background .1s;
  gap: 0;
}
.ib-row:last-child { border-bottom: none; }
.ib-row:hover      { background: var(--surface2, #f8fafc); }
.ib-row.selected   { background: #eff6ff; }
.ib-check  { display: flex; align-items: center; justify-content: center; }
.ib-icon   { font-size: 1.05rem; line-height: 1; }
.ib-name   { font-size: .84rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .6rem; color: var(--text, #0f172a); }
.ib-date   { font-size: .76rem; color: var(--text-2, #64748b); }
.ib-status { }
.ib-action { display: flex; justify-content: flex-end; }

/* ── Grid / icon view ─── */
#inbox-grid-view { padding: .25rem; }
#inbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
}
.ib-card {
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md);
  padding: .85rem .75rem .75rem;
  cursor: pointer; position: relative;
  transition: border-color .12s, box-shadow .12s;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  text-align: center;
}
.ib-card:hover   { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.ib-card.selected { border-color: #3b82f6; background: #eff6ff; }
.ib-card-check {
  position: absolute; top: .45rem; left: .45rem;
}
.ib-card-icon  { font-size: 2rem; line-height: 1; }
.ib-card-name  { font-size: .72rem; font-weight: 500; color: var(--text, #0f172a); word-break: break-all; line-height: 1.35; }
.ib-card-status { }

/* ══════════════════════════════════════════════════════════════════════════════
   PREPARING PAGE — PIPELINE
══════════════════════════════════════════════════════════════════════════════ */

.prep-pipeline-wrap {
  padding: 2rem 1.5rem 1rem;
}

.prep-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 1rem 0 1.5rem;
}

/* ── Stage node ── */
.prep-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  width: 110px;
  flex-shrink: 0;
  transition: transform .25s;
}

.prep-stage-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface1);
  position: relative; z-index: 1;
  transition: border-color .3s, background .3s, box-shadow .3s;
}
.prep-stage-icon svg { width: 26px; height: 26px; stroke: var(--text-3); transition: stroke .3s; }

.prep-stage-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  width: 60px; height: 60px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

.prep-stage-name {
  font-size: .8rem; font-weight: 700;
  color: var(--text-3);
  transition: color .3s;
  text-align: center;
}
.prep-stage-desc {
  font-size: .68rem; color: var(--text-3);
  opacity: .7; text-align: center;
  transition: color .3s;
}

/* ── Active stage ── */
.prep-stage.active .prep-stage-icon {
  border-color: #0A84FF;
  background: #ede9fe;
  box-shadow: 0 0 0 6px #0A84FF20, 0 0 20px #0A84FF40;
}
.prep-stage.active .prep-stage-icon svg { stroke: #0A84FF; }
.prep-stage.active .prep-stage-name { color: #0A84FF; }
.prep-stage.active .prep-stage-desc { color: #5AC8FA; opacity: 1; }
.prep-stage.active .prep-stage-glow {
  background: radial-gradient(circle, #0A84FF60 0%, transparent 70%);
  opacity: 1;
  animation: prep-glow-pulse 1.6s ease-in-out infinite;
}
.prep-stage.active { transform: translateY(-4px); }

/* ── Done stage ── */
.prep-stage.done .prep-stage-icon {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px #22c55e20;
}
.prep-stage.done .prep-stage-icon svg { stroke: #22c55e; }
.prep-stage.done .prep-stage-name { color: #22c55e; }

/* ── Connector ── */
.prep-connector {
  width: 50px; height: 2px;
  background: var(--border);
  flex-shrink: 0;
  position: relative;
  transition: background .4s;
  overflow: hidden;
}
.prep-connector.lit {
  background: #0A84FF;
}
.prep-connector.lit::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, #ffffff80, transparent);
  animation: prep-shimmer 1.5s linear infinite;
}

/* ── Animations ── */
@keyframes prep-glow-pulse {
  0%, 100% { transform: translate(-50%, -52%) scale(1);   opacity: .6; }
  50%       { transform: translate(-50%, -52%) scale(1.4); opacity: 1;  }
}
@keyframes prep-shimmer {
  to { left: 200%; }
}

/* ── Status dot ── */
.prep-pulse-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-3);
  display: inline-block;
  margin-right: .35rem;
  transition: background .3s;
}
.prep-pulse-dot.active {
  background: #22c55e;
  box-shadow: 0 0 0 3px #22c55e30;
  animation: prep-dot-pulse 1.2s ease-in-out infinite;
}
@keyframes prep-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #22c55e30; }
  50%       { box-shadow: 0 0 0 7px #22c55e10; }
}
.prep-status-dot-wrap { display: flex; align-items: center; font-size: .85rem; font-weight: 500; }

/* ── Queue list ── */
.prep-queue-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 1.5rem 1.5rem;
}
.prep-queue-header {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: .4rem;
}
.prep-queue-count {
  background: var(--primary-bg, #ede9fe);
  color: var(--primary, #0A84FF);
  border-radius: var(--radius-pill);
  font-size: .72rem; font-weight: 700;
  padding: .1rem .5rem;
}

.prep-queue-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .5rem;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.prep-queue-row:hover       { background: var(--surface2); }
.prep-queue-row.processing  { background: var(--surface2); border-left: 3px solid #0A84FF; }

.prep-queue-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.prep-spin { display: inline-block; animation: prep-rotate 1s linear infinite; }
@keyframes prep-rotate { to { transform: rotate(360deg); } }

.prep-queue-info  { flex: 1; min-width: 0; }
.prep-queue-name  { font-size: .85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prep-queue-stage { font-size: .72rem; color: var(--text-3); margin-top: .15rem; }

.prep-mini-pipeline { display: flex; align-items: center; gap: 2px; }
.queue-pipe-node {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
  transition: background .3s;
}
.queue-pipe-node.qp-done   { background: #22c55e; }
.queue-pipe-node.qp-active { background: #0A84FF; box-shadow: 0 0 0 3px #0A84FF30; animation: prep-dot-pulse 1s infinite; }
.queue-pipe-line { width: 12px; height: 2px; background: var(--border); transition: background .3s; }
.queue-pipe-line.done { background: #22c55e; }

/* Idle rings animation */
.prep-idle-rings {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 1.5rem;
  display: flex; align-items: center; justify-content: center;
}
.prep-idle-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  animation: prep-idle-expand 2.4s ease-out infinite;
}
.prep-idle-ring.r1 { width: 30px; height: 30px; animation-delay: 0s; }
.prep-idle-ring.r2 { width: 50px; height: 50px; animation-delay: .6s; }
.prep-idle-ring.r3 { width: 70px; height: 70px; animation-delay: 1.2s; }
.prep-idle-icon { font-size: 1.2rem; color: var(--text-3); position: relative; z-index: 1; }
@keyframes prep-idle-expand {
  0%   { opacity: .5; transform: scale(.8); }
  70%  { opacity: .2; }
  100% { opacity: 0;  transform: scale(1.1); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   MANUAL REVIEW PAGE
══════════════════════════════════════════════════════════════════════════════ */

/* Layout containers */
#page-manual-review:not(.hidden) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

#page-manual-review > .page-header {
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 4;
  margin: 0;
  padding: 0;
}

.mr-layout { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }

/* ── Email mode ── */
/* gap: the 上一张/当前/下一张 corridor is a separate control strip, not a
   header welded to the workbench below it -- without this the two panes share
   an edge and read as one block. */
.mr-layout-email { height: 100%; gap: var(--space-3); }
.mr-email-list-pane {
  flex: 0 0 auto;
  /* Was `max-height: 76px; overflow: hidden`. The corridor needs roughly 80px
     (card padding 16 + border 2 + three lines of content) plus the strip's own
     padding, so the cap was cutting the cards off at the bottom -- which is
     also why they never looked vertically centred: there was no spare vertical
     space to centre them in, the strip was simply too short for its contents.
     Sizing to content instead. The pane is flex:0 0 auto inside a flex column
     whose next child is flex:1, so growing here costs the workbench nothing. */
  display: flex;
  align-items: center;
  overscroll-behavior: contain;
  border-bottom: 2px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(244,246,249,.72));
}

.mr-corridor {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(220px, 1.2fr) minmax(0, .8fr);
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  /* stretch keeps the three cards the same height even though the empty
     prev/next cards hold less text; each card centres its own content via
     align-content on .mr-corridor-card. */
  align-items: stretch;
}

.mr-corridor-card {
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-2);
  align-content: center;
  color: var(--text);
}

.mr-corridor-card span {
  grid-column: 1 / -1;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.mr-corridor-card b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.mr-corridor-card em {
  color: var(--text-2);
  font-size: 11px;
  font-style: normal;
}

.mr-corridor-card i {
  align-self: center;
  justify-self: end;
  grid-row: 2 / 4;
  grid-column: 2;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  color: var(--danger);
  background: var(--danger-light);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}

.mr-corridor-card.prev,
.mr-corridor-card.next {
  opacity: .68;
  transform: scale(.96);
}

.mr-corridor-card.active {
  border-color: rgba(10,132,255,.42);
  background: var(--primary-light);
  box-shadow: 0 8px 22px rgba(10,132,255,.12);
}

.mr-corridor-card.is-empty {
  cursor: default;
  color: var(--text-3);
  background: transparent;
  box-shadow: none;
}

/* ── Filmstrip mode ── */
.mr-layout-film { height: 100%; }
.mr-film-strip {
  height: 110px;
  min-height: 110px;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: .6rem 1rem;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
  align-items: center;
  scrollbar-width: thin;
}
.mr-film-thumb {
  width: 72px; height: 88px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
}
.mr-film-thumb img { width: 100%; height: 72px; object-fit: cover; }
.mr-film-thumb.active { border-color: #0A84FF; box-shadow: 0 0 0 3px #0A84FF20; }
.mr-film-thumb:hover  { border-color: #5AC8FA; }
.mr-film-label {
  font-size: .72rem; color: var(--text-3);
  padding: .15rem .3rem;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap; width: 100%;
  text-align: center;
}
.mr-film-thumb.no-img img { display: none; }
.mr-film-thumb.no-img::before {
  content: 'PDF';
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text-2);
}

/* ── Shared split pane ── */
.mr-split-pane {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.mr-viewer-pane {
  flex: 7;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--surface1);
  min-width: 0;
  min-height: 0;
}
.mr-fields-pane {
  flex: 3;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 0;
}

.mr-viewer-placeholder,
.mr-fields-placeholder {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--text-3);
  padding: 2rem;
  text-align: center;
}

/* ── Receipt viewer ── */
.mr-receipt-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.mr-receipt-wrap {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
}
.mr-pdf-frame {
  width: 100%;
  flex: 1;
  min-height: 400px;
  border: none;
}
.mr-no-file {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: .8rem; color: var(--text-3);
}

/* ── Email list row ── */
.mr-email-row {
  display: flex; align-items: stretch;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  gap: .7rem;
}
.mr-email-row:hover  { background: var(--surface2); }
.mr-email-row.active { background: var(--primary-bg, #ede9fe); border-left: 3px solid #0A84FF; }

.mr-email-check { display: flex; align-items: center; flex-shrink: 0; }
.mr-email-body  { flex: 1; min-width: 0; }
.mr-email-top   { display: flex; align-items: center; justify-content: space-between; margin-bottom: .25rem; }
.mr-email-vendor { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-email-amount { font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; margin-left: .5rem; }
.mr-email-bottom { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.mr-email-date   { font-size: .75rem; color: var(--text-3); }
.mr-email-category { font-size: .72rem; color: var(--text-3); }

/* ── Fields panel ── */
.mr-fields-inner {
  display: flex; flex-direction: column;
  padding: .8rem 1rem;
  gap: .6rem;
}

.mr-conf-strip {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .6rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: .75rem;
}
.mr-conf-label { color: var(--text-3); font-weight: 500; flex-shrink: 0; }
.mr-conf-bar-wrap { flex: 1; height: 5px; background: var(--border); border-radius: var(--radius-xs); overflow: hidden; }
.mr-conf-bar { height: 100%; border-radius: var(--radius-xs); transition: width .4s; }
.mr-conf-pct { font-weight: 700; min-width: 36px; text-align: right; }

.mr-action-row {
  display: flex; flex-wrap: wrap; gap: .4rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: .3rem;
}

.mr-field-group { display: flex; flex-direction: column; gap: .5rem; }
.mr-field-row { display: flex; align-items: center; gap: .5rem; }
.mr-field-row label { font-size: .72rem; font-weight: 600; color: var(--text-3); width: 70px; flex-shrink: 0; text-align: right; }
.mr-field-input {
  flex: 1;
  padding: .35rem .55rem;
  font-size: .82rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s;
}
.mr-field-input:focus { outline: none; border-color: #0A84FF; }

.mr-save-row { margin-top: .4rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-danger-ghost { color: #dc2626 !important; }
.btn-danger-ghost:hover { background: #fef2f2 !important; }
.disabled { opacity: .4; cursor: not-allowed; }


/* ── LLM Tier Cards (Settings → Pipeline) ──────────────────────────────────── */
.llm-tier-section {
  margin-top: 1.5rem;
}
.llm-tier-section > .section-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted, #888);
  margin-bottom: .75rem;
}
.llm-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 860px) {
  .llm-tier-grid { grid-template-columns: 1fr; }
}
.llm-tier-card {
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 1.1rem;
  background: var(--surface, #fff);
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: box-shadow .15s;
}
.llm-tier-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.llm-tier-card .tier-header {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.tier-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.llm-tier-standard .tier-dot { background: #3b82f6; }
.llm-tier-advanced  .tier-dot { background: #32ADE6; }
.llm-tier-expert    .tier-dot { background: #f59e0b; }

.llm-tier-badge {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .15em .5em;
  border-radius: var(--radius-pill);
  line-height: 1.5;
}
.llm-tier-standard .llm-tier-badge {
  background: #eff6ff;
  color: #2563eb;
}
.llm-tier-advanced .llm-tier-badge {
  background: #f5f3ff;
  color: #32ADE6;
}
.llm-tier-expert .llm-tier-badge {
  background: #fffbeb;
  color: #d97706;
}
.llm-tier-card .tier-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text, #1e293b);
}
.llm-tier-desc {
  font-size: .75rem;
  color: var(--text-muted, #888);
  line-height: 1.45;
  min-height: 2.2em;
}
.llm-tier-card select {
  width: 100%;
  font-size: .82rem;
  padding: .35rem .5rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm);
  background: var(--input-bg, #f8fafc);
  color: var(--text, #1e293b);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  padding-right: 1.8rem;
  cursor: pointer;
}
.llm-tier-card select:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
/* highlight the card border on focus-within */
.llm-tier-standard:focus-within { border-color: #93c5fd; }
.llm-tier-advanced:focus-within  { border-color: #c4b5fd; }
.llm-tier-expert:focus-within    { border-color: #fcd34d; }

/* ── Workspace Settings ────────────────────────────────────────────────────── */

/* Default workspace card */
.ws-default-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.ws-default-left {
  display: flex; align-items: center; gap: .85rem; flex: 1; min-width: 0;
}
.ws-default-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-default-icon svg {
  width: 18px; height: 18px; stroke: #2563eb;
}
.ws-default-title {
  font-size: .9rem; font-weight: 700;
  color: var(--text, #0f172a); line-height: 1.2;
}
.ws-default-desc {
  font-size: .75rem; color: var(--text-2, #64748b);
  margin-top: .15rem; line-height: 1.4;
}
.ws-default-right {
  display: flex; align-items: center; gap: .65rem; flex-shrink: 0;
}
.ws-default-select {
  font-size: .83rem; padding: .38rem .65rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm); background: var(--bg, #f8fafc);
  color: var(--text, #0f172a); cursor: pointer;
  min-width: 180px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center;
  padding-right: 1.8rem;
}
.ws-default-select:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* Workspace list card */
.ws-list-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ws-list-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.ws-list-header .btn svg { width: 11px; height: 11px; margin-right: 3px; }
.ws-list-title {
  font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-2, #64748b);
}
.ws-pools-list { padding: 0; }
.ws-pools-list > .hint { padding: 1rem 1.25rem; font-size: .82rem; color: var(--text-3, #94a3b8); }

/* Workspace row (redesigned) */
.ws-pool-row {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  transition: background .12s;
}
.ws-pool-row:last-child { border-bottom: none; }
.ws-pool-row:hover { background: var(--surface2, #f8fafc); }
.ws-pool-swatch {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: .9rem;
}
.ws-pool-info { flex: 1; min-width: 0; }
.ws-pool-name {
  font-size: .88rem; font-weight: 600;
  color: var(--text, #0f172a);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-pool-meta {
  font-size: .73rem; color: var(--text-2, #64748b); margin-top: .1rem;
}
.ws-pool-badge {
  font-size: .72rem; font-weight: 700; padding: .12em .45em;
  border-radius: var(--radius-pill); background: #dbeafe; color: #0066D6;
  flex-shrink: 0; letter-spacing: .04em;
}
.ws-pool-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* ── Responsive / Mobile Breakpoints ────────────────────────────────────────
   Added for proper adaptive layout across screen sizes.
   Breakpoints: 768px (tablet), 640px (mobile)
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Sidebar mobile hamburger button (hidden on desktop) ─────────────────── */
#sidebar-toggle-btn {
  display: none;
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  color: var(--text-2);
  padding: 0;
  flex-shrink: 0;
}
#sidebar-toggle-btn svg { width: 18px; height: 18px; }

/* Mobile overlay behind open sidebar */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 299;
}

/* ── nav-link-dim: placeholder/coming-soon nav link ─────────────────────── */
.nav-link-dim {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

/* ── Dashboard attention & workspace summary lists ───────────────────────── */
.attention-list {
  display: flex;
  flex-direction: column;
}
.pools-summary-list {
  display: flex;
  flex-direction: column;
}

/* ── Tablet (≤768px) ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Show hamburger button */
  #sidebar-toggle-btn { display: flex; }

  /* Sidebar: hidden off-screen by default; slides in when .open */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-md);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #sidebar-overlay.visible { display: block; }

  /* Main content fills full width (no sidebar gutter) */
  #main-content {
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* Add top padding to content so it clears the hamburger button */
  .page { padding: 3.5rem 1rem 1rem; }

  /* Filters bar: allow items to shrink more on narrow screens */
  .filter-input  { min-width: 120px; }
  .filter-select { min-width: 100px; }
  .filters-bar   { gap: .35rem; }

  /* Settings shell: collapse side-nav into horizontal strip */
  .stg-shell { flex-direction: column; }
  .stg-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .15rem;
    padding: .4rem;
    overflow-y: visible;
    overflow-x: auto;
  }
  .stg-nav-label { display: none; }
  .stg-nav-item  { padding: .35rem .6rem; font-size: .8rem; white-space: nowrap; }

  /* Invoice editor: from/to grid → single column */
  .inv-doc-from-to { grid-template-columns: 1fr; }

  /* Inbox list view: allow horizontal scroll on narrow viewports */
  #inbox-list-view { overflow-x: auto; }
  .ib-row { min-width: 560px; }

  /* Overview panels: already handled by the 640px rule, ensure 1-col here too */
  .overview-panels { grid-template-columns: 1fr; }

  /* Receipt split modal: stack vertically on tablet */
  .rsm-split { flex-direction: column; }
  .rsm-preview { width: 100%; min-height: 40vh; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── Mobile (≤480px) ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .page { padding: 3.5rem .75rem .75rem; }

  /* Data table: allow horizontal scroll */
  .table-scroll-wrap { overflow-x: auto; }
  .data-table { min-width: 700px; }

  /* Dashboard stats: 2-up grid */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Buttons in toolbars: smaller */
  .btn { padding: .3rem .6rem; font-size: .82rem; }
  .btn-sm { padding: .25rem .45rem; font-size: .78rem; }

  /* Hide less-critical table columns via class toggle (JS-driven in future)
     For now, ensure page-title and header don't overflow */
  .page-title { font-size: 1.2rem; }

  /* Invoice document view */
  .inv-doc-wrap { padding: 1rem; }
  .inv-doc-header { flex-direction: column; gap: .75rem; }
  .inv-doc-logo { width: 64px; height: 64px; }

  /* Landing page responsive */
  .landing-footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .how-it-works-grid,
  .testimonials-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   APPLE-STYLE APP ENHANCEMENTS  — v0.4
══════════════════════════════════════════════════════════════ */

/* (topbar styles consolidated at the top of this file) */

/* Stat cards — refined */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }

/* Overview panels — refined */
.overview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-header {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Settings card — refined */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

/* Report rows — refined */
.report-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  box-shadow: var(--shadow);
}
.report-row:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Invoice rows — refined (in addition to existing .inv-row) */
.inv-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  box-shadow: var(--shadow);
}
.inv-row:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Topbar user chip — Apple-style pill */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 2px 12px rgba(0,0,0,.04);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), background var(--transition-fast);
}
html[data-theme="dark"] .user-chip { background: rgba(44,44,46,.9); }
.user-chip:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }

/* User dropdown — refined */
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  padding: 8px;
  animation: menuSlideIn 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
html[data-theme="dark"] .user-menu { background: rgba(28,28,30,.97); }
@keyframes menuSlideIn {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* Batch upload progress bar */
.upload-progress-bar-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  background: rgba(28,28,30,.96);
  color: #f5f5f7;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
  z-index: 1500;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
  animation: slideUpIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUpIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(1);   }
}
.upload-progress-title {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(245,245,247,.7);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.upload-progress-file {
  font-size: .9rem;
  font-weight: 600;
  color: #f5f5f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 12px;
}
.upload-progress-track {
  height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 10px;
}
.upload-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #5AC8FA, #0A84FF);
  transition: width 0.3s ease;
}
.upload-progress-count {
  font-size: .8rem;
  color: rgba(245,245,247,.55);
}

/* Toast — refined */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,.97);
  color: #f5f5f7;
  padding: .65rem 1.35rem;
  border-radius: var(--radius-pill);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.3), 0 1px 4px rgba(0,0,0,.2);
  z-index: 1200;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.1);
  animation: toastIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.94); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1);  }
}
.toast.success { background: rgba(22,101,52,.97); }
.toast.error   { background: rgba(153,27,27,.97);  }

/* Auth modal — refined */
.modal-sm { max-width: 420px; width: min(420px, calc(100vw - 32px)); }

/* Sidebar section labels — refined */
.bucket-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  padding: .8rem 1rem .25rem;
}

/* Form fields — refined */
.field input,
.field select,
.field textarea {
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 1.5;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,132,255,.12);
}

/* Empty state — more spacious */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 4rem 2rem;
  text-align: center;
}
.empty-state-icon { width: 80px; height: 80px; color: var(--border); margin-bottom: 20px; }
.empty-state h4 { font-size: 1.1rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: -.01em; }
.empty-state p { font-size: .875rem; color: var(--text-3); max-width: 260px; line-height: 1.55; }

/* Filters bar — refined */
.filters-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: .65rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Pool switcher — refined */
.pool-switcher {
  width: 100%;
  padding: .4rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.pool-switcher:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,132,255,.12); }

/* 2026 handoff alignment: Product app + Platform operator surfaces */
#main-app {
  background: var(--fol-bg);
}

#app-main {
  scrollbar-gutter: stable;
}

#content {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

#page-platform {
  --surface: var(--platform-surface);
  --surface2: #101827;
  --card-bg: var(--platform-surface);
  --border: rgba(234,242,245,.10);
  --border-hover: rgba(21,207,232,.45);
  --text: var(--platform-fg);
  --text-2: var(--platform-fg-2);
  --text-3: rgba(157,172,190,.68);
  --primary: var(--platform-brand);
  color: var(--platform-fg);
  background: radial-gradient(circle at 20% -10%, rgba(21,207,232,.16), transparent 32%),
              linear-gradient(180deg, var(--platform-bg), var(--platform-bg-2));
  border-radius: var(--radius-xl);
  padding: 18px;
  margin: 8px 0 28px;
}

#page-platform .page-header,
#page-platform .overview-panel,
#page-platform .stat-card {
  background: rgba(22,29,43,.88);
  border-color: rgba(234,242,245,.10);
  box-shadow: 0 18px 54px rgba(0,0,0,.24);
}

#page-platform .table th {
  color: rgba(157,172,190,.82);
}

#page-platform .table td {
  color: var(--platform-fg);
  border-color: rgba(234,242,245,.08);
}

.plan-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-3);
}

.pipeline-plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}

.pipeline-plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 12px;
}

.pipeline-plan-name {
  font-size: 1rem;
  font-weight: 800;
}

.pipeline-plan-price,
.pipeline-plan-meta {
  color: var(--text-2);
  font-size: .82rem;
}

.pipeline-plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: 10px;
}

.pipeline-tier,
.pipeline-cap {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}

.pipeline-tier {
  color: #05313a;
  background: rgba(21,207,232,.86);
}

.tier-ocr_only { background: rgba(157,172,190,.42); color: #eaf2f5; }
.tier-ocr_llm { background: rgba(10,132,255,.82); color: #fff; }
.tier-vision_reconciler { background: rgba(52,199,89,.82); color: #062814; }
.tier-multi_model { background: rgba(175,82,222,.86); color: #fff; }

.pipeline-cap-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: 10px;
}

.pipeline-cap.on {
  color: #062814;
  background: rgba(52,199,89,.82);
}

.pipeline-cap.off {
  color: rgba(234,242,245,.62);
  background: rgba(157,172,190,.14);
}

/* Landing page responsive breakpoints */
@media (max-width: 960px) {
  .landing-hero,
  .landing-feature-grid,
  .landing-pricing-grid,
  .how-it-works-grid,
  .testimonials-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
  .auth-aside { padding: 28px 24px; }
  .auth-panel { padding: 24px; }
  .auth-panel-body { max-width: none; }
  .landing-section-head h3 { font-size: 1.9rem; }
  .landing-footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}
@media (max-width: 640px) {
  .landing-copy { padding: 28px 24px; }
  .landing-header { flex-wrap: wrap; }
  .landing-actions { width: 100%; justify-content: flex-start; }
  .landing-footer-grid { grid-template-columns: 1fr; }
  .landing-shell { width: calc(100% - 32px); }
  .pricing-badge { font-size: .68rem; }
  .auth-mini-stats { grid-template-columns: 1fr; }
}

/* 2026 designer handoff runtime */
html {
  scrollbar-gutter: stable;
}

body {
  font-variant-numeric: tabular-nums;
}

#login-screen {
  align-items: stretch;
  background: var(--fol-bg);
}

#login-screen > .landing-shell {
  display: none;
}

.mk-shell {
  width: 100%;
  color: var(--fol-fg);
  background: #fff;
}

.mk-header,
.mk-hero,
.mk-section,
.mk-footer,
.mk-trust {
  width: min(1180px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}

.mk-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: 0 24px;
  background: var(--fol-surface-2);
  border-bottom: 1px solid var(--fol-border);
  box-shadow: 0 1px 0 rgba(11,15,23,.03);
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: max(24px, calc((100% - 1180px) / 2 + 24px));
  padding-right: max(24px, calc((100% - 1180px) / 2 + 24px));
}

.mk-brand {
  border: 0;
  background: transparent;
  color: var(--fol-fg);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  text-decoration: none;
}

.mk-brand span {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(150deg,#0A84FF,#5856D6);
  font-weight: 900;
  box-shadow: none;
}

.mk-brand b {
  font-size: 18px;
  letter-spacing: -.02em;
}

.mk-nav,
.mk-actions,
.mk-cta-row,
.mk-plan-meta,
.auth-proof {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.mk-nav {
  margin-left: 30px;
  gap: var(--space-6);
}

.mk-actions {
  margin-left: auto;
}

.mk-nav-link,
.mk-footer button {
  border: 0;
  background: transparent;
  color: var(--fol-fg-2);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 8px 6px;
  border-radius: var(--radius-pill);
}

.mk-nav-link.active,
.mk-nav-link:hover,
.mk-footer button:hover {
  color: var(--fol-fg);
  background: transparent;
  font-weight: 800;
}

.mk-hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: var(--space-12);
  align-items: center;
  padding: 78px 24px 40px;
}

.mk-hero.compact {
  grid-template-columns: minmax(0, 780px);
  padding-bottom: 12px;
}

.mk-hero h2 {
  font-size: 56px;
  line-height: 1.04;
  letter-spacing: -.035em;
  max-width: 560px;
  margin: 0;
  font-weight: 800;
}

.mk-hero.compact h2 {
  font-size: clamp(2.4rem, 4.4vw, 4.4rem);
}

.mk-hero p,
.mk-section p,
.mk-card p,
.mk-footer p {
  color: var(--fol-fg-2);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
}

.mk-hero > div > p {
  max-width: 480px;
  font-size: 18px;
  line-height: 1.55;
  margin: 20px 0 0;
}

.mk-eyebrow,
.mk-section-head span,
.mk-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: fit-content;
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  border: 1px solid var(--fol-border);
  background: var(--fol-surface-2);
  color: var(--fol-fg-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 22px;
}

.mk-eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.mk-hero-panel,
.mk-card,
.mk-price-card,
.mk-trust,
.auth-gateway,
.ob-shell,
.design-tool-row,
.design-bottom-strip {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(11,15,23,.08);
  box-shadow: 0 18px 55px rgba(16,28,52,.08);
}

.mk-hero-panel {
  border-radius: var(--radius-2xl);
  padding: 22px;
  display: grid;
  gap: var(--space-3);
}

.mk-live-card {
  border-radius: var(--radius-xl);
  padding: 20px;
  background: var(--fol-surface);
  border: 1px solid var(--fol-border);
}

.mk-live-card span,
.mk-plan-name,
.mk-contact-cards h4 {
  color: var(--fol-fg-2);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mk-live-card strong {
  display: block;
  font-size: 1.55rem;
  letter-spacing: -.035em;
  margin: 4px 0;
}

.mk-primary-cta,
.mk-secondary-cta {
  display: inline-flex;
  align-items: center;
  height: 48px;
  border-radius: var(--radius-md);
  padding: 0 24px;
  border: 0;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 700;
}

.mk-primary-cta {
  background: var(--fol-brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(10,132,255,.32);
}

.mk-secondary-cta {
  background: var(--fol-surface);
  color: var(--fol-fg);
  border: 1px solid var(--fol-border);
}

.mk-hero-stats {
  display: flex;
  gap: var(--space-6);
  margin-top: 30px;
}

.mk-hero-stats div {
  padding-right: 24px;
  border-right: 1px solid var(--fol-border);
}

.mk-hero-stats div:last-child {
  border-right: 0;
  padding-right: 0;
}

.mk-hero-stats strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.mk-hero-stats span {
  display: block;
  font-size: 12.5px;
  color: var(--fol-fg-3);
  font-weight: 600;
}

.mk-extraction-panel {
  background: linear-gradient(165deg,#0B1020,#161D34);
  border-radius: var(--radius-2xl);
  padding: 24px;
  box-shadow: 0 30px 70px rgba(11,16,32,.3);
  color: #E6ECF5;
}

.mk-panel-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #9DACBE;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mk-panel-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34D2E0;
}

.mk-extraction-grid {
  display: flex;
  gap: var(--space-3);
  margin-top: 16px;
}

.mk-receipt-mini {
  width: 104px;
  flex: 0 0 104px;
  align-self: flex-start;
  display: grid;
  gap: 5px;
  padding: 13px 11px;
  border-radius: var(--radius-md);
  background: #fff;
  color: #1a2030;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.mk-receipt-mini b {
  text-align: center;
  font-size: 10px;
  letter-spacing: .03em;
}

.mk-receipt-mini span,
.mk-receipt-mini strong {
  display: flex;
  justify-content: space-between;
  color: #7a8495;
  border-top: 1px dashed #c9d0db;
  padding-top: 4px;
}

.mk-receipt-mini strong {
  color: #1a2030;
  border-top: 1px solid #1a2030;
}

.mk-model-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mk-model-stack div {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 700;
}

.mk-model-stack i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.mk-model-stack span {
  flex: 1;
}

.mk-model-stack b {
  font-size: 10px;
}

.mk-model-stack .indigo { background: rgba(88,86,214,.16); border: 1px solid rgba(88,86,214,.4); }
.mk-model-stack .indigo i { background: #7B79E8; }
.mk-model-stack .indigo b { color: #34D17E; }
.mk-model-stack .green { background: rgba(52,199,89,.14); border: 1px solid rgba(52,199,89,.36); }
.mk-model-stack .green i { background: #34D17E; }
.mk-model-stack .green b { color: #34D17E; }
.mk-model-stack .orange { background: rgba(255,159,10,.14); border: 1px solid rgba(255,159,10,.36); }
.mk-model-stack .orange i { background: #FFB838; animation: mkPulse 1.1s infinite; }
.mk-model-stack .orange b { color: #FFB838; }

.mk-result-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
}

.mk-result-card > span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7E8DA3;
  margin-bottom: 10px;
}

.mk-result-card div {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 8px;
}

.mk-result-card label {
  width: 78px;
  color: #8A98AD;
  font-size: 12px;
}

.mk-result-card b {
  flex: 1;
  color: #fff;
  font-size: 13px;
}

.mk-result-card em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  color: #34D17E;
  background: rgba(52,199,89,.16);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

.mk-result-card em.warn {
  color: #FFB838;
  background: rgba(255,159,10,.16);
}

.mk-result-card em.auto {
  color: #34D2E0;
  background: rgba(52,210,224,.14);
}

.mk-trust {
  border: 0;
  box-shadow: none;
  background: transparent;
  min-height: 0;
  padding: 18px 24px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  color: var(--fol-fg-2);
}

.mk-trust p {
  flex-basis: 100%;
  text-align: center;
  margin: 0 0 -8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fol-fg-3);
}

.mk-trust b {
  font-size: 19px;
  letter-spacing: -.02em;
  opacity: .7;
}

.mk-section {
  padding: 54px 0;
}

.mk-capture-section {
  width: 100%;
  max-width: none;
  margin-top: 30px;
  padding: 64px max(24px, calc((100% - 1180px) / 2 + 24px));
  background: var(--fol-bg);
  border-top: 1px solid var(--fol-border);
  border-bottom: 1px solid var(--fol-border);
}

.mk-section-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 28px;
}

.mk-section-head h3,
.mk-dark-band h3 {
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -.03em;
  font-weight: 800;
  margin: 12px 0;
}

.mk-section-head span {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--fol-brand);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.mk-grid,
.mk-price-grid,
.mk-contact-grid {
  display: grid;
  gap: var(--space-4);
}

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

.mk-grid.three,
.mk-price-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mk-price-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mk-card,
.mk-price-card {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.mk-card h4,
.mk-price-card h4 {
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: 8px;
}

.mk-capture-card {
  border-radius: var(--radius-xl);
  padding: 30px;
}

.mk-capture-card h4 {
  font-size: 21px;
}

.mk-capture-card ul {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  margin-top: 16px;
  color: var(--fol-fg);
  font-size: 14px;
  font-weight: 600;
}

.mk-capture-card li::before {
  content: "✓";
  color: var(--success);
  margin-right: 9px;
}

.mk-belief-section {
  width: 100%;
  max-width: none;
  margin-top: 30px;
  background: var(--fol-bg);
  border-top: 1px solid var(--fol-border);
  border-bottom: 1px solid var(--fol-border);
}

.mk-belief-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 88px 24px;
  text-align: center;
}

.mk-belief-inner span,
.mk-pillars-head span,
.mk-audience-band > div:first-child span {
  display: block;
  color: var(--fol-brand);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mk-belief-inner h3 {
  margin: 18px 0 0;
  font-size: 40px;
  line-height: 1.18;
  letter-spacing: -.025em;
  font-weight: 800;
}

.mk-belief-inner p {
  max-width: 620px;
  margin: 22px auto 0;
  color: var(--fol-fg-2);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 500;
}

.mk-pillars-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 74px 24px;
}

.mk-pillars-head {
  max-width: 640px;
  margin: 0 auto 38px;
  text-align: center;
}

.mk-pillars-head h3 {
  margin: 12px 0 0;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 800;
}

.mk-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.mk-pillar-card {
  display: flex;
  min-height: 296px;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-xl);
  background: var(--fol-surface);
  color: var(--fol-fg);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.mk-pillar-card:hover {
  border-color: var(--fol-brand);
  box-shadow: 0 12px 34px rgba(16,28,52,.1);
  transform: translateY(-2px);
}

.mk-pillar-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  position: relative;
  display: block;
}

.mk-pillar-icon::before,
.mk-pillar-icon::after {
  content: "";
  position: absolute;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.mk-pillar-icon::before {
  width: 20px;
  height: 4px;
  left: 13px;
  top: 15px;
}

.mk-pillar-icon::after {
  width: 12px;
  height: 12px;
  left: 17px;
  top: 22px;
}

.mk-pillar-icon.blue {
  color: var(--fol-brand);
  background: var(--fol-brand-tint);
}

.mk-pillar-icon.green {
  color: var(--success);
  background: var(--success-light);
}

.mk-pillar-icon.indigo {
  color: #5856D6;
  background: #E8E8FA;
}

.mk-pillar-card h4 {
  margin: 0;
  font-size: 19px;
  line-height: 1.22;
  letter-spacing: -.01em;
  font-weight: 800;
}

.mk-pillar-card p {
  flex: 1;
  margin: 9px 0 18px;
  color: var(--fol-fg-2);
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 500;
}

.mk-pillar-card button {
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--fol-brand);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.mk-audience-band {
  width: 100%;
  max-width: none;
  background: var(--platform-bg);
  color: #fff;
}

.mk-audience-band > div {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.mk-audience-band > div:first-child {
  padding-top: 84px;
  max-width: 1180px;
}

.mk-audience-band > div:first-child span {
  max-width: 680px;
  color: #34D2E0;
}

.mk-audience-band h3 {
  max-width: 680px;
  margin: 14px 0 0;
  font-size: 36px;
  line-height: 1.14;
  letter-spacing: -.03em;
  font-weight: 800;
}

.mk-audience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  padding-top: 40px;
  padding-bottom: 84px;
}

.mk-audience-grid article {
  border-top: 2px solid rgba(52,210,224,.5);
  padding-top: 18px;
}

.mk-audience-grid b {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 800;
}

.mk-audience-grid p {
  margin: 8px 0 0;
  color: #9DACBE;
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 500;
}

.mk-final-cta {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 24px;
}

.mk-final-cta > div {
  padding: 54px;
  text-align: center;
  color: #fff;
  border-radius: var(--radius-2xl);
  background: linear-gradient(150deg,#0A84FF,#5856D6);
  box-shadow: 0 24px 60px rgba(10,132,255,.3);
}

.mk-final-cta h3 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -.03em;
  font-weight: 800;
}

.mk-final-cta p {
  max-width: 480px;
  margin: 14px auto 0;
  color: rgba(255,255,255,.92);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 500;
}

.mk-final-cta button {
  display: inline-flex;
  align-items: center;
  height: 50px;
  margin-top: 26px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius-md);
  background: #fff;
  color: #0B0F17;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
}

.mk-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-weight: 900;
}

.mk-icon.blue {
  color: var(--fol-brand);
  background: var(--fol-brand-tint);
}

.mk-icon.green {
  color: var(--success);
  background: var(--success-light);
}

.mk-dark-band {
  width: 100%;
  max-width: none;
  border-radius: 0;
  padding: 74px max(24px, calc((100% - 1180px) / 2 + 24px));
  color: #eaf2f5;
  background: var(--platform-bg);
}

.mk-dark-band p,
.mk-dark-band .mk-section-head p {
  color: rgba(234,242,245,.72);
}

.mk-pipeline-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.mk-pipeline-row div {
  border: 1px solid rgba(234,242,245,.12);
  border-radius: var(--radius-xl);
  padding: 26px;
  background: rgba(255,255,255,.04);
}

.mk-pipeline-row span {
  display: block;
  color: rgba(234,242,245,.58);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.mk-pipeline-row strong {
  display: block;
  margin: 6px 0;
}

.mk-price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mk-price-card.featured {
  border-color: rgba(10,132,255,.45);
  box-shadow: 0 22px 70px rgba(10,132,255,.16);
}

.mk-plan-price {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -.04em;
}

.mk-plan-meta span,
.auth-proof span {
  border-radius: var(--radius-pill);
  padding: 5px 9px;
  color: var(--fol-fg-2);
  background: var(--fol-surface-2);
  font-size: .78rem;
  font-weight: 700;
}

.mk-price-card ul {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  margin: 4px 0 8px;
  color: var(--fol-fg-2);
}

.mk-price-card li::before {
  content: "✓";
  color: var(--fol-brand);
  font-weight: 900;
  margin-right: 7px;
}

.mk-price-toggle {
  margin: 0 auto 22px;
  padding: 4px;
  width: fit-content;
  border-radius: var(--radius-pill);
  background: var(--fol-surface);
  border: 1px solid var(--fol-border);
}

.mk-price-toggle button {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  background: transparent;
  color: var(--fol-fg-2);
  cursor: pointer;
  font-weight: 800;
}

.mk-price-toggle button.active {
  background: var(--fol-brand);
  color: #fff;
}

.mk-compare {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.mk-compare div {
  display: grid;
  gap: var(--space-2);
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--fol-surface-2);
}

.mk-security {
  color: #eaf2f5;
  width: 100%;
  max-width: none;
  padding-left: max(20px, calc((100% - 1180px) / 2));
  padding-right: max(20px, calc((100% - 1180px) / 2));
  background: linear-gradient(135deg, #0a0e16, #151f30);
}

.mk-security p {
  color: rgba(234,242,245,.72);
}

.mk-contact-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
}

.mk-audit-section {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: var(--space-12);
  align-items: center;
  padding: 74px 24px;
}

.mk-audit-section h3 {
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 800;
  margin: 12px 0 0;
}

.mk-audit-section > div > p {
  font-size: 16.5px;
  margin-top: 16px;
}

.mk-audit-kicker {
  color: var(--fol-brand);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mk-audit-card {
  display: grid;
  grid-template-columns: .85fr 1fr;
  overflow: hidden;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-xl);
  background: var(--fol-surface);
  box-shadow: 0 22px 54px rgba(16,28,52,.12);
}

.mk-audit-receipt {
  display: grid;
  gap: var(--space-2);
  padding: 38px 24px;
  background: var(--fol-bg);
  border-right: 1px solid var(--fol-border);
  font-family: var(--font-mono);
  color: #1a2030;
}

.mk-audit-receipt b {
  text-align: center;
}

.mk-audit-receipt span,
.mk-audit-receipt strong {
  display: block;
  border-top: 1px dashed #c9d0db;
  padding-top: 8px;
  font-size: 12px;
}

.mk-audit-fields {
  padding: 24px;
}

.mk-audit-fields > span {
  display: block;
  color: var(--fol-fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 11px;
}

.mk-audit-fields p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--fol-border);
  padding: 10px 0;
  margin: 0;
}

.mk-audit-fields em {
  color: var(--success);
  font-style: normal;
  font-weight: 800;
  font-size: 10px;
}

.mk-page-hero,
.mk-contact-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 70px 24px 46px;
  text-align: center;
}

.mk-contact-hero {
  max-width: 1080px;
  text-align: left;
  padding: 64px 24px 20px;
}

.mk-page-hero span,
.mk-contact-hero span {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fol-brand);
}

.mk-page-hero h1,
.mk-contact-hero h1,
.mk-security-hero h1 {
  font-size: 48px;
  line-height: 1.06;
  letter-spacing: -.03em;
  font-weight: 800;
  margin: 12px 0 0;
}

.mk-contact-hero h1 {
  font-size: 44px;
}

.mk-page-hero p,
.mk-contact-hero p,
.mk-security-hero p {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--fol-fg-2);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 500;
}

.mk-contact-hero p {
  margin-left: 0;
  font-size: 17px;
}

.mk-split-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.mk-split-section h2,
.mk-silent-band h2 {
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 800;
  margin: 14px 0 0;
}

.mk-split-section ul,
.mk-silent-band ul {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  margin-top: 18px;
  font-size: 14.5px;
  font-weight: 600;
}

.mk-split-section li::before,
.mk-silent-band li::before {
  content: "✓";
  color: var(--success);
  margin-right: 10px;
}

.mk-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
}

.mk-mode-pill.blue {
  color: var(--fol-brand);
  background: var(--fol-brand-tint);
}

.mk-mode-pill.green {
  color: var(--success);
  background: var(--success-light);
}

.mk-progress-panel {
  display: grid;
  gap: var(--space-2);
  padding: 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg,#0B1020,#161D34);
  box-shadow: 0 22px 54px rgba(11,16,32,.22);
}

.mk-progress-panel div {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  overflow: hidden;
}

.mk-progress-panel p {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: #E6ECF5;
  font-size: 12.5px;
  font-weight: 700;
}

.mk-progress-panel i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.mk-progress-panel b {
  flex: 1;
}

.mk-progress-panel span {
  font-size: 10px;
  font-weight: 700;
}

.mk-progress-panel em {
  display: block;
  height: 5px;
  margin-top: 8px;
  border-radius: var(--radius-pill);
}

.mk-progress-panel .indigo { background: rgba(88,86,214,.16); border: 1px solid rgba(88,86,214,.4); }
.mk-progress-panel .indigo i,.mk-progress-panel .indigo em { background: #7B79E8; }
.mk-progress-panel .indigo span { color: #34D17E; }
.mk-progress-panel .green { background: rgba(52,199,89,.14); border: 1px solid rgba(52,199,89,.36); }
.mk-progress-panel .green i,.mk-progress-panel .green em { background: #34D17E; }
.mk-progress-panel .green span { color: #34D17E; }
.mk-progress-panel .orange { background: rgba(255,159,10,.14); border: 1px solid rgba(255,159,10,.36); }
.mk-progress-panel .orange i,.mk-progress-panel .orange em { background: #FFB838; }
.mk-progress-panel .orange span { color: #FFB838; }

.mk-silent-band {
  width: 100%;
  max-width: none;
  margin-top: 46px;
  padding: 54px max(24px, calc((100% - 1180px) / 2 + 24px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
  background: var(--fol-bg);
  border-top: 1px solid var(--fol-border);
  border-bottom: 1px solid var(--fol-border);
}

.mk-silent-card {
  padding: 22px;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-xl);
  background: var(--fol-surface);
  box-shadow: 0 1px 3px rgba(16,28,52,.06);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.mk-silent-card div {
  border-radius: var(--radius-md);
  padding: 11px;
  background: var(--fol-surface-2);
}

.mk-silent-card b {
  display: block;
  color: var(--fol-fg-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.mk-silent-card span {
  display: block;
  background: #fff;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
}

.mk-silent-card p {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 4px 0 0;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--fol-surface-2);
  font-size: 12px;
  font-weight: 700;
}

.mk-silent-card p i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--success-light);
  border-top-color: var(--success);
}

.mk-silent-card p em {
  margin-left: auto;
  color: var(--fol-fg-3);
  font-style: normal;
  font-family: var(--font-mono);
}

.mk-pricing-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px 0;
}

.mk-feature-table {
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--fol-surface);
  box-shadow: 0 1px 3px rgba(16,28,52,.06);
}

.mk-feature-table h4 {
  padding: 18px 22px;
  border-bottom: 1px solid var(--fol-border);
  font-size: 16px;
}

.mk-feature-head,
.mk-feature-row {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: var(--space-2);
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--fol-border);
}

.mk-feature-head {
  color: var(--fol-fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.mk-feature-row span {
  font-size: 13.5px;
  font-weight: 600;
}

.mk-feature-row em {
  text-align: center;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
}

.mk-faq {
  max-width: 840px;
  margin: 0 auto;
  padding: 60px 24px 20px;
}

.mk-faq h2 {
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 28px;
}

.mk-faq article {
  margin-bottom: 12px;
  padding: 18px 20px;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-lg);
  background: var(--fol-surface);
}

.mk-faq b {
  font-size: 15px;
}

.mk-security-hero {
  background: var(--platform-bg);
  color: #fff;
}

.mk-security-hero > div {
  max-width: 900px;
  margin: 0 auto;
  padding: 74px 24px;
  text-align: center;
}

.mk-security-hero span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-pill);
  color: var(--platform-brand);
  font-size: 12px;
  font-weight: 700;
}

.mk-security-hero i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--platform-brand);
}

.mk-security-hero p {
  color: var(--platform-fg-2);
}

.mk-promise-list {
  display: grid;
  gap: var(--space-3);
}

.mk-promise-list p {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin: 0;
  padding: 15px 17px;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-md);
  background: var(--fol-surface);
}

.mk-badges {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px;
  text-align: center;
}

.mk-badges span {
  display: block;
  margin-bottom: 22px;
  color: var(--fol-fg-3);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mk-badges b {
  display: inline-flex;
  margin: 7px;
  padding: 10px 18px;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-md);
  color: var(--fol-fg-2);
  background: var(--fol-surface);
  font-size: 14px;
}

.mk-contact-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 72px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

.mk-contact-form {
  padding: 28px;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-xl);
  background: var(--fol-surface);
  box-shadow: 0 1px 3px rgba(16,28,52,.06);
}

.mk-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.mk-contact-form .field {
  margin-bottom: 14px;
}

.mk-contact-form input,
.mk-contact-form textarea,
.mk-contact-form select {
  width: 100%;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-md);
  background: var(--fol-surface-2);
}

.mk-contact-form input,
.mk-contact-form select {
  height: 42px;
}

.mk-contact-form small {
  display: block;
  margin-top: 12px;
  color: var(--fol-fg-3);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.mk-contact-form small button {
  border: 0;
  background: transparent;
  color: var(--fol-brand);
  cursor: pointer;
  font-weight: 700;
}

.mk-contact-info {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 18px;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-lg);
  background: var(--fol-surface);
}

.mk-contact-info i {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--fol-brand);
  background: var(--fol-brand-tint);
  font-style: normal;
  font-weight: 900;
}

.mk-contact-info span {
  display: block;
  color: var(--fol-fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mk-contact-info b {
  display: block;
  margin-top: 3px;
  font-size: 14.5px;
  line-height: 1.4;
  word-break: break-word;
}

.mk-contact-info p {
  margin: 2px 0 0;
  color: var(--fol-fg-3);
  font-size: 12px;
  font-weight: 600;
}

.mk-contact-note {
  padding: 14px 16px;
  border: 1px dashed var(--fol-border);
  border-radius: var(--radius-lg);
  color: var(--fol-fg-3);
  background: var(--fol-surface-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.mk-contact-success {
  text-align: center;
  padding: 40px 10px;
}

.mk-contact-success div {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  background: var(--success-light);
  font-size: 28px;
  font-weight: 900;
}

.mk-contact-success b {
  display: block;
  font-size: 20px;
  font-weight: 800;
}

.mk-contact-success p {
  max-width: 320px;
  margin: 8px auto 0;
  color: var(--fol-fg-2);
  font-size: 14.5px;
  line-height: 1.5;
}

.mk-contact-success button {
  margin-top: 18px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--fol-border);
  color: var(--fol-fg-2);
  background: var(--fol-surface);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.mk-contact-cards {
  display: grid;
  gap: var(--space-3);
}

.mk-sent {
  color: var(--success);
  font-weight: 800;
  margin-top: 10px;
}

.mk-footer {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  color: #EAF2F5;
  background: #0A0E16;
  border-top: 1px solid rgba(255,255,255,.09);
}

.mk-footer-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 24px 24px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: var(--space-8);
}

.mk-footer h4 {
  color: #EAF2F5;
  margin-bottom: 8px;
}

.mk-footer button,
.mk-footer a {
  display: block;
  text-align: left;
  border: 0;
  background: transparent;
  color: #9DACBE;
  text-decoration: none;
  padding: 5px 0;
  padding-left: 0;
  font: inherit;
  cursor: pointer;
}

.mk-footer p {
  color: #9DACBE;
}

.mk-footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 12px;
}

.mk-footer-brand span {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(150deg,#0A84FF,#5856D6);
}

.mk-footer small {
  display: block;
  margin-top: 12px;
  color: #738196;
  font-family: var(--font-mono);
  font-size: 12px;
}

.mk-footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 26px;
  border-top: 1px solid rgba(255,255,255,.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  color: #738196;
  font-size: 12px;
  font-weight: 600;
}

.mk-footer-bottom div {
  display: flex;
  gap: var(--space-3);
}

.mk-footer-bottom button {
  color: #9DACBE;
  padding: 0;
}

.auth-gateway-box {
  max-width: 980px;
  width: min(980px, calc(100% - 32px));
  padding: 0;
  border-radius: var(--radius-2xl);
  overflow: visible;
}

.auth-gateway {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(340px, 1.1fr);
  min-height: 560px;
}

.auth-gateway aside {
  padding: 36px;
  color: #eaf2f5;
  background: radial-gradient(circle at 20% 10%, rgba(21,207,232,.20), transparent 38%), linear-gradient(135deg, #0a0e16, #161d2b);
}

.auth-gateway aside h3 {
  font-size: 2.2rem;
  line-height: 1.02;
  letter-spacing: -.045em;
  margin: 44px 0 16px;
}

.auth-gateway aside p {
  color: rgba(234,242,245,.72);
}

.auth-gateway section {
  padding: 28px;
  background: #fff;
  min-width: 0;
}

.auth-brand,
.auth-brand b {
  color: #eaf2f5;
}

.auth-forgot {
  border: 0;
  background: transparent;
  color: var(--fol-brand);
  cursor: pointer;
  font-weight: 700;
  width: fit-content;
  margin-bottom: 12px;
}

.auth-clerk-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,159,10,.28);
  border-radius: var(--radius-md);
  background: rgba(255,159,10,.10);
  color: #9a5b00;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
}

#onboarding-screen {
  min-height: 100vh;
  background: var(--fol-bg);
  padding: 32px;
}

.ob-shell {
  width: min(1120px, 100%);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.ob-rail {
  padding: 30px;
  color: #eaf2f5;
  background: linear-gradient(180deg, #0a0e16, #161d2b);
}

.ob-rail .mk-brand,
.ob-rail .mk-brand b {
  color: #eaf2f5;
}

#ob-steps {
  list-style: none;
  display: grid;
  gap: var(--space-3);
  margin-top: 42px;
}

#ob-steps li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(234,242,245,.62);
  font-weight: 800;
}

#ob-steps li span {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.09);
}

#ob-steps li.active {
  color: #fff;
}

#ob-steps li.active span {
  background: var(--fol-brand);
}

.ob-main {
  padding: 36px;
  background: #fff;
}

.ob-progress {
  display: grid;
  gap: var(--space-2);
  margin-bottom: 32px;
  color: var(--fol-fg-2);
  font-weight: 800;
}

.ob-progress div {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--fol-surface-2);
  overflow: hidden;
}

.ob-progress i {
  display: block;
  height: 100%;
  background: var(--fol-brand);
  border-radius: inherit;
}

.ob-step {
  display: grid;
  gap: var(--space-4);
  max-width: 680px;
  animation: obIn .18s ease-out;
}

@keyframes obIn {
  from { transform: translateY(10px); opacity: .4; }
  to { transform: translateY(0); opacity: 1; }
}

.ob-step h2 {
  font-size: 2.2rem;
  letter-spacing: -.04em;
}

.ob-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.ob-plan {
  min-height: 138px;
  text-align: left;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-lg);
  background: var(--fol-surface);
  padding: 16px;
  cursor: pointer;
  display: grid;
  gap: var(--space-2);
}

.ob-plan.active {
  border-color: var(--fol-brand);
  box-shadow: 0 0 0 4px var(--fol-brand-tint);
}

.ob-plan span {
  color: var(--fol-brand);
  font-weight: 900;
}

.ob-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: var(--space-2);
  margin-bottom: 10px;
}

.ob-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: 34px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fol-fg-2);
  font-weight: 800;
}

.designed-page {
  --dc-bg: #EEF1F5;
  --dc-bg-2: #E7ECF2;
  --dc-surface: #FFFFFF;
  --dc-surface-2: #F4F6F9;
  --dc-hover: #F1F4F8;
  --dc-border: rgba(11,15,23,.07);
  --dc-border-strong: rgba(11,15,23,.12);
  --dc-hairline: rgba(11,15,23,.06);
  --dc-fg: #0B0F17;
  --dc-fg-2: #6B7685;
  --dc-fg-3: #98A1B0;
  --dc-brand: #0A84FF;
  --dc-brand-tint: #E5F1FF;
  --dc-success: #34C759;
  --dc-success-tint: #E4F8EA;
  --dc-warning: #FF9F0A;
  --dc-warning-tint: #FFF1DC;
  --dc-danger: #FF3B30;
  --dc-danger-tint: #FFE6E4;
  --dc-shadow-sm: 0 1px 3px rgba(16,28,52,.06);
  --dc-shadow-md: 0 8px 26px rgba(16,28,52,.08);
  min-height: 100%;
  animation: obIn .18s ease-out;
}

#content:has(.designed-page:not(.hidden)) {
  background: var(--dc-bg, #EEF1F5);
}

.dc-page-body {
  width: min(1180px, 100%);
  margin: 0 auto;
  /* Sibling .dc-panel sections used to sit flush against each other, because
     nothing here established spacing -- only .dc-storage-hero carried its own
     margin-bottom, so the first gap existed and every gap after it did not
     (visible on 文件库: "最新文件" welded to "导入状态"). Owning the rhythm
     here means every designed page gets it, instead of each block having to
     remember its own margin. */
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dc-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}

.dc-two-col {
  display: flex;
  gap: var(--space-4);
  align-items: stretch;
}

.dc-two-col > .dc-stack {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
}

.dc-two-col > .dc-stack > .dc-toolbar,
.dc-two-col > .dc-stack > .dc-metric-grid,
.dc-two-col > .dc-stack > .dc-hint {
  flex: 0 0 auto;
}

.dc-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  background: var(--dc-surface);
  border: 1px solid var(--dc-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--dc-shadow-sm);
  overflow: hidden;
}

.dc-two-col > .dc-stack > .dc-panel {
  flex: 1 1 0;
  height: 100%;
}

.dc-panel > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--dc-border);
  color: var(--dc-fg);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.dc-panel > h3 small {
  color: var(--dc-fg-3);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0;
  white-space: nowrap;
}

.dc-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--dc-fg-3);
  font-size: 13px;
  font-weight: 700;
}

.dc-toolbar > span { flex: 1; }

.dc-secondary-btn {
  height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--dc-border);
  background: var(--dc-surface);
  color: var(--dc-fg-2);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.dc-secondary-btn:hover { background: var(--dc-hover); }

.dc-metric-grid,
.dc-ledger-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.dc-metric {
  background: var(--dc-surface);
  border: 1px solid var(--dc-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--dc-shadow-sm);
  padding: 18px;
}

.dc-metric-label {
  color: var(--dc-fg-3);
  font-size: 11.5px;
  font-weight: 800;
}

.dc-metric-value {
  margin-top: 7px;
  color: var(--dc-fg);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.dc-metric-sub {
  margin-top: 4px;
  color: var(--dc-fg-3);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
}

.dc-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 124px;
  padding: 28px 20px;
  color: var(--dc-fg-3);
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
}

.dc-hint {
  background: var(--dc-surface-2);
  border: 1px dashed var(--dc-border-strong);
  border-radius: var(--radius-lg);
  color: var(--dc-fg-2);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  padding: 14px 16px;
}

.dc-stack > .dc-hint {
  min-height: 44px;
}

.dc-note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  padding: 16px;
}

.dc-storage-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  gap: var(--space-4);
  /* spacing now comes from .dc-page-body's gap -- keeping a margin here too
     would double the gap below the hero only */
}

.dc-storage-main {
  padding: 22px;
}

.dc-media-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 18px;
}

.dc-media-title h3 {
  color: var(--dc-fg);
  font-size: 15px;
  font-weight: 850;
}

.dc-media-title p {
  margin-top: 3px;
  color: var(--dc-fg-3);
  font-size: 12px;
  font-weight: 650;
}

.dc-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dc-brand-tint);
  color: var(--dc-brand);
  font-weight: 900;
  flex: 0 0 44px;
}

.dc-storage-number {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: 10px;
}

.dc-storage-number b {
  color: var(--dc-fg);
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -.02em;
}

.dc-storage-number span {
  color: var(--dc-fg-3);
  font-size: 13px;
  font-weight: 650;
}

.dc-progress {
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--dc-surface-2);
  overflow: hidden;
  margin-bottom: 16px;
}

.dc-progress i {
  display: block;
  height: 100%;
  min-width: 3%;
  border-radius: inherit;
  background: var(--dc-brand);
}

.dc-drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 210px;
  border: 2px dashed var(--dc-border-strong);
  border-radius: var(--radius-xl);
  background: var(--dc-surface);
  color: var(--dc-fg);
  text-align: center;
  cursor: pointer;
  padding: 22px;
}

.dc-drop-card:hover {
  border-color: var(--dc-brand);
  background: var(--dc-surface-2);
}

.dc-drop-card span {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dc-brand-tint);
  color: var(--dc-brand);
  font-size: 30px;
  font-weight: 700;
}

.dc-drop-card b {
  font-size: 15px;
  font-weight: 850;
}

.dc-drop-card small {
  max-width: 280px;
  color: var(--dc-fg-2);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}

.designed-table {
  display: grid;
  flex: 1 1 auto;
  gap: 0;
}

.designed-table-head,
.designed-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(120px, 1.1fr) minmax(92px, .75fr) minmax(120px, .9fr) minmax(88px, .7fr);
  gap: var(--space-3);
  align-items: center;
}

.designed-table-head {
  padding: 12px 20px;
  border-bottom: 1px solid var(--dc-border);
  color: var(--dc-fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.designed-table-row {
  width: 100%;
  padding: 13px 20px;
  border: 0;
  border-bottom: 1px solid var(--dc-hairline);
  background: transparent;
  color: var(--dc-fg);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.designed-table-row:hover {
  background: var(--dc-surface-2);
}

.designed-table-row:disabled {
  cursor: default;
  opacity: .72;
}

.designed-table-row b {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
}

.designed-table-row small {
  display: block;
  margin-top: 3px;
  color: var(--dc-fg-3);
  font-size: 11px;
  font-weight: 650;
}

.designed-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.dc-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(96px, .8fr) minmax(90px, .6fr);
  align-items: center;
  gap: var(--space-3);
  padding: 13px 20px;
  border-bottom: 1px solid var(--dc-hairline);
}

.dc-list-row.dc-file-row {
  grid-template-columns: minmax(0, 1.6fr) minmax(96px, .55fr) minmax(90px, .45fr) auto;
}

.dc-list-row:last-child { border-bottom: 0; }

.dc-list-row b {
  color: var(--dc-fg);
  font-size: 13.5px;
  font-weight: 800;
}

.dc-list-row span {
  color: var(--dc-fg-2);
  font-size: 12.5px;
  font-weight: 650;
}

.dc-list-row > b:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dc-file-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.dc-file-action {
  border: 0;
  background: transparent;
  color: var(--dc-fg-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

.dc-file-action:hover {
  background: var(--dc-soft-blue);
  color: var(--dc-blue);
}

.dc-file-action.danger:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.dc-bar-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-height: 124px;
  gap: var(--space-3);
  padding: 16px 20px 20px;
}

.dc-bars-panel .dc-bar-list {
  min-height: 150px;
  gap: var(--space-3);
}

.dc-bar {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
}

.dc-bar-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dc-brand-tint);
  color: var(--dc-brand);
  font-size: 15px;
  font-weight: 850;
}

.dc-bar-main {
  min-width: 0;
}

.dc-bar-main > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 6px;
}

.dc-bar span {
  color: var(--dc-fg);
  font-size: 12.5px;
  font-weight: 800;
}

.dc-bar b {
  color: var(--dc-fg);
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dc-bar i {
  display: block;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--dc-surface-2);
  overflow: hidden;
}

.dc-bar em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--dc-brand);
}

.dc-bar-1 .dc-bar-icon { background: #FFF1DC; color: #C46A00; }
.dc-bar-1 em { background: #FF9F0A; }
.dc-bar-2 .dc-bar-icon { background: #E5F1FF; color: #0A84FF; }
.dc-bar-2 em { background: #0A84FF; }
.dc-bar-3 .dc-bar-icon { background: #E4F8EA; color: #248A3D; }
.dc-bar-3 em { background: #34C759; }
.dc-bar-4 .dc-bar-icon { background: #F3E8FF; color: #A855F7; }
.dc-bar-4 em { background: #AF52DE; }
.dc-bar-5 .dc-bar-icon { background: #FFE6E4; color: #D70015; }
.dc-bar-5 em { background: #FF3B30; }

@media (max-width: 900px) {
  .dc-two-col {
    flex-direction: column;
  }

  .dc-storage-hero,
  .dc-note-grid,
  .dc-metric-grid,
  .dc-ledger-hero {
    grid-template-columns: 1fr;
  }

  .designed-table {
    overflow-x: auto;
  }

  .designed-table-head,
  .designed-table-row {
    min-width: 760px;
  }
}

.design-note {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.design-note:last-child {
  border-bottom: 0;
}

.design-bottom-strip {
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-top: 18px;
  color: var(--fol-fg-2);
  font-weight: 800;
}

#nav-designed-map .nav-link {
  padding-left: 18px;
}

.topbar-lang-toggle {
  min-width: 54px;
  height: 34px;
  border-radius: var(--radius-pill);
  font-weight: 800;
}

#nav-designed-map {
  padding: 6px 10px 14px;
}

.nav-overview-slot .nav-links,
.nav-accordion-panel {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-accordion-section {
  margin-top: 6px;
}

.nav-accordion-toggle {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fol-fg-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-accordion-toggle:hover,
.nav-accordion-section.open .nav-accordion-toggle {
  color: var(--fol-brand);
  background: var(--fol-brand-tint);
}

.nav-accordion-toggle b {
  font-size: 14px;
  line-height: 1;
  transform: rotate(-90deg);
  transition: transform .2s ease;
}

.nav-accordion-section.open .nav-accordion-toggle b,
.nav-accordion-section.closing .nav-accordion-toggle b {
  transform: rotate(0deg);
}

.nav-accordion-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform-origin: top;
}

.nav-accordion-section.open .nav-accordion-panel {
  max-height: 420px;
  opacity: 1;
  animation: folAcc 1s ease both;
}

.nav-accordion-section.closing .nav-accordion-panel {
  max-height: 420px;
  opacity: 1;
  animation: folAccOut 2s ease 1s forwards;
}

@keyframes folAcc {
  from { max-height: 0; opacity: 0; }
  to { max-height: 420px; opacity: 1; }
}

@keyframes folAccOut {
  from { max-height: 420px; opacity: 1; }
  to { max-height: 0; opacity: 0; }
}

.platform-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.platform-tabs button {
  border: 1px solid rgba(234,242,245,.12);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  color: var(--platform-fg-2);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  font-weight: 800;
}

.platform-tabs button.active,
.platform-tabs button:hover {
  color: #06151a;
  background: var(--platform-brand);
}

.platform-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.platform-model-grid div {
  display: grid;
  gap: var(--space-1);
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(234,242,245,.10);
}

.platform-model-grid span {
  color: var(--platform-fg-2);
}

.platform-bars {
  display: grid;
  gap: var(--space-3);
}

.platform-bars div {
  display: grid;
  grid-template-columns: 140px 1fr 80px;
  gap: var(--space-2);
  align-items: center;
}

.platform-bars i {
  display: block;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--platform-brand);
  box-shadow: 0 0 24px rgba(21,207,232,.36);
}

@media (max-width: 980px) {
  .mk-hero,
  .mk-grid.two,
  .mk-grid.three,
  .mk-price-grid,
  .mk-contact-grid,
  .auth-gateway,
  .ob-shell,
  .mk-pillars-grid,
  .mk-audience-grid {
    grid-template-columns: 1fr;
  }
  .mk-price-grid,
  .mk-pipeline-row,
  .mk-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ob-rail {
    min-height: auto;
  }
  .mk-belief-inner {
    padding: 64px 24px;
  }
  .mk-belief-inner h3 {
    font-size: 32px;
  }
  .mk-pillars-section {
    padding: 58px 20px;
  }
  .mk-audience-band > div:first-child {
    padding-top: 64px;
  }
  .mk-audience-grid {
    padding-bottom: 64px;
  }
  .mk-final-cta {
    padding: 58px 20px;
  }
  .mk-final-cta > div {
    padding: 42px 22px;
  }
}

/* Handoff app shell alignment */
#main-app {
  --sidebar-w: 248px;
  background: var(--fol-bg);
}

#sidebar {
  width: 248px;
}

#app-main {
  margin-left: 0;
}

#app-topbar {
  height: 60px;
  min-height: 60px;
  background: rgba(244,246,249,.92);
  border-bottom: 1px solid var(--fol-border);
  backdrop-filter: blur(14px);
}

#content {
  max-width: none;
  margin: 0;
  padding-top: 18px;
}

/* 2026-07 full-width app shell:
   keep shared gutters, but remove the old centered/narrow content rail
   so every in-app page can adapt to available width. */
#content {
  width: 100%;
  padding-inline: clamp(18px, 2vw, 32px);
  padding-bottom: 24px;
}

.page,
.designed-page,
.dc-page-body,
.stg-tab,
.settings-sections {
  width: 100%;
  max-width: none;
}

.page {
  padding-inline: 0;
}

.stg-content {
  padding-inline: 0;
}

.dc-page-body {
  margin: 0;
}

#handoff-overview {
  display: grid;
  gap: var(--space-5);
  margin-bottom: 18px;
}

.hf-overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.hf-workspace-card,
.hf-engine-card,
.hf-lower-grid section,
.hf-kpi-grid div,
.hf-engine-strip {
  background: var(--fol-surface);
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 3px rgba(16,28,52,.06);
}

.hf-workspace-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 138px;
  padding: 28px 32px;
}

.hf-status-pill,
.hf-engine-card > span,
.hf-engine-option span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--fol-brand);
  background: #DCFCE7;
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.hf-workspace-card h2 {
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -.03em;
  margin: 10px 0;
}

.hf-workspace-card p {
  max-width: 520px;
  color: var(--fol-fg-2);
  font-weight: 500;
}

.hf-workspace-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.hf-engine-card {
  padding: 22px;
  display: grid;
  gap: var(--space-3);
  color: #EAF2F5;
  background: linear-gradient(165deg,#0B1020,#161D34);
}

.hf-engine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}

.hf-engine-row em {
  color: var(--platform-brand);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.hf-engine-strip {
  display: grid;
  gap: var(--space-4);
  padding: 24px 26px;
}

.hf-engine-strip h3,
.hf-lower-grid h3,
.hf-recent-section h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
}

.hf-engine-strip > div:first-child p {
  margin-top: 6px;
  color: var(--fol-fg-3);
  font-size: 13px;
  font-weight: 600;
}

.hf-engine-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.hf-engine-option {
  position: relative;
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-lg);
  background: #F7F9FC;
}

.hf-engine-option.is-current {
  background: #E7F2FF;
  border-color: #2F87FF;
  box-shadow: inset 0 0 0 1px rgba(47,135,255,.18);
}

.hf-engine-option span {
  padding: 0;
  background: transparent;
  color: var(--fol-brand);
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
}

.hf-engine-option b {
  display: block;
  margin-top: 8px;
  color: var(--fol-fg);
  font-size: 16px;
}

.hf-engine-option p {
  margin-top: 6px;
  color: var(--fol-fg-3);
  font-size: 12px;
  font-weight: 600;
}

.hf-engine-option em {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--fol-brand);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.hf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.hf-kpi-grid div {
  min-height: 110px;
  padding: 22px 24px;
}

.hf-kpi-grid span {
  color: var(--fol-fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hf-kpi-grid b {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  letter-spacing: -.03em;
}

.hf-lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.hf-lower-grid section,
.hf-recent-section {
  padding: 24px;
  background: var(--fol-surface);
  border: 1px solid var(--fol-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 3px rgba(16,28,52,.06);
}

.hf-lower-grid section {
  min-height: 208px;
}

.hf-recent-section {
  min-height: 316px;
}

#hf-category-bars,
#hf-activity,
#hf-recent-docs {
  min-height: 148px;
}

#hf-recent-docs {
  min-height: 244px;
}

.hf-bar {
  display: grid;
  grid-template-columns: 130px 1fr 90px;
  gap: var(--space-2);
  align-items: center;
  margin: 10px 0;
  color: var(--fol-fg-2);
}

.hf-bar i {
  display: block;
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--fol-brand);
}

#hf-recent-docs button,
#hf-activity button {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 100px 90px;
  gap: var(--space-2);
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--fol-border);
  background: transparent;
  padding: 10px 0;
  text-align: left;
  cursor: pointer;
}

#hf-recent-docs em,
#hf-activity em {
  color: var(--fol-fg-3);
  font-style: normal;
}

.hf-empty {
  min-height: inherit;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: var(--space-2);
  padding: 22px;
  color: var(--fol-fg-3);
  text-align: center;
}

.hf-empty span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: #EEF5FF;
  color: var(--fol-brand);
  font-size: 22px;
  box-shadow: inset 0 0 0 1px rgba(47,135,255,.08);
}

.hf-empty b {
  color: var(--fol-fg);
  font-size: 15px;
}

.hf-empty p {
  max-width: 360px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.hf-empty .btn {
  margin-top: 6px;
}

/* DPSTI product shell convergence */
#main-app {
  --sidebar-w: 296px;
  background: #EDF1F5;
}

#sidebar {
  width: var(--sidebar-w);
  background: #FBFCFE;
  border-right-color: rgba(15,23,42,.08);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.7);
}

.sidebar-header {
  min-height: 64px;
  padding: 12px 14px;
  gap: var(--space-2);
}

.logo-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.sidebar-household-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.sidebar-username {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 650;
}

.pool-switcher-wrap {
  padding: 8px 10px 10px;
}

.pool-switcher-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}

.pool-switcher {
  height: 36px;
  padding: 0 10px;
  background: #FFFFFF;
  font-size: 13.5px;
  font-weight: 700;
}

#nav-designed-map {
  padding: 8px 10px 14px;
}

#nav-designed-map .nav-links {
  padding: 0;
}

#nav-designed-map .nav-link {
  min-height: 34px;
  padding: 0 10px 0 24px;
  border-radius: var(--radius-sm);
  color: #687589;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

#nav-designed-map .nav-link:hover {
  background: #F0F4F8;
  color: #172033;
}

#nav-designed-map .nav-link.active {
  background: #E5F1FF;
  color: #075FCF;
  box-shadow: inset 0 0 0 1px rgba(10,132,255,.12);
  font-weight: 700;
}

.nav-accordion-section {
  margin-top: 4px;
}

.nav-accordion-toggle {
  height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.nav-accordion-toggle:hover,
.nav-accordion-section.open .nav-accordion-toggle {
  background: #EEF5FF;
  color: #075FCF;
}

.nav-accordion-toggle b {
  color: #8A96A8;
  font-size: 13px;
  font-weight: 800;
}

.nav-overview-slot .nav-link {
  min-height: 38px;
  padding-left: 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.nav-overview-slot .nav-link.active {
  color: #075FCF;
  font-weight: 850;
}

#app-topbar {
  height: 64px;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(247,249,252,.94);
  border-bottom-color: rgba(15,23,42,.08);
}

.topbar-title {
  font-size: 18px;
  font-weight: 800;
}

.topbar-subtitle {
  font-size: 12.5px;
  font-weight: 650;
}

.topbar-lang-toggle,
.user-chip {
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}

#content {
  padding-top: 20px;
  background: #EDF1F5;
}

.designed-page {
  --dc-bg: #EDF1F5;
  --dc-border: rgba(15,23,42,.08);
  --dc-border-strong: rgba(15,23,42,.14);
  --dc-shadow-sm: 0 1px 2px rgba(16,28,52,.05);
  --dc-shadow-md: 0 6px 18px rgba(16,28,52,.07);
}

.dc-panel,
.dc-metric,
.hf-workspace-card,
.hf-engine-card,
.hf-lower-grid section,
.hf-recent-section,
.hf-kpi-grid div,
.hf-engine-strip {
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(16,28,52,.05);
}

.dc-panel > h3 {
  min-height: 44px;
  padding: 12px 18px;
}

.dc-empty {
  font-size: 13px;
  font-weight: 700;
}

/* Folia v75 mockup alignment: icon-led sidebar and workbench scale */
#sidebar {
  background: #FAFBFD;
}

.sidebar-header {
  min-height: 72px;
  padding: 14px 18px;
}

.logo-mark-sm {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-lg);
  font-size: 20px;
  box-shadow: 0 12px 26px rgba(10,132,255,.24);
}

.sidebar-household-name {
  font-size: 14.5px;
  font-weight: 850;
  color: #0B0F17;
}

.sidebar-username {
  color: #8A95A6;
  font-size: 12px;
  font-weight: 650;
}

.pool-switcher-wrap {
  padding: 12px 14px 12px;
}

.pool-switcher-label {
  margin-bottom: 7px;
  color: #9AA5B4;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.pool-switcher {
  height: 42px;
  border-radius: var(--radius-md);
  border-color: rgba(15,23,42,.11);
  color: #0F172A;
  font-size: 14px;
  font-weight: 800;
}

#nav-designed-map {
  padding: 8px 14px 18px;
}

#nav-designed-map .nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: #334155;
  stroke-width: 2.1;
}

#nav-designed-map .nav-link,
#nav-designed-map .nav-accordion-toggle {
  gap: var(--space-3);
}

#nav-designed-map .nav-link {
  min-height: 38px;
  padding: 0 10px 0 44px;
  color: #5F6E82;
  font-size: 13.5px;
  font-weight: 650;
}

#nav-designed-map .nav-link:hover {
  background: #EEF4FA;
  color: #162033;
}

#nav-designed-map .nav-link.active {
  color: #0874E8;
  background: #E4F1FF;
  box-shadow: inset 0 0 0 1px rgba(10,132,255,.16);
  font-weight: 800;
}

.nav-overview-slot {
  margin-bottom: 10px;
}

.nav-overview-slot .nav-link {
  min-height: 48px;
  padding-left: 14px;
  border-radius: var(--radius-md);
  color: #172033;
  font-size: 14px;
  font-weight: 850;
}

.nav-overview-slot .nav-link .nav-icon,
.nav-overview-slot .nav-link.active .nav-icon,
.nav-accordion-section.open .nav-accordion-toggle .nav-icon {
  color: #0874E8;
}

.nav-accordion-section {
  margin-top: 2px;
}

.nav-accordion-toggle {
  width: 100%;
  min-height: 42px;
  padding: 0 10px 0 12px;
  border-radius: var(--radius-md);
  color: #253349;
  font-size: 14px;
  font-weight: 850;
}

.nav-accordion-toggle span {
  flex: 1;
  text-align: left;
}

.nav-accordion-toggle b {
  transform: rotate(-90deg);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.nav-accordion-section.open .nav-accordion-toggle b {
  transform: rotate(0deg);
}

.nav-accordion-panel {
  padding: 4px 0 8px;
}

.nav-accordion-panel .nav-icon {
  display: none;
}

.bucket-count {
  margin-left: auto;
}

#app-topbar {
  height: 72px;
  min-height: 72px;
  padding: 14px 36px;
  background: rgba(248,250,252,.96);
}

.topbar-title {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.topbar-subtitle {
  margin-top: 4px;
  color: #66758A;
  font-size: 13.5px;
  font-weight: 650;
}

.topbar-lang-toggle {
  height: 44px;
  padding: 0 19px;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  color: #111827;
  font-size: 13.5px;
  font-weight: 850;
}

.user-chip {
  min-height: 44px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
}

.user-chip-avatar,
#user-menu-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
}

.user-chip-name {
  color: #0F172A;
  font-size: 14px;
  font-weight: 850;
}

#content {
  padding: 32px clamp(30px, 2.6vw, 42px) 34px;
}

#handoff-overview {
  gap: var(--space-6);
  width: 100%;
  max-width: none;
  margin: 0 0 24px;
}

.hf-workspace-card,
.hf-kpi-grid div,
.hf-engine-strip,
.hf-lower-grid section,
.hf-recent-section,
.dc-panel,
.dc-metric {
  border-radius: var(--radius-xl);
  border-color: rgba(15,23,42,.075);
  box-shadow: 0 2px 3px rgba(16,28,52,.035), 0 14px 32px rgba(16,28,52,.055);
}

.hf-workspace-card {
  min-height: 174px;
  padding: 40px 44px;
}

.hf-status-pill {
  position: relative;
  gap: var(--space-1);
  padding: 5px 12px 5px 10px;
  color: #16A34A;
  background: #DDFBE8;
}

.hf-status-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: #22C55E;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.7);
}

.hf-workspace-card h2 {
  margin: 18px 0 10px;
  color: #0B0F17;
  font-size: clamp(34px, 3.1vw, 46px);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.hf-workspace-card p {
  max-width: 680px;
  color: #66758A;
  font-size: 16px;
  font-weight: 650;
}

.hf-workspace-actions .btn {
  min-height: 54px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(10,132,255,.24);
}

.hf-kpi-grid {
  gap: var(--space-6);
}

.hf-kpi-grid div {
  position: relative;
  min-height: 132px;
  padding: 28px 30px;
}

.hf-kpi-grid div::before {
  content: "";
  display: block;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: #E5F1FF;
}

.hf-kpi-grid div:nth-child(2)::before {
  background: #E3F6FE;
}

.hf-kpi-grid div:nth-child(3)::before {
  background: #FFF0D8;
}

.hf-kpi-grid div::after {
  content: "";
  position: absolute;
  top: 39px;
  left: 41px;
  width: 18px;
  height: 18px;
  background: #0A84FF;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.4l-2.9 3.1a1 1 0 0 1-1.7-.7V15H6a2 2 0 0 1-2-2V5Zm2 0v8h6v1.9l1.7-1.9H18V5H6Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.4l-2.9 3.1a1 1 0 0 1-1.7-.7V15H6a2 2 0 0 1-2-2V5Zm2 0v8h6v1.9l1.7-1.9H18V5H6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.hf-kpi-grid div:nth-child(2)::after {
  background: #0EA5C6;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 2a7 7 0 1 1 0 14 7 7 0 0 1 0-14Zm1 3h-2v5.2l4.1 2.5 1-1.7-3.1-1.8V8Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 2a7 7 0 1 1 0 14 7 7 0 0 1 0-14Zm1 3h-2v5.2l4.1 2.5 1-1.7-3.1-1.8V8Z'/%3E%3C/svg%3E");
}

.hf-kpi-grid div:nth-child(3)::after {
  background: #D97706;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M13 2v3.1c2.3.3 4 1.6 4.9 3.5l-1.9.9c-.8-1.6-2.1-2.4-4-2.4-2 0-3.2.8-3.2 2.1 0 1.4 1.5 1.8 4 2.4 2.8.7 5.4 1.5 5.4 4.7 0 2.6-2 4.4-5.2 4.7V24h-2v-3c-2.9-.3-4.9-1.8-5.8-4.1l2-.8c.7 1.8 2.3 2.9 4.8 2.9 2.5 0 4-.9 4-2.5 0-1.5-1.5-2-4.1-2.6-2.8-.7-5.3-1.4-5.3-4.5 0-2.3 1.8-4 4.4-4.3V2h2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M13 2v3.1c2.3.3 4 1.6 4.9 3.5l-1.9.9c-.8-1.6-2.1-2.4-4-2.4-2 0-3.2.8-3.2 2.1 0 1.4 1.5 1.8 4 2.4 2.8.7 5.4 1.5 5.4 4.7 0 2.6-2 4.4-5.2 4.7V24h-2v-3c-2.9-.3-4.9-1.8-5.8-4.1l2-.8c.7 1.8 2.3 2.9 4.8 2.9 2.5 0 4-.9 4-2.5 0-1.5-1.5-2-4.1-2.6-2.8-.7-5.3-1.4-5.3-4.5 0-2.3 1.8-4 4.4-4.3V2h2Z'/%3E%3C/svg%3E");
}

.hf-kpi-grid span {
  position: absolute;
  top: 34px;
  left: 86px;
  color: #8A95A6;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.hf-kpi-grid b {
  margin-top: 2px;
  color: #0B0F17;
  font-size: 42px;
  line-height: 1;
}

.hf-kpi-grid div:nth-child(3) b {
  color: #D97706;
}

.hf-engine-strip {
  gap: var(--space-5);
  padding: 28px 34px 32px;
}

.hf-engine-strip h3,
.hf-lower-grid h3,
.hf-recent-section h3 {
  color: #0B0F17;
  font-size: 21px;
  font-weight: 850;
}

.hf-engine-strip > div:first-child p {
  color: #66758A;
  font-size: 14px;
}

.hf-engine-options {
  gap: var(--space-4);
}

.hf-engine-option {
  min-height: 106px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
}

.hf-engine-option b {
  font-size: 18px;
}

.hf-engine-option p {
  font-size: 13px;
}

.hf-lower-grid {
  gap: var(--space-6);
}

.hf-lower-grid section {
  min-height: 300px;
  padding: 32px 34px;
}

.hf-recent-section {
  min-height: 346px;
  padding: 32px 34px;
}

.hf-empty span {
  width: 58px;
  height: 58px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: #E8F2FF;
  color: #0A84FF;
}

.hf-empty svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hf-empty b {
  color: #0B0F17;
  font-size: 15px;
  font-weight: 850;
}

.hf-empty p {
  color: #8A95A6;
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 900px) {
  .hf-workspace-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .hf-engine-options,
  .hf-kpi-grid,
  .hf-lower-grid {
    grid-template-columns: 1fr;
  }
}

/* Handoff admin console alignment */
#page-platform {
  max-width: 1200px;
}

#page-platform .page-header {
  min-height: 58px;
}

.platform-tabs {
  position: sticky;
  top: 60px;
  z-index: 5;
  padding: 8px 0;
  background: rgba(10,14,22,.86);
  backdrop-filter: blur(12px);
}

#admin-handoff-overview {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 18px;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.admin-kpi-grid div,
.admin-overview-grid section {
  border: 1px solid rgba(234,242,245,.10);
  border-radius: var(--radius-lg);
  background: var(--platform-surface);
  box-shadow: 0 18px 54px rgba(0,0,0,.24);
}

.admin-kpi-grid div {
  padding: 18px;
}

.admin-kpi-grid span {
  display: block;
  color: var(--platform-fg-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.admin-kpi-grid b {
  display: block;
  margin-top: 8px;
  color: var(--platform-fg);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  letter-spacing: -.03em;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: var(--space-3);
}

.admin-overview-grid section {
  padding: 18px;
}

.admin-overview-grid h3 {
  color: var(--platform-fg);
  font-size: 15px;
  margin-bottom: 14px;
}

.admin-dist-row,
.admin-health p,
.admin-activity-row {
  display: grid;
  grid-template-columns: 105px 1fr 42px;
  gap: var(--space-2);
  align-items: center;
  color: var(--platform-fg-2);
  margin: 10px 0;
}

.admin-dist-row i {
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--platform-brand);
  box-shadow: 0 0 18px rgba(21,207,232,.28);
}

.admin-health p {
  grid-template-columns: 1fr auto;
  padding: 10px 0;
  border-bottom: 1px solid rgba(234,242,245,.08);
}

.admin-health span {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.admin-activity-row {
  grid-template-columns: 1fr 90px 130px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(234,242,245,.08);
}

.admin-activity-row em,
.admin-activity-row b {
  color: var(--platform-fg-2);
  font-style: normal;
  font-size: 12px;
}

@media (max-width: 680px) {
  .mk-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .mk-hero h2 {
    font-size: 2.5rem;
  }
  .mk-price-grid,
  .mk-pipeline-row,
  .mk-compare,
  .ob-plan-grid,
  .mk-footer {
    grid-template-columns: 1fr;
  }
  #onboarding-screen {
    padding: 16px;
  }
  .ob-main,
  .auth-gateway section,
  .auth-gateway aside {
    padding: 22px;
  }
}
