:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: #202636;
  background: #f8f9fc;
  --accent: #3059ce;
  --accent-light: #edf1fc;
  --muted: #697184;
  --line: #e4e7ee;
}
* { box-sizing: border-box; }
body { margin: 0; overscroll-behavior-x: none; }
.day { touch-action: pan-y pinch-zoom; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, input, select { border-radius: 10px; }
button { color: inherit; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.25rem; letter-spacing: -.035em; font-weight: 700; }
h2 { font-size: 1rem; font-weight: 650; }
button { border: 0; background: none; }
[hidden] { display: none !important; }
.shell { max-width: 580px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); min-height: 100svh; }
.header { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-bottom: 22px; gap: 10px; }
.brand-dot { color: var(--accent); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; }
.icon-button:hover { background: #edf0f6; }
.icon-button:disabled { color: #c1c5d0; background: transparent; }
.menu-trigger { font-size: 1.75rem; letter-spacing: .08em; }
.booking .header, .devices .header { justify-content: flex-start; margin-left: -10px; margin-bottom: 18px; }
.day-navigation { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; margin-bottom: 19px; }
.date-heading { text-align: center; min-width: 0; }
.day-context { display: block; font-size: .875rem; color: var(--muted); margin-bottom: 5px; }
.date-picker { position: relative; }
.date-picker h2 { font-size: 1.12rem; letter-spacing: -.02em; line-height: 1.5; }
.date-picker input { opacity: 0; position: absolute; inset: -6px 0; width: 100%; height: 44px; cursor: pointer; }
.date-picker:focus-within { outline: 2px solid var(--accent); border-radius: 4px; }
.overview-meta { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .75rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.segment { display: block; height: 13px; min-width: 0; background: #e6eaf2; border-radius: 3px; }
.legend .segment { width: 9px; height: 9px; border-radius: 2px; }
.segment.booked { background: var(--accent); }
.segment.inactive { background: repeating-linear-gradient(135deg, #a7adba 0, #a7adba 2px, #d1d5df 2px, #d1d5df 4px); }
.hours { border-top: 1px solid var(--line); }
.hour { border-bottom: 1px solid var(--line); }
.hour-toggle { display: flex; width: 100%; align-items: center; gap: 15px; min-height: 51px; text-align: left; padding: 8px 0; border-radius: 0; }
.hour-name { white-space: nowrap; font-size: .875rem; flex: 0 0 5.45rem; }
.hour-name strong { display: inline-block; width: 1.375rem; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.segments { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; flex: 1; }
.expand-icon { color: var(--muted); width: 12px; text-align: center; font-size: 1.1rem; }
.hour-detail { padding: 0 0 12px 0; }
.booking-item { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 12px 14px; margin: 4px 0; background: var(--accent-light); text-align: left; line-height: 1.45; overflow-wrap: anywhere; }
.booking-pads { color: var(--accent); font-size: .875rem; font-weight: 650; }
.booking-description { font-size: .875rem; }
.booking-item .muted { font-size: .75rem; }
.empty-hour { font-size: .875rem; color: var(--muted); padding: 8px 0; }
.text-button { color: var(--accent); font-size: .875rem; font-weight: 550; min-height: 44px; padding: 10px 8px; }
.hour-book { padding-left: 0; }
.today-button { padding-right: 0; }
.action-bar { position: sticky; bottom: 0; padding: 16px 0 max(16px, env(safe-area-inset-bottom)); background: #f8f9fc; z-index: 2; }
.primary, .secondary { width: 100%; min-height: 49px; padding: 12px 16px; font-weight: 600; line-height: 1.4; }
.primary { color: white; background: var(--accent); }
.primary:hover:not(:disabled) { background: #2447af; }
.primary:disabled { background: #e1e5ee; color: #737d91; }
.secondary { background: #eceff5; }
.local-hint { font-size: .75rem; text-align: center; color: var(--muted); margin-top: 12px; }
.booking-date-row { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding-bottom: 18px; }
input[type="date"], select { min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; color: inherit; min-width: 0; }
.booking-date-row input { max-width: 72%; }
label, legend { font-size: .875rem; font-weight: 550; }
fieldset { border: 0; padding: 0; margin: 0 0 19px; min-width: 0; }
legend { width: 100%; margin-bottom: 10px; padding: 0; }
.field-hint { color: var(--muted); font-size: .75rem; font-weight: 400; line-height: 1.4; }
legend .field-hint { float: right; }
.choice-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.choice { background: #edf0f6; min-height: 44px; padding: 10px 2px; font-weight: 550; position: relative; border: 1px solid transparent; }
.choice.selected { background: var(--accent); color: white; }
.choice:disabled { color: #7c8495; background: #eceef2; border-color: #e2e5eb; }
.pad-choice:disabled { text-decoration: line-through; text-decoration-color: #b3b8c4; }
.people-fields { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr); gap: 12px; margin: 0 0 22px; }
.people-fields label { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.people-fields select { width: 100%; padding-left: 10px; }
.quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.quantity-row h2 { font-size: .875rem; margin-bottom: 4px; }
.quantity-row .field-hint { max-width: 185px; }
.stepper { display: flex; align-items: center; flex-shrink: 0; background: #edf0f6; border-radius: 10px; }
.stepper button { width: 44px; height: 44px; font-size: 1.4rem; color: var(--accent); }
.stepper button:disabled { color: #adb4c2; }
.stepper output { width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.pad-choice { font-size: .8125rem; }
.note-mark { position: absolute; right: 3px; top: 2px; font-size: .65rem; font-weight: 700; text-decoration: none; }
.selection-help { color: var(--muted); font-size: .75rem; margin: 11px 0 0; line-height: 1.5; }
.device-notes { font-size: .875rem; margin-top: 7px; }
summary { cursor: pointer; padding: 12px 0; min-height: 44px; }
.device-notes p { padding: 7px 0; line-height: 1.5; overflow-wrap: anywhere; color: var(--muted); }
.booking .action-bar { margin-top: 8px; }
.form-error { background: #e9edf7; border-left: 3px solid var(--accent); padding: 12px; margin-top: 14px; line-height: 1.5; font-size: .875rem; }
.admin-intro, .admin-info { color: var(--muted); font-size: .875rem; line-height: 1.65; margin-bottom: 18px; }
.device-editor { padding: 12px 0 16px; border-top: 1px solid var(--line); }
.device-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.active-label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.note-input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); background: white; }
input::placeholder { color: #778091; }
.reset-section { border-top: 1px solid var(--line); margin-top: 24px; padding: 24px 0 max(32px, env(safe-area-inset-bottom)); }
.reset-section p { color: var(--muted); font-size: .875rem; line-height: 1.6; margin: 8px 0 16px; }
.toast { position: fixed; left: 50%; bottom: max(100px, calc(env(safe-area-inset-bottom) + 80px)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); padding: 12px 18px; background: #202636; color: white; font-size: .875rem; border-radius: 10px; line-height: 1.5; z-index: 10; pointer-events: none; }
dialog { width: calc(100% - 40px); max-width: 390px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #f8f9fc; color: inherit; max-height: 85svh; overflow-y: auto; }
dialog::backdrop { background: rgb(25 33 53 / 30%); }
dialog h2 { font-size: 1.125rem; overflow-wrap: anywhere; line-height: 1.5; }
dialog p { margin-top: 10px; line-height: 1.55; font-size: .875rem; }
.muted { color: var(--muted); }
.dialog-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
@media (min-width: 700px) {
  .shell { padding-top: max(32px, env(safe-area-inset-top)); }
  .header { margin-bottom: 32px; }
  .hour-toggle { min-height: 57px; gap: 24px; }
  .hour-name { flex-basis: 6.5rem; }
  .segment { height: 15px; }
  .choice-grid { gap: 10px; }
  .choice { min-height: 48px; }
  .booking .header { margin-bottom: 28px; }
}
@media (max-width: 359px) {
  .shell { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .hour-toggle { gap: 10px; }
  .segments { gap: 3px; }
  .choice-grid { gap: 5px; }
  .quantity-row .field-hint { max-width: 150px; }
  .date-picker h2 { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
