/* ============================================================
   Crafted by Design — Business Suite v5
   styles.css — Navy/Gold brand theme, sidebar layout
   ============================================================ */

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BRAND TOKENS ──────────────────────────────────────────── */
@font-face {
  font-family: "Cinzel";
  src: url("/brand/fonts/Cinzel-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("/brand/fonts/Cinzel-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("/brand/fonts/Cinzel-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("/brand/fonts/Cinzel-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("/brand/fonts/Cinzel-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy:        #05101D;
  --navy-mid:    #0D1F36;
  --navy-light:  #162840;
  --gold:        #C99A39;
  --gold-light:  #E8C870;
  --gold-dim:    rgba(201,154,57,.15);

  /* Light theme */
  --bg:          #faf8f4;
  --bg2:         #f0ece3;
  --bg3:         #e5ddd0;
  --text:        #1a1208;
  --text2:       #6b5e4a;
  --text3:       #9c8f7c;
  --border:      rgba(0,0,0,.10);
  --border2:     rgba(0,0,0,.20);
  --accent:      var(--gold);
  --accent-fg:   var(--navy);

  --green:       #3B6D11;
  --green-bg:    #EAF3DE;
  --amber:       #854F0B;
  --amber-bg:    #FAEEDA;
  --red:         #A32D2D;
  --red-bg:      #FCEBEB;
  --blue:        #6A88A4;
  --blue-bg:     #EAF0F5;
  --info:        #6A88A4;
  --info-bg:     #EAF0F5;
  --warn:        #854F0B;
  --warn-bg:     #FAEEDA;
  --success:     #3B6D11;
  --success-bg:  #EAF3DE;
  --danger:      #A32D2D;
  --danger-bg:   #FCEBEB;

  --radius:      8px;
  --radius-lg:   12px;
  --font:        system-ui, -apple-system, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --font-ui:      system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:        ui-monospace, monospace;

  --sb-width:    220px;
  --hdr-h:       48px;

  /* Sidebar always navy */
  --sb-bg:       var(--navy);
  --sb-text:     #b8c4d4;
  --sb-text-dim: #6a7d94;
  --sb-active-bg: var(--gold-dim);
  --sb-active:   var(--gold);

  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 3px 10px rgba(0,0,0,.10);

  /* ── CBD design-system tokens ─────────────────────────────── */
  --cbd-navy:        #05101D;
  --cbd-navy-deep:   #030C13;
  --cbd-navy-soft:   #0D1F36;
  --cbd-navy-line:   #162840;
  --cbd-gold:        #C99A39;
  --cbd-gold-bright: #E8C870;
  --cbd-gold-deep:   #9A7A2D;
  --cbd-gold-wash:   rgba(201,154,57,0.12);
  --cbd-cream:       #faf8f4;
  --cbd-cream-soft:  #f3eee3;
  --cbd-cream-line:  #e6dec9;
  --cbd-ink:         #1a1410;
  --cbd-ink-soft:    #4a4036;
  --cbd-ink-mute:    #8a7d6f;
  --cbd-bone:        #f0ead8;
  --cbd-bone-soft:   #c9c0a8;
  --cbd-bone-mute:   #8a8270;
  --cbd-flag-red:    #b22234;
  --cbd-flag-blue:   #3c3b6e;

  /* Motion */
  --dur-fast:    120ms;
  --dur-base:    200ms;
  --dur-slow:    400ms;
  --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in:     cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Design-system shadows */
  --shadow-card:    0 1px 0 rgba(255,255,255,0.6) inset, 0 1px 2px rgba(26,20,16,0.04), 0 8px 20px rgba(26,20,16,0.06);
  --shadow-raised:  0 12px 28px rgba(26,20,16,0.10);
  --shadow-engrave: inset 0 1px 0 rgba(26,20,16,0.08), inset 0 -1px 0 rgba(255,255,255,0.5);

  /* Spacing scale */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;

  /* Additional radii */
  --radius-sm:   4px;
  --radius-xl:   18px;
  --radius-pill: 999px;
}

/* ── DARK THEME ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #111a26;
  --bg2:         #182232;
  --bg3:         #1f2e42;
  --text:        #e0d8c8;
  --text2:       #8a9eb8;
  --text3:       #4a6080;
  --border:      rgba(255,255,255,.08);
  --border2:     rgba(255,255,255,.16);
  --accent:      var(--gold);
  --accent-fg:   var(--navy);

  --green:       #8fc44a;
  --green-bg:    #162d08;
  --amber:       #e8961e;
  --amber-bg:    #3a1f02;
  --red:         #e88080;
  --red-bg:      #3d0f0f;
  --blue:        #6ba4e0;
  --blue-bg:     #06264a;
  --info:        #6ba4e0;
  --info-bg:     #06264a;
  --warn:        #e8961e;
  --warn-bg:     #3a1f02;
  --success:     #8fc44a;
  --success-bg:  #162d08;
  --danger:      #e88080;
  --danger-bg:   #3d0f0f;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.25);
  --shadow-md:   0 3px 12px rgba(0,0,0,.35);
}

/* Fallback for users with dark OS preference and no explicit toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #111a26;
    --bg2:         #182232;
    --bg3:         #1f2e42;
    --text:        #e0d8c8;
    --text2:       #8a9eb8;
    --text3:       #4a6080;
    --border:      rgba(255,255,255,.08);
    --border2:     rgba(255,255,255,.16);
    --green:       #8fc44a;
    --green-bg:    #162d08;
    --amber:       #e8961e;
    --amber-bg:    #3a1f02;
    --red:         #e88080;
    --red-bg:      #3d0f0f;
    --blue:        #6ba4e0;
    --blue-bg:     #06264a;
    --info:        #6ba4e0;
    --info-bg:     #06264a;
    --warn:        #e8961e;
    --warn-bg:     #3a1f02;
    --success:     #8fc44a;
    --success-bg:  #162d08;
    --danger:      #e88080;
    --danger-bg:   #3d0f0f;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.25);
    --shadow-md:   0 3px 12px rgba(0,0,0,.35);
  }
}

/* ── BASE ─────────────────────────────────────────────────── */
html, body { height: 100%; }

body {
  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  font-size:   13px;
  line-height: 1.5;
  overflow:    hidden;
}

a { color: inherit; }

/* ── APP SHELL — sidebar + main ─────────────────────────────── */
#app-shell {
  display:              grid;
  grid-template-columns: var(--sb-width) 1fr;
  height:               100vh;
  overflow:             hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
#sidebar {
  background:     var(--sb-bg);
  display:        flex;
  flex-direction: column;
  height:         100vh;
  overflow:       hidden;
  border-right:   1px solid var(--cbd-gold-deep);
  position:       relative;
  z-index:        10;
}

#sb-brand {
  padding:         14px 14px 10px;
  border-bottom:   1px solid rgba(255,255,255,.06);
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  flex-shrink:     0;
}

#sb-brand-name {
  font-family:    var(--font-display, "Cinzel", Georgia, serif);
  font-size:      13px;
  font-weight:    700;
  color:          var(--cbd-gold);
  letter-spacing: .12em;
  line-height:    1.2;
  text-transform: uppercase;
}

