/* ═══════════════════════════════════════════════════════════════
   GOLDEN GOOSE — Modern Fintech Design Language v3
   Structural CSS only. All token values (colors, fonts, spacing)
   are injected at runtime by brand.js via GG_BRAND.injectCSS().
   Do not add :root { } token blocks here — edit brand.js instead.
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   Base reset & typographic system
   ═══════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; }

/* Display — Inter at 700 default. Apply .display.wordmark or .display.hero
   for the heavier weights when needed. */
.display {
  font-family: var(--f-display);
  font-weight: var(--w-bold);
  letter-spacing: -0.025em;
  line-height: 1.02;
}
.display.wordmark { font-weight: var(--w-black);  letter-spacing: -0.04em; }
.display.hero     { font-weight: var(--w-extra);  letter-spacing: -0.035em; font-feature-settings: "tnum"; }
.display.title    { font-weight: var(--w-semi);   letter-spacing: -0.02em; }

/* Emphasis — gold, weight 600, NEVER italic.
   Per brand guide: emphasis is carried by color & weight, not slant. */
em, i {
  font-style: normal;
  color: var(--gold);
  font-weight: 600;
}
em.no-color, i.no-color { color: inherit; }

/* Data values: $ / % / digits MUST share one color. The em is just a wrapper
   for the digits; never let it inject gold into a semantic-colored value. */
.metric-value em,
.kpi .v em,
.cell .v em,
.big-num em,
.tabular em,
[data-value] em {
  color: inherit;
  font-weight: inherit;
}

/* Editorial section heading — small caps eyebrow */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

/* Tabular numerals */
.mono, .tabular {
  font-family: var(--f-mono);
  font-feature-settings: "tnum", "zero";
}

/* Hairline rule */
hr.rule {
  border: 0;
  border-top: 1px solid var(--hairline-2);
  margin: 0;
}

/* Selection */
::selection {
  background: var(--gold);
  color: var(--gold-ink);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: var(--hairline-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--hairline-strong); }


/* ═══════════════════════════════════════════════════════════════
   Deploy modal — Paper / Live Trade popup launched from /tests
   archive gear menu. Uses existing V3 tokens; no new variables.
   Tokens: --canvas, --surface, --ink, --ink-2, --ink-3,
   --hairline, --hairline-2, --hairline-strong, --gold, --gold-ink,
   --down, --brand-color-warn, --f-sans, --f-mono.
   ═══════════════════════════════════════════════════════════════ */

.gg-deploy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  font-family: var(--f-sans);
}
.gg-deploy-overlay.gg-deploy-open { display: flex; }

.gg-deploy-modal {
  width: min(520px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline-2);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  padding: 24px 26px 22px;
}

.gg-deploy-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline-2);
}

.gg-deploy-title {
  font-family: var(--f-display, var(--f-sans));
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.gg-deploy-mode {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--gold-dim-bg, rgba(212, 175, 55, 0.12));
  color: var(--gold);
  border: 1px solid var(--gold-dim-border, rgba(212, 175, 55, 0.4));
}
.gg-deploy-mode.gg-deploy-mode-live {
  background: rgba(220, 53, 69, 0.10);
  color: var(--down);
  border-color: rgba(220, 53, 69, 0.45);
}

.gg-deploy-strategy {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 16px;
  word-break: break-word;
}

.gg-deploy-balance {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-3);
  background: var(--canvas);
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  margin-bottom: 18px;
}
.gg-deploy-balance-value {
  color: var(--ink);
  font-weight: 600;
}
.gg-deploy-balance-error {
  color: var(--down);
}

.gg-deploy-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.gg-deploy-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.gg-deploy-input {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline-2);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--f-mono);
  font-size: 14px;
  font-feature-settings: "tnum", "zero";
  outline: none;
  transition: border-color 0.12s ease;
}
.gg-deploy-input:focus {
  border-color: var(--gold);
}
.gg-deploy-input.gg-deploy-input-invalid {
  border-color: var(--down);
}

