:root {
    color-scheme: light;
    --ink: #1d1b19;
    --muted: #605d57;
    --line: #e4e0d9;
    --page: #f5f4f1;
    --orange: #fe5000;
    --orange-pale: #fff3ea;
    font: 16px/1.45 "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid #aa3908; outline-offset: 3px;
}
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }

.topbar { background: #191817; color: #fff; border-bottom: 3px solid var(--orange); }
.topbar-inner { max-width: 1480px; margin: auto; padding: 0 42px; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand, .account { display: flex; align-items: center; gap: 18px; }
.brand img { width: 100px; height: auto; display: block; }
.brand span { color: #d3ceca; font-size: .875rem; border-left: 1px solid #514a43; padding-left: 16px; }
.account { font-size: .875rem; }
.demo-label { color: #ffd1b4; background: #3d2c22; border: 1px solid #78503a; border-radius: 6px; padding: 4px 8px; white-space: nowrap; }
.logout { background: transparent; color: #fff; border: 1px solid #67615b; border-radius: 7px; padding: 8px 11px; }
.logout:hover { background: #3a322d; }

.workspace { max-width: 1480px; margin: auto; padding: 39px 42px 38px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 26px; }
h1 { font-size: clamp(2.1rem, 3.6vw, 3.4rem); line-height: 1.06; letter-spacing: -.06em; font-weight: 750; }
.page-heading p { color: var(--muted); margin-top: 9px; }
.page-heading p::first-letter { text-transform: uppercase; }
.heading-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 42px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.primary { background: var(--orange); color: #171411; }
.primary:hover { background: #ff6a28; }
.secondary, .icon-button { background: #fff; color: var(--ink); border-color: #dbd6cd; }
.secondary:hover, .icon-button:hover { background: #f2efeb; }
.danger { color: #a22620; background: #fff; border-color: #e0bcb8; }
.danger:hover { background: #fff0ef; }
.icon-button { width: 38px; min-height: 38px; padding: 0; flex: 0 0 38px; }

.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric { min-width: 0; padding: 13px 15px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.metric span { color: var(--muted); font-size: .875rem; font-weight: 600; }
.metric strong { font-size: 1.5rem; line-height: 1; letter-spacing: -.045em; white-space: nowrap; font-variant-numeric: tabular-nums; }

.schedule-panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: clip; }
.schedule-toolbar { padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.period-control, .view-control { display: flex; align-items: center; gap: 7px; }
.period-control h2 { font-size: 1rem; text-align: center; min-width: 173px; font-variant-numeric: tabular-nums; }
.view-control { gap: 2px; padding: 3px; border: 1px solid var(--line); background: #f3f1ed; border-radius: 8px; }
.view-control button, .day-tab { border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; padding: 6px 12px; font-size: .875rem; font-weight: 700; }
.view-control button[aria-pressed=true] { border-color: #e3ded5; color: var(--ink); background: #fff; }
.calendar-scroll { overflow: auto; }
.week-table { width: 100%; min-width: 825px; border-collapse: collapse; table-layout: fixed; }
.week-table th, .week-table td { text-align: left; vertical-align: top; border: 1px solid var(--line); border-left: 0; }
.week-table tr > :last-child { border-right: 0; }
.week-table thead th { background: #fbfaf8; padding: 10px 11px; }
.week-table th:first-child { width: 148px; }
.week-table th.is-today, .week-table td.is-today { background: #fffbf6; }
.week-table th.is-today { box-shadow: inset 0 3px var(--orange); }
.corner, .column-date { color: var(--muted); font-size: .875rem; font-weight: 600; }
.column-day { font-size: .875rem; font-weight: 750; display: block; }
.current-day { color: #833007; margin-left: 7px; font-size: .75rem; }
.station { padding: 13px 11px; background: #fbfaf8; color: var(--ink); font-size: .9rem; }
.station strong { display: block; }
.station span { display: block; font-size: .875rem; font-weight: 400; color: var(--muted); margin-top: 3px; }
.week-table td { padding: 7px; }
.slots { display: flex; flex-direction: column; gap: 5px; }
.slot { border: 1px solid; text-align: left; padding: 5px 7px 6px; border-radius: 6px; overflow-wrap: anywhere; min-height: 44px; }
.slot-time, .slot-title { display: block; font-size: .875rem; }
.slot-time { font-variant-numeric: tabular-nums; line-height: 1.15; font-weight: 750; }
.slot-title { line-height: 1.25; margin-top: 2px; }
.slot.booking, .swatch.booking { background: #ffeadb; border-color: #edbe9f; color: #572b13; }
.slot.block, .swatch.block { background: #eeeae6; border-color: #c7bdb5; color: #493c34; }
.slot.free, .swatch.free { background: #f8faf6; border: 1px dashed #b6c4ac; color: #3c5230; }
.slot:hover { filter: brightness(.95); }
.week-days { display: flex; gap: 5px; padding: 0 16px 13px; }
.day-tab { background: #fff; border-color: var(--line); flex: 1; }
.day-tab[aria-pressed=true] { background: var(--orange-pale); border-color: #f3a277; color: #6a2710; }
.day-list { border-top: 1px solid var(--line); }
.day-station { display: grid; grid-template-columns: 140px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.day-station .slots { padding: 8px; }
.day-station .slot { display: flex; align-items: center; gap: 12px; }
.day-station .slot-time { white-space: nowrap; }
.day-station .slot-title { margin: 0; }
.schedule-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 15px; padding: 11px 16px; font-size: .875rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.swatch { width: 12px; height: 12px; border: 1px solid; border-radius: 3px; }

.login { position: relative; overflow: hidden; max-width: 470px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 70px auto; padding: 31px; }
.login h1 { font-size: 2.45rem; }
.login p { margin: 9px 0 22px; color: var(--muted); }
.login-accent { width: 60px; height: 4px; background: var(--orange); margin-bottom: 20px; }
.demo-info { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 13px; color: var(--muted); font-size: .875rem; }
dialog { padding: 23px; width: min(515px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px #1714114d; }
dialog::backdrop { background: #211b17a6; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 17px; }
.dialog-heading h2 { font-size: 1.42rem; letter-spacing: -.025em; }
.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid label { display: block; min-width: 0; font-size: .875rem; font-weight: 700; }
.form-grid input, .form-grid select, .form-grid textarea { display: block; width: 100%; min-width: 0; margin-top: 4px; border: 1px solid #ccc5bb; background: #fff; color: var(--ink); border-radius: 7px; min-height: 42px; padding: 7px 9px; font-weight: 400; font-size: 1rem; }
.form-grid textarea { resize: vertical; }
.dialog-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 8px; }
.notice, .error { padding: 10px 12px; border-radius: 6px; background: #f2efea; font-size: .875rem; }
#calendar-status { margin: 0 16px 12px; }
.login .error, .error { color: #872922; background: #ffefee; }
.toast { margin-top: 12px; background: #e7f2e3; color: #2e4926; }
.entry-history { font-size: .875rem; }
.alternatives { margin-top: 10px; display: grid; gap: 6px; }
.result { padding: 8px 10px; text-align: left; border: 1px solid #c5d0bf; border-radius: 7px; color: #30462a; background: #f5faf2; }
.result:hover { background: #e7f1e2; }
.result span { display: block; font-size: .875rem; }

@media (max-width: 1000px) {
    .workspace, .topbar-inner { padding-left: 21px; padding-right: 21px; }
}
@media (max-width: 759px) {
    .workspace { padding: 25px 12px; }
    .topbar-inner { padding: 0 12px; min-height: 59px; gap: 8px; }
    .brand img { width: 77px; }
    .brand span { display: none; }
    .account { gap: 6px; }
    .page-heading { align-items: start; flex-direction: column; gap: 13px; margin-bottom: 15px; }
    .overview { gap: 6px; margin-bottom: 14px; }
    .metric { padding: 8px; flex-direction: column-reverse; align-items: start; gap: 5px; }
    .metric strong { font-size: 1.3rem; }
    .schedule-toolbar { align-items: start; flex-direction: column; padding: 9px; }
    .period-control { width: 100%; }
    .period-control h2 { flex: 1; min-width: 0; }
    .today-button { min-height: 38px; padding: 5px 8px; }
    .week-days { padding: 0 9px 9px; }
    .day-tab { padding: 5px 2px; }
    .day-station { grid-template-columns: 100px minmax(0, 1fr); }
    .station { padding: 9px; }
    .day-station .slot { flex-direction: column; align-items: start; gap: 2px; }
    .login { margin: 40px 12px; padding: 24px; }
}
@media (max-width: 389px) {
    .user-name { display: none; }
    .schedule-footer { padding-inline: 9px; }
}