#sb-logo {
  width:          130px;
  height:         auto;
  display:        block;
  margin-bottom:  3px;
}

.cw-lockup {
  display:     inline-flex;
  align-items: center;
  gap:         9px;
  text-decoration: none;
}

.cw-lockup-mark {
  width:       32px;
  height:      32px;
  flex-shrink: 0;
}

.cw-lockup-text {
  display:        flex;
  flex-direction: column;
  gap:            1px;
  line-height:    1.05;
}

.cw-lockup-name {
  font-family:    var(--font-display, "Cinzel", Georgia, serif);
  font-size:      15px;
  font-weight:    800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cw-lockup-title {
  font-family:    var(--font-display, "Cinzel", Georgia, serif);
  font-size:      8.5px;
  font-weight:    600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.cw-lockup.dark .cw-lockup-name { color: var(--cbd-bone); }
.cw-lockup.dark .cw-lockup-title { color: var(--cbd-gold-bright); }
.cw-lockup.light .cw-lockup-name { color: var(--cbd-navy); }
.cw-lockup.light .cw-lockup-title { color: var(--cbd-gold-deep); }

#sb-brand .cw-lockup-mark {
  width: 28px;
  height: 28px;
}

#sb-brand .cw-lockup-name {
  font-size: 13px;
}

#sb-brand .cw-lockup-title {
  font-size: 7.5px;
}

#sb-brand-sub {
  font-family:    var(--font-display, "Cinzel", Georgia, serif);
  font-size:      9px;
  color:          var(--cbd-bone-mute);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-top:     2px;
}

#theme-toggle {
  width:           28px;
  height:          28px;
  border-radius:   var(--radius);
  background:      rgba(255,255,255,.06);
  border:          1px solid rgba(255,255,255,.08);
  cursor:          pointer;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       13px;
  flex-shrink:     0;
  transition:      background .15s;
  color:           var(--sb-text);
}
#theme-toggle:hover { background: rgba(255,255,255,.12); }

/* ── MACHINE PILLS (sidebar) ────────────────────────────────── */
#mrow {
  display:        flex;
  gap:            4px;
  padding:        8px 10px;
  border-bottom:  1px solid rgba(255,255,255,.06);
  flex-wrap:      wrap;
  flex-shrink:    0;
}

.mpill {
  font-size:     9px;
  padding:       3px 8px;
  border-radius: 20px;
  border:        1px solid rgba(255,255,255,.12);
  background:    transparent;
  color:         var(--sb-text-dim);
  cursor:        pointer;
  transition:    all .15s;
  white-space:   nowrap;
}

.mpill.on {
  background:   var(--gold-dim);
  color:        var(--gold);
  border-color: rgba(201,154,57,.4);
}

/* ── NAV (sidebar) ──────────────────────────────────────────── */
#nav {
  flex:       1;
  overflow-y: auto;
  padding:    6px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
#nav::-webkit-scrollbar { width: 4px; }
#nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-group {
  margin-bottom: 2px;
}

/* Base label style — used in nav AND inside panels (betafeedback section headers) */
.nav-label {
  font-size:      8.5px;
  font-weight:    700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color:          var(--sb-text-dim);
  padding:        10px 14px 4px;
  display:        block;
}

/* Nav-only: collapsible toggle behaviour, scoped to avoid bleeding into panels */
#nav .nav-label {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding-right:   10px;
  cursor:          pointer;
  user-select:     none;
  width:           100%;
  border:          none;
  background:      transparent;
  font-family:     var(--font);
}
#nav .nav-label:hover { color: var(--sb-text); }
#nav .nav-label::after {
  content:        '›';
  font-size:      13px;
  font-weight:    400;
  letter-spacing: 0;
  text-transform: none;
  opacity:        0.4;
  transform:      rotate(90deg);
  transition:     transform .15s ease;
  display:        inline-block;
  flex-shrink:    0;
  line-height:    1;
}
.nav-group.collapsed .nav-label::after {
  transform: rotate(0deg);
}
.nav-group.collapsed .ntab {
  display: none;
}

.ntab {
  display:        flex;
  align-items:    center;
  width:          100%;
  padding:        6px 14px 6px 18px;
  border:         none;
  background:     transparent;
  color:          var(--sb-text);
  font-size:      12px;
  font-family:    var(--font);
  cursor:         pointer;
  text-align:     left;
  border-radius:  0;
  transition:     all .12s;
  position:       relative;
  white-space:    nowrap;
  overflow:       hidden;
  text-overflow:  ellipsis;
}
.ntab:hover { background: rgba(255,255,255,.05); color: #f0e8d6; }

.ntab.on {
  background: var(--gold-dim);
  color:      var(--gold);
  font-weight: 500;
}
.ntab.on::before {
  content:  '';
  position: absolute;
  left:     0; top: 0; bottom: 0;
  width:    3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.ntab.locked {
  opacity: 0.45;
}
.ntab.locked::after {
  content: ' ★';
  font-size: 8px;
  opacity: 0.5;
  color: var(--cbd-gold);
}
.ntab.locked:hover {
  opacity: 0.65;
}

/* ── SIDEBAR FOOTER ─────────────────────────────────────────── */
#sb-footer {
  padding:       8px 10px;
  border-top:    1px solid rgba(255,255,255,.06);
  flex-shrink:   0;
}

#sync-pill {
  display:       flex;
  align-items:   center;
  gap:           6px;
  padding:       5px 8px;
  border-radius: var(--radius);
  background:    rgba(255,255,255,.04);
  border:        1px solid rgba(255,255,255,.07);
  cursor:        pointer;
  font-family:   var(--font);
  font-size:     10px;
  color:         var(--sb-text-dim);
  width:         100%;
  transition:    background .15s;
}
#sync-pill:hover { background: rgba(255,255,255,.08); }

