:root,
[data-theme="light"] {
  /* Centralized Theme System - Light Mode */
  --bg-primary: #F4F3EC;
  --bg-secondary: #EAEAE2;
  --bg-card: #FFFEFA;
  --bg-card-hover: #FFFFFF;
  --bg-surface-raised: #F7F7F2;
  --bg-surface-sunken: #EAEAE2;

  --text-primary: #10231B;
  --text-secondary: #1E3028;
  --text-muted: #374740;
  --text-dim: #5D6B63;

  --border-color: #C8CEC8;
  --border-color-hover: rgba(10, 102, 72, 0.45);

  --accent-color: #0A6648;
  --accent-light: rgba(10, 102, 72, 0.12);
  --accent-deep: #064030;
  --accent-secondary: #7A5520;
  --accent-secondary-light: #F0E0B8;

  --button-bg: #10231B;
  --button-text: #FFFFFF;
  --input-bg: #FFFFFF;
  --link-color: #0A6648;

  /* Backward Compatibility Mappings */
  --bg-main: var(--bg-primary);
  --bg-surface: var(--bg-card);
  --text-main: var(--text-primary);
  --text-soft: var(--text-secondary);
  --nav-link: #34463D;
  --accent-primary: var(--accent-color);
  --accent-primary-light: #C8E9D9;
  --accent-primary-deep: var(--accent-deep);
  --shadow-color: rgba(16, 38, 25, 0.14);
  --shadow-soft: rgba(16, 38, 25, 0.07);

  /* Workspace Tokens - Light Mode */
  --cq-bg: #E8EDE9;
  --cq-sidebar: #D8E2DA;
  --cq-surface: #FFFFFF;
  --cq-surface-hover: #F2F8F4;
  --cq-surface-raised: #EDF4EF;
  --cq-surface-sunken: #DDE6DF;
  --cq-border: rgba(15, 50, 30, 0.18);
  --cq-border-subtle: rgba(15, 50, 30, 0.10);
  --cq-border-hover: rgba(7, 122, 88, 0.55);
  --cq-text: #0D1A10;
  --cq-text-muted: #2E4438;
  --cq-text-dim: #4E6459;
  --cq-emerald: #076845;
  --cq-emerald-glow: rgba(7, 104, 69, 0.12);
  --cq-emerald-hover: #05503a;
  --cq-emerald-dark: #04402e;
  --cq-danger: #b52a20;
  --cq-danger-bg: rgba(181, 42, 32, 0.08);
  --cq-danger-border: rgba(181, 42, 32, 0.22);
  --cq-warning: #7a4e08;
  --cq-info: #0869a8;

  /* Core typography & metrics */
  --radius: 16px;
  --radius-sm: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Tiered Shadow System */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.13);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 20px var(--accent-light);

  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;

  --danger: #8B2218;
  --warning: #6B4209;
}

