:root {
  --fg: #141a22; --muted: #5b6573; --faint: #8b94a1; --line: #e2e6eb; --line2: #d0d7df; --soft: #f4f6f9; --bg: #fff;
  --primary: #1d5bd8; --primary-d: #1748ad; --primary-soft: #eaf1fd;
  --c-waiting: #b45d00; --c-checking: #1d5bd8; --c-done: #11805b; --c-late: #cf2a2a;
  --blue: #1d5bd8; --amber: #c06400; --green: #11805b; --red: #cf2a2a; --gray: #5b6573;
  --dark: #1a2029;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--primary); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
svg:not(.mark) { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mark { width: 26px; height: 26px; flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.c-late { color: var(--c-late); font-weight: 700; }
.c-warn { color: var(--amber); font-weight: 600; }
.empty { margin: 0; padding: 22px 16px; color: var(--muted); font-size: 14px; text-align: center; }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.warnline { margin: 0; background: #fff4e5; color: #7a4300; border-radius: 8px; padding: 9px 11px; font-size: 13.5px; }
.purged { color: var(--faint); font-weight: 600; }
.link { border: 0; background: none; padding: 0; color: var(--primary); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
kbd { font: 600 12px ui-monospace, Menlo, monospace; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: #fff; color: var(--fg); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.wm { font-weight: 800; font-size: 17px; letter-spacing: -.06em; color: var(--fg); line-height: 1; }
.wm em { font-style: normal; color: var(--primary); }
.role { font-size: 12.5px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); white-space: nowrap; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 650; font-size: 14px; text-decoration: none; color: var(--fg); white-space: nowrap; }
.btn:hover { border-color: #aeb8c4; }
.btn svg:not(.mark) { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-o { color: var(--red); border-color: #efc2c2; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.big { width: 100%; padding: 12px; font-size: 16px; }
.btn.send { padding: 10px 18px; font-size: 15px; }
.in { width: 100%; min-width: 0; border: 1px solid var(--line2); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 14.5px; background: #fff; color: inherit; }
.in:focus { outline: 2px solid rgba(29, 91, 216, .22); border-color: var(--primary); }
.in.bad { border-color: var(--red); background: #fff7f7; }
textarea.in { resize: vertical; min-height: 80px; line-height: 1.5; }
select.in { width: auto; padding-right: 28px; }
.fg { display: grid; gap: 6px; min-width: 0; margin: 0; border: 0; padding: 0; }
.fg > label, .fl { font-size: 13px; font-weight: 700; color: #343c47; padding: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: #fff; color: var(--fg); box-shadow: 0 1px 2px rgba(16, 24, 40, .14); }
.seg.sm button { padding: 5px 9px; font-size: 13px; }
.seg button i { font-style: normal; color: var(--faint); font-weight: 600; margin-left: 4px; }
.seg button.has-late i { color: var(--c-late); }
.chip { border: 1px solid var(--line2); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 13px; white-space: nowrap; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.cnt { font-style: normal; background: var(--c-late); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 17px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #b8c0ca; display: inline-block; flex: none; }
.dot.on { background: #18a058; box-shadow: 0 0 0 3px rgba(24, 160, 88, .2); }

/* Status and results */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.waiting { color: var(--c-waiting); } .st.checking { color: var(--c-checking); } .st.done { color: var(--c-done); } .st.late { color: var(--c-late); }
.st.off { color: #8a929c; } .st.idle { color: var(--muted); }
.st.waiting::before, .st.late::before { animation: blink 1.1s infinite; }
.tone-blue { --tc: var(--blue); } .tone-amber { --tc: var(--amber); } .tone-green { --tc: var(--green); } .tone-red { --tc: var(--red); } .tone-gray { --tc: var(--gray); }
.rt { color: var(--tc); font-weight: 700; }
@keyframes blink { 50% { opacity: .25; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sc) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

/* Shared request pieces */
.rq-title { font-size: 17px; margin: 0; line-height: 1.35; }
.rq-text { margin: 0; font-size: 14.5px; white-space: pre-wrap; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.ph { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #eef0f3; aspect-ratio: 4 / 3; cursor: zoom-in; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 4px; font-size: 11.5px; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.kv { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.tl { list-style: none; margin: 0; padding: 0 0 0 2px; display: grid; }
.tl li { position: relative; padding: 0 0 12px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; font-size: 14px; }
.tl li::before { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--c-done); }
.tl li::after { content: ""; position: absolute; left: 4px; top: 17px; bottom: 0; width: 1px; background: var(--line2); }
.tl li:last-child { padding-bottom: 0; }
.tl li:last-child::after { display: none; }
.tl li.pending::before { background: #fff; border: 2px solid #b8c0ca; width: 9px; height: 9px; box-sizing: border-box; }
.tl li.pending .tl-t { color: var(--faint); }
.tl li.warn::before { background: var(--c-late); }
.tl li.warn .tl-t { color: var(--c-late); }
.tl li.edit::before { background: var(--amber); }
.tl-t { font-weight: 650; }
.tl-at { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-d { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.live { --sc: var(--c-waiting); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--sc); }
.live.s-checking { --sc: var(--c-checking); } .live.s-late { --sc: var(--c-late); }
.live-m { display: grid; gap: 1px; min-width: 0; }
.live b { font-size: 16px; color: var(--sc); }
.live-m span { font-size: 13px; color: var(--muted); }
.live-t { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--sc); flex: none; animation: ping 1.4s infinite; }
.res { padding: 12px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--tc); display: grid; gap: 1px; }
.res small { color: var(--muted); font-size: 12.5px; }
.res b { font-size: 21px; color: var(--tc); letter-spacing: -.3px; }
.res p { margin: 2px 0 0; font-size: 14px; }
.res.flash { animation: resflash 1.5s ease-out; }
@keyframes resflash { 0% { background: color-mix(in srgb, var(--tc) 18%, #fff); transform: scale(1.01); } 100% { background: #fff; transform: none; } }

/* Toasts */
#toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: block; background: rgba(20, 26, 34, .95); color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); text-decoration: none; transition: opacity .3s, transform .3s; animation: tin .25s ease-out; }
.toast.ok { background: #0f6a44; }
.toast.bad { background: #b42323; }
.toast.result { display: grid; gap: 1px; background: #fff; color: var(--fg); border: 1px solid var(--line); border-left: 5px solid var(--tc, var(--primary)); }
.toast.result.late { --tc: var(--red); }
.toast.result small { color: var(--muted); font-size: 12.5px; }
.toast.result b { font-size: 17px; }
.toast.result.late b { color: var(--red); }
.toast.result span { font-size: 13px; color: var(--muted); }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* Dialog */
.dlg-wrap { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg-bg { position: absolute; inset: 0; background: rgba(12, 16, 22, .45); }
.dlg { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.dlg form { display: grid; gap: 14px; }
.dlg h3 { margin: 0 0 4px; font-size: 18px; }
.dlg p { margin: 0; }
.dlg > p, .dlg > table { margin-bottom: 12px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ck { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ck small { color: var(--muted); }
.url-box { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; word-break: break-all; }

/* Photo viewer */
.viewer { position: fixed; inset: 0; z-index: 250; background: rgba(8, 10, 14, .95); display: flex; flex-direction: column; color: #fff; }
.v-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-size: 14px; }
.v-count { font-variant-numeric: tabular-nums; color: #c9d1dc; }
.v-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.v-tools { display: flex; gap: 6px; }
.v-tools button { border: 1px solid #3a4250; background: #1d232c; color: #fff; border-radius: 8px; min-width: 40px; height: 38px; padding: 0 11px; font-size: 15px; font-weight: 600; }
.v-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.v-stage img { max-width: 100%; max-height: 100%; transform-origin: 50% 50%; will-change: transform; -webkit-user-drag: none; user-select: none; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 30px; line-height: 1; }
.v-nav.prev { left: 10px; } .v-nav.next { right: 10px; }
.v-hint { flex: none; text-align: center; font-size: 12.5px; color: #9aa4b1; padding: 8px 12px 12px; }

/* ---------- Outsourced CS ---------- */
body.v-cs, body.v-field { height: 100vh; height: 100dvh; overflow: hidden; }
.cs { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--soft); }
.cs-top { flex: none; height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.home { text-decoration: none; color: var(--muted); font-size: 24px; line-height: 1; margin-right: -2px; }
.cs-nav { display: flex; gap: 4px; margin-left: auto; }
.cs-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: 14px; white-space: nowrap; }
.cs-nav a.on { background: var(--primary-soft); color: var(--primary); }
.acct { font-size: 12.5px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; white-space: nowrap; }
.cs-body { flex: 1; min-height: 0; display: flex; }
.cs-body.wide { display: grid; grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); }
.cs-list { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.cs-lh { flex: none; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.cs-items { flex: 1; min-height: 0; overflow-y: auto; }
.cs-pane { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.empty-pane { padding: 40px 20px; text-align: center; color: var(--muted); }
.ri { position: relative; display: grid; gap: 3px; padding: 11px 14px 12px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.ri:hover { background: #f8fafc; }
.ri.sel { background: var(--primary-soft); }
.ri.unread::before { content: ""; position: absolute; left: 7px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.ri-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ri-top time { margin-left: auto; white-space: nowrap; }
.ri-title { font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-sub { font-size: 12.5px; color: var(--muted); }
.ri-res { font-size: 13px; color: var(--tc); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-res i { font-style: normal; background: var(--primary); color: #fff; border-radius: 5px; padding: 0 5px; margin-right: 6px; font-size: 11.5px; }
.ri-res em { font-style: normal; font-weight: 500; color: var(--muted); }
.cd { width: 100%; max-width: 820px; padding: 16px 20px 28px; display: grid; gap: 14px; align-content: start; }
.cd-head { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.back { text-decoration: none; color: var(--primary); font-weight: 700; font-size: 14px; }
.cd-body { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; }
.cd-tl { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.cd-tl h3 { margin: 0 0 10px; font-size: 14px; }
.cd-foot { display: flex; gap: 8px; }

.nf { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.nf-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; display: grid; gap: 14px; align-content: start; }
.nf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dev-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; border-radius: 10px; }
.dev-pick.bad { outline: 2px solid var(--red); outline-offset: 2px; }
.dp { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line2); background: #fff; border-radius: 9px; padding: 9px 11px; }
.dp b { font-size: 14px; }
.dp small { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dp.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-soft); }
.paste-zone { display: grid; gap: 10px; border: 1.5px dashed #b6c0cc; border-radius: 10px; padding: 12px; background: #fafbfc; outline: none; }
.paste-zone:focus, .paste-zone.drag { border-color: var(--primary); background: var(--primary-soft); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 86px; height: 86px; }
.thumb.fresh { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.ph-btn { width: 100%; height: 100%; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #eee; cursor: zoom-in; }
.ph-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: var(--dark); color: #fff; font-size: 13px; line-height: 1; padding: 0; }
.paste-hint { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.paste-hint > svg:not(.mark) { width: 22px; height: 22px; color: var(--primary); margin-top: 1px; }
.paste-hint div { display: grid; gap: 2px; }
.paste-hint b { color: var(--fg); font-size: 14px; }
.nf-bar { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 18px 12px; background: #fff; border-top: 1px solid var(--line); }
.author { display: flex; align-items: center; gap: 8px; min-width: 0; }
.author label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.author .in { max-width: 220px; }
.recent { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.recent > span { margin-right: 2px; }
.nf-err { grid-column: 1 / -1; margin: 0; color: var(--red); font-size: 13px; font-weight: 600; }
.nf-err:empty { display: none; }

.lock { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; background: var(--soft); }
.lock-card { width: min(380px, 100%); display: grid; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px 22px; }
.lock-card h1 { font-size: 20px; margin: 0; }

/* ---------- Field device ---------- */
.fs { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #eef1f4; }
.fh { flex: none; height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--dark); color: #fff; }
.fh .mark { width: 28px; height: 28px; }
.fh-dev { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.fh-dev b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-dev small { font-size: 11.5px; color: #a9b3c1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #c9d1dc; white-space: nowrap; }
.fh-sound { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #3b4553; background: #252d38; color: #fff; border-radius: 8px; padding: 7px 11px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.fh-sound.on { border-color: #2f7d55; background: #163a29; color: #a6f0c8; }
.fh-clock { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 700; color: #dfe5ec; }
body.alerting .fh { animation: hdr 1s steps(2, jump-none) infinite; }
body.alerting.late .fh { animation-name: hdrlate; }
@keyframes hdr { 50% { background: #b45d00; } }
@keyframes hdrlate { 50% { background: #b42323; } }
.strip { flex: none; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: #ffd34d; color: #3d2c00; font-weight: 700; font-size: 14px; padding: 10px 14px; text-align: left; }
.strip svg:not(.mark) { width: 20px; height: 20px; }
.fb { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.fb.wide { display: grid; grid-template-columns: clamp(210px, 31%, 340px) minmax(0, 1fr); }
.f-list { flex: 1; min-height: 0; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); }
.f-tabs { position: sticky; top: 0; z-index: 1; display: flex; background: #fff; border-bottom: 1px solid var(--line); }
.f-tabs a { flex: 1; text-align: center; padding: 12px 6px 10px; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.f-tabs a.on { color: var(--fg); border-color: var(--fg); }
.f-tabs a i { font-style: normal; margin-left: 5px; color: var(--primary); }
.f-note { margin: 0; padding: 8px 12px; font-size: 12.5px; color: var(--muted); background: var(--soft); border-bottom: 1px solid var(--line); }
.f-sub { padding: 14px 12px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbfc; }
.fi { display: grid; gap: 3px; padding: 11px 12px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; text-decoration: none; color: inherit; }
.fi:hover { background: #f7f9fb; }
.fi.sel { background: #eaf1fd; border-left-color: var(--primary); }
.fi.ring { background: #fff5e6; border-left-color: var(--amber); }
.fi.s-late.ring { background: #fff0f0; border-left-color: var(--red); }
.fi-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.fi-top time { margin-left: auto; white-space: nowrap; }
.fi b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi small { font-size: 12.5px; color: var(--muted); }
.f-detail { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.fd { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fd > .back { padding: 10px 14px 0; }
.fd-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.fd-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12.5px; color: var(--muted); }
.lat { color: var(--c-done); font-weight: 700; }
.fd .rq-title { font-size: 19px; }
.fd .rq-text { font-size: 15.5px; }
.fd .ph-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.fd .kv { background: #fff; border-radius: 10px; padding: 10px 12px; }
.revs { background: #fff8ec; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.revs ul { margin: 4px 0 0; padding-left: 18px; }
.fd-act { flex: none; display: grid; gap: 9px; padding: 10px 14px 12px; background: #fff; border-top: 1px solid var(--line); }
.memo-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.memo-row .in { flex: 1 1 200px; font-size: 15px; padding: 10px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rbtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rb { min-height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 8px 6px; border: 0; border-radius: 12px; background: var(--tc); color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); transition: transform .06s, box-shadow .06s; }
.rb b { font-size: 20px; letter-spacing: -.3px; white-space: nowrap; }
.rb small { font-size: 12.5px; opacity: .9; }
.rb:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.rb.cur, .rb:disabled { opacity: .35; box-shadow: none; }
.f-err { margin: 0; color: var(--red); font-size: 13.5px; font-weight: 700; }
.f-err:empty { display: none; }
.fdone { display: flex; align-items: center; gap: 12px; border-left: 5px solid var(--tc); padding: 4px 0 4px 12px; }
.fdone > div { flex: 1; min-width: 0; display: grid; }
.fdone small { color: var(--muted); font-size: 12.5px; }
.fdone b { font-size: 21px; color: var(--tc); }
.fdone span { font-size: 14px; }
.edit-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.edit-head span { font-size: 13px; color: var(--muted); }
.edit-head .link { margin-left: auto; }
.f-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.f-empty > svg:not(.mark) { width: 44px; height: 44px; color: #a3adb9; stroke-width: 1.4; margin-bottom: 4px; }
.f-empty b { color: var(--fg); font-size: 17px; }
.f-alert-host { position: absolute; inset: 0; z-index: 20; }
.f-alert-host:empty { display: none; }
.fa { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(15, 20, 28, .55); }
.fa-card { position: relative; width: min(460px, 100%); max-height: 100%; overflow: auto; display: grid; justify-items: center; gap: 3px; text-align: center; background: #fff; border-radius: 16px; padding: 18px 20px 16px; border: 4px solid var(--amber); animation: card 1.2s ease-in-out infinite; }
.fa.late .fa-card { border-color: var(--red); animation-name: cardlate; }
.fa-kind { font-size: 14px; font-weight: 800; color: var(--amber); }
.fa.late .fa-kind { color: var(--red); }
.fa-type { font-size: 13px; color: var(--muted); }
.fa-title { font-size: 21px; line-height: 1.3; margin: 2px 0; }
.fa-from { font-size: 13px; color: var(--muted); }
.fa-ok { width: 100%; min-height: 60px; margin-top: 10px; border: 0; border-radius: 12px; background: var(--fg); color: #fff; font-size: 21px; font-weight: 800; letter-spacing: 2px; }
.fa-more { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.fa-mute { font-size: 12.5px; color: #8a5a00; margin-top: 2px; }
@keyframes card { 50% { box-shadow: 0 0 0 12px rgba(192, 100, 0, .22); } }
@keyframes cardlate { 50% { box-shadow: 0 0 0 12px rgba(207, 42, 42, .22); } }
.void { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: #eef1f4; text-align: center; }
.void > div { display: grid; justify-items: center; gap: 8px; max-width: 400px; }
.void svg:not(.mark) { width: 40px; height: 40px; color: var(--muted); margin-top: 18px; }
.void b { font-size: 19px; }
.void p { margin: 0; color: var(--muted); }

/* ---------- Admin ---------- */
body.v-admin { background: #f4f6f8; }
.adm-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.adm-top { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.adm-bar { height: 54px; display: flex; align-items: center; gap: 12px; }
.adm-me { margin-left: auto; font-size: 13px; color: var(--muted); }
.adm-tabs { display: flex; gap: 22px; height: 44px; overflow-x: auto; scrollbar-width: none; }
.adm-tabs a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14.5px; white-space: nowrap; }
.adm-tabs a.on { color: var(--fg); border-color: var(--fg); font-weight: 700; }
.adm-body { padding-top: 20px; padding-bottom: 60px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 0; }
.stats > div { display: flex; flex-direction: column; padding: 12px 16px; border-right: 1px solid var(--line); min-width: 0; }
.stats > div:last-child { border-right: 0; }
.stats span { font-size: 12.5px; color: var(--muted); }
.stats b { font-size: 20px; }
.stats .warn b { color: var(--c-late); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; align-items: center; }
.filters .in { padding: 7px 10px; font-size: 14px; }
.filters .search { flex: 1 1 220px; width: auto; }
.count-line { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.split.has-pick { grid-template-columns: minmax(0, 1fr) 400px; }
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; font-size: 12px; color: var(--muted); }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.mono { white-space: nowrap; }
.split.has-pick .tbl .opt { display: none; }
.split.has-pick .tbl .cell-main { min-width: 160px; max-width: 240px; }
.tbl .cell-main { min-width: 200px; max-width: 340px; }
.tbl .cell-main b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .cell-main a { color: inherit; text-decoration: none; }
.tbl tbody tr[data-go] { cursor: pointer; }
.tbl tbody tr[data-go]:hover { background: #f7f9fc; }
.tbl tr.sel { background: #eef4ff !important; }
.tbl tr.dim td { color: var(--muted); }
.tbl.small { font-size: 13px; }
.tbl.small td, .tbl.small th { padding: 7px 10px; }
.detail { position: sticky; top: 116px; max-height: calc(100vh - 132px); overflow: auto; display: grid; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.d-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.detail p { margin: 0; }
.detail h4 { margin: 4px 0 0; font-size: 13px; }
.d-content { display: grid; gap: 8px; }
.d-content .rq-title { font-size: 15.5px; }
.d-content .rq-text { font-size: 14px; }
.d-content .ph-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.sec { margin-bottom: 28px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font-size: 17px; }
.sec-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); max-width: 760px; }
.sec-act { display: flex; gap: 8px; flex-wrap: wrap; }
.sec.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.url-cell { white-space: nowrap; }
.url { margin-right: 8px; color: #343c47; }
.url-act { display: inline-flex; gap: 6px; vertical-align: middle; }
.perm td:first-child { font-weight: 600; }
.perm .yes { color: var(--c-done); font-weight: 700; }
.perm .no { color: var(--faint); }
.log { list-style: none; margin: 0; padding: 4px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.log li { display: grid; gap: 1px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.log li:last-child { border-bottom: 0; }
.log li span { font-size: 12px; color: var(--muted); }

/* ---------- First screen ---------- */
body.v-landing { background: #e9edf2; }
.land { max-width: 1480px; margin: 0 auto; padding: 20px 24px 28px; }
.land-brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.land-brand .mark { width: 32px; height: 32px; }
.land-brand .wm { font-size: 22px; }
.land-brand > span:last-child { font-size: 13.5px; color: var(--muted); padding-left: 12px; border-left: 1px solid #c9d1da; }
.land-head h1 { margin: 0 0 4px; font-size: 23px; letter-spacing: -.4px; line-height: 1.3; }
.land-head p { margin: 0; color: var(--muted); font-size: 14.5px; }
.land-stage { margin-top: 16px; display: flex; gap: 28px; align-items: flex-start; justify-content: center; }
.lp { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.lp-cs { flex: 1 1 auto; min-width: 400px; max-width: 640px; }
.lp-tab { flex: none; }
.bframe { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #d3d9e0; box-shadow: 0 18px 40px rgba(16, 24, 40, .14); }
.bbar { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #f1f3f6; border-bottom: 1px solid #dde2e8; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.bbar i { width: 10px; height: 10px; border-radius: 50%; background: #cfd5dc; flex: none; }
.bbar span { margin-left: 8px; }
.bframe iframe { display: block; width: 100%; height: calc(var(--th, 520px) - 2px); border: 0; }
.tablet { position: relative; background: #161a20; border-radius: 24px; padding: 16px; box-shadow: 0 0 0 2px #2b313a inset, 0 22px 48px rgba(16, 24, 40, .3); }
.tablet::before { content: ""; position: absolute; left: 6px; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: #3a414c; }
.tablet iframe { display: block; width: var(--tw, 760px); height: var(--th, 475px); border: 0; border-radius: 6px; background: #fff; }
.lp figcaption { margin-top: 10px; display: flex; gap: 10px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13.5px; }
.lp figcaption a { font-weight: 700; text-decoration: none; }
.lp figcaption > span { color: var(--muted); }
.dev-switch { display: inline-flex; flex-wrap: wrap; gap: 3px; background: #dde3ea; border-radius: 9px; padding: 3px; }
.dev-switch button { border: 0; background: none; border-radius: 7px; padding: 5px 10px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dev-switch button.on { background: #fff; color: var(--fg); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.land-links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 30px; font-size: 14px; }
.ll { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.ll b { font-size: 12.5px; color: var(--muted); }
.ll a { font-weight: 600; text-decoration: none; }
.ll a:hover { text-decoration: underline; }
.land-foot { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13px; color: var(--muted); }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .split.has-pick { grid-template-columns: minmax(0, 1fr); }
  .detail { position: static; max-height: none; }
}
@media (max-width: 959px) {
  .land { padding: 18px 16px 24px; }
  .land-head h1 { font-size: 20px; }
  .land-stage { flex-direction: column; align-items: stretch; gap: 22px; }
  .lp-cs { min-width: 0; max-width: none; }
  .bframe iframe { height: 620px; }
  .tablet { border-radius: 18px; padding: 8px; }
  .tablet::before { display: none; }
  .tablet iframe { width: 100%; height: 620px; }
  .sec.two { grid-template-columns: minmax(0, 1fr); }
  .adm-in { padding: 0 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(2n) { border-right: 0; }
  .stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats.three { grid-template-columns: minmax(0, 1fr); }
  .stats.three > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats.three > div:last-child { border-bottom: 0; }
}
@media (max-width: 640px) {
  .cs-top { gap: 8px; padding: 0 12px; }
  .acct { display: none; }
  .nf-scroll { padding: 14px; }
  .nf-bar { padding: 10px 14px 12px; }
  .cd { padding: 14px 14px 24px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .fh { gap: 10px; padding: 0 10px; }
  .fh-live span, .fh-dev small { display: none; }
  .fh-sound { padding: 7px 9px; }
  .rbtns { gap: 8px; }
  .rb b { font-size: 17px; }
  .rb small { font-size: 11.5px; }
  .adm-bar .role { display: none; }
  .land-brand > span:last-child { border-left: 0; padding-left: 0; flex-basis: 100%; }
  .kv { grid-template-columns: 92px minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .cs-top .role { display: none; }
  .cs-nav a { padding: 6px 9px; }
  .fh-sound span { display: none; }
}
/* Short tablet screens (the frame on the first screen, landscape tablets) */
@media (min-width: 640px) and (max-height: 560px) {
  .fd-scroll { padding: 10px 14px; gap: 8px; }
  .fd .rq-title { font-size: 17px; }
  .fd .rq-text { font-size: 14.5px; }
  .fd .ph-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .fd-act { padding: 8px 12px 10px; gap: 7px; }
  .memo-row .in { padding: 8px 10px; font-size: 14px; }
  .rb { min-height: 56px; }
  .rb b { font-size: 18px; }
  .fi { padding: 9px 10px; }
  .fa-card { padding: 14px 16px 12px; }
  .fa-title { font-size: 19px; }
  .fa-ok { min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
