:root {
  --bg: #EEF4FB; --card: #fff; --ink: #14243A; --soft: #4E6179; --line: #D6E2F0;
  --blue: #0B5FB0; --blue-dark: #084886; --blue-soft: #DCEBFA;
  --ok: #1E9E5A; --ok-soft: #DFF5E9; --bad: #D93025; --bad-soft: #FCE5E3; --warn: #E8A317; --warn-soft: #FFF2D1;
  --tap: 56px; --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 500; line-height: 1.35; font-size: 17px; min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3 { margin: 0; font-weight: 800; }
.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { background: var(--blue); color: #fff; padding: calc(12px + var(--safe-top)) 16px 12px; display: flex; align-items: center; gap: 10px; }
.topbar .t { flex: 1; min-width: 0; }
.topbar h1 { font-size: 1.15rem; }
.topbar .sub { font-size: .85rem; opacity: .85; }
.topbar .out { color: #fff; border: 1.5px solid rgba(255,255,255,.55); border-radius: 12px; padding: 8px 12px; font-size: .85rem; font-weight: 700; }
.topbar .back { color: #fff; font-size: 1.6rem; line-height: 1; padding: 6px 10px 6px 0; font-weight: 700; }
.content { flex: 1; padding: 14px 14px calc(96px + var(--safe-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); z-index: 5; }
.tabbar .in { display: flex; width: 100%; max-width: 520px; }
.tab { flex: 1; padding: 10px 2px 9px; font-size: .78rem; font-weight: 700; color: var(--soft); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; }
.tab .ic { font-size: 1.35rem; line-height: 1.2; }
.tab.on { color: var(--blue); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.summary { border-radius: 20px; padding: 18px 16px; margin-bottom: 12px; text-align: center; background: var(--ok-soft); color: #0C5E34; border: 2px solid var(--ok); }
.summary.bad { background: var(--bad-soft); color: #8F1C14; border-color: var(--bad); }
.summary .big { font-size: 1.4rem; font-weight: 800; line-height: 1.25; }
.summary .small { font-size: .95rem; margin-top: 4px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--tap); border-radius: 16px; padding: 12px 16px; font-weight: 800; font-size: 1.05rem; background: var(--blue); color: #fff; margin-bottom: 10px; text-align: center; text-decoration: none; }
.btn.alt { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
.btn.red { background: var(--bad); }
.btn.green { background: var(--ok); }
.btn.gray { background: #E6EDF5; color: var(--ink); }
.btn.small { min-height: 44px; font-size: .95rem; width: auto; padding: 8px 14px; margin: 0; }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.sec { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); font-weight: 800; margin: 18px 4px 8px; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tile { min-height: 52px; border-radius: 14px; font-weight: 800; font-size: 1rem; color: #fff; background: var(--ok); display: flex; align-items: center; justify-content: center; }
.tile.Down { background: var(--bad); }
.tile.Waiting { background: var(--warn); color: #3b2a00; }
.tile.sel { outline: 4px solid var(--blue); outline-offset: 2px; }
.legend { display: flex; gap: 14px; font-size: .85rem; color: var(--soft); margin: 4px 4px 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
.mcard { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 8px solid var(--bad); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.mcard.Waiting { border-left-color: var(--warn); }
.mcard .num { font-size: 1.5rem; font-weight: 800; min-width: 56px; }
.mcard .meta { flex: 1; min-width: 0; }
.mcard .iss { font-weight: 700; }
.mcard .who { font-size: .85rem; color: var(--soft); }
.chip { display: inline-block; font-size: .8rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--ok-soft); color: #0C5E34; }
.chip.Down { background: var(--bad-soft); color: #8F1C14; }
.chip.Waiting { background: var(--warn-soft); color: #7A5200; }
.chip.blue { background: var(--blue-soft); color: var(--blue-dark); }
.pick { display: block; width: 100%; text-align: left; min-height: var(--tap); padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-weight: 700; margin-bottom: 8px; }
.pick.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.pick.danger.on { border-color: var(--bad); background: var(--bad-soft); color: #8F1C14; }
.picks2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picks2 .pick { margin: 0; text-align: center; }
label.f { display: block; font-weight: 800; margin: 14px 2px 6px; }
input[type=text], input[type=number], textarea, select { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; min-height: var(--tap); }
textarea { min-height: 96px; resize: vertical; }
.photo-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.photo-row img, .thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.thumb { width: 72px; height: 72px; cursor: pointer; }
.ev { border-left: 4px solid var(--line); padding: 4px 0 4px 12px; margin-bottom: 14px; }
.ev.report { border-color: var(--bad); } .ev.tech { border-color: var(--blue); } .ev.status { border-color: var(--warn); }
.ev .h { font-weight: 800; } .ev .m { font-size: .85rem; color: var(--soft); }
.ev .tx { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--soft); } .small { font-size: .88rem; }
.empty { text-align: center; color: var(--soft); padding: 28px 10px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.seg button { min-height: 44px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: .8rem; padding: 4px; }
.seg button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.warn911 { background: var(--bad); color: #fff; border-radius: 18px; padding: 18px; margin-bottom: 12px; text-align: center; }
.warn911 .big { font-size: 1.5rem; font-weight: 900; line-height: 1.2; }
.warn911 a { display: block; margin-top: 12px; background: #fff; color: var(--bad); font-weight: 900; font-size: 1.3rem; padding: 14px; border-radius: 14px; text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-bottom)); transform: translateX(-50%); background: #14243A; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 20; max-width: 90%; text-align: center; }
.overlay { position: fixed; inset: 0; background: rgba(10,25,45,.55); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + var(--safe-bottom)); }
.sheet h2 { margin-bottom: 8px; }
.pinbox { font-size: 2.2rem; font-weight: 900; letter-spacing: .3em; text-align: center; background: var(--blue-soft); border-radius: 14px; padding: 12px; margin: 10px 0; }
.err { color: var(--bad); font-weight: 700; margin: 8px 0; min-height: 1.2em; }
/* login */
.login { max-width: 420px; margin: 0 auto; padding: calc(34px + var(--safe-top)) 20px 30px; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 20px; }
.login h1 { font-size: 1.5rem; margin: 12px 0 2px; } .login .sub { color: var(--soft); margin-bottom: 18px; }
.dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0 6px; }
.dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--blue); }
.dots i.on { background: var(--blue); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pad button { min-height: 62px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 1.5rem; font-weight: 800; }
.pad button.fn { font-size: 1rem; color: var(--soft); }
.uline { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill-btn { border: 2px solid var(--line); border-radius: 12px; padding: 6px 12px; font-weight: 800; font-size: .85rem; background: #fff; }

.name-list { text-align: left; margin-top: 8px; }
.name-btn { display: block; width: 100%; min-height: 62px; border-radius: 16px; background: #fff; border: 2px solid var(--line); font-weight: 800; font-size: 1.2rem; margin-bottom: 10px; color: var(--ink); }
.name-btn:active { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-dark); }
.login .who { font-size: 1.45rem; font-weight: 800; margin: 8px 0 2px; }
.login .back { color: var(--blue); font-weight: 800; font-size: 1.05rem; min-height: 44px; padding: 8px 12px; margin: 4px auto 8px; }