[data-theme="dark"],
html[data-theme="dark"] {
  /* Centralized Theme System - Dark Mode */
  --bg-primary: #0A100C;
  --bg-secondary: #0E1612;
  --bg-card: #131C16;
  --bg-card-hover: #18241D;
  --bg-surface-raised: #17231B;
  --bg-surface-sunken: #0A0F0C;

  --text-primary: #F0F5F1;
  --text-secondary: #D4E2D7;
  --text-muted: #A6B8AC;
  --text-dim: #7E9485;

  --border-color: #24382B;
  --border-color-hover: rgba(62, 212, 160, 0.5);

  --accent-color: #3ED4A0;
  --accent-light: rgba(62, 212, 160, 0.16);
  --accent-deep: #6EE7B7;
  --accent-secondary: #E5B25D;
  --accent-secondary-light: rgba(229, 178, 93, 0.18);

  --button-bg: #3ED4A0;
  --button-text: #0A100C;
  --input-bg: #0E1612;
  --link-color: #3ED4A0;

  /* Backward Compatibility Mappings */
  --bg-main: var(--bg-primary);
  --bg-surface: var(--bg-card);
  --text-main: var(--text-primary);
  --text-soft: var(--text-secondary);
  --nav-link: #C4D4CA;
  --accent-primary: var(--accent-color);
  --accent-primary-light: var(--accent-light);
  --accent-primary-deep: var(--accent-deep);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --shadow-soft: rgba(0, 0, 0, 0.3);

  /* Workspace Tokens - Dark Mode */
  --cq-bg: #0A0D0B;
  --cq-sidebar: #0F1310;
  --cq-surface: #161D18;
  --cq-surface-hover: #1E2A22;
  --cq-surface-raised: #1E2A22;
  --cq-surface-sunken: #080C0A;
  --cq-border: rgba(255, 255, 255, 0.14);
  --cq-border-subtle: rgba(255, 255, 255, 0.08);
  --cq-border-hover: rgba(62, 212, 160, 0.5);
  --cq-text: #EEF2EE;
  --cq-text-muted: #B4C0B8;
  --cq-text-dim: #8FA89A;
  --cq-emerald: #22D49A;
  --cq-emerald-glow: rgba(34, 212, 154, 0.15);
  --cq-emerald-hover: #0FB882;
  --cq-emerald-dark: #065A43;
  --cq-danger: #fc8181;
  --cq-danger-bg: rgba(252, 129, 129, 0.12);
  --cq-danger-border: rgba(252, 129, 129, 0.28);
  --cq-warning: #fbbf24;
  --cq-info: #60c8f5;

  /* Marketing legacy dark tokens */
  --ink: #EEF2EE;
  --ink-soft: #D4E2D7;
  --surface: #0E1511;
  --surface-raised: #17231B;
  --surface-dark: #0A100C;
  --line: #2E4235;
  --line-dark: #476250;
  --muted: #B4C0B8;
  --muted-dark: #D4E2D7;
  --ivory: #F0F5F1;
  --emerald: #3ED4A0;
  --emerald-light: #173D2D;
  --emerald-deep: #7AE0B8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 8% 0%, rgba(216, 238, 225, .7), transparent 30rem),
    radial-gradient(circle at 92% 18%, rgba(243, 231, 201, .32), transparent 26rem),
    var(--bg-primary);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] body {
  color: var(--text-primary);
  background:
    radial-gradient(circle at 8% 0%, rgba(18, 104, 72, .25), transparent 30rem),
    radial-gradient(circle at 92% 18%, rgba(104, 78, 22, .15), transparent 26rem),
    var(--bg-primary);
}
  -webkit-font-smoothing: antialiased;
}
body.workspace-body { background: var(--cq-bg, #0d110f); color: var(--cq-text, #f4f3ee); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-primary); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(22, 120, 93, .35); outline-offset: 3px; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  /* relative needed so the mobile dropdown anchors to this header */
  background: rgba(251, 250, 243, .86);
  border-bottom: 1px solid rgba(217, 216, 207, .9);
  backdrop-filter: blur(16px);
  overflow: visible;
}
.site-nav, .container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.site-nav { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--accent-primary-deep), #0c0f0d); border: 1px solid rgba(181, 138, 67, .45); border-radius: 10px; box-shadow: 0 5px 14px rgba(7, 81, 62, .22); font-weight: 800; }
.brand-name { font-size: 1.1rem; }
.site-links, .nav-actions, .footer-links { display: flex; align-items: center; gap: 20px; list-style: none; }
.site-links a { color: var(--nav-link, #34463D); }
.site-links a:hover { color: var(--text-main); }
.nav-actions { gap: 10px; }
.nav-user { display: none; color: var(--text-muted); font-size: .8rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 1.35rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px;
  font-weight: 750; font-size: .86rem; letter-spacing: -.01em;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, #15966e 0%, var(--accent-primary-deep) 100%);
  border-color: rgba(7, 81, 62, .7);
  box-shadow: 0 8px 18px rgba(7, 81, 62, .2), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn-primary:hover {
  color: #fff;
  background: linear-gradient(145deg, #1ba97b 0%, #07513e 100%);
  border-color: #07513e;
  box-shadow: 0 12px 26px rgba(7, 81, 62, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-outline {
  color: var(--text-main);
  background: rgba(255, 254, 250, .55);
  border-color: #c8c9bd;
  box-shadow: 0 3px 10px rgba(16, 38, 25, .05), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.btn-outline:hover {
  color: var(--accent-primary-deep);
  border-color: var(--accent-primary);
  background: var(--bg-surface-raised);
  box-shadow: 0 7px 16px rgba(16, 38, 25, .1);
}
.btn-dark {
  color: #fff;
  background: linear-gradient(145deg, #2c4937, #0c0f0d);
  border-color: rgba(17, 23, 19, .7);
  box-shadow: 0 7px 16px rgba(17, 23, 19, .16), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.btn-dark:hover {
  color: #fff;
  background: linear-gradient(145deg, #395d46, #17251b);
  box-shadow: 0 11px 22px rgba(17, 23, 19, .24);
}
.btn-danger { color: var(--danger); background: rgba(255, 250, 249, .45); border-color: #d8aaa5; }
.btn-danger:hover { color: #8f332b; background: #fff3f1; border-color: #b87871; }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: .78rem; border-radius: 9px; }

.hero { padding: 104px 0 74px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 70px; }
.eyebrow { color: var(--accent-primary); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.hero-copy { max-width: 560px; color: var(--text-muted); font-size: 1.1rem; }
.hero-subheading { margin: -8px 0 16px; color: var(--accent-primary-deep); font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 700; letter-spacing: -.03em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 18px; color: var(--text-muted); font-size: .78rem; }
.preview-window { padding: 12px; border: 1px solid rgba(181, 138, 67, .46); border-radius: 18px; background: linear-gradient(145deg, #294535, #101a14); box-shadow: 0 30px 70px rgba(11, 43, 30, .22), 0 0 0 8px rgba(255, 254, 250, .4); transform: rotate(1deg); }
.preview-top { height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 8px; color: #98a396; font-size: .7rem; }
.preview-dot { width: 7px; height: 7px; border-radius: 50%; background: #667066; }
.preview-body { display: grid; grid-template-columns: 92px 1fr; min-height: 310px; border-radius: 10px; overflow: hidden; background: #f7f5ee; }
.preview-side { padding: 18px 10px; color: #aab2a7; background: #1c211d; font-size: .65rem; }
.preview-side strong { display: block; margin-bottom: 22px; color: #f3f1e9; font-size: .76rem; }
.preview-side div { margin: 13px 0; }
.preview-side-active { color: var(--ivory); font-weight: 700; }
.preview-main { padding: 23px; }
.preview-main h3 { font-size: 1.1rem; }
.preview-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: #637269; font-size: .68rem; }
.preview-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-primary); box-shadow: 0 0 0 4px rgba(13, 118, 86, .12); }
.preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.preview-card { min-height: 78px; padding: 12px; border: 1px solid #deded5; border-radius: 9px; background: #fffdf8; }
.preview-card small { display: block; color: #777d73; font-size: .65rem; }
.preview-card strong { display: block; margin-top: 8px; font-size: 1rem; }
.preview-card span { display: block; margin-top: 5px; color: #777d73; font-size: .64rem; }
.preview-card-wide { grid-column: 1 / -1; min-height: 88px; }
.section { padding: clamp(64px, 7vw, 92px) 0; }
.pricing-section {
  width: 100%;
  max-width: none;
  padding-right: clamp(20px, 4vw, 72px);
  padding-left: clamp(20px, 4vw, 72px);
}

.pricing-section > .section-heading,
.pricing-section > .grid,
.pricing-section > .comparison-wrap {
  width: 100%;
  max-width: 1480px;
  margin-right: auto;
  margin-left: auto;
}

.pricing-section > .grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pricing-section .price-card {
  width: 100%;
}
.workflow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.5vw, 24px); }
.workflow-step { display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: clamp(22px, 2.5vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 254, 250, .72); }
.workflow-step h3 { margin-bottom: 10px; font-size: 1.15rem; line-height: 1.35; }
.workflow-step p { color: var(--text-muted); font-size: .92rem; line-height: 1.65; }
.workflow-step-number { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; background: var(--accent-primary-deep); font-size: .75rem; font-weight: 800; flex-shrink: 0; }
.workflow-tag { display: inline-block; margin-top: 16px; color: var(--accent-primary-deep); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; }
.architecture-strip { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 28px; padding: 28px 32px; border: 1px solid #315542; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, #1d3b2c, #111b15); }
.architecture-strip h3 { margin-top: 8px; font-size: 1.35rem; }
.architecture-points { display: grid; grid-template-columns: repeat(2, auto); gap: 14px 28px; color: var(--text-muted); font-size: .8rem; }
.architecture-points strong { margin-right: 6px; color: #9bd6bf; }
.section-heading { max-width: 680px; margin-bottom: clamp(32px, 4vw, 44px); }
.section-heading h2 { margin-top: 10px; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.15; letter-spacing: -.04em; }
.section-heading p { margin-top: 14px; color: var(--text-muted); font-size: clamp(1rem, 1.2vw, 1.12rem); line-height: 1.65; }
.grid { display: grid; gap: clamp(20px, 2.5vw, 24px); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { padding: clamp(22px, 2.5vw, 30px); border: 1px solid rgba(216, 216, 205, .9); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255, 254, 250, .98), rgba(249, 248, 240, .9)); box-shadow: var(--shadow-soft); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card:hover { transform: translateY(-3px); border-color: rgba(13, 118, 86, .3); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 12px; font-size: 1.1rem; line-height: 1.35; }
.card p, .muted { color: var(--text-muted); line-height: 1.65; }
.feature-benefit { margin-bottom: 12px; font-weight: 600; line-height: 1.55; color: var(--text-main); }
.feature-number { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 22px; color: var(--accent-primary-deep); background: linear-gradient(145deg, var(--accent-primary-light), #c4e3d2); border: 1px solid rgba(13, 118, 86, .18); border-radius: 50%; font-weight: 800; font-size: .82rem; }
.security-panel {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--shadow-soft);
}
[data-theme="dark"] .security-panel {
  color: #fff;
  background: radial-gradient(circle at 90% 0%, rgba(181, 138, 67, .2), transparent 24rem), linear-gradient(145deg, #1c3a2b, #0c0f0d);
  border-color: #315542;
  box-shadow: 0 24px 60px rgba(13, 55, 37, .2);
}
.security-panel p, .security-panel .muted { color: var(--text-muted); }
.security-panel a { color: var(--accent-primary); text-decoration: underline; }
[data-theme="dark"] .security-panel a { color: #9bd6bf; }
.price-card { position: relative; }
.price-card {
  display: flex;
  min-height: 470px;
  flex-direction: column;
  align-items: stretch;
}
.price-card > .badge {
  align-self: flex-start;
  min-height: 26px;
}
.price-card > .price {
  min-height: 52px;
  display: flex;
  align-items: center;
}
.price-card.featured { border: 2px solid var(--accent-primary); box-shadow: 0 20px 55px rgba(13, 118, 86, .15); }
.price-card.featured::before { position: absolute; top: -11px; right: 24px; padding: 4px 10px; color: #6d4c19; background: var(--accent-secondary-light); border: 1px solid rgba(181, 138, 67, .4); border-radius: 999px; content: "Most popular"; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.price-card .price { margin: 18px 0; font-size: 2.1rem; font-weight: 800; letter-spacing: -.05em; }
.price-period { font-size: 1rem; font-weight: 600; }
.price-payg { font-size: 1.7rem !important; }
.price-card-muted { background: linear-gradient(145deg, rgba(246, 245, 238, .95), rgba(237, 237, 227, .9)); }
.price-card ul { margin: 18px 0 24px; padding-left: 18px; color: var(--text-muted); }
.price-card li { margin: 8px 0; }
.price-card > .btn {
  width: 100%;
  margin-top: auto;
}
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; color: var(--accent-primary); background: var(--accent-primary-light); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.badge-free { color: #61685f; background: #e8e8e0; }
.badge-premium { color: #126348; background: linear-gradient(135deg, #d9f0e2, #c4e4d2); border: 1px solid rgba(13, 118, 86, .18); }
.badge-warning { color: var(--warning); background: #f3e6c9; }
.badge-danger { color: var(--danger); background: #f2d8d4; }
.cta { padding: 54px; border: 1px solid rgba(181, 138, 67, .35); border-radius: var(--radius); color: #fff; background: radial-gradient(circle at 85% 15%, rgba(181, 138, 67, .2), transparent 22rem), linear-gradient(135deg, #1e3d2e, #0c0f0d); box-shadow: 0 24px 60px rgba(14, 37, 24, .18); }
.cta h2 { max-width: 620px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -.05em; }
.cta p { max-width: 540px; margin: 14px 0 24px; color: var(--text-muted); }
.cta-outline { color: #fff; border-color: rgba(251, 250, 243, .35); }
.cta-outline:hover { color: #fff; border-color: #fff; background: rgba(251, 250, 243, .1); }
.comparison-wrap { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 254, 250, .65); }
.comparison-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.comparison-heading h3 { margin-top: 7px; font-size: 1.15rem; }
.comparison-heading > .muted { max-width: 360px; text-align: right; font-size: .78rem; }
.comparison-scroll { overflow-x: auto; }
.comparison-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th,
.comparison-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e4e4da;
  font-size: .82rem;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  width: 34%;
}

.comparison-table th:not(:first-child),
.comparison-table td:not(:first-child) {
  width: 22%;
}

.comparison-table thead th { color: var(--text-muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.comparison-table thead th:not(:first-child), .comparison-table td:not(:first-child) { text-align: center; }
.comparison-table tbody th { color: var(--text-main); font-weight: 700; }
.comparison-table tbody td { color: var(--text-muted); }
.comparison-table tbody tr:last-child th, .comparison-table tbody tr:last-child td { border-bottom: 0; }
.footer { margin-top: 50px; padding: 28px 0; border-top: 1px solid var(--line); color: var(--text-muted); font-size: .8rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-links { gap: 16px; }

/* ==========================================================================
   CipherQ Authenticated Workspace Design System (Deep Charcoal & Emerald)
   ========================================================================== */

body.workspace-body {
  --cq-radius:    var(--radius);
  --cq-radius-sm: var(--radius-sm);
  background-color: var(--cq-bg);
  color: var(--cq-text);
  min-height: 100vh;
}

[data-theme="dark"] body.workspace-body,
html[data-theme="dark"] body.workspace-body {
  /* ── Workspace Dark Mode ── */
  background-color: var(--cq-bg);
  background-image:
    radial-gradient(ellipse 70% 35% at 20% 0%, rgba(34, 212, 154, 0.05), transparent),
    radial-gradient(circle at 90% 100%, rgba(6, 78, 59, 0.07), transparent 30rem);
  color: var(--cq-text);
}

[data-theme="light"] body.workspace-body,
html[data-theme="light"] body.workspace-body {
  /* ── Workspace Light Mode ── */
  background-color: var(--cq-bg);
  background-image:
    radial-gradient(ellipse 70% 35% at 20% 0%, rgba(7, 104, 69, 0.07), transparent),
    radial-gradient(circle at 90% 100%, rgba(181, 138, 67, 0.07), transparent 30rem);
  color: var(--cq-text);
}

[data-theme="dark"] body:not(.workspace-body) {
  --ink: #edf4ee;
  --ink-soft: #d4e2d7;
  --surface: #0e1511;
  --surface-raised: #17231b;
  --surface-dark: #0a100c;
  --line: #3a5546;
  --line-dark: #5e7a66;
  --muted: #b8c6bc;
  --muted-dark: #ccd8d0;
  --ivory: #f4f7f2;
  --emerald: #3ed4a0;
  --emerald-light: #173d2d;
  --emerald-deep: #7ae0b8;
  --gold-light: #40351f;
  --shadow: 0 22px 70px rgba(0, 0, 0, .32);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .22);
  background:
    radial-gradient(circle at 8% 0%, rgba(18, 104, 72, .2), transparent 30rem),
    radial-gradient(circle at 92% 18%, rgba(104, 78, 22, .12), transparent 26rem),
    var(--surface);
}

[data-theme="dark"] .site-header {
  background: rgba(14, 21, 17, .88);
  border-color: var(--line);
}

[data-theme="dark"] .card,
[data-theme="dark"] .workflow-step {
  background: linear-gradient(145deg, rgba(23, 35, 27, .98), rgba(17, 27, 21, .94));
  border-color: var(--line);
}

[data-theme="dark"] .btn-outline {
  color: var(--ink-soft);
  background: rgba(23, 35, 27, .7);
  border-color: var(--line);
}

[data-theme="dark"] .price-card-muted {
  background: linear-gradient(145deg, rgba(28, 39, 31, .95), rgba(19, 29, 22, .9));
}

.workspace {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
.workspace-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 256px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  background: var(--cq-sidebar);
  border-right: 1px solid var(--cq-border);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, visibility 0.25s ease;
}

.sidebar-brand-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--cq-border-subtle);
  margin-bottom: 20px;
}

.workspace-sidebar .brand {
  color: var(--cq-text);
  gap: 10px;
}

.workspace-sidebar .brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #f4f3ee;
  background: linear-gradient(135deg, #064e3b, #0c0f0d);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 9px;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
  font-weight: 800;
  font-size: 0.95rem;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--cq-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
  text-transform: uppercase;
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cq-text-muted);
  padding: 0 10px 8px;
}

.workspace-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workspace-nav a,
.workspace-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--cq-radius-sm);
  color: var(--cq-text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none;
}

.workspace-nav a:hover,
.workspace-nav .nav-item:hover {
  color: var(--cq-text);
  background: var(--cq-surface-raised);
  border-color: var(--cq-border);
}

.workspace-nav a.active,
.workspace-nav .nav-item.active {
  color: #ffffff;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}

.workspace-nav a.active svg,
.workspace-nav .nav-item.active svg {
  color: var(--cq-emerald);
  stroke: var(--cq-emerald);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  opacity: 0.85;
}

.sidebar-system-info {
  margin-top: auto;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--cq-surface-sunken);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius-sm);
}

.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--cq-text);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cq-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.system-crypto-tag {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--cq-text-muted);
  margin-top: 4px;
}

.workspace-account {
  padding-top: 14px;
  border-top: 1px solid var(--cq-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cq-surface-raised);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: grid;
  place-items: center;
  color: var(--cq-emerald);
  flex-shrink: 0;
}

.account-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.workspace-sidebar .nav-user {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cq-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 145px;
}

.workspace-sidebar .badge {
  align-self: flex-start;
  font-size: 0.65rem;
  padding: 2px 7px;
}

.btn-logout-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--cq-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-logout-action:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
}

/* Mobile Workspace Header */
.workspace-mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(8, 11, 9, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cq-border);
}

.mobile-toggle-btn {
  background: transparent;
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius-sm);
  color: var(--cq-text);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 45;
}

.sidebar-backdrop.active {
  display: block;
}

.workspace-sidebar.drawer-open {
  transform: translateX(0) !important;
  visibility: visible !important;
}

/* Main Workspace Area */
.workspace-main {
  width: calc(100% - 256px);
  margin-left: 256px;
  min-height: 100vh;
  padding: 40px min(5vw, 64px) 60px;
}

.workspace-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--cq-border-subtle);
}

.workspace-top .eyebrow {
  color: var(--cq-emerald);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-top h1 {
  font-size: clamp(1.8rem, 2.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--cq-text);
  line-height: 1.15;
}

.workspace-top p {
  margin-top: 8px;
  color: var(--cq-text-muted);
  font-size: 0.94rem;
  max-width: 660px;
  line-height: 1.5;
}

.workspace-top .nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Workspace Cards & Metrics */
.workspace-body .card {
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  color: var(--cq-text);
}

.workspace-body .card:hover {
  border-color: var(--cq-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.workspace-body .card h2,
.workspace-body .card h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cq-text);
  margin-bottom: 8px;
}

.workspace-body .card p,
.workspace-body .muted {
  color: var(--cq-text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.workspace-body .grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.workspace-body .metric {
  min-height: 146px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.workspace-body .metric-label {
  color: var(--cq-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workspace-body .metric-value {
  margin-top: 14px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--cq-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.workspace-body .metric-meta {
  font-size: 0.78rem;
  color: var(--cq-text-muted);
  margin-top: 4px;
}

.workspace-body .progress {
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cq-surface-raised);
}

.workspace-body .progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.4s ease;
}

/* Feature Cards on Dashboard */
.feature-link-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.feature-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: grid;
  place-items: center;
  color: var(--cq-emerald);
  flex-shrink: 0;
}

/* Section Headings */
.workspace-section {
  margin-top: 36px;
}

.workspace-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.workspace-section-heading h2 {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cq-text);
}

/* Filter Toolbar */
.vault-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.vault-search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}

.vault-search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cq-text-dim);
  pointer-events: none;
}

.vault-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  font-size: 0.84rem;
  border-radius: var(--cq-radius-sm);
  background: var(--cq-surface-sunken);
  border: 1px solid var(--cq-border);
  color: var(--cq-text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.vault-search-input:focus {
  border-color: var(--cq-emerald);
  box-shadow: 0 0 0 3px var(--cq-emerald-glow);
}

.vault-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--cq-border);
  color: var(--cq-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  color: var(--cq-text);
  background: var(--cq-surface-raised);
  border-color: var(--cq-border-hover);
}

.filter-pill.active {
  background: var(--cq-emerald-glow);
  border-color: var(--cq-border-hover);
  color: var(--cq-emerald);
  font-weight: 700;
}

/* Tables */
.workspace-body .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  background: var(--cq-surface);
}

.workspace-body table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.workspace-body th {
  padding: 13px 18px;
  color: var(--cq-text-dim);
  background: var(--cq-surface-sunken);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border-bottom: 1px solid var(--cq-border);
}

.workspace-body td {
  padding: 15px 18px;
  border-top: 1px solid var(--cq-border-subtle);
  font-size: 0.86rem;
  color: var(--cq-text);
  vertical-align: middle;
}

.workspace-body tr:hover td {
  background: var(--cq-surface-hover);
}

.file-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--cq-surface-raised);
  border: 1px solid var(--cq-border);
  display: grid;
  place-items: center;
  color: var(--cq-emerald);
  flex-shrink: 0;
}

.workspace-body .file-name {
  font-weight: 600;
  color: var(--cq-text);
  display: block;
}

.workspace-body .file-meta {
  margin-top: 3px;
  color: var(--cq-text-dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  display: block;
}

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

/* Dropzone */
.workspace-body .dropzone {
  padding: 34px 24px;
  border: 1.5px dashed rgba(16, 185, 129, 0.35);
  border-radius: var(--cq-radius);
  color: var(--cq-text-muted);
  background: var(--cq-surface-sunken);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer;
  margin-bottom: 24px;
}

.workspace-body .dropzone:hover,
.workspace-body .dropzone.dragover {
  border-color: var(--cq-emerald);
  background: rgba(16, 185, 129, 0.06);
  transform: translateY(-1px);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: grid;
  place-items: center;
  color: var(--cq-emerald);
}

.workspace-body .dropzone strong {
  display: block;
  margin-bottom: 6px;
  color: var(--cq-text);
  font-size: 1rem;
  font-weight: 700;
}

.workspace-body .dropzone span {
  display: block;
  font-size: 0.84rem;
  color: var(--cq-text-muted);
  max-width: 520px;
  margin: 0 auto 14px;
}

.workspace-body .dropzone input {
  display: none;
}

/* Buttons */
.workspace-body .btn,
.btn-primary,
.btn-outline,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.86rem;
  transition: all 0.18s ease;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}

.workspace-body .btn:hover {
  transform: translateY(-1px);
}

.workspace-body .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.workspace-body .btn-primary {
  color: #ffffff;
  background: linear-gradient(145deg, var(--cq-emerald), var(--cq-emerald-hover));
  box-shadow: 0 6px 16px var(--cq-emerald-glow), inset 0 1px 0 rgba(255, 255, 255, .15);
  border-color: var(--cq-emerald-hover);
}

.workspace-body .btn-primary:hover {
  color: #ffffff;
  background: linear-gradient(145deg, var(--cq-emerald-hover), var(--cq-emerald-dark));
  box-shadow: 0 10px 22px var(--cq-emerald-glow), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.workspace-body .btn-outline {
  color: var(--cq-text);
  background: rgba(128, 128, 128, 0.08);
  border-color: var(--cq-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.workspace-body .btn-outline:hover {
  color: var(--cq-text);
  border-color: rgba(52, 211, 153, .52);
  background: rgba(128, 128, 128, 0.14);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .2);
}

.workspace-body .btn-danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.workspace-body .btn-danger:hover {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(239, 68, 68, 0.9);
}

.workspace-body .btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 0.78rem;
  border-radius: 8px;
}

/* Badges */
.workspace-body .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.workspace-body .badge-free {
  color: var(--cq-text-muted);
  background: var(--cq-surface-raised);
  border-color: var(--cq-border);
}

.workspace-body .badge-premium {
  color: var(--cq-emerald);
  background: var(--cq-emerald-glow);
  border-color: var(--cq-border-hover);
}

.workspace-body .badge-success {
  color: var(--cq-emerald);
  background: var(--cq-emerald-glow);
  border-color: var(--cq-border-hover);
}

.workspace-body .badge-vault {
  color: var(--cq-text-muted);
  background: var(--cq-surface-raised);
  border-color: var(--cq-border);
}

.workspace-body .badge-warning {
  color: var(--cq-warning);
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
}

.workspace-body .badge-danger {
  color: var(--cq-danger);
  background: var(--cq-danger-bg);
  border-color: var(--cq-danger-border);
}

.workspace-body .badge-meta {
  color: var(--cq-text-dim);
  background: var(--cq-surface-raised);
  border-color: var(--cq-border);
  font-family: var(--mono);
}

/* AI Assistant Chat */
.ai-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--cq-surface-sunken);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius-sm);
  margin-bottom: 16px;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cq-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.ai-status-dot.warning {
  background: var(--cq-warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.workspace-body .chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 420px;
  max-height: 600px;
  overflow-y: auto;
  padding: 18px;
  background: var(--cq-surface-sunken);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  margin-bottom: 20px;
}

.workspace-body .message {
  max-width: 84%;
  padding: 16px 18px;
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  background: var(--cq-surface);
  line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.workspace-body .message.assistant {
  align-self: flex-start;
  color: var(--cq-text);
}

.workspace-body .message.user {
  align-self: flex-end;
  color: var(--cq-text);
  background: var(--cq-surface-raised);
  border-color: rgba(16, 185, 129, 0.28);
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.workspace-body .message .message-label {
  color: var(--cq-emerald);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace-body .message.user .message-label {
  color: #34d399;
}

.message-content {
  font-size: 0.9rem;
  word-break: break-word;
  white-space: normal;
}

.workspace-body .message.assistant .message-content {
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}

.workspace-body .message.assistant .badge-meta {
  color: var(--cq-emerald);
  background: var(--cq-emerald-glow);
  border-color: var(--cq-border-hover);
  font-family: var(--font);
  letter-spacing: .04em;
}

.message-evidence-alert {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Citations in AI chat */
.citations-container {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--cq-border-subtle);
}

.citations-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cq-text-dim);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}

.citations-title::-webkit-details-marker {
  display: none;
}

.citations-title::after {
  content: "+";
  margin-left: auto;
  font-size: 1rem;
  font-weight: 400;
}

.citations-container[open] .citations-title::after {
  content: "âˆ’";
}

.citation-card {
  background: var(--cq-surface-sunken);
  border: 1px solid var(--cq-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.citation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.citation-source {
  color: var(--cq-text);
  font-weight: 600;
}

.citation-snippet {
  color: var(--cq-text-muted);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.45;
}

/* Chat Empty State & Chips */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 16px;
  margin: auto;
  max-width: 520px;
}

.chat-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: grid;
  place-items: center;
  color: var(--cq-emerald);
  margin-bottom: 16px;
}

.chat-empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cq-text);
  margin-bottom: 6px;
}

.chat-empty-copy {
  color: var(--cq-text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.chat-prompt-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.prompt-chip {
  padding: 10px 14px;
  border-radius: var(--cq-radius-sm);
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  color: var(--cq-text-muted);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prompt-chip:hover {
  color: var(--cq-text);
  border-color: var(--cq-border-hover);
  background: var(--cq-surface-hover);
}

/* Chat Loading Dots */
.spinner-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-right: 8px;
}

.spinner-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cq-emerald);
  animation: dotPulse 1.4s infinite ease-in-out;
}

.spinner-dots span:nth-child(2) { animation-delay: 0.2s; }
.spinner-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Chat Form */
.workspace-body .chat-form {
  position: relative;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.workspace-body .chat-form:focus-within {
  border-color: var(--cq-emerald);
  box-shadow: 0 0 0 3px var(--cq-emerald-glow);
}

.workspace-body .form-control {
  width: 100%;
  padding: 6px 0;
  color: var(--cq-text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 0.92rem;
  resize: vertical;
  min-height: 52px;
}

.chat-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--cq-border-subtle);
}

.chat-input-hint {
  font-size: 0.74rem;
  color: var(--cq-text-dim);
}

/* Plan Cards on Account Page */
.plan-tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
}

.plan-tier-card.active-plan {
  border-color: var(--cq-emerald);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.12);
}

.current-plan-pill {
  position: absolute;
  top: -11px;
  right: 20px;
  padding: 3px 10px;
  color: #042010;
  background: var(--cq-emerald);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-tier-header {
  margin-bottom: 16px;
}

.plan-tier-price {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--cq-text);
  margin: 12px 0 6px;
}

.plan-feature-list {
  list-style: none;
  margin: 18px 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.85rem;
  color: var(--cq-text-muted);
}

.plan-feature-list li svg {
  color: var(--cq-emerald);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Account Overview Progress */
.account-storage-bar {
  margin-top: 8px;
}

/* Alerts */
.workspace-body .alert {
  padding: 12px 16px;
  border-radius: var(--cq-radius-sm);
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.workspace-body .alert-info {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
}

.workspace-body .alert-danger {
  color: #f87171;
  background: var(--cq-danger-bg);
  border-color: var(--cq-danger-border);
}

.workspace-body .alert-success {
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}

.workspace-body .alert-warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

/* Unauthenticated Lock Card */
.auth-lock-card {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  padding: 40px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.auth-lock-card .feature-number {
  margin: 0 auto 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: grid;
  place-items: center;
  color: var(--cq-emerald);
  font-weight: 800;
  font-size: 1.1rem;
}

.auth-lock-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cq-text);
  margin-bottom: 8px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, .12), transparent 28rem),
    rgba(5, 8, 6, 0.78);
  backdrop-filter: blur(14px);
}

.modal-card {
  --modal-surface: #121714;
  --modal-surface-raised: #18221b;
  --modal-surface-sunken: #0b100d;
  --modal-text: #f4f3ee;
  --modal-text-muted: #a5b0a7;
  --modal-border: rgba(255, 255, 255, .11);
  position: relative;
  width: min(440px, 100%);
  overflow: hidden;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(24, 34, 27, .98), rgba(12, 17, 14, .99));
  border: 1px solid rgba(52, 211, 153, .2);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, .62),
    0 0 0 1px rgba(255, 255, 255, .03) inset,
    0 0 70px rgba(16, 185, 129, .08);
  color: var(--modal-text);
}

.modal-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--modal-border);
}

.modal-header::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #34d399, #b58a43, transparent);
  content: "";
}

.modal-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-modal-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #f8fff9;
  background: linear-gradient(145deg, #15966e, #064e3b);
  border: 1px solid rgba(181, 138, 67, .55);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(6, 78, 59, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
  font-weight: 850;
  letter-spacing: -.04em;
}

.modal-kicker {
  margin-bottom: 3px;
  color: #62d9ad;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--modal-text);
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--modal-text-muted);
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.modal-close:hover {
  color: var(--modal-text);
  background: rgba(255, 255, 255, .07);
  border-color: var(--modal-border);
}

.modal-tabs {
  display: flex;
  gap: 20px;
  padding: 0 26px;
  background: rgba(8, 12, 10, .25);
  border-bottom: 1px solid var(--modal-border);
}

.modal-tab-btn {
  position: relative;
  padding: 14px 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--modal-text-muted);
  background: transparent;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: color .18s ease;
}

.modal-tab-btn.active {
  color: #6ee7b7;
  border-bottom-color: #34d399;
}

.modal-body {
  padding: 22px 26px 26px;
}

.modal-intro {
  margin-bottom: 20px;
  color: var(--modal-text-muted);
  font-size: .84rem;
  line-height: 1.55;
}

.modal-body .form-control {
  width: 100%;
  min-height: 46px;
  background: var(--modal-surface-sunken);
  border: 1px solid var(--modal-border);
  color: var(--modal-text);
  padding: 11px 13px;
  border-radius: 10px;
  margin-top: 5px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.modal-body .form-control::placeholder {
  color: #66746a;
}

.modal-body .form-control:focus {
  outline: none;
  border-color: #34d399;
  background: #0f1712;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .15), 0 8px 20px rgba(0, 0, 0, .12);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 4px;
  color: #d3ddd5;
  font-size: 0.76rem;
  font-weight: 700;
}

.form-hint {
  margin-top: 6px;
  color: #718077;
  font-size: .72rem;
}

.modal-body .btn-primary {
  min-height: 48px;
  border-radius: 10px;
  font-size: .88rem;
}

.modal-body .alert {
  border-radius: 10px;
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 960px) {
  .hero {
    min-height: auto;
  }

  .preview-window {
    justify-self: start;
  }

  .workspace-mobile-header {
    display: flex;
  }

  .workspace-sidebar {
    transform: translateX(-100%);
    visibility: hidden;
  }

  .workspace-main {
    width: 100%;
    margin-left: 0;
    max-width: none;
  }

  .workspace-main > section,
  .workspace-main > .ai-status-banner,
  .workspace-main > .alert,
  .workspace-main > .chat,
  .workspace-main > .chat-form,
  .workspace-top {
    max-width: none;
  }

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

@media (max-width: 700px) {
  .pricing-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .pricing-section > .grid {
    grid-template-columns: 1fr;
  }

  .price-card {
    min-height: auto;
  }

  .site-nav {
    min-height: 68px;
  }

  .nav-actions .btn {
    min-height: 34px;
  }

  .hero {
    padding-top: 58px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 15vw, 4rem);
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 180px;
  }

  .preview-window {
    transform: none;
  }

  .preview-body {
    grid-template-columns: 76px 1fr;
  }

  .preview-main {
    padding: 18px;
  }

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

  .preview-card-wide {
    grid-column: auto;
  }

  .workspace-main {
    padding: 24px 14px 40px;
  }

  .workspace-main > .grid,
  .workspace-body .grid-4,
  .workspace-body .grid-3,
  .workspace-body .grid-2 {
    grid-template-columns: 1fr;
  }

  .workspace-top {
    min-height: 0;
    margin-bottom: 26px;
    padding-bottom: 20px;
  }

  .workspace-top .nav-actions {
    gap: 8px;
  }

  .workspace-top .nav-actions .btn {
    flex: 1 1 160px;
  }

  .workspace-body .card {
    padding: 20px;
  }

  .workspace-body .metric {
    min-height: 132px;
  }

  .workspace-body .dropzone {
    min-height: 190px;
    padding: 30px 18px;
  }

  .workspace-body .table-wrap {
    margin-right: -2px;
    margin-left: -2px;
  }

  .workspace-body .table-actions {
    justify-content: flex-start;
  }

  .workspace-body .chat {
    min-height: 420px;
    max-height: none;
    padding: 14px;
  }

  .workspace-body .chat-form-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .workspace-body .chat-form-footer .btn {
    width: 100%;
  }

  .workspace-body .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-body .message {
    max-width: 100%;
  }

  .comparison-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-heading > .muted {
    max-width: none;
    text-align: left;
  }

  .comparison-wrap {
    padding: 18px;
  }

  .comparison-scroll {
    overflow: visible;
  }

  .comparison-table {
    min-width: 0;
    width: 100%;
    table-layout: auto;
  }

  .comparison-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .comparison-table tbody,
  .comparison-table tr,
  .comparison-table th,
  .comparison-table td {
    display: block;
    width: 100%;
  }

  .comparison-table tr {
    margin-bottom: 16px;
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius-sm);
    padding: 12px;
    background: var(--cq-surface);
    box-shadow: var(--shadow-sm);
  }

  .comparison-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid var(--cq-border-subtle);
  }

  .comparison-table td:last-child { border-bottom: 0; }

  .comparison-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    color: var(--cq-text-dim);
    margin-right: 12px;
  }
}

/* Theme-Specific Refinements */
.theme-icon { transition: transform 0.3s ease; }
[data-theme="dark"] .theme-icon { transform: rotate(360deg); }

#theme-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  aspect-ratio: 1 / 1 !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

#theme-toggle svg {
  display: block;
  margin: auto;
  flex-shrink: 0;
}

/* Dashboard Metric Gauges */
.metric-gauge-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
}

.metric-gauge-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.metric-gauge-track {
  fill: none;
  stroke: var(--cq-surface-raised);
  stroke-width: 8;
}

.metric-gauge-fill {
  fill: none;
  stroke: var(--cq-emerald);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.metric-gauge-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--cq-text);
}

/* Mobile Table-to-Card Transition */
@media (max-width: 700px) {
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap th,
  .table-wrap td,
  .table-wrap tr {
    display: block;
  }

  .table-wrap thead { display: none; }

  .table-wrap tr {
    margin-bottom: 16px;
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius-sm);
    padding: 12px;
    background: var(--cq-surface);
    box-shadow: var(--shadow-sm);
  }

  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--cq-border-subtle);
  }

  .table-wrap td:last-child { border-bottom: 0; }

  .table-wrap td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    color: var(--cq-text-dim);
    margin-right: 12px;
  }
}

