/* Clubhouse — mobile-first styles. Big tap targets for use at the field. */
:root {
  --brand: #1f4e8c;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --border: #d9dde3;
  --ok: #1e7b45;
  --ok-bg: #e5f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --bad: #b3261e;
  --bad-bg: #fde8e6;
  --radius: 10px;
  --tap: 44px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --surface: #1c1f25;
    --text: #e8eaed;
    --muted: #a3abb6;
    --border: #343a44;
    --ok: #6fd39a;
    --ok-bg: #173324;
    --warn: #f3c56b;
    --warn-bg: #3a2e12;
    --bad: #ff8a80;
    --bad-bg: #3b1a18;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--brand); }
@media (prefers-color-scheme: dark) { a { color: #8fb6f0; } }

/* Header */
.topbar {
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar .brand { font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .icon-link { min-width: var(--tap); min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.badge-count { position: absolute; top: 4px; right: 2px; background: #e53935; color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 5px; line-height: 1.4; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; min-width: var(--tap); min-height: var(--tap); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 240px; padding: 6px 0; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.menu-panel a, .menu-panel button {
  display: block; width: 100%; text-align: left; padding: 10px 16px; color: var(--text);
  background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--bg); }
.menu-panel .menu-label { padding: 8px 16px 2px; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.menu-panel hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

/* Layout */
main { max-width: 860px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack > * + * { margin-top: 8px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
.list a.block { display: block; text-decoration: none; color: inherit; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; justify-content: center; min-height: 72px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; text-decoration: none; color: var(--text); font-weight: 600;
}
.tile small { font-weight: 400; color: var(--muted); }

/* Buttons & forms */
.btn, button.btn, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 16px; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn.secondary { background: transparent; color: var(--brand); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 34px; padding: 0 10px; font-size: .875rem; }
.btn.block { width: 100%; }
@media (prefers-color-scheme: dark) { .btn.secondary { color: #8fb6f0; border-color: #8fb6f0; } }
form p, .field { margin: 0 0 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=url],
input[type=number], input[type=tel], select, textarea {
  width: 100%; min-height: var(--tap); padding: 8px 10px; font: inherit;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
}
input[type=color] { width: 64px; height: var(--tap); padding: 2px; border: 1px solid var(--border); border-radius: 8px; }
input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; }
.helptext, .help { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.errorlist { color: var(--bad); margin: 4px 0; padding-left: 18px; }
ul.checkbox-list, form ul:not(.errorlist) { list-style: none; padding: 0; margin: 0; }
form ul:not(.errorlist) li label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.inline-form { display: inline; }

/* Status pills & banners */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg); border: 1px solid var(--border); }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.banner { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.banner.ok, .messages .success { background: var(--ok-bg); color: var(--ok); }
.banner.warn, .messages .warning { background: var(--warn-bg); color: var(--warn); }
.banner.bad, .messages .error { background: var(--bad-bg); color: var(--bad); }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); border: 1px solid var(--border); }

/* Progress meter */
.meter { height: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.steps li:first-child { border-top: 0; }
.steps .mark { flex: 0 0 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.steps .done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps .skipped .mark { background: var(--muted); border-color: var(--muted); color: #fff; }
.steps .locked { opacity: .55; }
.steps .body { flex: 1; min-width: 0; }

/* Tables (scroll horizontally on small screens) */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }

.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: 1px dashed var(--border); padding: 10px; border-radius: 8px; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
.auth-wrap { max-width: 420px; margin: 32px auto; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 16px 40px; }

/* Breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: .9rem; margin: 0 0 8px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--muted); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
input.code-box { width: 100%; min-height: var(--tap); color: var(--text); margin-bottom: 8px; }

/* Public pages */
.topbar .toplink { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 8px; }
.topbar .toplink.strong { font-weight: 700; border: 1px solid rgba(255,255,255,.6); border-radius: 8px; padding: 0 12px; min-height: 36px; }
.hero { background: linear-gradient(160deg, var(--brand), #163a69); color: #fff; padding: 32px 16px; }
.hero-inner { max-width: 1040px; margin: 0 auto; display: grid; gap: 24px; }
.hero h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 12px; }
.hero .lead { font-size: 1.08rem; opacity: .95; }
.hero-points { padding-left: 20px; opacity: .95; }
.login-card { color: var(--text); margin: 0; }
.login-card h2 { margin-top: 0; }
@media (min-width: 820px) {
  .hero { padding: 56px 24px; }
  .hero-inner { grid-template-columns: 1.3fr 1fr; align-items: center; }
  .hero h1 { font-size: 2.6rem; }
}
body.public main { max-width: 1040px; }
.section-title { font-size: 1.3rem; margin: 28px 0 12px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.feature .icon { font-size: 1.6rem; }
.feature h3 { margin: 6px 0 4px; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.features.compact .feature { padding: 12px 14px; }
.trust { margin-top: 28px; }
/* Help articles */
.doc { max-width: 720px; }
.doc h2 { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--border); }
.doc table { margin: 12px 0; }
.doc blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--brand); background: var(--surface); border-radius: 0 8px 8px 0; }
.doc code, .doc kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: .9em; }
.doc .table-wrap, .doc table { display: block; overflow-x: auto; }
.toc ul { margin: 8px 0 0; padding-left: 20px; }
.doc-nav { max-width: 720px; margin-top: 24px; }