.gg-deploy-wft-warning {
  display: none;
  background: rgba(245, 166, 35, 0.10);
  border: 1px solid var(--brand-color-warn, rgba(245, 166, 35, 0.5));
  color: var(--brand-color-warn, #f5a623);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.gg-deploy-wft-warning.gg-deploy-wft-visible { display: block; }

.gg-deploy-error {
  display: none;
  background: rgba(220, 53, 69, 0.10);
  border: 1px solid rgba(220, 53, 69, 0.45);
  color: var(--down);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.gg-deploy-error.gg-deploy-error-visible { display: block; }

.gg-deploy-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline-2);
}
.gg-deploy-btn {
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.gg-deploy-btn:hover { background: var(--canvas); }
.gg-deploy-btn-primary {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
}
.gg-deploy-btn-primary:hover { background: var(--gold-bright, var(--gold)); }
.gg-deploy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.gg-deploy-btn-primary:disabled,
.gg-deploy-btn-primary[disabled] {
  opacity: 0.5;
  background: var(--ink-4);
  border-color: var(--ink-4);
  color: var(--canvas);
  cursor: not-allowed;
}

/* s78 deploy B1: notification panel — position:fixed so it appears at the
   bell button instead of below the document flow (was position:static). */
.notif-panel {
  position: fixed;
  /* s80: anchor to the sidebar edge (left:67px sidebar width + 6px gap) and to
     the bell row vertically. Slides out to the side of the bell, not down from
     the topbar. top:120px lands roughly next to the bell row in the nav-sec
     stack (above Help, below admin-shield + module icons). */
  top: 120px;
  left: 73px;
  width: 340px;
  max-height: calc(100vh - 140px);
  z-index: 900;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Optional pointer triangle on the LEFT edge (toward the sidebar bell). */
.notif-panel::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 14px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-left: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  transform: rotate(45deg);
  z-index: -1;
}
/* CSS display:flex overrides the HTML [hidden] attribute — restore it. */
.notif-panel[hidden] { display: none; }

.notif-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}
.notif-panel-title {
  flex: 1;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.notif-panel .link-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.notif-panel .link-btn:hover { color: var(--ink); background: var(--surface); }
.notif-panel .m-icon-btn {
  appearance: none;
  background: transparent;
  border: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.notif-panel .m-icon-btn:hover { color: var(--ink); background: var(--surface); }
.notif-panel .notif-list {
  flex: 1;
  overflow-y: auto;
  min-height: 60px;
}
.notif-panel .notif-list:empty::after {
  content: "No notifications";
  display: block;
  padding: 24px 12px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-4);
}
.notif-panel-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--hairline);
  background: var(--surface-2);
}
.notif-panel-foot a {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
}
.notif-panel-foot a:hover { color: var(--ink); }

/* s80: Sidebar bell. The bell lives in .nav-sec stack (above Help). Position
   the badge inside the nav-sec button. When unread > 0, JS toggles .has-unread
   on the button to flip its color to --down (brand.js red). */
.sidebar-bell {
  position: relative;
}
.sidebar-bell.has-unread { color: var(--down); }
.sidebar-bell.has-unread:hover { color: var(--down); filter: brightness(1.15); }

.notif-bell-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--down, #E26456);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}
.notif-bell-badge[hidden] { display: none; }

/* Topbar bell removed s80; class kept as no-op shim in case any stale handler
   still references it. */

/* Individual notif row */
.notif-row {
  position: relative;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: background .15s;
}
.notif-row:hover { background: var(--surface-2); }
.notif-row.is-unread { background: rgba(94,190,110,0.05); }
.notif-row.is-unread::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up, #5DB868);
  position: absolute;
  left: 4px;
  top: 14px;
}
.notif-row-headline {
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.35;
}
.notif-row-meta {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}


/* s80: topbar Goose mark. Uses canonical GG_BRAND head (gold gradient via
   data-gg-goose="head"). Canonical SVG faces RIGHT; the topbar variant looks
   LEFT, so flip horizontally with scaleX(-1). The flip is on the inner mark
   span, NOT on the button itself, so click area + hover stay correct. */
.goose-pop .goose-pop-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transform: scaleX(-1);
  transform-origin: center;
}
.goose-pop .goose-pop-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}


/* s80 2026-06-03: brand-styled AI model selects (used in Help / Goose / Builder
   chat panels). Uses brand tokens, not gg-primitives.css (which is only loaded
   on /build). White-background browser default no longer leaks through. */
.gg-select-ai {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  color: var(--ink);
  padding: 6px 28px 6px 10px;
  font: 500 12px/1.3 var(--f-sans);
  border-radius: 6px;
  cursor: pointer;
  min-height: 30px;
  /* s81 2026-06-04: visible lucide-style chevron-down (stroke 2, ink-2). */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ccc' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-position: calc(100% - 8px) 50%;
  background-size: 12px 12px;
  background-repeat: no-repeat;
  transition: border-color .12s, color .12s, background-color .12s;
}
.gg-select-ai:hover:not(:disabled) { color: var(--ink); border-color: var(--hairline-strong, var(--hairline-2)); background-color: var(--surface-2, var(--surface)); }
.gg-select-ai:focus { outline: none; border-color: var(--gold); }
.gg-select-ai:disabled { color: var(--ink-3); cursor: not-allowed; opacity: 0.6; }
.gg-select-ai option { background: var(--surface); color: var(--ink); }
