/* The look shared by the signed-in pages (sign-in, the overview, an event's page, billing, the moderation page, the QR
   page): the start page's light, warm direction (2026-10-06), so the product feels like one brand after signing in.
   Tokens first; then the few building blocks every page uses (buttons, inputs, cards, pills, modals, the sidebar
   shell). A page's own stylesheet adds only what is its own. Change a colour HERE, nowhere else. The start page has the
   same tokens inline (startPage.js) because it is served without this file. */
:root {
  color-scheme: light;
  accent-color: var(--primary); /* the browser's own checkboxes, radio buttons and sliders in the brand green */
  --bg: #f4f1ea; --panel: #fff; --line: #e7e1d6; --line-strong: #d5cfc3; --text: #1f2a24; --muted: #5f6a63; --dim: #8b948e;
  --primary: #2e5b48; --primary-dark: #244a3a; --primary-soft: #e2ede5; --ok: #2e5b48; --ok-soft: #dcebdf;
  --warn: #9a5b12; --warn-soft: #f6e7d0; --danger: #a33a2b; --danger-soft: #f7e1dd; --info: #1d4f91; --info-soft: #dde8f7;
  --radius: 16px; --shadow: 0 8px 24px rgba(40, 30, 10, .08), 0 1px 3px rgba(40, 30, 10, .05);
  --lang-fg: var(--muted); --lang-line: var(--line-strong); --lang-bg: var(--panel); --lang-text: var(--text); --lang-corner-bg: var(--panel);
  --page-max: 1100px;
  --gutter: max(20px, calc((100% - var(--page-max)) / 2 + 20px));
}
/* A page that scrolls and one that does not must be the same width: a classic scrollbar takes
   ~15px, which would shift the centred column (and the footer) when moving between pages. */
html { scrollbar-gutter: stable; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
a { color: var(--primary); }
h1, h2, h3 { letter-spacing: -.01em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: 13px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

/* the brand: the four-tile mark with its hidden plus, and the lowercase wordmark (the same drawing as the favicon, scripts/make-favicons.mjs) */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 21px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }

/* buttons: one primary per view, the rest quiet */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 600; line-height: 1.3; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #faf8f3; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: var(--panel); border-color: #e4c4bd; color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 14px; }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* inputs */
input.f, select.f, textarea.f { width: 100%; font: inherit; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--text); min-width: 0; }
input.f:focus, select.f:focus, textarea.f:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
label.f { display: block; font-weight: 700; margin: 16px 0 8px; }
.msg { font-size: 14px; min-height: 1.3em; margin-top: 8px; }
.msg:empty { min-height: 0; margin-top: 0; } /* an empty message line takes no room under a form */
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

/* cards and pills */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.off { background: #ebe7df; color: var(--muted); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.switch { display: inline-block; vertical-align: middle; width: 40px; height: 22px; border-radius: 999px; background: #cfc8bb; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.switch.on { background: var(--primary); }
.switch.on::after { left: 21px; }

/* the app shell: a sidebar and a main column; on a phone the sidebar becomes a top bar with a menu */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; min-height: 100dvh; }
.side { padding: 24px 20px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.side .brand { margin: 0 8px 22px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a, .side nav button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text); text-decoration: none; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.side nav a:hover, .side nav button:hover { background: #ebe7df; }
.side nav a[aria-current], .side nav button[aria-current] { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--text); font-size: 14px; min-width: 0; } /* the avatar (the masked address is its tooltip), Sign out and the globe: one line */
.side .me .link { font-size: 13px; }
.side .me [data-lang-switcher] { margin-left: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; text-transform: uppercase; }
.main { padding: 32px 36px 60px; max-width: 1040px; width: 100%; min-width: 0; }
.topbar { display: none; }
.topbar .burger { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px; color: var(--text); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 800; margin: 0; }
.page-head p { margin: 6px 0 0; }
.crumb { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 18px; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.crumb:hover { color: var(--text); }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } /* the top bar takes its own height and the page the rest: with auto rows the grid's minimum height (a whole screen) was shared between them, so on a short page the bar grew to a third of the screen */
  .side { display: none; position: fixed; inset: 0; z-index: 40; height: auto; background: var(--bg); border: 0; padding-top: 70px; }
  .side.open { display: flex; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 50; }
  .main { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 24px; }
}

/* modals (the portal's dialogs): a centred panel on a dim backdrop; a long one scrolls on a short screen */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(31, 42, 36, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(480px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 24px 60px rgba(31, 42, 36, .25); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
/* A dialog that is taller than the window scrolls INSIDE its rounded frame: the portal wraps the form in .modal-frame, which carries the frame
   (border, corners, shadow, the height cap), and the form is the scroller, 8px inside it, so the scrollbar sits within the box and clear of the
   corners instead of running down its outer edge. The small question dialog (dialogs.js) is a plain .modal and never scrolls. */
.modal-frame { width: min(480px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(31, 42, 36, .25);
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.modal-frame > .modal { width: auto; min-height: 0; margin: 8px; padding: 16px; border: 0; border-radius: 0; box-shadow: none; max-height: none; overflow-y: auto; scrollbar-width: thin; }
.modal h3 { margin: 0; font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.modal p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal label { color: var(--text); font-size: 14px; font-weight: 600; }
.modal label.check { display: flex; gap: 10px; align-items: center; }
.modal input[type="text"], .modal input[type="email"], .modal select, .modal textarea { width: 100%; font: inherit; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--text); box-sizing: border-box; }
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.modal textarea { min-height: 74px; resize: vertical; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.modal .msg { min-height: 0; margin: 0; }
.modal .row { display: flex; gap: 8px; }
.modal .row input { flex: 1 1 auto; min-width: 0; }
.modal .row button { flex: none; white-space: nowrap; } /* a button beside a field keeps its words on one line, in every language */
.modal .hint { font-size: 13px; color: var(--dim); }
.modal button { font: inherit; }
.modal button:not(.link) { border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: 12px; padding: 10px 16px; font-weight: 600; cursor: pointer; }
.modal button:not(.link):hover { background: #faf8f3; }
.modal button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.modal button.primary:hover { background: var(--primary-dark); }
.modal button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.modal button.link { color: var(--primary); font-weight: 600; }
.modal button:disabled { opacity: .55; cursor: default; }
.modal.ask { width: min(440px, 100%); }
.modal.ask p { color: var(--text); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; } /* a message may have a blank line (the address lookup's warning) */
.modal button.wide { width: 100%; padding: 12px 14px; font-size: 15px; }
