/* =============================================================================
   Team Scheduler theme
   -----------------------------------------------------------------------------
   Borrowed from the original availability survey: dark background, white text,
   Arial body with Verdana headings, indigo pill buttons (#3D5AFE, lighter
   #536DFE on hover), light-blue hover on inputs (#90CAF9), and square
   checkboxes / round radio buttons with white borders that fill indigo
   when chosen.

   Dark is the default. People whose device is set to light mode get the
   same design in light colours (the second block of variables below).

   Sections: 1 colours · 2 base · 3 header & nav · 4 forms & controls ·
             5 buttons · 6 cards, tables, lists · 7 home tabs & events ·
             8 availability · 9 calendar · 10 settings layout · 11 small screens
   ========================================================================== */

/* 1. Colours ---------------------------------------------------------------- */
:root {
  --bg: #111;
  --surface: #1a1a1a;
  --surface-2: #222;
  --text: #fff;
  --text-soft: #eee;
  --muted: #999;
  --line: #333;
  --divider: #ccc;
  --control-border: #fff;     /* inputs, checkboxes and radios */
  --accent: #3d5afe;          /* buttons, checked controls */
  --accent-hover: #536dfe;
  --accent-text: #fff;
  --hover: #90caf9;           /* hover/focus on inputs */
  --good: #69d08f;
  --warn: #f0c060;
  --bad: #ff7b72;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.4);
  --block-detail: #1f2a4d;    /* name builder: event details (weekday, time...) */
  --block-category: #2a3d24;  /* name builder: category slots */
  --block-condition: #3a2850; /* name builder: If / Otherwise / End if */
  --condition-line: #b48cf2;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fa;
    --surface: #fff;
    --surface-2: #eef0f7;
    --text: #111;
    --text-soft: #222;
    --muted: #5f6368;
    --line: #dcdde3;
    --divider: #c6c8d0;
    --control-border: #111;
    --accent: #3d5afe;
    --accent-hover: #536dfe;
    --accent-text: #fff;
    --hover: #1e88e5;
    --good: #1e7b4f;
    --warn: #8a5a00;
    --bad: #b3261e;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.16);
    --block-detail: #e3e8ff;
    --block-category: #e2f3e0;
    --block-condition: #efe6fb;
    --condition-line: #6a3fb5;
    color-scheme: light;
  }
}

/* 2. Base ------------------------------------------------------------------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font: 15px/1.5 Arial, sans-serif;
}
h1, h2, h3, legend, .brand-name { font-family: Verdana, sans-serif; }
h1 { font-size: 30px; margin: 24px 0 12px; }
h2 { font-size: 19px; margin: 24px 0 10px; }
h3 { font-size: 16px; }
a { color: var(--hover); }
a:hover { color: var(--accent-hover); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.875rem; font-style: italic; }
.breadcrumb { margin: 16px 0 0; font-size: 0.9rem; }
.breadcrumb + h1, .breadcrumb + .page-head { margin-top: 6px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
hr { border: 1px solid var(--divider); border-radius: 10px; }
:focus-visible { outline: 2px solid var(--hover); outline-offset: 2px; }

/* 3. Header & navigation ---------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.brand-name { font-weight: bold; font-size: 18px; }
.logos { display: flex; align-items: center; }
.logos img { height: 44px; width: auto; display: block; }
.logo-divider { background: var(--divider); width: 1px; height: 32px; margin: 0 14px; border-radius: 30px; } /* the survey's thin line between logos */
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nav a, .nav button.link { padding: 6px 14px; border-radius: 30px; text-decoration: none; color: var(--text-soft); }
.nav a:hover, .nav button.link:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.nav form { margin: 0; }
.org-switch { display: flex; gap: 8px; align-items: center; padding-bottom: 10px; font-size: 0.9rem; }
.org-switch select { width: auto; }