/* Floating Action Button (FAB) */
.fab-upload {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cq-emerald);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(13, 118, 86, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 100;
  border: none;
  cursor: pointer;
}

.fab-upload:hover {
  transform: scale(1.1) rotate(90deg);
  background: var(--cq-emerald-hover);
}

.fab-upload svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

/* ==========================================================================
   Premium visual refinement
   ========================================================================== */

:root {
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  letter-spacing: -0.005em;
}

.site-header {
  box-shadow: 0 8px 24px rgba(16, 38, 25, 0.04);
}

.site-nav {
  min-height: 78px;
}

.site-links a {
  position: relative;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.site-links a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-primary);
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.site-links a:hover::after,
.site-links a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  min-height: min(720px, calc(100vh - 78px));
  padding-top: 86px;
}

.hero > div:first-child {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 590px;
  line-height: 1.7;
}

.preview-window {
  width: 100%;
  max-width: 560px;
  justify-self: end;
}

.card {
  border-radius: var(--radius);
}

.benefit-card {
  min-height: 240px;
  display: flex;
  flex-direction: column;
}

.benefit-card .text-sm {
  line-height: 1.65;
  color: var(--text-muted);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.5vw, 24px);
}

@media (min-width: 992px) {
  .bento-grid .benefit-card[data-area="large"] {
    grid-column: span 2;
  }
}

