/* Je viens aider – clean, Google/Material-inspired stylesheet. Mobile first. */
:root {
  --bg: #ffffff;
  --surface-2: #f8f9fa;
  --text: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --primary: #1a73e8;
  --primary-hover: #1765cc;
  --primary-tonal: #e8f0fe;
  --primary-on-tonal: #174ea6;
  --danger: #d93025;
  --radius: 8px;

  --empty-bg: #fce8e6;   --empty-fg: #c5221f;
  --partial-bg: #fef7e0; --partial-fg: #b06000;
  --ok-bg: #e6f4ea;      --ok-fg: #137333;
  --full-bg: #f1f3f4;    --full-fg: #5f6368;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.3; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; font-weight: 500; }
p { margin: 0 0 .75rem; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 1.5rem; padding-bottom: 3rem; }

.topbar { border-bottom: 1px solid var(--border); }
.topbar .container { display: flex; align-items: center; height: 56px; }
.brand { font-size: 1.3rem; color: var(--muted); }
.brand:hover { text-decoration: none; }
.brand b { color: var(--text); font-weight: 500; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  height: 40px; padding: 0 24px; border-radius: 20px; border: 1px solid transparent;
  background: var(--primary); color: #fff; font: inherit; font-size: .9rem; font-weight: 500;
  letter-spacing: .01em; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; box-shadow: 0 1px 2px rgba(60, 64, 67, .3); }
.btn.text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn.text:hover { background: rgba(26, 115, 232, .08); box-shadow: none; }
.btn.tonal { background: var(--primary-tonal); color: var(--primary-on-tonal); }
.btn.tonal:hover { background: #d2e3fc; box-shadow: none; }
.btn.outlined { background: transparent; color: var(--primary); border-color: var(--border); }
.btn.outlined:hover { background: rgba(26, 115, 232, .04); box-shadow: none; }
.btn.danger { background: var(--danger); }
.btn.text.danger, .btn.outlined.danger { background: transparent; color: var(--danger); }
.btn.text.danger:hover { background: rgba(217, 48, 37, .08); }
.btn.small { height: 32px; padding: 0 16px; }
.btn.text.small { padding: 0 8px; }
.btn.icon { width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 1rem; }
.btn.block { width: 100%; height: 44px; }
.btn[disabled] { opacity: .38; cursor: default; box-shadow: none; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: var(--danger); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- surfaces ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; background: #fff; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
details > summary { cursor: pointer; color: var(--primary); font-weight: 500; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--muted); transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
details[open] > summary { margin-bottom: 12px; }

.callout { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; background: var(--surface-2); }
.callout.success { background: var(--ok-bg); color: #0d652d; }
.callout.error { background: var(--empty-bg); color: #a50e0e; }
.callout.warning { background: var(--partial-bg); color: #8a4a00; }
.callout.info { background: var(--primary-tonal); color: var(--primary-on-tonal); }

.muted, .hint { color: var(--muted); }
.hint { font-size: .85rem; margin: 0; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.missing { color: var(--empty-fg); }
.warn { color: var(--partial-fg); }
.desc { white-space: pre-line; color: var(--muted); }
.req { color: var(--danger); }

/* ---------- forms ---------- */
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 500; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 400; font-size: .9rem; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
}
textarea { height: auto; padding: 8px 12px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #9aa0a6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
input[type="color"] { width: 48px; padding: 2px; cursor: pointer; }
.row2, .row3 { display: grid; gap: 14px; }
@media (min-width: 600px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 1fr 1fr 1fr; }
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- status colours ---------- */
.st-empty   { --c-bg: var(--empty-bg);   --c-fg: var(--empty-fg); }
.st-partial { --c-bg: var(--partial-bg); --c-fg: var(--partial-fg); }
.st-ok      { --c-bg: var(--ok-bg);      --c-fg: var(--ok-fg); }
.st-full    { --c-bg: var(--full-bg);    --c-fg: var(--full-fg); }
.status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .8rem; font-weight: 500; background: var(--c-bg); color: var(--c-fg); white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--stand, var(--primary)); margin-right: 8px; flex: none; }

.progress { height: 4px; background: #e8eaed; border-radius: 2px; overflow: hidden; margin: 12px 0 8px; }
.progress-bar { height: 100%; background: var(--primary); }

/* ---------- home ---------- */
.hero { text-align: center; max-width: 560px; margin: 24px auto 32px; }
.hero h1 { font-size: 2rem; }
.hero p { color: var(--muted); font-size: 1rem; }

/* ---------- event page ---------- */
.event-head { margin-bottom: 8px; }
.event-head .meta, .page-head .meta { color: var(--muted); margin-bottom: 8px; }
.summary p { color: var(--muted); font-size: .9rem; }

.tabs {
  display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border);
  margin: 0 -16px; padding: 0 8px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; display: inline-flex; align-items: center; padding: 12px 14px 10px;
  color: var(--muted); font-weight: 500; font-size: .9rem; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs a.me { margin-left: auto; }
.tabs .count { margin-left: 6px; padding: 0 6px; min-width: 20px; border-radius: 10px; font-size: .75rem; text-align: center; background: var(--empty-bg); color: var(--empty-fg); }
.tabs .count.done { background: var(--ok-bg); color: var(--ok-fg); }
.tabs .count.mine { background: var(--primary-tonal); color: var(--primary-on-tonal); }

.toolbar { display: flex; justify-content: flex-end; margin: 16px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .85rem; font-weight: 500;
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.on { background: var(--primary-tonal); border-color: transparent; color: var(--primary-on-tonal); }

/* overview grid (desktop) */
.grid-wrap { display: none; overflow-x: auto; }
.grid { border-collapse: separate; border-spacing: 6px; width: 100%; margin: -6px; }
.grid thead th { font-weight: 500; font-size: .85rem; color: var(--muted); text-align: left; padding: 0 4px 4px; white-space: nowrap; }
.grid thead th small { font-weight: 400; }
.grid tbody th { text-align: left; font-weight: 500; white-space: nowrap; padding-right: 12px; position: sticky; left: 0; background: #fff; z-index: 1; }
.grid tbody th a { color: var(--text); display: flex; align-items: center; }
.grid td { min-width: 110px; vertical-align: top; padding: 0; }

.cell {
  display: block; padding: 8px 12px; border-radius: var(--radius); min-height: 56px;
  background: var(--c-bg); color: var(--c-fg); transition: box-shadow .15s;
}
.cell + .cell { margin-top: 6px; }
a.cell:hover { text-decoration: none; box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px rgba(60, 64, 67, .15); }
.cell.mine { box-shadow: inset 0 0 0 2px var(--primary); }
.cell-count { font-size: 1rem; font-weight: 500; }
.cell-me { margin-left: 6px; font-size: .75rem; font-weight: 500; color: var(--primary); }
.cell-names { display: block; font-size: .75rem; color: var(--muted); line-height: 1.35; }
.cell-stand { display: block; font-weight: 500; color: var(--text); font-size: .9rem; }

/* timeline (mobile) */
.timeline { display: grid; gap: 20px; }
.tgroup h3 { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.tcells { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tcells .cell + .cell { margin-top: 0; }

@media (min-width: 760px) {
  .grid-wrap { display: block; }
  .timeline { display: none; }
}

/* stand tab */
.stand-tab .desc { margin-top: 4px; }
.slots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.slot { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.slot.mine { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.slot-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.slot-top h3 { margin: 0; font-size: 1.05rem; }
.slot-top h3 small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.slot-names { margin: 0; font-size: .9rem; flex: 1; }
.slot-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* my slots */
.list { list-style: none; padding: 0; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.list li + li { border-top: 1px solid var(--border); }
.list .sub { color: var(--muted); font-size: .9rem; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-size: .85rem; color: var(--muted); background: var(--surface-2); }
.me-tab .card { margin-top: 16px; }

/* sign-up dialog */
.modal {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  border: 0; border-radius: 28px; padding: 24px; box-shadow: 0 8px 28px rgba(60, 64, 67, .3);
}
.modal::backdrop { background: rgba(32, 33, 36, .5); }
.modal .close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.modal .close:hover { background: var(--surface-2); }
.signup-title { display: flex; align-items: center; padding-right: 40px; margin-bottom: 2px; }
.signup-sub { color: var(--muted); margin-bottom: 16px; }

/* ---------- admin ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; margin-bottom: 16px; }
.page-head h1 { margin-bottom: 2px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.segmented button {
  height: 36px; padding: 0 16px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button:hover { background: var(--surface-2); }
.segmented button.on { background: var(--primary-tonal); color: var(--primary-on-tonal); cursor: default; }
.segmented button.on::before { content: "✓ "; }

.links { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: 1fr; gap: 4px 8px; align-items: center; }
.link-row .copy-row { gap: 4px; }
.link-label { font-size: .85rem; color: var(--muted); font-weight: 500; }
@media (min-width: 600px) { .link-row { grid-template-columns: 110px 1fr; } }

.overview { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; }
.overview p { margin: 0; color: var(--muted); }
.overview strong { color: var(--text); font-weight: 500; }
.section-title { font-size: 1.1rem; font-weight: 500; margin: 32px 0 12px; }

.stand { padding: 0; overflow: hidden; }
.stand-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 12px 12px 20px; }
.stand-head h3 { display: flex; align-items: center; margin: 0; font-size: 1.05rem; flex: 1; }
.stand-body { padding: 0 20px 16px; }
.stand-body > details { margin-top: 12px; }
.row-actions { display: flex; gap: 2px; align-items: center; }
.row-actions form { margin: 0; }

.table-wrap { overflow-x: auto; }
.slots-admin { width: 100%; border-collapse: collapse; font-size: .9rem; }
.slots-admin th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.slots-admin td { padding: 6px; border-bottom: 1px solid #f1f3f4; vertical-align: top; }
.slots-admin tr:last-child td { border-bottom: 0; }
.slots-admin input { height: 32px; padding: 0 6px; font-size: .9rem; border-color: transparent; background: transparent; }
.slots-admin input:hover { border-color: var(--border); }
.slots-admin input:focus { background: #fff; }
.slots-admin .when { white-space: nowrap; }
.slots-admin .when input[type="time"] { width: 6.6em; }
.slots-admin input.num { width: 4em; }
.slots-admin .status { margin-bottom: 4px; }
.people-admin { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.people-admin li { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; }
.people-admin .contact { color: var(--muted); font-size: .85rem; }
.people-admin em { color: var(--muted); font-size: .85rem; }
form.inline { display: inline; margin: 0; }
.gen-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 12px; }
@media (min-width: 760px) { .gen-grid { grid-template-columns: 1.4fr 1fr 1fr 1.3fr .8fr .8fr; } }

.add-stand { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.add-stand label:first-child { flex: 1; min-width: 200px; }
.danger-zone > summary { color: var(--danger); }
.tools .card { margin-bottom: 8px; }
.error-page { text-align: center; margin-top: 32px; }
