/* Reserve a Seat. Pine green is the app's own actions and choices, on a cool
   chalk page; blue is something that needs attention. Bricolage Grotesque
   for headings, numerals and times; Atkinson Hyperlegible, made to be easy
   to read, for everything else. */
:root {
  --chalk: #F3F6F4;
  --sheet: #FFFFFF;
  --tint: #F7FAF8;
  --pine: #0B4F35;
  --pine-dark: #083D29;
  --fern: #DCEDE3;
  --fern-2: #C8E3D3;
  --ink: #13221B;
  --moss: #5E6E66;
  --line: #D6E0DA;
  --blue: #006EA8;
  --blue-wash: #E6F1F6;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--chalk); color: var(--ink); font: 17px/1.55 "Atkinson Hyperlegible", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: var(--pine); font-weight: 700; text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-family: var(--display); letter-spacing: -0.02em; }
h1 { font-size: 36px; font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
.muted { color: var(--moss); }
.small { font-size: 15px; }
.error { color: var(--blue); font-weight: 700; }

/* Top bar */
.bar { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 22px 40px; }
.bar .name { font: 800 20px/1 var(--display); letter-spacing: -0.02em; color: var(--pine); text-decoration: none; }
.bar .dept { color: var(--moss); font-size: 15px; }
.bar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.bar nav button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; font-weight: 700; color: var(--moss); }
.bar nav button:hover { color: var(--ink); background: var(--sheet); }
.bar nav button[aria-current="page"] { color: var(--pine); background: var(--fern); }
.demo-badge { align-self: center; font-size: 13px; font-weight: 700; color: var(--blue); background: var(--blue-wash); padding: 3px 10px; border-radius: 999px; }

main { max-width: 1120px; margin: 0 auto; padding: 24px 40px 80px; }
.intro { margin-bottom: 36px; }
.intro h1 { font-size: clamp(36px, 5.4vw, 60px); line-height: 1.02; letter-spacing: -0.035em; max-width: 15ch; font-variation-settings: "opsz" 96; }
.intro p { margin: 18px 0 0; color: var(--moss); max-width: 46ch; }
.intro.short h1 { font-size: clamp(30px, 4vw, 44px); }
.card { background: var(--sheet); border-radius: 24px; padding: 32px 36px; margin-bottom: 24px; }
.card > h2 { margin-bottom: 18px; }
#closed { font: 700 24px/1.3 var(--display); letter-spacing: -0.02em; color: var(--pine); padding: 36px; }

/* Buttons */
.btn { border: 1.5px solid var(--line); background: var(--sheet); color: var(--ink); border-radius: 999px; padding: 10px 20px; font-weight: 700; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--pine); color: var(--pine); }
.btn.primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn.primary:hover { background: var(--pine-dark); border-color: var(--pine-dark); color: #fff; }
.btn.danger { color: var(--blue); border-color: var(--blue); }
.btn.danger:hover { background: var(--blue); color: #fff; }
.btn.sm { padding: 6px 14px; font-size: 15px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.actions.center { justify-content: center; }
.round { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); background: var(--sheet); font-size: 20px; line-height: 1; }
.round:hover:not(:disabled) { border-color: var(--pine); color: var(--pine); }
.round:disabled { opacity: 0.35; cursor: default; }

/* The planner: a month beside the picked day's times. It lays itself out
   by its own width, so it works on the page and in the staff dialog. */
.planner { container: planner / inline-size; }
.feature { margin-bottom: 28px; }
#confirm, #move-confirm { margin-top: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); background: var(--sheet); border: 1.5px solid var(--line); border-radius: 24px; overflow: hidden; }
.feature .split { border: 0; border-radius: 28px; box-shadow: 0 1px 0 var(--line), 0 30px 60px -40px rgba(11, 79, 53, 0.45); }
.month { padding: 32px 36px 36px; }
.month-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.month-head h3 { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.month-head h3 span { font-weight: 500; color: var(--moss); }
.arrows { display: flex; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wd { text-align: center; font-weight: 700; font-size: 14px; color: var(--moss); padding-bottom: 6px; }
.cell { position: relative; aspect-ratio: 1 / 0.92; border: 0; border-radius: 16px; background: none; display: grid; place-items: center; font: 700 24px/1 var(--display); letter-spacing: -0.02em; }
.cell.off { color: #B7C2BC; font-weight: 500; }
.cell.today { color: var(--ink); }
.cell.off.today::after { content: ""; position: absolute; bottom: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
button.cell { background: var(--fern); color: var(--pine); }
button.cell:hover { background: var(--fern-2); }
/* Morning, afternoon and evening, each filled by the share of its times still open. */
button.cell i { position: absolute; left: 16%; right: 16%; bottom: 9px; height: 5px; display: flex; gap: 3px; }
button.cell i b { position: relative; flex: 1; border-radius: 2px; overflow: hidden; background: rgba(11, 79, 53, 0.18); }
button.cell i b::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--fill, 0) * 100%); background: var(--pine); }
button.cell.has { box-shadow: inset 0 0 0 2px var(--pine); }
button.cell.on { background: var(--pine); color: #fff; }
button.cell.on i b { background: rgba(255, 255, 255, 0.3); }
button.cell.on i b::after { background: #fff; }
.picker-status { padding: 28px 0; }

.day { background: var(--tint); border-left: 1.5px solid var(--line); padding: 32px 30px; }
.day-empty { margin: 0; min-height: 100%; display: grid; place-items: center; text-align: center; color: var(--moss); }
.back { display: none; border: 0; background: none; padding: 0; margin-bottom: 18px; color: var(--pine); font-weight: 700; }
.day-nav { display: flex; align-items: center; gap: 12px; }
.day-nav h3 { flex: 1; text-align: center; font-size: 22px; }
.zone { text-align: center; color: var(--moss); font: 500 15px/1.4 var(--display); margin: 6px 0 22px; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { padding: 13px 0; border: 1.5px solid var(--line); border-radius: 14px; background: var(--sheet); font: 700 18px/1.2 var(--display); }
.slot span { font-weight: 500; color: var(--moss); }
.slot:hover { border-color: var(--pine); }
.slot.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.slot.on span { color: rgba(255, 255, 255, 0.75); }

@container planner (max-width: 620px) {
  .split { display: block; }
  .month { padding: 24px 16px 20px; }
  .month-head h3 { font-size: 24px; }
  .cell { font-size: 19px; border-radius: 12px; }
  .day { border-left: 0; padding: 24px 16px; background: var(--sheet); }
  .day-empty { display: none; }
  .planner[data-view="day"] .month, .planner[data-view="calendar"] .day { display: none; }
  .back { display: block; }
}
@media (prefers-reduced-motion: no-preference) {
  .cell, .slot { transition: background-color 0.15s, color 0.15s; }
}

/* Forms */
.chosen { margin: 0 0 24px; font: 700 22px/1.25 var(--display); letter-spacing: -0.02em; color: var(--pine); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.fields .wide { grid-column: 1 / -1; }
label { display: block; font-weight: 700; font-size: 15px; }
label .hint { font-weight: 400; color: var(--moss); }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--sheet);
}
input:focus, select:focus, textarea:focus { border-color: var(--pine); outline: none; box-shadow: 0 0 0 4px var(--fern); }
textarea { resize: vertical; min-height: 88px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--pine); width: 18px; height: 18px; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#form .actions .btn.primary { padding: 15px 30px; }

/* Confirmation and the family's meeting */
.done { text-align: center; padding: 48px 32px; }
.done .tick { width: 60px; height: 60px; border-radius: 50%; background: var(--pine); margin: 0 auto 20px; display: grid; place-items: center; }
.done h2 { font-size: 32px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; text-align: left; max-width: 560px; margin: 18px 0 0; }
.done .facts { margin: 26px auto 0; }
.facts dt { color: var(--moss); }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.note { background: var(--blue-wash); color: var(--ink); border-radius: 14px; padding: 14px 18px; margin: 18px 0 0; }
.empty { padding: 28px; text-align: center; color: var(--moss); background: var(--tint); border-radius: 14px; margin-top: 14px; }

/* Staff tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 14px; color: var(--moss); font-weight: 700; padding: 8px 12px; border-bottom: 1.5px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child { white-space: nowrap; }
#bookings td:first-child { font-family: var(--display); font-weight: 700; }
tr.canceled td { color: var(--moss); text-decoration: line-through; }
tr.canceled td:last-child { text-decoration: none; }
tr.day-head td { background: var(--tint); font: 700 17px/1.3 var(--display); letter-spacing: -0.01em; padding-top: 16px; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chalk); color: var(--moss); }
.pill.ok { background: var(--fern); color: var(--pine); }
.pill.bad { background: var(--blue-wash); color: var(--blue); }
.links { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.links li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.links .pill { margin-left: 6px; }
.row-notes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input { width: auto; margin: 0; }
.toolbar label:not(.check) { display: flex; align-items: center; gap: 10px; }

/* Dialog */
dialog { border: 0; border-radius: 28px; padding: 0; width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 30px 80px -20px rgba(19, 34, 27, 0.4); }
dialog::backdrop { background: rgba(19, 34, 27, 0.45); }
dialog .body { padding: 28px; }
dialog header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.icon-btn { border: 0; background: none; color: var(--moss); font-size: 24px; line-height: 1; padding: 4px 10px; border-radius: 999px; }
.icon-btn:hover { background: var(--chalk); color: var(--ink); }

/* Settings */
fieldset { border: 0; padding: 0; margin: 0 0 28px; }
legend { font: 700 19px/1.2 var(--display); letter-spacing: -0.01em; margin-bottom: 12px; padding: 0; }
.inline { display: flex; gap: 16px; flex-wrap: wrap; align-items: end; }
.inline label { flex: 1 1 160px; }
.inline + .check, fieldset > .check { margin: 10px 0; }
.weekday-list { display: flex; gap: 16px; flex-wrap: wrap; }
.preview { font-size: 15px; color: var(--moss); margin-top: 10px; }
#add-counselor { margin-top: 24px; }

/* Picking a range of days in Settings */
.ranges { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.ranges .preview { margin: -4px 0 14px; min-height: 3.1em; }
#add-day-off { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; align-items: start; margin-top: 24px; }
#add-day-off .inline { flex-direction: column; align-items: stretch; }
#add-day-off .inline label { flex: none; }
#add-day-off .actions { margin-top: 12px; }
#slot-preview { font-family: var(--display); }
.range-cal { background: var(--tint); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px 18px 14px; margin-bottom: 14px; }
.range-cal .month-head { margin-bottom: 12px; }
.range-cal .month-head h3 { font-size: 22px; }
.range-cal .round { width: 36px; height: 36px; font-size: 18px; }
.range-cal .grid { gap: 4px 0; }
.rc { position: relative; aspect-ratio: 1 / 0.86; border: 0; background: none; font: 700 16px/1 var(--display); color: var(--ink); border-radius: 10px; }
.rc:hover { background: var(--fern); }
.rc.in { background: var(--fern); color: var(--pine); border-radius: 0; }
.rc.end { background: var(--pine); color: #fff; border-radius: 10px; }
.rc.today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.range-sum { margin: 12px 0 0; font-size: 15px; color: var(--ink); }
.link { border: 0; background: none; padding: 0; margin-left: 6px; color: var(--pine); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.outbox article { border-top: 1px solid var(--line); padding: 16px 0; }
.outbox pre { white-space: pre-wrap; font: 15px/1.55 "Atkinson Hyperlegible", system-ui, sans-serif; margin: 8px 0 0; color: var(--moss); }

@media (max-width: 820px) {
  .bar { padding: 18px 16px; }
  main { padding: 8px 16px 56px; }
  .intro { margin-bottom: 28px; }
  .card { padding: 24px 16px; border-radius: 22px; }
  .fields { grid-template-columns: 1fr; }
  .ranges, #add-day-off { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  dialog .body { padding: 20px 14px; }
}
