/* tradeshow.one. Light and dark from the same tokens; all text ≥ 4.5:1. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #17202b;
  --muted: #586474;
  --border: #c9d1dc;
  --border-strong: #7b8797; /* 3:1 on surface for inputs (WCAG 1.4.11) */
  --accent: #0b5cad;
  --accent-text: #ffffff;
  --focus: #0b5cad;
  --overdue: #a8200d;
  --overdue-bg: #fdecea;
  --soon: #8a5300;
  --soon-bg: #fff4dc;
  --done: #1d6b35;
  --done-bg: #e5f4ea;
  --tbd: #4b5563;
  --tbd-bg: #eceff3;
  --considering-bg: #efe9fb;
  --considering: #5b3aa0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a;
    --surface: #171e27;
    --surface-2: #1f2833;
    --text: #e6ebf1;
    --muted: #a3afbe;
    --border: #2d3846;
    --border-strong: #7d8a9b;
    --accent: #6cb0ff;
    --accent-text: #08131f;
    --focus: #8cc2ff;
    --overdue: #ff9c8c;
    --overdue-bg: #3a1813;
    --soon: #f5c46a;
    --soon-bg: #33260c;
    --done: #7fd59a;
    --done-bg: #12301c;
    --tbd: #c3ccd7;
    --tbd-bg: #262f3a;
    --considering-bg: #2a2342;
    --considering: #c9b5ff;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; margin-top: 1rem; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
