/* One small stylesheet for the front page, the legal pages, the manager area and the staff page. No fonts, no images, nothing from other sites.
   Mobile first: every page works at 375 px; the week grid shows from 700 px up and a day-at-a-time list replaces it below. Touch targets are at least 44 px, focus is always visible,
   text colours have at least AA contrast on their backgrounds (light and dark). */
:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1d2733; --muted: #566270; --line: #d5dae0;
  --accent: #0f766e; --accent-text: #ffffff; --link: #0b5f59; --ok: #17703f; --warn: #8a5a00; --err: #b3261e; --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181d; --card: #1c2229; --text: #e8ecf0; --muted: #a3adb8; --line: #36404a; --accent: #14b8a6; --accent-text: #0b1a18; --link: #5eead4; --ok: #5fcf95; --warn: #e6b956; --err: #ff9a90; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--link); }
h1 { font-size: 1.6rem; margin: 1rem 0 .4rem; line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; line-height: 1.3; }
h3 { font-size: 1.05rem; margin: 0 0 .3rem; }
p { margin: .4rem 0 .8rem; }
ul, ol { padding-left: 1.2rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
/* the page is a column flexbox and .wrap has auto side margins, so without a width a child with a wide minimum (the 900 px week grid) widened the whole page between 700 and about 930 px */
.page > .wrap { width: 100%; }
.small-page { max-width: 38rem; padding-top: 1rem; padding-bottom: 2rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.mt { margin-top: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sep { margin: 0 .5rem; }
.skip { position: absolute; left: -999px; top: 0; min-height: 44px; display: inline-flex; align-items: center; background: var(--accent); color: var(--accent-text); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---- page frame */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page main { flex: 1; padding-bottom: 2rem; }
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: .25rem 1rem; flex-wrap: wrap; padding-top: .35rem; padding-bottom: .35rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.brand img { display: block; height: 30px; width: auto; max-width: 100%; }
.navlinks { display: flex; gap: 0 .25rem; flex-wrap: wrap; align-items: center; margin-left: auto; }
.navlinks a { color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 .6rem; border-radius: 8px; }
.navlinks a:hover { text-decoration: underline; }
.navlinks a[aria-current="page"] { font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.signout { margin-left: .25rem; }
.switcher { padding-bottom: .5rem; }
.switcher form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.switcher select { width: auto; min-width: 12rem; }
.foot { border-top: 1px solid var(--line); padding-top: 1rem; padding-bottom: 1.5rem; color: var(--muted); font-size: .85rem; }
.foot a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }

/* ---- cards and layout bits */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: .8rem 0; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; }
.hero { padding: 2rem 0 1rem; }
.hero h1 { font-size: 2rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 42rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.plan ul { padding-left: 1.1rem; margin: .4rem 0; }
.price { font-size: 1.3rem; font-weight: 700; margin: .2rem 0; }
.doc { max-width: 46rem; padding-top: 1rem; }
.doc h2 { font-size: 1.1rem; }
.empty { color: var(--muted); padding: .6rem 0; }
.coffee { margin: .8rem 0 0; color: var(--muted); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1rem; }
.meta { color: var(--muted); font-size: .9rem; margin: .2rem 0 .6rem; }
.plain { white-space: pre-wrap; overflow-wrap: anywhere; }
.swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: 4px; background: var(--pos, var(--accent)); vertical-align: -2px; border: 1px solid var(--line); }
.linkbox { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; user-select: all; -webkit-user-select: all; }

/* ---- forms and buttons (every control is at least 44 px tall) */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; background: var(--accent); color: var(--accent-text); border: 2px solid var(--accent); border-radius: 8px; padding: .4rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-quiet, button.btn-quiet { background: transparent; color: var(--link); border-color: var(--link); }
.btn-small { padding: .3rem .8rem; font-size: .95rem; }
.btn-danger, button.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-danger, button.btn-danger { color: #14181d; } }
.linkish { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 0 .5rem; min-height: 44px; text-decoration: underline; }
.inline { display: inline; }
.inline-label { display: inline; margin-right: .4rem; }
form.stack { display: grid; gap: .6rem; }
label { font-weight: 600; font-size: .95rem; }
label.check { display: flex; gap: .6rem; align-items: center; font-weight: 400; min-height: 44px; }
input[type=checkbox], input[type=radio] { width: 1.4rem; height: 1.4rem; flex: none; accent-color: var(--accent); }
input[type=text], input[type=email], input[type=search], input[type=date], input[type=time], input[type=number], textarea, select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--muted); border-radius: 8px; padding: .5rem .6rem; width: 100%; min-height: 44px;
}
input[type=color] { width: 4rem; height: 44px; padding: 2px; background: var(--bg); border: 1px solid var(--muted); border-radius: 8px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem .9rem; margin: 0; min-width: 0; }
fieldset.focused { border-color: var(--accent); border-width: 2px; }
legend { font-weight: 700; padding: 0 .4rem; }
fieldset.card { margin: .6rem 0; }
.slot { display: grid; grid-template-columns: 1fr; gap: .4rem; margin: .4rem 0; }
@media (min-width: 560px) { .slot { grid-template-columns: 1.4fr 1fr auto 1fr; align-items: center; } }
summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details.card[open] > summary { margin-bottom: .4rem; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; }

/* ---- notices and badges */
.notice { border-radius: 8px; padding: .55rem .8rem; margin: .7rem 0; border: 1px solid var(--line); background: var(--card); }
.notice-error { border-color: var(--err); color: var(--err); }
.notice-ok { border-color: var(--ok); color: var(--ok); }
.notice-warn { border-color: var(--warn); color: var(--warn); }
.notice a { color: inherit; font-weight: 700; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--muted); background: var(--bg); color: var(--text); vertical-align: middle; }
.badge-ok { border-color: var(--ok); color: var(--ok); }
.badge-warn { border-color: var(--warn); color: var(--warn); }
.badge-draft { color: var(--muted); }

/* ---- tables */
table { width: 100%; border-collapse: collapse; margin: .6rem 0; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.num { text-align: right; white-space: nowrap; }
.warnlist { padding-left: 1.1rem; }
.weeknav { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }

/* ---- the week grid (700 px and up) */
.gridwrap { display: none; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.gridhint { display: none; }
table.grid { table-layout: fixed; min-width: 900px; margin: 0; }
table.grid th, table.grid td { border-right: 1px solid var(--line); padding: .3rem; }
table.grid thead th { position: sticky; top: 0; background: var(--card); font-size: .9rem; text-align: center; }
table.grid thead th.who, table.grid tbody th.who { text-align: left; width: 11rem; }
table.grid thead th.today { box-shadow: inset 0 -3px 0 var(--accent); }
table.grid tbody th.who .badge { margin-left: .35rem; }
table.grid tbody th.who { font-size: .95rem; font-weight: 600; background: var(--card); }
table.grid .daytotal { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
table.grid .openrow { background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.cell { vertical-align: top; min-width: 7.5rem; height: 3.2rem; position: relative; }
.cell.dropping { outline: 3px dashed var(--accent); outline-offset: -3px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.chip { position: relative; background: var(--bg); border: 1px solid var(--line); border-left: 6px solid var(--pos, var(--accent)); border-radius: 6px; margin: 0 0 .3rem; touch-action: pan-y; }
.chip.dragging { opacity: .55; }
.chip-main { display: block; min-height: 44px; padding: .25rem .4rem; color: var(--text); text-decoration: none; font-size: .85rem; line-height: 1.3; cursor: grab; }
.chip-main:hover { background: color-mix(in srgb, var(--pos, var(--accent)) 12%, var(--bg)); }
.chip-time { display: block; font-weight: 700; }
.chip-pos { display: block; }
.chip-note { display: block; color: var(--muted); font-size: .8rem; }
.chip-actions { display: flex; flex-wrap: wrap; gap: 0 .2rem; padding: 0 .3rem .2rem; font-size: .8rem; opacity: 0; transition: opacity .1s; }
.chip:hover .chip-actions, .chip:focus-within .chip-actions { opacity: 1; }
.chip-actions a { padding: .5rem .45rem; min-height: 44px; display: inline-flex; align-items: center; }
.cell-add { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 8px; text-decoration: none; font-size: 1.3rem; color: var(--muted); opacity: .0; }
.cell:hover .cell-add, .cell:focus-within .cell-add, .cell-add:focus-visible { opacity: 1; }
@media (hover: none) { .chip-actions, .cell-add { opacity: 1; } }

/* ---- the phone list (below 700 px) */
.daylist { display: block; }
.daytabs { display: flex; gap: .25rem; margin: .6rem 0; }
.daytabs a { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); text-decoration: none; font-size: .8rem; }
.daytabs a strong { font-size: 1.1rem; }
.daytabs a.today { border-color: var(--accent); }
.daytabs a[aria-current="date"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.shiftcard { background: var(--card); border: 1px solid var(--line); border-left: 8px solid var(--pos, var(--accent)); border-radius: var(--radius); padding: .7rem .9rem; margin: .6rem 0; }
.shiftcard h3 { font-size: 1.15rem; }
@media (min-width: 700px) {
  .gridwrap { display: block; }
  .gridhint { display: block; }
  .daylist { display: none; }
}

/* ---- the staff page: large readable day cards */
.weekblock { margin-bottom: 2rem; }
.daycard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: .6rem 0; }
.daycard.mine { border-width: 2px; border-color: var(--accent); }
.daycard.today { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.daycard h3 { font-size: 1.15rem; }
.myshift { font-size: 1.25rem; line-height: 1.35; border-left: 8px solid var(--pos, var(--accent)); padding: .2rem .7rem; margin: .4rem 0; background: color-mix(in srgb, var(--accent) 8%, var(--card)); border-radius: 6px; }
.myshift .note { display: block; font-size: 1rem; color: var(--muted); }
.colleagues { list-style: none; padding: 0; margin: .3rem 0; }
.colleagues li { padding: .3rem 0; border-bottom: 1px solid var(--line); }

/* ---- the printable week */
.bare { padding: 12px; overflow-x: auto; }   /* the print grid is 900 px wide: on a phone or a tablet the page scrolls inside this box, not sideways */
.printbar { margin-bottom: .6rem; }
.printbar a { display: inline-flex; align-items: center; min-height: 44px; }
.printtitle { font-size: 1.3rem; margin-top: 0; }
table.printgrid { table-layout: fixed; font-size: .85rem; }
table.printgrid th, table.printgrid td { border: 1px solid var(--muted); padding: .25rem .35rem; }
.printshift { margin-bottom: .2rem; }

@media (max-width: 520px) { .hero h1 { font-size: 1.6rem; } table:not(.grid):not(.printgrid) { display: block; overflow-x: auto; } }

@media print {
  @page { size: landscape; margin: 10mm; }
  /* always the light colors on paper, even for someone who browses in dark mode */
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #333; --line: #888; --link: #000; --accent: #000; --accent-text: #fff; color-scheme: light; }
  .top, .foot, .skip, .noprint, .weeknav, .gridhint, .daylist { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { border: 0; padding: 0; background: #fff; }
  .bare { padding: 0; overflow: visible; }
  table { display: table; }
  .gridwrap { display: block; border: 0; overflow: visible; }
  table.grid { min-width: 0; }
  .chip-actions, .cell-add { display: none; }
}

/* a mouse user has no fat finger: the Move and Delete links under a shift can be slimmer than on a tablet */
@media (pointer: fine) {
  .chip-actions a { min-height: 28px; padding: .15rem .45rem; }
}

/* the "Today" badge and other badges that follow a heading or a name need a gap (Razor trims the space before them) */
.daycard h3 .badge { margin-left: .5rem; }
