/* ------------------------------------------------------------------
   FACTS conference platform prototype

   The organising idea is a ledger that shows its work: charges are
   ruled rows, and rules that were refused are annotations in the
   margin rather than silence. Colour carries meaning here and is not
   used for decoration.
   ------------------------------------------------------------------ */

:root {
  --ink:        #16222b;
  --ink-soft:   #4a5a63;
  --ink-faint:  #7b8890;
  --paper:      #f7f7f3;
  --surface:    #ffffff;
  --rule:       #e0e1da;
  --rule-firm:  #c6c8be;
  --accent:     #0e6e63;
  --accent-dim: #e2efec;
  --credit:     #2a6b41;
  --credit-dim: #e8f1e9;
  --refused:    #9b3a2c;
  --refused-dim:#f6e9e6;
  --held:       #8a6314;
  --held-dim:   #f6efe0;

  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }

.lede { font-size: 17px; color: var(--ink-soft); max-width: 62ch; margin: 0 0 28px; }

/* ---- prototype strip ---------------------------------------------- */

.proto {
  background: var(--ink);
  color: #dfe4e6;
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  padding: 9px 20px;
  font-size: 13px;
}
.proto p { margin: 0; }
.proto-toggle {
  background: none;
  border: 1px solid #4a5a63;
  border-radius: 2px;
  color: #dfe4e6;
  font: inherit;
  padding: 2px 9px;
  cursor: pointer;
}
.proto-toggle:hover { border-color: #9aa7ac; }

.proto-panel { background: #1e2c36; color: #cfd7da; }
.proto-panel-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  font-size: 13.5px;
}
.proto-panel h2 { color: #fff; font-size: 15px; margin-bottom: 8px; }
.proto-panel ul { margin: 0; padding-left: 18px; }
.proto-panel li { margin-bottom: 5px; }

/* ---- masthead ------------------------------------------------------ */

.masthead { background: var(--surface); border-bottom: 1px solid var(--rule-firm); }
.masthead-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px 0;
}
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.brand-meta { color: var(--ink-faint); font-size: 13px; }

.nav { display: flex; gap: 22px; margin-top: 14px; overflow-x: auto; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 0 10px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 14px;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- page shell ---------------------------------------------------- */

.page { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }
.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 48px;
  color: var(--ink-faint);
  font-size: 13px;
}
.foot p { margin: 0 0 4px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 40px; align-items: start; }

/* ---- form ---------------------------------------------------------- */

.field { margin-bottom: 20px; }
.field > label, .group-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.hint { color: var(--ink-faint); font-size: 13px; margin: 3px 0 0; }

input[type="text"], input[type="email"], input[type="date"], input[type="number"], select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-firm);
  border-radius: 2px;
  padding: 8px 10px;
}
input:hover, select:hover { border-color: var(--ink-faint); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--rule-firm);
  border-radius: 2px;
  background: var(--surface);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 14px;
}
.choice input { margin: 0; accent-color: var(--accent); }
.choice:hover { border-color: var(--ink-faint); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }

.addon-list { border-top: 1px solid var(--rule); }
.addon {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.addon input { margin: 3px 0 0; accent-color: var(--accent); }
.addon-note { display: block; color: var(--ink-faint); font-size: 13px; }

.codes { display: flex; flex-direction: column; gap: 8px; }
.code-row { display: flex; gap: 8px; }
.code-row input { text-transform: uppercase; }
.linkish {
  background: none; border: none; padding: 0;
  color: var(--accent); font: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
  align-self: flex-start;
}
.remove {
  border: 1px solid var(--rule-firm); background: var(--surface);
  border-radius: 2px; width: 34px; flex: 0 0 34px; cursor: pointer;
  color: var(--ink-soft); font-size: 16px; line-height: 1;
}
.remove:hover { border-color: var(--refused); color: var(--refused); }

/* ---- the ledger ---------------------------------------------------- */

.ledger {
  background: var(--surface);
  border: 1px solid var(--rule-firm);
  border-radius: 2px;
  position: sticky;
  top: 16px;
}
.ledger-head {
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--rule-firm);
}
.ledger-head h2 { margin: 0; font-size: 17px; }
.ledger-head p { margin: 3px 0 0; color: var(--ink-faint); font-size: 13px; }

.ledger-body { padding: 4px 18px 0; }