.sdot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--text3);
  flex-shrink:   0;
}
#sync-pill.syncing .sdot { background: var(--amber); animation: pulse 1s infinite; }
#sync-pill.synced  .sdot { background: var(--green); }
#sync-pill.error   .sdot { background: var(--red); }
#sync-pill.offline .sdot { background: #4a6080; }

@keyframes pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

#sb-platform-credit {
  display:        flex;
  align-items:    center;
  gap:            7px;
  padding:        10px 16px 14px;
  opacity:        0.28;
  pointer-events: none;
  user-select:    none;
}

#sb-platform-icon {
  width:       16px;
  height:      16px;
  flex-shrink: 0;
  filter:      var(--sb-icon-filter, none);
}

#sb-platform-name {
  font-size:      10px;
  font-weight:    700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--gold);
  line-height:    1;
}

/* ── MAIN CONTENT AREA ──────────────────────────────────────── */
#main {
  display:        flex;
  flex-direction: column;
  height:         100vh;
  overflow:       hidden;
  position:       relative;
}

#main::before {
  content:             "";
  position:            fixed;
  top:                 50%;
  left:                calc(50% + var(--sb-width, 220px) / 2);
  transform:           translate(-50%, -50%);
  width:               320px;
  height:              320px;
  background-image:    url("/brand/arch-icon.svg");
  background-size:     contain;
  background-repeat:   no-repeat;
  background-position: center;
  opacity:             0.025;
  pointer-events:      none;
  z-index:             0;
}

/* ── TOP BAR ────────────────────────────────────────────────── */
#hdr {
  height:          var(--hdr-h);
  display:         flex;
  align-items:     center;
  gap:             10px;
  padding:         0 16px;
  border-bottom:   1px solid var(--border);
  background:      var(--bg);
  flex-shrink:     0;
  box-shadow:      var(--shadow-sm);
}

#hdr-title {
  font-size:   13px;
  font-weight: 600;
  color:       var(--text);
  flex:        1;
}

#hdr-right {
  display:     flex;
  align-items: center;
  gap:         6px;
  margin-left: auto;
}

/* ── PANELS SCROLL AREA ─────────────────────────────────────── */
#panels {
  flex:       1;
  overflow-y: auto;
  padding:    16px 20px 24px;
}

/* ── PANELS ───────────────────────────────────────────────────── */
.panel    { display: none; }
.panel.on { display: block; }

/* ── SECTION CARD ─────────────────────────────────────────────── */
.sc {
  background:     var(--bg2);
  border:         1px solid var(--border);
  border-radius:  var(--radius-lg);
  padding:        .875rem 1rem;
  margin-bottom:  .875rem;
  box-shadow:     var(--shadow-sm);
}

.sl {
  font-family:    var(--font-display, "Cinzel", Georgia, serif);
  font-size:      11px;
  font-weight:    700;
  color:          var(--cbd-gold-deep);
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-bottom:  .625rem;
}

/* ── METRICS ─────────────────────────────────────────────────── */
.metrics {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap:                   8px;
  margin-bottom:         .875rem;
}

.mc {
  background:    var(--bg2);
  border-radius: var(--radius-lg);
  padding:       .75rem .875rem;
  border:        1px solid var(--border);
  box-shadow:    var(--shadow-sm);
  transition:    box-shadow .15s;
}
.mc:hover { box-shadow: var(--shadow-md); }

.mc-l { font-size: 9px;  color: var(--text2);  margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.mc-v { font-family: var(--font-display, "Cinzel", Georgia, serif); font-size: 22px; font-weight: 700; line-height: 1; color: var(--text); }
.mc-s { font-size: 9px;  color: var(--text3);  margin-top: 4px; }

.mc.good { border-color: var(--green);  background: var(--success-bg); }
.mc.warn { border-color: var(--amber);  background: var(--warn-bg); }
.mc.bad  { border-color: var(--danger); background: var(--danger-bg); }

/* ── TOOLTIPS ─────────────────────────────────────────────────── */
/* Usage: add data-tooltip="Text here" to any element              */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content:          attr(data-tooltip);
  position:         absolute;
  left:             50%;
  bottom:           calc(100% + 7px);
  transform:        translateX(-50%);
  white-space:      nowrap;
  max-width:        220px;
  white-space:      normal;
  text-align:       center;
  background:       var(--bg3, #1e2d3d);
  color:            var(--text1, #e8f0f8);
  border:           1px solid var(--border2, rgba(255,255,255,.14));
  border-radius:    6px;
  padding:          5px 9px;
  font-size:        11px;
  font-weight:      400;
  line-height:      1.45;
  pointer-events:   none;
  opacity:          0;
  transition:       opacity .15s, transform .15s;
  transform:        translateX(-50%) translateY(3px);
  z-index:          9999;
  box-shadow:       0 4px 12px rgba(0,0,0,.35);
}
/* Arrow */
[data-tooltip]::before {
  content:          '';
  position:         absolute;
  left:             50%;
  bottom:           calc(100% + 2px);
  transform:        translateX(-50%);
  border:           5px solid transparent;
  border-top-color: var(--border2, rgba(255,255,255,.14));
  pointer-events:   none;
  opacity:          0;
  transition:       opacity .15s;
  z-index:          9999;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity:   1;
  transform: translateX(-50%) translateY(0);
}
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
  opacity: 1;
}
/* Sidebar nav tooltips — push right so they don't go off-screen  */
#nav [data-tooltip]::after { left: 110%; bottom: auto; top: 50%; transform: translateY(-50%) translateX(4px); }
#nav [data-tooltip]::before { left: 100%; bottom: auto; top: 50%; transform: translateY(-50%); border-top-color: transparent; border-right-color: var(--border2, rgba(255,255,255,.14)); }
#nav [data-tooltip]:hover::after  { transform: translateY(-50%) translateX(0); }
#nav [data-tooltip]:hover::before { transform: translateY(-50%); }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  padding:        6px 12px;
  border-radius:  var(--radius);
  font-size:      11.5px;
  font-weight:    500;
  cursor:         pointer;
  border:         1px solid var(--border);
  background:     var(--bg);
  color:          var(--text);
  font-family:    var(--font);
  transition:     all .15s;
  display:        inline-flex;
  align-items:    center;
  gap:            5px;
  box-shadow:     var(--shadow-sm);
}
.btn:hover    { background: var(--bg2); border-color: var(--border2); }
.btn:disabled { opacity: .5; cursor: default; }

