:root {
  color-scheme: light;
  --canvas: #f9f1ed;
  --surface: #fffdfa;
  --ink: #30232a;
  --muted: #645159;
  --brand: #752e48;
  --brand-deep: #542236;
  --rose: #f4e4e9;
  --border: #e8d7da;
  --control: #937580;
  --danger: #88372e;
  --danger-soft: #fbebe6;
  --ok: #315946;
  --ok-soft: #eaf2eb;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button, input, select { min-height: 44px; border: 1px solid var(--control); border-radius: 10px; }
button { padding: 8px 15px; background: var(--surface); color: var(--brand-deep); font-weight: 650; cursor: pointer; }
button:where(:hover):not(:disabled) { background: var(--rose); border-color: var(--brand); }
button:disabled { cursor: default; opacity: .62; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
input, select { min-width: 0; width: 100%; padding: 8px 11px; background: var(--surface); color: var(--ink); }
label, legend { color: var(--ink); font-size: .92rem; font-weight: 650; }
label { display: grid; gap: 5px; min-width: 0; }
label small { color: var(--muted); font-weight: 450; }
.primary { background: var(--brand); border-color: var(--brand); color: white; }
.primary:hover:not(:disabled) { background: var(--brand-deep); }
.quiet-button { padding-inline: 11px; font-size: .9rem; }
.danger { color: var(--danger); }
.danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.danger.primary { background: var(--danger); border-color: var(--danger); color: white; }
.danger.primary:hover:not(:disabled) { background: #69291f; }

.shell { width: min(100%, 820px); margin-inline: auto; padding-inline: 24px; }
.topbar { background: #fff9f6; border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; min-height: 73px; align-items: center; justify-content: space-between; gap: 15px; }
.brand { display: flex; min-width: 0; align-items: center; gap: 11px; color: var(--brand-deep); font: 600 1.2rem/1.1 Georgia, serif; }
.brand-mark { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border: 1px solid #d1a8b5; border-radius: 50%; background: var(--rose); font-size: 1.3rem; }
.brand-detail { color: var(--muted); font: 600 .8rem/1.1 system-ui, sans-serif; }
.identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.identity span { overflow-wrap: anywhere; text-align: right; }
.identity button { flex: 0 0 auto; }
.muted { color: var(--muted); font-size: .91rem; }
main.shell { padding-bottom: 50px; }
.initial-status { margin-top: 24px; color: var(--muted); }
.card { padding: clamp(18px, 4vw, 29px); border: 1px solid var(--border); border-radius: 19px; background: var(--surface); box-shadow: 0 9px 25px #51283c0a; }
.sign-in { width: min(100%, 430px); margin: clamp(28px, 9vh, 95px) auto 0; border-top: 3px solid var(--brand); }
h1 { color: var(--brand-deep); font: 500 clamp(2.03rem, 7vw, 3.15rem)/1.06 Georgia, serif; letter-spacing: -.04em; }
h2 { color: var(--brand-deep); font-size: 1.19rem; line-height: 1.24; letter-spacing: -.01em; }
h3 { font-size: 1rem; }
.fields { display: grid; gap: 14px; }
.sign-in form { margin-top: 23px; }
.notice { padding: 11px 13px; border-radius: 8px; border-left: 3px solid var(--brand); background: var(--rose); color: var(--brand-deep); overflow-wrap: anywhere; }
.notice.is-error, .notice.is-warning { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.notice.is-success { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.card > .notice { margin-top: 15px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: clamp(25px, 6vw, 53px) 0 20px; }
.role-label { color: var(--muted); font-size: .9rem; }
.view-nav { display: flex; gap: 8px; margin-bottom: 13px; flex-wrap: wrap; }
.view-nav button { background: transparent; padding-inline: 12px; }
.view-nav button[aria-current="page"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 15px; }
.section-status { margin: 13px 0 8px; }
.section-status:empty { margin-bottom: 0; }
.date-room-controls { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(150px, 1fr); gap: 13px; }
.room-fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
.room-fieldset legend { margin-bottom: 5px; padding: 0; }
.segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.segments button { padding-inline: 5px; }
.segments button[aria-pressed="true"], .slot[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--rose); color: var(--brand-deep); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.slot { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.22; }
.slot span { font-size: .76rem; font-weight: 550; margin-top: 3px; }
.slot.available { border-color: #8ca497; color: var(--ok); background: var(--ok-soft); }
button.slot.available:hover:not(:disabled) { border-color: var(--brand); background: var(--rose); color: var(--brand-deep); }
.slot.mine { color: var(--brand-deep); background: var(--rose); }
.slot.past { background: #f7f2f0; }
.selection { display: grid; gap: 8px; align-items: start; margin-top: 16px; padding: 14px; border-radius: 11px; background: var(--rose); }
.selection > button { justify-self: start; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.list-title { color: var(--brand-deep); padding-bottom: 7px; margin-top: 15px; }
.management-date { max-width: 225px; }
.records { list-style: none; margin: 0; padding: 0; }
.record { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.record div:first-child { min-width: 0; overflow-wrap: anywhere; }
.record .action-row { justify-content: flex-end; flex-shrink: 0; }
.record-detail { font-size: .88rem; color: var(--muted); }
.empty { padding-block: 9px; color: var(--muted); }
.account-form { display: grid; gap: 12px; padding-bottom: 18px; }
.account-form > button { justify-self: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 10px 13px; }
#temporary-password { font-family: ui-monospace, monospace; }
#secret-message:empty { display: none; }
.account-list { margin-top: 15px; }
dialog { width: min(420px, calc(100vw - 30px)); padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #30212ab0; }
.dialog-actions { justify-content: flex-end; }

@media (max-width: 560px) {
  .shell { padding-inline: 14px; }
  .topbar-inner { min-height: 63px; }
  .brand-detail { display: none; }
  .identity { gap: 7px; }
  .identity span { font-size: .78rem; }
  .page-heading { align-items: start; flex-direction: column; gap: 4px; }
  .date-room-controls, .form-grid { grid-template-columns: 1fr; }
  .record { align-items: flex-start; flex-direction: column; gap: 7px; }
  .record .action-row { justify-content: flex-start; }
}

@media (max-width: 360px) {
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view-nav button { font-size: .87rem; padding-inline: 9px; }
}
