:root {
  color-scheme: dark;
  --background: #080808;
  --panel: #171717;
  --panel-raised: #222222;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f7f3ec;
  --muted: #a49f9a;
  --orange: #ff7a1a;
  --orange-soft: rgba(255, 122, 26, 0.15);
  --purple: #9a72ff;
  --purple-soft: rgba(154, 114, 255, 0.15);
  --mint: #68d6b5;
  --danger: #ff6b6b;
  --radius: 22px;
  --mono: "Courier New", Courier, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--background); color: var(--text); font-family: var(--sans); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 70%, white); outline-offset: 2px; }

.app-shell { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; min-height: 68px; padding: env(safe-area-inset-top) 20px 0; border-bottom: 1px solid var(--line); background: rgba(8, 8, 8, 0.88); backdrop-filter: blur(22px); }
.brand-lockup { display: flex; gap: 14px; align-items: baseline; justify-content: center; }
.eyebrow { color: var(--orange); font: 700 0.78rem/1 var(--mono); letter-spacing: 0.14em; }
.icon-button, .quiet-button, .primary-button { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; }
.icon-button { width: 44px; padding: 0; background: transparent; font-size: 1.25rem; }
.quiet-button { padding: 0 16px; background: var(--panel); }
.primary-button { padding: 0 18px; border-color: rgba(255, 122, 26, 0.5); background: var(--orange); color: #140900; font-weight: 750; }

.workspace-frame { display: grid; grid-template-columns: 284px minmax(0, 1fr); min-height: calc(100dvh - 145px); }
.navigation { position: sticky; top: 68px; align-self: start; height: calc(100dvh - 144px); padding: 28px 18px; border-right: 1px solid var(--line); background: #0d0d0d; overflow: auto; }
.navigation-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 18px; }
.navigation nav { display: grid; gap: 6px; }
.nav-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; }
.nav-button:hover { background: rgba(255, 255, 255, 0.06); }
.nav-button[aria-current="page"] { background: var(--orange-soft); color: var(--orange); }
.nav-count { margin-left: auto; min-width: 24px; padding: 3px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); text-align: center; font-size: 0.78rem; }
.connection-card { display: flex; gap: 12px; margin-top: 28px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.connection-card p { margin: 4px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.status-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--muted); }
.status-dot.connected { background: var(--mint); box-shadow: 0 0 0 4px rgba(104, 214, 181, 0.12); }

.main { width: min(1500px, 100%); margin: 0 auto; padding: 52px clamp(24px, 4vw, 70px) 110px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.hero h1 { margin: 9px 0 8px; font: 700 clamp(2rem, 4vw, 4rem)/0.98 var(--mono); }
.hero p { margin: 0; max-width: 660px; color: var(--muted); font-size: 1.02rem; }
.hero-actions { display: flex; gap: 10px; }
.status-banner { display: flex; gap: 12px; align-items: center; margin: 30px 0 20px; padding: 14px 18px; border: 1px solid rgba(255, 122, 26, 0.3); border-radius: 14px; background: var(--orange-soft); }
.status-banner span { color: #d8cec5; }
.status-banner.error { border-color: rgba(255, 107, 107, 0.45); background: rgba(255, 107, 107, 0.12); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 30px; }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.metric strong { display: block; font: 700 1.8rem/1 var(--mono); }
.metric span { display: block; margin-top: 7px; color: var(--muted); font-size: 0.86rem; }
.canvas { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 18px; }
.card { min-height: 210px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #24201e, #161515); cursor: pointer; }
.card.meeting { border-color: rgba(255, 122, 26, 0.55); background: linear-gradient(145deg, #38251d, #211b1d); }
.card.checklist { border-style: dashed; border-color: rgba(154, 114, 255, 0.7); background: linear-gradient(145deg, #1f192b, #14111c); }
.card h2 { margin: 10px 0 8px; font: 700 1.55rem/1.12 var(--mono); }
.card p { margin: 0; color: var(--muted); line-height: 1.45; }
.card-footer { display: flex; gap: 12px; align-items: center; margin-top: 28px; color: var(--muted); font-size: 0.86rem; }
.card-footer span:last-child { margin-left: auto; }
.empty { grid-column: 1 / -1; padding: 60px 30px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }

.catch-bar { position: fixed; z-index: 35; left: 284px; right: 0; bottom: 0; display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; min-height: calc(76px + env(safe-area-inset-bottom)); padding: 10px clamp(20px, 4vw, 64px) calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(25, 25, 25, 0.94); backdrop-filter: blur(22px); }
.catch-plus { width: 50px; height: 50px; border: 0; border-radius: 50%; background: var(--orange-soft); color: var(--orange); font-size: 1.6rem; cursor: pointer; }
.catch-bar input { min-width: 0; height: 48px; padding: 0 4px; border: 0; background: transparent; color: var(--text); font-size: 1rem; }
.catch-submit { min-width: 90px; height: 44px; border: 0; border-radius: 999px; background: #050505; font-weight: 700; cursor: pointer; }

dialog { width: min(620px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: #181818; color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(8px); }
.dialog-card { display: grid; gap: 18px; padding: 26px; }
.dialog-card h2 { margin: 0; font: 700 1.5rem var(--mono); }
.dialog-card textarea { min-height: 150px; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #0c0c0c; color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.mobile-only { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .canvas { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: 48px 1fr 48px; padding-inline: 12px; }
  .brand-lockup .eyebrow { display: none; }
  .brand-lockup strong { font-size: 0.95rem; }
  #account-button { width: 44px; overflow: hidden; padding: 0; color: transparent; }
  #account-button::after { content: "☁"; color: var(--text); font-size: 1.1rem; }
  .workspace-frame { display: block; }
  .navigation { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(320px, 86vw); height: 100dvh; top: 0; padding-top: calc(22px + env(safe-area-inset-top)); transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 22px 0 60px rgba(0, 0, 0, 0.6); }
  .navigation.open { transform: translateX(0); }
  .mobile-only { display: inline-grid; place-items: center; }
  .main { padding: 34px 18px 110px; }
  .hero { display: grid; align-items: start; }
  .hero h1 { font-size: clamp(2rem, 11vw, 3.4rem); }
  .hero-actions { width: 100%; }
  .hero-actions button { flex: 1; }
  .status-banner { align-items: flex-start; flex-direction: column; }
  .canvas { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catch-bar { left: 0; grid-template-columns: 48px 1fr 62px; padding-inline: 12px; }
  .catch-submit { min-width: 62px; }
}

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