.btn.pri         { background: var(--cbd-gold-deep); color: var(--cbd-cream); border-color: var(--cbd-gold-deep); font-weight: 600; }
.btn.pri:hover   { background: var(--cbd-gold);        border-color: var(--cbd-gold); }
.btn.pri:active  { background: var(--cbd-gold-deep);   transform: translateY(1px); box-shadow: var(--shadow-engrave, inset 0 1px 2px rgba(0,0,0,.2)); }
.btn.green       { background: var(--green); color: #fff; border-color: var(--green); }
.btn.green:hover { opacity: .85; }
.btn.blue        { background: var(--blue);  color: #fff; border-color: var(--blue); }
.btn.blue:hover  { opacity: .85; }
.btn.sm          { padding: 3px 9px; font-size: 10px; }
.btn.xs          { padding: 2px 7px; font-size: 9px; }
.btn.danger      { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }

.btn-row {
  display:    flex;
  gap:        6px;
  flex-wrap:  wrap;
  margin-top: .625rem;
}

/* ── FORMS ────────────────────────────────────────────────────── */
.fg { margin-bottom: .5rem; }

.fg label {
  font-family:    var(--font-display, "Cinzel", Georgia, serif);
  font-size:      10px;
  color:          var(--cbd-ink-soft, var(--text2));
  display:        block;
  margin-bottom:  3px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.fg input,
.fg select,
.fg textarea {
  width:         100%;
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       6px 9px;
  font-size:     12.5px;
  font-family:   var(--font);
  background:    var(--bg);
  color:         var(--text);
  outline:       none;
  transition:    border-color .15s, box-shadow .15s;
}
.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  border-color: var(--gold);
  box-shadow:   0 0 0 2px var(--gold-dim);
}

.g2 { display: grid; grid-template-columns: 1fr 1fr;     gap: 8px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.bare-input {
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       6px 9px;
  font-size:     12px;
  font-family:   var(--font);
  background:    var(--bg);
  color:         var(--text);
  outline:       none;
}
.bare-input:focus {
  border-color: var(--gold);
  box-shadow:   0 0 0 2px var(--gold-dim);
}

/* ── ALERTS ───────────────────────────────────────────────────── */
.alert {
  display:       flex;
  align-items:   center;
  gap:           8px;
  padding:       8px 12px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size:     11.5px;
  border:        1px solid;
}
.alert.warn    { background: var(--warn-bg);    color: var(--warn);    border-color: var(--warn); }
.alert.info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info); }
.alert.success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert.danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }

/* ── BADGES ───────────────────────────────────────────────────── */
.badge {
  font-size:     9px;
  padding:       2px 7px;
  border-radius: 20px;
  font-weight:   600;
  letter-spacing: .03em;
}
.badge.quote  { background: var(--warn-bg);    color: var(--warn); }
.badge.active { background: var(--info-bg);    color: var(--info); }
.badge.done   { background: var(--success-bg); color: var(--success); }
.badge.crit   { background: var(--danger-bg);  color: var(--danger); }

/* ── CARD ROW ─────────────────────────────────────────────────── */
.card {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       10px 13px;
  margin-bottom: 7px;
  display:       flex;
  align-items:   flex-start;
  gap:           10px;
  box-shadow:    var(--shadow-sm);
  transition:    box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow-md); }

/* ── TABLE ────────────────────────────────────────────────────── */
.mt { width: 100%; border-collapse: collapse; font-size: 11px; }

.mt th {
  text-align:     left;
  padding:        6px 8px;
  font-size:      9px;
  font-weight:    700;
  color:          var(--gold);
  border-bottom:  1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.mt td {
  padding:        6px 8px;
  border-bottom:  1px solid var(--border);
  vertical-align: top;
  line-height:    1.45;
}

.mt tr:last-child td { border-bottom: none; }
.mt tr:hover td      { background: var(--bg2); }

/* ── MATERIAL FILTERS ─────────────────────────────────────────── */
.mf { display: flex; gap: 5px; margin-bottom: .625rem; flex-wrap: wrap; }

.mft {
  font-size:     10px;
  padding:       3px 9px;
  border-radius: 20px;
  border:        1px solid var(--border);
  background:    var(--bg2);
  color:         var(--text2);
  cursor:        pointer;
  transition:    all .15s;
}
.mft.on {
  background:   var(--gold);
  color:        var(--navy);
  border-color: var(--gold);
  font-weight:  600;
}

/* ── STAG ─────────────────────────────────────────────────────── */
.stag {
  font-size:     9px;
  padding:       2px 7px;
  border-radius: 20px;
  background:    var(--bg2);
  border:        1px solid var(--border);
  color:         var(--text2);
}

/* ── RESULT CARD ──────────────────────────────────────────────── */
.rcard {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       .875rem;
  margin-top:    .625rem;
  box-shadow:    var(--shadow-sm);
}

.rrow {
  display:         flex;
  justify-content: space-between;
  padding:         4px 0;
  font-size:       11.5px;
  border-bottom:   1px solid var(--border);
}
.rrow:last-child {
  border-bottom: none;
  font-weight:   700;
  font-size:     13px;
  margin-top:    4px;
  color:         var(--gold);
}
.rl { color: var(--text2); }

/* ── JOB KANBAN ───────────────────────────────────────────────── */
.jcols {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   8px;
}

.jcol {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       8px;
  min-height:    60px;
}

.jch {
  font-size:       9px;
  font-weight:     700;
  color:           var(--gold);
  text-transform:  uppercase;
  letter-spacing:  .08em;
  margin-bottom:   8px;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
}

.jcard {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       8px 9px;
  margin-bottom: 6px;
  box-shadow:    var(--shadow-sm);
  transition:    box-shadow .15s;
}
.jcard:hover { box-shadow: var(--shadow-md); }

.jcn { font-size: 11.5px; font-weight: 600; margin-bottom: 2px; }
.jcd { font-size: 9.5px;  color: var(--text2); margin-bottom: 5px; }
.jca { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }

/* ── LEDGER / EXPENSE CARDS ───────────────────────────────────── */
.exp-card {
  display:       flex;
  align-items:   center;
  gap:           .5rem;
  padding:       .45rem .65rem;
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .35rem;
}

/* ── CHAT ─────────────────────────────────────────────────────── */
#msgs {
  min-height:     180px;
  max-height:     340px;
  overflow-y:     auto;
  padding:        .875rem;
  display:        flex;
  flex-direction: column;
  gap:            10px;
  background:     var(--bg2);
  border:         1px solid var(--border);
  border-radius:  var(--radius-lg) var(--radius-lg) 0 0;
}