/* Messages after an action ("Saved", "Something went wrong") */
.messages { list-style: none; padding: 0; margin: 16px 0; }
/* "Skip to content": off screen until a keyboard user tabs to it. */
.skip-link { position: absolute; left: -10000px; top: 8px; z-index: 10; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-text); }
.skip-link:focus { left: 8px; }
.msg { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); margin: 0 0 8px; }
.msg-success { border-color: var(--good); }
.msg-warning, .msg-error { border-color: var(--bad); }
.msg-info { border-color: var(--accent); }

/* 4. Forms & controls -------------------------------------------------------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: bold; font-size: 17px; padding: 0; margin-bottom: 10px; }
.stack > div, fieldset > div { margin-bottom: 14px; }
.stack label, fieldset > div > label { display: block; font-weight: bold; margin-bottom: 5px; }
/* A single yes/no checkbox sits on the same line as its question, box first;
   its help text goes underneath. */
.stack > div:has(> input[type="checkbox"]), fieldset > div:has(> input[type="checkbox"]) { display: flex; flex-wrap: wrap; align-items: center; }
.stack > div:has(> input[type="checkbox"]) > input, fieldset > div:has(> input[type="checkbox"]) > input { order: -1; }
.stack > div:has(> input[type="checkbox"]) > label, fieldset > div:has(> input[type="checkbox"]) > label { display: inline; margin: 0; font-weight: normal; flex: 1 1 0; min-width: 0; }
.stack > div:has(> input[type="checkbox"]) > .helptext, fieldset > div:has(> input[type="checkbox"]) > .helptext,
.stack > div:has(> input[type="checkbox"]) > .errorlist, fieldset > div:has(> input[type="checkbox"]) > .errorlist { order: 1; flex-basis: 100%; margin-left: 28px; }
.narrow { max-width: 460px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > div { flex: 1 1 200px; }
.helptext { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.errorlist { color: var(--bad); padding-left: 18px; margin: 4px 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%;
  max-width: 460px;
  padding: 10px;
  border: 2px solid var(--control-border);
  border-radius: 5px;
  background-color: var(--bg);
  color: var(--text-soft);
  font: inherit;
  outline: none;
}
textarea { max-width: 100%; }
/* Short values get short boxes, so a date or a number isn't a long empty bar. */
input[type="number"] { max-width: 9em; }
input[type="date"], input[type="time"], input[type="datetime-local"] { width: auto; max-width: 100%; }
input:hover, select:hover, textarea:hover { border-color: var(--hover); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-hover); }
::placeholder { color: var(--muted); opacity: 1; }
input.copy { max-width: 100%; font-family: ui-monospace, monospace; font-size: 0.85rem; }
.copy-row input.copy { flex: 1 1 auto; min-width: 0; }

/* The survey's checkboxes and radios: drawn by hand, filled indigo when chosen. */
input[type="radio"], input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid var(--control-border);
  background-color: transparent;
  cursor: pointer;
  margin: 0 10px 0 0;
  vertical-align: middle;
  position: relative;
}
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }
input[type="radio"]:hover, input[type="checkbox"]:hover { background-color: var(--hover); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background-color: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::before {
  content: "✔";
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
input[type="radio"]:checked::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
}
/* Lists of checkboxes/radios that Django prints (tags, people, reminders...) */
.stack div > div > label, fieldset div > div > label, .check-list label, .choices label {
  display: inline-flex; align-items: center; font-weight: normal; margin: 6px 0;
}
[id$="_tags"] > div, [id$="_assignees"] > div, [id$="_reminders"] > div, [id$="_weekdays"] > div, [id$="_members"] > div, [id$="_teams"] > div {
  margin: 0;
}
[id$="_tags"], [id$="_assignees"], [id$="_members"] { columns: 2 220px; }
[id$="_weekdays"], [id$="_reminders"] { display: flex; flex-wrap: wrap; gap: 0 20px; }

/* 5. Buttons: the survey's indigo pills ---------------------------------------- */
button, .button {
  display: inline-block;
  padding: 10px 20px;
  font: bold 15px Arial, sans-serif;
  background: var(--accent);
  color: var(--accent-text);
  border: 2px solid var(--accent);
  border-radius: 30px;
  box-shadow: var(--shadow);
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s;
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); box-shadow: var(--shadow-hover); }
button.big, .button.big { padding: 16px 28px; font-size: 18px; }       /* the survey's Submit button */
button.small, .button.small { padding: 5px 14px; font-size: 0.85rem; }
button.secondary, .button.secondary { background: transparent; color: var(--text); border-color: var(--divider); box-shadow: none; }
button.secondary:hover, .button.secondary:hover { border-color: var(--hover); background: transparent; color: var(--text); }
button.danger, .button.danger { background: transparent; color: var(--bad); border-color: var(--bad); box-shadow: none; }
button.danger:hover, .button.danger:hover { background: var(--bad); color: #fff; }
button.link { background: none; border: 0; box-shadow: none; padding: 0; font-weight: normal; color: var(--hover); }
/* Buttons in a row: .actions lays out buttons, links and one-button forms
   side by side with even gaps, wrapping on narrow screens. A form inside it
   (or any form.inline) sits in the row too, its own buttons spaced alike. */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.actions > * { margin: 0; }
.actions form, .row-actions form, form.inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; vertical-align: middle; }
form.inline input[type="text"] { width: auto; min-width: 9em; }
/* The row of buttons at the end of a form. */
.stack > .actions, form > .actions { margin-top: 18px; }
.push-right { margin-left: auto; }
/* A page title with its buttons on the same line (they wrap under it on phones). */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 24px 0 12px; }
.page-head h1 { margin: 0; }
.submit-bar { text-align: center; margin: 32px 0; }
/* With JavaScript, filter forms apply as soon as you click, so their button hides;
   shortcuts that need JavaScript only appear when it's running. */
