/* Portal additions on top of twit.au's own site.css (same tokens, same "Leading Hand" look). */
body.portal { font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
.portal main { flex: 1; outline: none; }
.portal footer a { color: var(--hero-muted); }

/* header */
.brand { display: flex; align-items: center; gap: 12px; }
.tag, .chip { display: inline-block; font: 500 12px/1 var(--mono); letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 8px; border-radius: 6px; border: 1px solid var(--field); color: var(--ink); white-space: nowrap; }
.tag { color: var(--hero-label); border-color: var(--hero-label); }
.portal nav { font-size: 15px; gap: 22px; }
.portal nav a.current { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 3px; text-underline-offset: 9px; opacity: 1; }
.who { font-size: 14px; color: var(--hero-muted); }

/* page layout */
.page { padding-top: 40px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 40px; }
.page.narrow { max-width: 880px; }
.page h1 { font-size: 44px; line-height: 1.1; letter-spacing: -1px; }
.page h2 { font-size: 28px; line-height: 1.15; }
.page h3 { font-size: 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.spread { justify-content: space-between; align-items: baseline; }
.cols { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.cols > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.cols > .side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.back { font-size: 15px; }
.small-text { font-size: 14px; }
.lede { font-size: 18px; }

/* navy band under the header */
.pband { background: var(--hero); color: var(--hero-ink); }
.pband .wrap { padding-top: 40px; padding-bottom: 52px; display: flex; flex-direction: column; gap: 20px; }
.pband .label { color: var(--hero-label); }
.pband h1 { font-size: 48px; line-height: 1.1; letter-spacing: -1px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding-top: 4px; }
.stat { border-top: 2px solid var(--mark); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.stat .k { font: 500 12px/1.4 var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--hero-muted); }
.stat .v { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat .s { font-size: 14px; color: var(--hero-muted); }

/* boxes */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.box.hot { border-color: var(--accent); }
.box.navy { border-color: var(--hero); }
.box.quiet { background: var(--band); border-color: var(--band); }
.box .label { font-size: 13px; }

/* chips */
.chip.you { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.terry { background: var(--band); border-color: var(--band); }
.chip.done { background: var(--hero); border-color: var(--hero); color: var(--hero-ink); }
.urg-high { color: var(--label); font-weight: 700; }

/* tables */
.tablebox { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.portal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.portal th { font: 500 12px/1.4 var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: left;
  padding: 10px 12px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.portal td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.portal tr:last-child td { border-bottom: none; }
.portal td .sub { font-size: 13px; color: var(--muted); padding-top: 4px; }
.mono { font-family: var(--mono); }
.empty { color: var(--muted); padding: 16px 0; }

/* buttons and choices */
.portal .btn { font-size: 16px; padding: 10px 22px; }
.portal .btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.light { background: transparent; color: var(--hero-ink); border-color: var(--hero-ink); }
.linkish { all: unset; cursor: pointer; text-decoration: underline; font-size: 15px; }
.linkish:focus-visible { outline: 3px solid var(--hero-label); }
.picks { display: flex; flex-wrap: wrap; gap: 10px; border: none; padding: 0; margin: 0; }
.picks legend { font-weight: 700; padding: 0 0 8px; }
.pick { position: relative; }
.pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; min-height: 0; }
.pick span { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--field);
  background: var(--surface); font-weight: 600; font-size: 15px; cursor: pointer; box-sizing: border-box; }
.pick input:checked + span { background: var(--hero); border-color: var(--hero); color: var(--hero-ink); }
.pick.red input:checked + span { background: var(--accent); border-color: var(--accent); }
.pick input:focus-visible + span { outline: 3px solid var(--hero-label); outline-offset: 1px; }
.portal nav.tabs { display: flex; flex-wrap: wrap; gap: 0; font-size: 16px; }
.portal nav.tabs a { opacity: 1; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px; border: 1px solid var(--field); margin-left: -1px;
  background: var(--surface); font-weight: 600; text-decoration: none; }
.tabs a:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.tabs a:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.tabs a[aria-current="page"] { background: var(--hero); border-color: var(--hero); color: var(--hero-ink); position: relative; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { cursor: pointer; background: transparent; font: 500 12px/1 var(--mono); }
.filters button[aria-pressed="true"] { background: var(--hero); border-color: var(--hero); color: var(--hero-ink); }

/* forms */
.portal form { display: flex; flex-direction: column; gap: 20px; }
.portal .field label, .portal .field .lbl { font-weight: 700; font-size: 16px; }
.portal .field .hint { font-size: 14px; color: var(--muted); }
.portal input, .portal textarea, .portal select { font-size: 16px; width: 100%; box-sizing: border-box; }
.portal select { font: inherit; padding: 10px 12px; border: 1px solid var(--field); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-height: 44px; }
.portal input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); flex: none; margin: 2px 0 0; }
.portal input[type="file"] { border-style: dashed; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }

/* item page */
.msg { display: flex; flex-direction: column; gap: 6px; padding: 16px 0; border-top: 1px solid var(--line); }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.event { font: 500 13px/1.5 var(--mono); color: var(--muted); padding: 12px 0; border-top: 1px solid var(--line); }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.shots { display: flex; flex-wrap: wrap; gap: 12px; }
.shots img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.trail { display: flex; flex-direction: column; }
.trail .step { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding-bottom: 16px; }
.trail .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--hero); margin-top: 5px; }
.trail .dot.now { background: var(--accent); }
.trail .dot.todo { background: var(--surface); border: 2px solid var(--field); box-sizing: border-box; }
.trail .step:last-child { padding-bottom: 0; }
.trail p { font-size: 14px; color: var(--muted); }
.plist > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.plist > div:first-child { border-top: none; }

.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--band); }
.notice.err { background: #F6DEDA; color: var(--ink); }

@media (max-width: 700px) {
  .page h1, .pband h1 { font-size: 34px; }
  /* Tables become stacked cards on a phone */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; }
  .portal .rtable tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .portal .rtable tr:last-child { border-bottom: none; }
  .portal .rtable td { border: none; padding: 4px 0; display: flex; gap: 12px; align-items: baseline; }
  .portal .rtable td::before { content: attr(data-label); font: 500 12px/1.4 var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); min-width: 96px; flex: none; }
  .portal .rtable td.go::before { content: none; }
  .page { padding-top: 28px; gap: 32px; }
  .who { display: none; }
}
