/* ==========================================================================
   ATLAS v2 — Editorial Dark Mobile-First
   ==========================================================================
   Aesthetic: serious financial research, editorial typography, dark canvas
   with amber accent + paper text. Refined, not flashy. Generous spacing.
   Designed for narrow phone viewports first; scales up gracefully.
   ========================================================================== */

/* -- Fonts: distinctive serif display + clean mono body ----------------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;0,600;1,400&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

/* -- Design tokens ------------------------------------------------------ */
:root {
  /* Palette */
  --ink:        #07090c;         /* deepest background */
  --ink-2:      #0e1217;         /* card background */
  --ink-3:      #161b22;         /* elevated surface */
  --line:       #232c3a;         /* dividers */
  --line-dim:   #1a1f29;
  --paper:      #e8e4d8;         /* primary text */
  --paper-dim:  #a8b3c5;         /* secondary text */
  --muted:      #6b7689;         /* meta / captions */
  --amber:      #f4b54a;         /* primary accent */
  --amber-glow: rgba(244, 181, 74, 0.12);
  --teal:       #4ec9b0;         /* positive */
  --red:        #e85a6c;         /* negative / warnings */
  --fuchsia:    #e85aff;         /* smart money / consensus accent */
  --green:      #4ec9b0;

  /* Typography */
  --serif: 'Fraunces', 'Georgia', serif;
  --sans:  'IBM Plex Sans', system-ui, sans-serif;
  --mono:  'IBM Plex Mono', 'SF Mono', 'Menlo', monospace;

  /* Spacing — generous, editorial */
  --gap-xs:  4px;
  --gap-sm:  8px;
  --gap-md:  16px;
  --gap-lg:  24px;
  --gap-xl:  40px;
  --gap-2xl: 64px;

  /* Layout */
  --max-w:    900px;
  --header-h: 56px;
  --tabbar-h: 64px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* -- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--ink);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  /* iOS safe areas */
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* -- Top app header ----------------------------------------------------- */
.app-header {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 100;
  background: var(--ink);
  border-bottom: 1px solid var(--line-dim);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gap-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.app-header .brand {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--paper);
}
.app-header .brand em {
  color: var(--amber);
  font-style: italic;
  font-weight: 500;
}
.app-header .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -- Bottom tab bar ----------------------------------------------------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--ink);
  border-top: 1px solid var(--line-dim);
  display: flex;
  align-items: stretch;
  z-index: 100;
}
.tabbar-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
  padding: 0;
}
.tabbar-tab .icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}
.tabbar-tab.active {
  color: var(--amber);
}
.tabbar-tab:active { transform: scale(0.95); }

/* -- Main canvas -------------------------------------------------------- */
.app-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap-lg) var(--gap-md);
  min-height: calc(100vh - var(--header-h) - var(--tabbar-h));
}

/* -- View transitions --------------------------------------------------- */
.view {
  display: none;
  animation: fadeUp 0.4s var(--ease-out);
}
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -- Section title ------------------------------------------------------ */
.section-title {
  font-family: var(--serif);
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--gap-xs) 0;
  color: var(--paper);
}
.section-title em {
  font-style: italic;
  color: var(--amber);
  font-weight: 500;
}
.section-desc {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--gap-xl) 0;
  line-height: 1.6;
}

/* -- Card --------------------------------------------------------------- */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line-dim);
  padding: var(--gap-lg) var(--gap-md);
  margin-bottom: var(--gap-md);
  position: relative;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.card:active {
  background: var(--ink-3);
  border-color: var(--amber);
}
.card-num {
  position: absolute;
  top: var(--gap-md);
  right: var(--gap-md);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-num em {
  color: var(--amber);
  font-style: normal;
  font-weight: 500;
}

/* -- Card content ------------------------------------------------------- */
.card .ticker {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: var(--gap-md) 0 var(--gap-xs) 0;
  color: var(--paper);
}
.card .name {
  font-size: 14px;
  color: var(--paper-dim);
  margin: 0 0 var(--gap-md) 0;
}
.card .signal,
.card .backers {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--gap-sm) 0;
  border-top: 1px solid var(--line-dim);
  font-family: var(--mono);
  font-size: 11px;
}
.card .signal .label,
.card .backers .label {
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 10px;
}
.card .signal .value {
  color: var(--amber);
  text-align: right;
}
.card .backers .value {
  color: var(--paper-dim);
  text-align: right;
}
.card .rationale {
  font-style: italic;
  color: var(--paper-dim);
  font-size: 13px;
  line-height: 1.6;
  margin: var(--gap-md) 0 0 0;
  padding-top: var(--gap-md);
  border-top: 1px solid var(--line-dim);
}