.js .js-hide { display: none; }
.js-only { display: none !important; }
.js .js-only { display: flex !important; }

/* 6. Cards, tables, lists ----------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin: 16px 0; }
.card > h2:first-child, .card > legend:first-child { margin-top: 0; }
.card > :last-child, .card > form > :last-child, fieldset.card > div:last-child { margin-bottom: 0; }
fieldset.card { padding-top: 16px; }
/* Keep a card's heading inside the box (a legend normally sits on its border). */
fieldset.card > legend { float: left; width: 100%; }
fieldset.card > legend + * { clear: both; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.85rem; color: var(--muted); font-weight: normal; }
.table select { width: auto; }
.table tbody tr:last-child td { border-bottom: 0; }
.table form.inline { flex-wrap: nowrap; }
.table-scroll, .calendar-scroll { overflow-x: auto; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
/* In a table the cell itself must stay a table cell, so its buttons line up
   with the row instead of the cell turning into a box of its own. */
td.row-actions { display: table-cell; text-align: right; white-space: nowrap; width: 1%; }
td.row-actions > a, td.row-actions > form { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.row-error td { color: var(--bad); }
.row-skip td { color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.tag { display: inline-block; font-size: 0.8rem; padding: 1px 10px; border-radius: 30px; background: var(--surface-2); border: 1px solid var(--line); margin: 1px 2px; }
.badge, .person { display: inline-block; font-size: 0.8rem; padding: 1px 10px; border-radius: 30px; border: 1px solid var(--line); }
.badge-confirmed, .status-confirmed.person { border-color: var(--good); color: var(--good); }
.badge-pending { border-color: var(--warn); color: var(--warn); }
.badge-declined, .status-declined.person { border-color: var(--bad); color: var(--bad); }
.status-declined.person { text-decoration: line-through; }
.steps li { margin-bottom: 8px; }
/* Cards side by side on wide screens (e.g. Repeating events), one per row on phones. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 16px 0; }
.card-grid > .card { margin: 0; display: flex; flex-direction: column; }
.card-grid > .card > .actions:last-child { margin-top: auto; padding-top: 8px; }
.card-grid > .card h2 a { color: var(--text); text-decoration: none; }
.card-grid > .card p { margin: 4px 0 8px; }
.card-grid > .card h2 a:hover { color: var(--hover); }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

/* 7. Home & event lists ------------------------------------------------------- */
.events { list-style: none; padding: 0; margin: 0; }
.event { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
.events.compact .event { background: transparent; border-color: var(--line); }
.event .when { font-weight: bold; }
.event .when span { display: block; font-weight: normal; color: var(--muted); font-size: 0.875rem; }
.event-title { font-weight: bold; font-size: 16px; color: var(--text); text-decoration: none; }
a.event-title:hover { color: var(--hover); }
.event .people { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.day { border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-top: 26px; }
.requirement-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.requirement-head h2 { margin: 0; }
.requirement.is-due { border-color: var(--bad); }
.requirement.is-met { border-color: var(--good); }

/* Short intro under a page title */
.lead { color: var(--text-soft); max-width: 70ch; }

/* Settings overview: one tile per section */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); }
.tile span { color: var(--muted); font-size: 0.9rem; }
.tile:hover { border-color: var(--accent); color: var(--text); }
.settings-nav .overview { font-weight: bold; }

/* Name builder (templates/settings/_name_builder.html, app.js part 5) and
   the rules table. Words are grey, details blue, categories green. */
.js .name-builder.js-only { display: block !important; }
.name-builder { margin: -6px 0 14px; }
.name-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 8px; border: 2px dashed var(--line); border-radius: 12px; background: var(--bg); }
.block { display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px 3px 12px; border-radius: 8px; border: 1px solid var(--line); font: 0.9rem Arial, sans-serif; color: var(--text); background: var(--surface-2); box-shadow: none; }
.blocks-cell .block, .lead .block { padding: 2px 10px; margin: 1px 2px; }
.block-detail { background: var(--block-detail); border-color: var(--accent); }
.block-category { background: var(--block-category); border-color: var(--good); font-weight: bold; }
.block-unknown { border-color: var(--bad); color: var(--bad); }
.name-strip .block { cursor: grab; }
.name-strip .block.drop-here { outline: 2px solid var(--hover); }
.name-strip .block-text input { width: auto; min-width: 0; padding: 2px 6px; border: 0; border-bottom: 1px solid var(--muted); border-radius: 0; background: transparent; color: var(--text); font: inherit; }
.block-control { padding: 0 5px; min-width: 0; font: bold 0.95rem Arial, sans-serif; background: transparent; color: var(--muted); border: 0; box-shadow: none; }
.block-control:hover { background: transparent; color: var(--text); box-shadow: none; }
button.block-button { padding: 4px 12px; cursor: pointer; }
button.block-button:hover { border-color: var(--hover); color: var(--text); box-shadow: none; }
button.block-button.block-detail:hover { background: var(--block-detail); }
button.block-button.block-category:hover { background: var(--block-category); }
/* If / Otherwise / End if: purple, with a square left edge so they read as
   brackets around the words they control, not as words themselves. */
.block-condition { background: var(--block-condition); border-color: var(--condition-line); border-left-width: 4px; font-style: italic; }
button.block-button.block-condition:hover { background: var(--block-condition); }
.name-problem { margin: -4px 0 10px; color: var(--bad); font-weight: bold; }
.if-help { display: block; margin-top: 4px; }
button.block-button.block-text:hover { background: var(--surface-2); }
.name-preview { margin: 6px 0 10px; }
.name-strip .strip-break { flex-basis: 100%; height: 0; }
.name-strip .block-newline { opacity: 0.75; font-style: italic; }
.palette { display: grid; gap: 8px; }
.palette-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.palette-label { width: 6.5em; color: var(--muted); font-size: 0.85rem; }
.variables-help { margin: 0 0 14px; }
.variables-help summary { cursor: pointer; color: var(--hover); }
.rules-table td.order { white-space: nowrap; width: 1%; }
.rules-table td.order form { display: inline; }
.filter-group { width: 100%; margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; }
.filter-group:first-child { margin-top: 0; }

/* Roles and skill levels (admins only; scheduling/staffing.py) */
dialog.advanced { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 20px 24px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-hover); }
dialog.advanced::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog.advanced h2 { margin-top: 0; }
/* Without JavaScript there's no pop-up: show its fields in the page. */
html:not(.js) dialog.advanced { display: block; position: static; width: auto; max-height: none; box-shadow: none; padding: 0; border: 0; margin: 12px 0 0; }
.roles-table td { padding: 6px 8px; }
.roles-table input[type="text"] { width: 100%; }
.skill { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 6px; border: 1px solid var(--muted); color: var(--muted); font: bold 0.8rem Arial, sans-serif; text-align: center; }
.staffing .problems { margin: 6px 0; padding-left: 20px; color: var(--warn); }
.staffing p { margin: 4px 0; }
.needs-attention { margin: 6px 0 0; color: var(--warn); font-size: 0.875rem; }
.person .role { color: var(--muted); }
.person-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; flex: 1 1 260px; cursor: pointer; }
.role-pick { width: auto; max-width: 100%; }
.logo-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 20px; }
/* Folded sections ({% more %}, templates/layout/more.html): a quiet bar
   with a summary of what's inside; click to open. */