.entry { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.entry:last-child { border-bottom: none; }
.entry-line { display: flex; gap: 14px; align-items: baseline; justify-content: space-between; }
.entry-title { font-size: 14px; }
.entry-amount {
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  white-space: nowrap;
}
.entry-detail { color: var(--ink-soft); font-size: 12.5px; margin: 3px 0 0; max-width: 46ch; }

.entry--note {
  border-bottom: none;
  padding: 12px 0 8px;
}
.entry--note .entry-title { font-family: var(--serif); font-style: italic; font-size: 14.5px; }

.entry--discount .entry-title { color: var(--credit); }
.entry--discount .entry-amount { color: var(--credit); }

.entry--skipped, .entry--blocked {
  margin: 0 -18px;
  padding: 10px 18px 10px 14px;
  border-left: 4px solid transparent;
}
.entry--skipped { background: var(--held-dim); border-left-color: var(--held); }
.entry--blocked { background: var(--refused-dim); border-left-color: var(--refused); }
.entry--skipped .entry-title { color: var(--held); }
.entry--blocked .entry-title { color: var(--refused); }
.entry--skipped .entry-title s, .entry--blocked .entry-title s { text-decoration-thickness: 1px; }
.entry--skipped .entry-detail, .entry--blocked .entry-detail { color: inherit; opacity: .95; }

.ledger-total {
  border-top: 2px solid var(--ink);
  margin-top: 2px;
  padding: 14px 18px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.ledger-total .label { font-family: var(--serif); font-size: 16px; }
.ledger-total .value {
  font-family: var(--serif);
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}
.ledger-sub {
  padding: 12px 18px 14px;
  color: var(--ink-faint);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
}
.ledger.is-busy { opacity: .55; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 2px;
  font: inherit;
  padding: 9px 18px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #0b5a51; }
.btn--quiet { background: var(--surface); color: var(--ink); border-color: var(--rule-firm); }
.btn--quiet:hover { background: var(--paper); border-color: var(--ink-faint); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- tables -------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--rule-firm);
  border-radius: 2px;
  padding: 20px 22px;
  margin-bottom: 26px;
}
.card > h2 { margin-top: 0; }
.card > p:first-of-type { margin-top: 0; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
table.grid th { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); border-bottom-color: var(--rule-firm); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid input[type="number"] { width: 86px; padding: 5px 7px; text-align: right; }
table.grid select { min-width: 152px; padding: 5px 7px; }
table.grid th.ctr { text-align: center; border-bottom-color: var(--rule); }
.rowhead { font-weight: 600; }

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 2px;
  border: 1px solid;
}
.tag--auto    { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.tag--dead    { color: var(--refused); border-color: var(--refused); background: var(--refused-dim); }
.tag--comp    { color: var(--held); border-color: var(--held); background: var(--held-dim); }

/* ---- try-these list ------------------------------------------------ */

.scenarios { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.scenarios li {
  border-bottom: 1px solid var(--rule);
  padding: 13px 0 13px 34px;
  position: relative;
  counter-increment: s;
}
.scenarios li:last-child { border-bottom: none; }
.scenarios li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 13px;
  font-family: var(--serif);
  color: var(--ink-faint);
  font-size: 14px;
}
.scenarios strong { font-weight: 600; }
.scenarios p { margin: 3px 0 0; color: var(--ink-soft); font-size: 13.5px; }
code {
  font-family: var(--sans);
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 5px;
  font-size: 13px;
}

/* ---- exhibitor portal ---------------------------------------------- */

.portal-head {
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
  margin-bottom: 26px;
}
.dial { flex: 0 0 auto; }
.dial-figure { font-family: var(--serif); font-size: 22px; }

.tasks { list-style: none; margin: 0; padding: 0; }
.task {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}
.task:last-child { border-bottom: none; }
.mark {
  width: 16px; height: 16px; margin-top: 3px;
  border: 1px solid var(--rule-firm); border-radius: 2px;
  background: var(--surface);
}
.task--done .mark { background: var(--credit); border-color: var(--credit); }
.task--done .mark::after {
  content: ""; display: block; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); margin: 2px auto;
}
.task--overdue .mark { border-color: var(--refused); border-width: 2px; }
.task--partial .mark { background: linear-gradient(90deg, var(--credit) 66%, var(--surface) 66%); border-color: var(--credit); }
.task--locked .mark { background: var(--paper); border-style: dashed; }
.task-title { font-weight: 600; font-size: 14.5px; }
.task--done .task-title { font-weight: 400; color: var(--ink-soft); }
.task-detail { color: var(--ink-soft); font-size: 13px; margin: 2px 0 0; }
.task-due { font-size: 12.5px; margin: 4px 0 0; color: var(--ink-faint); }
.task--overdue .task-due { color: var(--refused); font-weight: 600; }
.task-action { white-space: nowrap; }
.task-action .btn { padding: 6px 13px; font-size: 13.5px; }

/* ---- reports ------------------------------------------------------- */

.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule-firm); }
.fig { background: var(--surface); padding: 15px 18px; }
.fig .value { font-family: var(--serif); font-size: 25px; font-variant-numeric: tabular-nums; display: block; }
.fig .label { color: var(--ink-soft); font-size: 13px; }
.fig .delta { font-size: 12.5px; color: var(--credit); }

