/* Shared product components. Existing app.css tokens remain the brand source. */
:root { --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px; --border-strong: #748B7B; color-scheme: light; }
:root[data-theme="dark"] { --forest: #99DEC0; --deep: #09291F; --ink: #E4EEE7; --muted: #ADC0B4; --canvas: #0D1914; --surface: #14241C; --subtle: #1B3025; --border: #344D3D; --border-strong: #6B8876; --accent: #D8ED86; --ok: #9BE1BD; --caution: #F1C66C; --caution-bg: #382D16; --error: #F4A3AA; --error-bg: #3A1D23; --focus: #85C8EE; --shadow: 0 12px 40px #0005; color-scheme: dark; }
body { -webkit-font-smoothing: antialiased; }
:root[data-theme="dark"] .tag.fn { background: #243844; color: #D9EAF5; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .55; cursor: not-allowed; }
.top { background: #073C30; }
.top-in { gap: 22px; min-height: 76px; }
.nav a { font-size: 14px; padding: 24px 9px; }
.header-tools, #accountNav { display: flex; gap: 12px; align-items: center; }
.header-tools { margin-left: auto; }
.header-tools .theme-btn { color: #F0F5EB; background: transparent; border-color: #53796B; }
.header-login { color: #fff; text-decoration: none; font-size: 14px; white-space: nowrap; padding: 10px 0; }
.header-join { color: #073C30; background: #D8ED86; border-color: #D8ED86; white-space: nowrap; }
.account-pill { color: #fff; display: flex; align-items: center; gap: 9px; text-decoration: none; font-size: 14px; }
.avatar { width: 34px; height: 34px; border: 1px solid #6F9383; border-radius: 50%; display: grid; place-items: center; color: #D8ED86; font-weight: 650; }
.workspace-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.workspace-nav .wrap { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: thin; }
.workspace-nav a { white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; padding: 12px 0; border-bottom: 2px solid transparent; }
.workspace-nav a[aria-current="page"] { border-color: var(--forest); color: var(--forest); }
.workspace { padding-top: 38px; padding-bottom: 64px; min-height: 65vh; }
.workspace-heading { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin: 0 0 30px; }
.workspace-heading h1 { font-size: 38px; line-height: 1.18; letter-spacing: -.035em; }
.workspace-heading .lede { margin: 10px 0 0; max-width: 64ch; font-size: 15px; line-height: 24px; }
.eyebrow { font-size: 11px; letter-spacing: .12em; }
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.panel-card h2 { font-size: 20px; line-height: 28px; margin-bottom: 8px; }
.panel-card h3 { font-size: 16px; }
.stack { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.metric .value, .metric strong { display: block; font-size: 32px; line-height: 40px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.metric .label, .metric > span { font-size: 13px; color: var(--muted); }
.metric small { display: block; color: var(--muted); margin-top: 8px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.btn.primary { color: #fff; background: #064E3B; border-color: #064E3B; }
:root[data-theme="dark"] .btn.primary { color: #0A291C; background: #99DEC0; border-color: #99DEC0; }
.btn.danger { color: var(--error); border-color: var(--error); background: var(--error-bg); }
.badge, .pill { display: inline-flex; align-items: center; border-radius: 6px; font-size: 12px; line-height: 20px; padding: 2px 8px; background: var(--subtle); color: var(--forest); font-weight: 600; }
.note { padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--subtle); font-size: 14px; }
.note.caution { background: var(--caution-bg); color: var(--caution); border-color: currentColor; }
.v3-form { display: grid; gap: 20px; }
.v3-form label, .field { display: grid; gap: 7px; font-size: 14px; font-weight: 600; }
.v3-form input:not([type="checkbox"]):not([type="radio"]), .v3-form select, .v3-form textarea, .field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; font-size: 15px; line-height: 22px; }
.v3-form textarea, .field textarea { min-height: 100px; resize: vertical; }
.v3-form input[type="checkbox"], .v3-form input[type="radio"] { accent-color: var(--forest); width: 18px; height: 18px; }
.v3-form label.check, label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.v3-form small, .field small, .hint { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 20px; }
.v3-form fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 0; min-width: 0; }
.v3-form legend { padding: 0 6px; font-weight: 650; }
.form-error { background: var(--error-bg); color: var(--error); padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.form-error:empty { display: none; }
.empty-state { text-align: center; padding: 54px 24px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 16px; }
.empty-state h2 { font-size: 23px; margin: 12px 0 8px; }
.empty-state p { color: var(--muted); max-width: 48ch; margin: 0 auto 22px; }
.empty-symbol { display: inline-grid; place-items: center; width: 52px; height: 52px; background: var(--subtle); border-radius: 50%; color: var(--forest); font-size: 27px; }
.v3-dialog { width: min(620px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); max-height: calc(100dvh - 32px); }
.v3-dialog::backdrop { background: #061C13A3; backdrop-filter: blur(3px); }
.dialog-inner { padding: 32px; }
.dialog-inner h2 { font-size: 28px; line-height: 36px; letter-spacing: -.025em; }
.dialog-inner .lede { font-size: 16px; }
.tour-dots { display: flex; gap: 6px; margin: 28px 0; }
.tour-dots i { width: 26px; height: 4px; border-radius: 3px; background: var(--border); }
.tour-dots i.active { background: var(--forest); }
.section-heading { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { margin: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap { overflow: auto; }
.foot { margin-top: 24px; }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; margin: 12px 0; }
.foot-links a { font-size: 13px; }
.hero { padding-top: 60px; }
.hero h1 { letter-spacing: -.045em; }
.hero-mark { opacity: .92; }
:root[data-theme="dark"] .hero-mark { filter: brightness(1.8) saturate(.6); }
.hero-actions { margin-top: 18px; }
.product-intro { background: var(--subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 30px 0; margin: 16px 0 28px; }
.product-intro .grid-3 > div { border-left: 2px solid var(--border-strong); padding-left: 20px; }
.product-intro h2 { font-size: 17px; margin-bottom: 6px; }
.product-intro p { color: var(--muted); font-size: 14px; margin: 0; }
.toast { z-index: 1000; }
@media (max-width: 1100px) { .top-in { gap: 14px; } .brand b { font-size: 14px; } .nav a { padding-inline: 7px; } .header-tools { gap: 8px; } .account-name { display: none; } }
@media (max-width: 767px) {
  .top-in { padding-top: 12px; column-gap: 8px; }
  .brand { flex: 1; gap: 6px; } .brand img { width: 34px; height: 34px; }
  .brand b { font-size: 15px; } .header-tools { margin-left: auto; } .header-join { display: none; }
  .nav { order: 3; margin: 0; width: 100%; justify-content: space-between; flex: 1 0 100%; }
  .nav a { font-size: 13px; padding: 10px 5px; }
  .workspace-nav .wrap { gap: 23px; }
  .workspace { padding-top: 26px; padding-bottom: 40px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 24px; }
  .workspace-heading h1 { font-size: 30px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 16px; } .metric strong, .metric .value { font-size: 27px; }
  .panel-card { padding: 20px 16px; }
  .dialog-inner { padding: 24px 20px; }
  .hero { padding: 34px 0 24px; }
  .hero h1 { font-size: 38px; line-height: 43px; }
  .product-intro .grid-3 { gap: 22px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* Restore the local header before paint; verification changes it only on sign-out. */
.local-account {display:none;}
html[data-session="signed-in"] #accountNav .header-login,
html[data-session="signed-in"] #accountNav .header-join {display:none;}
html[data-session="signed-in"] #accountNav .local-account {display:inline-flex;}
