/* Student-safe classroom kiosk. Light, touch-first, and read-only. */
.kiosk-body {
  min-height: 100vh; min-height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; background: var(--bg);
}
.access-mode:not(.access-authorized) .kiosk-header,
.access-mode:not(.access-authorized) .kiosk-stage,
.access-mode:not(.access-authorized) .kiosk-footer,
.access-mode:not(.access-authorized) .connection-error { display: none; }
.access-login {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: 1rem; background: var(--bg);
}
.access-card {
  width: min(420px, 100%); padding: 1.5rem; border: 1px solid var(--line);
  border-radius: var(--r-modal); background: var(--panel); box-shadow: var(--shadow-modal);
}
.access-card h1 { margin-top: 1.2rem; font-size: 1.55rem; }
.access-card p { color: var(--muted); }
.access-card form { margin-top: 1.1rem; }
.access-card form label { display: block; margin-bottom: 0.35rem; font-weight: 600; }
.access-card input { min-height: 56px; font-family: var(--font-mono); font-size: 1.35rem; letter-spacing: 0.18em; }
.access-card form .btn { min-height: 52px; margin-top: 0.8rem; }
.access-error { padding: 0.6rem; border-radius: 8px; background: var(--amber-tint); color: var(--amber) !important; }
.access-note { margin-bottom: 0; font-size: 0.82rem; text-align: center; }
.kiosk-header {
  min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 1rem; padding: 0.65rem 1.1rem;
  padding-top: max(0.65rem, env(safe-area-inset-top));
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.kiosk-header .brand { justify-self: start; }
.kiosk-header .brand span { color: var(--muted); font-weight: 500; }
.kiosk-header h1 { font-size: 1.25rem; text-align: center; }
.kiosk-header .btn { justify-self: end; min-height: 46px; }
.connection-error {
  padding: 0.65rem 1rem; background: var(--amber-tint); color: var(--amber);
  border-bottom: 1px solid var(--amber); text-align: center;
}
.connection-error button { font: inherit; font-weight: 700; color: inherit; border: 0; background: none; text-decoration: underline; cursor: pointer; }
.kiosk-stage { position: relative; flex: 1; min-height: 0; }
.kiosk-stage #room-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.kiosk-empty { position: absolute; inset: 0; display: grid; place-content: center; padding: 2rem; text-align: center; color: var(--muted); }
.kiosk-footer {
  display: flex; align-items: center; gap: 1rem; min-height: 54px;
  padding: 0.65rem 1.1rem max(0.65rem, env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--line); color: var(--muted);
}
.view-controls { display: flex; gap: 0.4rem; }
.view-controls .btn { min-height: 42px; padding-inline: 0.7rem; }
.status-summary { margin-left: auto; color: var(--text); font-weight: 600; }
.date-label { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

.room-boundary { fill: var(--panel); stroke: var(--line); stroke-width: 2; rx: 18; }
.room-front-label { font-family: var(--font-mono); font-size: 19px; font-weight: 700; letter-spacing: 0.14em; fill: var(--accent); }
.front-pill { fill: var(--accent-tint); }
.furniture .furn-body { fill: var(--field); stroke: var(--line); stroke-width: 1.5; }
.furniture text { font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: 0.12em; fill: #475467; }
.furniture.is-teacher .furn-body { fill: var(--accent-tint); stroke: var(--accent); }
.furniture.is-door .furn-body { fill: var(--amber-tint); stroke: var(--amber); }
.group-frame { display: none; }
.group-label { font-family: var(--font-mono); font-size: 17px; font-weight: 700; letter-spacing: 0.12em; fill: var(--accent); }
.desk { cursor: pointer; }
.desk .desk-body { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
.desk.seated:hover .desk-body, .desk.seated:focus-visible .desk-body { stroke: var(--accent); stroke-width: 3; }
.desk.seated:focus-visible { outline: none; }
.desk .desk-chair { fill: var(--line); }
.desk text { font-family: var(--font-ui); font-size: 26px; font-weight: 700; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.desk .kiosk-status-text { font-family: var(--font-mono); font-size: 12px; font-weight: 800; letter-spacing: 0.04em; fill: var(--accent-deep); pointer-events: none; }
.desk.is-out .desk-body { fill: var(--amber-tint); stroke: var(--amber); stroke-width: 2.5; }
.desk.is-out .kiosk-status-text { fill: var(--amber); }
.desk.is-calculator:not(.is-out) .desk-body { fill: var(--accent-tint); stroke: var(--accent); stroke-width: 2.5; }

dialog {
  color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-modal); box-shadow: var(--shadow-modal); padding: 1.3rem;
  width: min(620px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto;
}
dialog::backdrop { background: rgba(4, 8, 18, 0.62); }
.dialog-head { display: flex; align-items: start; gap: 1rem; margin-bottom: 0.7rem; }
.dialog-head h2 { margin-top: 0.15rem; font-size: 1.5rem; }
.dialog-head .icon-btn { margin-left: auto; width: 44px; height: 44px; font-size: 1.7rem; }
.action-dialog section { margin-top: 1rem; }
.action-dialog h3 { margin-bottom: 0.45rem; font-size: 0.85rem; color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.action-button {
  min-height: 54px; padding: 0.7rem 0.85rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--field); color: var(--text);
  font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.action-button:hover, .action-button:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.action-button.return { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); width: 100%; margin-bottom: 0.5rem; }
.action-button:disabled { opacity: 0.5; cursor: wait; }
.action-error, .pin-error, .detail-error { padding: 0.55rem 0.7rem; border-radius: 8px; background: var(--amber-tint); color: var(--amber); }
.detail-dialog { max-width: 500px; }
.detail-dialog h2 { margin-bottom: 0.35rem; }
.detail-dialog > p { color: var(--muted); }
.detail-dialog fieldset { margin: 0.8rem 0; padding: 0; border: 0; }
.detail-dialog legend { margin-bottom: 0.45rem; color: var(--muted); font-weight: 600; }
.detail-options { display: grid; gap: 0.5rem; }
.detail-option {
  display: flex; align-items: center; gap: 0.7rem; min-height: 54px;
  padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--field); font-weight: 600; cursor: pointer;
}
.detail-option input { inline-size: 22px; block-size: 22px; margin: 0; accent-color: var(--accent); flex: none; }
.detail-option:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.detail-note { margin-top: 0.85rem; }
.detail-note label { display: block; margin-bottom: 0.3rem; font-weight: 600; }
.detail-note textarea { width: 100%; min-height: 88px; font-size: 1rem; }
.detail-buttons { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }
.detail-buttons .btn { min-height: 48px; }
dialog:modal { overscroll-behavior: contain; }
.pin-dialog { max-width: 430px; }
.pin-dialog h2 { margin-bottom: 0.45rem; }
.pin-dialog p { color: var(--muted); }
.pin-field { margin-top: 0.9rem; }
.pin-field label { display: block; margin-bottom: 0.3rem; font-weight: 600; }
.pin-field input { min-height: 50px; font-size: 1.1rem; }
.pin-buttons { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.1rem; }
.pin-buttons .btn { min-height: 48px; }
.guided-note { font-size: 0.82rem; }
.kiosk-toast {
  position: fixed; z-index: 80; left: 50%; bottom: 72px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 1rem; max-width: calc(100vw - 2rem);
  padding: 0.75rem 1rem; border-radius: 10px; background: var(--text); color: var(--panel);
  box-shadow: var(--shadow-modal); font-weight: 600;
}
.kiosk-toast button { border: 0; background: transparent; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; min-height: 40px; }

@media (pointer: coarse) {
  .action-button { min-height: 60px; font-size: 1rem; }
  .kiosk-header .btn { min-height: 52px; }
}
@media (max-width: 700px) {
  .kiosk-header { grid-template-columns: auto 1fr auto; gap: 0.5rem; padding-inline: 0.65rem; }
  .kiosk-header .brand { font-size: 0; gap: 0; }
  .kiosk-header .brand .icon { width: 25px; height: 25px; }
  .kiosk-header h1 { font-size: 1rem; }
  .kiosk-footer { font-size: 0.82rem; }
  .date-label { display: none; }
  .status-summary { text-align: right; }
  .action-grid { grid-template-columns: 1fr; }
}
