:root {
  font-family: "Yu Gothic UI", "Hiragino Sans", system-ui, sans-serif;
  color: #15313c;
  background: #eef4f5;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; }

button { font: inherit; }

.app-shell { width: min(720px, 100%); margin: 0 auto; padding: 28px 20px 36px; }

.topbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow, .section-kicker { margin: 0 0 5px; color: #52717d; font-size: .82rem; font-weight: 700; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(1.55rem, 6vw, 2.25rem); }
.clock { text-align: right; display: grid; color: #52717d; }
.clock strong { color: #15313c; font-size: 1.35rem; }
.clock span { font-size: .78rem; }

.status-card { min-height: 310px; border-radius: 28px; padding: 30px 24px; display: grid; place-items: center; align-content: center; text-align: center; color: white; box-shadow: 0 18px 45px rgba(18,54,67,.16); transition: background .25s; }
.status-card.standby { background: linear-gradient(145deg, #176b78, #0c4e64); }
.status-card.active-a { background: linear-gradient(145deg, #d86425, #a93618); }
.status-card.active-b { background: linear-gradient(145deg, #7655c9, #44358f); }
.status-label { margin: 0 0 14px; font-weight: 700; opacity: .86; }
.status-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 10px; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; font-size: 2rem; font-weight: 900; }
.status-card h2 { margin: 0; font-size: clamp(2.4rem, 12vw, 4.3rem); line-height: 1.1; }
.status-card #statusDetail { margin: 13px 0 0; opacity: .9; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
button { border: 0; border-radius: 14px; cursor: pointer; font-weight: 800; }
button:focus-visible { outline: 4px solid #f7b940; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .42; }
.action-button { min-height: 68px; padding: 14px 16px; font-size: 1.05rem; }
.primary { background: #d44d24; color: white; }
.secondary { background: white; color: #244754; border: 1px solid #c9d8dc; }
.button-icon { display: inline-grid; place-items: center; width: 27px; height: 27px; margin-right: 5px; border: 2px solid currentColor; border-radius: 50%; }

.area-card, .next-card, .history-section { background: white; border: 1px solid #d8e3e5; border-radius: 19px; }
.area-card { margin-bottom: 14px; padding: 18px 20px; }
.area-heading { display: flex; align-items: center; gap: 11px; }
.area-heading h2 { margin: 0; font-size: 1.2rem; }
.pin { color: #d44d24; font-size: .8rem; }
.area-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.area-list li { padding: 7px 11px; border-radius: 999px; background: #edf5f6; color: #245866; font-size: .88rem; font-weight: 700; }
.next-card { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
.next-team { margin: 0; font-size: 1.2rem; font-weight: 700; }
.next-team span { color: #0b6475; font-size: 1.55rem; }
.text-button { padding: 9px 11px; background: #edf5f6; color: #176273; }

.history-section { margin-top: 18px; padding: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 1.3rem; }
.history-list { margin: 16px 0 0; padding: 0; list-style: none; }
.history-item { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: center; padding: 14px 2px; border-top: 1px solid #e1eaec; }
.history-dot { width: 10px; height: 10px; border-radius: 50%; background: #78909a; }
.history-dot.issue { background: #d44d24; }
.history-main strong { display: block; }
.history-main span, .history-time { color: #667e87; font-size: .82rem; }
.empty-history { color: #779099; text-align: center; padding: 20px 0 8px; }

footer { margin-top: 22px; text-align: center; color: #6b828b; font-size: .78rem; line-height: 1.5; }
footer p { margin: 3px; }

dialog { width: min(430px, calc(100% - 32px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 25px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,32,39,.58); }
dialog form { padding: 25px; }
dialog h2 { margin: 0 0 8px; }
dialog p { margin: 0; color: #526c76; line-height: 1.7; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.dialog-actions button { min-height: 48px; }

@media (max-width: 480px) {
  .app-shell { padding: 20px 14px 28px; }
  .status-card { min-height: 285px; }
  .actions { grid-template-columns: 1fr; }
  .clock span { display: none; }
  .history-item { grid-template-columns: 10px 1fr; }
  .history-time { grid-column: 2; }
}

.connection-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-10px 0 16px}.sync-status{display:inline-flex;align-items:center;gap:7px;color:#47717c;font-size:.84rem;font-weight:700}.sync-status::before{content:"";width:9px;height:9px;border-radius:50%;background:#9aaeb4}.sync-status.online::before{background:#1a9b61}.sync-status.error::before{background:#d44d24}.field{display:grid;gap:6px;margin-top:16px;color:#355763;font-weight:700}.field input{width:100%;padding:12px;border:1px solid #b9cdd2;border-radius:10px;font:inherit}.form-error{min-height:1.4em;margin-top:8px!important;color:#b3341d!important;font-size:.85rem}

.history-dot.rotate{background:#16748a}.next-card{border:3px solid #16748a}.next-team span{font-size:2rem}

.weather-feed{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:14px;padding-top:13px;border-top:1px solid #d8e3e5;color:#42636e;font-size:.82rem}.weather-feed strong{color:#14657a}.weather-feed .alert{color:#c33d1e}@media(max-width:480px){.weather-feed{align-items:flex-start;flex-direction:column}}