code.url { word-break: break-all; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 20; background: var(--surface); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Sticky header must not hide the focused element (WCAG 2.4.11). */
html { scroll-padding-top: 80px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-wrap; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 1200px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 8px 20px; align-items: center; flex-wrap: wrap; }
.brand { display: flex; gap: 8px; align-items: center; color: var(--text); text-decoration: none; min-height: 44px; }
.brand-mark { color: var(--accent); font-size: 1.2rem; }
.brand-sub { color: var(--muted); font-size: .85rem; margin-left: 4px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
nav a:hover { background: var(--surface-2); }
nav a[aria-current="page"] { background: var(--surface-2); font-weight: 600; box-shadow: inset 0 -3px 0 var(--accent); }
.count { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 7px; font-size: .78rem; font-weight: 700; }
.search { margin-left: auto; flex: 1 1 220px; max-width: 320px; }
.search input { width: 100%; }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 80px; outline: none; }
.page-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { margin: 0 0 6px; }
.empty { padding: 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* forms and buttons */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; min-height: 40px; max-width: 100%;
}
input[type="checkbox"] { min-height: 0; width: 20px; height: 20px; accent-color: var(--accent); }
textarea { width: 100%; resize: vertical; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 8px 14px; min-height: 40px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none; display: inline-flex; align-items: center;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--overdue); border-color: var(--overdue); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn:disabled { opacity: .55; cursor: default; }
.link-btn { font: inherit; font-weight: 700; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 6px 8px; min-height: 32px; }
.icon-btn {
  font: inherit; cursor: pointer; background: none; border: 1px solid transparent; color: var(--muted);
  min-width: 32px; min-height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-left: 4px;
}
.icon-btn:hover { border-color: var(--border); color: var(--text); background: var(--surface-2); }
.icon-btn.edit { flex: none; }
label.inline { display: inline-flex; gap: 6px; align-items: center; margin-right: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

.edit-form { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 8px 0; }
.edit-form h3 { margin-top: 0; }
.edit-form .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9rem; }
.field input:not([type="checkbox"]), .field select { width: 100%; }
.check-field { flex-direction: row; align-items: center; gap: 8px; align-self: end; min-height: 40px; }
.check-field label { font-weight: 500; }
.hint { color: var(--muted); font-size: .85rem; margin: 4px 0; }
.form-error { color: var(--overdue); font-weight: 600; min-height: 0; margin: 8px 0 0; }
.form-error:empty { display: none; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* panels and cards */
.panel, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 16px; margin: 16px 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-head h2 { margin: 0 0 8px; }
details.panel > summary, details.sub > summary { cursor: pointer; font-weight: 600; min-height: 32px; display: list-item; }
details.sub { margin-top: 10px; }
.callout.overdue { border-color: var(--overdue); background: var(--overdue-bg); padding: 12px; border-radius: var(--radius); }
.callout.overdue h2, .callout.overdue h3 { color: var(--overdue); margin-top: 0; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.show-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.show-card h2 { margin: 0; font-size: 1.1rem; }
.show-card h2 a { color: var(--text); text-decoration: none; }
.show-card h2 a:hover { text-decoration: underline; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.when, .where { margin: 0; }
.when.big { font-size: 1.05rem; }
.card-links { margin: 6px 0 0; border-top: 1px solid var(--border); padding-top: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 0; }

.facts { margin: 8px 0 0; display: grid; gap: 8px 16px; }
.facts.cols { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.facts > div.wide { grid-column: 1 / -1; }
.facts dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.show-card .facts { grid-template-columns: 1fr; gap: 6px; }

.pill { display: inline-flex; align-items: center; gap: 2px; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); white-space: nowrap; }
.pill-confirmed { background: var(--done-bg); color: var(--done); border-color: transparent; }
.pill-considering { background: var(--considering-bg); color: var(--considering); border-color: transparent; }
.pill-archived { background: var(--tbd-bg); color: var(--tbd); border-color: transparent; }
.st-overdue { background: var(--overdue-bg); color: var(--overdue); border-color: var(--overdue); }
.st-soon { background: var(--soon-bg); color: var(--soon); border-color: transparent; }
.st-done { background: var(--done-bg); color: var(--done); border-color: transparent; }
.st-tbd, .st-skipped { background: var(--tbd-bg); color: var(--tbd); border-color: transparent; }
.st-open { background: var(--surface-2); }
.st-check { background: var(--tbd-bg); color: var(--tbd); border-color: var(--border-strong); border-style: dashed; }
.tag-est { font-style: normal; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tbd); border: 1px dashed var(--border-strong); border-radius: 4px; padding: 0 5px; margin-right: 4px; }
.copy-btn { font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; margin-left: 6px; padding: 2px 8px; min-height: 26px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); vertical-align: middle; }
.copy-btn:hover { background: var(--surface-2); }
.strip { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 8px 0 4px; }
.strip-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.month h3 { margin: 14px 0 4px; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.panel.quiet { box-shadow: none; background: transparent; }

/* deadlines */
.dl-list { list-style: none; padding: 0; margin: 0; }
.dl-list > li { border-top: 1px solid var(--border); }
.dl-list > li:first-child { border-top: 0; }
.dl, .dl-wrap > .dl { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.dl-wrap { display: flex; align-items: flex-start; gap: 4px; }
.dl-wrap > .dl { flex: 1; }
.dl-wrap > .icon-btn { margin-top: 8px; }
.dl-main { flex: 1; min-width: 0; }
.dl-title { font-weight: 600; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.dl-show { font-weight: 700; }
.dl-show::after { content: " ·"; color: var(--muted); }
.dl-meta { font-size: .88rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.amount { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.est { font-style: italic; }
abbr { text-decoration: underline dotted; cursor: help; }
.st-row-done .dl-title > span, .st-row-skipped .dl-title > span { text-decoration: line-through; color: var(--muted); }
.check {
  flex: none; width: 28px; height: 28px; margin-top: 2px; border-radius: 6px; border: 2px solid var(--border-strong);
  background: var(--surface); color: var(--done); font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.check.on { background: var(--done-bg); border-color: var(--done); }
.check:hover { border-color: var(--accent); }

/* show page */
.show-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 20px; align-items: start; }
.links, .plain { list-style: none; padding: 0; margin: 0; }
.link-row, .contact, .staff-row { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.links > li:first-child, .plain > li:first-child { border-top: 0; }
.link-main { min-width: 0; }
.link-main strong { display: block; overflow-wrap: anywhere; }
.link-meta { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; margin-top: 2px; }
.kind { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.contact-links { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.contact-links a { min-height: 28px; display: inline-flex; align-items: center; overflow-wrap: anywhere; }
.staff-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; margin-top: 4px; align-items: center; }
.history li { padding: 4px 0; font-size: .9rem; }

/* inbox */
.sugs { display: grid; gap: 14px; }
.sug { padding: 14px 16px; }
.sug-head { display: flex; gap: 10px; align-items: center; }
.warn { color: var(--soon); background: var(--soon-bg); padding: 6px 10px; border-radius: 6px; font-weight: 600; }
.diff { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .92rem; }
.diff th, .diff td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.diff thead th { font-size: .78rem; text-transform: uppercase; color: var(--muted); }
.diff tbody th { width: 28%; font-weight: 600; }
del { color: var(--overdue); }
ins { text-decoration: none; background: var(--done-bg); color: var(--done); padding: 0 3px; border-radius: 3px; font-weight: 600; }
.source { font-size: .85rem; color: var(--muted); }

.feed { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.results li { padding: 8px 0; border-top: 1px solid var(--border); }

/* login */
.login { max-width: 380px; margin: 10vh auto; padding: 28px; display: flex; flex-direction: column; gap: 6px; }
.login label { font-weight: 600; margin-top: 8px; }
.login .btn { margin-top: 16px; justify-content: center; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px);
}
.toast.error { background: var(--overdue); color: #fff; }
.toast:not(.show) { display: none; }

@media (max-width: 860px) {
  .show-grid { grid-template-columns: 1fr; }
  .search { max-width: none; margin-left: 0; flex-basis: 100%; }
  .brand-sub { display: none; }
  /* Show floor: bigger targets. */
  .icon-btn { min-width: 44px; min-height: 44px; }
  .check { width: 32px; height: 32px; }
  .copy-btn { min-height: 36px; padding: 4px 12px; }
  .btn { min-height: 44px; }
}
@media (max-width: 520px) {
  h1 { font-size: 1.35rem; }
  nav a { padding: 8px 10px; }
  .panel { padding: 12px; }
  .diff tbody th { width: auto; }
}