/* -- Empty / loading states -------------------------------------------- */
.loading {
  text-align: center;
  padding: var(--gap-2xl) var(--gap-md);
  color: var(--paper-dim);
}
.loading .status {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: var(--gap-md);
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--line);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar {
  height: 2px;
  background: var(--line-dim);
  border-radius: 1px;
  overflow: hidden;
  margin: var(--gap-md) auto;
  max-width: 240px;
}
.progress-bar .fill {
  height: 100%;
  background: var(--amber);
  transition: width 0.4s var(--ease);
}

.empty-state {
  text-align: center;
  padding: var(--gap-2xl) var(--gap-md);
}
.empty-state h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 var(--gap-md) 0;
}
.empty-state p {
  color: var(--paper-dim);
  font-size: 13px;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* -- Settings page ------------------------------------------------------ */
.settings-group {
  margin-bottom: var(--gap-xl);
}
.settings-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--gap-sm);
}
.settings-input {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 14px;
  -webkit-appearance: none;
  appearance: none;
}
.settings-input:focus {
  outline: none;
  border-color: var(--amber);
}
.settings-help {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: var(--gap-sm);
  line-height: 1.5;
}

/* -- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 12px 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
  font-weight: 600;
}
.btn-primary:active {
  background: #ffc560;
}
.btn-block { width: 100%; }

/* -- Status messages ---------------------------------------------------- */
.status-ok    { color: var(--green); }
.status-error { color: var(--red); }
.status-warn  { color: var(--amber); }

.banner {
  background: var(--ink-2);
  border-left: 3px solid var(--amber);
  padding: var(--gap-md);
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: var(--gap-md);
  line-height: 1.6;
}
.banner.error { border-left-color: var(--red); }
.banner.success { border-left-color: var(--green); }

/* -- Smart Money accent (fuchsia for consensus) ------------------------ */
.consensus-tag {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(232, 90, 255, 0.12);
  border: 1px solid rgba(232, 90, 255, 0.4);
  color: var(--fuchsia);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

/* -- Wider screens (tablet+) ------------------------------------------- */
@media (min-width: 720px) {
  body { font-size: 15px; }
  .app-main { padding: var(--gap-xl) var(--gap-lg); }
  .card { padding: var(--gap-xl) var(--gap-lg); }
}

@media (min-width: 1024px) {
  /* On desktop we widen the viewport but keep the editorial single-column.
     Two-column layouts come later when sections demand it. */
  .app-main { padding: var(--gap-2xl) var(--gap-xl); }
}

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

/* ==========================================================================
   BLOCK 2 — Strategy chips, portfolio rows, stock modal, brief modal
   ========================================================================== */

/* -- Strategy chips (horizontal scroll on mobile) ----------------------- */
.chips {
  display: flex;
  gap: var(--gap-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--gap-md)) var(--gap-lg);
  padding: 0 var(--gap-md) var(--gap-sm);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.chip:active { transform: scale(0.96); }
.chip.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
  font-weight: 600;
}

/* -- Strategy thesis ---------------------------------------------------- */
.strategy-thesis {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: var(--paper-dim);
  margin-bottom: var(--gap-xl);
  padding-left: var(--gap-md);
  border-left: 2px solid var(--amber);
}
.strategy-thesis .badge {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--gap-sm);
}

/* -- Portfolio stock row (compact list, mobile-first) ------------------ */
.stock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--gap-md);
  padding: var(--gap-md) 0;
  border-bottom: 1px solid var(--line-dim);
  cursor: pointer;
  transition: background 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.stock-row:active {
  background: var(--ink-2);
}
.stock-row .left {
  min-width: 0;
}
.stock-row .ticker-line {
  display: flex;
  align-items: baseline;
  gap: var(--gap-sm);
  margin-bottom: 4px;
}
.stock-row .ticker {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--paper);
  margin: 0;
}
.stock-row .region {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stock-row .name {
  font-size: 12px;
  color: var(--paper-dim);
  margin: 0 0 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-row .meta-line {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.stock-row .sector {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stock-row .conviction {
  display: inline-flex;
  gap: 2px;
}
.stock-row .conv-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line);
}
.stock-row .conv-dot.on {
  background: var(--amber);
}
.stock-row .right {
  text-align: right;
  flex-shrink: 0;
}
.stock-row .price {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--paper);
  margin: 0 0 4px 0;
}
.stock-row .upside {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}
.stock-row .upside.positive { color: var(--green); }
.stock-row .upside.negative { color: var(--red); }
.stock-row .weight {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

/* -- Modal (full-screen on mobile) ------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
  flex-direction: column;
}
.modal[aria-hidden="false"] {
  display: flex;
  animation: slideUp 0.3s var(--ease-out);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ink);
  border-bottom: 1px solid var(--line-dim);
  padding: env(safe-area-inset-top) var(--gap-md) 0;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-close {
  background: transparent;
  border: 0;
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.modal-close:active { color: var(--amber); }
.modal-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.modal-title > span:first-child {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: -0.01em;
}
.modal-title .modal-subtitle {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-body {
  flex: 1;
  padding: var(--gap-lg) var(--gap-md) calc(var(--gap-2xl) + env(safe-area-inset-bottom));
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

/* -- Stock detail content ---------------------------------------------- */
.stock-detail-hero {
  text-align: left;
  margin-bottom: var(--gap-xl);
  padding-bottom: var(--gap-lg);
  border-bottom: 1px solid var(--line-dim);
}
.stock-detail-hero .ticker-big {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--gap-sm) 0;
}
.stock-detail-hero .name-big {
  color: var(--paper-dim);
  font-size: 14px;
  margin: 0 0 var(--gap-md) 0;
}
.stock-detail-hero .price-big {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  color: var(--paper);
}
.stock-detail-hero .change-big {
  font-family: var(--mono);
  font-size: 13px;
  margin-top: 4px;
}
.stock-detail-hero .change-big.positive { color: var(--green); }
.stock-detail-hero .change-big.negative { color: var(--red); }

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-md);
  margin-bottom: var(--gap-xl);
}
.metric-card {
  background: var(--ink-2);
  border: 1px solid var(--line-dim);
  padding: var(--gap-md);
}
.metric-card .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.metric-card .value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--paper);
}
.metric-card .sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--paper-dim);
  margin-top: 4px;
}

