/* App shell + page components (uses theme.css tokens). */
.shell { display: flex; min-height: 100vh; }
.side { width: 300px; flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: #000; }
body.signed-out .side { display: none; }
body.signed-out main#main { padding-bottom: 56px; }
.brand { display: flex; gap: 14px; align-items: center; padding: 36px 28px; border-bottom: 1px solid var(--line); color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark, .pq { background: var(--accent); color: #fff; font-family: var(--mono); font-weight: 500; width: 44px; height: 44px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.brand b { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.03em; display: block; line-height: 1.1; }
.brand small { font-family: var(--mono); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
#nav { padding: 32px 14px; display: flex; flex-direction: column; gap: 6px; }
#nav a { display: flex; gap: 16px; align-items: center; padding: 14px 18px; color: var(--ink-2); font-size: 17px; border: 2px solid transparent; }
#nav a:hover { background: var(--panel-2); text-decoration: none; }
#nav a.on { background: var(--panel-2); border-color: var(--accent); color: var(--ink); }
.me { margin-top: auto; border-top: 1px solid var(--line); padding: 24px; display: grid; grid-template-columns: 44px 1fr; gap: 6px 14px; align-items: center; }
.me .avatar { width: 44px; height: 44px; background: #18181b; border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 600; }
.me .who { min-width: 0; } .me b { display: block; font-weight: 500; }
.me small { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .link-btn { grid-column: 1 / -1; color: var(--muted); margin-top: 10px; }
main#main { flex: 1; min-width: 0; padding: 56px clamp(16px, 4vw, 68px) 96px; }
body.signed-out main#main { padding-top: 8vh; }

.demo-bar.warn { background: var(--warn-soft); border-color: rgba(245,158,11,.5); }
.demo-bar { background: var(--accent-soft); border: 1px solid rgba(59,130,246,.5); padding: 14px 20px; margin-bottom: 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.page-head .eyebrow { margin-bottom: 18px; }
.page-head .actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.prop-select { background: #050506; border: 1px solid var(--line-2); color: var(--ink); padding: 14px 18px; font-size: 17px; min-width: 300px; cursor: pointer; border-radius: 0; }
.section { margin-top: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; font-size: 32px; margin: 0; }

/* briefing header */
.brief-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid var(--line); margin-bottom: 44px; }
.brief-head .pqline { display: flex; gap: 12px; align-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; }
.brief-head .pqline .pq { width: 34px; height: 34px; font-size: 13px; }
.brief-head h2 { font-family: var(--display); font-weight: 700; font-size: 34px; letter-spacing: -.02em; margin: 18px 0 8px; }
.brief-head .right { text-align: right; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

/* AI note */
.ai-note { padding: 32px 44px; }
.ai-note .top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ai-note .text { margin-top: 24px; font-size: 18px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; }
.ai-note .text.placeholder { color: var(--muted); font-style: italic; }

/* opportunities */
.opp { border: 1px solid var(--line); border-left: 4px solid var(--good); background: var(--panel); padding: 30px 36px; display: flex; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.opp.med { border-left-color: var(--warn); } .opp.low { border-left-color: var(--accent-2); } .opp.done { opacity: .5; }
.opp .tag { font-family: var(--mono); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--good); }
.opp.med .tag { color: var(--warn); } .opp.low .tag { color: var(--accent-2); }
.opp h4 { font-family: var(--sans); font-size: 21px; font-weight: 600; margin: 14px 0 8px; }
.opp p { color: var(--muted); margin: 0; font-size: 16px; }
.opp .impact { text-align: right; flex-shrink: 0; }
.opp .impact .v { font-family: var(--mono); font-size: 32px; color: var(--good); margin: 8px 0 4px; }
.opp .act { margin-top: 18px; }

/* misc page pieces */
.chart-box { position: relative; height: 380px; } .chart-box.sm { height: 260px; }
.wx { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.wx .d { border: 1px solid var(--line); padding: 18px 8px; text-align: center; }
.wx .d .eyebrow { letter-spacing: .2em; } .wx .d svg.i { width: 24px; height: 24px; margin: 12px auto; display: block; color: var(--accent-2); }
.wx .d .t { font-family: var(--mono); font-size: 18px; } .wx .d .r { font-family: var(--mono); font-size: 12px; color: var(--accent-2); margin-top: 6px; }
.event { border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 26px 30px; }
.event h4 { font-size: 19px; margin: 12px 0 10px; font-weight: 600; }
.sim-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.verdict { margin-top: 24px; padding: 18px 22px; border: 1px solid rgba(59,130,246,.4); background: var(--accent-soft); font-size: 16px; }
.score-card { border: 1px solid var(--line); padding: 44px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.score-card .num { font-family: var(--mono); font-size: clamp(72px, 7vw, 120px); line-height: 1; letter-spacing: -.04em; white-space: nowrap; }
.prop-card { background: var(--panel); border: 1px solid var(--line); padding: 36px; cursor: pointer; text-align: left; color: var(--ink); width: 100%; }
.prop-card:hover { border-color: var(--line-2); }
.prop-card.on { border-color: var(--accent); }
.prop-card .top { display: flex; justify-content: space-between; }
.prop-card h3 { font-size: 27px; margin: 22px 0 12px; }
.prop-card .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 30px 0 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.prop-card .kv b { display: block; font-family: var(--mono); font-size: 24px; font-weight: 400; margin-top: 8px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.icon-btn:hover { color: var(--bad); }
.variant { border: 1px solid var(--line); padding: 20px; } .variant.win { border-color: var(--good); background: var(--good-soft); }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.stats4 b { display: block; font-family: var(--mono); font-size: 18px; font-weight: 400; margin-top: 6px; }
.probbar { height: 6px; background: var(--line); display: flex; margin: 18px 0 8px; } .probbar span { background: var(--accent); }
.row-list .r { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.row-list .r:first-child { border-top: 0; }
.auth { max-width: 460px; margin: 0 auto; }
.auth .brand { border: 0; padding: 0 0 36px; }
.auth form { display: grid; gap: 18px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: #050506; border: 1px solid var(--line-2); padding: 40px; width: min(640px, 100%); max-height: 90vh; overflow: auto; }


/* number explanations (ⓘ): hover on desktop, tap/focus on touch */
.info { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--line-2); border-radius: 50%; font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); cursor: help; position: relative; vertical-align: 1px; margin-left: 4px; }
.info:hover, .info:focus { color: var(--ink); border-color: var(--accent-2); outline: none; }
.info:hover::after, .info:focus::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 260px; background: #000; border: 1px solid var(--line-2); color: var(--ink-2); padding: 10px 12px; font-size: 13px; line-height: 1.45; letter-spacing: 0; text-transform: none; z-index: 30; white-space: normal; text-align: left; font-weight: 400; }
.tile .val small { font-size: .45em; color: var(--muted); margin-left: 4px; }
.opp .how { color: var(--ink-2); font-size: 15px; margin: 12px 0 0; display: flex; gap: 8px; align-items: flex-start; }
.opp .how svg.i { flex-shrink: 0; margin-top: 4px; color: var(--accent-2); }
.opp .act { display: flex; gap: 10px; flex-wrap: wrap; }

/* getting-started checklist */
.guide { border-color: rgba(59,130,246,.5); }
.guide ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.guide li { display: grid; grid-template-columns: 30px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.guide li .n { width: 26px; height: 26px; border: 1px solid var(--line-2); border-radius: 50%; display: grid; place-items: center; color: var(--good); font-size: 14px; }
.guide li.ok b { color: var(--muted); text-decoration: line-through; }
.guide li.ok .n { border-color: var(--good); background: var(--good-soft); }
.guide li .muted { font-size: 14px; margin-top: 4px; }

/* address search */
.addr { position: relative; }
.addr-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #050506; border: 1px solid var(--line-2); z-index: 50; max-height: 260px; overflow: auto; }
.addr-list.open { display: block; }
.addr-list button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink-2); padding: 12px 14px; font-family: var(--sans); font-size: 15px; letter-spacing: 0; text-transform: none; cursor: pointer; }
.addr-list button:hover, .addr-list button:focus { background: var(--panel-2); color: var(--ink); outline: none; }
details.more { border: 1px solid var(--line); padding: 16px 18px; }
details.more summary { cursor: pointer; color: var(--ink-2); }
#nav .short { display: none; }

/* sign-up page pitch */
.auth-pitch { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 12px; }
.auth-pitch li { display: flex; gap: 12px; color: var(--ink-2); }
.auth-pitch li::before { content: "✓"; color: var(--good); font-weight: 600; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 18px 16px; }
  /* phones: bottom tab bar so every page is one tap away, no sideways scrolling */
  #nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; flex-direction: row; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: #000; border-top: 1px solid var(--line); }
  #nav a { flex: 1; flex-direction: column; gap: 4px; padding: 6px 2px; font-size: 11px; border: 0; justify-content: center; min-width: 0; }
  #nav a.on { background: none; color: var(--accent-2); }
  #nav a .full { display: none; } #nav a .short { display: block; }
  .me { display: none; }
  main#main { padding: 20px 16px 96px; }
  .page-head { margin-bottom: 24px; } .page-head .lead { font-size: 15px; }
  .page-head .actions .btn.tag { display: none; }
  .brief-head { display: none; }
  .demo-bar { padding: 12px 14px; margin-bottom: 20px; }
  .guide li { grid-template-columns: 30px 1fr; } .guide li .btn { grid-column: 2; justify-self: start; }
  .g4, .g3, .g2, .score-card, .sim-out { grid-template-columns: 1fr; }
  .wx { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .prop-select { min-width: 0; width: 100%; }
  .opp { flex-direction: column; } .opp .impact { text-align: left; }
  table.t th, table.t td { padding: 14px 12px; }
}
@media print {
  .side, .page-head .actions, .ai-note .link-btn, .opp .act, .demo-bar, .no-print { display: none !important; }
  html, body { background: #fff; color: #000; }
  .panel, .tile, .opp, .brief-head { background: #fff !important; color: #000; border-color: #ccc !important; }
  .muted, .tile .note, .opp p, .eyebrow { color: #444 !important; }
  main#main { padding: 0; }
  .chart-box { break-inside: avoid; }
}
