/* DeineSchicht – light palette with the night indigo as ink, amber "bar light" for being on duty.
   One typeface (Bricolage Grotesque), mobile first. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 300 800; font-stretch: 100%; font-display: swap;
  src: url(fonts/bricolage-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 300 800; font-stretch: 100%; font-display: swap;
  src: url(fonts/bricolage-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --ink: #f3f4fa;          /* page: cool off-white */
  --ink-2: #ffffff;        /* raised surface */
  --ink-3: #eceef7;        /* control */
  --line: #d6dae9;
  --text: #1b2140;         /* the old night indigo, now as ink */
  --muted: #5f6684;
  --amber: #f2b544;        /* on duty */
  --amber-ink: #2a1d00;
  --amber-text: #a86d05;  /* amber as text on light surfaces */
  --ok: #27a86f;           /* ich kann */
  --part: #e39b1c;         /* teilweise */
  --no: #d9485b;           /* ich kann nicht */
  --fill-ok: #c8edd8;  --line-ok: #8fd3ae;
  --fill-part: #fde3a7; --line-part: #f0c463;
  --fill-no: #f9d3d8;  --line-no: #eba3ad;
  --duty: #14172b;         /* eingeplant: near black */
  --focus: #1b2140;
  --radius: 10px;
  --font: "Bricolage Grotesque", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.45;
  font-variation-settings: "opsz" 14; min-height: 100dvh;
}
b { font-weight: 800; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- layout ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.hours-page .month-nav { margin-bottom: 6px; }
.topbar {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 720px; margin: 0 auto; padding: 14px 16px 0;
}
.brand { color: var(--text); text-decoration: none; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a, .nav-group-btn {
  color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 500;
  background: none; border: 0; cursor: pointer; font-size: 17px; white-space: nowrap;
}
.nav a:hover, .nav-group-btn:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--ink-2); box-shadow: 0 1px 3px rgba(27, 33, 64, .12); }
.nav-group { position: relative; }
.nav-group-btn::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.nav-group.is-active .nav-group-btn { color: var(--text); }
.nav-sub { display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 160px; padding: 6px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(27, 33, 64, .15); z-index: 20; }
.nav-sub a { display: block; padding: 9px 12px; }
.nav-group:hover .nav-sub, .nav-group.open .nav-sub, .nav-group:focus-within .nav-sub { display: block; }
.nav-out { margin-left: 8px; }
.burger { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; padding: 10px; flex-direction: column; justify-content: space-between; }
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
@media (max-width: 760px) {
  .topbar { padding-top: 10px; }
  .burger { display: flex; }
  .nav { display: none; position: absolute; left: 12px; right: 12px; top: calc(100% + 6px); flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(27, 33, 64, .18); z-index: 20; }
  .nav.open { display: flex; }
  .nav a, .nav-group-btn { padding: 12px 14px; font-size: 17px; }
  .nav-group { display: contents; }
  .nav-group-btn { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; padding: 12px 14px 4px; cursor: default; border-top: 1px solid var(--line); margin-top: 6px; }
  .nav-group-btn::after { display: none; }
  .nav-sub { display: block; position: static; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; }
  .nav-sub a { padding-left: 24px; }
  .nav-out { margin: 6px 0 0; border-top: 1px solid var(--line); padding-top: 12px; border-radius: 0; }
  body.nav-open .burger span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
  body.nav-open .burger span:nth-child(2) { opacity: 0; }
  body.nav-open .burger span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }
}

