/* Mobile-first: designed at ~390px, widened for desktop. Nothing may overflow sideways. */
:root {
  --ink: #10151c;
  --muted: #5a6673;
  --line: #dfe4ea;
  --bg: #f6f8fa;
  --brand: #12603f;
  --brand-ink: #ffffff;
  --ok: #1a7f4b;
  --warn: #8a5a00;
  --bad: #b3261e;
}

* { box-sizing: border-box; }

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

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

img, svg, video, canvas { max-width: 100%; height: auto; }
p, li, td, th, a, code, pre { overflow-wrap: anywhere; word-break: break-word; }

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.6rem 0; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 0.6rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; }
.lede { color: var(--muted); }
section { margin-bottom: 1.5rem; }

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

.topbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
  align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; }
.topbar nav a { text-decoration: none; }

footer {
  border-top: 1px solid var(--line);
  padding: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  background: #fff;
}

/* Controls: 44px tap targets and 16px text so iOS never zooms on focus. */
input, select, textarea, button {
  font-size: 16px !important;
  font-family: inherit;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  background: #fff;
  color: inherit;
  max-width: 100%;
}
@supports (-webkit-touch-callout: none) {
  input:focus, select:focus, textarea:focus { font-size: 16px !important; }
}
label { display: block; margin-bottom: 0.9rem; font-weight: 600; }
label input, label select { display: block; width: 100%; font-weight: 400; margin-top: 0.3rem; }
label.radio { font-weight: 400; display: flex; gap: 0.5rem; align-items: center; }
label.radio input { width: auto; min-height: auto; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 1rem; }
legend { font-weight: 600; padding: 0 0.35rem; }

button, .cta {
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.cta { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); padding: 0.7rem 1.1rem; border-radius: 8px; }
.cta.big { width: 100%; }
button.link { border: 0; background: none; color: var(--brand); padding: 0; min-height: 44px; }
button.danger { border-color: var(--bad); color: var(--bad); background: #fff; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}
form.card > button { width: 100%; }

.error { background: #fdecea; border: 1px solid var(--bad); color: var(--bad); padding: 0.7rem; border-radius: 8px; }
.badge {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 0.9rem; font-weight: 600; background: #eceff3; color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: #e5f5ec; color: var(--ok); }
.badge.warn { background: #fdf3e0; color: var(--warn); }
.badge.bad { background: #fdecea; color: var(--bad); }
.count { color: var(--muted); font-weight: 400; font-size: 0.95rem; }

.list-controls { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.list-controls h2 { margin: 0; }
.list-controls input, .list-controls select, .list-controls .cta { width: 100%; }

/* Rows are entirely clickable and become stacked cards on a phone. */
.list .row {
  display: flex; flex-direction: column; gap: 0.35rem;
  text-decoration: none; color: inherit;
}
.list a.row:hover, .list a.row:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(18, 96, 63, 0.12); }
.row-main { display: flex; flex-direction: column; }
.row-main small { color: var(--muted); font-size: 0.92rem; }
.empty { color: var(--muted); }

table.wide { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
table.wide th, table.wide td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
table.wide th { color: var(--muted); font-size: 0.9rem; }

.features { padding-left: 1.1rem; }
.features li { margin-bottom: 0.6rem; }
.plans { display: grid; gap: 1rem; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.plan .price { font-size: 1.5rem; font-weight: 700; margin: 0.2rem 0; }
.plan .price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.plan .cta { width: 100%; }
.plan-free { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.plan-tagline { color: var(--muted); margin: 0.1rem 0 0.4rem; }
.price-annual { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.5rem; }
.cta-quiet { background: #fff; color: var(--brand); }
.hero { padding: 0.5rem 0 1rem; }

pre { background: #0f1720; color: #e8eef4; padding: 0.8rem; border-radius: 10px; overflow-x: auto; }

/* Wide screens: tables and plans get room, rows become single lines. */
@media (min-width: 700px) {
  .list-controls { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .list-controls input { flex: 1 1 14rem; }
  .list-controls select, .list-controls .cta { width: auto; }
  .list .row { flex-direction: row; align-items: center; justify-content: space-between; }
  .plans { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
  .cta.big { width: auto; }
  form.card > button { width: auto; }
  h1 { font-size: 2rem; }
}

/* Narrow screens: no wide table may force sideways scrolling — stack each row. */
@media (max-width: 620px) {
  table.wide, table.wide tbody, table.wide tr, table.wide td { display: block; width: 100%; }
  table.wide thead { display: none; }
  table.wide tr { border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
  table.wide td { border: 0; padding: 0.15rem 0.6rem; }
  table.wide td::before { content: attr(data-label); color: var(--muted); margin-right: 0.4rem; }
}
