/* Complaint Escape — single stylesheet, no framework. Mobile-first. */

:root {
  --ink: #1b2330;
  --ink-soft: #4d5a6c;
  --line: #dfe4ec;
  --bg: #f7f8fb;
  --card: #ffffff;
  --brand: #c2410c;
  --brand-dark: #9a3412;
  --brand-soft: #fff1e7;
  --ok: #0f766e;
  --warn: #b45309;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(27, 35, 48, 0.08);
  --maxw: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

a { color: var(--brand-dark); }

h1 { font-size: 1.85rem; line-height: 1.2; margin: 0.4em 0; }
h2 { font-size: 1.25rem; margin: 1.6em 0 0.5em; }
h3 { font-size: 1.02rem; margin: 0 0 0.4em; }

/* Header / footer */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--ink-soft); padding: 6px 10px; border-radius: 8px; font-size: 0.92rem; }
.site-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }

.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 48px; padding: 20px 0; font-size: 0.85rem; color: var(--ink-soft); }
.site-footer p { margin: 0.3em 0; }

/* Hero */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); max-width: 22ch; }
.lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 60ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Buttons */
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }

/* Filters */
.filters { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 26px 0 8px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr; } }
.filters input, .filters select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.95rem; background: #fff; color: var(--ink);
}
.filters input:focus, .filters select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.result-meta { color: var(--ink-soft); font-size: 0.85rem; margin: 6px 0 12px; }

/* Cards */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.grid.grid-small { grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid.grid-small { grid-template-columns: repeat(2, 1fr); } }

.card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.card[hidden] { display: none; } /* [hidden] must beat .card's display:flex */
.card:hover { border-color: var(--brand); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-platform { font-weight: 700; font-size: 1.08rem; }
.card-ind { color: var(--ink-soft); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.card-sum { margin: 2px 0 6px; font-size: 0.9rem; color: var(--ink-soft); flex: 1; }
.card-cta { color: var(--brand-dark); font-weight: 600; font-size: 0.88rem; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--ink-soft); }

/* Badges */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 18px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eef1f6; color: var(--ink-soft); font-size: 0.8rem; font-weight: 600; }
.badge-country { background: var(--brand-soft); color: var(--brand-dark); }
.badge-verified { background: #e6f4f1; color: var(--ok); }

/* Panels & ladders */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 14px 0; }
.panel h2 { margin-top: 0; }
.inapp { font-weight: 600; margin: 0.2em 0; }
.hint { color: var(--ink-soft); font-size: 0.88rem; margin: 8px 0 0; }

.ladder { display: flex; flex-direction: column; gap: 12px; }
.ladder-step { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.lvl { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; background: #eef1f6; color: var(--ink-soft); }
.lvl-L1 { background: #eef1f6; color: var(--ink-soft); }
.lvl-L2, .lvl-L3 { background: var(--brand-soft); color: var(--brand-dark); }
.lvl-L4 { background: #fdece8; color: #9b1c1c; }

.channels { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.channels li { display: grid; grid-template-columns: 22px 1fr; gap: 2px 6px; }
.ch-icon { grid-row: span 2; text-align: center; }
.ch-val { font-weight: 600; overflow-wrap: anywhere; }
.ch-note { color: var(--ink-soft); font-size: 0.85rem; }

.regulators, .social, .sources { padding-left: 1.2em; margin: 6px 0; }
.regulators li, .sources li { margin: 0.6em 0; overflow-wrap: anywhere; }
.sources { font-size: 0.9rem; }

.cta-panel { background: var(--brand-soft); border: 1px solid #f3c9ac; border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.cta-panel h2 { margin-top: 0; }

.related { margin-top: 28px; }
.crumbs { font-size: 0.85rem; color: var(--ink-soft); margin-top: 20px; }

.steps { padding-left: 1.2em; }
.steps li { margin: 0.5em 0; }

/* Generator */
.gen-layout { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
@media (min-width: 920px) { .gen-layout { grid-template-columns: 1fr 1fr; align-items: start; } }

.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 5px; }
.req { color: #9b1c1c; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.95rem; font-family: inherit; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.err { color: #9b1c1c; font-size: 0.83rem; margin: 4px 0 0; }
.meta-row { display: flex; justify-content: space-between; gap: 10px; }
.char-count { color: var(--ink-soft); font-size: 0.8rem; }
.send-hint { margin-top: 8px; background: #e6f4f1; color: var(--ok); border-radius: 8px; padding: 8px 10px; font-size: 0.85rem; overflow-wrap: anywhere; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.output { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: sticky; top: 70px; }
.output h2 { margin-top: 0; }
.output pre {
  white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem; line-height: 1.5; background: #fbfbfd; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; max-height: 60vh; overflow: auto; margin: 0 0 12px;
}

/* A11y helper */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .hero { padding-top: 26px; }
  .output { position: static; }
}
