:root {
  --brand-accent: #2459a9;
  --accent: var(--brand-accent);
  --on-accent: #fff;
  --primary-hover: #1d2d44;
  --on-primary-hover: #fff;
  --ink: #1d2d44;
  --muted: #58697b;
  --line: #dce3ec;
  --canvas: #f3f6fa;
  --surface: #fff;
  --soft-blue: #edf3fc;
  --border-soft: #edf0f5;
  --input-border: #bac7d7;
  --blue-border: #cbd9ef;
  --nav-ink: #506177;
  --avatar-bg: #e9eef5;
  --avatar-ink: #425a78;
  --segmented-bg: #e7edf5;
  --office-bg: #e7effd;
  --office-ink: #24549b;
  --home-bg: #edf0f4;
  --home-ink: #46566c;
  --open-bg: #fff4dd;
  --open-ink: #795310;
  --free-bg: #e7f4ec;
  --free-ink: #256340;
  --free-border: #719e82;
  --busy-bg: #eef0f3;
  --busy-ink: #586373;
  --day-column: #f4f7fd;
  --floor-bg: #f7f9fc;
  --floor-border: #c4cfdd;
  --map-divider: #d0d9e5;
  --desk-border: #9fc4ae;
  --desk-bg: #f0f8f3;
  --desk-busy-bg: #e8edf3;
  --desk-busy-ink: #606d80;
  --desk-busy-border: #c7d0dc;
  --desk-mine-border: #a4bbdf;
  --notice-bg: #eef2f8;
  --notice-border: #8299b5;
  --danger-bg: #fff0ef;
  --danger-ink: #9e2525;
  --danger-border: #dd9b99;
  --window: #87b8df;
  --window-soft: #e4f1fc;
  --focus: #b57900;
  --brand-bg: #1d2d44;
  --brand-ink: #fff;
  color-scheme: light;
  --radius: 18px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, select { min-height: 44px; }
button { color: inherit; border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; border-radius: 9px; font-size: .875rem; font-weight: 600; }
button:hover:not(:disabled) { border-color: var(--accent); background: var(--soft-blue); }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: var(--accent); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
select { background: var(--surface); border: 1px solid var(--input-border); border-radius: 8px; padding: 8px 32px 8px 12px; color: var(--ink); max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 2.2vw, 2.15rem); line-height: 1.2; font-weight: 650; letter-spacing: -.04em; margin-bottom: 8px; }
h2 { font-size: 1.125rem; line-height: 1.4; font-weight: 650; margin-bottom: 10px; }
h3 { font-size: 1rem; margin-bottom: 8px; }
p { line-height: 1.55; }
small, .small { font-size: .875rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.skip-link { position: fixed; left: 16px; top: -90px; z-index: 20; padding: 14px; background: var(--surface); }
.skip-link:focus { top: 12px; }
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 30px 18px 24px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.05rem; line-height: 1.25; margin: 0 6px 43px; }
.brand-symbol { display: grid; place-items: center; width: 38px; height: 40px; background: var(--brand-bg); color: var(--brand-ink); border-radius: 10px 10px 3px 10px; font-size: 1.4rem; flex-shrink: 0; }
.nav-label { font-size: .75rem; letter-spacing: .11em; font-weight: 700; color: var(--muted); margin: 0 12px 10px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; margin: 4px 0; color: var(--nav-ink); min-height: 48px; padding: 12px; background: transparent; }
.nav-item.active { background: var(--soft-blue); color: var(--accent); }
.nav-item svg { width: 21px; height: 21px; flex-shrink: 0; }
.nav-item span[aria-hidden] { width: 21px; text-align: center; }
.sidebar-bottom { margin-top: auto; padding-top: 32px; }
.version { display: block; font-size: .75rem; color: var(--muted); padding: 16px 12px 0; }
.workspace { min-width: 0; }
.topbar { min-height: 80px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; padding: 16px 38px; border-bottom: 1px solid var(--line); position: relative; gap: 16px; }
.breadcrumb { font-size: .875rem; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 14px; }
.demo-badge { font-size: .75rem; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-ink); font-weight: 700; font-size: .8rem; }
.icon-button { min-width: 44px; padding: 8px; display: inline-grid; place-items: center; }
.icon-button svg { width: 20px; height: 20px; }
#nav-toggle {
position: fixed;
left: 224px;
bottom: 72px;
z-index: 12;
transform: translateX(-50%);
border-radius: 12px;
background: var(--surface);
box-shadow: 0 4px 14px #18345b20;
}
.profile-menu { position: absolute; right: 28px; top: 72px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); z-index: 5; box-shadow: 0 12px 35px #18345b20; padding: 18px; min-width: 240px; display: grid; gap: 9px; }
.profile-menu span { font-size: .875rem; color: var(--muted); margin-bottom: 10px; }
main { max-width: 1480px; margin: 0 auto; padding: 36px 38px 24px; min-height: calc(100vh - 140px); }
main:focus { outline: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-head p { color: var(--muted); margin-bottom: 0; }
.eyebrow { color: var(--accent); font-size: .75rem; letter-spacing: .12em; font-weight: 750; margin-bottom: 12px; }
.date-control { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.date-control strong { min-width: 178px; text-align: center; font-size: .875rem; font-weight: 600; }
.date-control .icon-button { background: transparent; }
.today-strip { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 1px solid var(--blue-border); background: var(--soft-blue); border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; }
.today-strip > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.today-strip label { font-size: .875rem; font-weight: 650; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.dashboard-card { display: flex; flex-direction: column; min-height: 238px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.card-heading h2 { margin: 0; }
.card-icon { color: var(--accent); background: var(--soft-blue); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; flex-shrink: 0; }
.card-icon svg { width: 21px; height: 21px; }
.appointment { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); align-items: start; }
.appointment:last-child { border-bottom: none; }
.appointment time { font-size: .875rem; color: var(--muted); padding-top: 2px; }
.appointment strong { font-size: .875rem; font-weight: 600; }
.appointment small { display: block; color: var(--muted); margin-top: 4px; }
.appointment > small { margin: 2px 0 0; }
.text-button { padding: 8px 0; min-height: 44px; background: transparent; border: 0; text-align: left; color: var(--accent); }
.text-button:hover:not(:disabled) { background: transparent; text-decoration: underline; }
.card > .text-button { margin-top: auto; padding-top: 20px; align-self: flex-start; }
.metric { font-size: 2.8rem; letter-spacing: -.05em; font-weight: 650; margin: 5px 0 2px; line-height: 1.15; }
.metric span { font-size: 1rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.metric-note { font-size: .875rem; color: var(--muted); margin: 8px 0 14px; }
.people-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.people-names { font-size: .875rem; color: var(--muted); margin: 4px 0 10px; line-height: 1.5; }
.bookings { margin-top: 24px; }
.booking-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; border-top: 1px solid var(--line); }
.booking-row small { display: block; margin-top: 5px; color: var(--muted); }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.primary:hover:not(:disabled) { background: var(--primary-hover); color: var(--on-primary-hover); border-color: var(--primary-hover); }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-bottom: 24px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; background: var(--segmented-bg); padding: 4px; border-radius: 10px; }
.segmented button { border: 0; background: transparent; min-height: 40px; }
.segmented button.active { background: var(--surface); box-shadow: 0 1px 5px #1d2d4410; color: var(--accent); }
.week-label { font-size: .875rem; color: var(--muted); }
.day-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 24px; }
.day-tabs button { text-align: left; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); }
.day-tabs button.active { border-color: var(--accent); box-shadow: inset 0 3px var(--accent); background: var(--soft-blue); }
.day-tabs strong, .day-tabs small { display: block; }
.day-tabs small { color: var(--muted); font-weight: 400; margin-top: 5px; }
.calendar-layout { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.45fr); gap: 24px; }
.workday { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.workday label { font-size: .875rem; font-weight: 600; }
.workday.selected { background: var(--soft-blue); padding: 14px 12px; margin-left: -12px; margin-right: -12px; border-radius: 8px; }
.agenda-list .appointment { grid-template-columns: 67px 1fr; padding: 20px 0; }
.agenda-list .appointment strong { font-size: 1rem; }
.empty { padding: 24px 8px; color: var(--muted); line-height: 1.6; }
.empty strong { display: block; color: var(--ink); margin-bottom: 5px; }
.status { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .875rem; font-weight: 550; padding: 7px 10px; border-radius: 6px; white-space: nowrap; }
.status.office, .status.mine { background: var(--office-bg); color: var(--office-ink); }
.status.home { background: var(--home-bg); color: var(--home-ink); }
.status.open { background: var(--open-bg); color: var(--open-ink); }
.status.free { background: var(--free-bg); color: var(--free-ink); }
.status.busy { background: var(--busy-bg); color: var(--busy-ink); }
.table-wrap { overflow-x: auto; }
.team-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.team-table th { text-align: left; padding: 14px 12px; color: var(--muted); font-weight: 550; border-bottom: 1px solid var(--line); white-space: nowrap; }
.team-table td { padding: 12px; border-bottom: 1px solid var(--border-soft); }
.team-table tr:last-child td { border-bottom: 0; }
.team-table th:not(:first-child), .team-table td:not(:first-child) { text-align: center; }
.team-table .day-column { background: var(--day-column); }
.team-table .name { display: flex; align-items: center; gap: 10px; min-width: 185px; }
.team-table .name small { color: var(--muted); }
.table-footnote { margin: 16px 0 0; color: var(--muted); font-size: .875rem; }
.day-team-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.team-person { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.team-person strong { flex: 1; font-size: .875rem; }
.resource-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.resource-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.floorplan { background: var(--floor-bg); border: 2px solid var(--floor-border); border-radius: 12px; padding: 20px; }
.map-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.map-zone + .map-zone { border-left: 2px solid var(--map-divider); padding-left: 24px; }
.map-zone h3 { font-size: .875rem; color: var(--muted); margin-bottom: 16px; }
.desk-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.desk { display: flex; flex-direction: column; gap: 6px; align-items: center; min-height: 82px; padding: 12px 6px; border: 1px solid var(--desk-border); border-radius: 8px 8px 3px 3px; background: var(--desk-bg); color: var(--free-ink); }
.desk span { font-weight: 400; font-size: .75rem; }
.desk.busy { background: var(--desk-busy-bg); color: var(--desk-busy-ink); border-color: var(--desk-busy-border); opacity: 1; }
.desk.mine { background: var(--office-bg); color: var(--accent); border-color: var(--desk-mine-border); }
.desk.selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.map-corridor { border-top: 2px solid var(--map-divider); margin-top: 24px; padding: 14px 0 0; text-align: center; font-size: .875rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .875rem; margin-top: 18px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 12px; height: 12px; background: var(--free-bg); border: 1px solid var(--free-border); border-radius: 2px; }
.swatch.busy { background: var(--desk-busy-bg); border-color: var(--desk-busy-border); }
.swatch.mine { background: var(--office-bg); border-color: var(--desk-mine-border); }
.booking-detail h2 { font-size: 1.4rem; }
.booking-detail .primary { width: 100%; margin-top: 10px; }
.detail-list { padding: 0; margin: 22px 0; }
.detail-list div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { font-size: .875rem; color: var(--muted); margin-bottom: 5px; }
.detail-list dd { margin: 0; line-height: 1.5; }
.resource-list { display: grid; gap: 10px; }
.resource-item { display: grid; grid-template-columns: minmax(0, 1fr) 142px 116px; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.resource-item > div { min-width: 0; overflow-wrap: anywhere; }
.resource-item > .status { justify-self: center; text-align: center; }
.resource-item > button { width: 100%; }
.resource-item small { display: block; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.resource-item.selected { border-color: var(--accent); background: var(--soft-blue); }
.notice { padding: 16px 20px; border-left: 3px solid var(--notice-border); background: var(--notice-bg); border-radius: 0 10px 10px 0; margin-bottom: 24px; line-height: 1.6; }
.room-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.room-grid .card { display: flex; flex-direction: column; }
.room-grid button { margin-top: auto; }
.confirmation { max-width: 660px; margin: 25px auto; text-align: center; }
.confirmation .card { text-align: left; margin: 26px 0; }
.checkmark { background: var(--free-bg); color: var(--free-ink); width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 24px; font-size: 2rem; }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.app-footer { max-width: 1480px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; padding: 0 38px 22px; color: var(--muted); font-size: .75rem; line-height: 1.6; }
dialog { background: var(--surface); max-height: calc(100dvh - 32px); overflow-y: auto; max-width: min(580px, calc(100vw - 32px)); width: 100%; padding: 28px; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 15px 70px #1d2d4440; }
dialog::backdrop { background: #14264160; }
dialog p, dialog li { line-height: 1.6; }
dialog li { margin-bottom: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

:root[data-theme="dark"] {
  --accent: #8ebdff;
  --on-accent: #11233a;
  --primary-hover: #bdd8ff;
  --on-primary-hover: #11233a;
  --ink: #e7edf6;
  --muted: #adbbcd;
  --line: #3b4a60;
  --canvas: #111924;
  --surface: #1b2636;
  --soft-blue: #243c5b;
  --border-soft: #344256;
  --input-border: #708198;
  --blue-border: #47668e;
  --nav-ink: #bdcadd;
  --avatar-bg: #34445c;
  --avatar-ink: #d4e3f8;
  --segmented-bg: #131f30;
  --office-bg: #284360;
  --office-ink: #b7d4ff;
  --home-bg: #344052;
  --home-ink: #d7e0ec;
  --open-bg: #47391c;
  --open-ink: #f9d387;
  --free-bg: #213e32;
  --free-ink: #a4e0ba;
  --free-border: #629677;
  --busy-bg: #303b4c;
  --busy-ink: #bbc7d6;
  --day-column: #22364f;
  --floor-bg: #151f2e;
  --floor-border: #677993;
  --map-divider: #566780;
  --desk-border: #568a6d;
  --desk-bg: #233d31;
  --desk-busy-bg: #303b4c;
  --desk-busy-ink: #becbdc;
  --desk-busy-border: #64748a;
  --desk-mine-border: #7aa5de;
  --notice-bg: #29374c;
  --notice-border: #8aabcf;
  --danger-bg: #48272d;
  --danger-ink: #ffc1bb;
  --danger-border: #b87477;
  --window: #6ba5d4;
  --window-soft: #233e56;
  --focus: #ffcc66;
  --brand-bg: #d4e3f8;
  --brand-ink: #16243a;
  color-scheme: dark;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
input:not([type="checkbox"]):not([type="radio"]), textarea {
  min-height: 44px; min-width: 0; max-width: 100%; padding: 9px 11px;
  border: 1px solid var(--input-border); border-radius: 8px;
  color: var(--ink); background: var(--surface);
}
input[type="checkbox"], input[type="radio"] {
  width: 19px; height: 19px; margin: 0; flex: 0 0 19px; accent-color: var(--accent);
}
input[aria-invalid="true"], select[aria-invalid="true"] { border: 2px solid var(--danger-ink); }
.topbar-start {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-left: 0;
}
.breadcrumb { overflow-wrap: anywhere; }
.top-actions { flex-shrink: 0; }

body.nav-collapsed .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
body.nav-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
body.nav-collapsed #nav-toggle { left: 84px; }
body.nav-collapsed .brand { justify-content: center; margin-left: 0; margin-right: 0; }
body.nav-collapsed .nav-item { justify-content: center; padding-left: 10px; padding-right: 10px; }
body.nav-collapsed .nav-text,
body.nav-collapsed #brand-name,
body.nav-collapsed .nav-label,
body.nav-collapsed .version { display: none; }

.page-head > div:first-child { min-width: 0; }
.date-control { flex-wrap: wrap; max-width: 100%; }
.date-input-wrap { display: flex; min-width: 0; }
.date-input-wrap input { width: 160px; max-width: 100%; }
.time-range { min-width: 0; margin: 0 0 20px; padding: 15px 18px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.time-range legend { padding: 0 6px; font-size: .875rem; font-weight: 650; }
.time-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; }
.time-fields label { display: grid; gap: 7px; font-size: .875rem; font-weight: 550; min-width: 0; }
.time-fields input { width: 148px; }
.time-hint { color: var(--muted); font-size: .875rem; line-height: 1.5; margin: 10px 0 0; }
.field-error { color: var(--danger-ink); font-size: .875rem; font-weight: 600; line-height: 1.5; margin: 10px 0 0; }

.filter-panel { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 24px; padding: 16px 20px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; }
fieldset.filter-group { border: 0; margin: 0; padding: 0; }
.filter-group > label:not(.check-option) { font-size: .875rem; font-weight: 600; }
.filter-group legend { font-size: .875rem; font-weight: 600; padding: 0; margin-bottom: 3px; }
.check-option { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 2px; cursor: pointer; font-size: .875rem; line-height: 1.4; }
.filter-summary { margin: 0 0 16px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.filter-empty { padding: 20px; border: 1px dashed var(--input-border); border-radius: 10px; background: var(--floor-bg); color: var(--muted); line-height: 1.6; }
.filter-empty p:last-child { margin-bottom: 0; }

.team-table tr.team-self > th,
.team-table tr.team-self > td { background: var(--soft-blue); border-bottom-color: var(--blue-border); }
.team-table tr.team-self > th:first-child { box-shadow: inset 4px 0 var(--accent); color: var(--ink); font-weight: 700; }
.team-table tr.team-self .day-column { background: var(--office-bg); }
.team-person.team-self { border-left: 4px solid var(--accent); border-radius: 8px; background: var(--soft-blue); padding-left: 12px; padding-right: 12px; }
.self-label { display: inline-block; width: fit-content; padding: 3px 7px; border-radius: 5px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 750; line-height: 1.3; vertical-align: middle; }
.team-table .name .self-label { color: var(--on-accent); margin-top: 4px; }

.recurrence-panel { margin-top: 24px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.recurrence-panel > summary { padding: 20px 24px; font-weight: 650; line-height: 1.5; cursor: pointer; min-height: 64px; border-radius: var(--radius); }
.recurrence-panel[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.recurrence-panel > :not(summary) { margin-left: 24px; margin-right: 24px; }
.recurrence-panel > :last-child { margin-bottom: 24px; }
.recurrence-panel[open] > summary + * { margin-top: 20px; }
.recurrence-form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid label { display: grid; align-content: start; gap: 8px; font-size: .875rem; font-weight: 600; min-width: 0; }
.form-grid input, .form-grid select { width: 100%; }
.weekday-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 16px; min-width: 0; padding: 12px 16px; margin: 0; border: 1px solid var(--line); border-radius: 10px; }
.weekday-picker legend { padding: 0 5px; font-size: .875rem; font-weight: 600; }
.weekday-picker label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 2px; cursor: pointer; }
.recurrence-form > button { justify-self: start; }
.recurrence-list { display: grid; gap: 12px; margin-top: 24px; }
.recurrence-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--floor-bg); line-height: 1.5; }
.recurrence-item > div { flex: 1 1 240px; min-width: 0; }
.recurrence-item p { margin: 5px 0 0; }
.recurrence-item small { display: block; color: var(--muted); margin-top: 5px; }

.floor-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.floor-heading h2, .floor-heading h3, .floor-heading p { margin-bottom: 0; }
.floor-heading small, .floor-heading > span { font-size: .75rem; color: var(--muted); line-height: 1.5; }
.floor-windows { padding: 7px 12px; margin-bottom: 20px; border-top: 5px solid var(--window); border-bottom: 1px solid var(--window); border-radius: 4px; background: repeating-linear-gradient(90deg, var(--window-soft) 0, var(--window-soft) 45px, var(--window) 46px, var(--window-soft) 47px); text-align: center; color: var(--ink); font-size: .75rem; font-weight: 650; letter-spacing: .04em; }
.map-zone h3 { padding: 9px 10px; background: var(--soft-blue); border-radius: 6px; color: var(--ink); }
.map-zone h3 small { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); margin-top: 3px; }
.map-zone + .map-zone h3 { background: var(--home-bg); }
.desk.filtered { background: var(--floor-bg); border-color: var(--desk-busy-border); border-style: dashed; color: var(--muted); opacity: .65; outline: none; }
.map-corridor { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 58px; border-bottom: 2px solid var(--map-divider); padding: 13px 8px; margin-top: 20px; background: var(--surface); }
.map-entrance { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--blue-border); border-radius: 5px; color: var(--accent); font-weight: 650; background: var(--soft-blue); }
.map-landmarks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.map-landmark { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 11px 8px; min-height: 68px; border: 1px solid var(--floor-border); border-top-width: 3px; border-radius: 5px; text-align: center; color: var(--muted); font-size: .75rem; line-height: 1.45; overflow-wrap: anywhere; }
.map-landmark strong { color: var(--ink); font-weight: 650; }
.resource-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.resource-title h2, .resource-title h3 { margin-bottom: 0; }
.resource-title + .time-hint { margin-bottom: 16px; }
.reserved-list { display: grid; gap: 8px; padding-left: 18px; margin: 10px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.room-resource > div { min-width: 0; }
.room-resource strong { line-height: 1.4; }
.booking-detail { overflow-wrap: anywhere; }
.booking-detail .status { max-width: 100%; white-space: normal; text-align: center; }

/* Notifications sit near the action area, stay readable in either theme,
   and use an explicit symbol as well as color to communicate the result. */
.toast {
  position: fixed; top: 96px; right: 24px; left: auto; bottom: auto;
  display: flex; align-items: center; gap: 12px; width: max-content;
  max-width: min(460px, calc(100vw - 32px)); padding: 13px 12px 13px 16px;
  border: 1px solid var(--blue-border); border-left-width: 5px; border-radius: 12px;
  background: var(--soft-blue); color: var(--ink); box-shadow: 0 8px 28px #08172826;
  z-index: 30; font-size: .875rem; line-height: 1.5; opacity: 0;
  visibility: hidden; pointer-events: none; transition: opacity .15s, visibility .15s;
}
.toast.visible { opacity: 1; visibility: visible; pointer-events: auto; }
.toast.success { background: var(--free-bg); color: var(--free-ink); border-color: var(--free-border); }
.toast.error { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-border); }
.toast.info { background: var(--soft-blue); color: var(--ink); border-color: var(--blue-border); }
.toast-symbol { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 1.1rem; }
.toast.success .toast-symbol { background: var(--free-ink); color: var(--free-bg); }
.toast.error .toast-symbol { background: var(--danger-ink); color: var(--danger-bg); }
.toast-copy { min-width: 0; overflow-wrap: anywhere; }
.toast-copy strong { display: block; margin-bottom: 2px; }
.week-events { margin-top: 6px; color: var(--muted); }
.week-events small { display: block; font-size: .75rem; line-height: 1.5; }
.workday > div { min-width: 0; }
.workday select { flex-shrink: 0; }
.team-table caption { text-align: left; padding: 0 12px 16px; }
.reserved-list { padding-left: 0; }
.reserved-list ul { margin-top: 0; padding-left: 20px; }
.toast-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; padding: 8px; align-self: start; background: transparent; border-color: transparent; color: inherit; font-size: 1.25rem; }
.toast-close:hover:not(:disabled) { background: var(--surface); border-color: currentColor; color: var(--ink); }

@media (min-width: 1500px) { main { padding-top: 44px; } .dashboard-card { min-height: 265px; } }
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  #nav-toggle { left: 190px; }
  body.nav-collapsed #nav-toggle { left: 84px; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  main { padding: 28px 24px 24px; }
  .topbar { padding: 16px 24px; }
  .page-head { flex-wrap: wrap; gap: 18px; }
  .resource-layout { grid-template-columns: 1fr; }
  .booking-detail .detail-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
  .calendar-layout { grid-template-columns: minmax(270px,1fr) minmax(0,1.1fr); }
  .app-footer { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 850px) {
  .app-shell { display: block; }
  #nav-toggle {
  position: static;
  transform: none;
  box-shadow: none;
  }

  .topbar-start { padding-left: 0; }
  body.nav-collapsed .sidebar { display: none; }
  .sidebar { position: static; height: auto; padding: 18px 18px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 0 14px; font-size: 1rem; }
  .nav-label, .sidebar-bottom { display: none; }
  #navigation { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 5px; }
  .nav-item { width: auto; white-space: nowrap; margin: 0; }
  .nav-item svg { width: 18px; }
  .topbar { min-height: 66px; padding: 10px 20px; }
  .calendar-layout { grid-template-columns: 1fr 1.2fr; }
  .room-grid { grid-template-columns: 1fr; }
  .version { display: none; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-actions { gap: 8px; }
}
@media (max-width: 650px) {
  main { padding: 24px 16px; }
  .grid-2, .calendar-layout, .day-team-list { grid-template-columns: 1fr; }
  .dashboard-card { min-height: 215px; }
  .card { padding: 20px; }
  .today-strip { flex-wrap: wrap; padding: 14px; }
  .today-strip > div { width: 100%; justify-content: space-between; }
  .date-control { gap: 4px; width: 100%; }
  .date-control strong { min-width: 0; flex: 1; }
  .date-control .secondary { padding: 10px; }
  .day-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .day-tabs button { padding: 12px 7px; text-align: center; }
  .day-tabs small { font-size: .75rem; }
  .demo-badge { display: none; }
  .app-footer { flex-direction: column; padding: 0 16px 20px; }
  .floorplan { padding: 13px; }
  .map-zones { gap: 14px; }
  .map-zone + .map-zone { padding-left: 14px; }
  .desk-grid { grid-template-columns: 1fr; gap: 10px; }
  .desk { min-height: 68px; }
  .resource-item { grid-template-columns: minmax(0, 1fr) 132px; gap: 12px; }
  .resource-item > div { grid-column: 1 / -1; }
  .resource-item > .status { grid-column: 2; grid-row: 2; justify-self: center; }
  .resource-item > button { grid-column: 1; grid-row: 2; max-width: 132px; }
  .booking-row { flex-wrap: wrap; }
  .appointment { grid-template-columns: 50px 1fr; }
  .appointment > small { display: none; }
  .booking-detail .detail-list { display: block; }
  .topbar { padding-left: 16px; padding-right: 16px; gap: 10px; }
  .topbar-start { gap: 8px; }
  .top-actions { gap: 5px; }
  .date-input-wrap { flex: 1 1 140px; }
  .date-input-wrap input { width: 100%; }
  .time-range { padding: 12px; }
  .time-fields { gap: 12px; }
  .time-fields label { flex: 1 1 112px; }
  .time-fields input { width: 100%; }
  .filter-panel { padding: 12px 16px; gap: 10px 16px; }
  .filter-group { gap: 6px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .recurrence-panel > summary { padding: 17px 20px; }
  .recurrence-panel > :not(summary) { margin-left: 20px; margin-right: 20px; }
  .recurrence-panel > :last-child { margin-bottom: 20px; }
  .weekday-picker { gap: 4px 12px; padding: 10px 12px; }
  .recurrence-item { padding: 12px; }
  .team-person { gap: 8px; }
  .team-person .status { white-space: normal; text-align: center; }
  .toast { right: 16px; top: 82px; }
  .map-landmarks { gap: 6px; }
  .map-landmark { padding-left: 5px; padding-right: 5px; }
  dialog { padding: 20px; }
  .dialog-actions > button { flex: 1 1 130px; }
}
@media (max-width: 380px) {
  .top-actions > .avatar { display: none; }
  .workday { flex-wrap: wrap; gap: 8px; }
  .workday select { width: 100%; }
  .day-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card { padding: 16px; }
  .recurrence-panel { padding: 0; }
  .today-strip > div { justify-content: flex-start; }
  .date-control .secondary { flex: 1 1 auto; }
  .map-landmarks { grid-template-columns: 1fr; }
  .map-landmark { min-height: 44px; }
  .booking-row > button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  :root, :root[data-theme="dark"] {
  --brand-accent: #2459a9;
  --accent: var(--brand-accent);
  --on-accent: #fff;
  --primary-hover: #1d2d44;
  --on-primary-hover: #fff;
  --ink: #1d2d44;
  --muted: #58697b;
  --line: #dce3ec;
  --canvas: #f3f6fa;
  --surface: #fff;
  --soft-blue: #edf3fc;
  --border-soft: #edf0f5;
  --input-border: #bac7d7;
  --blue-border: #cbd9ef;
  --nav-ink: #506177;
  --avatar-bg: #e9eef5;
  --avatar-ink: #425a78;
  --segmented-bg: #e7edf5;
  --office-bg: #e7effd;
  --office-ink: #24549b;
  --home-bg: #edf0f4;
  --home-ink: #46566c;
  --open-bg: #fff4dd;
  --open-ink: #795310;
  --free-bg: #e7f4ec;
  --free-ink: #256340;
  --free-border: #719e82;
  --busy-bg: #eef0f3;
  --busy-ink: #586373;
  --day-column: #f4f7fd;
  --floor-bg: #f7f9fc;
  --floor-border: #c4cfdd;
  --map-divider: #d0d9e5;
  --desk-border: #9fc4ae;
  --desk-bg: #f0f8f3;
  --desk-busy-bg: #e8edf3;
  --desk-busy-ink: #606d80;
  --desk-busy-border: #c7d0dc;
  --desk-mine-border: #a4bbdf;
  --notice-bg: #eef2f8;
  --notice-border: #8299b5;
  --danger-bg: #fff0ef;
  --danger-ink: #9e2525;
  --danger-border: #dd9b99;
  --window: #87b8df;
  --window-soft: #e4f1fc;
  --focus: #b57900;
  --brand-bg: #1d2d44;
  --brand-ink: #fff;
  color-scheme: light;
  }
  .sidebar, .topbar, .app-footer, .toast, dialog, .skip-link { display: none !important; }
  .app-shell { display: block; }
  main { padding: 0; max-width: none; min-height: 0; }
  body, :root { background: var(--surface); color: #17243a; font-size: 10pt; }
  .card, .today-strip, .resource-item { break-inside: avoid; }
  button, select { print-color-adjust: exact; }
  .print-page { break-after: page; padding: 0; zoom: .75; }
  .print-page:last-child { break-after: auto; }
  .print-heading { font-size: 10pt; color: #58697b; border-bottom: 1px solid #ccd5e1; padding-bottom: 8px; margin-bottom: 16px; }
  h1 { font-size: 22pt; }
  h2 { font-size: 12pt; }
  .page-head { flex-wrap: nowrap; margin-bottom: 16px; }
  .card { padding: 16px; }
  .dashboard-card { min-height: 150px; }
  .card-heading { margin-bottom: 8px; }
  .card > .text-button { padding-top: 10px; }
  .appointment { padding: 8px 0; }
  .today-strip { padding: 10px 16px; margin-bottom: 16px; }
  .bookings { margin-top: 16px; }
  .bookings p { margin-bottom: 0; }
  .toolbar, .day-tabs { margin-bottom: 14px; }
  .day-tabs button { padding: 9px 12px; }
  button, select { min-height: 34px; }
  .segmented button { min-height: 32px; }
  .team-table .avatar { width: 26px; height: 26px; }
  .team-table .name { min-width: 170px; }
  .booking-detail .detail-list { display: block; }
  .print-intro { max-width: 850px; }
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .resource-layout { grid-template-columns: 1.5fr 1fr; }
  .day-team-list { grid-template-columns: 1fr 1fr; }
  .team-table { font-size: 9pt; }
  .team-table td, .team-table th { padding: 5px 8px; }
  .team-table .status { font-size: 9pt; }
  .calendar-layout { grid-template-columns: 1fr 1.4fr; }
  @page { size: A4 landscape; margin: 12mm; }
}
