:root {
  color-scheme: light;
  --ink: #192e31;
  --muted: #4c6366;
  --side: #152d31;
  --line: #d8e4e1;
  --paper: #fff;
  --canvas: #f2f6f4;
  --teal: #096859;
  --teal-dark: #064e42;
  --red: #a42d2b;
  font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 100%;
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); min-width: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #187e77; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, p { margin: 0; }
strong, small { overflow-wrap: anywhere; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; background: var(--side); color: #e9f6f2; display: flex; flex-direction: column; padding: 29px 17px 20px; z-index: 4; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 31px; }
.brand-mark, .mobile-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; background: #bce9d8; color: #13453e; font-family: "Yu Mincho", serif; font-size: 1.35rem; font-weight: 700; border-radius: 12px; flex: none; }
.brand strong { display: block; font-size: 1.15rem; letter-spacing: .045em; }
.brand small { display: block; color: #afc9c6; font-size: .82rem; }
nav { display: grid; gap: 7px; }
.nav-button { min-height: 48px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: #cbdedb; font-size: .92rem; font-weight: 650; }
.nav-button:hover, .nav-button[aria-current="page"] { color: #fff; background: #28514f; }
.nav-button[aria-current="page"] { color: #dbfff0; }
.nav-button:focus-visible { outline-color: #a3e4cd; }
.nav-icon { min-width: 22px; display: grid; place-items: center; font-size: 1.2rem; line-height: 1; }
.sidebar-note { border-top: 1px solid #43615f; margin-top: auto; padding: 15px 6px 0; display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.sidebar-note span:last-child { color: #adc7c4; margin-left: auto; }
.trial-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #aa6d22; flex: none; }
.sidebar-note .trial-dot { background: #efbb72; }
.workspace { margin-left: 224px; }
.topbar { min-height: 66px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px clamp(20px, 3.1vw, 48px); }
.top-title { display: flex; gap: 10px; align-items: center; font-weight: 720; font-size: .95rem; }
.top-title .top-detail { margin-left: 5px; color: var(--muted); font-weight: 400; }
.mobile-mark { display: none; }
.trial-label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: #6f481a; background: #fff5e5; border: 1px solid #f0dcb9; padding: 4px 10px; border-radius: 20px; font-weight: 700; font-size: .78rem; }
main { max-width: 1530px; margin: 0 auto; padding: 29px clamp(20px, 3.1vw, 48px) 55px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.55rem, 3vw, 2.2rem); letter-spacing: .02em; line-height: 1.21; }
.eyebrow { font-size: .85rem; color: var(--teal); font-weight: 750; margin-bottom: 5px; }
.page-head p:not(.eyebrow) { margin-top: 7px; color: var(--muted); }
.date-control, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.date-control { gap: 5px; }
.date-control input { width: 151px; min-width: 0; }
.date-control .step { padding-inline: 10px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; min-height: 44px; padding: 7px 13px; background: var(--paper); color: var(--ink); font-weight: 680; font-size: .9rem; text-align: center; }
.button:hover { background: #e8f2ee; }
.button.primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.danger { color: var(--red); border-color: #e5b9b8; }
.button.danger:hover { background: #fbe7e6; }
.button.link { color: var(--teal); border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.metric { text-align: left; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 12px 15px; min-width: 0; }
button.metric:hover { border-color: var(--teal); background: #fbfffd; }
.metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; font-weight: 700; }
.metric-mark { width: 23px; height: 23px; display: grid; place-items: center; flex: none; border-radius: 6px; color: var(--metric-ink, #21526e); background: var(--metric-bg, #e2eef9); font-size: .85rem; }
.metric-value { display: flex; gap: 4px; align-items: baseline; margin-top: 3px; font-size: 1.8rem; line-height: 1.2; font-weight: 760; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: .81rem; color: var(--muted); }
.key-notice, .notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #e9d4a4; background: #fff7e6; color: #65461f; border-radius: 11px; overflow-wrap: anywhere; }
.key-notice { font-size: .89rem; margin-bottom: 22px; }
.key-notice strong, .notice strong { font-weight: 760; }
.notice-icon { flex: none; display: inline-grid; place-items: center; background: #f2dfb3; width: 22px; height: 22px; border-radius: 50%; font-weight: 770; }

.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; margin: 0 0 11px; }
.section-head h2 { font-size: 1.2rem; }
.section-head h2 small { margin-left: 8px; color: var(--muted); font-size: .82rem; font-weight: 500; }
.filters { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 20px; padding: 4px 11px; min-height: 40px; font-size: .84rem; font-weight: 700; }
.filter:hover, .filter[aria-pressed="true"] { background: #e0f1e9; color: #145b49; border-color: #a3ccba; }
.room-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.room-card { display: flex; flex-direction: column; gap: 7px; min-width: 0; min-height: 154px; padding: 12px; text-align: left; border: 1px solid var(--line); border-top: 3px solid var(--card-accent, #a6bcbb); border-radius: 12px; background: var(--paper); color: var(--ink); overflow-wrap: anywhere; }
.room-card:hover { border-color: var(--teal); box-shadow: 0 3px 12px #16372f14; }
.room-card[data-tone="occupied"] { --card-accent: #6798c4; }
.room-card[data-tone="depart"] { --card-accent: #9d83bf; }
.room-card[data-tone="waiting"] { --card-accent: #d6aa43; }
.room-card[data-tone="free"] { --card-accent: #62ad92; }
.room-card[data-tone="blocked"] { --card-accent: #cc8080; }
.room-top { display: flex; justify-content: space-between; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.room-number { font-size: 1.69rem; font-weight: 760; letter-spacing: -.035em; line-height: 1.08; font-variant-numeric: tabular-nums; }
.room-number small { font-size: .72rem; margin-left: 3px; letter-spacing: 0; font-weight: 550; color: var(--muted); }
.room-name { font-size: .93rem; font-weight: 740; }
.room-line, .muted { color: var(--muted); }
.room-line { font-size: .83rem; }
.card-footer { border-top: 1px solid #edf1f0; margin-top: auto; padding-top: 6px; font-size: .79rem; color: var(--muted); }
.card-footer.caution { color: #765018; font-weight: 730; }
.status { align-self: flex-start; display: inline-block; border-radius: 6px; padding: 2px 7px; white-space: nowrap; background: #e8edef; color: #394e54; font-size: .79rem; font-weight: 730; }
.status.free { background: #def2e9; color: #195b47; }
.status.occupied, .status.planned { background: #e1eef9; color: #214e78; }
.status.depart { background: #eee5f7; color: #623d81; }
.status.waiting { background: #fff0ca; color: #725014; }
.status.blocked { background: #f9e5e4; color: #8b2828; }
.empty { padding: 18px; background: var(--paper); border: 1px dashed #b8cdc8; border-radius: 11px; color: var(--muted); }

.panel { padding: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.panel + .panel, .panel + .section-head, .schedule-shell + .panel, .section-head + .panel { margin-top: 14px; }
.schedule-shell { overflow: auto; max-width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.schedule-shell:focus-visible { outline-offset: 2px; }
.schedule-grid { display: grid; grid-template-columns: 76px repeat(var(--days), minmax(var(--day-width), 1fr)); width: max(100%, calc(76px + var(--days) * var(--day-width))); --day-width: 51px; }
.schedule-corner, .schedule-room { position: sticky; left: 0; z-index: 1; background: #f5faf8; display: grid; place-items: center; border-right: 1px solid #c9d9d5; border-bottom: 1px solid var(--line); font-weight: 720; font-size: .86rem; }
.schedule-date { min-height: 45px; display: grid; place-items: center; align-content: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); line-height: 1.15; font-size: .8rem; }
.schedule-date span { color: var(--muted); }
.schedule-date.today { background: #dff2e9; color: var(--teal-dark); font-weight: 760; }
.schedule-cell { min-height: 46px; border-right: 1px solid #e7edeb; border-bottom: 1px solid #e7edeb; }
.schedule-cell.weekend { background: #f3f7f6; }
.schedule-bar { align-self: center; z-index: 0; min-width: 0; min-height: 34px; margin: 0 2px; padding: 4px 5px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #dfedf7; border: 1px solid #abc7df; border-radius: 5px; color: #234d70; font-size: .78rem; font-weight: 700; }
.schedule-bar:hover { background: #cfe4f3; }
.schedule-bar.blocked { background: #f9e5e4; border-color: #e2bcb8; color: #8b2828; cursor: default; }
.schedule-bar.overlap { align-self: end; min-height: 19px; padding-block: 0; }
.schedule-bar.behind { align-self: start; min-height: 22px; padding-block: 1px; }
.list { display: grid; gap: 8px; }
.reservation-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 16px; width: 100%; text-align: left; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; background: var(--paper); }
.reservation-row:hover { border-color: var(--teal); background: #f5faf8; }
.reservation-row > span { display: grid; gap: 3px; min-width: 0; }
.reservation-row .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.reservation-row small { color: var(--muted); font-size: .85rem; }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px 18px; margin-bottom: 13px; }
.list-toolbar label { flex: 1 1 230px; max-width: 430px; }
.management-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr)); gap: 10px; }
.management-grid .button { min-height: 62px; text-align: left; justify-content: flex-start; }

label { display: grid; gap: 4px; font-weight: 680; font-size: .87rem; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #a9c0bb; border-radius: 8px; background: var(--paper); color: var(--ink); padding: 6px 9px; font-size: 1rem; }
input[type="checkbox"] { width: 19px; height: 19px; min-height: 0; accent-color: var(--teal); }
textarea { resize: vertical; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.form-grid > .full { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 12px; }
.error { color: var(--red); font-weight: 680; }
.error:empty { display: none; }
.form-note { color: var(--muted); font-size: .86rem; }
.check-label { display: flex; gap: 7px; align-items: center; min-height: 42px; }
.allocation-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.allocation-row { display: grid; grid-template-columns: 1fr 62px; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.allocation-row small { display: block; font-size: .8rem; font-weight: 550; color: var(--muted); }
.allocation-row input { padding-inline: 6px; }
.allocation-row.unavailable { background: #fff4f3; border-color: #eed2d1; }
.data-list { margin: 0; display: grid; gap: 0; }
.data-list div { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.data-list dt { color: var(--muted); font-size: .87rem; flex: 0 0 auto; }
.data-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.detail-section { display: grid; gap: 8px; }
.detail-section h3 { font-size: 1rem; }
.detail-section p { overflow-wrap: anywhere; }
.detail-section + .detail-section { padding-top: 10px; border-top: 1px solid var(--line); }
.scroll-list { max-height: 210px; overflow: auto; padding-right: 4px; }
.log-list { padding-left: 22px; margin: 0; }
.log-list li { overflow-wrap: anywhere; margin-bottom: 5px; }
.log-list time { color: var(--muted); font-size: .81rem; margin-right: 7px; }

dialog { width: min(660px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 17px 65px #061b2750; }
dialog::backdrop { background: #10292cb3; }
#confirmation { width: min(510px, calc(100% - 24px)); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 18px; position: sticky; top: 0; z-index: 2; }
.dialog-head h2 { font-size: 1.21rem; overflow-wrap: anywhere; }
.dialog-head .button { flex: none; }
.dialog-body { padding: 15px 18px 19px; display: grid; gap: 12px; }
.preline { white-space: pre-line; overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 24px; right: 24px; max-width: calc(100% - 48px); z-index: 5; border-radius: 9px; color: #fff; background: #16483f; padding: 10px 15px; font-weight: 680; box-shadow: 0 4px 15px #112b2c43; }
.toast:empty { display: none; }

@media (max-width: 1180px) {
  .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { inset: auto 0 0; width: auto; padding: 4px 5px max(4px, env(safe-area-inset-bottom)); border-top: 1px solid #355452; }
  .brand, .sidebar-note { display: none; }
  nav { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  .nav-button { display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 5px; padding: 5px 1px; font-size: .75rem; min-height: 51px; line-height: 1.19; }
  .nav-button:focus-visible { outline-offset: -3px; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 56px; }
  .mobile-mark { display: inline-grid; width: 32px; height: 32px; font-size: 1rem; border-radius: 8px; }
  main { padding-bottom: calc(81px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(67px + env(safe-area-inset-bottom)); }
}

@media (max-width: 620px) {
  .topbar { padding: 8px 13px; }
  .top-detail { display: none; }
  main { padding: 17px 13px calc(75px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 15px; gap: 10px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 11px; }
  .metric { padding: 8px 10px; }
  .metric-value { font-size: 1.54rem; }
  .key-notice { margin-bottom: 14px; padding: 9px 10px; }
  .room-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .room-card { padding: 9px; min-height: 143px; gap: 5px; }
  .room-top { column-gap: 5px; }
  .room-number { font-size: 1.48rem; }
  .status { font-size: .75rem; padding-inline: 5px; }
  .schedule-grid { --day-width: 75px; grid-template-columns: 62px repeat(var(--days), minmax(var(--day-width), 1fr)); width: max(100%, calc(62px + var(--days) * var(--day-width))); }
  .dialog-head, .dialog-body { padding-inline: 12px; }
}

@media (max-width: 390px) {
  .allocation-list { grid-template-columns: 1fr; }
  .date-control .button { padding-inline: 8px; }
  .date-control input { width: 137px; }
}