@media (min-width: 681px) and (max-width: 991px) {
  .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 680px) {
  .bento-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

.price-card > ul {
  flex: 1 1 auto;
}

.comparison-wrap {
  box-shadow: 0 12px 32px rgba(16, 38, 25, 0.04);
}

.cta {
  position: relative;
  overflow: hidden;
}

.cta::after {
  position: absolute;
  top: -100px;
  right: -70px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.025), 0 0 0 48px rgba(255, 255, 255, 0.018);
  content: "";
  pointer-events: none;
}

/* Workspace alignment and depth */
.workspace-main {
  max-width: 1600px;
}

.workspace-top {
  min-height: 104px;
  align-items: center;
}

.workspace-top > div:first-child {
  min-width: 0;
}

.workspace-top h1 {
  text-wrap: balance;
}

.workspace-body .grid-4 {
  align-items: stretch;
}

.workspace-body .metric {
  min-height: 158px;
  padding: 22px;
}

.workspace-body .metric-label svg {
  color: var(--cq-emerald);
  opacity: 0.8;
}

.workspace-body .card,
.workspace-body .table-wrap,
.workspace-body .dropzone,
.workspace-body .chat-form,
.workspace-body .chat {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.workspace-body .card:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, .25);
}

.workspace-section {
  margin-top: 42px;
}