/* Section header within modal */
.detail-section-h {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin: var(--gap-xl) 0 var(--gap-md) 0;
  color: var(--paper);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--gap-sm) 0;
  border-bottom: 1px solid var(--line-dim);
  font-family: var(--mono);
  font-size: 12px;
}
.detail-row .label {
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 10px;
  text-transform: uppercase;
}
.detail-row .value {
  color: var(--paper);
  text-align: right;
  font-weight: 500;
}

/* Brief content (Claude-generated HTML) */
.brief-exec {
  border-left: 2px solid var(--amber);
  padding: var(--gap-md) var(--gap-md) var(--gap-md) var(--gap-lg);
  background: rgba(244, 181, 74, 0.04);
  margin-bottom: var(--gap-xl);
}
.brief-exec-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--gap-sm);
  font-weight: 600;
}
.brief-exec p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--paper);
  margin: 0 0 var(--gap-md) 0;
}
.brief-oneliner {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--paper-dim);
  border-top: 1px solid var(--line-dim);
  padding-top: var(--gap-md);
  margin-top: var(--gap-md);
}
/* =====================================================================
   BRIEF SECTION — aggressive flow override
   The backend's HTML uses <div class="brief-section"> wrapping <h2>+<p>.
   Claude varies between h1/h2/h3/h4 across runs, so we cover all.
   !important defeats any cached grid layout from older CSS versions.
   ===================================================================== */
.brief-section {
  display: block !important;
  grid-template-columns: none !important;
  padding: var(--gap-md) 0 !important;
  border-bottom: 1px solid var(--line-dim);
}
.brief-section:last-child {
  border-bottom: none;
}
.brief-section > * {
  grid-column: unset !important;
  grid-row: unset !important;
}
.brief-num {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  font-weight: 500;
  color: var(--amber);
  line-height: 1;
  display: inline-block;
  margin-right: var(--gap-sm);
}
.brief-section h1,
.brief-section h2,
.brief-section h3,
.brief-section h4,
.brief-content h1,
.brief-content h2,
.brief-content h3,
.brief-content h4 {
  font-family: var(--serif) !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  margin: 0 0 var(--gap-sm) 0 !important;
  color: var(--paper) !important;
  letter-spacing: -0.005em !important;
  line-height: 1.3 !important;
  display: block !important;
}
.brief-section p,
.brief-content p {
  font-size: 13px !important;
  line-height: 1.65 !important;
  color: var(--paper-dim) !important;
  margin: 0 0 var(--gap-sm) 0 !important;
  display: block !important;
}
.brief-section p:last-child,
.brief-content p:last-child {
  margin-bottom: 0 !important;
}
.brief-section strong,
.brief-content strong {
  color: var(--paper) !important;
  font-weight: 600 !important;
}

/* Brief loading state with progress */
.brief-loading {
  text-align: center;
  padding: var(--gap-2xl) var(--gap-md);
}
.brief-loading h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  margin: var(--gap-md) 0 var(--gap-sm) 0;
  color: var(--paper);
}
.brief-loading p {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 var(--gap-lg) 0;
}
.brief-loading-detail {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--paper-dim);
  margin-top: var(--gap-md);
  font-style: italic;
  line-height: 1.6;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA button to generate brief */
.brief-cta {
  display: block;
  width: 100%;
  background: var(--amber);
  border: 0;
  color: var(--ink);
  padding: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  margin: var(--gap-lg) 0;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.brief-cta:active {
  transform: scale(0.98);
  background: #ffc560;
}
.brief-cta:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Wider screens — modals also have max-width */
@media (min-width: 720px) {
  .modal-body {
    padding: var(--gap-xl) var(--gap-lg) calc(var(--gap-2xl) + env(safe-area-inset-bottom));
  }
  .stock-detail-hero .ticker-big { font-size: 56px; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
}
