/* きゃべつ 予定表 — compact operations UI */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  color-scheme: light;
  --ink: #17251c;
  --muted: #68766d;
  --line: #dfe7e1;
  --line-soft: #edf2ee;
  --surface: #fff;
  --surface-subtle: #f5f8f5;
  --brand: #327c3c;
  --brand-dark: #225f2c;
  --brand-soft: #edf7ef;
  --blue: #3575c7;
  --blue-soft: #f1f6fd;
  --blue-line: #a9c8ee;
  --danger: #c54444;
  --danger-soft: #fff3f2;
  --warn: #b86d08;
  --warn-soft: #fff7e7;
  --header-h: 86px;
  --staff-col: 184px;
  --radius: 10px;
  --shadow: 0 18px 48px rgb(24 45 30 / .12);
  --shadow-sm: 0 1px 2px rgb(24 45 30 / .04), 0 8px 24px rgb(24 45 30 / .05);
}

html, body { margin: 0; min-height: 100%; background: #fbfcfb; }
body {
  overflow-x: hidden;
  color: var(--ink);
  font: var(--text-body)/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.lucide { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 1.8; }
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 9px 13px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand-dark);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* App shell */
#topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: grid;
  width: 100%;
  height: var(--header-h);
  grid-template-columns: 190px minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / .98);
}
.brand {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 8px;
  padding: 0 21px;
  color: var(--brand-dark);
  letter-spacing: .02em;
}
.brand img { width: 32px; height: 32px; flex: 0 0 auto; object-fit: contain; }
.brand > span { display: grid; gap: 1px; }
.brand strong { font-size: var(--text-heading); line-height: 1.05; letter-spacing: -.045em; }
.brand small { color: #708075; font-size: var(--text-dense); font-weight: var(--weight-strong); letter-spacing: .04em; line-height: 1.15; white-space: nowrap; }
#nav {
  display: flex;
  min-width: 0;
  height: 100%;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}
#nav a {
  position: relative;
  display: flex;
  min-height: 100%;
  flex: 0 1 auto;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  padding: 0 clamp(12px, 1.3vw, 20px);
  border-bottom: 3px solid transparent;
  text-decoration: none;
  font-size: var(--text-small);
  font-weight: var(--weight-strong);
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
#nav a .lucide { width: 18px; height: 18px; color: #6d7b71; stroke-width: 1.75; }
#nav a:hover { color: var(--brand-dark); background: #fbfdfb; }
#nav a:hover .lucide { color: var(--brand); }
#nav a.active { border-bottom-color: transparent; color: var(--brand); background: transparent; }
#nav a.active .lucide { color: var(--brand); }
.nav-more { position: relative; display: flex; min-height: 100%; align-items: stretch; }
.nav-more > summary {
  display: flex;
  min-height: 100%;
  align-items: center;
  gap: 9px;
  padding: 0 clamp(12px, 1.3vw, 20px);
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary .lucide { width: 18px; height: 18px; color: #6d7b71; }
.nav-more > summary:hover, .nav-more > summary.active, .nav-more[open] > summary { color: var(--brand); background: #fbfdfb; }
.nav-more > summary:hover .lucide, .nav-more > summary.active .lucide, .nav-more[open] > summary .lucide { color: var(--brand); }
.nav-more-menu {
  position: absolute;
  top: calc(100% - 8px);
  right: 0;
  z-index: 20;
  display: grid;
  width: 224px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
#nav .nav-more-menu a {
  min-height: 42px;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  font-size: var(--text-small);
}
#nav .nav-more-menu a:hover, #nav .nav-more-menu a.active { color: var(--brand-dark); background: var(--brand-soft); }
#topbar > .spacer { display: none; }
#jobbar {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  right: 20px;
  z-index: 12;
  color: var(--muted);
  font-size: var(--text-small);
}
#jobbar:empty { display: none; }
#jobbar span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
#userbox { position: relative; display: flex; height: 100%; align-items: center; justify-content: center; padding: 0 14px 0 8px; }
#userbox #account-trigger {
  position: relative;
  width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
#userbox #account-trigger:hover { background: var(--brand-soft); box-shadow: none; }
#userbox #account-trigger[aria-expanded="true"] { background: var(--brand-soft); }
.account-avatar { position: relative; display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #edf7ef; box-shadow: 0 0 0 1px #cbd9ce; line-height: 1; }
.account-avatar img { display: block; width: 100%; height: 100%; border-radius: inherit; }
.account-avatar-large { width: 48px; height: 48px; }
#account-scrim { position: fixed; inset: 0; z-index: 39; width: 100%; min-height: 100%; padding: 0; border: 0; border-radius: 0; background: rgb(19 31 23 / .38); box-shadow: none; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
#account-scrim.open { opacity: 1; pointer-events: auto; }
#account-drawer { position: fixed; inset: 0 0 0 auto; z-index: 40; display: flex; width: min(420px, 100vw); min-height: 100dvh; flex-direction: column; overflow: hidden; border-left: 1px solid var(--line); background: #fff; box-shadow: -20px 0 60px rgb(18 35 23 / .16); transform: translateX(104%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
#account-drawer[aria-hidden="false"] { transform: translateX(0); visibility: visible; transition: transform .22s ease; }
#account-drawer-content { display: flex; min-height: 100%; flex: 1; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
body.account-drawer-open { overflow: hidden; }
.account-drawer-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) 38px; align-items: center; gap: 12px; padding: 20px 18px 18px; border-bottom: 1px solid var(--line); }
.account-identity { display: grid; min-width: 0; gap: 2px; }
.account-identity strong { overflow: hidden; font-size: var(--text-body); text-overflow: ellipsis; white-space: nowrap; }
.account-identity small { color: var(--muted); font-size: var(--text-dense); }
.icon-button { width: 38px; min-height: 38px; padding: 0; border-color: transparent; border-radius: 50%; box-shadow: none; }
.icon-button:hover { border-color: transparent; background: var(--surface-subtle); box-shadow: none; }
.icon-button .lucide { width: 17px; height: 17px; }
#account-overview { flex: 1; }
.account-drawer-foot { display: grid; gap: 10px; margin-top: auto; padding: 16px 18px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fbfcfb; }
.account-drawer-foot > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: var(--text-dense); }
.account-drawer-foot > span .lucide { width: 14px; height: 14px; color: var(--brand); }
.account-drawer-foot > small { color: var(--muted); font-size: var(--text-dense); }
.account-manual-link { display: grid; grid-template-columns: 18px 1fr 16px; align-items: center; gap: 9px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); color: var(--ink); background: #fff; font-size: var(--text-dense); font-weight: var(--weight-strong); text-decoration: none; }
.account-manual-link .lucide { width: 15px; height: 15px; color: var(--brand); }
.account-manual-link:hover { border-color: #bad4bf; background: var(--surface-subtle); }
.account-drawer-foot #logout { width: 100%; justify-content: flex-start; border-color: transparent; color: var(--muted); background: transparent; box-shadow: none; font-size: var(--text-dense); }
.account-drawer-foot #logout:hover { color: var(--ink); background: var(--surface-subtle); }
@keyframes spin { to { transform: rotate(360deg); } }

main { min-width: 0; min-height: calc(100vh - var(--header-h)); margin-top: var(--header-h); padding: 40px 38px 44px; }
#topbar[hidden] + main { min-height: 100vh; margin: 0; }
.pattern-view main { padding: 14px 32px 18px; }

/* Type and controls */
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: var(--text-display); line-height: 1.25; letter-spacing: -.035em; }
h1[tabindex="-1"]:focus { outline: none; }
h2 { margin-bottom: 12px; font-size: var(--text-heading); letter-spacing: -.01em; }
h3 { margin: 20px 0 8px; font-size: var(--text-body); }
.page-heading { margin-bottom: 14px; }
.page-heading p { margin: 0; color: var(--muted); font-size: var(--text-small); }

label, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.inline, .toolbar, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { margin-bottom: 14px; }
.actions { justify-content: flex-end; }
.sep { color: var(--line); }