.workspace-section-heading {
  min-height: 40px;
  margin-bottom: 18px;
}

.workspace-section-heading h2 {
  font-size: 1.24rem;
}

.workspace-section-heading .muted {
  display: block;
  margin-top: 4px;
  line-height: 1.5;
}

.workspace-body .table-wrap {
  border-radius: var(--cq-radius);
}

.workspace-body th {
  height: 48px;
}

.workspace-body td {
  min-height: 64px;
}

.workspace-body .dropzone {
  min-height: 214px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  padding: 38px 28px;
}

.workspace-body .dropzone .btn {
  margin-top: 2px;
}

.workspace-body .chat {
  min-height: 480px;
  padding: 22px;
}

.workspace-body .chat-form {
  padding: 14px 16px;
}

.workspace-body .chat-form-footer {
  min-height: 30px;
}

.workspace-body .plan-tier-card {
  min-height: 390px;
}

.workspace-body .table-wrap {
  overflow-x: auto;
}

@supports not (background: color-mix(in srgb, white, black)) {
  .workspace-body .card,
  .workspace-body .message.user {
    background: var(--cq-surface);
  }
}

@media (max-width: 960px) {
  .hero {
    min-height: auto;
  }

  .preview-window {
    justify-self: start;
  }

  .workspace-main {
    max-width: none;
  }

  .workspace-main > section,
  .workspace-main > .ai-status-banner,
  .workspace-main > .alert,
  .workspace-main > .chat,
  .workspace-main > .chat-form,
  .workspace-top {
    max-width: none;
  }

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

@media (max-width: 700px) {
  .pricing-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .pricing-section > .grid {
    grid-template-columns: 1fr;
  }

  .price-card {
    min-height: auto;
  }

  .site-nav {
    min-height: 68px;
  }

  .nav-actions .btn {
    min-height: 34px;
  }

  .hero {
    padding-top: 58px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 15vw, 4rem);
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 180px;
  }

  .preview-window {
    transform: none;
  }

  .preview-body {
    grid-template-columns: 76px 1fr;
  }

  .preview-main {
    padding: 18px;
  }

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

  .preview-card-wide {
    grid-column: auto;
  }

  .workspace-main {
    padding: 24px 14px 40px;
  }

  .workspace-main > .grid,
  .workspace-body .grid-4,
  .workspace-body .grid-3,
  .workspace-body .grid-2 {
    grid-template-columns: 1fr;
  }

  .workspace-top {
    min-height: 0;
    margin-bottom: 26px;
    padding-bottom: 20px;
  }

  .workspace-top .nav-actions {
    gap: 8px;
  }

  .workspace-top .nav-actions .btn {
    flex: 1 1 160px;
  }

  .workspace-body .card {
    padding: 20px;
  }

  .workspace-body .metric {
    min-height: 132px;
  }

  .workspace-body .dropzone {
    min-height: 190px;
    padding: 30px 18px;
  }

  .workspace-body .table-wrap {
    margin-right: -2px;
    margin-left: -2px;
  }

  .workspace-body .table-actions {
    justify-content: flex-start;
  }

  .workspace-body .chat {
    min-height: 420px;
    max-height: none;
    padding: 14px;
  }

  .workspace-body .chat-form-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .workspace-body .chat-form-footer .btn {
    width: 100%;
  }

  .workspace-body .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-body .message {
    max-width: 100%;
  }

  .comparison-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-heading > .muted {
    max-width: none;
    text-align: left;
  }

  .comparison-wrap {
    padding: 18px;
  }

  .comparison-scroll {
    overflow: visible;
  }

  .comparison-table {
    min-width: 0;
    width: 100%;
    table-layout: auto;
  }

  .comparison-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .comparison-table tbody,
  .comparison-table tr,
  .comparison-table th,
  .comparison-table td {
    display: block;
    width: 100%;
  }

  .comparison-table tr {
    margin-bottom: 16px;
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius-sm);
    padding: 12px;
    background: var(--cq-surface);
    box-shadow: var(--shadow-sm);
  }

  .comparison-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid var(--cq-border-subtle);
  }

  .comparison-table td:last-child { border-bottom: 0; }

  .comparison-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    color: var(--cq-text-dim);
    margin-right: 12px;
  }
}

