/* Shift requests - for people who rarely use a phone: large text, large targets, strong contrast,
 * one question per screen. Light only for now (a default, not tuned). Colours are variables here. */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #9ca3af;
  --primary: #1d4ed8;
  --primary-text: #ffffff;
  --focus: #f59e0b;
  --danger: #b91c1c;
  --warn-bg: #fef3c7; --warn-text: #78350f;
  --ok-bg: #d1fae5;   --ok-text: #065f46;
  --no-bg: #fee2e2;   --no-text: #991b1b;
  --off-bg: #e5e7eb;  --off-text: #374151;
  --radius: 14px;
  --tap: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 20px/1.4 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
h1:focus { outline: none; }

.topbar { max-width: 560px; margin: 0 auto; padding: 8px 16px 0; min-height: 8px; }
.homebtn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 6px 14px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 999px; font-weight: 700;
}
.homebtn .ic svg { width: 24px; height: 24px; display: block; }

main { max-width: 560px; margin: 0 auto; padding: 8px 16px 32px; }
.screen h1 { font-size: 28px; line-height: 1.25; margin: 12px 0 6px; }
.sub, .hint { margin: 0 0 12px; color: var(--muted); }
.flowname { margin: 4px 0 6px; color: var(--muted); font-size: 17px; font-weight: 700; }
.progress { height: 8px; background: var(--off-bg); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); }
.ctx { margin: 12px 0 0; padding: 10px 14px; background: var(--surface); border-inline-start: 6px solid var(--primary); border-radius: 8px; }

