:root {
  --bg: #f4f6fa;
  --panel: #fff;
  --panel-strong: #f9fafc;
  --line: #d9e1ec;
  --line-strong: #aeb8c8;
  --text: #10192b;
  --muted: #667085;
  --soft: #f1f4f8;
  --green: #2f9e58;
  --yellow: #e6a400;
  --blue: #0e1b33;
  --violet: #667085;
  --black: #0b1220;
  --red: #ff2431;
  --red-deep: #d81724;
  --red-soft: #fff1f2;
  --cyan: var(--red);
  --cyan-deep: var(--red-deep);
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
* {
  box-sizing: border-box;
}

.operations-dialog { width: min(1040px, calc(100vw - 26px)); max-height: calc(100dvh - 28px); }
.operations-tabs { display: flex; margin-bottom: 16px; }
.operations-tabs button { flex: 1; min-height: 44px; }
.operations-message { color: var(--text); min-height: 1.5em; line-height: 1.6; }
.operations-list > * { border-bottom: 1px solid var(--line); padding: 14px 0; }
.operations-list summary { cursor: pointer; line-height: 1.6; }
.operations-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.operations-row > div { min-width: 0; overflow-wrap: anywhere; }
.operations-row button { flex-shrink: 0; min-height: 44px; }
.operations-detail { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px 14px; margin: 14px 0 0; }
.operations-detail dt { font-weight: 700; }
.operations-detail dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.operations-detail .history-before { color: var(--muted); }
.report-toolbar { display: flex; gap: 16px; align-items: end; justify-content: space-between; }
.report-toolbar label, .cost-form label { display: grid; gap: 6px; font-weight: 600; }
.report-toolbar input, .cost-form input, .cost-form select { width: 100%; min-height: 44px; }
.report-basis { color: var(--muted); font-size: 13px; line-height: 1.7; }
.report-summary { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 16px 0; border-block: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.report-filter { display: flex; align-items: center; gap: 8px; margin-top: 16px; min-height: 32px; }
.report-filter input { width: 18px; height: 18px; accent-color: var(--red-deep); }
.report-scroll-hint { display: none; }
.report-table-scroll { overflow: auto; margin-top: 16px; max-height: 440px; }
.report-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.report-table th, .report-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.report-table th:first-child, .report-table td:first-child { text-align: left; white-space: normal; min-width: 190px; max-width: 340px; }
.report-table th { background: var(--panel-strong); font-size: 13px; position: sticky; top: 0; }
.report-table td small { display: block; color: var(--muted); margin-top: 4px; }
.report-costs { margin-top: 24px; }
.report-costs > summary { font-weight: 700; cursor: pointer; padding-block: 10px; }
.cost-form { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-top: 12px; align-items: end; }
.cost-form label:nth-child(4) { grid-column: span 2; }
.report-table-scroll:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
@media (max-width: 720px) {
  .operations-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .operations-dialog .dialog-form { padding: 16px; }
  .operations-dialog .dialog-head h3 { font-size: 20px; }
  .cost-form { grid-template-columns: 1fr 1fr; }
  .cost-form label:first-child, .cost-form label:nth-child(4), .cost-form button { grid-column: 1 / -1; }
  .operations-detail { grid-template-columns: 1fr; gap: 4px; }
  .operations-detail dd { margin-bottom: 12px; }
  .report-summary { gap: 8px 18px; font-size: 14px; }
  .report-scroll-hint { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; }
  .backup-actions { flex-wrap: wrap; }
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body::before {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 100%;
  height: 5px;
  pointer-events: none;
  content: "";
  background: var(--red);
}

.launch-warning {
  position: relative;
  z-index: 40;
  padding: 10px 16px;
  border-bottom: 1px solid #f0b8bd;
  background: #fff4f5;
  color: #86101a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(255, 36, 49, 0.35);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-areas: "sidebar main";
  min-height: 100vh;
}

.sidebar {
  grid-area: sidebar;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 18px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  letter-spacing: 0;
}

.brand p,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 360px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.auth-panel strong {
  display: block;
  overflow: hidden;
  max-width: 150px;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.auth-actions button {
  min-height: 32px;
  white-space: nowrap;
}

.quick-panel,
.inspector {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 12px;
}

.meta,
.small {
  color: var(--muted);
  font-size: 12px;
}

.search-results,
.equipment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mini-card,
.equipment-row,
.search-row,
.warning-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.mini-card {
  border-left: 4px solid var(--red);
}

.equipment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.equipment-row button {
  flex: 0 0 auto;
}

.equipment-management {
  padding: 18px;
}

.equipment-management-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.equipment-management-head h3 {
  margin: 2px 0 0;
  font-size: 22px;
}

.equipment-management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.equipment-management-grid .equipment-row {
  min-height: 76px;
}

.access-gate {
  display: grid;
  min-height: 320px;
  place-content: center;
  gap: 8px;
  padding: 30px;
  text-align: center;
}

.access-gate strong {
  color: var(--red);
  font-size: 24px;
}

.access-gate p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
}

.field-label,
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 36, 49, 0.12);
  outline: none;
}

.money-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 72px;
  padding: 0 10px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
}