.msg { display: flex; gap: 8px; align-items: flex-start; }

.mav {
  width:           26px;
  height:          26px;
  border-radius:   50%;
  flex-shrink:     0;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       9px;
  font-weight:     700;
}
.msg.ag .mav { background: var(--gold); color: var(--navy); }
.msg.us .mav { background: var(--info-bg); color: var(--info); }

.mbody {
  font-size:   12.5px;
  line-height: 1.65;
  padding:     7px 11px;
  border-radius: var(--radius);
  max-width:   92%;
}
.msg.ag .mbody { background: var(--bg); border: 1px solid var(--border); }
.msg.us .mbody { background: var(--info-bg); color: var(--info); margin-left: auto; }
.msg.us        { flex-direction: row-reverse; }

.mbody pre {
  font-family: var(--mono);
  font-size:   10px;
  background:  var(--bg2);
  padding:     7px;
  border-radius: 5px;
  margin-top:  6px;
  overflow-x:  auto;
  white-space: pre-wrap;
  border:      1px solid var(--border);
}

#ld   { display: none; padding: 6px .875rem; gap: 5px; align-items: center; }
#ld.v { display: flex; }

.d {
  width:         4px; height: 4px;
  border-radius: 50%;
  background:    var(--text2);
  animation:     pp 1.2s infinite;
}
.d:nth-child(2) { animation-delay: .2s; }
.d:nth-child(3) { animation-delay: .4s; }
@keyframes pp { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

#ir {
  display:       flex;
  gap:           6px;
  padding:       7px;
  border:        1px solid var(--border);
  border-top:    none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background:    var(--bg);
}

#ui {
  flex:          1;
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       6px 9px;
  font-size:     12px;
  font-family:   var(--font);
  resize:        none;
  background:    var(--bg2);
  color:         var(--text);
  min-height:    34px;
  max-height:    80px;
  outline:       none;
}
#ui:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }

#sb {
  background:    var(--gold);
  border:        none;
  border-radius: var(--radius);
  padding:       0 11px;
  cursor:        pointer;
  display:       flex;
  align-items:   center;
}
#sb svg { width: 14px; height: 14px; fill: var(--navy); }

.qg {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap:                   6px;
  margin-bottom:         .875rem;
}

.qc {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       8px 10px;
  cursor:        pointer;
  text-align:    left;
  transition:    all .15s;
}
.qc:hover { background: var(--bg); border-color: var(--gold); }
.qc .ql   { font-size: 9px;  color: var(--text2); margin-bottom: 2px; }
.qc .qt   { font-size: 11px; font-weight: 500; }

/* ── DROP ZONE ────────────────────────────────────────────────── */
#dz {
  border:        2px dashed var(--border2);
  border-radius: var(--radius);
  padding:       1rem;
  text-align:    center;
  cursor:        pointer;
  transition:    all .15s;
  position:      relative;
  margin-bottom: .5rem;
}
#dz:hover, #dz.drag { border-color: var(--gold); background: var(--gold-dim); }
#dz input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
#dz p { font-size: 11px; color: var(--text2); }

/* ── SVG STUDIO ───────────────────────────────────────────────── */
#svgws { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: .5rem; }

#scb {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow:      hidden;
}

#stb {
  display:       flex;
  gap:           3px;
  padding:       6px;
  border-bottom: 1px solid var(--border);
  flex-wrap:     wrap;
}

.st2 {
  padding:       3px 7px;
  border-radius: 5px;
  font-size:     10px;
  border:        1px solid var(--border);
  background:    var(--bg);
  cursor:        pointer;
  color:         var(--text);
  font-family:   var(--font);
}

#sc {
  width:       100%;
  min-height:  180px;
  border:      none;
  padding:     8px;
  font-family: var(--mono);
  font-size:   10px;
  resize:      vertical;
  background:  transparent;
  color:       var(--text);
  outline:     none;
  line-height: 1.5;
}

#sp2 {
  background:     #fff;
  border:         1px solid var(--border);
  border-radius:  var(--radius-lg);
  overflow:       hidden;
  display:        flex;
  flex-direction: column;
}
#sp2 p { font-size: 9px; color: #444; padding: 4px 8px; border-bottom: 1px solid #e5e5e5; }
#sr {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-height: 180px;
}

/* ── INVENTORY BARS ───────────────────────────────────────────── */
.inv-bar-wrap { flex: 1; background: var(--bg2); border-radius: 20px; height: 5px; overflow: hidden; margin-top: 4px; }
.inv-bar { height: 5px; border-radius: 20px; background: var(--green); transition: width .3s; }
.inv-bar.low  { background: var(--amber); }
.inv-bar.crit { background: var(--danger); }

/* ── TIMER ────────────────────────────────────────────────────── */
#timer-display {
  font-size:      48px;
  font-weight:    300;
  font-family:    var(--mono);
  text-align:     center;
  letter-spacing: 3px;
  padding:        1rem 0;
  color:          var(--gold);
}

.timer-controls { display: flex; justify-content: center; gap: 8px; margin-bottom: .875rem; }