details.more { margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
details.more > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 20px; cursor: pointer; list-style: none; border-radius: 12px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "\25B8"; display: inline-block; align-self: center; color: var(--muted); width: 1em; transition: transform 0.15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary:hover { background: var(--surface-2); }
details.more > summary:focus-visible { outline: 2px solid var(--hover); outline-offset: 2px; }
.more-title { font: bold 17px Arial, sans-serif; }
.more-hint { color: var(--muted); font-size: 0.9rem; }
details.more[open] .more-hint { display: none; }
.more-body { padding: 0 20px 18px; }
.more-body > :last-child { margin-bottom: 0; }
fieldset.card.has-error, details.more:has(.errorlist) { border-color: var(--bad); }
.field-check { margin-bottom: 10px; }
/* A field's label always sits above its box, however short the box is. */
.field:not(.field-check) > label { display: block; font-weight: bold; margin-bottom: 5px; }
/* Settings > Email */
.email-preview { margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: var(--bg); overflow-wrap: anywhere; }
.domain-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 1.1rem; }
.dns-steps h3 { margin: 18px 0 6px; font-size: 1rem; }
.dns-records { display: grid; gap: 12px; margin: 14px 0; }
.dns-record { padding: 12px 16px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; background: var(--bg); }
.dns-record.state-ok { border-left-color: var(--good); }
.dns-record.state-wrong { border-left-color: var(--bad); }
.dns-record-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; }
.dns-record .ok { color: var(--good); font-weight: bold; }
.dns-record .no { color: var(--bad); font-weight: bold; }
.dns-record .msg { margin: 10px 0 0; }
.dns-fields { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 8px 12px; margin: 10px 0 0; }
.dns-fields dt { color: var(--muted); padding-top: 6px; }
.dns-fields dd { margin: 0; min-width: 0; }
.dns-fields .copy-row { display: flex; gap: 6px; align-items: center; }
.dns-fields input.copy { flex: 1 1 auto; min-width: 0; max-width: none; }
.host-steps { margin: 6px 0; }
.host-steps summary { cursor: pointer; }
@media (max-width: 560px) { .dns-fields { grid-template-columns: 1fr; } .dns-fields dt { padding-top: 0; } }
/* Home: the two reminders at the top. Amber edge = something to do,
   green = done, plain = nothing required. */
