:root {
  color-scheme: light;
  --ink: #211f35;
  --muted: #5c5972;
  --line: #dedbeb;
  --paper: #fff;
  --soft: #f2f0fa;
  --accent: #554097;
  --accent-dark: #42307b;
  --mine: #c9f2eb;
  --mine-border: #64b5a4;
  --reserved: #e2daf6;
  --reserved-border: #a694cc;
  font-family: "Hiragino Sans", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background: #f8f7fc;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
a { color: var(--accent-dark); }
button, .primary {
  min-height: 38px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink); padding: 6px 12px;
  font-size: .875rem; font-weight: 650; cursor: pointer;
}
button:hover { background: var(--soft); }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shell { width: min(1540px, calc(100% - 72px)); margin-inline: auto; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand, nav a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand { font-weight: 750; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 5px); gap: 3px; padding: 8px; border-radius: 8px; background: var(--accent); }
.brand-mark i { width: 5px; height: 5px; border-radius: 1px; background: #fff; }
nav { display: flex; gap: 16px; }
nav a { color: var(--accent-dark); font-size: .875rem; }
nav a:hover, .brand:hover { text-decoration: underline; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 37px 0 25px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.15; letter-spacing: -.045em; }
.page-heading p { margin-top: 10px; color: var(--muted); }
.primary { display: inline-flex; justify-content: center; align-items: center; gap: 4px; min-height: 43px; color: #fff; background: var(--accent); border-color: var(--accent); white-space: nowrap; text-decoration: none; }
.primary:hover { color: #fff; background: var(--accent-dark); }
.layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 38px; }
.panel, .login-panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; }
.login-panel { max-width: 540px; padding: 23px; }
.login-panel p { margin: 10px 0 16px; color: var(--muted); }
.login-panel form { display: grid; gap: 8px; max-width: 330px; }
.login-panel label { font-weight: 650; font-size: .875rem; }
.login-panel input { min-height: 40px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; }
.login-panel form .primary { justify-self: start; margin-top: 6px; }
.admin-login { display: inline-block; margin-top: 15px; font-size: .875rem; }
.nav-button { color: var(--accent-dark); border-color: transparent; }
.calendar { padding: 13px; }
.calendar-heading { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 12px; }
.calendar-heading h2 { font-size: 1rem; white-space: nowrap; }
.calendar-heading button { min-width: 32px; min-height: 32px; padding: 0; font-size: 1.25rem; line-height: 1; }
.weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.weekdays { color: var(--muted); font-size: .875rem; background: var(--soft); padding-block: 5px; border-radius: 5px; }
.weekdays span:first-child, .calendar-days button.sunday { color: #a52954; }
.weekdays span:last-child, .calendar-days button.saturday { color: #344e9e; }
.calendar-days { min-height: 186px; grid-auto-rows: 30px; margin-top: 5px; }
.calendar-days button { font-weight: 500; width: 100%; min-height: 0; padding: 0; border-color: transparent; border-radius: 6px; }
.calendar-days button[aria-current="date"] { border-color: var(--reserved-border); }
.calendar-days button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 750; }
.day-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; border-top: 1px solid var(--line); padding-top: 10px; }
.day-controls button { padding-inline: 3px; min-height: 32px; }
.board-heading, .board-options { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.board-heading h2 { font-size: 1.28rem; }
.board-heading p { font-size: .875rem; margin-top: 4px; color: var(--muted); }
.board-options { border-top: 1px solid var(--line); padding-block: 9px; }
.views, .legend { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.views button { min-height: 32px; }
.views button[aria-pressed="true"] { background: var(--soft); color: var(--accent-dark); border-color: var(--reserved-border); }
.legend { font-size: .875rem; color: var(--muted); column-gap: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; background: var(--reserved); border: 1px solid var(--reserved-border); border-radius: 3px; }
.legend i.mine { background: var(--mine); border-color: var(--mine-border); }
.timeline { overflow-x: auto; border-block: 1px solid var(--line); }
.timeline-content { width: max(100%, 1120px); }
.timeline-row { display: grid; grid-template-columns: 164px minmax(0, 1fr); min-height: 62px; }
.timeline-row + .timeline-row { border-top: 1px solid var(--line); }
.timeline-header { min-height: 36px; background: var(--soft); font-size: .875rem; color: var(--muted); }
.equipment-label { position: sticky; z-index: 2; left: 0; display: flex; justify-content: center; flex-direction: column; align-items: flex-start; background: var(--paper); padding: 7px 10px; border-right: 1px solid var(--line); }
.timeline-header .equipment-label { background: var(--soft); }
.equipment-label strong { font-size: .875rem; overflow-wrap: anywhere; }
.equipment-label small { color: var(--muted); font-size: .8rem; }
.hours, .track { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); position: relative; }
.hours span { display: grid; place-items: center; white-space: nowrap; }
.hours span + span, .hour-slot + .hour-slot { border-left: 1px solid var(--line); }
.hour-slot { min-height: 61px; background: #fcfaff; border: 0; border-radius: 0; padding: 0; }
.hour-slot:nth-child(n+9):nth-child(-n+18) { background: #fff; }
.hour-slot:disabled { opacity: 1; }
.hour-slot:not(:disabled):hover, .hour-slot:focus-visible { background: #ebe5fb !important; }
.hour-slot:focus-visible { outline-offset: -3px; }
.hour-slot:not(:disabled) { cursor: crosshair; }
.track { user-select: none; }
.drag-hint { margin: 0 18px 10px; color: var(--muted); font-size: .875rem; }
.drag-selection { position: absolute; z-index: 1; top: 8px; bottom: 8px; pointer-events: none; overflow: hidden; padding: 6px 4px; white-space: nowrap; border: 1px solid var(--accent); border-radius: 6px; background: var(--mine); color: #10493e; font-size: .875rem; font-weight: 650; }
.reservation { position: absolute; top: 9px; bottom: 9px; min-height: 0; min-width: 0; overflow: hidden; padding: 4px 6px; white-space: nowrap; text-overflow: ellipsis; text-align: left; background: var(--reserved); border-color: var(--reserved-border); color: #2e2057; border-radius: 6px; }
.reservation.mine { background: var(--mine); border-color: var(--mine-border); color: #10493e; }
.reservation:hover { filter: brightness(.96); }
.status { min-height: 42px; padding: 12px 18px; color: var(--muted); font-size: .875rem; }
.empty { margin: 14px 18px; color: var(--muted); }
.reservation-list { margin: 0; padding: 0 18px; list-style: none; }
.reservation-list li + li { border-top: 1px solid var(--line); }
.reservation-list button { display: grid; grid-template-columns: 8rem minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; padding: 12px 8px; }
.reservation-list small { color: var(--accent-dark); font-size: .81rem; }
dialog { width: min(440px, calc(100% - 30px)); max-height: calc(100% - 30px); border: 1px solid var(--line); border-radius: 13px; color: var(--ink); padding: 20px; box-shadow: 0 16px 70px #24184033; }
dialog::backdrop { background: #1b163e66; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dialog-heading h2 { font-size: 1.24rem; }
.close-dialog { width: 34px; min-height: 34px; padding: 0; font-size: 1.25rem; }
dialog label { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; font-size: .875rem; font-weight: 650; }
dialog input, dialog select { min-width: 0; min-height: 41px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); padding: 6px 9px; font-size: 1rem; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { margin-top: 10px; color: #a12248; font-size: .875rem; }
.dialog-action { margin-top: 14px; width: 100%; }
.danger { color: #951d41; border-color: #e9bac9; }
#detail-dialog p + p { margin-top: 7px; }
#detail-purpose { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
@media (max-width: 750px) {
  .shell { width: calc(100% - 28px); }
  .page-heading { margin-block: 23px 19px; align-items: flex-start; }
  .page-heading p { font-size: .875rem; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .calendar { width: 100%; max-width: 350px; }
  .board-heading, .board-options { padding-inline: 10px; }
  .timeline-row { grid-template-columns: 115px minmax(0, 1fr); }
}
@media (max-width: 390px) {
  .header-inner, nav { flex-wrap: wrap; }
  .header-inner { padding-block: 9px; }
  .reservation-list button { grid-template-columns: 1fr; gap: 3px; }
}