/* ── EXPORT GRID ──────────────────────────────────────────────── */
.export-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   8px;
  margin-bottom:         .875rem;
}

.exp-c {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       .875rem;
  box-shadow:    var(--shadow-sm);
}
.exp-t { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.exp-d { font-size: 10px; color: var(--text2); margin-bottom: 8px; line-height: 1.5; }

/* ── ATOMM LINKS ──────────────────────────────────────────────── */
.atomm-link {
  display:         flex;
  align-items:     center;
  gap:             9px;
  padding:         8px 10px;
  background:      var(--bg);
  border:          1px solid var(--border);
  border-radius:   var(--radius);
  margin-bottom:   6px;
  cursor:          pointer;
  text-decoration: none;
  color:           inherit;
  transition:      all .15s;
  box-shadow:      var(--shadow-sm);
}
.atomm-link:hover { background: var(--bg2); border-color: var(--gold); }

.al-icon {
  width:           28px; height: 28px;
  border-radius:   var(--radius);
  background:      var(--gold);
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
  color:           var(--navy);
  font-size:       14px;
}
.al-title { font-size: 12px; font-weight: 600; }
.al-sub   { font-size: 10px; color: var(--text2); }

/* ── GRANT CARDS ──────────────────────────────────────────────── */
.grant-card {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       10px 13px;
  margin-bottom: 8px;
  box-shadow:    var(--shadow-sm);
}

/* ── HERO BANNER ──────────────────────────────────────────────── */
.hero-banner {
  border-radius:  var(--radius-lg);
  padding:        1rem 1.25rem;
  margin-bottom:  .875rem;
  display:        flex;
  align-items:    center;
  gap:            14px;
}
.hero-banner.dark  { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); color: #d0c8b4; }
.hero-banner.green { background: linear-gradient(135deg, #3B6D11 0%, #27500A 100%); color: #EAF3DE; }
.hero-banner .hb-icon  { font-size: 28px; }
.hero-banner .hb-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; color: var(--gold); }
.hero-banner .hb-sub   { font-size: 10.5px; opacity: .85; line-height: 1.6; }

/* ── SETTINGS LOG ─────────────────────────────────────────────── */
.sle {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       8px 11px;
  margin-bottom: 6px;
  display:       flex;
  align-items:   flex-start;
  gap:           9px;
}

/* ── MODAL ────────────────────────────────────────────────────── */
.modal-overlay {
  display:         none;
  position:        fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:      rgba(0,0,0,.65);
  z-index:         9999;
  align-items:     center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }

.modal-box {
  background:    var(--bg);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  max-width:     460px;
  width:         90%;
  box-shadow:    0 12px 48px rgba(0,0,0,.35);
  border:        1px solid var(--border2);
}
.modal-box h2 { font-size: 15px; font-weight: 700; margin-bottom: .5rem; color: var(--gold); }
.modal-box h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.modal-box p  { font-size: 11.5px; color: var(--text2); margin-bottom: 1rem; line-height: 1.65; }

/* ── ONBOARDING WIZARD ────────────────────────────────────────── */
.ob-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: background .2s;
}
.ob-dot.active { background: var(--accent); }
.ob-machine-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border); font-size: 11px;
  cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s;
}
.ob-machine-chip.selected {
  border-color: var(--accent); background: rgba(var(--accent-rgb, 37,99,235),.08);
  color: var(--accent);
}

/* ── AI RESULT ────────────────────────────────────────────────── */
.ai-result { font-size: 12px; line-height: 1.75; white-space: pre-wrap; }

/* ── INVOICE LINE ─────────────────────────────────────────────── */
.inv-line {
  display:               grid;
  grid-template-columns: 1fr 55px 80px auto;
  gap:                   6px;
  margin-bottom:         6px;
  align-items:           center;
}
.inv-line input {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 7px; font-size: 12px; font-family: var(--font);
  background: var(--bg2); color: var(--text); outline: none; width: 100%;
}

/* ── GRANT INNER NAV ──────────────────────────────────────────── */
.gtab-nav {
  display:        flex;
  gap:            2px;
  background:     var(--bg2);
  border-radius:  var(--radius);
  padding:        3px;
  margin-bottom:  .875rem;
}