.reminders { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 8px 0 24px; }
.reminder { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title go" "status go"; align-items: center; gap: 4px 12px; padding: 16px 20px; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.reminder:hover { border-color: var(--hover); box-shadow: var(--shadow-hover); }
.reminder.state-due { border-left-color: var(--warn); }
.reminder.state-done { border-left-color: var(--good); }
.reminder-title { grid-area: title; font: bold 18px Arial, sans-serif; }
.reminder-status { grid-area: status; color: var(--muted); }
.reminder.state-due .reminder-status { color: var(--warn); font-weight: bold; }
.reminder-go { grid-area: go; font-size: 1.4rem; color: var(--muted); }
.more-link { margin: 10px 0 0; }
.calendar-preview .preview-title { font-weight: bold; font-size: 16px; margin: 0 0 2px; }
.calendar-preview .preview-details { margin: 8px 0 0; padding-left: 12px; border-left: 3px solid var(--line); }
.field[hidden] { display: none; }
.logo-preview { display: block; height: 44px; width: auto; margin-bottom: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }

/* Availability: "answer everything as" shortcut */
.fill-bar { flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }

/* Home sections, read top to bottom */
.section { margin: 28px 0; }
.section > h2 { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.count { display: inline-block; min-width: 1.6em; padding: 0 8px; border-radius: 30px; background: var(--accent); color: var(--accent-text); font: bold 0.8rem Arial, sans-serif; text-align: center; line-height: 1.6; }

/* Schedule people: grouped by answer, one row per person */
.legend-note { font-size: 0.9rem; }
.person-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.person-row:last-child { border-bottom: 0; }
.person-row:hover .person-name { color: var(--hover); }
.person-name { font-weight: bold; }
.person-stats { color: var(--muted); font-size: 0.9rem; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }

/* 8. Availability: each event like a survey question ------------------------------ */
.filters-card .check-list { display: flex; flex-wrap: wrap; gap: 0 24px; }
/* The question (event) on the left, its three choices on the same line to the right. */
.availability-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; margin: 8px 0; }
.availability-row.unanswered { border-left: 4px solid var(--accent); }
.availability-row .question { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.availability-row .question .muted { font-size: 0.9rem; }
.availability-row .choices { display: flex; flex-wrap: wrap; gap: 4px 22px; flex: 0 0 auto; }
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.filters select { width: auto; }

/* 9. Month calendar ------------------------------------------------------------- */
.calendar { width: 100%; min-width: 620px; table-layout: fixed; border-collapse: collapse; background: var(--surface); }
.calendar th { font-size: 0.8rem; color: var(--muted); padding: 6px; font-weight: normal; }
.calendar td { border: 1px solid var(--line); vertical-align: top; height: 100px; padding: 4px; }
.calendar td.other { opacity: 0.4; }
.calendar td.today .daynum { background: var(--accent); color: var(--accent-text); border-radius: 30px; display: inline-block; min-width: 1.7em; text-align: center; }
.daynum { font-size: 0.8rem; font-weight: bold; }
.cal-event { display: block; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: var(--text-soft); margin-top: 2px; padding: 1px 4px; border-radius: 4px; }
.cal-event:hover { background: var(--surface-2); }
.cal-event.mine, .cal-key { background: var(--accent); color: var(--accent-text); }
.cal-key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; }

/* 10. Settings layout: sidebar + section ----------------------------------------- */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; margin-top: 16px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; align-self: start; }
.settings-nav .nav-group { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 16px 0 4px 12px; }
.settings-nav .nav-group:first-child { margin-top: 0; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text-soft); }
.settings-nav a:hover { background: var(--surface-2); }
.settings-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.settings-body h1, .settings-body > .page-head:first-child { margin-top: 0; }
.settings-body > .breadcrumb { margin-top: 0; }