/* ==========================================================================
   COMPLETE RESPONSIVE DESIGN SYSTEM
   Covers: Fold Phones â†’ Phones â†’ Tablets â†’ Laptops â†’ Desktops
   ========================================================================== */

/* â”€â”€ Tablet: 768px â€“ 1023px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (min-width: 768px) and (max-width: 1023px) {
  .site-nav,
  .container {
    width: min(960px, calc(100% - 32px));
  }

  /* Hero: stack columns on tablet */
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 72px 0 56px;
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 7vw, 4.4rem);
  }

  .preview-window {
    max-width: 100%;
    transform: none;
    justify-self: stretch;
  }

  /* Grids */
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* Pricing */
  .pricing-section > .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Workflow */
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Architecture strip */
  .architecture-strip {
    flex-direction: column;
    gap: 20px;
  }

  /* Workspace sidebar becomes a drawer on tablet */
  .workspace-mobile-header { display: flex; }
  .workspace-sidebar {
    transform: translateX(-100%);
    visibility: hidden;
  }
  .workspace-main {
    width: 100%;
    margin-left: 0;
    padding: 32px 24px 48px;
  }
  .workspace-body .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* â”€â”€ Small Phone / Large Fold: 480px â€“ 767px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (min-width: 480px) and (max-width: 767px) {
  .site-nav,
  .container {
    width: calc(100% - 28px);
  }

  .site-links { display: none; }
  .mobile-menu { display: block; }

  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 56px 0 44px;
    min-height: auto;
  }

  .hero h1 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .hero-copy { font-size: 1rem; }

  .preview-window {
    max-width: 100%;
    transform: none;
  }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .workflow-grid { grid-template-columns: 1fr; }
  .architecture-strip { flex-direction: column; gap: 16px; }
  .architecture-points { grid-template-columns: 1fr; }

  .pricing-section > .grid { grid-template-columns: 1fr; }

  .bento-grid { display: flex; flex-direction: column; gap: 14px; }

  .cta { padding: 36px 24px; }
  .cta h2 { font-size: clamp(1.7rem, 6vw, 2.4rem); }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .footer-links { flex-wrap: wrap; gap: 12px; }
}

