/* PA Realty — Portfolio Builder
   Brand: black / white / gold #F1C233, heavy grotesque to echo the PA mark, hard edges (no rounding). */
:root {
  --black: #000000;
  --ink: #141414;
  --gold: #F1C233;
  --gold-deep: #B88F0A;
  --paper: #FFFFFF;
  --mist: #F3F3F0;
  --line: #D8D8D2;
  --grey: #5E5E58;
  --neg: #B3261E;
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--mist); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Top bar ---------- */
.bar { background: var(--black); color: #fff; display: flex; align-items: center; gap: 20px; padding: 14px 28px; position: sticky; top: 0; z-index: 20; }
.bar .logo { height: 44px; width: auto; display: block; }
.bar .title { font-weight: 800; font-size: 18px; letter-spacing: 0.01em; padding-left: 20px; border-left: 2px solid var(--gold); }
.bar .spacer { flex: 1; }
.bar a, .bar button { color: #fff; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--black); background: var(--paper); color: var(--black); padding: 9px 16px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--black); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--black); }
.btn.gold:hover { background: #fff; border-color: #fff; color: var(--black); }
.btn.ghost-light { background: transparent; border-color: #fff; color: #fff; }
.btn.ghost-light:hover { background: #fff; color: #000; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.xl { padding: 16px 30px; font-size: 18px; font-weight: 800; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

main { max-width: 1480px; margin: 0 auto; padding: 28px; }

/* ---------- Setup view ---------- */
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.intro h1 { font-size: 40px; font-weight: 900; }
.intro p { margin: 6px 0 0; color: var(--grey); max-width: 60ch; }

.panel { background: var(--paper); border: 2px solid var(--black); }
.panel > header { background: var(--black); color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.panel > header h2 { font-size: 17px; }
.panel > header .tag { margin-left: auto; font-size: 12px; color: var(--gold); font-weight: 700; }
.panel .body { padding: 16px; }

.meeting { margin-bottom: 24px; }
.meeting .grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .meeting .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .meeting .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 700; color: var(--grey); display: flex; align-items: center; gap: 6px; }
.field input, .field select {
  width: 100%; padding: 9px 10px; border: 2px solid var(--line); background: #fff; border-radius: 0; min-height: 40px;
}
.field input:focus, .field select:focus { border-color: var(--black); outline: none; box-shadow: 0 0 0 3px var(--gold); }
.field input::placeholder { color: #A5A59E; }
.field .hint { font-size: 12px; color: var(--grey); }
.pre { position: relative; }
.pre > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--grey); font-weight: 700; pointer-events: none; }
.pre > input { padding-left: 22px; }
.est { display: inline-block; font-size: 10.5px; font-weight: 800; background: var(--gold); color: #000; padding: 1px 5px; }

.seg { display: inline-flex; border: 2px solid var(--black); }
.seg button { border: 0; background: #fff; padding: 8px 12px; font-weight: 700; cursor: pointer; border-right: 2px solid var(--black); min-height: 40px; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--black); color: var(--gold); }

.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1180px) { .slots { grid-template-columns: 1fr; } }
.slot.empty { border-style: dashed; background: transparent; }
.slot.empty .body { text-align: center; padding: 52px 16px; color: var(--grey); }

.slot .stack { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2px solid var(--black); background: #fff; padding: 4px 10px; font-weight: 700; cursor: pointer; font-size: 13.5px; }
.chip[aria-pressed="true"] { background: var(--black); color: var(--gold); }
.chip.htag { border-style: dashed; border-color: var(--grey); font-weight: 600; }
.chip.htag:hover { background: var(--gold); border-color: var(--black); }

.suggest { border: 2px solid var(--black); background: #fff; max-height: 240px; overflow: auto; }
.suggest button { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.suggest button:hover { background: var(--gold); }
.note { font-size: 12.5px; color: var(--grey); }
.note.warn { color: var(--neg); font-weight: 600; }

details.more { border-top: 2px solid var(--line); padding-top: 10px; }
details.more > summary { cursor: pointer; font-weight: 800; padding: 4px 0; list-style: none; display: flex; justify-content: space-between; }
details.more > summary::after { content: "+"; font-weight: 900; }
details.more[open] > summary::after { content: "–"; }
details.more .inner { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 0 4px; }

.live { background: var(--black); color: #fff; display: grid; grid-template-columns: 1fr 1fr; }
.live > div { padding: 10px 16px; }
.live > div + div { border-left: 1px solid #333; }
.live small { display: block; color: #bdbdb6; font-size: 12px; }
.live b { font-size: 22px; font-weight: 900; }
.live b.neg { color: #ff8f86; }
.live b.pos { color: var(--gold); }

.runbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 26px; flex-wrap: wrap; }
.legal { font-size: 12.5px; color: var(--grey); max-width: 80ch; }

/* ---------- Results ---------- */
.rtop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.rtop h1 { font-size: 34px; font-weight: 900; }
.rtop .who { color: var(--grey); }
.rtop .spacer { flex: 1; }
.tabs { display: flex; gap: 0; border: 2px solid var(--black); background: #fff; position: sticky; top: 74px; z-index: 10; margin-bottom: 24px; }
.tabs button { flex: 1; border: 0; border-right: 2px solid var(--black); background: #fff; padding: 12px 10px; font-weight: 800; font-size: 16px; cursor: pointer; }
.tabs button:last-child { border-right: 0; }
.tabs button[aria-selected="true"] { background: var(--black); color: var(--gold); }

.section { display: none; }
.section.active { display: block; }
.section > h2 { font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.section > .sub { color: var(--grey); margin: 0 0 18px; max-width: 80ch; }

.slabs { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 20px; margin-bottom: 26px; }
@media (max-width: 1000px) { .slabs { grid-template-columns: 1fr; } }
.slab { background: var(--black); color: #fff; }
.slab .head { padding: 16px 18px 12px; border-bottom: 3px solid var(--gold); }
.slab .head h3 { font-size: 19px; }
.slab .head p { margin: 4px 0 0; color: #c9c9c2; font-size: 13.5px; }
.slab .big { padding: 18px 18px 6px; }
.slab .big small { color: #c9c9c2; display: block; font-size: 13px; }
.slab .big b { font-size: 56px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.slab .big b.neg { color: #ff8f86; }
.slab .big b.pos { color: var(--gold); }
.slab .trio { padding: 10px 18px 18px; display: grid; gap: 0; }
.slab .trio div { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid #333; }
.slab .trio span.k { font-weight: 800; color: var(--gold); }
.slab .trio span.d { color: #c9c9c2; font-size: 13px; }
.slab .trio span.v { font-weight: 800; font-size: 17px; }
.slab .trio .best { background: var(--gold); color: #000; margin: 0 -8px; padding: 10px 8px; border-top-color: var(--gold); }
.slab .trio .best span.k, .slab .trio .best span.d { color: #000; }
.slab .badge { margin: 0 18px 16px; }
.slab .checks { padding: 0 18px 18px; display: grid; gap: 6px; font-size: 13px; }
.ck.ok::before { content: "✓ "; color: var(--gold); font-weight: 900; }
.ck.bad { color: #ff8f86; }
.ck.bad::before { content: "! "; font-weight: 900; }

.tablewrap { overflow-x: auto; background: #fff; border: 2px solid var(--black); }
table.cmp { width: 100%; border-collapse: collapse; min-width: 640px; }
table.cmp th, table.cmp td { padding: 9px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; white-space: normal; }
table.cmp thead th { background: var(--black); color: #fff; font-weight: 800; vertical-align: bottom; }
table.cmp thead th small { display: block; font-weight: 500; color: #c9c9c2; }
table.cmp tbody tr.grp th { background: var(--gold); color: #000; text-align: left; font-size: 14px; padding: 7px 14px; }
table.cmp td.best { background: #FFF3C4; font-weight: 800; }
table.cmp td.neg { color: var(--neg); }
table.cmp td .est { margin-left: 6px; }
table.cmp tr.total td, table.cmp tr.total th { border-top: 2px solid var(--black); font-weight: 900; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.card { background: #fff; border: 2px solid var(--black); padding: 16px; }
.card h3 { font-size: 17px; margin-bottom: 10px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.legend i { display: inline-block; width: 26px; height: 0; border-top: 4px solid; vertical-align: middle; margin-right: 6px; }
svg.chart text { font-family: var(--font); font-size: 12px; fill: var(--grey); }
.callout { border-left: 8px solid var(--gold); background: #fff; padding: 12px 16px; margin: 0 0 18px; }
.callout b { font-weight: 800; }

.fine { font-size: 12px; color: var(--grey); margin-top: 24px; max-width: 110ch; }

/* ---------- Cover (print only) ---------- */
.cover { display: none; }

/* ---------- Print / PDF ---------- */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: #fff; font-size: 11.5px; }
  .bar, .tabs, .rtop .btnrow, .no-print, #setup { display: none !important; }
  main { padding: 0; max-width: none; }
  .cover { display: flex; flex-direction: column; justify-content: space-between; background: var(--black); color: #fff; height: 186mm; padding: 16mm; page-break-after: always; }
  .cover img { height: 38mm; }
  .cover h1 { font-size: 40pt; font-weight: 900; line-height: 1; }
  .cover h1 em { font-style: normal; color: var(--gold); }
  .cover .meta { color: #d4d4cc; font-size: 12pt; }
  .cover .rule { height: 3px; background: var(--gold); width: 60mm; margin: 6mm 0; }
  .rtop { display: none; }
  .section { display: block !important; page-break-after: always; break-after: page; }
  .section:last-of-type { page-break-after: auto; }
  .slab .big b { font-size: 36pt; }
  .card, .tablewrap, .slab, .callout { break-inside: avoid; }
  .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .slabs { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
  table.cmp { min-width: 0; font-size: 10.5px; }
  table.cmp th, table.cmp td { padding: 5px 8px; }
  .section > h2 { font-size: 20pt; }
}

.card table.cmp th, .card table.cmp td { white-space: normal; }
table.cmp.compact th, table.cmp.compact td { padding: 6px 8px; font-size: 13px; white-space: nowrap; }
svg.chart { max-height: 360px; }
.growth-two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

@media print {
  .section > h2 { font-size: 18pt; margin-bottom: 1mm; }
  .section > .sub { margin: 0 0 4mm; font-size: 10.5px; }
  .slab .head { padding: 10px 14px 8px; }
  .slab .big { padding: 10px 14px 2px; }
  .slab .big b { font-size: 30pt; }
  .slab .trio { padding: 4px 14px 8px; }
  .slab .trio div { padding: 6px 0; }
  .slabs { margin-bottom: 4mm; gap: 4mm; }
  #sec-overview .tablewrap { break-before: page; }
  table.cmp { font-size: 9px; }
  table.cmp th, table.cmp td { padding: 2.5px 8px; }
  table.cmp tbody tr.grp th { padding: 3px 8px; font-size: 9.5px; }
  table.cmp.compact th, table.cmp.compact td { padding: 2.5px 5px; font-size: 9px; }
  svg.chart { max-height: 58mm; }
  .card { padding: 10px; }
  .callout { padding: 6px 12px; margin-bottom: 4mm; }
  .legend { font-size: 10px; margin-top: 2px; }
  .card h3 { font-size: 12px; margin-bottom: 6px; }
  .two { gap: 4mm; }
  #sec-cash .card[style] { margin-top: 4mm !important; }
}