/* 10b. Getting started: landing page, new-organization requests, setup
   guide, the tour (templates/onboarding/) ----------------------------------------- */
.nav a.nav-primary { background: var(--accent); color: var(--accent-text); }
.nav a.nav-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.landing { max-width: 720px; margin: 7vh auto 40px; text-align: center; }
.landing h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.2; margin-bottom: 12px; }
.landing .lead { margin: 0 auto 24px; font-size: 1.1rem; }
.landing .actions { justify-content: center; }
.landing-points { list-style: none; padding: 0; margin: 40px 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; text-align: left; }
.landing-points li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--text-soft); }
.landing-points strong { display: block; color: var(--text); margin-bottom: 4px; }
.narrow-page { max-width: 620px; }
/* The form field only bots fill in: off screen, not just invisible. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { min-height: 65px; }
.status-link { word-break: break-all; padding: 10px 14px; background: var(--surface-2); border-radius: 8px; }
.request-state { display: inline-block; padding: 4px 14px; border-radius: 30px; font-weight: bold; border: 1px solid var(--line); }
.request-state.state-pending { border-color: var(--warn); color: var(--warn); }
.request-state.state-approved { border-color: var(--good); color: var(--good); }
.request-state.state-declined { border-color: var(--bad); color: var(--bad); }
.request-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.request-actions form { margin: 0; }
.request-actions .decline { display: flex; gap: 8px; flex: 1 1 320px; }
.request-actions .decline input { flex: 1; min-width: 0; }
.plain-list { padding-left: 1.2em; }
.small { font-size: 0.85rem; }
progress { width: 100%; height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 6px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 6px; }
.progress { display: flex; align-items: center; gap: 12px; margin: 8px 0 20px; }
.progress progress { flex: 1; }
.progress span { white-space: nowrap; color: var(--muted); }
.setup-steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.setup-step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.step-mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: bold; color: var(--accent-text); }
.setup-steps:not(.optional) { counter-reset: step; }
.setup-steps:not(.optional) .setup-step:not(.is-done) .step-mark::before { counter-increment: step; content: counter(step); color: var(--muted); font-size: 0.85rem; }
.setup-steps:not(.optional) .setup-step.is-done .step-mark { counter-increment: step; }
.setup-step.is-done .step-mark { background: var(--good); border-color: var(--good); }
.step-text { display: grid; gap: 2px; }
.step-title { font-weight: bold; text-decoration: none; color: var(--text); }
.step-title:hover { color: var(--hover); }
.setup-step.is-done .step-title { color: var(--text-soft); }
.step-actions form { margin: 0; }
.setup-card { border-left: 5px solid var(--accent); }
.setup-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.setup-card-head h2 { margin: 0 0 8px; }
.setup-card progress { margin-bottom: 4px; }
.tour { border-left: 5px solid var(--good); }
.tour-steps { padding-left: 1.4em; display: grid; gap: 10px; margin: 8px 0 16px; }
.tour-steps strong { display: block; }

/* 11. Small screens --------------------------------------------------------------- */
@media (max-width: 720px) {
  h1 { font-size: 24px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  /* The settings menu becomes one row you can swipe sideways, instead of a
     tall stack of buttons above every page. */
  .settings-nav { position: static; flex-direction: row; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: thin; }
  .settings-nav .nav-group { display: none; }
  .settings-nav a { flex: none; white-space: nowrap; border: 1px solid var(--line); border-radius: 30px; padding: 6px 12px; }
  .nav { gap: 2px; }
  .nav a, .nav button.link { padding: 6px 10px; }
  .event { grid-template-columns: 1fr; gap: 6px; }
  .table { display: block; overflow-x: auto; }
  .availability-row .choices { width: 100%; gap: 4px 18px; }
  .setup-step { grid-template-columns: 28px minmax(0, 1fr); }
  .step-actions { grid-column: 2; }
  .landing { margin-top: 24px; }
}