/* ── LOG ITEM ─────────────────────────────────────────────────── */
.log-item {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       9px 11px;
  margin-bottom: 6px;
  display:       flex;
  align-items:   flex-start;
  gap:           10px;
  box-shadow:    var(--shadow-sm);
}
.log-item-info { flex: 1; }
.log-item-name { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.log-item-sub  { font-size: 10.5px; color: var(--text2); line-height: 1.5; }

/* ── CANDIDATE CARDS ──────────────────────────────────────────── */
.candidate-box { margin-top: 8px; display: grid; gap: 6px; }
.candidate-card {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       9px 11px;
  box-shadow:    var(--shadow-sm);
}

/* ── UTILITY ──────────────────────────────────────────────────── */
.text-muted   { color: var(--text2); }
.text-small   { font-size: 10px; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warn    { color: var(--warn); }
.text-info    { color: var(--info); }
.fw-500       { font-weight: 500; }
.fw-600       { font-weight: 600; }
.mt-half      { margin-top: .5rem; }
.mt-1         { margin-top: 1rem; }
.mb-half      { margin-bottom: .5rem; }
.gap-sm       { gap: 5px; }

/* ── MOBILE MENU BUTTON (hidden on desktop) ──────────────────── */
#mob-menu-btn {
  display:      none;
  background:   none;
  border:       none;
  color:        var(--text);
  font-size:    20px;
  cursor:       pointer;
  padding:      0 6px;
  line-height:  1;
  flex-shrink:  0;
}

/* ── MOBILE BACKDROP ─────────────────────────────────────────── */
#mob-backdrop {
  display:    none;
  position:   fixed;
  inset:      0;
  z-index:    90;
  background: rgba(0,0,0,.55);
}
#mob-backdrop.open { display: block; }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 700px) {
  :root { --sb-width: 220px; }

  #app-shell {
    grid-template-columns: 1fr;
    height: 100vh;
    overflow: hidden;
  }

  /* Sidebar slides in over content */
  #sidebar {
    position:   fixed;
    top:        0;
    left:       0;
    height:     100vh;
    z-index:    100;
    transform:  translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  #sidebar.mob-open { transform: translateX(0); }

  #mob-menu-btn { display: flex; align-items: center; }

  #main {
    height:   100vh;
    overflow: hidden;
    display:  flex;
    flex-direction: column;
  }

  #hdr {
    flex-shrink: 0;
    gap: 8px;
  }

  #panels {
    flex:       1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body { overflow: hidden; }

  /* Grids collapse to single column */
  .g2, .g3     { grid-template-columns: 1fr; }
  .jcols       { grid-template-columns: 1fr; }
  #svgws       { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
  .metrics     { grid-template-columns: 1fr 1fr; }

  /* Invoice line items */
  .inv-line {
    grid-template-columns: 1fr auto auto auto;
    font-size: 12px;
  }

  /* Cards and sections */
  .sc   { padding: .6rem .75rem; }
  .card { padding: .5rem .65rem; }

  /* CRM cards stack vertically */
  .crm-card { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .crm-av   { align-self: flex-start; }

  /* Modals take full width on mobile */
  .modal-box { width: 95vw; max-width: 95vw; padding: 1.1rem 1rem; }

  /* Hero banners reduce padding */
  .hero-banner { padding: .75rem 1rem; }
  .hb-title    { font-size: 15px; }
  .hb-sub      { font-size: 11px; }

  /* Button rows wrap */
  .btn-row { flex-wrap: wrap; gap: 5px; }

  /* Tab pane padding */
  .panel { padding-bottom: 2rem; }

  /* Hide decorative sidebar elements on desktop that we don't need */
  #sb-machine-pills { display: none; }

  /* Proof portal iframe */
  #proof-frame { height: 60vh; }

  /* Onboarding machine grid */
  #ob-machine-list { grid-template-columns: 1fr; }

  /* Job card actions wrap */
  .jca { gap: 4px; }
  .jca .btn { font-size: 10px; padding: 3px 7px; }

  /* Ledger/expense cards stack on mobile */
  .exp-card { flex-wrap: wrap; }
  .exp-card > strong { margin-left: auto; }

  /* Metric values slightly smaller in 2-col grid */
  .mc-v { font-size: 18px; }
  .mc-l { font-size: 8px; }

  /* Quick prompts: 2-col on small screens */
  .qg { grid-template-columns: 1fr 1fr; gap: 5px; }
  .qg button { font-size: 10px; padding: 5px 7px; }

  /* Chat: fill height so input isn't buried by keyboard */
  #chat-panel {
    display:        flex;
    flex-direction: column;
    min-height:     calc(100dvh - var(--hdr-h) - 1rem);
    padding-bottom: 0;
  }
  #msgs { flex: 1; overflow-y: auto; min-height: 120px; }
  #ir   { flex-shrink: 0; position: sticky; bottom: 0; background: var(--bg); z-index: 2; }

  /* Verify email banner wraps */
  #verify-banner { flex-wrap: wrap; }
  #verify-banner span { width: 100%; }

  /* Sync pill: hide label text, show dot only */
  #sync-pill .sp-label { display: none; }
  #sync-pill { padding: 4px 6px; gap: 4px; min-width: 0; }

  /* Table overflow scroll */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }

  /* Invoice line: tighter on very small screens */
  .inv-line { grid-template-columns: 1fr 45px 70px auto; gap: 4px; }

  /* Hdr upgrade button smaller on mobile */
  #hdr-upgrade-btn { font-size: 10px !important; padding: 4px 8px !important; }

  /* Panel headings slightly smaller */
  .sl { font-size: 13px; }

}

/* ── VERY SMALL PHONES (≤400px) ───────────────────────────────── */
@media (max-width: 400px) {
  .sc      { padding: .4rem .5rem; }
  .btn     { font-size: 11px; }
  .metrics { grid-template-columns: 1fr; }
  .mc-v    { font-size: 20px; }
}

/* ── AUTH SCREEN ─────────────────────────────────────────────────────────────── */
#auth-screen {
  position:        fixed;
  inset:           0;
  z-index:         2000;
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      var(--navy);
  padding:         1rem;
}

#auth-card {
  background:    var(--bg);
  border-radius: 12px;
  padding:       2rem 2rem 1.5rem;
  width:         100%;
  max-width:     400px;
  box-shadow:    0 24px 64px rgba(0,0,0,.45);
}

#auth-brand {
  text-align:    center;
  margin-bottom: 1.5rem;
}

#auth-brand .cw-lockup {
  justify-content: center;
  margin: 0 auto .6rem;
}

#auth-brand .cw-lockup-mark {
  width: 42px;
  height: 42px;
}

#auth-brand .cw-lockup-name {
  font-size: 17px;
}

#auth-brand .cw-lockup-title {
  font-size: 9px;
}

#auth-brand-name {
  font-size:     15px;
  font-weight:   700;
  letter-spacing: .12em;
  color:         var(--navy);
}
[data-theme="dark"] #auth-brand-name { color: var(--gold); }
#auth-brand-sub {
  font-size:  11px;
  color:      var(--text2);
  margin-top: 2px;
}
#auth-brand-tagline {
  font-family: Georgia, serif;
  font-size:   11px;
  font-style:  italic;
  color:       var(--cbd-ink-mute, #8a7d6f);
  margin-top:  8px;
  line-height: 1.55;
  max-width:   240px;
  text-align:  center;
}

#auth-tabs {
  display:       flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  gap:           0;
}
.auth-tab {
  flex:          1;
  background:    none;
  border:        none;
  border-bottom: 2px solid transparent;
  padding:       .5rem;
  font-size:     12px;
  font-weight:   500;
  color:         var(--text2);
  cursor:        pointer;
  margin-bottom: -1px;
  transition:    color .15s, border-color .15s;
}
.auth-tab.on {
  color:         var(--text);
  font-weight:   600;
  border-bottom-color: var(--gold);
}

.auth-panel .fg { margin-bottom: .625rem; }
.auth-panel .fg label { font-size: 11px; }

.auth-submit-btn {
  width:      100%;
  padding:    .625rem;
  font-size:  13px;
  margin-top: .25rem;
}

