/* COI Desk. The screen borrows the certificate's own material: white form paper ruled in the blue
   that liability certificates are printed in, small-caps box labels, policy numbers and dollars in a
   typewriter face, and the one thing a desk adds to a form: the rubber stamp. READY, HOLD and
   ISSUED are stamped, slightly off square, in stamp ink. */

:root {
  color-scheme: light;

  --desk: #eef1f5;
  --paper: #ffffff;
  --paper-2: #f7f8fa;
  --rule: #b8c4d4;
  --rule-soft: #d9e0e9;
  --form-blue: #1d4f91;
  --ink: #16202b;
  --ink-2: #4a5663;
  --ink-3: #74808c;
  --stamp-red: #b3261e;
  --stamp-green: #2f6b3a;
  --stamp-blue: #1d4f91;
  --hold-pale: #fbeae8;
  --ready-pale: #e4f0e6;
  --amber: #8a5a00;
  --amber-pale: #fbf1dc;
  --focus: #d97706;

  --display: "Charter", "Cambria", "Iowan Old Style", "Georgia", "Times New Roman", serif;
  --text: "Segoe UI Variable Text", "Segoe UI", "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SF Mono", "Menlo", ui-monospace, monospace;
  --stamp-face: "Impact", "Haettenschweiler", "Arial Narrow", "Franklin Gothic Medium", sans-serif;

  --radius: 3px;
  --shadow: 0 1px 2px rgb(22 32 43 / 0.06), 0 10px 24px rgb(22 32 43 / 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--form-blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: 12px; top: -60px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--form-blue); z-index: 10; }
.skip:focus { top: 12px; }

.mono { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; }
a, button, .btn { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
td { overflow-wrap: anywhere; }
th { white-space: nowrap; }
.muted { color: var(--ink-3); }

/* the bar */
.bar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 10px 24px;
  background: var(--paper);
  border-bottom: 2px solid var(--form-blue);
}
.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 14px; height: 14px; align-self: center; border: 2px solid var(--form-blue); background: repeating-linear-gradient(to bottom, transparent 0 3px, var(--rule) 3px 4px); }
.brand-name { font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.01em; }
.brand-agency { color: var(--ink-3); font-size: 0.9rem; }
.bar nav { display: flex; gap: 4px; }
.bar nav a { padding: 6px 10px; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; }
.bar nav a:hover { background: var(--paper-2); color: var(--ink); }
.bar nav a[aria-current="page"] { color: var(--form-blue); box-shadow: inset 0 -2px 0 var(--form-blue); }
.bar-clock { margin: 0 0 0 auto; color: var(--ink-3); font-size: 0.85rem; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 24px 56px; }
main:focus { outline: none; }

.page-title { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.15; margin: 8px 0 18px; letter-spacing: -0.005em; }
.section-title {
  font-family: var(--text); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); margin: 28px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--rule);
}
.section-gaps { color: var(--stamp-red); border-color: var(--stamp-red); }

.note { margin: 0 0 16px; padding: 10px 14px; border: 1px solid; border-radius: var(--radius); background: var(--paper); }
.note-ok { border-color: var(--stamp-green); color: var(--stamp-green); }
.note-bad { border-color: var(--stamp-red); color: var(--stamp-red); background: var(--hold-pale); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 8px; }
.tile { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px 10px; display: flex; flex-direction: column; min-height: 92px; }
.tile-value { font-family: var(--display); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-top: 6px; }
.tile-sub { font-size: 0.82rem; color: var(--ink-3); margin-top: 4px; }
.tile-ready .tile-value { color: var(--stamp-green); }
.tile-hold .tile-value { color: var(--stamp-red); }

/* the ledger */
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.ledger { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.93rem; }
.ledger th, .ledger td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.ledger thead th { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover td { background: #fbfcfd; }
.req-link { font-family: var(--mono); font-weight: 600; }
.what { display: block; font-size: 0.82rem; color: var(--ink-3); margin-top: 4px; max-width: 28ch; }
.empty { background: var(--paper); border: 1px dashed var(--rule); padding: 28px; text-align: center; color: var(--ink-2); }

/* the stamp: the one thing a desk adds to a form */
.stamp {
  display: inline-block;
  font-family: var(--stamp-face);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 3px 7px 2px 8px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--paper), inset 0 0 0 2px currentColor;
  transform: rotate(-4deg);
  opacity: 0.88;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 55%, rgb(0 0 0 / 0.75) 100%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 55%, rgb(0 0 0 / 0.75) 100%);
}
.stamp-small { font-size: 0.8rem; }
.stamp-large { font-size: 1.9rem; padding: 6px 14px 4px 16px; transform: rotate(-7deg); border-width: 3px; box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 4px currentColor; }
.stamp-ready { color: var(--stamp-green); }
.stamp-hold { color: var(--stamp-red); }
.stamp-issued { color: var(--stamp-blue); }

/* request page */
.crumbs { font-size: 0.85rem; margin-top: 4px; }
.req-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 8px; }
.req-head .page-title { margin-bottom: 4px; }
.req-meta { margin: 0; color: var(--ink-2); }
.columns { display: grid; grid-template-columns: minmax(280px, 5fr) minmax(360px, 7fr); gap: 28px; align-items: start; }
.letter {
  margin: 0; padding: 18px 20px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--mono); font-size: 0.84rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
}
.found { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 4px 16px; }
.found p { margin: 10px 0; }

