:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #eef5f1;
  --ink: #102a27;
  --muted: #60736e;
  --line: #dce8e2;
  --teal: #0f766e;
  --teal-dark: #095e58;
  --teal-soft: #d9f3ec;
  --amber: #b45309;
  --amber-soft: #fff2d9;
  --red: #b42318;
  --red-soft: #fee4e2;
  --green: #067647;
  --green-soft: #dcfae6;
  --shadow: 0 18px 50px rgba(16, 42, 39, 0.09);
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(900px 420px at -10% 0%, rgba(180, 83, 9, 0.09), transparent 50%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: var(--teal); }
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: calc(18px + var(--safe-top)) 18px calc(108px + var(--safe-bottom)); }
.shell--auth { display: flex; align-items: center; padding-bottom: 24px; }
.auth-card { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 30px; padding: 26px 22px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand__mark { width: 46px; height: 46px; border-radius: 15px; background: linear-gradient(145deg, #0f766e, #0a5b56); color: white; display: grid; place-items: center; font-weight: 800; letter-spacing: 0.4px; box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24); }
.brand__name { font-size: 15px; font-weight: 750; line-height: 1.15; }
.brand__sub { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 3px; }
.eyebrow { color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; margin: 0 0 8px; }
h1 { font-size: clamp(27px, 7.4vw, 34px); line-height: 1.06; margin: 0; letter-spacing: -0.035em; }
h2 { font-size: 19px; line-height: 1.2; margin: 0; letter-spacing: -0.025em; }
h3 { font-size: 15px; margin: 0; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 14px; }
.stack--sm { display: grid; gap: 8px; }
.hero { margin: 8px 0 22px; }
.hero p { color: var(--muted); margin: 10px 0 0; font-size: 14px; max-width: 34ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 8px 26px rgba(16, 42, 39, 0.045); }
.card--soft { background: linear-gradient(145deg, #ffffff, #f3f9f6); }
.card--dark { background: linear-gradient(150deg, #0b4f4a, #0f766e 60%, #128579); color: white; border: 0; box-shadow: 0 18px 42px rgba(15, 118, 110, 0.28); }
.card--dark .muted, .card--dark .small { color: rgba(255, 255, 255, 0.72); }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card__head p { margin: 4px 0 0; font-size: 12px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; font-size: 12px; font-weight: 650; color: #29423d; }
.field input, .field select { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: #fbfdfc; color: var(--ink); outline: none; font-size: 16px; font-weight: 500; }
.field input:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12); }
.btn { min-height: 50px; border: 0; border-radius: 15px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; font-size: 14px; transition: transform 0.16s ease, background 0.16s ease; }
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--teal); color: white; box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22); }
.btn--primary:hover { background: var(--teal-dark); }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--teal); border: 1px solid var(--line); box-shadow: none; }
.btn--soft { background: var(--teal-soft); color: var(--teal-dark); }
.btn--danger { background: var(--red-soft); color: var(--red); }
.btn--small { min-height: 38px; padding: 0 12px; border-radius: 11px; font-size: 12px; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.badge--ok { background: var(--green-soft); color: var(--green); }
.badge--warn { background: var(--amber-soft); color: var(--amber); }
.badge--bad { background: var(--red-soft); color: var(--red); }
.badge--neutral { background: var(--surface-soft); color: var(--muted); }
.badge--onDark { background: rgba(255, 255, 255, 0.14); color: white; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.hero-shift { margin-top: 20px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.hero-shift__time { font-size: 31px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.hero-shift__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.68; margin-bottom: 7px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 16px; font-size: 12px; color: rgba(255, 255, 255, 0.78); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.timeline__item { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 15px; padding: 11px 12px; }
.timeline__item .label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.65; }
.timeline__item .value { font-size: 17px; font-weight: 750; margin-top: 5px; }
.cta-card { margin-top: 14px; }
.cta-card .hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; line-height: 1.45; }
.cta-card .protocol { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; padding: 14px; color: var(--ink); box-shadow: none; }
.quick strong { display: block; margin-top: 9px; font-size: 13px; }
.quick span { color: var(--muted); font-size: 11px; }
.quick .icon { color: var(--teal); }
.list { display: grid; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfc; }
.list-item__icon { width: 38px; height: 38px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; flex: 0 0 auto; }
.list-item__body { min-width: 0; flex: 1; }
.list-item__title { font-size: 13px; font-weight: 700; }
.list-item__meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-row .date { font-weight: 750; font-size: 13px; }
.history-row .times { color: var(--muted); font-size: 11px; margin-top: 3px; }
.empty { text-align: center; padding: 22px 12px; color: var(--muted); font-size: 13px; }
.empty .icon { width: 28px; height: 28px; color: #8aa39b; margin-bottom: 6px; }
.notice { border-radius: 15px; padding: 12px 13px; font-size: 12px; line-height: 1.5; }
.notice--info { background: #eef7ff; color: #184c6b; }
.notice--warn { background: var(--amber-soft); color: #7a4307; }
.notice--error { background: var(--red-soft); color: #7a1a13; }
.notice--success { background: var(--green-soft); color: #075e3a; }
.bottom-nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-bottom)); width: min(444px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid rgba(220, 232, 226, 0.9); border-radius: 24px; box-shadow: 0 16px 38px rgba(16, 42, 39, 0.16); z-index: 20; }
.nav-btn { border: 0; background: transparent; color: #71857f; padding: 9px 6px; border-radius: 18px; display: grid; justify-items: center; gap: 4px; font-size: 10px; font-weight: 700; }
.nav-btn .icon { width: 20px; height: 20px; }
.nav-btn.is-active { color: var(--teal-dark); background: var(--teal-soft); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar__greeting { font-size: 12px; color: var(--muted); margin: 0 0 3px; }
.topbar h1 { font-size: 26px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #d9f3ec; border: 1px solid #c4e8dd; color: #0b5c55; display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 10px; }
.section-head h2 { font-size: 16px; }
.section-head a, .link-btn { color: var(--teal); font-size: 12px; font-weight: 750; background: none; border: 0; padding: 0; }
.install-tip { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 15px; background: #eaf7f2; border: 1px solid #d5eee4; color: #24534b; font-size: 12px; line-height: 1.45; }
.install-tip .icon { color: var(--teal); margin-top: 1px; }
.offline { position: sticky; top: 0; z-index: 10; margin: 0 0 12px; padding: 9px 12px; border-radius: 12px; background: #fff2d9; color: #7a4307; font-size: 12px; font-weight: 650; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(9, 34, 30, 0.46); backdrop-filter: blur(4px); display: grid; place-items: end center; padding: 0; z-index: 50; animation: fade 0.2s ease; }
.modal { width: min(480px, 100%); background: var(--surface); border-radius: 28px 28px 0 0; padding: 20px 20px calc(22px + var(--safe-bottom)); box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.18); animation: rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal__handle { width: 38px; height: 4px; background: #d9e5df; border-radius: 99px; margin: 0 auto 16px; }
.result-icon { width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; margin-bottom: 13px; }
.result-icon--ok { background: var(--green-soft); color: var(--green); }
.result-icon--warn { background: var(--amber-soft); color: var(--amber); }
.result-icon--bad { background: var(--red-soft); color: var(--red); }
.result-icon .icon { width: 28px; height: 28px; }
.result-title { font-size: 24px; letter-spacing: -0.03em; margin: 0; }
.result-sub { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.result-grid { margin: 16px 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.result-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.result-row:last-child { border-bottom: 0; }
.result-row span:first-child { color: var(--muted); }
.result-row span:last-child { font-weight: 650; text-align: right; }
.loader { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; display: inline-block; }
.skeleton { background: linear-gradient(90deg, #edf4f0, #f8fbf9, #edf4f0); background-size: 220% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }
.gate-hint { margin: 2px 0 0; font-size: 11px; line-height: 1.45; color: var(--muted); text-align: center; }
.legal { margin-top: 22px; font-size: 11px; color: var(--muted); line-height: 1.55; text-align: center; }
.legal strong { color: #39534c; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 7px 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 650; text-align: right; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: #f1f6f3; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: calc(94px + var(--safe-bottom)); transform: translate(-50%, 16px); max-width: min(420px, calc(100% - 32px)); background: #102a27; color: white; border-radius: 13px; padding: 11px 14px; font-size: 12px; line-height: 1.4; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 60; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { transform: translateY(24px); opacity: 0.6; } }
@keyframes fade { from { opacity: 0; } }
@keyframes shimmer { to { background-position: -220% 0; } }
@media (min-width: 600px) {
  .shell { padding-top: 42px; }
  .bottom-nav { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