/* â”€â”€ Standard Phone: 320px â€“ 479px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 479px) {
  :root {
    --radius: 12px;
    --radius-sm: 8px;
  }

  .site-nav,
  .container {
    width: calc(100% - 24px);
  }

  .site-links { display: none; }
  .mobile-menu { display: block; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { min-height: 34px; padding: 0 10px; font-size: .8rem; }

  /* Hide "Get started" on very small screens to avoid overflow */
  @media (max-width: 380px) {
    #btn-nav-register { display: none; }
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 48px 0 36px;
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 13vw, 3rem);
    letter-spacing: -.06em;
  }

  .hero-subheading { font-size: 1.05rem; }
  .hero-copy { font-size: .95rem; }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn { width: 100%; }

  .preview-window { transform: none; max-width: 100%; }
  .preview-body { grid-template-columns: 70px 1fr; }
  .preview-main { padding: 14px; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-card-wide { grid-column: auto; }

  .section { padding: 48px 0; }
  .section-heading h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .workflow-grid { grid-template-columns: 1fr; }
  .architecture-strip { flex-direction: column; gap: 14px; padding: 20px 18px; }
  .architecture-points { grid-template-columns: 1fr; gap: 8px; }

  .pricing-section > .grid { grid-template-columns: 1fr; }
  .pricing-section { padding-right: 12px; padding-left: 12px; }

  .bento-grid { display: flex; flex-direction: column; gap: 12px; }

  .cta { padding: 28px 18px; }
  .cta h2 { font-size: clamp(1.5rem, 7vw, 2rem); }
  .cta .hero-actions { flex-direction: column; }
  .cta .hero-actions .btn { width: 100%; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-links { flex-wrap: wrap; gap: 10px; }

  /* Workspace */
  .workspace-main { padding: 20px 12px 36px; }
  .workspace-top h1 { font-size: 1.5rem; }
  .workspace-top .nav-actions { flex-direction: column; width: 100%; }
  .workspace-top .nav-actions .btn { width: 100%; }

  .workspace-body .grid-4,
  .workspace-body .grid-3,
  .workspace-body .grid-2 {
    grid-template-columns: 1fr;
  }

  .workspace-body .chat { min-height: 340px; padding: 12px; }
  .workspace-body .metric { min-height: 120px; }

  .fab-upload { bottom: 20px; right: 16px; width: 50px; height: 50px; }

  .comparison-heading { flex-direction: column; align-items: flex-start; }
}

/* â”€â”€ Fold Phone / Tiny: < 320px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 319px) {
  :root {
    --radius: 10px;
    --radius-sm: 6px;
  }

  .site-nav,
  .container {
    width: calc(100% - 16px);
  }

  .brand-name { font-size: .95rem; }
  .brand-mark { width: 28px; height: 28px; }

  .nav-actions { gap: 4px; }
  #btn-nav-login,
  #btn-nav-register { display: none; }

  .hero { padding: 36px 0 28px; gap: 22px; }
  .hero h1 { font-size: clamp(1.9rem, 14vw, 2.6rem); letter-spacing: -.05em; }
  .hero-subheading { font-size: .95rem; }
  .hero-copy { font-size: .88rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; min-height: 40px; }

  .preview-window { border-radius: 12px; padding: 8px; }
  .preview-body { grid-template-columns: 54px 1fr; }
  .preview-side { padding: 12px 6px; font-size: .6rem; }
  .preview-main { padding: 10px; }
  .preview-grid { grid-template-columns: 1fr; gap: 8px; }
  .preview-card-wide { grid-column: auto; }

  .section { padding: 36px 0; }
  .section-heading h2 { font-size: 1.4rem; }

  .btn { min-height: 40px; padding: 0 12px; font-size: .82rem; }
  .btn-sm { min-height: 32px; padding: 0 9px; font-size: .75rem; }

  .cta { padding: 22px 14px; }
  .cta h2 { font-size: 1.4rem; }

  .workspace-main { padding: 14px 10px 28px; }
  .workspace-top h1 { font-size: 1.3rem; }

  .modal-card { border-radius: 14px; }
  .modal-header { padding: 18px 16px 14px; }
  .modal-body { padding: 16px; }

  .fab-upload { bottom: 14px; right: 12px; width: 46px; height: 46px; }
}

/* â”€â”€ Small Laptop: 1024px â€“ 1279px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (min-width: 1024px) and (max-width: 1279px) {
  .site-nav,
  .container {
    width: min(1020px, calc(100% - 40px));
  }

  .hero {
    gap: 40px;
    padding: 76px 0 60px;
  }

  .hero h1 { font-size: clamp(3rem, 6vw, 4.8rem); }

  .preview-window { max-width: 460px; }

  .pricing-section > .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace-sidebar { width: 220px; }
  .workspace-main {
    width: calc(100% - 220px);
    margin-left: 220px;
    padding: 32px 32px 52px;
  }

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

/* â”€â”€ Large Desktop: â‰¥ 1536px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (min-width: 1536px) {
  .site-nav,
  .container {
    width: min(1320px, calc(100% - 64px));
  }

  .hero {
    padding: 120px 0 90px;
    gap: 90px;
  }

  .hero h1 { font-size: 6.4rem; }

  .pricing-section > .grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .workspace-sidebar { width: 272px; }
  .workspace-main {
    width: calc(100% - 272px);
    margin-left: 272px;
    padding: 52px 72px 72px;
  }
}

/* â”€â”€ Mobile nav menu (slide-down) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 767px) {
  .site-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    flex-direction: column;
    gap: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
  }

  .site-links.open { display: flex; }

  .site-links li { width: 100%; }
  .site-links a {
    display: block;
    padding: 13px 20px;
    font-size: .95rem;
    border-bottom: 1px solid var(--border-color);
  }
  .site-links li:last-child a { border-bottom: 0; }

  /* Dark-theme mobile nav */
  [data-theme="dark"] .site-links {
    background: var(--bg-card);
    border-color: var(--border-color);
  }
}