.toggle-button[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--red-deep);
  color: #fff;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.main {
  grid-area: main;
  min-width: 0;
  padding: 18px 20px;
}

.topbar {
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.topbar-brand {
  display: none;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar h2 {
  font-size: 26px;
  font-weight: 850;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-right {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.widget-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-download-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.widget-version {
  margin-left: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.widget-sync-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
}

.widget-label-mobile {
  display: none;
}

.icon-button,
.text-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 36px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  line-height: 1.2;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.text-button {
  min-height: 30px;
  color: var(--red);
  background: var(--red-soft);
}

.primary-button {
  border-color: var(--red-deep);
  background: var(--red-deep);
  color: #fff;
  font-weight: 700;
}

.secondary-button {
  background: #f8fafc;
}

.danger-button {
  border-color: #ffd0d4;
  color: var(--red);
  background: var(--red-soft);
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 0 12px;
  line-height: 1.2;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--red-deep);
  color: #fff;
  font-weight: 800;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.bottom-panels {
  margin-top: 14px;
}

.bottom-panels .quick-panel {
  margin-bottom: 0;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  border-left: 4px solid var(--red);
}

.status-card-alert {
  border-color: #f0b8bd;
  border-left-color: var(--red-deep);
  background: var(--red-soft);
}

.status-card-unread {
  border-color: #d8b4fe;
  border-left-color: #9333ea;
  background: #faf5ff;
}

.status-card-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.status-card-button:hover {
  border-color: var(--red-deep);
  box-shadow: 0 4px 14px rgba(150, 20, 35, 0.12);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-areas: "calendar inspector";
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.workspace.equipment-workspace {
  grid-template-columns: 1fr;
  grid-template-areas: "calendar";
}

.workspace.equipment-workspace .inspector {
  display: none;
}

.calendar-view {
  grid-area: calendar;
  min-width: 0;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  -webkit-user-select: none;
  user-select: none;
}

.inspector {
  grid-area: inspector;
}

.inspector summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.inspector summary::-webkit-details-marker {
  display: none;
}

.inspector summary::after {
  display: grid;
  flex: 0 0 20px;
  place-items: center;
  width: 20px;
  height: 20px;
  content: "+";
  color: var(--red-deep);
  font-size: 20px;
  line-height: 1;
}

.inspector[open] summary::after {
  content: "−";
}

.summary-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.inspector-content {
  margin-top: 14px;
}

.inspector-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.search-panel-title {
  margin-bottom: 0;
}

.search-panel-title > label,
.search-actions {
  flex: 0 0 auto;
}

.search-panel-title > input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  min-height: 44px;
  font-weight: 400;
}

.search-actions {
  position: relative;
}

.search-actions > summary {
  min-height: 44px;
  padding: 0 8px;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.search-actions > summary::-webkit-details-marker {
  display: none;
}

.search-actions[open] > summary svg {
  transform: rotate(180deg);
}

.search-actions .backup-actions {
  position: absolute;
  z-index: 10;
  bottom: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 4px;
  min-width: 160px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search-actions .backup-actions .text-button {
  justify-content: flex-start;
  min-height: 44px;
  color: var(--text);
  background: var(--panel);
}

.search-actions .backup-actions .text-button:hover {
  background: var(--panel-strong);
}

.backup-actions,
.import-failure-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.import-failure-dialog {
  width: min(760px, calc(100vw - 28px));
}

.import-failure-list {
  display: grid;
  gap: 12px;
  max-height: 62vh;
  overflow: auto;
}

.import-failure-item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.import-failure-item pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.calendar-grid {
  display: grid;
  width: 100%;
  overflow: visible;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
}

.calendar-local-toolbar {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.calendar-local-toolbar strong {
  text-align: center;
  font-size: 18px;
}

.day-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.weekday,
.day-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.weekday {
  padding: 10px;
  background: #0e1b33;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.weekday.holiday {
  color: #ff6574;
}

.weekday.saturday {
  color: #72a7ff;
}

.day-cell {
  position: relative;
  z-index: 1;
  min-height: 128px;
  padding: 8px;
  background: #fff;
  overflow: visible;
}

.day-z-20 { z-index: 20; }
.day-z-19 { z-index: 19; }
.day-z-18 { z-index: 18; }
.day-z-17 { z-index: 17; }
.day-z-16 { z-index: 16; }
.day-z-15 { z-index: 15; }
.day-z-14 { z-index: 14; }

.day-cell.muted-day {
  background: #f8fafc;
  color: #98a2b3;
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13px;
}

.day-cell.holiday .day-head > span:first-child,
.schedule-day.holiday strong,
.schedule-day.holiday span {
  color: var(--red);
}

.day-cell.saturday .day-head > span:first-child,
.schedule-day.saturday strong,
.schedule-day.saturday span {
  color: #2563eb;
}

.day-head .today-dot {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: var(--red-deep);
  box-shadow: 0 0 0 3px rgba(255, 36, 49, 0.12);
}

.day-cell .day-head .today-dot {
  color: #fff;
}

.reservation-card {
  border: 0;
  border-left: 5px solid var(--blue);
  border-radius: 6px;
  width: 100%;
  margin-bottom: 6px;
  padding: 7px 8px;
  color: var(--text);
  background: #f8fafc;
  text-align: left;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.reservation-card-span {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 20;
  min-height: 34px;
  max-width: none;
  border: 1px solid var(--status-accent, var(--line-strong));
  border-left-width: 5px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.reservation-card-compact.reservation-span-2 { width: calc(200% + 17px); }
.reservation-card-compact.reservation-span-3 { width: calc(300% + 34px); }
.reservation-card-compact.reservation-span-4 { width: calc(400% + 51px); }
.reservation-card-compact.reservation-span-5 { width: calc(500% + 68px); }
.reservation-card-compact.reservation-span-6 { width: calc(600% + 85px); }
.reservation-card-compact.reservation-span-7 { width: calc(700% + 102px); }

.reservation-card strong,
.reservation-card span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reservation-card span {
  color: var(--muted);
  font-size: 12px;
}

.reservation-card-span strong,
.reservation-card-span span {
  display: inline;
  min-width: 0;
}

.reservation-card-span strong {
  flex: 0 0 auto;
}

.reservation-card-span span {
  flex: 1 1 auto;
}

.reservation-card-span span:last-child {
  flex: 0 0 auto;
}

.reservation-card-compact {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  border-left-width: 4px;
  margin-bottom: 4px;
  padding: 4px 5px;
  width: 100%;
}

.reservation-card-compact strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.15;
}

.reservation-card-list {
  display: grid;
  grid-template-columns: minmax(82px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-bottom: 6px;
  padding: 7px 9px;
}

.reservation-card-list strong,
.reservation-card-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reservation-card-list span:last-child {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
}

.reservation-card-placeholder {
  visibility: hidden;
  min-height: 24px;
  margin-bottom: 4px;
  pointer-events: none;
}

.status-menu {
  position: fixed;
  z-index: 1000;
  width: min(240px, calc(100vw - 20px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

html.restoring-reservation body::after {
  content: "보고 있던 화면 여는 중…";
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.status-menu[hidden] {
  display: none;
}

.status-menu-title {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-menu button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.status-menu button:hover,
.status-menu button.active {
  background: var(--red-soft);
}

.status-menu button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-menu button.status-menu-delete {
  grid-template-columns: minmax(0, 1fr);
  color: #b10f1b;
  text-align: center;
}

.app-confirm-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(336px, calc(100vw - 40px));
  height: auto;
  max-height: calc(100vh - 40px);
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
  transform: translate(-50%, -50%);
}

.app-confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.34);
}

.app-confirm {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.24);
}

.app-confirm-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--red-deep);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.app-confirm-body h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.app-confirm-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.app-confirm-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.app-confirm-actions button {
  min-width: 78px;
  min-height: 32px;
}

.status-ntfy-unread {
  --status-accent: #8b3fc7;
  border-left-color: #a855f7;
  background: #f7eaff;
}

.status-inquiry {
  --status-accent: #c88d00;
  border-left-color: var(--yellow);
  background: #fff8e6;
}

.reservation-card-conflict {
  border-color: var(--red-deep);
  box-shadow: inset 0 0 0 2px rgba(201, 28, 40, 0.2);
}

.status-confirmed {
  --status-accent: #238146;
  border-left-color: var(--green);
  background: #ecfdf3;
}

.status-rented {
  --status-accent: #285ea8;
  border-left-color: var(--blue);
  background: #eef2f8;
}

.status-returned {
  --status-accent: #8b4513;
  border-left-color: #8b4513;
  color: #8b4513;
  background: #fff7ed;
}

.status-return-issue {
  --status-accent: #006d80;
  border-left-color: #007f94;
  background: #ecfeff;
}

.status-complete {
  --status-accent: #344054;
  border-left-color: var(--black);
  background: #f8fafc;
}

.status-cancel-fee-30,
.status-cancel-fee-50 {
  --status-accent: #c56a00;
  border-left-color: #e67e00;
  background: #fff3df;
}

.status-cancelled {
  --status-accent: #c91c28;
  border-left-color: var(--red);
  background: #fff1f2;
  opacity: 0.68;
}

.reservation-card-span.status-ntfy-unread { background: #efd8ff; }
.reservation-card-span.status-inquiry { background: #fff0bd; }
.reservation-card-span.status-confirmed { background: #d8f7e3; }
.reservation-card-span.status-rented { background: #dce9fb; }
.reservation-card-span.status-returned { background: #f3e5d8; }
.reservation-card-span.status-return-issue { background: #a5edf5; }
.reservation-card-span.status-complete { background: #e7eaf0; }
.reservation-card-span.status-cancel-fee-30,
.reservation-card-span.status-cancel-fee-50 { background: #ffe5b8; }
.reservation-card-span.status-cancelled { background: #ffdce0; }

.status-menu-dot { display: inline-block; flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%; background: var(--status-accent); }

.reservation-status-dot { display: inline-block; width: 0.75em; height: 0.75em; border-radius: 50%; background: var(--status-accent); vertical-align: baseline; }

.week-view,
.day-view {
  display: grid;
  grid-template-columns: 76px repeat(7, minmax(105px, 1fr));
}

.day-view {
  grid-template-columns: 76px minmax(240px, 1fr);
}

.time-label,
.time-slot {
  min-height: 56px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px;
}

.time-label {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
}

.schedule-view {
  display: grid;
}

.schedule-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.schedule-row:last-child {
  border-bottom: 0;
}

.schedule-day {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.schedule-day strong {
  font-size: 13px;
}

.schedule-day span,
.schedule-empty {
  color: var(--muted);
  font-size: 12px;
}

.schedule-items {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 58px;
  padding: 8px;
}

.schedule-empty {
  padding: 8px;
}

.timeline {
  overflow-x: auto;
}

.timeline-grid {
  display: grid;
  grid-template-columns: 180px repeat(7, 150px);
  min-width: 1230px;
}

.timeline-head,
.timeline-equipment,
.timeline-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
  padding: 8px;
  background: #fff;
}

.timeline-head,
.timeline-equipment {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fafc;
  font-weight: 700;
}

.timeline-head {
  position: static;
  color: var(--muted);
  font-size: 12px;
}

.timeline-cell {
  position: relative;
}

.timeline-bar {
  position: absolute;
  top: 12px;
  left: 8px;
  right: 8px;
  min-height: 30px;
  border-radius: 6px;
  padding: 6px 8px;
  color: #fff;
  background: var(--red-deep);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.conflict-bar {
  background: var(--red-deep);
}

.inquiry-result {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.quick-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.quick-save-row select {
  min-width: 0;
}

.check-pass,
.check-warn,
.check-fail {
  border-radius: 8px;
  padding: 10px;
}

.check-pass {
  border: 1px solid rgba(39, 209, 130, 0.45);
  background: #ecfdf3;
}

.check-warn {
  border: 1px solid rgba(243, 189, 56, 0.48);
  background: #fff8e6;
}

.warning-detail-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  margin-top: 8px;
  font-size: 12px;
}

.warning-detail-grid span {
  color: var(--muted);
}

.warning-detail-grid strong {
  min-width: 0;
  color: var(--text);
  white-space: normal;
}

.check-fail {
  border: 1px solid #ffd0d4;
  background: #fff1f2;
}

dialog {
  width: min(860px, calc(100vw - 26px));
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.32);
}

.dialog-form {
  padding: 18px;
}

.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dialog-head {
  margin-bottom: 16px;
}

.dialog-head h3 {
  margin: 0;
  font-size: 20px;
}

.dialog-actions {
  margin-top: 16px;
}

.autosave-status {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-message {
  margin-top: 14px;
  border: 1px solid #ffb9bf;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--red-soft);
  color: #a80f1b;
  font-size: 13px;
  font-weight: 750;
}

.form-message[hidden] {
  display: none;
}

.reservation-tools {
  margin-top: 14px;
  border: 1px solid #f0c9cc;
  border-radius: 8px;
  padding: 12px;
  background: #fff8f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reservation-tools[hidden] {
  display: none;
}

.reservation-tools > div:first-child {
  display: grid;
  gap: 3px;
}

.reservation-tools span {
  color: var(--muted);
  font-size: 12px;
}

.reservation-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#reservationDialog {
  width: min(960px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

#reservationForm {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}

#reservationDialog .reservation-dialog-head {
  flex: 0 0 auto;
  margin: 0;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: inset 0 5px 0 var(--red);
}

#reservationDialog .reservation-dialog-head h3 {
  margin-top: 2px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

#reservationDialog .reservation-dialog-head .icon-button {
  width: 40px;
  min-height: 40px;
  border-radius: 12px;
  padding-bottom: 2px;
  background: var(--panel);
}

.reservation-dialog-body {
  display: grid;
  min-height: 0;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}

#reservationDialog .reservation-tools {
  align-items: center;
  margin: 0;
  border-color: var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

#reservationDialog .reservation-tools > div:first-child {
  flex: 0 0 auto;
}

#reservationDialog .reservation-tools strong {
  color: var(--text);
  font-size: 15px;
}

#reservationDialog .reservation-tool-actions {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

#reservationDialog .reservation-tool-actions button {
  min-height: 42px;
  border-radius: 10px;
  white-space: nowrap;
}

.reservation-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.035);
}

.reservation-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.reservation-section-head > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.reservation-section-head strong {
  color: var(--text);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.reservation-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.reservation-status-field {
  flex: 0 0 220px;
  color: var(--muted);
}

.reservation-overview .reservation-section-head {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.reservation-overview .reservation-availability {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.reservation-overview .reservation-availability[data-available="true"] {
  color: #166534;
  background: #dcfce7;
}

.reservation-overview .reservation-availability[data-available="false"] {
  color: #b91c1c;
  background: #fee2e2;
}

#reservationOverviewCount {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.reservation-overview-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 14px;
}

.reservation-overview-dates dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.reservation-overview-dates dd {
  margin: 0;
}

.reservation-overview-dates time {
  display: grid;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.reservation-overview-dates time span {
  font-size: 13px;
}

.reservation-overview-dates time strong {
  font-size: 24px;
  line-height: 1.2;
}

.reservation-overview-equipment {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.reservation-overview-equipment li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
}

.reservation-overview-equipment li span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reservation-overview-equipment li strong {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.reservation-overview-alarms {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.reservation-overview-alarm-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reservation-overview-alarm-buttons button {
  display: grid;
  place-content: center;
  gap: 3px;
  min-height: 56px;
  font-size: 14px;
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.reservation-overview-alarm-buttons button small {
  font-size: 11px;
  font-weight: 500;
}

.reservation-overview-alarm-buttons button[data-alarm-state="on"] {
  color: #166534;
  border-color: #86efac;
  background: #dcfce7;
}

.reservation-overview-alarm-buttons button[data-alarm-state="pending"] {
  color: #475467;
  border-color: var(--line);
  background: var(--soft);
}

.reservation-section input,
.reservation-section select,
.reservation-section textarea {
  min-height: 42px;
  border-radius: 10px;
  background: #fff;
}

.reservation-section input[readonly] {
  background: var(--soft);
  color: var(--muted);
}

.reservation-customer-grid {
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reservation-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

#reservationDialog .reservation-history-button {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

#reservationDialog .reservation-history-button:hover {
  color: var(--text);
  background: var(--panel-strong);
}

.reservation-history-button[hidden] {
  display: none;
}

.customer-name-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.customer-name-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.required-documents-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.required-documents-toggle[aria-pressed="true"] {
  border-color: #78c691;
  color: #176537;
  background: #eaf8ef;
}

.required-documents-notice {
  display: flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #9cd6af;
  border-radius: 8px;
  padding: 5px 7px;
  background: #eaf8ef;
  color: #176537;
  font-size: 11px;
  font-weight: 750;
}

.required-documents-notice[data-state="error"] {
  border-color: #e7b37c;
  background: #fff5e9;
  color: #934815;
}

.required-documents-notice[hidden] {
  display: none;
}

.reservation-schedule-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reservation-money-grid {
  grid-template-columns: 0.9fr 1.4fr 0.8fr 1.35fr;
}

.reservation-money-grid .toggle-button {
  min-height: 42px;
  border-radius: 10px;
}

.reservation-memo-section .wide-label {
  margin-top: 0;
}

.reservation-memo-section textarea {
  min-height: 180px;
  line-height: 1.55;
}

#reservationDialog .form-message {
  margin: 0;
  border-radius: 12px;
}

#reservationDialog .availability-box {
  margin: 12px 0 0;
}

#reservationDialog .availability-box > * {
  border-radius: 12px;
}

.equipment-selection-summary {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--soft);
  color: var(--text) !important;
  white-space: nowrap;
}

#reservationDialog .equipment-tools {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#reservationDialog .equipment-tools input {
  min-height: 44px;
  flex: 1 1 160px;
  width: 0;
}

#reservationDialog .equipment-picker {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

#reservationDialog .pick-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
  border-radius: 11px;
  padding: 9px 10px;
  background: var(--panel);
}

.quantity-stepper { display: flex; align-items: center; gap: 2px; }
.quantity-stepper button { width: 40px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--text); font-size: 22px; }
#reservationDialog .quantity-stepper input { width: 44px; min-height: 44px; padding: 4px; text-align: center; appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.reservation-discount-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.reservation-discount-row label { font-size: 13px; font-weight: 700; }
.reservation-discount-row input { width: 76px; min-height: 44px; }
.reservation-discount-row output { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.reservation-discount-reason { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 700; }
.reservation-discount-reason input { width: 100%; min-height: 44px; }
.applied-discount-summary { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; line-height: 1.7; overflow-wrap: anywhere; }

#reservationDialog .dialog-actions {
  position: static;
  z-index: 5;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}

#reservationDialog .dialog-actions button {
  min-height: 44px;
  border-radius: 11px;
}

#reservationDialog .dialog-actions .danger-button {
  min-width: 88px;
}

#reservationDialog .dialog-actions .secondary-button {
  min-width: 112px;
}

#reservationDialog .dialog-actions .primary-button {
  min-width: 156px;
}

@media (max-width: 900px) {
  .reservation-customer-grid,
  .reservation-money-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.alarm-settings-dialog {
  width: min(460px, calc(100vw - 28px));
}

.alarm-preferences-dialog { width: min(440px, calc(100vw - 28px)); height: fit-content; margin: auto; border-radius: 8px; max-height: calc(100dvh - 24px); }
.alarm-preferences-dialog .dialog-form { min-height: 0; padding: 24px; }
.alarm-preferences-dialog .dialog-head { margin-bottom: 16px; }
.alarm-volume-label { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; font-weight: 700; }
.alarm-volume-label output { font-variant-numeric: tabular-nums; }
#alarmVolume { display: block; width: 100%; min-height: 44px; margin: 0; padding: 0; accent-color: var(--red-deep); cursor: pointer; }
.alarm-vibration-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; margin: 18px 0; border-block: 1px solid var(--line); font-weight: 700; cursor: pointer; }
.alarm-vibration-option input { width: 22px; height: 22px; accent-color: var(--red-deep); }
.alarm-preferences-button { flex: 0 0 44px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.alarm-preferences-dialog .alarm-dialog-actions { margin-top: 20px; }
@media (max-width: 720px) {
  .topbar .alarm-preferences-button { width: 36px; height: 36px; flex-basis: 36px; }
  .alarm-preferences-dialog { max-height: calc(100dvh - 24px); }
  .alarm-preferences-dialog .dialog-form { padding: 20px; }
}

.alarm-settings-dialog .dialog-form {
  min-height: 0;
}

.alarm-pickup-summary {
  margin: 2px 0 18px;
  border-radius: 8px;
  padding: 12px;
  background: #fff3f4;
  color: var(--text);
  font-weight: 750;
}

.alarm-option-head,
.alarm-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alarm-options {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.alarm-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--panel);
  font-weight: 750;
  cursor: pointer;
}

.alarm-options input {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
}

.alarm-helper {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.alarm-app-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  text-decoration: none;
}

.alarm-dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.copy-phrases-dialog {
  width: min(680px, calc(100vw - 28px));
}

.copy-phrases-dialog {
  box-shadow: inset 0 5px 0 var(--red), var(--shadow);
}

.copy-phrases-dialog .dialog-form {
  padding-top: 0;
}

.copy-phrases-dialog .dialog-head.compact-work-header {
  position: sticky;
  top: 0;
  z-index: 6;
  box-sizing: border-box;
  height: 70px;
  min-height: 70px;
  margin-bottom: 16px;
  margin-inline: -18px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.copy-phrases-dialog .dialog-head.compact-work-header > div:first-child {
  min-width: 0;
}

.copy-phrases-dialog .dialog-head.compact-work-header > .icon-button {
  display: inline-grid;
  flex: 0 0 36px;
  align-self: center;
  place-items: center;
  width: 36px;
  min-height: 36px;
  margin: 0;
}

@media (max-width: 720px) {
  .copy-phrases-dialog .dialog-head.compact-work-header {
    height: 75px;
    min-height: 75px;
    margin-inline: -14px;
    padding-inline: 14px;
    border-top: 5px solid var(--red);
  }
}

.copy-phrase-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.copy-phrase-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.copy-phrase-card textarea {
  min-height: 108px;
  resize: vertical;
}

.copy-phrase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.copy-phrase-actions a {
  text-decoration: none;
  white-space: nowrap;
}

.copy-phrase-actions .checkin-button {
  width: 100%;
}

.checkin-shortcut {
  justify-content: flex-end;
}


.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.wide-label {
  margin-top: 14px;
}

.equipment-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.equipment-tools {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
}

.equipment-tools span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.pick-row[hidden] {
  display: none;
}

.pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.pick-row input {
  padding: 7px;
}

.availability-box {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.reservation-change-toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 8px;
  background: rgba(16, 25, 43, 0.86);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
  animation: reservation-change-toast 2.4s ease both;
}

.reservation-change-toast[hidden] { display: none; }

@keyframes reservation-change-toast {
  0% { opacity: 0; }
  10%, 80% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reservation-change-toast { animation: none; }
}

.today-dialog {
  width: min(720px, calc(100vw - 26px));
  max-height: calc(100dvh - 26px);
  overflow: hidden;
}

.today-dialog .dialog-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 31px);
  padding-bottom: 8px;
  overflow: hidden;
}

.today-dialog .dialog-head { flex-shrink: 0; }

.today-schedule-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.today-date-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  padding-top: 10px;
  background: var(--panel);
  flex-shrink: 0;
}

.today-date-navigation button {
  min-height: 44px;
  padding-inline: 10px;
}

.pending-widget-alarms {
  margin-block: 18px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pending-widget-alarms-head,
.pending-widget-alarms-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pending-widget-alarms button {
  min-height: 40px;
  padding: 6px 10px;
  font-size: 12px;
}

.pending-widget-alarms-head > strong,
.pending-widget-alarms-head > div {
  flex-shrink: 0;
}

.pending-alarm-inline-status {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}

.pending-widget-alarm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}

.pending-alarm-group h4 {
  margin: 12px 0 4px;
  color: var(--text);
  font-size: 13px;
}

.pending-alarm-group-other {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--line-strong);
}

.pending-widget-alarm-row strong,
.pending-widget-alarm-row span,
.pending-widget-alarm-row small {
  display: block;
  overflow-wrap: anywhere;
}

.pending-widget-alarm-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.pending-widget-alarm-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pending-widget-alarm-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 5px 3px;
}

.pending-widget-alarm-actions button span:first-child { font-weight: 700; }
.pending-widget-alarm-actions button span + span { margin-top: 2px; font-size: 11px; }

.today-window-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.today-window-summary div {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel-strong);
}

.today-window-summary strong {
  display: block;
  color: var(--red);
  font-size: 22px;
  line-height: 1;
}

.today-window-summary span {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.today-window-list {
  display: grid;
  gap: 8px;
}

.today-window-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.today-window-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  font-size: 14px;
  color: #fff;
  background: #0e1b33;
}

.today-window-section-title span {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.82;
}

.today-window-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.today-window-row:hover {
  background: var(--red-soft);
}

.today-row-time {
  color: var(--red);
  font-size: 18px;
  font-weight: 850;
}

.today-row-main {
  min-width: 0;
}

.today-row-main strong,
.today-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-row-main span,
.today-row-status,
.today-empty {
  color: var(--muted);
  font-size: 12px;
}

.today-row-status {
  justify-self: end;
  white-space: nowrap;
}

.today-empty {
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #fff;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "main";
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "inspector"
      "calendar";
  }
}

@media (max-width: 720px) {
  .reservation-tools,
  .reservation-tool-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body {
    background: var(--bg);
    padding-bottom: 72px;
  }

  .app-shell {
    padding-top: 100px;
  }

  .main,
  .sidebar {
    padding: 12px;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    position: fixed;
    top: 5px;
    right: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    min-height: 54px;
    margin: 0;
    gap: 6px;
    padding: 7px 10px 8px;
    border-bottom: 1px solid var(--line);
    background: rgba(244, 246, 250, 0.98);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
  }

  .file-launch .topbar {
    top: 43px;
  }

  .sidebar .brand {
    display: none;
  }

  .topbar-brand {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    gap: 7px;
    max-width: 150px;
  }

  .topbar-brand .brand-mark {
    width: 34px;
    height: 34px;
    margin: 0;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  }

  .topbar-brand strong,
  .topbar-brand span {
    display: block;
    overflow: hidden;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-brand strong {
    font-size: 15px;
    font-weight: 850;
  }

  .topbar-brand span {
    color: var(--muted);
    font-size: 10px;
  }

  .topbar h2 {
    font-size: clamp(17px, 5vw, 20px);
    line-height: 1.05;
    white-space: nowrap;
  }

  .topbar > div:not(.topbar-brand):first-of-type {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    padding-right: 8px;
  }

  .range-row {
    gap: 6px;
    min-width: 0;
  }

  .topbar .eyebrow {
    display: none;
  }

  .top-actions {
    width: 100%;
    gap: 5px;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .widget-actions {
    flex: 0 0 auto;
    gap: 2px;
  }

  .widget-actions .secondary-button {
    width: auto;
    min-height: 34px;
    padding: 0 6px;
    font-size: 9px;
    white-space: nowrap;
  }

  .widget-label-full {
    display: none;
  }

  .widget-label-mobile {
    display: inline;
  }

  .widget-version {
    margin-left: 2px;
    font-size: 6px;
  }

  .widget-sync-status {
    display: none;
  }

  .topbar-right {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(116px, 136px);
    width: 100%;
    align-items: start;
    justify-items: stretch;
    gap: 5px;
  }

  .topbar-right:not(:has(.auth-actions button:not([hidden]))) {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-right:not(:has(.auth-actions button:not([hidden]))) .auth-panel {
    display: none;
  }

  .topbar .icon-button {
    width: 34px;
    min-height: 42px;
    font-size: 18px;
  }

  .auth-panel {
    position: static;
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .auth-panel strong {
    display: none;
  }

  .auth-panel .meta {
    display: none;
  }

  .auth-actions {
    display: flex;
    gap: 0;
  }

  .auth-actions button {
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .backup-actions {
    gap: 4px;
  }

  .backup-actions .text-button {
    padding-inline: 8px;
  }

  .import-failure-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    grid-column: 1;
    grid-row: 1;
  }

  .segmented {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .segmented::-webkit-scrollbar {
    display: none;
  }

  .segmented button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 6px;
    font-size: 11px;
  }

  #openTodayScheduleBtn,
  #openReservationBtn {
    position: fixed;
    bottom: 12px;
    z-index: 25;
    display: block;
    min-height: 48px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
  }

  #openTodayScheduleBtn {
    right: 144px;
    left: 12px;
    background: #fff;
  }

  #openReservationBtn {
    right: 12px;
    width: 120px;
  }

  .workspace {
    grid-template-areas:
      "calendar"
      "inspector";
  }

  .quick-save-row {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .danger-button,
  .text-button {
    min-height: 42px;
  }

  .status-strip,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    gap: 8px;
  }

  .inspector textarea {
    min-height: 170px;
  }

  .calendar-grid {
    overflow: visible;
  }

  .calendar-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .weekday {
    padding: 7px 4px;
    font-size: 11px;
    text-align: center;
  }

  .day-cell {
    min-height: 82px;
    padding: 5px 3px;
    overflow: visible;
  }

  .day-head {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .day-head .today-dot {
    min-width: 22px;
    height: 22px;
  }

  .reservation-card {
    border-left-width: 4px;
    margin-bottom: 4px;
    padding: 5px 4px;
  }

  .reservation-card strong {
    font-size: 11px;
  }

  .reservation-card-compact {
    gap: 2px;
    min-height: 22px;
    border-left-width: 3px;
    padding: 3px 3px;
  }

  .reservation-card-compact.reservation-span-2 { width: calc(200% + 7px); }
  .reservation-card-compact.reservation-span-3 { width: calc(300% + 14px); }
  .reservation-card-compact.reservation-span-4 { width: calc(400% + 21px); }
  .reservation-card-compact.reservation-span-5 { width: calc(500% + 28px); }
  .reservation-card-compact.reservation-span-6 { width: calc(600% + 35px); }
  .reservation-card-compact.reservation-span-7 { width: calc(700% + 42px); }

  .reservation-card-compact strong {
    font-size: 10px;
    line-height: 1.1;
  }

  .reservation-card-list {
    grid-template-columns: minmax(52px, auto) minmax(0, 1fr) auto;
    gap: 5px;
    min-height: 32px;
    padding: 5px 6px;
  }

  .reservation-card-list strong {
    font-size: 11px;
  }

  .reservation-card-list span {
    font-size: 10px;
  }

  .schedule-row {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .schedule-day {
    padding: 9px 7px;
  }

  .schedule-items {
    min-height: 48px;
    padding: 6px;
  }

  .reservation-card-placeholder {
    min-height: 22px;
    margin-bottom: 4px;
  }

  .reservation-card span {
    font-size: 10px;
  }

  dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    border: 0;
  }

  .copy-phrases-dialog {
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

  .copy-phrases-dialog .dialog-form {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .dialog-form {
    min-height: 100dvh;
    padding: 14px;
    overflow-y: auto;
    padding-bottom: 88px;
  }

  .dialog-head {
    position: sticky;
    top: -14px;
    z-index: 4;
    padding: 12px 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }

  .dialog-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--line);
  }

  .autosave-status {
    grid-column: 1 / -1;
    margin: 0;
  }

  .equipment-picker {
    grid-template-columns: 1fr;
  }

  .equipment-tools {
    top: 52px;
    grid-template-columns: 1fr;
  }

  .pick-row {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .pick-row input {
    min-height: 42px;
  }

  .today-dialog { max-height: 100dvh; }

  .today-dialog .dialog-form {
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .today-window-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .today-window-row {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .today-row-status {
    grid-column: 2;
    justify-self: start;
  }

  .alarm-settings-dialog .dialog-form {
    min-height: 0;
    padding-bottom: 16px;
  }
}

@media (max-width: 720px) {
  #reservationDialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  #reservationForm {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  #reservationDialog .reservation-dialog-head {
    position: static;
    top: auto;
    z-index: 6;
    min-height: 72px;
    padding: 17px 14px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }

  #reservationDialog .reservation-dialog-head h3 {
    font-size: 20px;
  }

  .reservation-dialog-body {
    gap: 10px;
    padding: 12px;
  }

  #reservationDialog .reservation-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    justify-content: stretch;
    gap: 12px;
    padding: 14px;
  }

  #reservationDialog .reservation-tools > * {
    min-width: 0;
    width: 100%;
  }

  #reservationDialog .reservation-tool-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-self: stretch;
    max-width: none;
  }

  #reservationDialog .reservation-tool-actions button {
    min-width: 0;
    min-height: 44px;
    padding: 7px 6px;
    font-size: 13px;
    white-space: nowrap;
  }

  .reservation-section {
    border-radius: 14px;
    padding: 14px;
  }

  .reservation-section-head {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
  }

  .reservation-status-field {
    width: 100%;
  }

  .reservation-customer-grid,
  .reservation-schedule-grid,
  .reservation-money-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .reservation-memo-section textarea {
    min-height: 160px;
  }

  .reservation-equipment-section .reservation-section-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .equipment-selection-summary {
    justify-self: end;
  }

  #reservationDialog .equipment-picker {
    grid-template-columns: 1fr;
  }

  #reservationDialog .dialog-actions {
    position: static;
    display: grid;
    grid-template-columns: 0.8fr 1fr 1.4fr;
    gap: 8px;
    padding: 9px 12px 12px;
    background: rgba(255, 255, 255, 0.98);
  }

  #reservationDialog .autosave-status {
    grid-column: 1 / -1;
    margin: 0;
  }

  #reservationDialog .dialog-actions .danger-button,
  #reservationDialog .dialog-actions .secondary-button,
  #reservationDialog .dialog-actions .primary-button {
    min-width: 0;
  }
}