.gaps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gap { background: var(--paper); border: 1px solid var(--stamp-red); border-left-width: 6px; border-radius: var(--radius); padding: 12px 16px; }
.gap-title { font-family: var(--display); font-weight: 400; font-size: 1.1rem; margin: 0 0 6px; }
.gap-detail { margin: 0 0 8px; }
.gap-fix { margin: 0; color: var(--ink-2); }
.fix-label { display: inline-block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stamp-red); margin-right: 6px; }

.coverage { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 10px; }
.coverage-gap { border-color: var(--stamp-red); }
.coverage-head { padding: 10px 14px 8px; border-bottom: 1px solid var(--rule-soft); }
.coverage-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.coverage-policy { margin: 2px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.coverage-none { color: var(--stamp-red); }
.limits { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.limits th, .limits td { text-align: left; padding: 6px 14px; border-bottom: 1px solid var(--rule-soft); font-weight: 400; }
.limits thead th { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.limits td.mono { text-align: right; width: 9em; }
.limits tbody tr:last-child th, .limits tbody tr:last-child td { border-bottom: 0; }
.limit-short td:last-child { color: var(--stamp-red); font-weight: 600; background: var(--hold-pale); }
.endorsements { list-style: none; margin: 0; padding: 8px 14px 10px; border-top: 1px solid var(--rule-soft); font-size: 0.88rem; }
.endorsements li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.end-mark { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; white-space: nowrap; }
.end-ok .end-mark { color: var(--stamp-green); }
.end-missing { color: var(--stamp-red); }
.end-missing .end-mark { color: var(--stamp-red); }

.description { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; margin: 0; font-size: 0.93rem; }

.action { margin-top: 24px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.action p { margin: 0 0 12px; }
.action-hold { border-color: var(--stamp-red); background: var(--hold-pale); }
.action-hold p { margin: 0; }
.action-done { border-color: var(--stamp-blue); }

.btn {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--form-blue); border-radius: var(--radius);
  background: var(--paper); color: var(--form-blue); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--paper-2); }
.btn-primary { background: var(--form-blue); color: #fff; }
.btn-primary:hover { background: #163f75; }

/* intake */
.intake { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px 20px; max-width: 760px; }
.intake-help { margin: 0 0 14px; color: var(--ink-2); }
.field-label { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
textarea { width: 100%; font-family: var(--mono); font-size: 0.88rem; line-height: 1.5; padding: 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); color: var(--ink); resize: vertical; }
textarea:focus { border-color: var(--form-blue); }
.intake-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.foot { max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; color: var(--ink-3); font-size: 0.85rem; }
.foot p { margin: 6px 0; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .columns { grid-template-columns: 1fr; }
  .req-head { flex-direction: column-reverse; align-items: flex-start; }
  .bar-clock { margin-left: 0; width: 100%; }
  main, .foot { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .tiles { grid-template-columns: 1fr; }
  .page-title { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- the showcase: the tour card and its launch button, appended to styles.css at build ---- */

.tour-launch { position: fixed; right: 20px; bottom: 20px; z-index: 39; background: var(--form-blue, #1d4f91); color: #fff; border-color: var(--form-blue, #1d4f91); box-shadow: 0 10px 30px rgb(22 32 43 / 0.28); }
.tour-launch:hover { background: #163f75; }
body.touring .tour-launch { display: none; }

.tour { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: min(420px, calc(100vw - 32px)); padding: 16px 20px 16px; background: var(--ink, #16202b); color: #fff; border-top: 8px solid var(--stamp-red, #b3261e); border-radius: 6px; box-shadow: 0 14px 44px rgb(22 32 43 / 0.4); }
.tour[data-side="left"] { right: auto; left: 20px; }
.tour-count { margin: 0 0 6px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #c9d3e0; }
.tour-title { margin: 0 0 8px; font-size: 1.3rem; line-height: 1.15; font-weight: 700; color: #fff; }
.tour-body { margin: 0 0 14px; font-size: 0.97rem; line-height: 1.5; color: #e6ecf3; }
.tour-nav { display: flex; align-items: center; gap: 10px; }
.tour .tour-next { background: #fff; color: var(--ink, #16202b); border-color: #fff; }
.tour .tour-next:hover { background: #e6ecf3; }
.tour .tour-back { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.4); }
.tour .tour-back:hover:not(:disabled) { background: rgb(255 255 255 / 0.08); }
.tour .tour-back:disabled { opacity: 0.45; cursor: default; }
.tour-close { margin-left: auto; border: 0; background: none; color: #c9d3e0; font: inherit; font-size: 0.9rem; text-decoration: underline; cursor: pointer; padding: 6px 2px; }
.tour :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tour-target { outline: 4px solid var(--form-blue, #1d4f91) !important; outline-offset: 8px !important; border-radius: 6px; }
body.touring main { padding-bottom: 300px; }

@media (max-width: 640px) {
  .tour { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .tour[data-side="left"] { right: 12px; left: 12px; }
}