.auth-error {
  font-size:    11px;
  color:        #dc2626;
  min-height:   16px;
  margin:       .25rem 0;
  line-height:  1.4;
}
.auth-success {
  font-size:    11px;
  color:        #16a34a;
  min-height:   16px;
  margin:       .25rem 0;
}

.auth-link {
  display:    block;
  background: none;
  border:     none;
  color:      var(--text2);
  font-size:  11px;
  cursor:     pointer;
  margin-top: .625rem;
  text-align: center;
  text-decoration: underline;
  padding:    0;
}
.auth-link:hover { color: var(--gold); }

.auth-note {
  font-size:     11px;
  color:         var(--text2);
  margin-bottom: .75rem;
  line-height:   1.6;
}

.auth-footer-note {
  text-align: center;
  font-size:  11px;
  color:      var(--text2);
  margin-top: 1.25rem;
  margin-bottom: 0;
}

/* ── TOAST SYSTEM ─────────────────────────────────────────────── */
#toast-stack {
  position:      fixed;
  top:           16px;
  right:         16px;
  z-index:       9999;
  display:       flex;
  flex-direction: column;
  gap:           10px;
  pointer-events: none;
  width:         340px;
  max-width:     calc(100vw - 32px);
}

.cbd-toast {
  background:   var(--bg, #faf8f4);
  border:       1px solid var(--border, rgba(0,0,0,.1));
  border-radius: var(--radius-lg, 12px);
  box-shadow:   var(--shadow-raised, 0 12px 28px rgba(26,20,16,.10));
  overflow:     hidden;
  pointer-events: auto;
  animation:    toast-in var(--dur-base, 200ms) var(--ease-out, ease) forwards;
  position:     relative;
}

.cbd-toast.toast-leaving {
  animation: toast-out var(--dur-base, 200ms) var(--ease-in, ease) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); max-height: 120px; }
  to   { opacity: 0; transform: translateX(24px); max-height: 0; margin: 0; padding: 0; }
}

.cbd-toast-bar {
  height:     3px;
  background: var(--cbd-gold, #C99A39);
  width:      100%;
  transform-origin: left;
  animation:  toast-bar linear forwards;
}

@keyframes toast-bar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.cbd-toast-inner {
  display:  flex;
  gap:      10px;
  padding:  12px 14px;
  align-items: flex-start;
}

.cbd-toast-icon {
  width:         20px;
  height:        20px;
  border-radius: 50%;
  flex-shrink:   0;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     11px;
  font-weight:   700;
  margin-top:    1px;
}

.cbd-toast-body {
  flex: 1;
  min-width: 0;
}

.cbd-toast-title {
  font-weight:  600;
  font-size:    12.5px;
  color:        var(--text, #1a1410);
  line-height:  1.3;
  margin-bottom: 2px;
}

.cbd-toast-msg {
  font-size:   11.5px;
  color:       var(--text2, #4a4036);
  line-height: 1.4;
}

.cbd-toast-close {
  background:  none;
  border:      none;
  cursor:      pointer;
  color:       var(--text2);
  font-size:   14px;
  line-height: 1;
  padding:     0 0 0 4px;
  flex-shrink: 0;
  opacity:     0.5;
  transition:  opacity var(--dur-fast, 120ms);
}
.cbd-toast-close:hover { opacity: 1; }

/* Tone variants */
.cbd-toast.success .cbd-toast-bar    { background: var(--color-success, var(--green)); }
.cbd-toast.success .cbd-toast-icon  { background: var(--success-bg, #EAF3DE); color: var(--color-success, var(--green)); }
.cbd-toast.error   .cbd-toast-bar   { background: var(--color-danger, var(--red)); }
.cbd-toast.error   .cbd-toast-icon  { background: var(--danger-bg, #FCEBEB);  color: var(--color-danger, var(--red)); }
.cbd-toast.warning .cbd-toast-bar   { background: var(--color-warning, var(--amber)); }
.cbd-toast.warning .cbd-toast-icon  { background: var(--warn-bg, #FAEEDA);   color: var(--color-warning, var(--amber)); }
.cbd-toast.info    .cbd-toast-bar   { background: var(--color-info, var(--blue)); }
.cbd-toast.info    .cbd-toast-icon  { background: var(--info-bg, #E6F1FB);   color: var(--color-info, var(--blue)); }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.cbd-empty {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  text-align:     center;
  padding:        3rem 1.5rem;
}

.cbd-empty-icon {
  width:           64px;
  height:          64px;
  border-radius:   50%;
  background:      var(--bg3, #e5ddd0);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       26px;
  margin-bottom:   1.25rem;
  color:           var(--text2);
}

.cbd-empty-eyebrow {
  font-family:    var(--font-display, "Cinzel", Georgia, serif);
  font-size:      10px;
  font-weight:    600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color:          var(--cbd-gold-deep, var(--gold));
  margin-bottom:  .375rem;
}

.cbd-empty-title {
  font-size:    16px;
  font-weight:  600;
  color:        var(--text);
  margin-bottom: .5rem;
  line-height:  1.3;
}

.cbd-empty-body {
  font-size:    13px;
  color:        var(--text2);
  max-width:    340px;
  line-height:  1.6;
  margin-bottom: 1.5rem;
}

.cbd-empty-steps {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap:                   10px;
  width:                 100%;
  max-width:             480px;
  margin-bottom:         1.25rem;
}

.cbd-empty-step {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding:       .75rem;
  text-align:    left;
}

.cbd-empty-step-num {
  font-family:  var(--font-display, "Cinzel", Georgia, serif);
  font-size:    18px;
  font-weight:  700;
  color:        var(--cbd-gold-deep, var(--gold));
  line-height:  1;
  margin-bottom: .25rem;
}

.cbd-empty-step-label {
  font-size:   11.5px;
  font-weight: 600;
  color:       var(--text);
  margin-bottom: .2rem;
}

.cbd-empty-step-hint {
  font-size:  10.5px;
  color:      var(--text2);
  line-height: 1.4;
}

/* ── CBD EYEBROW CLASS ───────────────────────────────────────── */
.cbd-eyebrow {
  font-family:    var(--font-display, "Cinzel", Georgia, serif);
  font-weight:    600;
  font-size:      10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color:          var(--cbd-gold-deep, var(--gold));
}
