/* FireHelp — one stylesheet, no build step, no web fonts.
 *
 * Design constraints, all of them driven by who uses this and how:
 *   - Mobile-first. Most people will open this on a phone, some of them
 *     standing in a driveway.
 *   - Large tap targets: 44px minimum on anything tappable.
 *   - High contrast: body text is #1c1917 on #ffffff (>15:1). No grey-on-grey.
 *   - No web fonts, no images, no JS: the whole page is this file plus HTML,
 *     which matters on a saturated cell tower during an emergency.
 *   - System font stack renders instantly and matches the phone's own UI.
 */

:root {
  --ink:        #1c1917;
  --ink-soft:   #57534e;
  --bg:         #ffffff;
  --bg-soft:    #faf9f7;
  --line:       #d6d3d1;
  --brand:      #7c2d12;   /* deep ember */
  --brand-mid:  #b45309;
  --offer:      #166534;   /* green — something is available */
  --need:       #9a3412;   /* orange — something is wanted */
  --danger:     #b91c1c;
  --ok-bg:      #ecfdf5;
  --ok-line:    #059669;
  --err-bg:     #fef2f2;
  --err-line:   #dc2626;
  --warn-bg:    #fffbeb;
  --warn-line:  #d97706;
  --radius:     10px;
  --tap:        44px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Keyboard users land here first; invisible until focused. */
.skip {
  position: absolute; left: -9999px;
  background: var(--brand); color: #fff; padding: 12px 16px; z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

/* Visible focus everywhere. Never remove this without a replacement. */
:focus-visible { outline: 3px solid var(--brand-mid); outline-offset: 2px; }

/* ---- Header / nav ---- */

.site-header { background: var(--brand); color: #fff; }
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; gap: 12px;
}
.brand { color: #fff; font-size: 20px; font-weight: 700; text-decoration: none; }
.signout { margin: 0; }
.linkish {
  background: none; border: 1px solid rgba(255,255,255,.5); color: #fff;
  padding: 8px 14px; border-radius: var(--radius); font-size: 15px; cursor: pointer;
  min-height: 38px;
}
.linkish:hover { background: rgba(255,255,255,.12); }

.site-nav { background: #5c2110; }
.nav-row { display: flex; gap: 4px; overflow-x: auto; }
.site-nav a {
  color: #fde9d9; text-decoration: none; padding: 12px 14px;
  min-height: var(--tap); display: flex; align-items: center;
  font-size: 15px; white-space: nowrap; border-bottom: 3px solid transparent;
}
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: #fbbf24; font-weight: 600; }

main { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }

/* ---- Typography ---- */

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 14px; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 16px 0 6px; }
p  { margin: 0 0 12px; }
a  { color: var(--brand); }

.lede { font-size: 18px; color: var(--ink-soft); }
.help { font-size: 14px; color: var(--ink-soft); margin: 0 0 8px; }
.opt  { font-weight: 400; color: var(--ink-soft); font-size: 14px; }
.backlink { margin-bottom: 12px; }
.count { color: var(--ink-soft); font-size: 14px; }

/* ---- Panels ---- */

.panel {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin: 0 0 18px;
}
.panel-privacy { background: var(--ok-bg); border-color: var(--ok-line); }
.panel-scope   { background: var(--warn-bg); border-color: var(--warn-line); }
.panel-warn    { background: var(--warn-bg); border-color: var(--warn-line); }
.panel-danger  { background: var(--err-bg); border-color: var(--err-line); }
.panel-message { text-align: center; }
.empty { text-align: center; }

.hero { padding: 8px 0 20px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.steps, .checks { margin: 0; padding-left: 22px; }
.steps li, .checks li { margin-bottom: 8px; }
.checks { list-style: none; padding-left: 0; }
.checks li::before { content: "✓ "; color: var(--ok-line); font-weight: 700; }

/* ---- Alerts ---- */

.alert {
  padding: 12px 14px; border-radius: var(--radius); border-left: 5px solid;
  margin: 0 0 16px; font-size: 15px;
}
.alert-error { background: var(--err-bg); border-color: var(--err-line); }
.alert-ok    { background: var(--ok-bg);  border-color: var(--ok-line); }

/* ---- Buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 12px 20px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  font-family: inherit;
}
.btn-primary   { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #64210d; }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: #fdf5f2; }
.btn-quiet     { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.btn-danger    { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--err-bg); }
.btn-block     { width: 100%; }
.btn-small     { min-height: 36px; padding: 6px 12px; font-size: 14px;
                 background: #fff; border-color: var(--line); color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.inline-form { display: inline; margin: 0; }
.alt-action { margin-top: 14px; text-align: center; }

/* ---- Forms ---- */

.form { margin: 0 0 20px; }
.field { margin: 0 0 20px; }
.field legend, .field > label {
  display: block; font-weight: 600; margin-bottom: 4px; font-size: 16px;
}
fieldset { border: 0; padding: 0; margin: 0 0 20px; }

input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 11px 12px;
  border: 2px solid var(--line); border-radius: var(--radius);
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
  font-family: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-mid); }
textarea { resize: vertical; }

.code-input { text-transform: uppercase; letter-spacing: .12em; font-family: ui-monospace, monospace; }

/* The location field's warning border earns its own treatment — this is the
   one input where a mistake has a real-world privacy cost. */
.field-warn { padding: 12px; border-left: 4px solid var(--warn-line); background: var(--warn-bg); border-radius: 0 var(--radius) var(--radius) 0; }

.radio-row { display: flex; gap: 12px; }
.radio-card {
  flex: 1; display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px; min-height: 56px; cursor: pointer; background: #fff;
  font-weight: 600;
}
.radio-card:has(input:checked) { border-color: var(--brand); background: #fdf5f2; }
.radio-card input { width: 22px; height: 22px; accent-color: var(--brand); }

.filters { background: var(--bg-soft); border: 1px solid var(--line);
           border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.filters-title { font-size: 16px; }
.filter-grid { display: grid; gap: 14px; }
.filter-grid .field { margin: 0; }
.filter-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---- Cards ---- */

.cards { display: grid; gap: 14px; }
.card {
  border: 1px solid var(--line); border-left: 5px solid var(--line);
  border-radius: var(--radius); padding: 14px; background: #fff;
}
.card-offer { border-left-color: var(--offer); }
.card-need  { border-left-color: var(--need); }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 4px 9px; border-radius: 999px;
  background: #f5f5f4; color: var(--ink-soft);
}
.tag-offer  { background: #dcfce7; color: var(--offer); }
.tag-need   { background: #ffedd5; color: var(--need); }
.tag-status { background: #e7e5e4; color: var(--ink); }

.card-title { margin: 0 0 8px; font-size: 18px; }
/* The whole title row is the tap target, not just the words. */
.card-title a { text-decoration: none; display: block; min-height: 28px; }
.card-title a:hover { text-decoration: underline; }

.card-loc, .card-qty { margin: 0 0 4px; font-size: 15px; }
.card-contact { margin: 8px 0 4px; font-size: 15px; }
.card-meta { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* ---- Detail ---- */

.detail { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.detail-desc { white-space: pre-wrap; }   /* keeps the poster's line breaks */
.detail-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0; }
.detail-facts dt { font-weight: 600; color: var(--ink-soft); font-size: 14px; }
.detail-facts dd { margin: 0; }

.contact-block {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-top: 16px;
}
.contact-line { font-size: 17px; margin-bottom: 6px; }

.claims { list-style: none; padding: 0; margin: 0; }
.claims li { border-top: 1px solid var(--line); padding: 10px 0; }
.claims li:first-child { border-top: 0; }
.claim-note { font-size: 14px; color: var(--ink-soft); margin: 4px 0 0; font-style: italic; }

/* ---- Moderation / admin ---- */

.mod-row { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.mod-actions { margin-top: 8px; display: flex; gap: 8px; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table th { font-size: 13px; text-transform: uppercase; color: var(--ink-soft); }
/* Wide tables scroll inside their own box; the page body never scrolls sideways. */
.table-scroll { overflow-x: auto; margin-bottom: 16px; }
.row-actions { display: flex; gap: 6px; }

.joincode { font-size: 16px; font-weight: 700; letter-spacing: .08em; background: #fff7ed; padding: 3px 7px; border-radius: 5px; }

/* Inline ward rename: input and button side by side, input allowed to shrink. */
.rename-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.rename-form input { min-width: 140px; min-height: 36px; padding: 6px 8px; font-size: 15px; }

/* Label present for screen readers, invisible on screen. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.counts { list-style: none; padding: 0; margin: 0; display: grid;
          grid-template-columns: 1fr 1fr; gap: 12px; }
.big-number { font-size: 26px; font-weight: 700; display: block; }

.loglist, .plainlist { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.loglist li, .plainlist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.loglist code { color: var(--ink-soft); font-size: 12px; }

.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { flex: 1; min-width: 200px; margin: 0; }

/* ---- Footer ---- */

.site-footer {
  border-top: 3px solid var(--brand); background: var(--bg-soft);
  padding: 22px 0; font-size: 14px; color: var(--ink-soft);
}
.site-footer p { margin: 0 0 10px; }
.disclaimer { font-weight: 600; color: var(--ink); }
.resources a { display: inline-block; padding: 4px 0; }

/* ---- Wider screens ---- */

@media (min-width: 620px) {
  h1 { font-size: 30px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .counts { grid-template-columns: repeat(4, 1fr); }
  .btn-block { width: auto; min-width: 220px; }
}

/* Honour a reduced-motion preference; there is little motion here, but the
   rule costs nothing and covers anything added later. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
