/* OSJ Command - look and feel. OSJ palette: black / steel / red. */
:root {
  --black: #000000; --gunmetal: #242323; --steel: #595858; --silver: #A4A4A4; --chrome: #D4D5D4; --white: #FFFFFF;
  --red: #D51011; --ember: #EF191D; --blood: #A50C0E; --crimson: #710508; --oxblood: #3F0303;
  --ok: #4CC38A; --ok-bg: #0F2A1E; --ok-text: #7EE2B0; --bad-text: #FFB3B3; --warn: #E3A008; --warn-bg: #2E2105; --warn-text: #F5D27A;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--black); color: var(--chrome); font-family: var(--font); font-size: 15px; }
body { min-height: 100vh; }
a { color: var(--chrome); }
button, input, select, textarea { font: inherit; }
.boot { height: 100vh; display: flex; align-items: center; justify-content: center; font-size: 28px; letter-spacing: 3px; color: var(--white); font-weight: 800; }
.boot b, .brand b { color: var(--ember); }

.screen { max-width: 560px; margin: 0 auto; padding: calc(16px + var(--safe-t)) 18px calc(160px + var(--safe-b)); }
.screen.center { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-bottom: 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: 2px; color: var(--white); }
.sub { font-size: 12.5px; color: var(--silver); }
h1 { font-size: 24px; margin: 0 0 4px; color: var(--white); letter-spacing: .5px; }
h2 { font-size: 13px; margin: 22px 0 10px; color: var(--silver); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; }
p { line-height: 1.5; margin: 0 0 12px; }
.muted { color: var(--silver); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }

.back { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--gunmetal); border: 1px solid var(--steel); color: var(--chrome); text-decoration: none; flex-shrink: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }

.card { display: block; background: var(--gunmetal); border: 1px solid var(--steel); border-radius: 14px; padding: 14px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.card.tap:active { background: #2e2d2d; }
.card-title { font-size: 18px; font-weight: 800; color: var(--white); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stat-label { font-size: 11px; color: var(--silver); }
.stat-value { font-family: var(--mono); font-size: 15px; color: var(--white); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 4px; }
.pill.ok { background: var(--ok-bg); color: var(--ok-text); } .pill.ok .dot { background: var(--ok); }
.pill.bad { background: var(--oxblood); color: var(--bad-text); } .pill.bad .dot { background: var(--ember); }
.pill.unk { background: #1b1b1b; color: var(--silver); border: 1px solid var(--steel); } .pill.unk .dot { background: var(--silver); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.plain { background: #1b1b1b; color: var(--chrome); border: 1px solid var(--steel); font-weight: 600; }

.filters { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--steel); background: var(--gunmetal); color: var(--chrome); font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--red); border-color: var(--red); color: var(--white); }

.notice { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; line-height: 1.45; }
.notice.bad { background: var(--oxblood); border: 1px solid var(--blood); color: var(--white); }
.notice.info { background: var(--gunmetal); border: 1px solid var(--steel); }
.notice.warn { background: var(--warn-bg); border: 1px solid #6b5212; color: var(--warn-text); }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--chrome); }
input[type=text], input[type=password], input[type=url], select, textarea {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px; background: var(--gunmetal); border: 1px solid var(--steel); color: var(--white); font-size: 16px; outline: none;
}
textarea { padding: 12px 14px; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--ember); }
input.code { font-family: var(--mono); font-size: 22px; letter-spacing: 6px; text-align: center; }
.hint { font-size: 12px; color: var(--silver); margin-top: 6px; line-height: 1.4; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--steel); background: var(--gunmetal); color: var(--white); font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; margin-top: 14px; }
.btn.primary { background: var(--red); border-color: var(--red); letter-spacing: 1px; }
.btn.danger { background: var(--crimson); border-color: var(--blood); }
.btn.small { min-height: 40px; width: auto; padding: 0 14px; margin-top: 0; font-size: 13px; }
.btn:disabled { opacity: .55; }
.err { color: var(--bad-text); font-size: 13.5px; margin-top: 10px; min-height: 18px; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #1d1d1d; text-decoration: none; color: inherit; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer; min-height: 56px; }
.list { background: var(--gunmetal); border: 1px solid var(--steel); border-radius: 14px; overflow: hidden; }
.list .list-item:last-child { border-bottom: 0; }
.li-title { color: var(--white); font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { color: var(--silver); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--steel); flex-shrink: 0; }

.report-text { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; background: var(--gunmetal); border: 1px solid var(--steel); border-radius: 12px; padding: 14px; color: var(--chrome); }

.keybox { font-family: var(--mono); font-size: 17px; letter-spacing: 2px; word-break: break-all; background: var(--gunmetal); border: 1px dashed var(--ember); border-radius: 12px; padding: 14px; color: var(--white); text-align: center; }
.steps { padding-left: 20px; margin: 8px 0 0; line-height: 1.55; }
.steps li { margin-bottom: 6px; }

.checks label { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; padding: 10px 0; border-bottom: 1px solid #1d1d1d; }
.checks input { width: 22px; height: 22px; accent-color: var(--red); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.96); border-top: 1px solid var(--gunmetal); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 6px calc(8px + var(--safe-b)); z-index: 20; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; color: var(--silver); text-decoration: none; font-size: 11px; font-weight: 600; }
.tab.on { color: var(--ember); }
.tab svg { width: 22px; height: 22px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--gunmetal); border-top: 1px solid var(--steel); border-radius: 20px 20px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--steel); margin: 0 auto 12px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 14px; margin-top: 10px; }
.kv dt { color: var(--silver); } .kv dd { margin: 0; color: var(--white); word-break: break-all; }

#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--white); color: var(--black); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; }
.empty { text-align: center; color: var(--silver); padding: 28px 10px; }
