/* Rostra Requests — design tokens
   ink:      #1A2433  statute-book navy
   paper:    #FAFAF7  cool document stock
   sun:      #E8A013  received-stamp amber
   palmetto: #1F5C45  deep Florida green (success / fulfilled)
   alert:    #A33B2E  overdue brick
   rule:     #DDDAD2  hairline rules
*/

:root {
  --ink: #1A2433;
  --ink-soft: #5B6470;
  --paper: #FAFAF7;
  --card: #FFFFFF;
  --sun: #E8A013;
  --sun-soft: #FBF1DC;
  --palmetto: #1F5C45;
  --palmetto-soft: #E4EFE9;
  --alert: #A33B2E;
  --alert-soft: #F6E6E2;
  --rule: #DDDAD2;
  --mono: "Consolas", "SF Mono", Menlo, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

a { color: var(--ink); }
a:hover { color: var(--sun); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }

h2.hook {
  color: var(--sun); border-left: 4px solid var(--sun);
  padding-left: .75rem; margin-top: 1.75rem;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }

/* ---- chrome ---- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.25rem;
  background: var(--card);
  border-bottom: 3px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.brand-accent { color: var(--sun); }
.topnav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topnav a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.topnav-staff { color: var(--ink-soft); }
.topnav-user { color: var(--ink-soft); font-size: .9rem; }
.inline-form { display: inline; }
.btn-link { background: none; border: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--ink); cursor: pointer; text-decoration: underline; }

@media (max-width: 540px) {
  .topbar { flex-wrap: wrap; }
  .topnav { width: 100%; justify-content: flex-start; gap: .6rem 1.1rem; }
}

.page { max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.footer { border-top: 1px solid var(--rule); color: var(--ink-soft);
  font-size: .85rem; padding: 1rem 1.25rem; text-align: center; }

/* ---- panels & forms ---- */

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.panel.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.panel-sun { border-top-color: var(--sun); }

.eyebrow {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: .35rem;
}

label { display: block; font-weight: 600; margin: .9rem 0 .25rem; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: .55rem .65rem; font: inherit;
  border: 1px solid var(--rule); border-radius: 2px; background: #fff; color: var(--ink);
}
textarea { min-height: 130px; resize: vertical; }
.field-error { color: var(--alert); font-weight: 700; font-size: .85rem; margin-top: .2rem; }
.form-msg { padding: .6rem .8rem; margin: .5rem 0 1rem; font-weight: 600; }
.form-msg.ok { background: var(--palmetto-soft); color: var(--palmetto); }
.form-msg.bad { background: var(--alert-soft); color: var(--alert); }

.btn {
  display: inline-block; padding: .6rem 1.3rem; font: inherit; font-weight: 700;
  background: var(--ink); color: #fff; border: none; border-radius: 2px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: #2A3A52; color: #fff; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: #F0B23A; color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-quiet:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; }

/* ---- the stamp (signature element) ---- */

.stamp {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: .08em;
  color: var(--sun);
  border: 3px solid var(--sun);
  border-radius: 4px;
  padding: .35rem .9rem;
  transform: rotate(-2deg);
  background: var(--sun-soft);
}

.tracking-code { font-family: var(--mono); font-weight: 700; letter-spacing: .05em; }

/* ---- status chips ---- */

.chip {
  display: inline-block; font-size: .78rem; font-weight: 700;
  padding: .15rem .6rem; border-radius: 999px; white-space: nowrap;
}
.chip-new    { background: var(--sun-soft); color: #8A5E08; }
.chip-open   { background: #E3EAF5; color: #27466E; }
.chip-wait   { background: #F2E9D8; color: #7A5A14; }
.chip-done   { background: var(--palmetto-soft); color: var(--palmetto); }
.chip-denied { background: var(--alert-soft); color: var(--alert); }
.chip-muted  { background: #ECEBE6; color: var(--ink-soft); }

.due-overdue { color: var(--alert); font-weight: 700; }
.due-soon { color: #8A5E08; font-weight: 700; }

/* ---- dashboard ---- */

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--rule); padding: 1rem 1.1rem; }
.stat .num { font-family: var(--serif); font-size: 2.1rem; font-weight: 700; line-height: 1; }
.stat .lbl { color: var(--ink-soft); font-size: .85rem; margin-top: .3rem; }
.stat.warn .num { color: var(--alert); }
.stat.soon .num { color: #8A5E08; }

.toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }
.filterbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.filterbar select, .filterbar input[type="search"] { width: auto; }
.filterbar input[type="search"] {
  min-width: 220px; padding: .55rem .65rem; font: inherit;
  border: 1px solid var(--rule); border-radius: 2px; background: #fff; color: var(--ink);
}
.bulkbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: #F4F3EE; border: 1px solid var(--rule); padding: .5rem .75rem; margin-bottom: -1px; }
.bulkbar select { width: auto; }
.selcol { width: 1.5rem; text-align: center; }
.selcol input { width: auto; }

table.list { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--rule); }
table.list th {
  text-align: left; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: .6rem .75rem; border-bottom: 2px solid var(--ink); background: #F4F3EE;
}
table.list td { padding: .6rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.list tr:hover td { background: #FCFBF6; }

/* ---- request detail ---- */

.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }

.kv { margin: 0; }
.kv dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); margin-top: .8rem; }
.kv dd { margin: .15rem 0 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid var(--rule); padding: .2rem 0 1rem 1rem; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -7.5px; top: .45rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--ink);
}
.timeline li.public::before { background: var(--sun); }
.timeline .when { font-family: var(--mono); font-size: .75rem; color: var(--ink-soft); }
.timeline .who { font-weight: 700; }
.timeline .pub-tag { font-size: .7rem; font-weight: 700; color: var(--sun);
  border: 1px solid var(--sun); border-radius: 3px; padding: 0 .3rem; margin-left: .4rem; }

.checkline { display: flex; align-items: center; gap: .5rem; margin: .6rem 0; }
.checkline input { width: auto; }
.checkline label { margin: 0; }

.muted { color: var(--ink-soft); }
.mt { margin-top: 1rem; }

.ack-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; background: var(--sun-soft); border: 1px solid var(--sun);
  border-left: 4px solid var(--sun); padding: .9rem 1.1rem; margin-bottom: 1.5rem;
}
.fee-total { font-size: 1.05rem; }
.fee-total strong { font-family: var(--mono); }

.filelist { list-style: none; margin: .5rem 0 0; padding: 0; }
.filelist li { display: flex; gap: .6rem; align-items: baseline; padding: .35rem 0;
  border-bottom: 1px solid var(--rule); }
.filelist a { font-weight: 600; }

/* ---- public request builder ---- */
.prompt-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .6rem; }
.chip-btn {
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  background: #fff; color: var(--ink); border: 1px solid var(--ink);
  border-radius: 999px; padding: .25rem .75rem;
}
.chip-btn:hover { background: var(--ink); color: #fff; }

/* ---- tags ---- */
.tagline { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 1rem;
  padding-top: .8rem; border-top: 1px solid var(--rule); }
.tag { display: inline-flex; align-items: center; gap: .25rem; background: #EEF1F5; color: #27466E;
  font-size: .8rem; font-weight: 700; padding: .1rem .25rem .1rem .55rem; border-radius: 999px; }
.tag-x { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem;
  line-height: 1; padding: 0 .2rem; }
.tag-x:hover { color: var(--alert); }
.tag-add input { width: 7rem; padding: .2rem .5rem; font-size: .8rem; border-radius: 999px; }
.row-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.tag-static { padding: .05rem .5rem; font-size: .72rem; }

/* ---- withholding log ---- */
.withholdings { list-style: none; margin: .5rem 0 0; padding: 0; }
.withholdings li { display: flex; justify-content: space-between; align-items: start; gap: .75rem;
  padding: .5rem 0; border-bottom: 1px solid var(--rule); }

/* ---- two-column form row (staff intake) ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .two-col { grid-template-columns: 1fr; } }

/* ---- response templates ---- */
.template-row { border-top: 1px solid var(--rule); padding-top: .9rem; margin-top: .9rem; }
.template-row > input[type="text"] { font-weight: 700; margin-bottom: .4rem; }
.template-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.statute { font-family: var(--mono); font-size: .8rem; color: var(--ink-soft); }
.hp-field { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ---- printable record ---- */
.printbar { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.record { background: var(--card); border: 1px solid var(--rule); padding: 2rem; max-width: 820px; margin: 0 auto; }
.record-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; border-bottom: 3px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1rem; }
.record-head h1 { margin: 0; }
.record-code { text-align: right; }
.record-code .tracking-code { font-size: 1.1rem; display: block; margin-bottom: .35rem; }
.record-desc { white-space: pre-wrap; }
.record h2 { margin-top: 1.5rem; padding-bottom: .2rem; border-bottom: 1px solid var(--rule); }
.record-log th, .record-log td { font-size: .85rem; }
.record-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  font-size: .8rem; color: var(--ink-soft); }

@media print {
  .topbar, .footer, .no-print { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .page { padding: 0; max-width: none; }
  .record { border: none; padding: 0; max-width: none; }
  table.list tr:hover td { background: none; }
  a { color: var(--ink); text-decoration: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: stamp-in .35s ease-out; }
  @keyframes stamp-in {
    0% { transform: rotate(-2deg) scale(1.6); opacity: 0; }
    70% { transform: rotate(-2deg) scale(.96); opacity: 1; }
    100% { transform: rotate(-2deg) scale(1); }
  }
}

/* ---- hub directory ---- */
.agency-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; }
.agency-card { display: block; background: var(--card); border: 1px solid var(--rule);
  border-top: 4px solid var(--sun); padding: 1.25rem; text-decoration: none; color: var(--ink); }
.agency-card:hover { border-top-color: var(--ink); background: #FCFBF6; }
.agency-card h2 { margin: .5rem 0 .25rem; }
.agency-cta { display: inline-block; margin-top: .75rem; font-weight: 700; color: var(--sun); }

/* unregistered (not-yet-on-platform) directory cards */
.agency-card-unreg { border-top-color: var(--rule); }
.agency-card-unreg .agency-cta { color: var(--ink-soft); }