/* ---------- controls ---------- */
.btn-primary {
  background: var(--amber); color: var(--amber-ink); border: 0; border-radius: var(--radius);
  padding: 14px 20px; font-weight: 700; font-size: 17px; cursor: pointer; width: 100%;
}
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  background: var(--ink-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; font-weight: 500; cursor: pointer; min-width: 44px;
}
label { display: block; color: var(--muted); font-weight: 500; }
input[type=email], input[type=password], input[type=text] {
  display: block; width: 100%; margin-top: 6px; padding: 13px 14px;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
input[type=time] {
  margin-left: 6px; padding: 10px 12px; background: var(--ink-3); border: 1px solid var(--line);
  border-radius: 8px; color: var(--text); font-variant-numeric: tabular-nums;
}
.form-error { color: var(--no); margin: 0; font-weight: 500; }

/* ---------- login ---------- */
.login { max-width: 400px; margin: 10vh auto 0; }
.login-title { font-size: 44px; font-weight: 400; letter-spacing: -0.02em; margin: 0 0 30px; line-height: 1.05;
  font-variation-settings: "opsz" 96; }
.login-sub { color: var(--muted); margin: 10px 0 34px; font-size: 19px; }
.login-form { display: grid; gap: 18px; }
.login-help { color: var(--muted); text-align: center; text-decoration: none; }
.login-help:hover { color: var(--text); text-decoration: underline; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }
.cal-title { font-size: 34px; font-weight: 400; letter-spacing: -0.02em; margin: 0; font-variation-settings: "opsz" 96; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav .btn-ghost { padding: 8px 12px; font-size: 18px; }
.cal-hint { color: var(--muted); margin: 6px 0 18px; }
.month-nav { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; margin: 6px 0 16px; }
.month-nav .cal-title { text-align: center; font-size: 28px; }
.month-nav .btn-ghost { padding: 8px 0; font-size: 20px; }
.month-nav .cal-title small { display: block; font-size: 15px; color: var(--muted); font-variation-settings: "opsz" 14; margin-top: 2px; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekdays span { color: var(--muted); font-size: 14px; text-align: center; padding-bottom: 4px; }
.cal-weekdays span:nth-child(n+6) { color: var(--text); }
.day {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 1 / 1.15; padding: 7px 7px 6px; border-radius: var(--radius);
  background: var(--ink-2); border: 1px solid var(--line); cursor: pointer; text-align: left;
  transition: transform .12s ease, border-color .12s ease;
}
.day:hover { border-color: var(--muted); }
.day:active { transform: scale(.96); }
.day-pad { background: none; cursor: default; }
.day .num { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.day.past { cursor: default; }
.day.past .num { color: var(--muted); font-weight: 500; }
.day.past:not(.assigned) { background-image: repeating-linear-gradient(135deg, rgba(27, 33, 64, .07) 0 2px, transparent 2px 8px); }
/* availability states: the whole tile is filled */
.day.s1 { background: var(--fill-ok); border-color: var(--line-ok); }
.day.s2 { background: var(--fill-part); border-color: var(--line-part); }
.day.s3 { background: var(--fill-no); border-color: var(--line-no); }
.day .part { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
/* on duty: black tile, white text */
.day.assigned { background: var(--duty); color: #fff; border-color: var(--duty); }
.day.assigned .shift { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.day.assigned.past .num { color: #c9cce0; }
.day.today .num { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
@media (max-width: 400px) { .day { padding: 5px; } .day .num { font-size: 15px; } }
@media (min-width: 761px) { .day { aspect-ratio: 1 / 0.85; } }

.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.cal-legend li { display: flex; align-items: center; gap: 8px; }
.dot { width: 18px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid transparent; }
.dot-1 { background: var(--fill-ok); border-color: var(--line-ok); }
.dot-2 { background: var(--fill-part); border-color: var(--line-part); }
.dot-3 { background: var(--fill-no); border-color: var(--line-no); }
.dot-shift { background: var(--duty); border-color: var(--duty); }

.shifts { margin-top: 32px; }
.shifts-title { font-size: 20px; font-weight: 500; margin: 0 0 10px; }
.shift-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shift-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 12px 14px;
  background: var(--ink-2); border-left: 4px solid var(--duty); border-radius: 0 var(--radius) var(--radius) 0;
}
.shift-when { font-weight: 600; }
.shift-time { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; grid-row: span 2; align-self: center; }
.shift-what { color: var(--muted); font-size: 15px; }
.shift-what em { font-style: normal; color: var(--no); }

/* ---------- bottom sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 10; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(27, 33, 64, .45); opacity: 0; transition: opacity .2s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 760px;
  background: var(--ink-2); border-radius: 20px 20px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .22s ease;
  box-shadow: 0 -10px 40px rgba(27, 33, 64, .25);
}
@media (min-width: 761px) { .sheet-panel { bottom: 10vh; border-radius: 20px; } }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: translateY(0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet-date { font-size: 26px; font-weight: 500; margin: 0 0 6px; letter-spacing: -0.01em; }
.sheet-note { color: var(--muted); margin: 0 0 12px; }
.choice { display: grid; gap: 8px; margin: 12px 0; }
.choice button {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left;
  background: var(--ink-3); border: 2px solid transparent; border-radius: var(--radius); font-weight: 600; cursor: pointer;
}
.choice button::before { content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none; }
.choice-1::before { background: var(--ok); } .choice-2::before { background: var(--part); } .choice-3::before { background: var(--no); }
.choice button[aria-checked="true"] { border-color: var(--text); background: var(--ink-2); }
.times { display: flex; gap: 14px; align-items: center; margin: 4px 0 12px; color: var(--muted); }
.times label { display: flex; align-items: center; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content; max-width: min(520px, calc(100% - 32px)); background: var(--duty); color: #fff;
  padding: 12px 16px; border-radius: 12px; font-weight: 500; font-size: 15px; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(27, 33, 64, .3); z-index: 40; text-align: left;
}
@media (min-width: 761px) { .toast { bottom: 28px; } }

/* ---------- plan (admin week) ---------- */
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 18px; }
.plan-status { margin: 0; color: var(--muted); }
.plan-status.warn { color: var(--amber-ink); background: var(--amber); padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-inline { width: auto; padding: 10px 16px; }
.btn-primary.btn-inline:disabled { background: var(--ink-3); color: var(--muted); }
.btn-ghost:disabled { opacity: .5; cursor: default; }
.btn-danger { color: var(--no); border-color: transparent; }
.btn-small { padding: 7px 11px; font-size: 15px; min-width: 0; }
.select {
  padding: 10px 12px; background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  width: 100%; margin-top: 6px;
}
.plan-actions .select { width: auto; margin: 0; }
.week { display: grid; gap: 10px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, 1fr); gap: 8px; } .page:has(.plan) { max-width: 1280px; } .topbar:has(+ .page .plan) { max-width: 1280px; } }
.day-col { display: grid; gap: 6px; align-content: start; }
.day-col.past { opacity: .6; }
.day-head { font-size: 17px; font-weight: 600; margin: 4px 0 2px; }
.day-col.today .day-head { color: var(--amber-text); }
.shift-card {
  display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: var(--radius); cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--line); color: var(--text); box-shadow: 0 1px 2px rgba(27, 33, 64, .06);
}
.shift-card:hover { border-color: var(--muted); }
.shift-card.open { border-color: var(--amber); border-style: dashed; }
.shift-card.draft .sc-time::after { content: " · Entwurf"; color: var(--muted); font-weight: 400; }
.sc-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-pos { color: var(--muted); font-size: 15px; }
.sc-crew { font-size: 15px; }
.shift-card.open .sc-crew { color: var(--amber-text); }
.sc-note { font-size: 14px; color: var(--muted); font-style: italic; }
.add-shift {
  background: none; border: 1px dashed var(--line); color: var(--muted); border-radius: var(--radius); padding: 9px; cursor: pointer;
}
.add-shift:hover { color: var(--text); border-color: var(--muted); }

.sheet-wide { max-width: 680px; max-height: calc(100dvh - 20px); overflow: auto; }
@media (min-width: 761px) { .sheet-wide { bottom: 4vh; max-height: 92dvh; } }
.shift-form { display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 input[type=time], .row2 input[type=number], .row2 input[type=text], .row2 input[type=tel], .row2 input[type=email] {
  display: block; width: 100%; margin: 6px 0 0; padding: 11px 12px; background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
.sheet-actions.three { grid-template-columns: auto 1fr 2fr; }
.sheet-actions.one { grid-template-columns: 1fr; }
.crew { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.crew-title { font-size: 20px; font-weight: 500; margin: 0 0 6px; }
.crew-group { font-size: 15px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.crew-group::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.crew-group.g-assigned::before { background: var(--amber); }
.crew-group.g-available::before { background: var(--ok); }
.crew-group.g-partial::before { background: var(--part); }
.crew-group.g-unavailable::before { background: var(--no); }
.crew-group em { font-style: normal; color: var(--amber-text); font-weight: 500; }
.crew-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.crew-item { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: center; padding: 9px 12px; background: var(--ink-3); border-radius: var(--radius); }
.ci-name { font-weight: 600; }
.ci-meta { color: var(--muted); font-size: 14px; grid-column: 1; }
.crew-item button { grid-column: 2; grid-row: 1 / span 2; }
.muted { color: var(--muted); }

.hours { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.hours td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.hours td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hours tr.over td { color: var(--amber-text); }

/* ---------- contacts ---------- */
.search-label { margin: 0 0 14px; }
.search {
  display: block; width: 100%; padding: 12px 14px; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); -webkit-appearance: none;
}
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contact {
  display: grid; grid-template-columns: 1fr; gap: 4px 14px; align-items: center;
  padding: 12px 14px; background: var(--ink-2); border-radius: var(--radius); border: 1px solid var(--line);
}
.c-body { display: grid; gap: 1px; min-width: 0; }
.c-name { font-weight: 600; }
.c-meta { color: var(--muted); font-size: 14px; }
.c-next { color: var(--amber-text); }
.c-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.c-btn {
  color: var(--text); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 999px;
  background: var(--ink-3); border: 1px solid var(--line); font-variant-numeric: tabular-nums; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.c-btn:hover { border-color: var(--muted); }
@media (min-width: 761px) {
  .contact { grid-template-columns: 1fr auto; }
  .c-actions { grid-column: 2; flex-direction: column; align-items: flex-end; }
}

/* segmented choice (Bereich) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--ink-3); border-radius: var(--radius); }
.seg button { background: none; border: 0; border-radius: 7px; padding: 9px 10px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--ink-2); color: var(--text); box-shadow: 0 1px 3px rgba(27, 33, 64, .15); }

/* ---------- profile ---------- */
.small { font-size: 14px; margin: 0; }
.form-block { display: grid; gap: 14px; padding: 18px 16px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.block-title { font-size: 20px; font-weight: 500; margin: 0 0 2px; }
.form-block input[type=text], .form-block input[type=email], .form-block input[type=tel], .form-block input[type=password] {
  display: block; width: 100%; margin-top: 6px; padding: 12px 13px; background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
.form-block .row2 input { margin: 6px 0 0; }
.consent { border: 0; padding: 0; margin: 4px 0 0; }
.consent legend { color: var(--muted); font-weight: 500; padding: 0; margin-bottom: 8px; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; padding: 8px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--amber); }
.form-block .btn-ghost { width: 100%; padding: 13px; }
.link { color: var(--muted); }
.link:hover { color: var(--text); }

/* ---------- team ---------- */
.flag { color: var(--amber-text); font-weight: 500; font-size: 13px; }
.c-meta.warn { color: var(--no); }
.lvl { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); vertical-align: middle; }
.lvl-1 { background: var(--muted); } .lvl-2 { background: var(--ok); } .lvl-3 { background: var(--amber); }
.pos-list { display: grid; gap: 8px; }
.pos-row { padding: 6px 0; }
.pos-name { font-weight: 500; }
.seg-small button { padding: 7px 8px; font-size: 13px; }
.inactive { margin-top: 20px; color: var(--muted); }
.inactive summary { cursor: pointer; padding: 8px 0; }
.inactive .contact-list { margin-top: 10px; opacity: .75; }
.invite-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 8px 0 10px; }
.btn-link { display: block; text-align: center; text-decoration: none; }
.team .btn-inline { padding: 10px 16px; }

.pos-admin { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.pos-admin-row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: center; padding: 8px 12px; background: var(--ink-2); border-radius: var(--radius); color: var(--text); }
.pos-admin-row .c-meta { grid-column: 1; }
.pos-admin-row button { grid-column: 2; grid-row: 1 / span 2; }
.pos-admin-row.off { opacity: .6; }

/* ---------- weekly template ---------- */
.legend-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.legend-row .cal-legend { margin: 0; }
.tpl-days { display: grid; gap: 8px; margin: 10px 0 14px; }
.tpl-row { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; align-items: center; }
.tpl-name { font-weight: 600; }
/* selected answer uses the same fill as the calendar tile */
.seg button.t1[aria-checked="true"] { background: var(--fill-ok); box-shadow: inset 0 0 0 1px var(--line-ok); color: var(--text); }
.seg button.t2[aria-checked="true"] { background: var(--fill-part); box-shadow: inset 0 0 0 1px var(--line-part); color: var(--text); }
.seg button.t3[aria-checked="true"] { background: var(--fill-no); box-shadow: inset 0 0 0 1px var(--line-no); color: var(--text); }
/* the row takes the colour of its answer, so the week reads like the calendar */
.wk-row[data-status="1"] { border-color: var(--line-ok); }
.wk-row[data-status="2"] { border-color: var(--line-part); }
.wk-row[data-status="3"] { border-color: var(--line-no); }
.tpl-times { grid-column: 2; margin: 0; }
.seg-small button { white-space: nowrap; }
@media (max-width: 640px) {
  .tpl-row { grid-template-columns: 1fr; gap: 4px; }
  .tpl-name { font-size: 15px; color: var(--muted); }
  .tpl-times { grid-column: 1; }
  .seg-small button { padding: 9px 2px; font-size: 13px; }
  .tpl-days { gap: 12px; }
}

/* ---------- week editor (full screen) ---------- */
.legend-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.week-editor { position: fixed; inset: 0; z-index: 12; background: var(--ink); overflow: auto; padding: 14px 16px calc(90px + env(safe-area-inset-bottom)); }
.week-head { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto 14px; }
.week-head .btn-ghost { padding: 8px 0; font-size: 20px; }
.week-title { text-align: center; font-size: 26px; }
.week-title small { display: block; font-size: 15px; color: var(--muted); font-variation-settings: "opsz" 14; margin-top: 2px; }
.week-days { display: grid; gap: 10px; max-width: 640px; margin: 0 auto; }
.wk-row { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; align-items: center; padding: 10px 12px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); }
.wk-row.past { opacity: .6; }
.wk-name { font-weight: 600; white-space: nowrap; }
.wk-name small { color: var(--muted); font-weight: 500; }
.wk-name em { font-style: normal; color: var(--muted); font-size: 13px; font-weight: 500; }
.wk-times { grid-column: 2; margin: 0; }
.wk-row.locked { background: var(--duty); border-color: var(--duty); color: #fff; }
.wk-row.locked .wk-name small { color: #c9cce0; }
.wk-locked { font-size: 15px; font-weight: 600; }
.week-foot { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--ink-2); border-top: 1px solid var(--line); z-index: 13; }
@media (min-width: 761px) { .week-foot { max-width: 640px; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; } }
@media (max-width: 640px) { .wk-row { grid-template-columns: 1fr; } .wk-times { grid-column: 1; } }
.hours-wrap { max-width: 640px; margin: 0 auto; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.hours th { text-align: left; color: var(--muted); font-weight: 500; font-size: 14px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.hours th.num { text-align: right; }
.hours tbody tr:last-child td { border-bottom: 0; }
.h-name { display: block; font-weight: 600; }
.h-bar { display: block; height: 4px; border-radius: 2px; background: var(--ink-3); margin-top: 5px; max-width: 220px; overflow: hidden; }
.h-bar i { display: block; height: 100%; background: var(--amber); }
.hours tr.over .h-bar i { background: var(--no); }
.week-foot.one { grid-template-columns: 1fr; }

/* ---------- confirm bar ---------- */
.confirm-bar { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); z-index: 30;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 36px rgba(27, 33, 64, .25); padding: 14px 16px; }
.confirm-q { margin: 0 0 12px; font-weight: 600; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .btn-primary { padding: 12px; }
.btn-danger-solid { background: var(--no); color: #fff; border: 0; border-radius: var(--radius); padding: 12px; font-weight: 700; cursor: pointer; }

/* ---------- footer + legal ---------- */
.foot { text-align: center; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); font-size: 14px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.legal { max-width: 68ch; line-height: 1.6; }
.legal h2 { font-size: 21px; font-weight: 600; margin: 28px 0 6px; }
.legal h3 { font-size: 17px; font-weight: 600; margin: 18px 0 4px; }
.legal p, .legal ul { margin: 0 0 10px; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--text); }

/* ---------- full-screen editor: fixed header and footer, scrolling body ---------- */
.screen { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; background: var(--ink); }
.screen-head { flex: none; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.screen-head .btn-ghost { padding: 8px 0; font-size: 20px; }
.screen-head-plain { grid-template-columns: 1fr; }
.screen-title { margin: 0; text-align: center; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.screen-title small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.screen-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 20px; }
.screen-body > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.screen-foot { flex: none; display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--ink-2); border-top: 1px solid var(--line); }
.screen-foot > * { width: 100%; }
@media (min-width: 761px) { .screen-head, .screen-foot { padding-left: calc(50% - 320px); padding-right: calc(50% - 320px); } }
.tpl-days { margin: 0; }
.c-wa { background: #e7f7ee; border-color: #b9e6cb; color: #12673a; }
.c-wa:hover { border-color: #25d366; }
.btn-block { display: block; text-align: center; text-decoration: none; padding: 13px; }

/* ---------- shift screen ---------- */
.shift-head { grid-template-columns: 48px 1fr 48px; }
.btn-x { font-size: 18px; line-height: 1; }
.shift-view { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); }
.sv-main { display: grid; gap: 2px; }
.sv-time { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.sv-what { color: var(--muted); }
.sv-note { font-style: italic; color: var(--muted); }
.shift-view + .crew, .crew { border-top: 0; padding-top: 0; margin-top: 20px; }
.link-danger { justify-self: start; background: none; border: 0; padding: 6px 0; color: var(--no); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.week-note { margin: 0 auto 12px; padding: 10px 14px; background: var(--ink-3); border-radius: var(--radius); color: var(--text); font-size: 15px; }
.profile-legal { text-align: center; margin: 8px 0 16px; }