.choices { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.foot { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* The one button shape: icon at the start, a label and an optional second line */
.big {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: var(--tap); padding: 12px 16px; text-align: start;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}
.big:active { transform: translateY(1px); }
.big .ic svg { width: 32px; height: 32px; display: block; color: var(--primary); }
.big .tx { display: flex; flex-direction: column; }
.big .lb { font-size: 22px; font-weight: 700; }
.big .sb { font-size: 17px; color: var(--muted); }
.big.compact { min-height: 56px; }
.big.compact .lb { font-size: 20px; }
.big.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); justify-content: center; }
.big.primary .ic svg, .big.primary .sb { color: var(--primary-text); }
.big.secondary { background: transparent; }
.big.danger { background: var(--danger); border-color: var(--danger); color: #fff; justify-content: center; }
.big.back { background: transparent; justify-content: center; }
.big.back .ic svg { color: var(--text); }
.big[disabled] { opacity: .45; cursor: default; }
.big.urgent { border-inline-start: 10px solid var(--danger); }
.big.warn { background: #b45309; border-color: #b45309; }

.hrs { unicode-bidi: isolate; white-space: nowrap; }

/* Hour and minute pickers */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cell {
  min-height: 56px; background: var(--surface); border: 2px solid var(--line); border-radius: 10px;
  font-size: 20px; font-weight: 700; cursor: pointer;
}
.cell.tall { min-height: var(--tap); font-size: 24px; }

/* Toggles (days) and the letter strip */
.toggle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 6px; background: var(--surface);
  border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
}
.toggle .lb { font-weight: 700; }
.toggle .sb { font-size: 17px; color: var(--muted); }
.toggle[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.toggle[aria-pressed="true"] .sb { color: var(--primary-text); }
.toggle.wide { width: 100%; font-weight: 700; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; }
.letter {
  min-width: 48px; min-height: 48px; padding: 0 10px; background: var(--surface);
  border: 2px solid var(--line); border-radius: 10px; font-weight: 700; cursor: pointer;
}
.letter[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.search input, .note textarea {
  width: 100%; font: inherit; font-size: 22px; padding: 12px 14px;
  background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: var(--radius);
}
.note textarea { resize: vertical; min-height: 140px; }

/* Messages */
.flash {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--no-bg); color: var(--no-text); font-weight: 700;
}
.flash .ic svg, .privacy .ic svg { width: 26px; height: 26px; display: block; flex: none; }
.privacy { display: flex; gap: 8px; align-items: center; color: var(--muted); margin: 14px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.done { display: flex; justify-content: center; margin-top: 24px; }
.done .ic svg { width: 96px; height: 96px; color: var(--ok-text); background: var(--ok-bg); border-radius: 50%; padding: 16px; }

/* A request: summary lines and cards */
.what { font-weight: 700; font-size: 22px; margin: 12px 0 4px; }
.lines { margin: 8px 0 0; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.lines .row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--off-bg); }
.lines .row:last-child { border-bottom: 0; }
.lines dt { flex: 0 0 6.5em; color: var(--muted); font-weight: 700; }
.lines dd { margin: 0; flex: 1; }
.urg { font-weight: 700; color: var(--no-text); }
.lines .warnrow dd { color: var(--warn-text); font-weight: 700; }

.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 16px; }
.card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .what { margin: 0; }
.card .lines { border: 0; padding: 0; }
.card .big { margin-top: 10px; }
.pill { padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 17px; background: var(--off-bg); color: var(--off-text); }
.st-waiting .pill { background: var(--warn-bg); color: var(--warn-text); }
.st-approved .pill { background: var(--ok-bg); color: var(--ok-text); }
.st-declined .pill { background: var(--no-bg); color: var(--no-text); }
.st-approved { border-color: var(--ok-text); }
.st-declined { border-color: var(--no-text); }
.answer { margin: 8px 0 0; font-weight: 700; }

/* Typed hours and the note: a field, its live message, and suggestion chips */
.field { display: flex; flex-direction: column; gap: 6px; }
.flabel { font-weight: 700; font-size: 22px; }
input.time {
  width: 100%; font: inherit; font-size: 30px; font-weight: 700; text-align: center; letter-spacing: 1px;
  padding: 10px 14px; background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: var(--radius);
}
.sugg { display: flex; flex-wrap: wrap; gap: 8px; min-height: 4px; }
.chip {
  min-height: 48px; padding: 6px 14px; background: var(--surface); border: 2px solid var(--primary);
  border-radius: 999px; color: var(--primary); font-weight: 700; cursor: pointer;
}
.hmsg { margin: 4px 0 0; padding: 0; font-weight: 700; min-height: 1.4em; }
.hmsg.good { color: var(--ok-text); }
.hmsg.warn { color: var(--warn-text); background: var(--warn-bg); padding: 10px 14px; border-radius: var(--radius); }
.hmsg.bad { color: var(--no-text); background: var(--no-bg); padding: 10px 14px; border-radius: var(--radius); }
.loading { text-align: center; color: var(--muted); padding: 48px 0; font-size: 24px; }
.done.gate .ic svg { color: var(--muted); background: var(--off-bg); }

/* ---------- the admin page: denser, for a computer first, still usable on a phone ---------- */
body.admin { font-size: 17px; }
.admin .abar {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  max-width: 1000px; margin: 0 auto; padding: 12px 16px; font-size: 20px;
}
.admin .who { font-size: 15px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.admin main { max-width: 1000px; }
.tabs { display: flex; gap: 6px; max-width: 1000px; margin: 0 auto; padding: 0 16px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 14px; font-weight: 700; cursor: pointer; border-bottom: 4px solid transparent; white-space: nowrap; }
.tab[aria-current="true"] { border-bottom-color: var(--primary); color: var(--primary); }
.count { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 14px; }
.panel { padding-top: 8px; }
.panel h1 { font-size: 24px; } .panel h2 { font-size: 19px; margin: 20px 0 4px; }
.signin { max-width: 480px; margin: 24px auto; text-align: center; }
.gbtn { display: flex; justify-content: center; margin: 20px 0; min-height: 44px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 14px; background: var(--surface); color: var(--text);
  border: 2px solid var(--line); border-radius: 10px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn.small { min-height: 34px; padding: 2px 10px; font-size: 14px; }
.btn.ok { background: var(--ok-text); border-color: var(--ok-text); color: #fff; }
.btn.no { color: var(--no-text); border-color: var(--no-text); }
.btn.wa { background: #128c7e; border-color: #128c7e; color: #fff; }
.btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn[disabled] { opacity: .5; cursor: default; }
.filters, .row2, .addrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.admin .card { margin-top: 12px; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.urgentpill { background: var(--no-bg); color: var(--no-text); }
.warnpill { background: var(--warn-bg); color: var(--warn-text); }
.okmsg { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok-text); font-weight: 700; }
.reply, .admin textarea, .admin input[type="text"], .admin input[type="search"], .admin input:not([type]), .admin select {
  width: 100%; font: inherit; padding: 8px 10px; background: var(--surface); color: var(--text);
  border: 2px solid var(--line); border-radius: 10px;
}
.reply { margin-top: 10px; }
.addrow input { flex: 1 1 200px; width: auto; }
.slist { margin-top: 10px; }
.srow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--off-bg); }
.sname { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.muted { color: var(--muted); font-size: 15px; }
.sact { display: flex; gap: 8px; }
.linkbox { flex: 1 1 100%; background: var(--bg); border-radius: 10px; padding: 10px; }
.linkbox label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.shifts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.shiftrow { display: grid; grid-template-columns: 1.4fr 1.2fr .8fr .8fr auto; gap: 6px; align-items: center; }
@media (max-width: 560px) { .shiftrow { grid-template-columns: 1fr 1fr; } }
.hist { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 15px; }
.hist th, .hist td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--off-bg); vertical-align: top; }

@media (prefers-reduced-motion: reduce) { .big:active { transform: none; } }