/* â”€â”€ Touch-friendly tap targets â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .btn-sm { min-height: 40px; }
  .workspace-nav a,
  .workspace-nav .nav-item { padding: 13px 12px; }
  .filter-pill { padding: 8px 14px; }
  .prompt-chip { padding: 14px 16px; }
  .modal-close { width: 40px; height: 40px; }
  .fab-upload { width: 60px; height: 60px; }
}

/* â”€â”€ Landscape phone / fold â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    padding-top: 36px;
    min-height: auto;
  }

  .workspace-body .chat {
    min-height: 260px;
  }
}

/* end of styles */


/* ==========================================================================
   CipherQ New Sections & Enhanced Responsive Styles
   ========================================================================== */

.feature-benefit {
  font-weight: 600;
  color: var(--accent-primary);
  margin: 6px 0 10px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.5vw, 24px);
}

.audience-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(22px, 2.5vw, 28px);
}

.audience-card .eyebrow {
  margin-bottom: 4px;
}

.audience-card h3 {
  margin-bottom: 4px;
  line-height: 1.35;
}

.audience-card p.text-sm {
  line-height: 1.65;
  color: var(--text-muted);
}

.local-ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 28px);
}

.local-ai-grid .card {
  padding: clamp(26px, 3vw, 36px);
}

.benefit-list, .tradeoff-list {
  list-style: none;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.benefit-list li, .tradeoff-list li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.benefit-list li strong {
  color: var(--accent-primary);
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.tradeoff-list li strong {
  color: var(--accent-secondary);
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.pricing-notice {
  padding: 14px 20px;
  background: var(--bg-surface-sunken);
  border-radius: var(--radius-sm);
  max-width: 760px;
  margin: 24px auto 0;
  border: 1px solid var(--border-color);
  line-height: 1.6;
}

/* Security Disclosure Grid */
.security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 2.5vw, 24px);
  margin-top: 28px;
}

.security-card {
  padding: clamp(24px, 2.8vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.security-badge-wrap {
  margin-bottom: 4px;
}

.security-card h3 {
  line-height: 1.35;
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
}

.security-card p {
  line-height: 1.68;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.security-card strong {
  color: var(--accent-primary);
  font-weight: 700;
}

[data-theme="light"] .security-card h3 {
  color: #10231B;
}

[data-theme="light"] .security-card p {
  color: #374740;
}

[data-theme="light"] .security-card strong {
  color: #0A6648;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}

.security-badge-warning {
  background: rgba(122, 85, 32, 0.12);
  color: #7A5520;
  border: 1px solid rgba(122, 85, 32, 0.28);
}

.security-badge-info {
  background: rgba(10, 102, 72, 0.12);
  color: #0A6648;
  border: 1px solid rgba(10, 102, 72, 0.28);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: clamp(18px, 2vw, 24px) clamp(20px, 2.5vw, 26px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item[open] {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
  color: var(--accent-primary);
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.68;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.setup-card {
  background: #0f1713;
  color: #e5f2eb;
  border: 1px solid #1c2b23;
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 20px 0;
  max-width: 100%;
}

.setup-card code {
  display: block;
  white-space: pre;
  color: #a8dbc3;
  font-family: inherit;
}

.setup-card .comment {
  color: #648777;
}

/* Media query adjustments for newly added components */
@media (max-width: 1023px) {
  .audience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .audience-grid {
    grid-template-columns: 1fr;
  }
  .local-ai-grid {
    grid-template-columns: 1fr;
  }
  .security-grid {
    grid-template-columns: 1fr;
  }
  .faq-question {
    font-size: 0.98rem;
  }
  .setup-card {
    padding: 16px;
    font-size: 0.8rem;
  }
}

/* Fix word-break on code symbols globally */
code, kbd, samp, pre {
  overflow-wrap: anywhere;
  word-break: break-word;
}
pre code {
  overflow-wrap: normal;
  word-break: normal;
}

/* Ensure mobile menu activates smoothly at <= 900px to avoid 768px tablet nav overflow */
@media (max-width: 900px) {
  .site-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    flex-direction: column;
    gap: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 16px 32px var(--shadow-color);
    padding: 8px 0;
  }
  .site-links.open { display: flex; }
  .mobile-menu { display: block; }
  .site-links li { width: 100%; }
  .site-links a {
    display: block;
    padding: 13px 20px;
    font-size: .95rem;
    border-bottom: 1px solid var(--border-color);
  }
  .site-links li:last-child a { border-bottom: 0; }
  [data-theme="dark"] .site-links {
    background: var(--bg-card);
    border-color: var(--border-color);
  }
}