/* Daily schedule */
.day-toolbar { gap: 10px; }
.date-switch, .day-actions, .day-summary { display: flex; align-items: center; gap: 7px; }
.day-tools-menu { position: relative; }
.day-tools-menu[open] { z-index: 30; }
.day-tools-menu > summary {
  list-style: none;
  cursor: pointer;
}
.day-tools-menu > summary::-webkit-details-marker { display: none; }
.day-tools-menu > summary small { color: var(--muted); font-size: var(--text-small); font-weight: var(--weight-medium); }
.day-tools-menu > summary .lucide:last-child { width: 14px; height: 14px; transition: transform .15s ease; }
.day-tools-menu[open] > summary .lucide:last-child { transform: rotate(180deg); }
.day-tools-menu > div {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 31;
  display: grid;
  width: min(410px, calc(100vw - 32px));
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  max-height: min(640px, calc(100dvh - 180px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.day-tools-menu:not([open]) > div { display: none; }
.day-tools-heading { position: sticky; top: -10px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 6px; background: var(--surface); }
.day-tools-heading > strong { font-size: var(--text-body); }
.day-tools-heading > button { width: 44px; min-height: 44px; padding: 0; border: 0; color: var(--muted); background: transparent; box-shadow: none; }
.day-tools-heading > button .lucide { width: 18px; height: 18px; }
.day-tools-menu summary:focus-visible, .day-tools-menu button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.day-tools-menu > div > button { width: 100%; justify-content: flex-start; box-shadow: none; }
.calendar-picker { position: relative; display: inline-flex; min-width: 190px; min-height: var(--control-height); align-items: center; justify-content: center; gap: 8px; padding: var(--control-padding); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--surface); cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.calendar-picker:hover { border-color: #aac7af; background: #fbfdfb; box-shadow: 0 3px 10px rgb(32 75 44 / .07); }
.calendar-picker strong { font-size: var(--text-body); font-weight: var(--weight-medium); white-space: nowrap; }
.calendar-picker > .lucide { width: 15px; height: 15px; flex: 0 0 auto; color: var(--brand); }
.calendar-picker input { position: absolute; inset: 0; width: 100%; min-height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.calendar-picker:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.day-summary { padding: 3px; border-radius: var(--radius); background: var(--surface-subtle); }
.day-summary > span, .day-summary-trigger { padding: 5px 9px; border: 0; border-right: 1px solid var(--line); border-radius: 0; color: var(--muted); background: transparent; box-shadow: none; white-space: nowrap; }
.day-summary > :last-child { border-right: 0; }
.day-summary-trigger { display: inline-flex; min-height: 0; align-items: center; gap: 3px; font-size: inherit; font-weight: inherit; }
.day-summary-trigger:hover { border-color: var(--line); color: var(--brand-dark); background: var(--brand-soft); box-shadow: none; }
.day-summary-trigger:active:not(:disabled) { transform: none; }
.day-summary-trigger .lucide { width: 13px; height: 13px; margin-left: 2px; }
.day-summary strong { color: var(--ink); font-size: var(--text-label); }
.day-summary .has-alert, .day-summary .has-alert strong { color: var(--danger); }
.day-tools-menu .reserved-time-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding-block: 8px; border-bottom: 1px solid var(--line); }
.day-tools-menu .reserved-time-toolbar button { justify-content: flex-start; white-space: normal; text-align: left; }
.day-actions .primary { min-width: 108px; }
.board-row { content-visibility: auto; contain-intrinsic-block-size: 72px; }

/* Full labels no longer fit between the brand and account around tablet widths. */
@media (min-width: 901px) and (max-width: 1240px) {
  #topbar { grid-template-columns: 166px minmax(0, 1fr) auto; }
  .brand { padding-inline: 18px; }
  #nav a { min-width: 52px; padding-inline: 12px; }
  #nav a span { display: none; }
  #userbox { padding-inline: 10px; }
}

.day-planning-grid { display: block; }
.day-board-column { min-width: 0; }
.board-scroll {
  position: relative;
  min-height: 420px;
  max-height: calc(100vh - 274px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scrollbar-gutter: stable;
}
.board-header, .board { min-width: calc(var(--staff-col) + var(--day-track-width, 1576px)); }
.day-timeline-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; }
.day-timeline-toolbar > span { color: var(--muted); font-size: var(--text-small); }
.day-timeline-toolbar strong { color: var(--ink); }
.day-timeline-toolbar button { min-height: var(--control-height); padding: 6px 10px; color: var(--brand-dark); font-size: var(--text-body); box-shadow: none; }
.board-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: var(--staff-col) 1fr;
  border-bottom: 1px solid #d5e0d7;
  background: rgb(244 248 245 / .98);
  backdrop-filter: blur(10px);
}
.board-header > div:first-child {
  position: sticky;
  left: 0;
  z-index: 10;
  display: grid;
  align-content: center;
  padding: 8px 14px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: #f4f8f5;
  font-size: var(--text-small);
  font-weight: var(--weight-strong);
}
.board-header > div:first-child small { color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-medium); }
.timescale { position: relative; height: 42px; }
.timescale span { position: absolute; top: 11px; transform: translateX(-50%); color: #56645b; font-size: var(--text-dense); font-weight: var(--weight-strong); white-space: nowrap; }
.timescale .timescale-now { top: 3px; z-index: 2; padding: 1px 5px; border-radius: 99px; color: #fff; background: var(--danger); font-size: var(--text-dense); font-weight: var(--weight-strong); transform: translateX(-50%); }
.board-row { display: grid; height: auto; min-height: var(--day-row-height, 72px); grid-template-columns: var(--staff-col) 1fr; border-top: 1px solid #e1e8e3; }
.board-row:first-child { border-top: 0; }
.board-name {
  position: sticky;
  left: 0;
  z-index: 6;
  display: flex;
  width: 100%;
  height: auto;
  min-height: var(--day-row-height, 72px);
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 9px 13px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: #fbfdfb;
  box-shadow: none;
  text-align: left;
}
.board-row:nth-child(even) .board-name { background: #f7faf7; }
.board-row:nth-child(even) .board-track { background: #fbfdfb; }
.board-row:hover .board-name { color: var(--brand-dark); background: #edf7ef; }
.board-row:hover .board-track { background-color: #f7fbf8; }
.board-name:hover { border-color: var(--line); color: var(--brand-dark); background: var(--brand-soft); box-shadow: none; }
.board-name:active:not(:disabled) { transform: none; }
.staff-copy { min-width: 0; font-weight: var(--weight-strong); }
.staff-copy > span { display: block; overflow: hidden; font-size: var(--text-small); font-weight: var(--weight-strong); text-overflow: ellipsis; white-space: nowrap; }
.staff-copy small { display: flex; min-width: 0; align-items: center; gap: 5px; margin-top: 2px; color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-medium); }
.staff-copy small > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-copy small > em { flex: 0 0 auto; padding: 1px 4px; border-radius: 4px; color: var(--brand-dark); background: #e8f3ea; font-size: var(--text-dense); font-style: normal; font-weight: var(--weight-strong); }
.staff-copy .tag { padding: 1px 4px; font-size: var(--text-dense); }
.staff-route-arrow { width: 13px; height: 13px; margin-left: auto; color: #93a097; }
.staff-warning { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; color: var(--danger); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.staff-warning .lucide { width: 13px; height: 13px; }
.staff-warning + .staff-route-arrow { margin-left: 0; }
.bound-badge { display: inline-flex; max-width: 100%; align-items: center; gap: 3px; margin-top: 3px; padding: 1px 4px; border-radius: 4px; color: #855108; background: #fff1cf; font-size: var(--text-dense); font-weight: var(--weight-strong); white-space: nowrap; }
.bound-badge .lucide { flex: 0 0 11px; width: 11px; height: 11px; }
.staff-copy > .bound-badge { display: inline-flex; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.bound-badge.over-limit { color: #a2322f; background: #ffebe8; }
.bound-detail { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf8; font-size: var(--text-dense); line-height: 1.6; }
.bound-detail-title { display: flex; align-items: center; gap: 6px; }
.bound-detail-title .lucide { flex: 0 0 14px; width: 14px; height: 14px; }
.bound-detail p { margin: 3px 0 0; }
.bound-detail ul { margin: 6px 0 0; padding-left: 18px; }
.bound-detail.within-allowance { border-color: #eed398; color: #855108; background: #fff8e9; }
.bound-detail.over-limit { border-color: #efb8b1; color: #a2322f; background: #fff1ee; }
.board-track { position: relative; min-width: 0; height: auto; min-height: var(--day-row-height, 72px); overflow: hidden; background: var(--surface); transition: background-color .12s ease; }
.gridline, .offwork, .break-block, .visit-event, .absence-label, .travel-leg, .current-time-line { position: absolute; }
.gridline { inset-block: 0; width: 1px; }
.gridline.hour { background: #dbe5dd; }
.gridline.half { background: #f0f4f1; }
.offwork { inset-block: 0; background: var(--surface-subtle); }
.break-block {
  inset-block: 0;
  background: repeating-linear-gradient(135deg, #fff 0 6px, #edf1ed 6px 10px);
}
.visit-event { height: 55px; min-width: 43px; }
.visit-event:hover, .visit-event:focus-within { z-index: 8; }
.visit-block {
  position: absolute;
  inset: 0 0 auto;
  display: block;
  width: 100%;
  height: 38px;
  min-width: 43px;
  min-height: 0;
  overflow: hidden;
  padding: 5px 7px 4px;
  border: 0;
  border-radius: 2px 2px 0 0;
  color: #29434b;
  background: #edf2f3;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.visit-block:hover { z-index: 3; background: #e2ebed; box-shadow: 0 4px 11px rgb(43 72 56 / .13); }
.visit-block.readonly { cursor: default; }
.visit-block.confirmed { color: var(--brand-dark); background: #e4f1e6; box-shadow: none; }
.visit-block.conflict { z-index: 2; color: #9f302c; background: repeating-linear-gradient(135deg, #fff2f0 0 8px, #ffe4e0 8px 12px); }
.visit-block.travel-risk { color: #865508; background: var(--warn-soft); }
.visit-block > :not(.rec) { position: relative; z-index: 1; }
.visit-main, .visit-meta { display: block; overflow: hidden; text-overflow: ellipsis; }
.visit-main { font-size: var(--text-dense); line-height: 1.25; font-weight: var(--weight-strong); letter-spacing: -.01em; }
.visit-main .time { margin-right: 3px; color: #285968; font-size: var(--text-dense); font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }
.visit-block.confirmed .visit-main .time { color: var(--brand-dark); }
.visit-meta { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: #68776e; font-size: var(--text-dense); font-weight: var(--weight-medium); line-height: 1.1; }
.visit-meta b { flex: 0 0 auto; padding: 1px 3px; color: #476156; background: rgb(255 255 255 / .7); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.visit-meta span { overflow: hidden; text-overflow: ellipsis; }
.visit-block.short { padding-inline: 4px; }
.visit-block.short .visit-main { font-size: var(--text-dense); line-height: 1.2; }
.visit-block.short .time { display: block; }
.visit-block.short .visit-meta { display: none; }
.visit-block .rec { position: absolute; inset: 0 0 0 auto; border-left: 1px dashed rgb(53 117 199 / .25); background: rgb(53 117 199 / .07); }
.visit-warning { position: absolute !important; top: 3px; right: 3px; z-index: 2 !important; display: grid; width: 15px; height: 15px; place-items: center; border-radius: 50%; color: #fff; background: var(--danger); }
.visit-warning .lucide { width: 10px; height: 10px; }
.visit-block.travel-risk .visit-warning { background: var(--warn); }
.visit-condition { position: absolute !important; right: 3px; bottom: 3px; z-index: 2 !important; display: grid; width: 15px; height: 15px; place-items: center; border: 1px solid #ddb76a; border-radius: 50%; color: #825608; background: #fff7df; }
.visit-condition .lucide { width: 10px; height: 10px; }
.visit-set { position: absolute !important; right: 21px; bottom: 3px; z-index: 2 !important; display: grid; width: 15px; height: 15px; place-items: center; color: #315f43; background: #eef7f1; border: 1px solid #a9c9b2; }
.visit-set .lucide { width: 10px; height: 10px; }
.visit-lock-toggle {
  display: grid;
  place-items: center;
  border: 1px solid #c5d2c8;
  color: #66736a;
  background: rgb(255 255 255 / .94);
  box-shadow: 0 1px 4px rgb(27 50 32 / .12);
}
.visit-lock-toggle {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
  pointer-events: auto;
}
.visit-lock-toggle .lucide { width: 11px; height: 11px; }
.visit-lock-toggle:hover, .visit-lock-toggle:focus-visible { border-color: var(--brand); color: var(--brand-dark); background: #fff; }
.visit-lock-toggle.is-locked { border-color: var(--brand); color: #fff; background: var(--brand); }
.visit-lock-toggle:disabled { opacity: .45; }
.visit-client-label {
  position: absolute;
  top: 37px;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: min(240px, calc(100vw - 54px));
  min-width: 100%;
  min-height: 18px;
  padding: 1px 4px 1px 7px;
  border-left: 3px solid #8ca39a;
  color: var(--ink);
  background: #f2f5f4;
  font-size: var(--text-dense);
  font-weight: var(--weight-strong);
  line-height: 14px;
  pointer-events: none;
  white-space: nowrap;
}
.visit-client-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.visit-block.confirmed + .visit-client-label { border-left-color: var(--brand); color: var(--brand-dark); background: #edf6ef; }
.visit-block.conflict + .visit-client-label { border-left-color: var(--danger); color: #8d2d29; background: #fff0ee; }
.visit-block.travel-risk + .visit-client-label { border-left-color: var(--warn); color: #78500b; background: #fff7e4; }
.visit-event.align-end .visit-client-label { right: 0; left: auto; }
.visit-event:hover .visit-client-label, .visit-event:focus-within .visit-client-label { z-index: 9; filter: brightness(.98); }
.travel-leg { z-index: 2; display: flex; height: 24px; align-items: center; justify-content: center; color: #486977; pointer-events: none; }
.travel-leg::before { position: absolute; right: 0; left: 0; border-top: 1px dashed #b5c7cb; content: ""; }
.travel-leg::after { position: absolute; top: 9px; right: 0; width: 5px; height: 5px; border-top: 1px solid #8ca9b1; border-right: 1px solid #8ca9b1; content: ""; transform: rotate(45deg); }
.travel-leg-label { position: relative; z-index: 1; display: inline-flex; flex: 0 0 auto; min-width: 48px; min-height: 24px; align-items: center; justify-content: center; gap: 4px; padding: 3px 7px; border: 1px solid #d3e0e4; border-radius: 6px; color: #395e6a; background: #f3f8fa; box-shadow: none; font-size: var(--text-dense); line-height: 16px; font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: auto; }
.travel-leg-label .lucide { width: 12px; height: 12px; }
.travel-leg-label:hover { border-color: #90adb7; color: #234955; background: #e7f1f5; box-shadow: none; transform: none; }
.travel-leg.risk .travel-leg-label { border-color: #d6b273; color: #875307; background: #fff5df; }
.travel-leg.unknown .travel-leg-label { color: #6c716d; background: #f7f8f6; border-style: dashed; }
.travel-legend .lucide { width: 14px; height: 14px; color: #395e6a; }
.current-time-line { inset-block: 0; z-index: 5; width: 1px; background: rgb(197 68 68 / .7); pointer-events: none; }
.current-time-line span { display: none; }
.board-row.absent .board-name { color: var(--danger); background: var(--danger-soft); }
.board-row.absent .board-track { background: var(--danger-soft); }
.absence-label { inset: 0; display: grid; place-items: center; color: var(--danger); font-size: var(--text-small); font-weight: var(--weight-strong); }

.board-legend { display: flex; flex-wrap: wrap; gap: 10px 17px; padding: 9px 4px; color: var(--muted); font-size: var(--text-dense); }
.board-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 13px; height: 13px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-subtle); }
.legend-swatch.proposed { border-color: transparent; background: #edf2f3; }
.legend-swatch.confirmed { border-color: #a8d0aa; background: var(--brand-soft); }
.legend-swatch.break { background: #edf1ed; }
.legend-swatch.conflict { border-color: #e26a63; background: repeating-linear-gradient(135deg, #fff2f0 0 5px, #ffdcd8 5px 8px); }
.legend-swatch.travel-risk { border-color: #d5a141; background: var(--warn-soft); }
.legend-swatch.absent { border-color: #efc1be; background: var(--danger-soft); }

.day-unassigned-dialog { inset: 0 0 0 auto; width: min(380px, calc(100vw - 20px)); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: var(--ink); background: #fff; box-shadow: -24px 0 70px rgb(20 38 25 / .2); }
.day-unassigned-dialog::backdrop { background: rgb(20 34 24 / .28); backdrop-filter: blur(2px); }
.day-unassigned-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.day-unassigned-dialog > header { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.day-unassigned-dialog > header > div { display: flex; align-items: center; gap: 8px; }
.day-unassigned-dialog > header > div > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--brand-dark); background: var(--brand-soft); }
.day-unassigned-dialog > header .lucide { width: 16px; height: 16px; }
.day-unassigned-dialog h2 { margin: 0; font-size: var(--text-heading); }
.day-unassigned-dialog header strong { color: var(--brand-dark); font-size: var(--text-label); }
.day-unassigned-dialog header strong.has-alert { color: var(--danger); }
.day-unassigned-dialog header small { margin-left: 2px; color: var(--muted); font-size: var(--text-dense); }
.day-unassigned-close { width: 38px; min-height: 38px; padding: 0; border-radius: 50%; }
.day-unassigned-dialog > .unassigned-list { min-height: 0; overflow-y: auto; padding: 12px; }
.unassigned-list { min-height: 0; overflow-y: auto; padding: 9px; }
.unassigned-card { display: grid; gap: 5px; margin-bottom: 8px; padding: 11px; border: 1px solid #eadbb9; border-radius: 10px; background: #fffaf0; }
.unassigned-card:last-child { margin-bottom: 0; }
.unassigned-card-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.unassigned-client { display: flex; min-width: 0; align-items: center; gap: 6px; }
.unassigned-client .lucide { width: 13px; height: 13px; color: var(--muted); }
.unassigned-client strong { overflow: hidden; font-size: var(--text-dense); text-overflow: ellipsis; white-space: nowrap; }
.unassigned-state { padding: 2px 5px; border: 1px solid #e3b2ad; border-radius: 5px; color: var(--danger); background: #fff; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.unassigned-time { color: var(--ink); font-size: var(--text-small); }
.unassigned-meta { color: var(--muted); font-size: var(--text-dense); }
.unassigned-reason { display: flex; align-items: flex-start; gap: 4px; color: #9b5d08; font-size: var(--text-dense); line-height: 1.4; }
.unassigned-reason .lucide { width: 11px; height: 11px; margin-top: 1px; }
.unassigned-note { display: flex; align-items: flex-start; gap: 4px; padding: 5px 6px; border-radius: 6px; color: #744d08; background: #fff3cd; font-size: var(--text-dense); line-height: 1.4; }
.unassigned-note .lucide { width: 11px; min-width: 11px; height: 11px; margin-top: 1px; }
.unassigned-clear { display: grid; min-height: 170px; place-content: center; place-items: center; gap: 4px; padding: 20px; color: var(--brand); text-align: center; }
.unassigned-clear .lucide { width: 28px; height: 28px; margin-bottom: 4px; }
.unassigned-clear strong { color: var(--ink); font-size: var(--text-dense); }
.unassigned-clear span { color: var(--muted); font-size: var(--text-dense); }
.empty { padding: 10px 12px; color: var(--muted); }

.day-route-dialog { inset: 0 0 0 auto; width: min(540px, calc(100vw - 24px)); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: var(--ink); background: #fff; box-shadow: -24px 0 70px rgb(20 38 25 / .2); }
.day-route-dialog::backdrop { background: rgb(20 34 24 / .28); backdrop-filter: blur(2px); }
.day-route-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.day-route-dialog-head { display: flex; min-height: 80px; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 12px; }
.day-route-dialog-head h2 { margin: 0; font-size: var(--text-heading); }
.day-route-dialog-head p { margin: 4px 0 0; color: var(--muted); font-size: var(--text-small); }
.day-route-close { flex: 0 0 40px; width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: #f3f6f3; box-shadow: none; }
.day-route-nav { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 8px; padding: 4px 24px 16px; border-bottom: 1px solid var(--line); }
.day-route-nav > button { min-width: 0; min-height: var(--control-height); padding: 0; border-color: var(--line); box-shadow: none; }
.day-route-nav > button:disabled { opacity: .35; }
.day-route-nav > label { min-width: 0; }
.day-route-nav select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 30px 8px 12px; border-color: #c8d9cc; color: var(--brand-dark); background-color: #f3f8f3; font-size: var(--text-label); font-weight: var(--weight-strong); text-overflow: ellipsis; }
.day-route-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 24px 24px; scrollbar-gutter: stable; }
.day-route-person { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; margin-bottom: 14px; color: #626f66; font-size: var(--text-small); }
.day-route-person > span { display: inline-flex; align-items: center; gap: 5px; }
.day-route-person .lucide { width: 13px; height: 13px; }
.day-route-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; padding: 16px 0; border: 1px solid #e0e8e1; border-radius: 12px; background: #f7faf7; }
.day-route-summary > span { display: flex; flex-direction: column; gap: 5px; padding: 0 16px; border-right: 1px solid #dde6df; }
.day-route-summary > span:last-child { border-right: 0; }
.day-route-summary small { color: #647167; font-size: var(--text-dense); font-weight: var(--weight-medium); }
.day-route-summary strong { color: #254731; font-size: var(--text-title); line-height: 1.1; font-variant-numeric: tabular-nums; }
.day-route-summary em { margin-left: 4px; color: #647167; font-size: var(--text-small); font-style: normal; font-weight: var(--weight-regular); }
.day-route-summary .day-route-unknown { color: #8a5a0e; font-size: var(--text-dense); }
.day-route-itinerary-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.day-route-itinerary-head h3 { margin: 0; font-size: var(--text-body); }
.day-route-itinerary-head > span { color: #4b6052; font-size: var(--text-small); font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }
.day-route-stops { --route-time-width: 54px; --route-index-width: 22px; --route-step-gap: 10px; display: grid; margin: 0; padding: 0; list-style: none; }
.day-route-stop { position: relative; display: grid; grid-template-columns: var(--route-time-width) var(--route-index-width) minmax(0, 1fr); align-items: start; column-gap: var(--route-step-gap); }
.day-route-time { display: grid; gap: 5px; padding-top: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.day-route-time strong { font-size: var(--text-label); line-height: 1.2; }
.day-route-time > span { color: var(--muted); font-size: var(--text-small); }
.day-route-index { z-index: 1; display: grid; width: var(--route-index-width); height: var(--route-index-width); margin-top: 14px; place-items: center; border: 1px solid #bcd0c0; border-radius: 50%; color: #386545; background: #eaf3eb; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.day-route-stop-card { display: block; min-width: 0; width: 100%; min-height: 80px; padding: 13px 14px; border: 1px solid #dce6de; border-radius: 10px; color: var(--ink); background: #fff; box-shadow: 0 2px 4px rgb(36 58 41 / .025); text-align: left; white-space: normal; }
button.day-route-stop-card:hover { border-color: #9ebca6; color: var(--ink); background: #f6faf6; box-shadow: 0 3px 10px rgb(36 58 41 / .06); transform: none; }
.day-route-stop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-route-stop-name { min-width: 0; font-size: var(--text-label); line-height: 1.4; font-weight: var(--weight-strong); overflow-wrap: anywhere; }
.day-route-stop-head > .lucide { flex: 0 0 14px; width: 14px; height: 14px; color: #92a097; }
.day-route-stop-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; margin-top: 8px; color: #647167; font-size: var(--text-dense); font-weight: var(--weight-regular); }
.day-route-state { margin-left: auto; padding: 2px 6px; border-radius: 4px; color: #6c756f; background: #f0f3f0; font-size: var(--text-dense); font-weight: var(--weight-medium); white-space: nowrap; }
.day-route-state.confirmed { color: var(--brand-dark); background: var(--brand-soft); }
.day-route-locked, .day-route-record { display: inline-flex; align-items: center; gap: 4px; }
.day-route-locked .lucide, .day-route-record .lucide { width: 12px; height: 12px; }
.day-route-record { margin-top: 8px; color: #506d82; font-size: var(--text-dense); font-weight: var(--weight-regular); }
.day-route-alert { display: flex; align-items: flex-start; gap: 5px; margin-top: 9px; color: #9b5e09; font-size: var(--text-dense); line-height: 1.5; font-weight: var(--weight-medium); }
.day-route-alert .lucide { flex: 0 0 13px; width: 13px; height: 13px; margin-top: 2px; }
.day-route-stop.conflict .day-route-stop-card { border-color: #e1aba6; background: #fff7f5; }
.day-route-stop.conflict .day-route-alert { color: #a23e37; }
.day-route-stop.travel-risk .day-route-stop-card { border-color: #dbc18b; background: #fffbf3; }
.day-route-stop.is-highlighted .day-route-stop-card { outline: 2px solid #6e9ba9; outline-offset: 2px; }
.day-route-leg { display: grid; grid-template-columns: var(--route-index-width) minmax(0, 1fr); gap: var(--route-step-gap); margin-left: calc(var(--route-time-width) + var(--route-step-gap)); color: #4c6a78; }
.day-route-leg-line { position: relative; display: flex; align-items: center; justify-content: center; }
.day-route-leg-line::before { position: absolute; top: -44px; bottom: -16px; left: 50%; border-left: 1px solid #c9d8cd; content: ""; }
.day-route-leg-line > .lucide { z-index: 1; width: 14px; height: 14px; padding-block: 3px; box-sizing: content-box; color: #88a492; background: #fff; }
.day-route-leg > div { display: flex; flex-wrap: wrap; min-height: 52px; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 10px 12px; }
.day-route-travel { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-small); }
.day-route-travel .lucide { width: 14px; height: 14px; }
.day-route-travel strong { font-weight: var(--weight-strong); }
.day-route-remaining { color: #778179; font-size: var(--text-dense); font-variant-numeric: tabular-nums; }
.day-route-leg.risk .day-route-travel, .day-route-leg.risk .day-route-remaining { color: #9b5e09; font-weight: var(--weight-strong); }
.day-route-leg.unknown .day-route-travel { color: #80632c; }
.day-route-note { margin: 20px 0 0; color: #7a857e; font-size: var(--text-dense); line-height: 1.7; }
.day-route-record-note { display: flex; gap: 6px; align-items: center; margin: 10px 0 0; color: #7a857e; font-size: var(--text-dense); }
.day-route-record-note .lucide { flex: 0 0 13px; width: 13px; height: 13px; }
.day-route-footer { padding: 12px 24px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.day-route-footer a { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; border: 1px solid #c5d7c9; border-radius: 8px; color: var(--brand-dark); background: #f2f7f2; font-size: var(--text-small); font-weight: var(--weight-strong); text-decoration: none; }
.day-route-footer a:hover { background: #e7f1e8; }
.day-route-footer .lucide { width: 16px; height: 16px; }

@media (max-width: 420px) {
  .day-route-dialog-head { padding-inline: 16px; }
  .day-route-nav { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 6px; padding-inline: 16px; }
  .day-route-nav select { padding-left: 8px; font-size: var(--text-body); }
  .day-route-content { padding-inline: 14px; }
  .day-route-summary > span { padding-inline: 12px; }
  .day-route-summary strong { font-size: var(--text-title); }
  .day-route-stops { --route-time-width: 46px; --route-index-width: 20px; --route-step-gap: 7px; }
  .day-route-stop-card { padding: 12px 10px; }
  .day-route-stop-name { font-size: var(--text-body); }
  .day-route-stop-meta { gap: 5px 7px; }
  .day-route-leg > div { padding-inline: 7px; }
  .day-route-footer { padding-inline: 16px; }
}

/* Shared content */
.tag { display: inline-block; padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-subtle); font-size: var(--text-dense); line-height: 1.35; white-space: nowrap; }
.tag.blue { border-color: var(--blue-line); color: var(--blue); background: var(--blue-soft); }
.tag.red { border-color: #efc1be; color: var(--danger); background: var(--danger-soft); }
.tag.plain { background: #fff; }
.panel { margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; max-width: 600px; grid-template-columns: 120px 1fr; gap: 9px 12px; align-items: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); background: var(--surface-subtle); font-size: var(--text-small); font-weight: var(--weight-strong); white-space: nowrap; }

/* Shared headings */
.eyebrow, .panel-kicker { color: #758178; font-size: var(--text-dense); font-weight: var(--weight-strong); letter-spacing: .14em; }
.panel-title { display: flex; align-items: center; gap: 9px; }
.panel-title > .lucide { width: 19px; height: 19px; color: var(--brand); }

/* Read-only route map */
.route-view main { padding: 20px 22px 26px; }
.route-page { max-width: 1540px; margin: 0 auto; }
.route-page-head {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.route-page-head h1 { margin: 3px 0 2px; font-size: var(--text-display); }
.route-page-head p { margin: 0; color: var(--muted); font-size: var(--text-small); }
.route-head-actions { display: flex; align-items: center; gap: 10px; }
.route-mode-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #d4ded6;
  border-radius: 12px;
  background: rgb(255 255 255 / .78);
}
.route-mode-switch a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: var(--text-dense);
  font-weight: var(--weight-strong);
  text-decoration: none;
  white-space: nowrap;
}
.route-mode-switch a:hover { color: var(--brand-dark); background: #f2f6f2; }
.route-mode-switch a.active { color: #fff; background: var(--brand-dark); box-shadow: 0 5px 12px rgb(32 75 44 / .17); }
.route-mode-switch .lucide { width: 14px; height: 14px; }
.route-date-switch { display: flex; align-items: center; gap: 7px; }
.route-date-switch .route-date-current { min-width: 200px; border-color: #d4ded6; background: rgb(255 255 255 / .94); }
.route-date-switch button { min-width: 40px; background: rgb(255 255 255 / .94); }
.route-overview {
  display: grid;
  min-height: 660px;
  height: calc(100vh - var(--header-h) - 132px);
  max-height: 860px;
  grid-template-areas: "map sidebar";
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 14px;
}
.route-map-panel {
  position: relative;
  /* Keep Leaflet panes and map controls below the app navigation and dialogs. */
  isolation: isolate;
  grid-area: map;
  overflow: hidden;
  border: 1px solid #d4ded6;
  border-radius: 10px;
  background: #e9eee9;
  box-shadow: 0 24px 54px rgb(23 43 29 / .12);
}
#route-map { width: 100%; height: 100%; min-height: 520px; background: #e9eee9; }
.route-map-panel .leaflet-control-attribution { margin: 0 8px 8px 0 !important; padding: 2px 7px !important; border-radius: 6px; background: rgb(255 255 255 / .82) !important; font-size: var(--text-dense) !important; backdrop-filter: blur(8px); }
.route-map-panel .leaflet-control-zoom { overflow: hidden; margin: 0 18px 64px 0 !important; border: 1px solid rgb(35 67 44 / .14) !important; border-radius: 12px !important; box-shadow: 0 10px 24px rgb(27 50 33 / .14) !important; }
.route-map-panel .leaflet-control-zoom a { display: grid; width: 36px; height: 36px; place-items: center; border-color: var(--line-soft); color: var(--ink); font: 20px/1 system-ui; }
.route-map-topline {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgb(35 67 44 / .12);
  border-radius: 13px;
  color: #536159;
  background: rgb(255 255 255 / .9);
  box-shadow: 0 12px 28px rgb(27 50 33 / .12);
  font-size: var(--text-dense);
  font-weight: var(--weight-strong);
  backdrop-filter: blur(12px);
}
.route-map-topline > span { padding: 5px 8px; }
.route-quota-chip { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.route-quota-chip .lucide { width: 13px; height: 13px; }
.route-quota-chip.daily_exceeded, .route-quota-chip.minute_exceeded { color: var(--danger); background: var(--danger-soft); }
.route-readonly { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; color: var(--brand-dark); background: var(--brand-soft); }
.route-readonly .lucide { width: 14px; height: 14px; }
.route-map-reset {
  position: absolute;
  top: 17px;
  right: 17px;
  z-index: 500;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-color: rgb(35 67 44 / .12);
  border-radius: 12px;
  background: rgb(255 255 255 / .92);
  box-shadow: 0 12px 28px rgb(27 50 33 / .12);
  backdrop-filter: blur(12px);
}
.route-google-actions { position: absolute; top: 68px; right: 17px; z-index: 500; display: flex; overflow: hidden; border: 1px solid rgb(35 67 44 / .16); border-radius: 9px; background: #244f33; box-shadow: 0 10px 24px rgb(27 50 33 / .16); }
.route-google-actions[hidden] { display: none; }
.route-google-fallback { display: inline-flex; min-height: 38px; align-items: center; gap: 6px; padding: 8px 10px; color: #fff; background: #244f33; font-size: var(--text-dense); font-weight: var(--weight-strong); text-decoration: none; }
.route-google-fallback:hover { color: #fff; background: #173b24; }
.route-google-fallback small { padding-left: 6px; border-left: 1px solid rgb(255 255 255 / .24); color: rgb(255 255 255 / .78); font-size: var(--text-dense); }
.route-google-fallback .lucide { width: 14px; height: 14px; }
.route-google-qr { min-height: 38px; padding: 7px 10px; border: 0; border-left: 1px solid rgb(255 255 255 / .22); border-radius: 0; color: #fff; background: #244f33; box-shadow: none; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-google-qr:hover { border-left-color: rgb(255 255 255 / .22); color: #fff; background: #173b24; box-shadow: none; transform: none; }
.route-google-qr .lucide { width: 13px; height: 13px; }
.route-map-style {
  position: absolute;
  top: 17px;
  right: 68px;
  z-index: 500;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgb(35 67 44 / .12);
  border-radius: 9px;
  background: rgb(255 255 255 / .94);
}
.route-map-style button { min-height: 32px; padding: 5px 9px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; box-shadow: none; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-map-style button:hover { border: 0; color: var(--brand-dark); background: var(--brand-soft); box-shadow: none; }
.route-map-style button.active { color: #fff; background: var(--brand-dark); }
.route-source-switch { position: absolute; top: 68px; left: 16px; z-index: 500; display: flex; gap: 2px; padding: 3px; border: 1px solid rgb(35 67 44 / .12); border-radius: 9px; background: rgb(255 255 255 / .94); box-shadow: 0 10px 24px rgb(27 50 33 / .10); }
.route-source-switch button { min-height: 32px; padding: 5px 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; box-shadow: none; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-source-switch button:hover { border: 0; color: var(--brand-dark); background: var(--brand-soft); box-shadow: none; }
.route-source-switch button.active { color: #fff; background: var(--brand-dark); }
.route-map-people { position: absolute; top: 112px; left: 16px; z-index: 500; display: grid; width: 132px; overflow: hidden; border: 1px solid rgb(35 67 44 / .12); border-radius: 9px; background: rgb(255 255 255 / .94); box-shadow: 0 10px 24px rgb(27 50 33 / .10); backdrop-filter: blur(12px); }
.route-map-people button { display: grid; min-width: 0; min-height: 30px; grid-template-columns: 10px minmax(0, 1fr); align-items: center; gap: 7px; padding: 5px 9px; border: 0; border-bottom: 1px solid rgb(35 67 44 / .08); border-radius: 0; color: #445149; background: transparent; box-shadow: none; font-size: var(--text-dense); font-weight: var(--weight-strong); text-align: left; }
.route-map-people button:last-child { border-bottom: 0; }
.route-map-people button:hover { border-color: rgb(35 67 44 / .08); color: var(--ink); background: #f2f7f3; box-shadow: none; transform: none; }
.route-map-people button.active { color: var(--ink); background: color-mix(in srgb, var(--route-color, #46604e) 12%, white); box-shadow: inset 3px 0 var(--route-color, var(--brand-dark)); }
.route-map-people button > i { width: 8px; height: 8px; border: 2px solid rgb(255 255 255 / .95); border-radius: 50%; background: var(--route-color, #718078); box-shadow: 0 0 0 1px color-mix(in srgb, var(--route-color, #718078) 70%, #0000); }
.route-map-people button.all > i { background: linear-gradient(135deg, #2d6f46 0 33%, #d47635 33% 66%, #3d70b2 66%); }
.route-map-people button > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-map-foot {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 500;
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 12px;
  border: 1px solid rgb(35 67 44 / .10);
  border-radius: 12px;
  color: #5d6a61;
  background: rgb(255 255 255 / .9);
  box-shadow: 0 12px 28px rgb(27 50 33 / .10);
  font-size: var(--text-dense);
  backdrop-filter: blur(14px);
}
.route-map-foot > span, .route-map-foot a { display: inline-flex; align-items: center; gap: 6px; }
.route-map-foot .lucide { width: 14px; height: 14px; }
.route-map-foot a { color: var(--brand-dark); font-weight: var(--weight-strong); text-decoration: none; white-space: nowrap; }
.route-map-error { position: absolute; inset: 0; z-index: 450; display: grid; place-content: center; place-items: center; gap: 7px; padding: 30px; color: var(--muted); background: #edf1ed; text-align: center; }
.route-map-error .lucide { width: 36px; height: 36px; color: #839087; }
.route-map-error strong { color: var(--ink); font-size: var(--text-body); }
.route-map-error small { max-width: 300px; }
.route-sidebar {
  display: flex;
  min-height: 0;
  grid-area: sidebar;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(255 255 255 / .97);
  box-shadow: var(--shadow-sm);
}
.route-sidebar-head { display: flex; min-height: 74px; align-items: center; justify-content: space-between; padding: 15px 16px 12px; border-bottom: 1px solid var(--line-soft); }
.route-sidebar-head h2 { margin: 1px 0 0; font-size: var(--text-heading); }
.route-all { min-height: 32px; padding: 5px 10px; border-radius: 99px; color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-all.active { border-color: #bad2be; color: var(--brand-dark); background: var(--brand-soft); }
.route-summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line-soft); background: #fbfcfb; }
.route-summary-strip > span { display: grid; gap: 1px; padding: 12px 10px; border-right: 1px solid var(--line-soft); }
.route-summary-strip > span:last-child { border-right: 0; }
.route-summary-strip small { color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-medium); }
.route-summary-strip strong { font-size: var(--text-label); letter-spacing: -.02em; }
.route-summary-strip em { margin-left: 2px; color: var(--muted); font-size: var(--text-dense); font-style: normal; }
.route-summary-strip .has-alert small, .route-summary-strip .has-alert strong { color: var(--danger); }
.route-person-list { min-height: 0; flex: 1; overflow-y: auto; padding: 0; }
.route-person-entry { background: #fff; }
.route-person-card {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 14px 16px 14px 15px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 4px solid var(--route-color);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  text-align: left;
}
.route-person-entry:last-child .route-person-card { border-bottom: 0; }
.route-person-card:hover { border-left-color: var(--route-color); background: #f7faf7; box-shadow: none; transform: none; }
.route-person-card.active { background: color-mix(in srgb, var(--route-color) 7%, white); box-shadow: inset 3px 0 var(--route-color); }
.route-external-links { display: none; gap: 6px; padding: 9px 12px 11px 15px; border-bottom: 1px solid var(--line-soft); border-left: 4px solid var(--route-color); background: #fbfdfb; }
.route-person-card.active + .route-external-links { display: grid; }
.route-external-row { display: flex; align-items: stretch; gap: 5px; }
.route-external-links a { display: flex; min-height: 34px; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid #cddbd0; border-radius: 8px; color: var(--brand-dark); background: #fff; font-size: var(--text-dense); font-weight: var(--weight-strong); text-decoration: none; }
.route-external-row > a { min-width: 0; flex: 1; }
.route-external-links a:hover { border-color: #8eae95; background: var(--brand-soft); }
.route-external-links a small { margin-left: auto; color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-medium); }
.route-external-links .lucide { width: 13px; height: 13px; }
.route-external-links p { margin: 0; color: var(--muted); font-size: var(--text-dense); line-height: 1.45; }
.route-qr-button { min-width: 48px; min-height: 34px; padding: 6px 8px; border: 1px solid #cddbd0; border-radius: 8px; color: var(--brand-dark); background: #fff; box-shadow: none; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-qr-button:hover { border-color: #8eae95; background: var(--brand-soft); box-shadow: none; transform: none; }
.route-qr-button .lucide { width: 13px; height: 13px; }
.route-person-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.route-person-copy { display: grid; min-width: 0; }
.route-person-copy > strong { overflow: hidden; font-size: var(--text-small); text-overflow: ellipsis; white-space: nowrap; }
.route-person-copy small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--text-dense); }
.route-person-copy .lucide { width: 11px; height: 11px; }
.route-count { display: grid; justify-items: end; }
.route-count strong { color: var(--route-color); font-size: var(--text-label); line-height: 1; }
.route-count small { color: var(--muted); font-size: var(--text-dense); }
.route-person-meta { display: flex; align-items: center; gap: 12px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: var(--text-dense); }
.route-person-meta span { display: inline-flex; align-items: center; gap: 4px; }
.route-person-meta .lucide { width: 12px; height: 12px; color: var(--route-color); }
.route-time-solver { display: none !important; }
.route-page.solver-source .route-time-detail, .route-page.solver-source .route-time-compare, .route-page.solver-source .route-guidance, .route-page.solver-source .route-calc-status { display: none !important; }
.route-page.solver-source .route-time-solver { display: inline-flex !important; }
.route-time-compare { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: #346143; font-size: var(--text-dense); font-variant-numeric: tabular-nums; }
.route-time-compare .lucide { width: 12px; height: 12px; color: var(--route-color); }
.route-time-compare b { margin-left: auto; padding: 2px 6px; border-radius: 5px; color: #346143; background: #edf7ef; font-size: var(--text-dense); }
.route-time-compare.over, .route-time-compare.over b { color: #a35218; }
.route-time-compare.over b { background: #fff0df; }
.route-calc-status { display: inline-flex; width: fit-content; align-items: center; gap: 4px; margin-top: 8px; padding: 3px 7px; border-radius: 99px; color: #6c5a28; background: var(--warn-soft); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-calc-status .lucide { width: 11px; height: 11px; }
.route-calc-status.ready { color: var(--brand-dark); background: var(--brand-soft); }
.route-calc-status.single { color: var(--muted); background: var(--surface-subtle); }
.route-calc-status.error { color: var(--danger); background: var(--danger-soft); }
.route-mini-stops { display: none; gap: 7px; margin-top: 10px; }
.route-person-card.active .route-mini-stops { display: grid; }
.route-mini-stop { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 7px; }
.route-mini-stop > b { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #fff; background: var(--route-color); font-size: var(--text-dense); }
.route-mini-stop > span { display: grid; min-width: 0; }
.route-mini-stop strong { font-size: var(--text-dense); }
.route-mini-stop small { overflow: hidden; color: var(--muted); font-size: var(--text-dense); text-overflow: ellipsis; white-space: nowrap; }
.route-guidance { display: none; gap: 0; margin-top: 12px; border-top: 1px solid var(--line); }
.route-person-card.active .route-guidance { display: grid; }
.route-guidance-title { display: inline-flex; align-items: center; gap: 5px; padding: 10px 0 7px; color: var(--ink); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-guidance-title .lucide { width: 13px; height: 13px; color: var(--route-color); }
.route-leg { display: grid; gap: 7px; padding: 9px 0 10px; border-top: 1px solid var(--line-soft); }
.route-leg-head { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 8px; }
.route-leg-head > b { color: var(--route-color); font-size: var(--text-dense); font-variant-numeric: tabular-nums; }
.route-leg-head > span { display: grid; min-width: 0; }
.route-leg-head strong { overflow: hidden; font-size: var(--text-dense); text-overflow: ellipsis; white-space: nowrap; }
.route-leg-head small { color: var(--muted); font-size: var(--text-dense); }
.route-steps { display: grid; gap: 6px; margin-left: 4px; padding-left: 13px; border-left: 1px solid #cbd8cd; }
.route-step { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 6px; }
.route-step-icon { display: grid; width: 17px; height: 17px; place-items: center; color: var(--route-color); background: var(--brand-soft); }
.route-step-icon .lucide { width: 11px; height: 11px; }
.route-step > span:last-child { display: grid; min-width: 0; }
.route-step strong { font-size: var(--text-dense); font-weight: var(--weight-strong); line-height: 1.35; }
.route-step small { overflow: hidden; color: var(--muted); font-size: var(--text-dense); text-overflow: ellipsis; white-space: nowrap; }
.route-leaflet-marker { border: 0; background: transparent; }
.route-map-pin { position: relative; display: grid; width: 34px; height: 34px; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--route-color); box-shadow: 0 2px 8px rgb(20 43 28 / .22); }
.route-map-pin b { color: #fff; font-size: var(--text-small); font-variant-numeric: tabular-nums; font-weight: var(--weight-strong); line-height: 1; }
.route-map-pin.unassigned { --route-color: var(--danger); }
.route-popup { display: grid; min-width: 176px; gap: 2px; padding: 2px; }
.route-popup > span { color: var(--route-color); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-popup > strong { color: var(--ink); font-size: var(--text-small); }
.route-popup > small { color: var(--muted); font-size: var(--text-dense); }
.route-popup > a { margin-top: 7px; color: var(--brand-dark); font-size: var(--text-dense); font-weight: var(--weight-strong); text-decoration: none; }
.route-popup.danger { --route-color: var(--danger); }
.route-map-panel .leaflet-popup-content-wrapper { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 38px rgb(23 43 29 / .18); }
.route-map-panel .leaflet-popup-content { margin: 11px 13px; }
.route-map-panel .leaflet-overlay-pane canvas { will-change: transform; }
.route-qr-modal { display: grid; justify-items: center; text-align: center; }
.route-qr-modal h2 { margin: 7px 0 2px; font-size: var(--text-title); }
.route-qr-modal > p { margin: 0 0 13px; color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.route-qr-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-dark); font-size: var(--text-dense); font-weight: var(--weight-strong); letter-spacing: .04em; }
.route-qr-kicker .lucide { width: 15px; height: 15px; }
.route-qr-image { display: grid; width: min(280px, 82vw); padding: 12px; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.route-qr-image img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.route-qr-modal > small { max-width: 350px; margin-top: 12px; color: var(--muted); font-size: var(--text-dense); line-height: 1.65; }
.route-qr-modal .actions { display: flex; width: 100%; justify-content: center; gap: 8px; }
.route-qr-modal .actions button { min-height: var(--control-height); }
.site-cluster-wrap { border: 0; background: transparent; }
.site-cluster { display: grid; width: 42px; height: 42px; place-items: center; border: 3px solid rgb(255 255 255 / .94); border-radius: 50%; color: #fff; background: var(--brand-dark); box-shadow: 0 7px 18px rgb(24 49 31 / .28); font-size: var(--text-small); font-weight: var(--weight-strong); }
.route-empty { display: grid; min-height: 200px; place-content: center; place-items: center; gap: 5px; padding: 20px; color: var(--muted); text-align: center; }
.route-empty .lucide { width: 30px; height: 30px; margin-bottom: 5px; color: #89948c; }
.route-empty strong { color: var(--ink); font-size: var(--text-small); }
.route-empty small { max-width: 210px; font-size: var(--text-dense); }

.site-visible-count { display: inline-flex; min-width: 48px; min-height: 32px; align-items: baseline; justify-content: center; gap: 2px; padding: 7px 10px; border-radius: 99px; color: var(--brand-dark); background: var(--brand-soft); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.site-visible-count strong { font-size: var(--text-body); }
.site-status-filter { display: block; padding: 0 12px 10px; border-bottom: 1px solid var(--line-soft); background: #fbfcfb; }
.site-status-filter select { width: 100%; min-height: 34px; padding-block: 5px; border-color: #dce5de; border-radius: 9px; background: #fff; font-size: var(--text-body); }
.site-index { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: #fff; background: var(--brand); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.site-index .lucide { width: 15px; height: 15px; }
.site-copy { display: grid; min-width: 0; gap: 2px; }
.site-copy > strong { overflow: hidden; color: var(--ink); font-size: var(--text-small); text-overflow: ellipsis; white-space: nowrap; }
.site-copy > small { overflow: hidden; color: var(--muted); font-size: var(--text-dense); text-overflow: ellipsis; white-space: nowrap; }
.site-meta { display: flex; align-items: center; gap: 7px; margin-top: 3px; color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.site-status { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-dark); }
.site-status::before { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); content: ""; }
.site-status.suspended { color: #98621e; }
.site-status.suspended::before { background: var(--warn); }
.site-status.ended { color: var(--muted); }
.site-status.ended::before { background: #88938c; }
.decision-summary { display: grid; gap: 5px; margin: 12px 0 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); }
.decision-summary.warning { border-color: #e4cc9d; color: #684c18; background: var(--warn-soft); }
.decision-summary strong { font-size: var(--text-body); }
.decision-summary span { font-size: var(--text-small); line-height: 1.55; }
.decision-details { display: grid; gap: 7px; margin: 0 0 15px; }
.decision-details > div { display: grid; grid-template-columns: 90px 1fr; gap: 10px; }
.decision-details dt { color: var(--muted); font-size: var(--text-small); }
.decision-details dd { margin: 0; }
.decision-comment { display: grid; gap: 6px; color: var(--ink); font-weight: var(--weight-medium); }

.pattern-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.pattern-page-head .page-heading { margin-bottom: 0; }
.pattern-page-actions { display: flex; gap: 10px; }
.pattern-page-actions button { min-height: var(--control-height); padding-inline: 15px; }
.pattern-workspace { height: min(860px, calc(100vh - var(--header-h) - 112px)); min-height: 620px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pattern-toolbar { display: grid; min-height: 70px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; border-bottom: 1px solid var(--line); }
.pattern-toolbar-main { display: grid; min-width: 0; grid-template-columns: minmax(185px, 1fr) auto auto auto; align-items: center; gap: 8px; padding: 13px; border-right: 1px solid var(--line); }
.pattern-search { position: relative; display: block; min-width: 0; }
.pattern-search > .lucide { position: absolute; top: 50%; left: 12px; z-index: 1; width: 16px; height: 16px; color: #849088; transform: translateY(-50%); pointer-events: none; }
.pattern-search input { width: 100%; min-height: var(--control-height); padding-left: 38px; border-color: #d9e1da; background: #fff; }
.pattern-select { display: flex; min-height: var(--control-height); align-items: center; gap: 5px; padding: 0 5px 0 11px; border: 1px solid #d9e1da; border-radius: var(--radius); color: var(--ink); background: #fff; font-size: var(--text-dense); font-weight: var(--weight-strong); white-space: nowrap; }
.pattern-select select { width: auto; min-height: 36px; padding: 4px 27px 4px 5px; border: 0; color: var(--muted); background: transparent; font-size: var(--text-body); }
.pattern-toolbar-status { display: flex; min-width: 0; align-items: center; justify-content: flex-end; }
.pattern-result-count { align-self: center; justify-self: end; padding: 0 22px; color: var(--muted); font-size: var(--text-dense); white-space: nowrap; }
.pattern-mobile-open { display: none; }
.pattern-split { display: grid; height: calc(100% - 70px); grid-template-columns: minmax(490px, 1fr) minmax(420px, 1fr); }
.pattern-master { display: grid; min-width: 0; min-height: 0; grid-template-rows: 38px minmax(0, 1fr); border-right: 1px solid var(--line); }
.pattern-master-head { display: grid; grid-template-columns: 62px 130px minmax(0, 1fr) 112px; align-items: center; gap: 10px; padding: 0 13px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fbfcfb; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.pattern-master-head span:last-child { text-align: right; }
.pattern-list { min-height: 0; overflow-y: auto; }
.pattern-list-row { display: grid; width: 100%; min-height: 64px; grid-template-columns: 62px 130px minmax(0, 1fr) 112px; align-items: center; gap: 10px; margin: 0; padding: 10px 13px; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: #fff; box-shadow: none; text-align: left; }
.pattern-list-row:hover { border-color: var(--line-soft); background: #fafcf9; box-shadow: none; transform: none; }
.pattern-list-row.active { background: #f1f8f1; box-shadow: inset 3px 0 var(--brand); }
.pattern-row-id { overflow: hidden; color: #536158; font-size: var(--text-dense); font-weight: var(--weight-strong); text-overflow: ellipsis; white-space: nowrap; }
.pattern-row-main { display: grid; min-width: 0; }
.pattern-row-title { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.pattern-row-title strong { overflow: hidden; font-size: var(--text-small); text-overflow: ellipsis; white-space: nowrap; }
.pattern-row-title small { color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); white-space: nowrap; }
.pattern-row-schedule { overflow: hidden; color: #536158; font-size: var(--text-dense); line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.pattern-row-meta { display: grid; justify-items: end; gap: 2px; }
.pattern-row-meta > strong { font-size: var(--text-dense); }
.pattern-row-meta > small { overflow: hidden; max-width: 120px; color: var(--muted); font-size: var(--text-dense); text-overflow: ellipsis; white-space: nowrap; }
.pattern-state { color: var(--brand-dark); font-size: var(--text-dense); font-style: normal; font-weight: var(--weight-strong); }
.pattern-state.paused, .pattern-state.scheduled { color: var(--warn); }
.pattern-state.ended { color: var(--muted); }
.pattern-empty { display: grid; min-height: 180px; place-items: center; color: var(--muted); font-size: var(--text-small); }
.pattern-inspector { min-width: 0; min-height: 0; overflow-y: auto; background: #fff; }
.pattern-mobile-detail-bar, .pattern-mobile-actions { display: none; }
.pattern-inspector-head { position: sticky; top: 0; z-index: 2; display: flex; min-height: 102px; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / .97); }
.pattern-inspector-head > div:first-child { display: grid; gap: 4px; }
.pattern-inspector-head > div:first-child > span { color: var(--brand); font-size: var(--text-body); font-weight: var(--weight-strong); }
.pattern-inspector-head h2 { display: flex; align-items: baseline; gap: 12px; margin: 0; font-size: var(--text-heading); }
.pattern-inspector-head h2[tabindex="-1"]:focus { outline: none; }
.pattern-inspector-head h2 small { color: var(--ink); font-size: var(--text-small); font-weight: var(--weight-strong); }
.pattern-inspector-actions { display: flex; align-items: center; gap: 9px; }
.pattern-inspector-actions > button:first-child { min-width: 92px; border-color: var(--brand); color: #fff; background: var(--brand); font-weight: var(--weight-strong); }
.pattern-inspector-actions > button:first-child:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.pattern-more-wrap { position: relative; }
#pattern-more { width: 42px; padding: 0; }
.pattern-detail-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; width: 184px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 18px 42px rgb(24 45 30 / .14); }
.pattern-detail-menu button { width: 100%; justify-content: flex-start; border: 0; background: transparent; box-shadow: none; font-size: var(--text-body); }
.pattern-detail-menu button:hover { border: 0; background: var(--surface-subtle); box-shadow: none; }
.pattern-inspector-body { padding: 0 24px 24px; }
.pattern-inspector-body > section { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.pattern-inspector-body h3 { margin: 0 0 8px; color: #536158; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.pattern-detail-heading-icon { display: none; }
.pattern-detail-value { margin: 0; font-size: var(--text-small); }
.pattern-detail-days { display: grid; gap: 8px; }
.pattern-detail-day { display: flex; align-items: center; gap: 10px; }
.pattern-detail-day > span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #b9d3bd; border-radius: 5px; color: var(--brand-dark); background: var(--brand-soft); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.pattern-detail-day > .weekday-2 { border-color: #b9cdea; color: #2f609e; background: #eff5fd; }
.pattern-detail-day > .weekday-4 { border-color: #dfca92; color: #8a6115; background: #fff7e7; }
.pattern-detail-day strong { font-size: var(--text-small); }
.pattern-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pattern-inspector-empty { display: grid; min-height: 320px; place-content: center; place-items: center; gap: 7px; color: var(--muted); text-align: center; }
.pattern-inspector-empty .lucide { width: 28px; height: 28px; }
.pattern-inspector-empty strong { color: var(--ink); font-size: var(--text-small); }
.pattern-inspector-empty span { font-size: var(--text-dense); }
.pattern-subpage-head { margin-bottom: 14px; }
.pattern-subpage-head > div { display: flex; align-items: center; gap: 14px; }
.pattern-subpage-head h2 { margin: 0; }
.pattern-edit-modal { width: min(760px, 100%); }
.pattern-edit-title { display: flex; align-items: baseline; gap: 10px; }
.pattern-edit-title > span { color: var(--brand); font-size: var(--text-small); font-weight: var(--weight-strong); }
.pattern-edit-title h2 { margin: 0; }
.pattern-edit-days { display: grid; gap: 6px; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.pattern-edit-days legend { padding: 0 6px; color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.pattern-edit-day { display: grid; grid-template-columns: 22px 24px minmax(110px, 1fr) auto minmax(110px, 1fr); align-items: center; gap: 7px; color: var(--ink); }
.pattern-edit-day input[type="time"] { width: 100%; }
.pattern-edit-fields input[type="number"] { width: 88px; }
.pattern-edit-note { padding: 12px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); }
.pattern-check { color: var(--ink); }

/* Month */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.calendar .head { padding: 5px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); text-align: center; font-size: var(--text-dense); }
.calendar .cell { display: block; width: 100%; min-height: 86px; padding: 6px 8px; border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; text-align: left; }
.calendar .cell:hover { background: var(--surface-subtle); }
.calendar .cell.blank { background: var(--surface-subtle); cursor: default; }
.calendar .d { font-weight: var(--weight-strong); }
.calendar .sun, .calendar .holiday { color: var(--danger); }
.calendar .sat { color: var(--blue); }
.calendar .holiday { display: block; font-size: var(--text-dense); }
.calendar .stat { margin-top: 4px; font-size: var(--text-dense); }
.calendar .warn { color: var(--danger); }
.calendar .ok { color: var(--brand); }

.transfer-page { max-width: 900px; margin: 0 auto; }
.transfer-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.transfer-head h1 { margin: 0 0 7px; font-size: clamp(26px, 2.4vw, 32px); letter-spacing: -.04em; }
.transfer-state { display: inline-flex; align-items: baseline; gap: 7px; color: var(--brand-dark); font-size: var(--text-dense); }
.transfer-state::before { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); content: ""; }
.transfer-state small { color: var(--muted); font-size: var(--text-dense); }
.transfer-state.verification, .transfer-state.dryrun { color: #8a6115; }
.transfer-state.verification::before, .transfer-state.dryrun::before { background: var(--warn); }
.transfer-state.invalid { color: var(--danger); }
.transfer-state.invalid::before { background: var(--danger); }
.transfer-counts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.transfer-errors { margin-top: 18px; }
.transfer-errors h2 { margin: 0 0 9px; font-size: var(--text-body); }
.transfer-empty { display: grid; gap: 3px; padding: 20px 0; border-top: 1px solid var(--line); }
.transfer-empty strong { font-size: var(--text-small); }
.transfer-empty small { color: var(--muted); font-size: var(--text-dense); }

/* Unified operations screens — 2026-08-28 */
.day-page, .month-page, .transfer-page { width: min(100%, 1120px); margin-inline: auto; }

.day-page { width: min(100%, 1480px); }
.day-page-head, .month-page-head { margin-bottom: 20px; }
.day-page-head > small, .month-page-head > small { display: block; margin-top: 5px; color: var(--brand-dark); font-size: var(--text-small); font-weight: var(--weight-strong); }
.day-page-head h1, .month-page-head h1 { margin: 3px 0 0; font-size: var(--text-title); }
.day-toolbar { margin-bottom: 18px; padding: 12px 0; border-block: 1px solid var(--line); }
.day-summary { padding: 0; border-radius: 0; background: transparent; }
.day-summary > span, .day-summary-trigger { padding: 8px 14px; }
.day-actions button { box-shadow: none; }
.day-timeline-toggle { display: none; }

@media (min-width: 901px) {
  .day-toolbar {
    position: sticky;
    top: var(--header-h);
    z-index: 9;
    background: rgb(251 252 251 / .96);
    backdrop-filter: blur(12px);
  }
}

.month-page { width: min(100%, 1080px); }
.month-toolbar { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.month-date-current { min-width: 170px; }
.calendar { border-radius: 10px; box-shadow: none; }
.calendar .cell { position: relative; }
.calendar .cell.selected { z-index: 1; background: #fbfdfb; box-shadow: inset 0 0 0 2px var(--brand); }
.calendar .cell.selected::after { position: absolute; right: 12px; bottom: 8px; left: 12px; height: 3px; background: var(--brand); content: ""; }
.month-day-summary { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(260px, 1fr) auto; align-items: center; gap: 24px; margin-top: 22px; padding: 18px 2px; border-block: 1px solid var(--line); }
.month-day-summary h2 { margin: 0; font-size: var(--text-heading); }
.month-day-counts { display: grid; grid-template-columns: 1fr 1fr; }
.month-day-counts > span { display: grid; grid-template-columns: 24px auto auto 1fr; align-items: baseline; gap: 5px; padding: 5px 18px; border-left: 1px solid var(--line); }
.month-day-counts .lucide { align-self: center; width: 18px; height: 18px; color: var(--brand); }
.month-day-counts small { color: var(--muted); }
.month-day-counts strong { color: var(--brand-dark); font-size: var(--text-title); }
.month-day-counts em { color: var(--muted); font-size: var(--text-dense); font-style: normal; }
.month-day-summary > a, .transfer-help { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; color: var(--brand-dark); font-weight: var(--weight-strong); text-decoration: none; }
.month-day-summary > a .lucide:last-child, .transfer-help .lucide:last-child { color: #87928b; }
.month-note { margin: 12px 2px 0; color: var(--muted); font-size: var(--text-dense); }

.transfer-page { width: min(100%, 820px); }
.transfer-head { align-items: center; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.transfer-head .eyebrow { display: block; margin-bottom: 5px; }
.transfer-state { margin-top: 4px; font-size: var(--text-small); }
.transfer-state small { font-size: var(--text-dense); }
.transfer-steps { border-top: 1px solid var(--line); }
.transfer-steps > a, .transfer-steps > div { display: grid; min-height: 96px; grid-template-columns: 46px minmax(0, 1fr) auto 18px; align-items: center; gap: 15px; padding: 15px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.transfer-steps > div { grid-template-columns: 46px minmax(0, 1fr) auto; }
.transfer-steps > a:hover { background: #fbfdfb; }
.transfer-steps > a > span:nth-child(2), .transfer-steps > div > span:nth-child(2) { display: grid; gap: 2px; }
.transfer-steps small { font-size: var(--text-body); font-weight: var(--weight-strong); }
.transfer-steps strong { color: var(--brand-dark); font-size: var(--text-small); }
.transfer-steps em { padding: 4px 8px; border-radius: 6px; color: var(--muted); background: var(--surface-subtle); font-size: var(--text-dense); font-style: normal; font-weight: var(--weight-strong); white-space: nowrap; }
.transfer-step-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #707b74; background: var(--surface-subtle); }
.transfer-step-icon.complete { color: var(--brand-dark); background: var(--brand-soft); }
.transfer-step-icon.dryrun, .transfer-step-icon.verification { color: #9b5b06; background: var(--warn-soft); }
.transfer-step-icon.invalid { color: var(--danger); background: var(--danger-soft); }
.transfer-empty { min-height: 210px; place-content: center; place-items: center; border-top: 0; text-align: center; }
.transfer-empty .lucide { width: 38px; height: 38px; margin-bottom: 7px; color: #7b8780; }
.transfer-empty strong { font-size: var(--text-heading); }
.transfer-empty small { font-size: var(--text-dense); }
.transfer-help { width: 100%; justify-content: flex-start; margin-top: 12px; padding: 15px 4px; border-block: 1px solid var(--line); }
.transfer-help span { flex: 1; }

.site-tools { display: grid; grid-template-columns: minmax(0, 1fr); background: #fbfcfb; }
.site-status-filter { padding-top: 0; }
.site-index { border-radius: 50%; color: var(--brand-dark); background: var(--brand-soft); }
.site-index .lucide { width: 16px; height: 16px; }
.site-visible-count { border-radius: 7px; }

/* Live master data and workload */
.masters-page { width: min(100%, 1280px); }
.masters-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.masters-head .eyebrow { color: var(--brand); font-size: var(--text-dense); font-weight: var(--weight-strong); letter-spacing: .13em; }
.masters-head h1 { margin-top: 4px; }
.masters-head p { margin: 0; color: var(--muted); font-size: var(--text-small); }
.master-month { display: grid; gap: 4px; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.master-month input { width: 150px; }








.master-tabs { display: flex; gap: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.master-tabs button { min-height: 44px; padding-inline: 20px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); font-weight: var(--weight-medium); }
.master-tabs button:hover { border-color: transparent; background: var(--surface-subtle); box-shadow: none; }
.master-tabs button.active { border-bottom-color: var(--brand); color: var(--brand-dark); }
.master-panel { min-width: 0; }
.master-panel-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.master-panel-head h2 { margin: 0 0 2px; }
.master-panel-head p { margin: 0; color: var(--muted); font-size: var(--text-dense); }
.master-panel-actions { display: flex; align-items: center; gap: 8px; }
.master-panel-actions > label { position: relative; }
.master-panel-actions > label .lucide { position: absolute; top: 11px; left: 10px; width: 15px; height: 15px; color: var(--muted); }
.master-panel-actions input { width: min(260px, 32vw); padding-left: 33px; }
.master-panel-actions > a { display: inline-flex; min-height: 38px; align-items: center; padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--brand-dark); text-decoration: none; }
.master-table { width: 100%; max-width: 100%; border-radius: 10px; box-shadow: none; }
.master-table table { width: 100%; border-collapse: collapse; }
.master-table th { padding: 9px 11px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fbfcfb; font-size: var(--text-dense); text-align: left; white-space: nowrap; }
.master-table td { padding: 10px 11px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.master-table tr:last-child td { border-bottom: 0; }
.master-table td > strong { display: block; }
.master-table td > small { display: block; color: var(--muted); font-size: var(--text-dense); }
.master-table td code { display: block; overflow: hidden; max-width: 430px; color: #344a3a; font-size: var(--text-dense); text-overflow: ellipsis; white-space: nowrap; }
.master-table.compact td { font-size: var(--text-dense); }
.master-row-action { min-height: 30px; padding: 4px 10px; color: var(--brand-dark); font-size: var(--text-dense); }
.master-row-actions { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.master-row-actions .master-row-action { padding-inline: 7px; }
.master-status { display: inline-flex; padding: 3px 7px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); font-size: var(--text-dense); font-weight: var(--weight-strong); white-space: nowrap; }
.master-status.on_leave, .master-status.suspended { color: var(--warn); background: var(--warn-soft); }
.master-status.retired, .master-status.ended { color: var(--muted); background: var(--surface-subtle); }
.master-workload-head, .master-workload-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 2fr) 70px 90px 70px; align-items: center; gap: 14px; }
.master-workload-head { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.master-workload { border-bottom: 1px solid var(--line); }
.master-workload-row { min-height: 62px; padding: 8px 12px; border-top: 1px solid var(--line-soft); }
.master-workload-row:first-child { border-top: 0; }
.master-workload-row > span:first-child { display: grid; }
.master-workload-row > span:first-child small { color: var(--muted); font-size: var(--text-dense); }
.master-workload-row > div { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-subtle); }
.master-workload-row > div i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.master-workload-row > strong { font-size: var(--text-label); }
.master-workload-row > strong small, .master-workload-row > span small { margin-left: 3px; color: var(--muted); font-size: var(--text-dense); }
.master-stat-notes { display: flex; gap: 24px; padding: 15px 12px; color: var(--muted); font-size: var(--text-dense); }
.master-stat-notes span { display: inline-flex; align-items: center; gap: 7px; }
.master-stat-notes .lucide { width: 15px; height: 15px; }
.master-settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 22px; }
.master-settings-grid > * { min-width: 0; }
.solver-settings-card { margin-bottom: 28px; padding: 20px; border: 1px solid #cfe0d1; border-radius: 14px; background: linear-gradient(135deg, #fbfdfb, #f3f8f4); }
.solver-settings-card .master-panel-head { margin-bottom: 14px; }
.solver-settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.solver-settings-actions button { display: inline-flex; min-height: var(--control-height); align-items: center; gap: 6px; padding: 7px 10px; font-size: var(--text-body); }
.solver-settings-actions .lucide { width: 15px; height: 15px; }
.solver-policy-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; padding: 12px 14px; border: 1px solid #cce1cf; border-radius: 11px; background: #fff; }
.solver-policy-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #fff; background: var(--brand); }
.solver-policy-icon .lucide { width: 18px; height: 18px; }
.solver-policy-banner > span:last-child { display: grid; gap: 1px; }
.solver-policy-banner small { color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); letter-spacing: .06em; }
.solver-policy-banner strong { color: var(--brand-dark); font-size: var(--text-body); }
.solver-policy-banner em { color: var(--muted); font-size: var(--text-dense); font-style: normal; }
.solver-setting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.solver-setting-row > span { display: grid; min-width: 0; }
.solver-setting-row strong { font-size: var(--text-dense); }
.solver-setting-row small { color: var(--muted); font-size: var(--text-dense); line-height: 1.45; }
.solver-setting-row > strong { flex: 0 0 auto; color: var(--brand-dark); font-size: var(--text-small); }
.modal.solver-settings-modal { width: min(900px, 100%); }
.solver-settings-form { min-width: 0; gap: 16px; }
.solver-preset-picker h3 { margin: 0 0 8px; color: var(--brand-dark); font-size: var(--text-dense); }
.solver-preset-primary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.solver-preset { display: grid; min-width: 0; align-content: start; justify-content: stretch; justify-items: stretch; gap: 5px; min-height: 96px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; text-align: left; white-space: normal; background: #fff; box-shadow: none; }
.solver-preset strong { color: var(--brand-dark); font-size: var(--text-small); line-height: 1.5; }
.solver-preset small { color: var(--muted); font-size: var(--text-dense); line-height: 1.5; font-weight: var(--weight-regular); }
.solver-preset.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.solver-preset:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.solver-preset-extra { margin-top: 7px; }
.solver-preset-extra > summary { min-height: var(--control-height); padding: 10px 0; color: var(--brand-dark); font-size: var(--text-body); font-weight: var(--weight-medium); cursor: pointer; }
.solver-preset-extra > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.solver-preset-extra > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.solver-preset-extra .solver-preset { min-height: 80px; }
.solver-preset-selection { margin: 10px 0; padding: 9px 11px; border: 1px solid #cce1cf; border-radius: 8px; color: var(--brand-dark); background: var(--brand-soft); font-size: var(--text-dense); line-height: 1.6; overflow-wrap: anywhere; }
.solver-settings-fieldset { display: grid; gap: 7px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.solver-settings-fieldset legend { padding: 0 5px; color: var(--brand-dark); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.solver-settings-fieldset label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .8fr); align-items: center; gap: 16px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.solver-settings-fieldset label:first-child { border-top: 0; }
.solver-settings-fieldset label > span:first-child { display: grid; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.solver-settings-fieldset label small { color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-regular); }
.solver-settings-fieldset label > span:first-child em { margin-top: 2px; color: #6f836f; font-size: var(--text-dense); font-style: normal; font-weight: var(--weight-regular); }
.solver-change-summary { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #cce1cf; border-radius: 9px; color: var(--brand-dark); background: var(--brand-soft); }
.solver-change-summary .lucide { width: 17px; height: 17px; }
.solver-change-summary span { display: grid; font-size: var(--text-dense); }
.solver-change-summary strong { font-size: var(--text-dense); }
.master-warning-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.master-warning-list li, .master-clear, .master-source-note { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid #ead7ae; border-radius: 9px; color: #744d12; background: var(--warn-soft); font-size: var(--text-dense); }
.master-warning-list .lucide, .master-clear .lucide, .master-source-note .lucide { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.master-clear { border-color: #cce1cf; color: var(--brand-dark); background: var(--brand-soft); }
.master-source-note { margin-top: 10px; border-color: var(--line); color: var(--muted); background: var(--surface-subtle); }
.master-form { display: grid; gap: 11px; }
.master-form > label, .master-form-pair > label { display: grid; gap: 4px; font-size: var(--text-small); font-weight: var(--weight-strong); }
.master-form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.master-form textarea { resize: vertical; }
.staff-bound-help { padding: 10px 12px; border-radius: 9px; background: var(--surface-alt, #f3f6f4); font-size: var(--text-dense); line-height: 1.6; }
.staff-bound-help p { margin: 0 0 4px; color: var(--muted); }
.staff-bound-help strong { display: block; font-weight: var(--weight-medium); }
.master-form .master-check { display: flex; min-height: 38px; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.master-form .master-check input { min-height: auto; }
.client-affinity-editor { display: grid; gap: 10px; margin: 4px 0; padding: 12px; border: 1px solid var(--line); background: var(--surface-subtle); }
.client-affinity-editor legend { padding: 0 6px; font-weight: var(--weight-strong); }
.client-affinity-editor > p { margin: 0; color: var(--muted); font-size: var(--text-small); line-height: 1.55; }
#master-client-affinities { display: grid; gap: 8px; }
.client-affinity-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr .7fr .9fr auto; gap: 7px; align-items: end; padding: 9px; border: 1px solid var(--line); background: #fff; }
.client-affinity-row label { display: grid; gap: 3px; min-width: 0; font-size: var(--text-dense); font-weight: var(--weight-strong); }
.client-affinity-row select, .client-affinity-row input { width: 100%; min-width: 0; }
.client-affinity-row > button { min-width: 38px; padding: 8px; color: var(--danger); }
.input-suffix { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; }
.input-suffix em { color: var(--muted); font-style: normal; font-size: var(--text-dense); }

/* Login, modal, feedback */
.login { width: min(400px, calc(100% - 32px)); margin: 12vh auto; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.login h1 { color: var(--brand-dark); }
.login p { margin-bottom: 16px; color: var(--muted); }
.login form { display: flex; gap: 8px; }
.login input { flex: 1; }
.login .login-fields { display: grid; gap: 12px; }
.login .login-fields label { display: grid; gap: 4px; }
.login .login-fields input { width: 100%; }
.login .error, .warnings { margin-top: 10px; color: var(--danger); }
#modal-layer { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding: 72px 16px 16px; background: rgb(31 42 35 / .38); }
body:has(#modal-layer:not([hidden])) { overflow: hidden; }
#modal-layer .modal { overscroll-behavior: contain; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 96px); overflow-y: auto; padding: 22px; border: 1px solid rgb(255 255 255 / .7); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.modal .actions { margin-top: 16px; }
.modal:has(.visit-detail-panel) { width: min(760px, 100%); }
.visit-detail-panel { display: grid; grid-template-columns: minmax(220px, .85fr) minmax(280px, 1.15fr); min-height: 190px; margin: 18px 0 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f7faf8; }
.visit-detail-loading, .visit-detail-empty { display: flex; grid-column: 1 / -1; min-height: 190px; align-items: center; justify-content: center; gap: 9px; padding: 24px; color: var(--muted); text-align: center; }
.visit-detail-loading .lucide { animation: visit-detail-spin 1s linear infinite; }
@keyframes visit-detail-spin { to { transform: rotate(360deg); } }
.visit-detail-map-wrap { position: relative; isolation: isolate; display: grid; min-height: 190px; grid-template-rows: 1fr auto; border-right: 1px solid var(--line); background: #e7eee9; }
.visit-detail-map { width: 100%; min-height: 160px; z-index: 0; }
.visit-detail-map-empty { display: grid; min-height: 160px; place-content: center; justify-items: center; gap: 7px; color: var(--muted); }
.visit-detail-map-empty .lucide { width: 28px; height: 28px; }
.visit-detail-map-wrap > small { padding: 5px 9px; color: var(--muted); background: #f4f7f5; font-size: var(--text-dense); }
.visit-detail-map-wrap .leaflet-control-attribution { font-size: var(--text-dense) !important; }
.visit-detail-copy { display: grid; align-content: start; gap: 13px; padding: 16px; }
.visit-detail-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; color: var(--brand-dark); }
.visit-detail-row .lucide { width: 18px; height: 18px; margin-top: 2px; }
.visit-detail-row > div { display: grid; gap: 2px; }
.visit-detail-row small { color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.visit-detail-row strong { color: var(--ink); font-size: var(--text-small); line-height: 1.45; }
.visit-detail-row span { color: var(--muted); font-size: var(--text-dense); }
.visit-detail-note { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 9px; color: #57471f; background: #fff8dc; font-size: var(--text-dense); line-height: 1.5; }
.visit-detail-note .lucide { width: 16px; height: 16px; }
.visit-detail-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.button-link { display: inline-flex; min-height: 35px; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font-size: var(--text-body); font-weight: var(--weight-medium); text-decoration: none; }
.button-link.primary { border-color: var(--brand); color: #fff; background: var(--brand); }
.button-link .lucide, .visit-detail-register .lucide { width: 14px; height: 14px; }
.visit-detail-register { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-dark); font-size: var(--text-dense); font-weight: var(--weight-strong); text-decoration: none; }
.visit-edit-heading { margin: 0 0 12px; font-size: var(--text-body); }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: grid; gap: 8px; }
.toast { max-width: 420px; display:flex; align-items:center; gap:12px; padding:12px 16px; border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:var(--radius); color:var(--ink); background:#fff; box-shadow:var(--shadow); line-height:1.6; overflow-wrap:anywhere; }
.toast button { flex:none; padding:0; min-width:32px; min-height:32px; background:transparent; color:var(--ink); border:0; font-size:22px; }
.notification-dialog { box-sizing:border-box; width:min(520px,calc(100vw - 32px)); max-height:calc(100dvh - 48px); overflow:auto; border:1px solid var(--line); border-radius:16px; padding:24px; color:var(--ink); background:#fff; box-shadow:0 20px 70px #0003; }
.notification-dialog::backdrop { background:rgb(0 0 0 / .28); }
.notification-content { line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.notification-content p { margin:0 0 20px; }
.notification-error { border-left:3px solid var(--danger); padding-left:12px; }
.notification-dialog > button { display:block; margin-left:auto; min-width:80px; }


@media (max-width: 900px) {
  :root { --staff-col: 152px; }
  #topbar { position: sticky; top: 0; display: grid; width: auto; height: auto; grid-template-columns: 1fr auto; padding: 0; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / .98); box-shadow: 0 8px 24px rgb(24 45 30 / .055); }
  .brand { grid-column: 1; grid-row: 1; min-height: 54px; padding: 10px 16px; border: 0; }
  #topbar > .spacer { display: none; }
  #nav { grid-column: 1 / -1; grid-row: 2; display: flex; width: 100%; overflow-x: auto; gap: 4px; padding: 7px 12px 9px; border-top: 1px solid var(--line-soft); white-space: nowrap; }
  #nav { scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  #nav a { min-height: 40px; flex: 0 0 auto; gap: 8px; padding: 8px 11px; border-bottom: 2px solid transparent; border-radius: 9px; }
  #nav a.active { border-bottom-color: transparent; }
  #nav a .lucide { width: 17px; height: 17px; }
  #nav a span[data-mobile-label] { font-size: 0; }
  #nav a span[data-mobile-label]::after { content: attr(data-mobile-label); font-size: var(--text-small); }
  .nav-more { flex: 0 0 auto; min-height: 40px; }
  .nav-more > summary { min-height: var(--control-height); gap: 8px; padding: 8px 11px; border-radius: 9px; }
  .nav-more > summary span[data-mobile-label] { font-size: 0; }
  .nav-more > summary span[data-mobile-label]::after { content: attr(data-mobile-label); font-size: var(--text-small); }
  .nav-more-menu { position: fixed; top: 104px; right: 12px; width: min(250px, calc(100vw - 24px)); }
  #userbox { grid-column: 2; grid-row: 1; display: flex; height: auto; padding: 0 14px; }
  #userbox #account-trigger { margin: 0; }
  main { min-height: 0; margin-top: 0; padding: 24px 22px 36px; }
  .pattern-view main { padding: 18px 16px 30px; }
  .day-toolbar { align-items: flex-start; }
  .board-scroll { max-height: 620px; }
  .day-actions { width: 100%; }
  .day-actions .primary { margin-left: auto; }
  .route-view main { padding: 18px 16px 30px; }
  .route-page-head { align-items: flex-start; }
  .route-head-actions { align-items: flex-end; flex-direction: column; }
  .route-overview { height: auto; min-height: 0; max-height: none; grid-template-areas: "map" "sidebar"; grid-template-columns: 1fr; }
  .route-map-panel { min-height: 560px; }
  .route-sidebar { max-height: 560px; }
  .pattern-workspace { height: auto; min-height: 0; overflow: visible; }
  .pattern-toolbar { grid-template-columns: 1fr; }
  .pattern-toolbar-main { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; border-right: 0; }
  .pattern-search { grid-column: 1 / -1; }
  .pattern-select { min-width: 0; }
  .pattern-select select { width: 100%; min-width: 0; flex: 1; }
  .pattern-toolbar-status { min-height: 54px; gap: 10px; justify-content: space-between; padding: 7px 10px; border-top: 1px solid var(--line-soft); }
  .pattern-result-count { justify-self: auto; padding: 0; border: 0; }
  .pattern-mobile-open { display: inline-flex; min-width: 0; min-height: 40px; align-items: center; gap: 6px; padding: 7px 9px 7px 12px; border-color: #cfe0d0; color: var(--brand-dark); background: var(--brand-soft); font-size: var(--text-dense); font-weight: var(--weight-strong); white-space: nowrap; }
  .pattern-mobile-open:hover { border-color: #bcd4be; background: #e8f4e8; }
  .pattern-mobile-open .lucide { width: 15px; height: 15px; }
  .pattern-split { display: block; height: auto; }
  .pattern-master { max-height: 470px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pattern-inspector { display: none; min-height: 0; overflow: visible; }
  .pattern-workspace.is-detail { border: 0; border-radius: 0; background: transparent; }
  .pattern-workspace.is-detail .pattern-toolbar,
  .pattern-workspace.is-detail .pattern-master { display: none; }
  .pattern-workspace.is-detail .pattern-inspector { display: block; }
  .pattern-mobile-detail-bar { display: grid; min-height: 58px; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
  .pattern-mobile-detail-bar button { justify-self: start; padding-left: 0; border-color: transparent; color: var(--brand); background: transparent; box-shadow: none; font-weight: var(--weight-medium); }
  .pattern-mobile-detail-bar button:hover { border-color: transparent; background: transparent; box-shadow: none; }
  .pattern-mobile-detail-bar strong { font-size: var(--text-label); }
  .pattern-mobile-detail-bar > span { min-width: 58px; }
  .pattern-workspace.is-detail .pattern-inspector-head { position: static; }
  .pattern-workspace.is-detail .pattern-inspector-head .pattern-inspector-actions { display: none; }
  .pattern-workspace.is-detail .pattern-inspector-head > div:first-child > span { display: none; }
  .pattern-workspace.is-detail .pattern-inspector-head h2 { font-size: var(--text-display); }
  .pattern-workspace.is-detail .pattern-inspector-head h2 small { padding: 3px 8px; border-radius: 6px; color: var(--brand-dark); background: var(--brand-soft); font-size: var(--text-dense); }
  .pattern-workspace.is-detail .pattern-inspector-head .pattern-state { width: fit-content; padding: 4px 9px; border-radius: 6px; color: #fff; background: var(--brand); }
  .pattern-workspace.is-detail .pattern-inspector-body > section:first-child { display: none; }
  .pattern-workspace.is-detail .pattern-inspector-body h3 { display: flex; align-items: center; gap: 8px; color: var(--brand-dark); font-size: var(--text-small); }
  .pattern-workspace.is-detail .pattern-detail-heading-icon { display: block; width: 18px; height: 18px; }
  .pattern-mobile-actions { position: fixed; right: 0; bottom: 0; left: 0; z-index: 9; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 255 255 / .98); }
  .pattern-mobile-actions > button, .pattern-mobile-actions > .pattern-more-wrap > button { width: 100%; min-height: 50px; }
  .pattern-mobile-actions > .pattern-more-wrap { min-width: 0; }
  .pattern-mobile-actions .pattern-detail-menu { top: auto; right: 0; bottom: calc(100% + 8px); }
  body.pattern-detail-mode .pattern-page-head { display: none; }
  body.pattern-detail-mode main { padding-bottom: 94px; }
}

@media (max-width: 620px) {
  body { font-size: var(--text-small); }
  #topbar { background: rgb(255 255 255 / .98); }
  .brand { display: flex; width: auto; min-height: 48px; padding: 8px 12px; border-bottom: 0; }
  .brand img { width: 29px; height: 29px; }
  .brand strong { font-size: var(--text-label); }
  .brand small { display: none; }
  #nav { width: auto; gap: 3px; padding: 6px 5px 8px; overscroll-behavior-x: contain; scroll-padding-inline: 8px; scroll-snap-type: x proximity; }
  #nav::after { content: none; }
  #nav a { min-width: 56px; min-height: 50px; flex: 1 0 56px; flex-direction: column; gap: 3px; justify-content: center; padding: 6px 4px 5px; border: 1px solid transparent; border-bottom-width: 2px; scroll-snap-align: start; font-size: var(--text-dense); line-height: 1.1; }
  #nav a .lucide { width: 18px; height: 18px; }
  #nav a span[data-mobile-label]::after { font-size: var(--text-dense); }
  #nav a.active { border-color: #cfe0d1; color: var(--brand-dark); background: var(--brand-soft); }
  .nav-more { min-width: 56px; min-height: 50px; flex: 1 0 56px; }
  .nav-more > summary { min-width: 56px; min-height: 50px; flex: 1; flex-direction: column; gap: 3px; justify-content: center; padding: 6px 4px 5px; border: 1px solid transparent; border-bottom-width: 2px; border-radius: 9px; font-size: var(--text-body); line-height: 1.1; }
  .nav-more > summary .lucide { width: 18px; height: 18px; }
  .nav-more > summary span[data-mobile-label]::after { font-size: var(--text-dense); }
  .nav-more > summary.active, .nav-more[open] > summary { border-color: #cfe0d1; color: var(--brand-dark); background: var(--brand-soft); }
  .nav-more-menu { top: 106px; right: 8px; width: min(260px, calc(100vw - 16px)); }
  #userbox { display: flex; padding-inline: 8px 10px; }
  #userbox #account-trigger { width: 44px; min-height: 44px; }
  #userbox .account-avatar { width: 34px; height: 34px; font-size: var(--text-small); }
  #account-drawer { width: min(390px, 100vw); }
  main { padding: 20px 12px 32px; }
  .pattern-view main { padding: 14px 10px 28px; }
  h1 { font-size: var(--text-title); }
  button, input, select, textarea { min-height: 44px; }
  .page-heading p { display: none; }
  .date-switch { display: grid; width: 100%; grid-template-columns: 46px minmax(0, 1fr) 46px; }
  .date-switch button { min-width: 0; padding-inline: 6px; }
  .date-switch button span { display: none; }
  .day-summary { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); }
  .day-summary > span, .day-summary-trigger { min-width: 0; justify-content: center; text-align: center; }
  .day-summary-trigger { white-space: normal; line-height: 1.35; }
  .day-summary-trigger strong, .day-summary-trigger .lucide { flex-shrink: 0; }
  .day-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .day-actions .primary { grid-column: 1 / -1; width: 100%; }
  .board-scroll, .board-legend { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .calendar .cell { min-height: 68px; padding: 4px; }
  .transfer-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .transfer-head button { width: 100%; }
  .pattern-page-head { align-items: stretch; flex-direction: column; gap: 12px; margin-bottom: 13px; }
  .pattern-page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pattern-page-actions button { width: 100%; }
  .pattern-workspace { border-radius: 10px; }
  .pattern-toolbar { min-height: 0; grid-template-columns: 1fr; }
  .pattern-toolbar-main { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
  .pattern-search { grid-column: 1 / -1; }
  .pattern-select { min-width: 0; }
  .pattern-select:nth-of-type(4) { grid-column: 1; }
  .pattern-toolbar-status { min-height: 54px; padding: 7px 10px; }
  .pattern-result-count { justify-self: auto; padding: 0; }
  .pattern-master { max-height: 420px; grid-template-rows: 36px minmax(0, 1fr); }
  .pattern-master-head, .pattern-list-row { grid-template-columns: 44px minmax(0, 1fr) 84px; gap: 7px; padding-inline: 9px; }
  .pattern-master-head span:nth-child(3), .pattern-row-schedule { display: none; }
  .pattern-list-row { min-height: 70px; }
  .pattern-row-title { gap: 6px; }
  .pattern-row-title strong { font-size: var(--text-small); }
  .pattern-row-meta > small { max-width: 84px; }
  .pattern-inspector { min-height: 0; }
  .pattern-inspector-head { min-height: 0; align-items: flex-start; flex-direction: column; gap: 13px; padding: 24px 15px 18px; }
  .pattern-inspector-head h2 { font-size: var(--text-display); }
  .pattern-inspector-actions { width: 100%; }
  .pattern-inspector-actions > button:first-child { flex: 1; }
  .pattern-inspector-body { padding: 0 15px 18px; }
  .pattern-inspector-body > section { padding: 15px 0; }
  .pattern-workspace.is-detail .pattern-inspector-body > section { padding: 19px 0; }
  .pattern-workspace.is-detail .pattern-detail-value { padding-left: 26px; font-size: var(--text-body); }
  .pattern-workspace.is-detail .pattern-detail-days { padding-left: 26px; }
  .pattern-detail-grid { grid-template-columns: 1fr; gap: 15px; }
  .pattern-detail-menu { right: 0; }
  .pattern-subpage-head > div { align-items: flex-start; flex-direction: column; }
  .pattern-subpage-head button { width: 100%; }
  .pattern-edit-modal { padding: 18px 14px; }
  .pattern-edit-day { grid-template-columns: 22px 22px 1fr 14px 1fr; gap: 5px; }
  .route-view main { padding: 14px 10px 28px; }
  .route-page-head { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr); gap: 13px; margin-bottom: 12px; }
  .route-page-head p { display: none; }
  .route-page-head h1 { font-size: var(--text-title); }
  .route-head-actions { width: 100%; align-items: stretch; }
  .route-mode-switch { width: 100%; }
  .route-mode-switch a { min-height: 40px; flex: 1; justify-content: center; }
  .route-date-switch { width: 100%; }
  .route-date-switch label { min-width: 0; flex: 1; }
  .route-date-switch .route-date-current { min-width: 0; }
  .route-date-switch button { min-width: 42px; padding-inline: 9px; }
  .route-map-panel { min-height: 480px; border-radius: 10px; }
  #route-map { min-height: 480px; }
  .route-map-topline { top: 10px; left: 10px; }
  .route-map-topline > span:last-child { display: none; }
  .route-map-reset { top: 10px; right: 10px; }
  .route-google-actions { top: 104px; right: 10px; }
  .route-source-switch { top: 58px; left: 10px; }
  .route-map-people { top: 104px; left: 10px; width: 114px; }
  .route-map-style { top: 10px; right: 60px; }
  .route-map-foot { right: 8px; bottom: 8px; left: 8px; padding: 8px 10px; }
  .route-map-foot { align-items: flex-end; flex-direction: column; gap: 4px; }
  .route-map-foot > span { display: flex; width: 100%; font-size: var(--text-dense); line-height: 1.35; }
  .route-map-foot a { margin-left: auto; }
  .route-map-panel .leaflet-control-zoom { margin: 0 10px 56px 0 !important; }
  .route-sidebar { max-height: 520px; border-radius: 10px; }
}

@media (max-width: 900px) {
  .month-page, .transfer-page { width: min(100%, 720px); }
  .month-day-summary { grid-template-columns: 1fr; gap: 12px; }
  .month-day-counts > span:first-child { border-left: 0; }
}

@media (max-width: 760px) {
  .day-page, .month-page, .transfer-page { width: 100%; }

  .day-page-head, .month-page-head { margin-bottom: 14px; }
  .day-page-head .eyebrow, .month-page-head .eyebrow { font-size: var(--text-dense); }
  .day-page-head > small, .month-page-head > small { margin-top: 3px; font-size: var(--text-dense); }
  .day-page-head h1, .month-page-head h1 { font-size: var(--text-title); }
  .day-toolbar { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; padding: 10px 0 12px; }
  .date-switch { order: 1; }
  .date-switch button { min-width: 52px; padding-inline: 8px; }
  .date-switch button span { }
  .day-date-current { min-width: 0; flex: 1; }
  .day-date-current strong { font-size: var(--text-body); }
  .day-summary { order: 2; }
  .day-summary > span, .day-summary-trigger { padding: 6px 4px; }
  .day-summary strong { font-size: var(--text-heading); }
  .day-actions { order: 3; display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 7px; }
  .day-actions > button, .day-actions > .day-tools-menu { width: 100%; min-width: 0; }
  .day-actions > button, .day-actions > .day-tools-menu > summary { width: 100%; min-width: 0; padding: 7px 6px; box-shadow: none; }
  .day-actions .primary { grid-column: auto; }
  .day-tools-menu > summary { }
  .day-tools-menu > summary small { display: none; }
  .day-tools-menu > div { position: fixed; top: 112px; right: 8px; left: 8px; width: auto; }
  .day-actions .lucide { width: 15px; height: 15px; }
  .day-planning-grid { display: block; }
  .board-scroll, .board-legend { display: none; }
  .day-timeline-toggle { display: flex; width: 100%; min-height: 52px; justify-content: center; margin: 10px 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--brand-dark); background: transparent; box-shadow: none; font-weight: var(--weight-strong); }
  .day-timeline-toggle:hover { border-color: var(--line); background: #fbfdfb; box-shadow: none; }
  .day-timeline-toolbar { display: none; }
  .day-timeline-toolbar button { min-height: 44px; }

  .day-route-dialog { width: 100vw; }
  .day-unassigned-dialog { width: 100vw; }

  .month-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; padding-bottom: 12px; }
  .month-toolbar .spacer { display: none; }
  .month-toolbar button { min-width: 48px; padding-inline: 8px; }
  .month-toolbar button span { font-size: var(--text-dense); }
  .month-date-current { min-width: 0; }
  .month-toolbar #expand-btn { grid-column: 1 / -1; width: 100%; }
  .calendar { border-radius: 8px; }
  .calendar .head { padding: 7px 2px; }
  .calendar .cell { min-width: 0; min-height: 78px; padding: 5px 2px 8px; }
  .calendar .holiday { overflow: hidden; font-size: var(--text-dense); text-overflow: ellipsis; white-space: nowrap; }
  .calendar .stat { display: grid; gap: 3px; min-width: 0; margin-top: 5px; font-size: var(--text-dense); line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
  .calendar .stat .warn, .calendar .stat .ok { display: block; }
  .calendar .stat .warn { padding: 2px 0; border-radius: 3px; background: var(--danger-soft); font-weight: var(--weight-strong); }
  .calendar .cell.selected::after { right: 6px; bottom: 5px; left: 6px; height: 2px; }
  .month-day-summary { gap: 12px; margin-top: 18px; padding: 15px 2px; }
  .month-day-summary h2 { font-size: var(--text-heading); }
  .month-day-counts > span { grid-template-columns: 21px auto auto 1fr; padding: 5px 12px; }
  .month-day-counts > span:first-child { border-left: 0; }
  .month-day-counts strong { font-size: var(--text-title); }
  .month-day-summary > a { width: 100%; padding: 6px 2px; border-top: 1px solid var(--line-soft); }
  .month-day-summary > a span { flex: 1; }
  .month-note { display: none; }

  .transfer-head { gap: 14px; margin-bottom: 18px; padding-bottom: 16px; }
  .transfer-head h1 { font-size: var(--text-display); }
  .transfer-state { align-items: center; font-size: var(--text-dense); }
  .transfer-steps > a, .transfer-steps > div { min-height: 88px; grid-template-columns: 40px minmax(0, 1fr) auto 16px; gap: 10px; padding: 13px 2px; }
  .transfer-steps > div { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .transfer-step-icon { width: 38px; height: 38px; border-radius: 10px; }
  .transfer-steps small { font-size: var(--text-body); }
  .transfer-steps strong { font-size: var(--text-dense); }
  .transfer-empty { min-height: 190px; }
  .site-sidebar-head { display: none; }
  .site-tools { grid-template-columns: minmax(0, 1fr) 128px; border-bottom: 1px solid var(--line); }
  .site-status-filter { padding: 9px 6px 9px 0; border-bottom: 0; }
  .site-status-filter select { min-height: 44px; font-size: var(--text-body); }
  .site-copy > strong { font-size: var(--text-small); }
  .site-copy > small { font-size: var(--text-dense); }
}

@media (max-width: 900px) {
  .masters-head { align-items: start; }


  .master-panel-head { align-items: start; flex-direction: column; }
  .master-panel-actions { width: 100%; }
  .master-panel-actions > label { flex: 1; }
  .master-panel-actions input { width: 100%; }
  .master-settings-grid { grid-template-columns: 1fr; }
  .master-workload-head, .master-workload-row { grid-template-columns: minmax(110px, 1fr) minmax(120px, 1.5fr) 58px 72px 58px; gap: 8px; }
}

@media (max-width: 620px) {
  .solver-preset-primary, .solver-preset-extra > div { grid-template-columns: 1fr; }
  .solver-preset, .solver-preset-extra .solver-preset { min-height: 0; padding: 10px 11px; }
  .solver-settings-card .master-panel-head { align-items: stretch; }
  .solver-settings-actions { width: 100%; justify-content: stretch; }
  .solver-settings-actions button { flex: 1; justify-content: center; }
  .solver-settings-actions .primary { flex-basis: 100%; }
  .solver-settings-fieldset label { grid-template-columns: 1fr; gap: 7px; }
  .masters-head { display: grid; gap: 13px; margin-bottom: 16px; }
  .masters-head h1 { font-size: var(--text-display); }
  .masters-head p { display: none; }
  .master-month { width: 100%; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .master-month input { width: 100%; }







  .master-tabs { overflow-x: auto; margin-inline: -16px; padding-inline: 16px; }
  .master-tabs button { flex: 0 0 auto; padding-inline: 14px; font-size: var(--text-body); }
  .master-panel-actions { align-items: stretch; flex-direction: column; }
  .master-panel-actions > a, .master-panel-actions > button { width: 100%; justify-content: center; }
  .master-table { width: calc(100% + 32px); max-width: calc(100% + 32px); margin-inline: -16px; border-right: 0; border-left: 0; border-radius: 0; }
  .master-table table { min-width: 720px; }
  .master-workload-head { display: none; }
  .master-workload-row { grid-template-columns: minmax(110px, 1.2fr) minmax(100px, 1fr) 52px; gap: 8px; padding-inline: 2px; }
  .master-workload-row > span:nth-child(4), .master-workload-row > span:nth-child(5) { display: none; }
  .master-stat-notes { overflow-x: auto; gap: 16px; padding-inline: 2px; white-space: nowrap; }
  .master-form-pair { grid-template-columns: 1fr; }
  .client-affinity-row { grid-template-columns: 1fr 1fr; }
  .client-affinity-row > button { justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.day-solver-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px 10px;
  padding: 9px 12px;
  border: 1px solid #cbdcf3;
  border-radius: 8px;
  color: #194b7a;
  background: #f2f7fd;
  font-size: var(--text-small);
}
.day-solver-status.warning { border-color: #efcf9a; color: #7a4a00; background: #fff8ea; }
.day-solver-status svg { width: 16px; height: 16px; flex: 0 0 auto; }
.day-solver-status span { color: inherit; opacity: .82; }
body.day-view #toasts { bottom: 94px; }
@keyframes day-regenerate-spin { to { transform: rotate(360deg); } }

/* Tablet-sized day boards still have enough room when secondary labels are compact. */
@media (min-width: 761px) and (max-width: 900px) {
  .day-toolbar { flex-wrap: wrap; align-items: center; gap: 10px; }
  .day-toolbar > .spacer { display: none; }
  .date-switch { flex: 0 0 auto; gap: 4px; }
  .date-switch > button { width: 38px; min-width: 38px; padding-inline: 6px; }
  .date-switch > button span { display: none; }
  .day-date-current { min-width: 168px; padding-inline: 9px; }
  .day-date-current strong { font-size: var(--text-body); }
  .day-summary { flex: 0 0 auto; gap: 0; }
  .day-summary > span, .day-summary-trigger { min-width: 0; padding: 5px 6px; font-size: var(--text-dense); }
  .day-summary strong { font-size: var(--text-body); }
  .day-actions { width: 100%; flex: 0 0 100%; gap: 8px; }
  .day-actions .primary { min-width: 76px; margin-left: 0; padding-inline: 9px; }
  .day-tools-menu > summary { }
  .day-tools-menu > summary small { display: none; }
}

@media (max-width: 760px) {
  body.day-view main { padding-bottom: 104px; }
  body.day-view #toasts { right: 12px; bottom: 88px; left: 12px; }
  .day-actions { grid-template-columns: 1fr 1fr; }
  .day-actions .primary { grid-column: auto; }
}

/* Read-only operational digital twin: explanation, resilience and hiring. */
.virtual-staff-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px; background: #f6f9f7; }
.virtual-staff-form label { position: relative; display: grid; gap: 5px; color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.virtual-staff-form label.wide { grid-column: span 3; }
.theoretical-capacity-assumptions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 2px 0; padding: 12px; border: 1px solid #d8e4dc; background: #fff; }
.theoretical-capacity-assumptions legend { padding: 0 7px; color: var(--ink); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.virtual-staff-form label > small { position: absolute; right: 9px; bottom: 10px; }
.virtual-staff-form input, .virtual-staff-form select { width: 100%; min-width: 0; background: #fff; }
.virtual-staff-form label:has(> small) input { padding-right: 32px; }
.virtual-staff-form > button { align-self: end; justify-content: center; }
.virtual-result { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; border: 1px solid var(--line); }
.virtual-result > div { padding: 13px; border-right: 1px solid var(--line); }
.virtual-result > div:last-child { border-right: 0; }
.virtual-result small { display: block; margin-bottom: 5px; color: var(--muted); }
.virtual-result strong { font-size: var(--text-label); }
.virtual-result.positive > div:last-child strong { color: var(--brand-dark); }
.virtual-result.negative > div:last-child strong { color: var(--danger); }
.virtual-result em { margin-left: 2px; font-size: var(--text-dense); font-style: normal; }
.virtual-result-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border: solid var(--line); border-width: 0 1px 1px; }
.virtual-result-detail > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.virtual-result-detail dt { color: var(--muted); font-size: var(--text-dense); }
.virtual-result-detail dd { margin: 0; overflow-wrap: anywhere; }
.virtual-visit-form label.wide { grid-column: span 2; }
.virtual-visit-form > button { grid-column: span 2; }
.virtual-visit-result { margin-top: 14px; border: 1px solid var(--line); background: var(--surface); }
.virtual-visit-result.positive { border-left: 4px solid var(--brand); }
.virtual-visit-result.negative { border-left: 4px solid var(--danger); }
.virtual-visit-verdict { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.virtual-visit-verdict svg { width: 22px; color: var(--brand); }
.virtual-visit-result.negative .virtual-visit-verdict svg { color: var(--danger); }
.virtual-visit-verdict span { display: grid; gap: 2px; }
.virtual-visit-verdict small { color: var(--muted); }
.virtual-visit-result dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.virtual-visit-result dl > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.virtual-visit-result dl > div:last-child { border-right: 0; }
.virtual-visit-result dt { margin-bottom: 4px; color: var(--muted); font-size: var(--text-dense); }
.virtual-visit-result dd { margin: 0; overflow-wrap: anywhere; font-weight: var(--weight-strong); }
.virtual-visit-result > p { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); }
.virtual-visit-diagnostics { padding: 12px 14px; border-top: 1px solid var(--line); background: #f8faf8; }
.virtual-visit-diagnostics > p { margin: 3px 0 8px; color: var(--muted); font-size: var(--text-dense); }
.virtual-visit-diagnostics > div { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.virtual-visit-diagnostics > div span { padding: 3px 6px; color: #695426; background: #fff3d6; font-size: var(--text-dense); }
.virtual-visit-diagnostics > small { color: var(--muted); }
.rank-summary { padding-bottom: 8px; }
.virtual-visit-ranking { min-width: 720px; }
.virtual-visit-ranking td:first-child { display: flex; align-items: center; gap: 8px; }
.virtual-visit-ranking td:first-child em { display: grid; width: 22px; height: 22px; place-items: center; color: var(--muted); background: #eef2ef; font-size: var(--text-dense); font-style: normal; }
.virtual-visit-ranking tr.placeable td:nth-child(2), .virtual-visit-ranking tr.placeable td:last-child { color: var(--brand-dark); font-weight: var(--weight-strong); }

@media (max-width: 720px) {
  .virtual-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .virtual-staff-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .virtual-staff-form label.wide { grid-column: 1 / -1; }
  .theoretical-capacity-assumptions { grid-template-columns: 1fr 1fr; }
  .virtual-staff-form > button { grid-column: 1 / -1; }
  .virtual-result-detail, .virtual-visit-result dl { grid-template-columns: 1fr; }
  .virtual-visit-form label.wide, .virtual-visit-form > button { grid-column: 1 / -1; }
  .virtual-visit-result dl > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .virtual-visit-result dl > div:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
  .visit-detail-panel { grid-template-columns: 1fr; }
  .visit-detail-map-wrap { min-height: 155px; border-right: 0; border-bottom: 1px solid var(--line); }
  .visit-detail-map, .visit-detail-map-empty { min-height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .visit-detail-loading .lucide { animation: none; }
}

/* 未配置から理由・候補・反映へ進む解決パネル */
.day-unassigned-dialog { width: min(680px, 100%); max-width: 100%; }
.day-unassigned-dialog[open] { grid-template-rows: auto minmax(0, 1fr) auto; }
.day-unassigned-dialog > header { padding: 22px 24px; }
.resolution-body { overflow-y: auto; min-height: 0; padding: 0 24px 24px; }
.resolution-body .unassigned-list { padding: 0; overflow: visible; }
.resolution-case { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.resolution-case summary { display: flex; align-items: center; gap: 12px; padding: 20px 18px; cursor: pointer; flex-wrap: wrap; }
.resolution-index { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); flex-shrink: 0; }
.resolution-person { display: grid; gap: 5px; flex: 1; min-width: 185px; }
.resolution-person strong { font-size: var(--text-heading); }
.resolution-person small { font-size: var(--text-small); color: var(--muted); }
.needs-review { color: #965712; line-height: 1.65; }
.can-place { color: var(--brand-dark); }
.resolution-case summary > .needs-review { font-size: var(--text-small); font-weight: var(--weight-medium); }
.resolution-explanation { padding: 0 20px 18px; }
.resolution-explanation > button { width: 100%; margin-top: 10px; }
.resolution-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px 0; background: #faf9f6; border-radius: 8px; }
.resolution-facts > span { display: grid; gap: 7px; text-align: center; }
.resolution-facts > span + span { border-left: 1px solid var(--line); }
.resolution-facts small { color: var(--muted); font-size: var(--text-small); }
.resolution-facts strong { font-size: var(--text-heading); font-variant-numeric: tabular-nums; }
.resolution-count { display: flex; align-items: center; gap: 8px; padding: 13px 20px; margin: 0; border-top: 1px solid var(--line); font-size: var(--text-body); }
.resolution-count .lucide { width: 16px; }
.resolution-preview { width: min(680px, 100%); }
.placement-ack { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; padding: 14px; background: #fff8ea; line-height: 1.65; cursor: pointer; }
.placement-ack input { margin: 2px 0 0; width: 18px; height: 18px; min-height: 18px; flex-shrink: 0; }
.placement-ack[hidden] { display: none; }
.resolution-diff p { display: grid; gap: 5px; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.resolution-diff span { color: var(--muted); }
.resolution-diff b { color: var(--ink); }
.resolution-preview > .actions { position: sticky; bottom: -24px; padding: 16px 0; background: #fff; }
@media (max-width: 480px) {
  .resolution-body { padding: 0 14px 14px; }
  .day-unassigned-dialog > header { padding: 16px; }
  .resolution-case summary { padding: 16px 12px; }
  .resolution-case summary > .needs-review { margin-left: 40px; }
  .resolution-explanation { padding: 0 12px 14px; }
}
.record-placement { display: flex; gap: 10px; padding: 14px; background: var(--brand-soft); border-radius: 8px; font-size: var(--text-body); }
.record-placement .lucide { width: 20px; flex-shrink: 0; }
.record-time-block { position: absolute; height: 38px; z-index: 3; background: #deebdb; border: 1px dashed #507548; border-radius: 4px; }
.record-presets { display: flex; gap: 6px; margin-top: 8px; }
.record-presets button { padding: 5px 12px; }
.record-filter { display: flex; min-height: 44px; align-items: center; gap: 8px; margin: 14px 0; font-size: var(--text-body); }
.record-filter input { width: 18px; height: 18px; min-height: 18px; flex-shrink: 0; }
.record-settings-field { display: grid; gap: 8px; margin: 18px 0; }
.record-settings-field input { width: 100%; min-width: 0; }
.reserved-time-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:12px 0 18px; }
.reserved-time-toolbar button { min-height:44px; }
.reserved-time-block { position:absolute; top:0; bottom:0; background:repeating-linear-gradient(135deg,#f1f0ec,#f1f0ec 5px,#e5e4de 5px,#e5e4de 6px); border-inline:1px solid #d2d2c8; color:#565b51; pointer-events:none; }
.reserved-time-block.records-allowed { background:#e7f1e8; border-color:#b9cbbb; color:#305e3a; }
.reserved-time-block > span { display:block; padding:3px 5px; font-size:var(--text-dense); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.reserved-time-selection { position:absolute; inset-block:0; background:#d5e8d3bb; border:2px solid var(--brand); z-index:8; pointer-events:none; color:var(--ink); padding:5px; font-size:var(--text-small); white-space:nowrap; }
[data-reserve-track]:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.reserved-time-modal { width:min(680px,100%); }
.reserved-time-modal form > label, .reserved-time-modal #reserved-weekly label, .reserved-time-inputs label { display:grid; gap:7px; margin:15px 0; }
.reserved-time-modal select, .reserved-time-modal input[type="date"], .reserved-time-modal input[type="time"] { min-height:44px; width:100%; min-width:0; }
.reserved-time-modal fieldset { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; border:1px solid var(--line); padding:14px; max-height:200px; overflow:auto; }
.reserved-time-modal fieldset label { display:flex; align-items:center; gap:8px; min-height:36px; }
.reserved-time-modal input[type="checkbox"] { width:18px; height:18px; min-height:18px; flex-shrink:0; }
.reserved-time-inputs, #reserved-weekly { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.reserved-time-modal [hidden] { display:none !important; }
.reserved-time-modal .reserved-checkbox, .reserved-time-modal .placement-ack { display:flex; align-items:center; gap:10px; }
.reserved-conflict { padding:14px; margin:12px 0; border:1px solid #e5d7bd; border-radius:10px; background:#fffbf2; }
.reserved-conflict p, .reserved-list-row p { margin:6px 0; font-size:var(--text-body); }
.reserved-conflict button { min-height:44px; }
.reserved-list-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 0; border-bottom:1px solid var(--line); }
.reserved-list-row small { color:var(--muted); }
.reserved-time-modal .actions { position:sticky; bottom:-22px; z-index:5; background:var(--surface); border-top:1px solid var(--line); padding:14px 0; }
@media (max-width:480px) {
  .reserved-time-toolbar { align-items:stretch; }
  .reserved-time-toolbar > button:first-child { flex:1; }
  .reserved-time-modal fieldset { grid-template-columns:1fr; }
  .reserved-time-modal .actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; }
  .reserved-time-modal .actions > button { min-width:0; }
  .reserved-time-modal .actions > .primary:last-child:nth-child(odd) { grid-column:1 / -1; }
}
.resolution-preview > .actions { position: sticky; bottom: -22px; z-index: 2; padding: 14px 0; background: var(--surface); border-top: 1px solid var(--line); }

/* Keep the schedule first; supporting detail opens where it is needed. */
.day-context { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 16px; }
.day-context > details { flex: 0 1 auto; min-width: 0; }
.day-context > details[open] { flex: 1 0 100%; }
.day-context-body { padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: var(--text-small); line-height: 1.6; }
.day-context-body p { margin: 0 0 6px; }
.day-context-body p:last-child { margin: 0; }
.day-context-body ul { max-height: 220px; overflow-y: auto; margin: 12px 0 0; padding: 0; list-style: none; }
.day-context-body li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.day-context-body li span { color: var(--muted); }
.day-context > .needs-review { min-height: 44px; font-size: var(--text-small); }
@media (max-width: 760px) {
  .day-page > .day-toolbar { margin-bottom: 6px; padding-top: 0; border-top: 0; }
  .day-page .day-actions { grid-template-columns: 1fr 1fr; }
  .day-page .day-actions .primary { grid-column: auto; }
  .day-context { margin: 0 0 12px; gap: 2px 14px; }
}

/* 月次設定：表を残して一括編集と影響確認を行う */
.month-settings-page { max-width: 1800px; margin: 0 auto; padding: 0 4px 20px; }
.month-settings-head { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0 0 18px; }
.month-settings-head a { display:inline-flex; align-items:center; gap:5px; color:var(--muted); font-size:var(--text-small); text-decoration:none; }
.month-settings-head a .lucide { width:15px; height:15px; }
.month-settings-head h1 { margin:8px 0 4px; font-size:var(--text-title); }
.month-settings-head p { margin:0; color:var(--muted); font-size:var(--text-small); }
.month-settings-month { display:grid; gap:6px; color:var(--muted); font-size:var(--text-small); }
.month-settings-month input { min-height:var(--control-height); max-width:180px; }
.month-settings-layout { display:grid; grid-template-columns:minmax(0,1fr) 350px; gap:18px; align-items:start; }
.month-settings-board, .month-settings-editor { min-width:0; border:1px solid #dce6de; border-radius:13px; background:#fff; overflow:hidden; }
.month-settings-board { display:flex; flex-direction:column; height:calc(100dvh - 255px); min-height:420px; }
.month-settings-tools { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:13px 14px 8px; }
.month-settings-search { display:flex; align-items:center; gap:6px; flex:1; max-width:210px; }
.month-settings-search .lucide { width:16px; flex-shrink:0; color:var(--muted); }
.month-settings-search input { width:100%; min-width:60px; min-height:34px; font-size: var(--text-body); }
.month-settings-selection { flex:1; white-space:nowrap; color:var(--brand-dark); font-size:var(--text-dense); font-weight:var(--weight-strong); }
.month-settings-tools > button { min-height:30px; padding:5px 8px; font-size:var(--text-body); }
.month-settings-selectors { display:flex; align-items:center; flex-wrap:wrap; gap:5px; padding:4px 14px; }
.month-settings-selectors > span { margin-right:4px; font-size:var(--text-dense); color:var(--muted); }
.month-settings-selectors button { min-height:28px; min-width:29px; padding:4px 7px; font-size:var(--text-body); box-shadow:none; }
.month-settings-help { padding:5px 14px 10px; margin:0; font-size:var(--text-small); line-height:1.6; color:var(--muted); }
.month-settings-grid { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; border-block:1px solid #e1e9e2; }
.month-settings-grid table { border-collapse:separate; border-spacing:0; width:max-content; table-layout:fixed; }
.month-settings-grid th, .month-settings-grid td { width:63px; min-width:63px; padding:0; border-right:1px solid #e5ece7; border-bottom:1px solid #e5ece7; text-align:center; background:#fff; }
.month-settings-grid thead { position:sticky; top:0; z-index:4; }
.month-settings-grid thead th { background:#f4f8f4; }
.month-settings-grid th:first-child { position:sticky; left:0; width:145px; min-width:145px; max-width:145px; z-index:3; text-align:left; background:#f6f9f6; }
.month-settings-grid thead th:first-child { z-index:5; padding:0 12px; font-size:var(--text-small); }
.month-settings-grid th > button { width:100%; min-height:49px; border:0; border-radius:0; padding:6px 5px; box-shadow:none; background:transparent; font-size:var(--text-body); }
.month-settings-grid th > button small { display:block; color:var(--muted); font-size:var(--text-dense); margin-top:2px; }
.month-settings-grid tbody th > button { display:block; text-align:left; padding:10px 12px; white-space:normal; }
.month-settings-grid tbody th > button strong { display:block; overflow-wrap:anywhere; font-size:var(--text-small); }
.month-settings-grid thead .weekend > button { color:#ae6f42; }
.month-settings-grid button:focus-visible { outline:2px solid #448261; outline-offset:-3px; }
.month-settings-cell { display:flex; position:relative; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-height:70px; height:100%; width:100%; padding:7px 3px; border:0; border-radius:0; background:#fff; box-shadow:none; font-size:var(--text-small); white-space:normal; line-height:1.35; }
.month-settings-cell-time { font-weight:var(--weight-medium); font-variant-numeric:tabular-nums; }
.month-settings-cell:disabled { opacity:1; color:#68766d; background:#f6f7f6; }
.month-settings-cell > small { color:#52675a; font-size:var(--text-dense); }
.month-settings-cell.is-selected { background:#e9f4ed; box-shadow:inset 0 0 0 2px #6d9b7c; }
.month-settings-cell.has-draft { min-height:93px; background:#fff9e9; }
.month-settings-cell.has-draft.is-selected { box-shadow:inset 0 0 0 2px #6d9b7c; }
.month-settings-cell.has-conflict { background:#fff0e9; }
.month-settings-cell.is-skipped .month-settings-cell-draft { color:#747f80; border-color:#c3cecb; background:#f0f3f2; }
.month-settings-cell-draft { display:block; width:100%; color:#936219; background:#fff8e9; border-top:1px dashed #c7a76e; padding-top:3px; overflow-wrap:anywhere; font-size:var(--text-dense); }
.month-settings-reserved-dot { position:absolute; right:4px; top:5px; width:5px; height:5px; border-radius:50%; background:#899bb0; }
.month-settings-legend { display:flex; flex-wrap:wrap; gap:7px 12px; padding:10px 13px; font-size:var(--text-dense); color:var(--muted); }
.month-settings-legend span { display:flex; align-items:center; gap:4px; }
.month-settings-legend i { display:inline-block; width:11px; height:11px; border:1px solid #b5c6bb; border-radius:2px; }
.month-settings-legend i.selected { background:#e9f4ed; border-color:#6d9b7c; }.month-settings-legend i.draft { background:#fff9e9; border-color:#d4bb86; }.month-settings-legend i.conflict { background:#fff0e9; border-color:#d89a84; }
.month-settings-editor { display:flex; flex-direction:column; max-height:calc(100dvh - 255px); min-height:420px; }
.month-settings-edit-panel, .month-settings-review-panel { flex:1; min-height:0; padding:18px; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.month-settings-editor h2 { font-size:var(--text-label); margin:0 0 8px; }
.month-settings-target { font-size:var(--text-small); color:var(--brand-dark); margin:0 0 18px; line-height:1.6; }
.month-settings-form { display:grid; gap:14px; }
.month-settings-form label { display:grid; gap:6px; font-size:var(--text-small); color:#5d7163; }
.month-settings-form input, .month-settings-form select { width:100%; min-width:0; min-height:var(--control-height); font-size: var(--text-body); }
.month-settings-time { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:end; gap:8px; }
.month-settings-time > span { padding-bottom:12px; color:var(--muted); }
.month-settings-action-note { margin:0; color:var(--muted); font-size:var(--text-dense); line-height:1.7; }
.month-settings-stage { width:100%; min-height:43px; font-size: var(--text-body); }
.month-settings-local-summary { margin-top:22px; padding:14px 12px; background:#f6f9f6; border-radius:8px; }
.month-settings-local-summary strong { font-size:var(--text-small); }
.month-settings-local-summary p { font-size:var(--text-dense); color:var(--muted); line-height:1.6; margin:5px 0 0; }
.month-settings-discard { width:100%; border:0; box-shadow:none; min-height:34px; margin-top:5px; color:var(--muted); font-size:var(--text-dense); }
.month-settings-review-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:14px 0; }
.month-settings-review-metrics span { display:flex; flex-direction:column; align-items:center; gap:5px; font-size:var(--text-dense); padding:10px 2px; border-radius:7px; background:#f3f8f3; }
.month-settings-review-metrics strong { font-size:var(--text-title); color:var(--brand-dark); }
.month-settings-review-metrics span.warn { background:#fff3e9; }.month-settings-review-metrics .warn strong { color:#b16b35; }
.month-settings-scope, .month-settings-record-note { font-size:var(--text-dense); color:var(--muted); line-height:1.7; margin:10px 0; }
.month-settings-record-note { background:#fffaee; color:#8b6e36; padding:9px; border-radius:6px; }
.month-settings-apply-area { position:sticky; bottom:-18px; margin:8px -18px -18px; padding:12px 18px; border-top:1px solid var(--line); background:#fff; }
.month-settings-apply { width:100%; min-height:44px; font-size: var(--text-body); }
.month-settings-ack { display:flex; align-items:flex-start; gap:8px; margin:0 0 10px; padding:10px; background:#fff7ea; font-size:var(--text-dense); line-height:1.6; }
.month-settings-ack input { min-width:17px; width:17px; min-height:17px; height:17px; margin:2px 0 0; }
.month-settings-checking { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:var(--text-small); padding:15px 0; }.month-settings-checking .lucide { width:18px; animation:spin 1s linear infinite; }
.month-settings-notice { margin:0; flex-shrink:0; padding:10px 15px; font-size:var(--text-dense); color:#367248; background:#f2f8f2; line-height:1.6; }.month-settings-notice.error { color:#a34731; background:#fff2ec; }
.month-settings-read-retry, .month-settings-undo { flex-shrink:0; margin:7px 12px; min-height:36px; font-size:var(--text-small); color:var(--brand-dark); }
.month-settings-applied { font-size:var(--text-small); line-height:1.7; color:var(--brand-dark); }
@media (max-width:1100px) { .month-settings-layout { grid-template-columns:minmax(0,1fr) 320px; gap:12px; }.month-settings-grid th:first-child { width:120px; min-width:120px; max-width:120px; }.month-settings-grid tbody th > button { padding:8px; } }
@media (max-width:760px) {
  .month-settings-head { align-items:flex-start; gap:8px; margin-bottom:12px; }.month-settings-head h1 { font-size:var(--text-title); }.month-settings-head p { display:none; }.month-settings-month input { max-width:140px; }
  .month-settings-layout { grid-template-columns:minmax(0,1fr); gap:12px; }.month-settings-board { height:350px; min-height:0; }.month-settings-editor { min-height:0; max-height:none; }.month-settings-edit-panel,.month-settings-review-panel { max-height:65dvh; }.month-settings-grid th:first-child { width:110px; min-width:110px; max-width:110px; }.month-settings-help { font-size:var(--text-dense); padding-bottom:6px; }.month-settings-tools { padding:9px 10px 5px;gap:6px; }.month-settings-search { max-width:160px; }.month-settings-selection { font-size:var(--text-dense); }.month-settings-selectors { padding:4px 10px; }.month-settings-selectors > span { display:none; }.month-settings-legend { font-size:var(--text-dense); padding:7px 10px; }.month-settings-grid th > button { min-height:43px; }.month-settings-cell { min-height:65px; }
}

.month-settings-selectors button[aria-pressed="true"] { background:#e9f4ed; border-color:#6d9b7c; color:var(--brand-dark); }
.month-settings-remove-selected { width:100%; border:0; box-shadow:none; min-height:34px; margin-top:5px; color:var(--brand-dark); font-size:var(--text-dense); }

/* Month overview: scan the month, then inspect a day without leaving it. */
.month-overview-page { width:min(100%, 1320px); }
.month-overview-page-head { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:20px; }
.month-overview-page-head h1 { margin:0; font-size:var(--text-display); letter-spacing:-.035em; }
.month-overview-page-head p { margin:5px 0 0; color:var(--muted); font-size:var(--text-small); }
.month-overview-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.month-overview-actions .button-link, .month-overview-actions button { min-height:var(--control-height); }
.month-overview-page .month-toolbar { display:flex; gap:8px; align-items:center; border:0; margin-bottom:18px; padding:0; }
.month-overview-page .month-toolbar > button { min-width:40px; min-height:var(--control-height); padding:8px 11px; }
.month-overview-page .month-date-current { min-width:180px; min-height:40px; }
.month-overview-page .month-date-current strong { font-size:var(--text-heading); }
.month-overview-page #current-month { margin-left:4px; font-size:var(--text-small); }
.month-overview-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; margin-bottom:24px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.month-overview-summary .month-overview-summary-item { display:flex; flex-direction:column; gap:2px; padding:11px 22px; min-width:0; }
.month-overview-summary .month-overview-summary-item + .month-overview-summary-item { border-left:1px solid var(--line); }
.month-overview-summary .month-overview-summary-item > .lucide { grid-row:1 / 4; align-self:center; width:20px; height:20px; color:var(--brand); }
.month-overview-summary .month-overview-summary-item strong { font-size:var(--text-display); font-weight:var(--weight-strong); letter-spacing:-.03em; line-height:1.35; font-variant-numeric:tabular-nums; }
.month-overview-summary .month-overview-summary-item small { color:var(--muted); font-size:var(--text-dense); }
.month-overview-summary .month-overview-summary-item.is-attention strong { color:var(--warn); }
.month-overview-layout { display:grid; grid-template-columns:minmax(0,1fr) 330px; align-items:start; gap:22px; }
.month-overview-calendar { min-width:0; }
.month-overview-filters { display:flex; flex-wrap:wrap; gap:4px; padding:4px; width:fit-content; max-width:100%; border-radius:9px; background:#eef2ee; }
.month-overview-filters button { min-height:34px; padding:5px 13px; border:1px solid transparent; background:transparent; box-shadow:none; color:var(--muted); font-size:var(--text-body); border-radius:7px; }
.month-overview-filters button.is-active { background:var(--surface); border-color:var(--line); box-shadow:0 1px 3px #1631200a; color:var(--ink); font-weight:var(--weight-medium); }
.month-overview-filter-note { min-height:20px; margin:9px 0 12px; color:var(--muted); font-size:var(--text-small); }
.month-overview-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:1px; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--line); }
.month-overview-weekday { padding:10px 0; text-align:center; color:var(--muted); background:var(--surface-subtle); font-size:var(--text-dense); font-weight:var(--weight-medium); }
.month-overview-pad { min-width:0; background:var(--surface-subtle); }
.month-overview-day { position:relative; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; width:100%; min-width:0; min-height:96px; gap:0; padding:8px 11px; border:0; border-radius:0; color:var(--ink); background:var(--surface); box-shadow:none; text-align:left; font-weight:var(--weight-regular); transition:background .12s ease; }
.month-overview-day:hover { background:#f5faf6; }
.month-overview-day.is-selected { z-index:1; background:#f0f7f1; box-shadow:inset 0 0 0 2px var(--brand); }
.month-overview-day.is-empty { background:#fafbfa; }
.month-overview-day.is-empty.is-selected { background:#f0f7f1; }
.month-overview-day.is-muted { background:#f4f6f4; }
.month-overview-day.is-muted .month-overview-day-count, .month-overview-day.is-muted .month-overview-day-status, .month-overview-day.is-muted .month-overview-bar { opacity:.48; }
.month-overview-day:focus-visible { z-index:2; outline:3px solid var(--blue); outline-offset:-3px; }
.month-overview-day-head { display:flex; flex-wrap:wrap; min-height:24px; align-items:center; justify-content:space-between; gap:3px; }
.month-overview-day-date { display:inline-flex; min-width:23px; height:23px; align-items:center; justify-content:center; font-size:var(--text-body); font-weight:var(--weight-strong); font-variant-numeric:tabular-nums; }
.month-overview-day.is-today .month-overview-day-date { border-radius:50%; background:var(--brand); color:white; }
.month-overview-day-today { font-size:var(--text-dense); color:var(--brand-dark); font-weight:var(--weight-strong); }
.month-overview-day-holiday { overflow:hidden; margin-top:2px; color:var(--danger); font-size:var(--text-dense); white-space:nowrap; text-overflow:ellipsis; }
.month-overview-day-count { margin-top:auto; padding-top:8px; color:var(--ink); font-size:var(--text-heading); font-weight:var(--weight-strong); font-variant-numeric:tabular-nums; line-height:1.3; }
.month-overview-day-count small { padding-left:2px; font-size:var(--text-dense); font-weight:var(--weight-regular); color:var(--muted); }
.month-overview-day-status { margin:3px 0 0; color:var(--muted); font-size:var(--text-dense); line-height:1.4; }
.month-overview-day.has-missing .month-overview-day-status { color:#95600a; font-weight:var(--weight-strong); }
.month-overview-day.is-empty .month-overview-day-status { margin-top:auto; color:#839087; }
.month-overview-bar { display:flex; height:4px; gap:1px; margin-top:8px; overflow:hidden; border-radius:3px; background:#edf1ed; }
.month-overview-bar i { display:block; height:100%; }
.month-overview-bar i.confirmed, .month-overview-legend i.confirmed { background:var(--brand); }
.month-overview-bar i.draft, .month-overview-legend i.draft { background:#9cbbc2; }
.month-overview-bar i.missing, .month-overview-legend i.missing { background:#d59a3a; }
.month-overview-legend { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:12px; font-size:var(--text-dense); color:var(--muted); }
.month-overview-legend > span { display:inline-flex; gap:5px; align-items:center; }
.month-overview-legend i { display:inline-block; width:14px; height:4px; border-radius:2px; }
.month-overview-footnote { margin:12px 0 0; color:var(--muted); font-size:var(--text-dense); line-height:1.7; }
@media (max-width:1100px) {
  .month-overview-layout { grid-template-columns:minmax(0,1fr) 285px; gap:16px; }
  .month-overview-day { padding:9px 7px; }
}
@media (max-width:860px) {
  .month-overview-layout { grid-template-columns:minmax(0,1fr); }
  .month-overview-page-head { flex-wrap:wrap; gap:14px; }
  .month-overview-summary .month-overview-summary-item { padding:14px 16px; }
  .month-overview-day { min-height:104px; }
}
@media (max-width:540px) {
  .month-overview-page-head { margin-bottom:16px; }
  .month-overview-page-head h1 { font-size:var(--text-title); }
  .month-overview-page-head p { font-size:var(--text-dense); }
  .month-overview-actions { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:7px; }
  .month-overview-actions .button-link, .month-overview-actions button { justify-content:center; padding:8px 6px; font-size:var(--text-body); }
  .month-overview-actions .lucide { width:15px; height:15px; }
  .month-overview-page .month-toolbar { gap:5px; margin-bottom:14px; }
  .month-overview-page .month-toolbar > button { min-width:36px; padding:7px; }
  .month-overview-page .month-date-current { min-width:0; flex:1; }
  .month-overview-page .month-date-current strong { font-size:var(--text-label); }
  .month-overview-summary { margin-bottom:18px; }
  .month-overview-summary .month-overview-summary-item { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:1px; padding:11px 10px; }
  .month-overview-summary .month-overview-summary-item > .lucide { display:none; }
  .month-overview-summary .month-overview-summary-item strong { font-size:var(--text-title); }
  .month-overview-summary .month-overview-summary-item small { font-size:var(--text-dense); }
  .month-overview-summary .month-overview-summary-item > span { font-size:var(--text-dense); }
  .month-overview-filters { width:100%; gap:2px; }
  .month-overview-filters button { flex:1; padding:5px 4px; font-size:var(--text-body); }
  .month-overview-filter-note { margin:8px 0; font-size:var(--text-dense); }
  .month-overview-grid { border-radius:8px; }
  .month-overview-weekday { padding:7px 0; font-size:var(--text-dense); }
  .month-overview-day { min-height:93px; padding:6px 4px; }
  .month-overview-day-head { min-height:20px; }
  .month-overview-day-date { min-width:20px; height:20px; font-size:var(--text-small); }
  .month-overview-day-today { display:none; }
  .month-overview-day-holiday { font-size:var(--text-dense); max-width:100%; }
  .month-overview-day-count { font-size:var(--text-label); padding-top:5px; }
  .month-overview-day-status { font-size:var(--text-dense); min-height:24px; overflow-wrap:anywhere; }
  .month-overview-bar { margin-top:5px; height:3px; }
  .month-overview-legend { gap:10px; font-size:var(--text-dense); }
  .month-overview-footnote { font-size:var(--text-dense); }
}

.month-overview-summary-item > span { color:var(--muted); font-size:var(--text-small); }
.month-overview-summary-item strong small { margin-left:5px; font-size:var(--text-small); font-weight:var(--weight-regular); }
.month-overview-summary-item.is-attention > span { color:#95600a; }
.month-overview-weekday:first-child, .month-overview-day.is-weekend .month-overview-day-date { color:var(--danger); }
.month-overview-weekday:nth-child(7) { color:var(--blue); }
.month-overview-day.is-today .month-overview-day-date { color:#fff; }
.month-overview-day.is-empty .month-overview-day-count { color:#a1aaa4; font-size:var(--text-body); font-weight:var(--weight-regular); }

.month-overview-page-head .month-toolbar { margin:0; flex-shrink:0; }
.month-overview-day.is-saturday:not(.is-holiday) .month-overview-day-date { color:var(--blue); }
.month-overview-day.is-today .month-overview-day-date { color:#fff; }
@media (max-width:1100px) {
  .month-overview-page-head { flex-wrap:wrap; gap:12px 18px; }
  .month-overview-page-head > div:first-child { flex:1 0 100%; }
  .month-overview-actions { margin-left:auto; }
}
@media (max-width:540px) {
  .month-overview-page-head { gap:12px; }
  .month-overview-page-head .month-toolbar { width:100%; }
  .month-overview-actions { margin:0; }
  .month-overview-day { min-height:86px; }
}
@media (min-width:861px) {
  .month-overview-day { min-height:90px; padding-block:6px; }
  .month-overview-day-head { min-height:22px; }
  .month-overview-day-count { padding-top:4px; }
  .month-overview-bar { margin-top:5px; }
}
.month-overview-calendar { scroll-margin-top:calc(var(--header-h) + 16px); }

.month-overview-page-head .month-current-heading { margin:0; min-width:0; font-size:inherit; }
@media (max-width:540px) {
  .month-overview-page-head .month-current-heading { flex:1; }
  .month-current-heading .month-date-current { width:100%; }
}

.route-page-head .route-head-actions { width:100%; justify-content:space-between; }
@media (min-width:621px) {
  .route-page-head .route-head-actions { flex-direction:row; align-items:center; flex-wrap:wrap; }
}

/* Staff route list: scan compact rows, expand only the selected route. */
.route-staff-panel .route-sidebar-head { min-height:58px; padding:10px 16px; }
.route-staff-panel .route-all { display:flex; align-items:center; gap:10px; border-radius:7px; font-size:var(--text-small); }
.route-staff-panel .route-all span { font-size:var(--text-dense); font-weight:var(--weight-regular); }
.route-placement-total { color:var(--muted); font-size:var(--text-small); font-variant-numeric:tabular-nums; }
.route-placement-total strong { color:var(--ink); }
.route-staff-panel .route-person-card { padding:16px 18px; border-left:0; }
.route-staff-panel .route-person-card.active { background:var(--surface); box-shadow:inset 2px 0 var(--route-color); }
.route-staff-panel .route-person-head { grid-template-columns:minmax(0,1fr) auto 16px; gap:12px; }
.route-staff-panel .route-person-copy > strong { font-size:var(--text-body); white-space:normal; overflow-wrap:anywhere; }
.route-staff-panel .route-person-copy small { margin-top:3px; font-size:var(--text-dense); }
.route-staff-panel .route-person-copy > strong::before { content:""; display:inline-block; width:8px; height:8px; margin-right:8px; border-radius:50%; background:var(--route-color); vertical-align:middle; }
.route-staff-panel .route-count { display:flex; align-items:baseline; gap:3px; }
.route-staff-panel .route-count strong { font-size:var(--text-title); color:var(--ink); font-variant-numeric:tabular-nums; }
.route-staff-panel .route-count small { font-size:var(--text-dense); }
.route-expand-icon { display:flex; color:var(--muted); }
.route-expand-icon .lucide { width:16px; height:16px; transition:transform .15s; }
.route-person-card.active .route-expand-icon .lucide { transform:rotate(180deg); }
.route-staff-panel .route-person-meta { flex-wrap:wrap; gap:6px 16px; border:0; padding-top:0; margin-top:10px; font-size:var(--text-small); line-height:1.5; }
.route-service-total { display:block; margin-top:5px; color:var(--muted); font-size:var(--text-dense); }
.route-staff-panel .route-mini-stops { gap:0; margin-top:16px; padding-top:8px; border-top:1px solid var(--line); }
.route-staff-panel .route-mini-stop { position:relative; grid-template-columns:22px minmax(0,1fr); gap:10px; padding:10px 0; align-items:start; }
.route-staff-panel .route-mini-stop:not(:last-child)::after { content:""; position:absolute; left:10px; top:30px; bottom:-10px; width:1px; background:color-mix(in srgb,var(--route-color) 30%,white); }
.route-staff-panel .route-mini-stop > b { width:22px; height:22px; border:1px solid color-mix(in srgb,var(--route-color) 55%,white); color:var(--ink); background:var(--surface); font-size:var(--text-dense); font-weight:var(--weight-medium); }
.route-staff-panel .route-mini-stop strong { display:flex; flex-wrap:wrap; gap:4px 10px; font-size:var(--text-small); line-height:1.6; }
.route-staff-panel .route-mini-stop time { font-variant-numeric:tabular-nums; }
.route-staff-panel .route-mini-stop small { margin-top:3px; font-size:var(--text-dense); white-space:normal; overflow-wrap:anywhere; line-height:1.6; }
.route-staff-panel .route-external-links { padding:12px 18px; border-left:0; background:var(--surface); }
.route-staff-panel .route-external-links a, .route-staff-panel .route-qr-button { min-height:var(--control-height); font-size:var(--text-dense); }
.route-staff-panel .route-external-links a small, .route-staff-panel .route-external-links p { font-size:var(--text-dense); }
.route-staff-panel .route-time-compare, .route-staff-panel .route-calc-status { font-size:var(--text-dense); }
@media (min-width:1101px) {
  .route-map-people { display:none; }
}
@media (prefers-reduced-motion:reduce) { .route-expand-icon .lucide { transition:none; } }

/* Compact colored map pins remain distinct from the map; hit areas stay 34px. */
.route-map-pin { width:28px; height:28px; margin:3px; border:2px solid #fff; background:color-mix(in srgb,var(--route-color) 82%,#25332b); box-shadow:0 1px 4px rgb(20 43 28 / .25); }
.route-map-pin b { color:#fff; font-size:var(--text-small); font-weight:var(--weight-strong); }
.route-staff-panel .route-person-card:hover { background:#fafbfa; }
.route-staff-panel .route-person-card.active:hover { background:var(--surface); }

.route-direction-marker { pointer-events:none; }
.route-direction-arrow { display:grid; place-items:center; width:20px; height:20px; border-radius:4px; background:rgb(255 255 255 / .92); color:var(--route-color); box-shadow:0 0 0 1px rgb(255 255 255 / .7); }
.route-direction-arrow .lucide { width:18px; height:18px; stroke-width:3; }

.pdf-choice { display:flex; gap:12px; align-items:flex-start; padding:14px; margin:8px 0; border:1px solid var(--line); border-radius:8px; }
.pdf-choice input { margin:4px 0 0; width:16px; height:16px; min-height:16px; flex:0 0 16px; padding:0; accent-color:var(--brand); }
.pdf-choice span { display:grid; gap:4px; }
.pdf-choice small { color:var(--muted); font-size:var(--text-small); }
.pdf-person { display:grid; gap:6px; margin:16px 0; }
#route-pdf { display:inline-flex; gap:6px; align-items:center; white-space:nowrap; }
#route-pdf .lucide { width:16px; height:16px; }
@media(max-width:540px) { #route-pdf { grid-column:1 / -1; justify-content:center; } }

/* Route endpoints share one compact marker with the visit number. */
.route-map-pin.start, .route-map-pin.finish, .route-map-pin.single { display:flex; justify-content:center; align-items:center; gap:3px; width:34px; margin:3px 0; border-radius:8px; }
.route-map-pin > .lucide { width:11px; height:11px; flex:none; stroke-width:2.5; }
.route-map-pin.start > .lucide { fill:currentColor; stroke-width:1.5; }
.route-map-pin.start b, .route-map-pin.finish b, .route-map-pin.single b { font-size:var(--text-dense); }
.route-endpoint-label { display:inline-flex; align-items:center; gap:3px; color:var(--muted); font-size:var(--text-dense); font-weight:var(--weight-regular); }
.route-endpoint-label .lucide { width:11px; height:11px; }

/* Keep member switching outside the map; secondary display controls stay folded. */
.route-map-toolbar { position: relative; z-index: 1; isolation: isolate; display: flex; align-items: center; gap: 12px; margin: -4px 0 12px; min-width: 0; }
.route-map-toolbar .route-map-people { position: static; display: flex; flex: 1; width: auto; min-width: 0; gap: 4px; overflow-x: auto; padding: 3px 1px 6px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; scrollbar-width: thin; }
.route-map-toolbar .route-map-people button { display: flex; flex: 0 0 auto; min-height: 36px; padding: 7px 11px; gap: 7px; border: 1px solid transparent; border-radius: 8px; font-size: var(--text-small); }
.route-map-toolbar .route-map-people button.active { background: #fff; border-color: color-mix(in srgb, var(--route-color, #46604e) 45%, #e4e9e5); box-shadow: none; }
.route-display-settings { position: relative; flex: 0 0 auto; z-index: 600; }
.route-display-settings summary { display: grid; place-items: center; width: 38px; height: 38px; list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.route-display-settings summary::-webkit-details-marker { display: none; }
.route-display-settings summary svg { width: 18px; height: 18px; }
.route-display-settings[open] summary { color: var(--brand-dark); background: var(--brand-soft); }
.route-display-popover { position: absolute; right: 0; top: calc(100% + 8px); width: min(290px, calc(100vw - 40px)); padding: 18px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 36px rgb(25 45 33 / .16); }
.route-display-popover > strong { font-size: var(--text-body); margin-bottom: 4px; }
.route-display-popover > span { font-size: var(--text-small); color: var(--muted); }
.route-display-popover .route-map-style, .route-display-popover .route-source-switch { position: static; display: flex; padding: 3px; box-shadow: none; background: #f4f6f4; }
.route-display-popover button { flex: 1; font-size: var(--text-body); min-height: 36px; }
.route-map-toolbar + .route-overview { height: calc(100vh - var(--header-h) - 184px); }
@media (max-width: 900px) { .route-map-toolbar + .route-overview { height: auto; } }

/* Compact navigation opens from the brand, leaving the content full height. */
#brand-menu-trigger, .brand-menu-chevron, #brand-menu-scrim, .brand-drawer-head { display: none; }
@media (max-width: 900px) {
  .brand { position: relative; justify-self: start; width: fit-content; padding-right: 12px; }
  #brand-menu-trigger { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; background: transparent; box-shadow: none; cursor: pointer; }
  #brand-menu-trigger:hover { background: rgb(50 124 60 / .05); transform: none; }
  .brand-menu-chevron { display: block; width: 14px; height: 14px; margin-left: 4px; color: var(--muted); transition: transform .15s ease; }
  .brand-menu-open .brand-menu-chevron { transform: rotate(180deg); }
  body.brand-drawer-open { overflow: hidden; }
  #topbar #nav { display: none; position: fixed; inset: 0 auto 0 0; z-index: 2; width: min(320px, 86vw); height: 100dvh; max-height: none; overflow-y: auto; overscroll-behavior: contain; justify-content: flex-start; padding: max(12px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom)); border: 0; border-right: 1px solid var(--line); border-radius: 0 18px 18px 0; background: #fff; box-shadow: 10px 0 40px rgb(24 45 30 / .12); white-space: normal; }
  #topbar.brand-menu-open #brand-menu-scrim { display: block; position: fixed; inset: 0; z-index: 1; width: 100vw; height: 100dvh; border: 0; border-radius: 0; background: rgb(20 32 26 / .28); box-shadow: none; }
  .brand-drawer-head { display: flex; align-items: center; gap: 9px; min-height: 58px; margin-bottom: 18px; padding: 0 4px 12px; border-bottom: 1px solid var(--line-soft); color: var(--brand-dark); }
  .brand-drawer-head img { width: 30px; height: 30px; }
  .brand-drawer-head strong { font-size: var(--text-heading); }
  #brand-menu-close { margin-left: auto; display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 10px; border: 0; background: transparent; box-shadow: none; }
  #brand-menu-close svg { width: 20px; height: 20px; }
  @media (prefers-reduced-motion: no-preference) { #topbar.brand-menu-open #nav { animation: brand-drawer-enter .18s ease-out; } }
  @keyframes brand-drawer-enter { from { transform: translateX(-100%); } to { transform: translateX(0); } }
  #topbar.brand-menu-open #nav { display: flex; flex-direction: column; gap: 3px; }
  #topbar #nav a, #topbar #nav .nav-more > summary { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; min-width: 0; min-height: 46px; gap: 12px; padding: 11px 13px; border: 0; border-radius: 8px; font-size: var(--text-small); line-height: 1.4; }
  #topbar #nav a span[data-mobile-label], #topbar #nav .nav-more > summary span[data-mobile-label] { display: inline; font-size: var(--text-small); }
  #topbar #nav span[data-mobile-label]::after { content: none; }
  #topbar #nav .nav-more { display: block; flex: 0 0 auto; min-height: 0; min-width: 0; border-top: 1px solid var(--line-soft); padding-top: 4px; }
  #topbar #nav .nav-more > summary::after { content: "＋"; margin-left: auto; color: var(--muted); }
  #topbar #nav .nav-more[open] > summary::after { content: "−"; }
  #topbar #nav .nav-more-menu { position: static; width: auto; padding: 3px 0 0 18px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  #topbar #nav a[hidden], #topbar #nav .nav-more[hidden] { display: none; }
}

/* AI companion: existing operations remain visible beside the panel. */
#userbox { gap: 8px; }
@media (max-width: 760px) {
  #userbox { gap: 3px; }
}

/* A single quiet capsule pairs the generated mark with the account control. */
/* Empty status hooks remain available for errors and filtered results. */
.month-overview-filter-note:empty,
.month-settings-local-summary p:empty { display: none; }

/* Interaction polish: immediate press, quiet release, stable scrolling. */
:root { --ui-ease: cubic-bezier(.2,.8,.2,1); }
button, summary, input, select, textarea { touch-action: manipulation; }
button:not(:disabled), summary { -webkit-tap-highlight-color: rgb(50 124 60 / .12); }
button { transition: background-color 120ms ease, border-color 120ms ease, box-shadow 160ms ease, transform 140ms var(--ui-ease); }
button:active:not(:disabled) { transition-duration: 40ms; box-shadow: none; }
button:disabled { transform: none; box-shadow: none; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { transition: border-color 140ms ease, box-shadow 140ms ease; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(50 124 60 / .09); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
summary { cursor: pointer; }
#account-drawer-content, .modal, .day-route-content { scrollbar-gutter: stable; scroll-padding-block: 16px; }
.modal :is(input, select, textarea, button) { scroll-margin-block: 16px; }
@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 3px; }
}
@media (prefers-reduced-motion: no-preference) {
  #modal-layer:not([hidden]) { animation: ui-surface-enter 120ms ease-out; }
  #modal-layer:not([hidden]) > .modal { animation: ui-dialog-enter 170ms var(--ui-ease); }
  #account-drawer { transition-timing-function: var(--ui-ease); }
}
@keyframes ui-panel-enter { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ui-dialog-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ui-surface-enter { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  button, input, select, textarea, #account-drawer { transition: none !important; }
  button:active:not(:disabled) { transform: none; }
  #modal-layer, #modal-layer > .modal { animation: none !important; }
}

/* Single-office account entry */
.login.auth-card { width: min(460px, calc(100% - 40px)); margin: 8vh auto; padding: 36px; border-radius: 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; font-size: var(--text-title); font-weight: var(--weight-strong); color: var(--brand-dark); }
.auth-brand img { width: 58px; height: 58px; object-fit: contain; }
.auth-brand small { display: block; margin-top: 2px; font-size: var(--text-dense); color: var(--muted); font-weight: var(--weight-regular); }
.auth-card h1 { margin-bottom: 10px; font-size: var(--text-title); }
.auth-card p { line-height: 1.8; overflow-wrap: anywhere; }
.auth-card .login-fields { gap: 18px; }
.auth-card input:not([type="checkbox"]) { min-height: 46px; }
.auth-card .primary { min-height: 46px; }
.auth-card .login-fields .auth-show-password { display: flex; align-items: center; gap: 8px; font-size: var(--text-small); color: var(--muted); }
.auth-card .auth-show-password input { flex: none; width: 16px; height: 16px; }
.auth-text-button { display: block; margin: 20px auto 0; padding: 8px; background: transparent; border: 0; color: var(--brand-dark); text-decoration: underline; text-underline-offset: 4px; }
.auth-card .auth-invite-note { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: var(--text-small); }
@media (max-width: 620px) { .login.auth-card { padding: 24px; margin: 32px auto; } }

.auth-social-buttons { display: grid; gap: 10px; margin: 20px 0; }
.auth-social-buttons button { width: 100%; min-height: 46px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: var(--weight-medium); }
.auth-social-buttons button:hover { background: var(--surface-subtle); }
.auth-divider { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: var(--text-small); margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.auth-card .auth-caps-warning { color: var(--warn); margin: 0; font-size: var(--text-small); }
.auth-card:has(.auth-social-buttons) { margin-top: 24px; }
.auth-social-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-social-buttons button:only-child { grid-column: 1 / -1; }
@media (max-width: 380px) { .auth-social-buttons { grid-template-columns: 1fr; } }

/* Sidebar splitter: a generous hit area without covering either workspace. */
/* Recurring primary staff editor */
.recurring-staff-editor { max-width: 900px; }
.modal.recurring-staff-modal { width: min(900px, 100%); }
.recurring-staff-card { margin: 16px 0; padding: 16px; border: 1px solid #d6e2d4; border-radius: 12px; }
.recurring-staff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.recurring-staff-grid label { display: flex; flex-direction: column; gap: 6px; }
.recurring-staff-grid [hidden] { display: none; }
.recurring-history { padding: 14px; background: #f3f7f1; border-radius: 12px; }
.recurring-history summary { cursor: pointer; font-weight: var(--weight-medium); }
.recurring-history .table-wrap { max-height: 260px; overflow: auto; margin-top: 12px; }
#recurring-staff-review { padding: 14px; border: 1px solid #6c9165; border-radius: 12px; }
#recurring-staff-error { color: #a33232; }
@media(max-width: 600px) { .recurring-staff-grid { grid-template-columns: 1fr; } }
.condition-clients{max-height:40vh;overflow:auto}.condition-clients fieldset{margin:10px 0;padding:12px;border:1px solid #d8e0d8;border-radius:8px}.condition-clients fieldset[hidden]{display:none}.condition-clients label{display:inline-flex;align-items:center;gap:8px;margin-right:20px}

.rehab-mode-toggle{display:flex;align-items:center;gap:10px;margin:16px 0}.rehab-mode-toggle input[type=checkbox]{width:18px;height:18px;min-height:18px;flex:0 0 18px;margin:0;padding:0}

/* Time-proportional rectangular layout. */
.day-layout-choice { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: var(--text-small); }
.day-layout-choice select { width: auto; min-height: 32px; padding: 4px 24px 4px 8px; }
.square-timeline .visit-event { height: 64px; min-width: 0; }
.square-timeline .visit-block { height: 64px; min-width: 0; padding: 7px 5px; border: 1px solid #a9c3b1; border-radius: 0; background: #edf5ee; box-shadow: none; }
.square-timeline .visit-block.confirmed { background: #dcecdf; border-color: #83a78e; }
.square-timeline .visit-block.conflict { background: #fff0ee; border-color: #c76860; }
.square-timeline .visit-block.travel-risk { background: #fff5df; border-color: #c5994e; }
.square-timeline .visit-block:hover { filter: brightness(.97); box-shadow: none; }
.square-timeline .visit-main .time { font-size: var(--text-dense); }
.square-timeline .visit-client-label { top: 24px; left: 0; right: 0; width: 100%; min-width: 0; max-width: 100%; padding: 0 5px; border: 0; background: transparent; font-size: var(--text-small); line-height: 17px; }
.square-timeline .visit-block + .visit-client-label { background: transparent; }
.square-timeline .visit-lock-toggle { flex-shrink: 0; background: transparent; }
.square-timeline .visit-block .visit-meta { display: flex; margin-top: 28px; font-size: var(--text-dense); }
.square-timeline .visit-meta b { background: transparent; padding: 0; }
.square-timeline .visit-condition, .square-timeline .visit-set { display: none; }
.square-timeline .visit-warning { border-radius: 0; }
.square-timeline .travel-leg { height: 64px; overflow: visible; }
.square-timeline .travel-leg::before, .square-timeline .travel-leg::after { display: none; }
.square-timeline .travel-leg-label { width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 0; border: 1px solid #c5ceca; border-radius: 0; background: #eef0ef; color: #5b665e; font-size: var(--text-dense); overflow: hidden; box-shadow: none; }
.square-timeline .travel-leg-label span { flex: none; overflow: visible; transform: rotate(-90deg); white-space: nowrap; }
.square-timeline .travel-leg-label .lucide { display: none; }
.square-timeline .travel-leg.unknown .travel-leg-label { border-style: dashed; }
.square-timeline .record-time-block { height: 64px; border-radius: 0; }

.square-timeline .visit-client-label { align-items: start; top: 21px; padding-right: 4px; }
.square-timeline .visit-client-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow-wrap: anywhere; line-height: 14px; font-size: var(--text-dense); }
.square-timeline .visit-lock-toggle { position: absolute; right: 2px; top: 25px; }
.square-timeline .visit-block.short .visit-meta { display: none; }
.square-timeline .visit-block .visit-main { position: absolute; top: 7px; left: 5px; right: 4px; }
.square-timeline .visit-block .visit-meta { position: absolute; bottom: 5px; left: 5px; right: 17px; margin: 0; }
.modal.staff-roster-modal { width: min(1000px, 100%); }
.roster-scroll { overflow-x: auto; margin-block: 14px; }
.roster-scroll table { min-width: 680px; width: 100%; }
.roster-scroll th small { display: block; font-weight: var(--weight-regular); font-size: var(--text-dense); }
.roster-scroll td label { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: var(--text-small); }
.roster-scroll input[type=checkbox] { width: 20px; height: 20px; min-height: 20px; }
.roster-scroll td small { font-size: var(--text-dense); max-width: 70px; }
.roster-weekdays { display: flex; gap: 24px; margin-block: 16px; }
.roster-weekdays label { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.roster-weekdays input { width: 20px; height: 20px; }
.roster-scroll [data-count] { display: block; margin-top: 8px; }
.roster-scroll [data-reset-staff] { font-size: var(--text-dense); padding: 4px; }

/* 利用者一覧：リハビリチェックと訪問パターンの食い違い */
.master-rehab-warning { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: #744d12; font-size: var(--text-dense); }
.master-rehab-warning svg { width: 12px; height: 12px; }

/* Contextual controls in the master tabs. */
.master-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 20px; padding: 14px 16px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 12px; }
.master-tools button, .master-rehab-card button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.master-tools p { margin: 0; font-size: var(--text-small); color: var(--muted); }
.master-rehab-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 20px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.master-rehab-card h2 { margin: 0 0 6px; }
.master-rehab-card p { margin: 4px 0; }
.master-rehab-card small { color: var(--muted); }
.master-rehab-state { font-weight: var(--weight-strong); color: var(--brand-dark); }
@media (max-width: 760px) {
  .masters-page { min-width: 0; }
  .master-tools p { flex-basis: 100%; }
  .master-rehab-card { align-items: stretch; }
  .master-rehab-card button { width: 100%; }
  .master-panel-actions { flex-wrap: wrap; }
  .master-panel-actions label { min-width: 0; max-width: 100%; }
}

.staff-attendance-help { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); font-size: var(--text-small); }
.staff-attendance-help > .lucide { flex: 0 0 auto; width: 18px; height: 18px; color: var(--brand); margin-top: 2px; }
.staff-attendance-help strong { font-size: var(--text-small); color: var(--ink); }
.staff-attendance-help p { margin: 5px 0 0; color: var(--muted); line-height: 1.6; }
.staff-attendance-help .staff-attendance-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.staff-attendance-path > strong { color: var(--brand-dark); }

.staff-skill-options { min-width: 0; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.staff-skill-options legend { padding: 0 5px; font-size: var(--text-small); font-weight: var(--weight-strong); }
.staff-skill-options p, .staff-skill-options details { font-size: var(--text-small); color: var(--muted); line-height: 1.7; }
.staff-skill-options p { margin: 8px 0 0; }
.staff-skill-options input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }

/* Compact JSON actions retain accessible names and hover descriptions. */

/* Keep list summaries and tools compact enough to expose the actual rows. */



.master-list-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 10px 0 14px; }
.master-list-controls label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: var(--text-dense); }
.master-list-controls select { min-height: 36px; width: auto; min-width: 100px; font-size: var(--text-body); }
.master-list-controls > button, .master-list-controls summary { min-height: 36px; padding: 8px 10px; font-size: var(--text-small); cursor: pointer; }
.master-list-controls > span { margin-left: auto; align-self: center; color: var(--muted); font-size: var(--text-small); }
.master-extra-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
@media(max-width:600px) {  { min-width: 130px; } .master-list-controls { gap: 8px; } }

/* Footer shared by condition and rehabilitation settings dialogs. */
.modal .modal-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal .modal-actions > button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 10px 18px; font-size: var(--text-body); line-height: 1.5; white-space: normal; }
.modal .modal-actions > button:not(.primary) { min-width: 88px; }
.modal .modal-actions > button.primary { min-width: 176px; }
@media (max-width: 480px) { .modal .modal-actions { display: grid; grid-template-columns: minmax(72px, 1fr) minmax(0, 2fr); gap: 10px; } .modal .modal-actions > button { width: 100%; min-width: 0 !important; padding-inline: 10px; } }

/* The board remains editable in both views; planning controls have one home. */

/* ---- 文書作成（報告書・計画書評価・計画書）。スマホの片手入力を優先する ---- */
.doc-page { width: min(100%, 760px); margin: 0 auto; padding-bottom: 24px; }
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.doc-head h1 { margin: 0; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.03em; line-height: 1.2; }
.doc-sub, .doc-meta { margin: 4px 0 0; color: var(--muted); font-size: var(--text-small); }
.doc-back { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; margin-left: -6px; padding: 0 8px 0 2px; border-radius: 8px; color: var(--brand-dark); font-size: var(--text-small); font-weight: var(--weight-strong); text-decoration: none; }
.doc-back .lucide { width: 18px; height: 18px; }
.doc-editor-head { align-items: center; flex-wrap: wrap; }
.doc-editor-head > div { flex: 1 1 200px; min-width: 0; }
.doc-editor-head h1 { font-size: var(--text-heading); overflow-wrap: anywhere; }
.doc-status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface-subtle); color: var(--muted); font-size: var(--text-small); font-weight: var(--weight-strong); }
.doc-status.final { background: var(--brand-soft); color: var(--brand-dark); }
.doc-month { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.doc-month strong { min-width: 120px; text-align: center; font-size: var(--text-label); }
.doc-month button { width: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.doc-row:hover { border-color: #b9c5bb; }
.doc-row.final { border-color: #cfe0d1; }
.doc-row .lucide { width: 18px; height: 18px; color: var(--muted); }
.doc-row-body { display: grid; gap: 2px; min-width: 0; }
.doc-row-body strong { font-size: var(--text-body); overflow-wrap: anywhere; }
.doc-row-body small { color: var(--muted); font-size: var(--text-small); }
.doc-kind { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; min-height: 30px; padding: 0 8px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); font-size: var(--text-small); font-weight: var(--weight-strong); }
.doc-empty { padding: 28px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: var(--text-small); }
.doc-new-link { min-height: 40px; font-size: var(--text-small); }
.doc-fab { display: none; }
.doc-step { min-width: 0; margin: 0 0 12px; padding: 14px 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.doc-step legend { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--ink); font-size: var(--text-body); font-weight: var(--weight-strong); }
.doc-step-no { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: var(--text-small); }
.doc-search { position: relative; display: block; margin-bottom: 8px; }
.doc-search .lucide { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.doc-search input { width: 100%; min-height: 46px; padding-left: 38px; border-radius: 10px; }
.doc-selected { margin: 0 0 8px; color: var(--muted); font-size: var(--text-small); }
.doc-selected strong { color: var(--brand-dark); }
.doc-client-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }
.doc-client { display: grid; gap: 2px; min-height: 52px; padding: 8px 12px; text-align: left; justify-content: start; justify-items: start; border-radius: 10px; }
.doc-client strong { font-size: var(--text-body); }
.doc-client small { color: var(--muted); font-size: var(--text-dense); }
.doc-client[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.doc-choices { display: grid; gap: 8px; }
.doc-choice { position: relative; display: block; cursor: pointer; }
.doc-choice input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.doc-choice > span { display: grid; gap: 2px; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.doc-choice > span strong { color: var(--ink); font-size: var(--text-body); }
.doc-choice > span small { color: var(--muted); font-size: var(--text-small); line-height: 1.5; }
.doc-choice:has(input:checked) > span, .doc-choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.doc-choice:has(input:focus-visible) > span { outline: 2px solid var(--brand); outline-offset: 2px; }
.doc-segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.doc-segment { position: relative; display: block; cursor: pointer; }
.doc-segment input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.doc-segment > span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 6px; color: var(--ink); font-size: var(--text-body); font-weight: var(--weight-strong); text-align: center; }
.doc-segment + .doc-segment > span { border-left: 1px solid var(--line); }
.doc-segment:has(input:checked) > span, .doc-segment input:checked + span { background: var(--brand); color: #fff; }
.doc-page input[type="month"] { width: 100%; max-width: 240px; min-height: 46px; }
.doc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.doc-tabs button { min-height: 44px; border: 0; border-radius: 0; box-shadow: none; font-weight: var(--weight-medium); }
.doc-tabs button + button { border-left: 1px solid var(--line); }
.doc-tabs button[aria-selected="true"] { background: var(--brand); color: #fff; }
.doc-fields { display: grid; gap: 10px; }
.doc-field { display: grid; gap: 6px; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.doc-field > label, .doc-field-label-row { display: grid; gap: 2px; color: var(--ink); }
.doc-field-label-row { grid-template-columns: 1fr; }
.doc-field-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-body); font-weight: var(--weight-strong); }
.doc-field > label small, .doc-field-label-row small { color: var(--muted); font-size: var(--text-small); line-height: 1.5; }
.doc-required { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: var(--text-dense); font-style: normal; font-weight: var(--weight-strong); }
.doc-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; line-height: 1.6; resize: none; overflow: hidden; }
.doc-chips { display: flex; gap: 6px; margin: 2px -14px 0; padding: 2px 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.doc-chips::-webkit-scrollbar { display: none; }
.doc-chip { flex: 0 0 auto; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface-subtle); font-size: var(--text-small); font-weight: var(--weight-medium); white-space: nowrap; }
.doc-chip:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.doc-list-row { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 8px; }
.doc-list-no { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand-dark); font-size: var(--text-body); font-weight: var(--weight-strong); }
.doc-remove { width: 36px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-color: transparent; color: var(--muted); background: transparent; box-shadow: none; }
.doc-remove .lucide { width: 16px; height: 16px; }
.doc-problem { display: grid; gap: 6px; padding: 8px 0 10px; border-top: 1px solid var(--line-soft); }
.doc-solution { display: grid; gap: 4px; padding-left: 4px; }
.doc-solution > span { color: var(--muted); font-size: var(--text-small); font-weight: var(--weight-strong); }
.doc-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-style: dashed; color: var(--brand-dark); font-weight: var(--weight-strong); }
.doc-add .lucide { width: 16px; height: 16px; }
.doc-memo { margin-top: 10px; }
.doc-output { margin-top: 14px; padding: 14px; border: 1px solid #cfe0d1; border-radius: 14px; background: #fbfdfb; }
.doc-output-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.doc-output-head h2 { margin: 0; font-size: var(--text-label); }
.doc-output-head small { color: var(--muted); font-size: var(--text-small); }
.doc-notes { margin: 0 0 10px; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: var(--text-small); line-height: 1.6; }
.doc-output textarea { width: 100%; min-height: 200px; padding: 12px; border-radius: 10px; line-height: 1.7; font-size: var(--text-body); resize: vertical; }
.doc-output textarea:disabled { color: var(--ink); background: var(--surface); opacity: 1; }
.doc-output-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.doc-output-actions button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.doc-error { margin: 0 0 10px; color: var(--danger); font-size: var(--text-small); }
.doc-error:empty { display: none; }
.doc-error button { margin-left: 6px; min-height: 32px; padding: 4px 10px; font-size: var(--text-body); }
.doc-bar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); background: linear-gradient(to top, #fbfcfb 70%, rgb(251 252 251 / 0)); }
.doc-bar-text { color: var(--muted); font-size: var(--text-small); }
.doc-bar-text.saved { color: var(--brand-dark); }
.doc-bar-text.error { color: var(--danger); }
.doc-bar button { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-body); border-radius: 12px; }
.doc-bar button .lucide { width: 18px; height: 18px; }
.doc-editor.is-final textarea:disabled { background: var(--surface-subtle); color: var(--ink); opacity: 1; }
@media (max-width: 760px) {
  .doc-page { padding-bottom: 88px; }
  .doc-page input, .doc-page textarea { font-size: var(--text-label); } /* iOSの拡大を避ける */
  .doc-new-link { display: none; }
  .doc-fab { display: block; position: fixed; left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 4; }
  .doc-fab a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 14px; background: var(--brand); color: #fff; font-size: var(--text-body); font-weight: var(--weight-strong); text-decoration: none; box-shadow: 0 10px 26px rgb(34 95 44 / .28); }
  .doc-fab a .lucide { width: 20px; height: 20px; }
  .doc-bar { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: rgb(255 255 255 / .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
  .doc-bar button { flex: 1 1 auto; justify-content: center; }
  .doc-bar-text { flex: 0 1 40%; }
  .doc-client-list { grid-template-columns: 1fr; max-height: 260px; }
  .doc-output-actions { grid-template-columns: 1fr 1fr; }
}
/* 文書画面では固定の操作バーと重ならない位置に通知を出す */
@media (max-width: 760px) { body:has(.doc-bar) #toasts { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); } body:has(.doc-bar) .toast { max-width: none; } }

/* 文書作成：検索の強化と一覧の絞り込み */
.doc-page mark { padding: 0 1px; border-radius: 3px; background: #fff1b8; color: inherit; }
.doc-kana-rows { display: flex; gap: 4px; margin: 0 0 8px; overflow-x: auto; scrollbar-width: none; }
.doc-kana-rows::-webkit-scrollbar { display: none; }
.doc-kana-rows button { flex: 0 0 auto; width: 40px; min-height: var(--control-height); padding: 0; border-radius: 10px; font-weight: var(--weight-medium); }
.doc-kana-rows button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: #fff; }
.doc-kana-rows button:disabled { opacity: .3; }
.doc-recent { display: grid; gap: 4px; margin-bottom: 8px; }
.doc-recent small { color: var(--muted); font-size: var(--text-dense); font-weight: var(--weight-strong); }
.doc-recent > div { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.doc-recent > div::-webkit-scrollbar { display: none; }
.doc-selected-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 56px; padding: 8px 8px 8px 12px; border: 1px solid #cfe0d1; border-radius: 12px; background: var(--brand-soft); }
.doc-selected-card > span:nth-child(2) { display: grid; gap: 1px; min-width: 0; }
.doc-selected-card strong { font-size: var(--text-label); overflow-wrap: anywhere; }
.doc-selected-card small { color: var(--muted); font-size: var(--text-small); }
.doc-selected-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; }
.doc-selected-mark .lucide { width: 16px; height: 16px; color: #fff; }
.doc-selected-card button { min-height: var(--control-height); }
.doc-step.is-done { border-color: #cfe0d1; }
.doc-step.is-done .doc-step-no { background: var(--brand-dark); }
.doc-step-no .lucide { width: 14px; height: 14px; color: #fff; }
.doc-list-tools { display: grid; gap: 8px; margin-bottom: 12px; }
.doc-list-tools .doc-search { margin: 0; }
.doc-status-filter button { min-height: 44px; border: 0; border-radius: 0; box-shadow: none; display: inline-flex; gap: 6px; font-weight: var(--weight-medium); }
.doc-status-filter button + button { border-left: 1px solid var(--line); }
.doc-status-filter button b { padding: 0 6px; border-radius: 999px; background: var(--surface-subtle); color: var(--muted); font-size: var(--text-dense); }
.doc-status-filter button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.doc-status-filter button[aria-pressed="true"] b { background: rgb(255 255 255 / .22); color: #fff; }
.doc-row-status { font-weight: var(--weight-strong); }
.doc-row-status.final { color: var(--brand-dark); }
.doc-duplicate { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid #a9c8ee; border-radius: 12px; background: var(--blue-soft); font-size: var(--text-small); }
.doc-duplicate .lucide { width: 18px; height: 18px; color: var(--blue); }
.doc-duplicate .doc-duplicate-note { grid-column: 2 / -1; color: var(--muted); font-size: var(--text-small); }
.doc-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: var(--text-small); font-weight: var(--weight-strong); }
.doc-progress.done { background: var(--brand-soft); color: var(--brand-dark); }
.doc-progress .lucide { width: 15px; height: 15px; }
.doc-progress button { margin-left: auto; min-height: 32px; padding: 4px 10px; font-size: var(--text-body); }

/* 文書作成：訪問予定から利用者を選ぶ */
.doc-visits { display: grid; gap: 6px; margin-bottom: 10px; padding: 10px 10px 8px; border: 1px solid #cfe0d1; border-radius: 12px; background: #f6faf6; }
.doc-visits-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.doc-visits-head > small { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-dark); font-size: var(--text-small); font-weight: var(--weight-strong); }
.doc-visits-head .lucide { width: 15px; height: 15px; }
.doc-visit-days { display: inline-flex; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.doc-visit-days button { display: inline-flex; flex-direction: column; align-items: center; gap: 0; min-width: 58px; min-height: 40px; padding: 4px 8px; border: 0; border-radius: 0; box-shadow: none; font-size: var(--text-small); font-weight: var(--weight-strong); line-height: 1.15; }
.doc-visit-days button small { font-size: var(--text-dense); font-weight: var(--weight-medium); color: var(--muted); }
.doc-visit-days button + button { border-left: 1px solid var(--line); }
.doc-visit-days button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.doc-visit-days button[aria-pressed="true"] small { color: rgb(255 255 255 / .8); }
.doc-visit-list { display: grid; gap: 6px; }
.doc-visit { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px 6px 10px; text-align: left; justify-content: start; justify-items: start; border-radius: 10px; }
.doc-visit b { min-width: 44px; color: var(--brand-dark); font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.doc-visit > span { display: grid; gap: 1px; min-width: 0; }
.doc-visit strong { font-size: var(--text-body); overflow-wrap: anywhere; }
.doc-visit small { color: var(--muted); font-size: var(--text-dense); }
.doc-visit .lucide { width: 16px; height: 16px; color: var(--muted); }
.doc-visit[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.doc-empty.compact { padding: 12px; font-size: var(--text-small); }

/* 操作履歴（監査ログ） */

/* ---- 実行結果（#/runs） ------------------------------------------------ */
a.button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--surface); font-size: var(--text-body); font-weight: var(--weight-medium); text-decoration: none; line-height: 1.3; }
a.button:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }

/* 日別の操作を同じツールバーへ集約。 */
.day-regenerate { display:flex; align-items:center; gap:8px; }
.day-regenerate > span { display:flex; text-align:left; gap:8px; }
.day-regenerate small { font-size:var(--text-small); }
.day-regenerate:disabled { opacity:.6; cursor:default; }
.day-regenerate.running > .lucide { animation:day-regenerate-spin 1s linear infinite; }
#jobbar progress { width:90px; height:6px; accent-color:var(--brand); }
.day-unassigned-dialog > .unassigned-list { padding:18px; overflow:auto; }
.month-overview-layout { display:block; }
@media (max-width:760px) { .day-page .board-scroll { display:block; } .day-page .board-legend { display:flex; } }
@media (prefers-reduced-motion:reduce) { .day-regenerate.running > .lucide { animation:none; } }

.job-progress-dialog { position:fixed; inset:0; margin:auto; width:min(420px,calc(100vw - 32px)); padding:28px; border:1px solid var(--line); border-radius:16px; background:var(--surface); color:var(--ink); box-shadow:var(--shadow); text-align:center; }
.job-progress-dialog::backdrop { background:rgb(20 34 24 / .4); }
.job-progress-dialog h2 { font-size:var(--text-heading); }
.job-progress-dialog progress { display:block; width:100%; height:12px; margin:20px 0; accent-color:var(--brand); }
.job-progress-dialog small { color:var(--muted); }

.day-confirm-switch { gap:9px; white-space:nowrap; }
.switch-track { display:block; width:42px; height:24px; padding:3px; border-radius:20px; background:#b5bdb7; transition:background .15s; }
.switch-track > span { display:block; width:18px; height:18px; border-radius:50%; background:white; box-shadow:0 1px 3px #0003; transition:transform .15s; }
.day-confirm-switch[aria-checked="true"] .switch-track { background:var(--brand); }
.day-confirm-switch[aria-checked="true"] .switch-track > span { transform:translateX(18px); }
.board-staff { position:sticky; left:0; z-index:6; display:flex; align-items:center; background:var(--surface); border-right:1px solid var(--line); }
.board-staff .board-name { position:static; flex:1; min-width:0; padding-left:5px; border-right:0; }
.staff-lock-button { flex:0 0 28px; width:28px; min-height:36px; padding:4px; margin-left:3px; border:0; background:transparent; box-shadow:none; }
.staff-lock-button .lucide { width:16px; height:16px; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track > span { transition:none; } }

/* 外部連携に必要な設定だけを縦に並べる。 */
.connection-policy { display: grid; gap: 12px; margin: 16px 0; }
.connection-policy > label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.connection-policy > button { justify-self: start; }

.header-assistant { white-space: nowrap; flex-shrink: 0; }

/* Read-only weekly list: fixed staff column, seven compact stacked day cells. */
.week-readonly-label { color: var(--muted, #68776e); font-size: var(--text-small); }
.week-list-scroll { overflow: auto; max-height: calc(100dvh - 220px); border: 1px solid #d8dfda; background: white; }
.week-list-table { width: 100%; min-width: 1160px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--text-body); }
.week-list-table th, .week-list-table td { border-right: 1px solid #d8dfda; border-bottom: 1px solid #d8dfda; padding: 12px; vertical-align: top; text-align: left; background: white; }
.week-list-table th:first-child { width: 164px; position: sticky; left: 0; z-index: 1; font-weight: var(--weight-strong); }
.week-list-table thead th { position: sticky; top: 0; z-index: 2; text-align: center; background: #f3f6f4; }
.week-list-table thead th:first-child { z-index: 3; text-align: left; }
.week-list-table thead .saturday { background: #e7effb; }
.week-list-table thead .sunday { background: #fae9ed; }
.week-visit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.week-visit:last-child { margin-bottom: 0; }
.week-visit-time { color: #3568a8; font-variant-numeric: tabular-nums; }
.week-visit strong { color: #24598f; font-weight: var(--weight-strong); }
.week-visit small, .week-empty { color: #738078; font-size: var(--text-small); }
@media (max-width: 760px) { .week-list-scroll { max-height: 70dvh; } .week-list-table th:first-child { width: 120px; } }

.master-delete-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 0}.master-delete-bar label{display:flex;align-items:center;gap:6px}.master-delete-bar input,[data-client-select]{width:18px;height:18px;accent-color:var(--green,#307d3e)}.master-row-action.danger{margin-left:8px;color:#a52a2a}

/* Direct manual scheduling uses the shared form controls with explicit rows. */
.manual-schedule-modal #manual-form > label,
.manual-schedule-modal #manual-form details > label,
.manual-schedule-modal #manual-assignment-fields > label,
.manual-schedule-modal #manual-swap-fields > label { display:grid; gap:6px; margin:12px 0; }
.manual-schedule-modal #manual-form input:not([type="checkbox"]),
.manual-schedule-modal #manual-form select,
.manual-schedule-modal #manual-form textarea { width:100%; min-width:0; box-sizing:border-box; }
.manual-schedule-modal #manual-form label:has(input[type="checkbox"]) { display:flex; align-items:center; }
.manual-schedule-modal #manual-form .actions { flex-wrap:wrap; }
.manual-schedule-modal #manual-form details { margin:16px 0; }

/* Google sign-in: a single, recognizable entry point. */
.auth-card .google-signin { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; min-height:44px; padding:10px 16px; border:1px solid #747775; border-radius:4px; background:#fff; color:#1f1f1f; font-size:14px; font-weight:500; }
.auth-card .google-signin:hover { background:#f5f7f8; color:#1f1f1f; }
.auth-card .google-signin img { flex:none; }

.day-view-switch { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; font-size:var(--text-small); cursor:pointer; }
.day-view-switch input { appearance:none; flex:none; width:40px; height:24px; min-height:24px; padding:0; margin:0; border:0; border-radius:12px; background:#a9b2ac; position:relative; cursor:pointer; }
.day-view-switch input::before { content:""; position:absolute; width:18px; height:18px; top:3px; left:3px; border-radius:50%; background:white; transition:transform .15s; }
.day-view-switch input:checked { background:var(--brand); }
.day-view-switch input:checked::before { transform:translateX(16px); }
.day-view-switch input:focus-visible { outline:2px solid var(--brand-dark); outline-offset:3px; }
.square-timeline .travel-leg-label { overflow:visible; }



#week-unassigned-control { display:flex; width:max-content; margin:0 0 8px auto; }
#week-unassigned-control[hidden], #week-unassigned-row[hidden] { display:none; }

/* Keep the unassigned control in the existing weekly toolbar. */
.day-week-page { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:12px; }
.day-week-page > .day-toolbar { grid-column:1; grid-row:1; min-width:0; }
.day-week-page > #week-unassigned-control { grid-column:2; grid-row:1; align-self:center; margin:0; }
.day-week-page > #week-content { grid-column:1 / -1; min-width:0; }
@media(max-width:760px) {
 .day-week-page { display:block; }
 .day-week-page > #week-unassigned-control { margin:-4px 0 8px auto; }
}

button.week-visit { width:100%; padding:3px 4px; border:0; border-radius:4px; background:transparent; box-shadow:none; text-align:left; font:inherit; cursor:pointer; }
button.week-visit:hover { background:#eef5ef; }
button.week-visit:focus-visible { outline:2px solid #307c3a; outline-offset:2px; }

.header-inquiry { flex-shrink: 0; white-space: nowrap; gap: 6px; padding-inline: 10px; color: var(--brand-dark); }
.header-inquiry .lucide { width: 18px; height: 18px; flex-shrink: 0; }
.inquiry-form { display: grid; gap: 14px; }
.inquiry-form label { display: grid; gap: 6px; }
.inquiry-form :is(input, select, textarea) { width: 100%; min-width: 0; }
.inquiry-form textarea { resize: vertical; }
.inquiry-form .actions { flex-wrap: wrap; }
.inquiry-status { margin: 0; }
.inquiry-list article { padding: 16px 0; border-bottom: 1px solid var(--line); }
.inquiry-list small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.inquiry-list p { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .header-inquiry { font-size: var(--text-small); padding-inline: 8px; } }

#inquiry-attachment img, .inquiry-list img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; margin-block: 8px; border: 1px solid var(--line); border-radius: 8px; }
#inquiry-attachment[hidden], .inquiry-list img[hidden] { display: none; }
.inquiry-form input[type="file"] { padding: 8px; }
.inquiry-context-toggle {display:flex!important;align-items:center;gap:8px;}
.inquiry-context-toggle input {width:auto;}
.inquiry-context {white-space:pre-wrap;overflow-wrap:anywhere;max-height:280px;overflow:auto;font-size:12px;background:var(--surface-subtle);padding:12px;}
.inquiry-evidence[hidden] {display:none;}
