:root {
  --paper: #f7f6f2; --card: #ffffff; --ink: #1d2a24; --muted: #56625b; --line: #d6dad2;
  --ok: #2e6b4a; --warn: #a8402a; --accent: #c9962f;
  --slab: Rockwell, "Rockwell Nova", "Roboto Slab", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.45 var(--sans); padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--ink); }
h1, h2 { font-family: var(--slab); font-weight: 700; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.25rem; margin-top: 1.5rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { background: linear-gradient(rgba(29,42,36,.88), rgba(29,42,36,.94)), url(hero-small.jpg) center 70% / cover, var(--ink); color: var(--paper); padding: calc(env(safe-area-inset-top) + 12px) 16px 0; position: sticky; top: 0; z-index: 5; }
.top a { color: var(--paper); }
.top-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; max-width: 960px; margin: 0 auto; }
.brand { font-family: var(--slab); font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.logo { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.hero { margin: -8px 0 20px; }
.hero img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; display: block; }
.who { font-size: .9rem; opacity: .85; white-space: nowrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 960px; margin: 8px auto 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 12px 12px 10px; text-decoration: none; font-weight: 600; font-size: .95rem; border-bottom: 3px solid transparent; opacity: .8; }
.tabs a[aria-current="page"] { border-color: var(--accent); opacity: 1; }

main { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
.narrow { max-width: 420px; margin: 24px auto; }
.lead { font-size: 1.05rem; margin: 0 0 12px; max-width: 60ch; }
.muted { color: var(--muted); font-size: .92rem; }
.note { background: #fff6df; border: 1px solid #ecd9a6; border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; font-size: .95rem; }
.flash { background: var(--ink); color: var(--paper); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.error { color: var(--warn); font-weight: 600; }
.empty { color: var(--muted); padding: 16px 0; }
code { font-size: .8rem; word-break: break-all; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--accent); color: #1a1406; font: 700 1rem var(--sans); text-decoration: none; cursor: pointer; }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.big { min-height: 54px; width: 100%; font-size: 1.05rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
label.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; min-height: 44px; }
input, select { font: inherit; min-height: 46px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
input[type=checkbox] { min-height: auto; width: 22px; height: 22px; accent-color: var(--ok); }
input[type=color] { padding: 4px; width: 64px; }
.short { width: 90px; text-align: center; }
fieldset { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }

.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.monthnav h1 { margin: 0; text-align: center; }
.monthnav .btn { width: 46px; padding: 0; font-size: 1.4rem; }

.cal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-head span { text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.day { height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-direction: row; background: #eef0ea; border: 1.5px solid var(--line); cursor: pointer; user-select: none; }
.day.closed { background: transparent; border: 1.5px dashed var(--line); color: #a3aaa4; cursor: default; font-weight: 500; }
.daybox { position: absolute; opacity: 0; width: 1px; height: 1px; }
.daybox:checked + .day { background: var(--ok); border-color: var(--ok); color: #fff; }
.daybox:focus-visible + .day { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw.ok { background: var(--ok); } .sw.free { background: #eef0ea; border: 1px solid var(--line); } .sw.closed { border: 1px dashed #a3aaa4; }

.list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.item.block { display: block; }
.item-title { font-family: var(--slab); font-weight: 700; font-size: 1.1rem; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details[open] > summary { margin-bottom: 10px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px; margin: 0 0 16px; }
.box summary { font-weight: 700; }
.plain { margin: 0 0 10px; padding-left: 18px; }

.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #e7e9e3; font-weight: 700; font-size: .85rem; }
.pill.pub { background: var(--ok); color: #fff; }

.days { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.dayrow { display: grid; grid-template-columns: 8.5rem 1fr; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.dayrow.today { background: #fff6df; }
.dayrow-date { font-family: var(--slab); font-weight: 700; }
.dayrow-crew { display: flex; flex-direction: column; gap: 2px; }
.missing { color: var(--warn); font-weight: 700; }
.slots { display: flex; flex-wrap: wrap; gap: 14px; }
.slotgroup { display: flex; flex-direction: column; gap: 6px; min-width: 200px; flex: 1; }
select.unset { border-color: var(--warn); color: var(--warn); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.needs { border-collapse: collapse; }
.needs th, .needs td { padding: 4px 8px; text-align: left; }

@media (max-width: 560px) {
  .dayrow { grid-template-columns: 1fr; gap: 4px; }
  h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