.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.swatch { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: baseline; }

/* ---- responsive ---------------------------------------------------- */

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
  .ledger { position: static; }
  .proto-panel-inner { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 560px) {
  .page { padding: 24px 16px 48px; }
  .masthead-inner, .foot, .proto-panel-inner { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 25px; }
  .task { grid-template-columns: 22px minmax(0, 1fr); }
  .task-action { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- task screens --------------------------------------------------- */

.crumb { font-size: 13.5px; color: var(--ink-faint); margin: 0 0 4px; }

.split-wide { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 32px; align-items: start; }
.side .card { padding: 16px 18px; margin-bottom: 16px; }
.side h3 { font-size: 14.5px; }
.side p { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-soft); }
.side p:last-child { margin-bottom: 0; }

.notice { border: 1px solid; border-radius: 2px; padding: 14px 18px; margin-bottom: 22px; }
.notice h2 { font-size: 15px; margin: 0 0 6px; }
.notice p { margin: 0; }
.notice ul { margin: 0; padding-left: 18px; }
.notice--bad  { border-color: var(--refused); background: var(--refused-dim); color: var(--refused); }
.notice--good { border-color: var(--credit); background: var(--credit-dim); }

textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-firm); border-radius: 2px; padding: 9px 11px;
  resize: vertical; line-height: 1.5;
}
textarea:hover { border-color: var(--ink-faint); }
.overlimit { color: var(--refused); font-weight: 600; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.reqs { margin: 0 0 18px; padding-left: 18px; color: var(--ink-soft); font-size: 14px; }
.reqs li { margin-bottom: 4px; }

.drop {
  border: 1.5px dashed var(--rule-firm);
  border-radius: 2px;
  background: var(--paper);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-dim); }
.drop-main { margin: 0; font-weight: 600; font-size: 15px; }
.drop-sub { margin: 3px 0 0; color: var(--ink-faint); font-size: 13px; }

.filerow {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  border-bottom: 1px solid var(--rule); padding: 12px 0 8px; font-size: 14px;
}
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.preview {
  border: 1px solid var(--rule-firm); border-radius: 2px;
  height: 128px; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.preview--light { background: #fff; }
.preview--dark  { background: #16222b; }
.preview img { max-width: 100%; max-height: 96px; display: block; }

/* ---- floor plan ----------------------------------------------------- */

.planwrap { overflow-x: auto; }
.plan { width: 100%; min-width: 620px; height: auto; display: block; }
.booth { cursor: pointer; }
.booth rect { transition: fill .12s ease; }
.booth:hover rect { fill: var(--accent-dim); }
.booth--mine:hover rect { fill: var(--accent); }
.booth:focus-visible rect { stroke-width: 3; }
.booth:focus { outline: none; }
.chosen { font-family: var(--serif); font-size: 16px; margin: 14px 0 18px; }

/* ---- signed document ------------------------------------------------ */

.doc { border: 1px solid var(--rule); background: var(--paper); padding: 22px 24px; margin-bottom: 18px; }
.doc-title { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.doc p { font-size: 14px; color: var(--ink-soft); max-width: 66ch; }
.doc-sig { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 24px; }
.doc-hand {
  display: block; font-family: var(--serif); font-style: italic; font-size: 21px;
  padding-bottom: 4px; border-bottom: 1px solid var(--rule-firm); margin-bottom: 5px;
}
.doc-line { font-size: 12.5px; color: var(--ink-faint); }

@media (max-width: 900px) {
  .split-wide { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pair, .previews, .doc-sig { grid-template-columns: 1fr; }
}
