/* Nodable's page. Colours are tokens; the dark scheme redefines them. */
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 10px 0; }
label.check input { width: auto; margin-top: 2px; }
:root { --bg:#fff; --panel:#f8f9fb; --line:#e2e6ed; --tx:#1e293b; --muted:#64748b; --blue:#2563eb; --red:#dc2626; --green:#16a34a; }
@media (prefers-color-scheme: dark) { :root { --bg:#0d1117; --panel:#161b22; --line:#2d333b; --tx:#e6edf3; --muted:#9aa5b1; --blue:#60a5fa; --red:#f87171; --green:#4ade80; } }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--tx); font:15px/1.6 -apple-system,"PingFang SC",sans-serif; }
main { max-width:960px; margin:0 auto; padding:24px 16px 64px; }
.hidden { display:none !important; }
label.indent { margin-left: 1.5em; }
/* Business modules switched off by an admin (modules.js sets the classes). */
body.mod-off-payouts #wd-box, body.mod-off-identity #id-go, body.mod-off-identity #id-state,
body.mod-off-invoices #iv-box, body.mod-off-invoices #ia-box, body.mod-off-referrals #rf-box, body.mod-off-enterprise #ent,
body.mod-off-flows #a-flow { display:none !important; }
.captcha { margin:8px 0; min-height:65px; }

/* top bar */
header { position:sticky; top:0; z-index:10; background:var(--bg); border-bottom:1px solid var(--line); }
.bar { max-width:960px; margin:0 auto; padding:10px 16px; display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.brand { font-weight:700; font-size:17px; }
nav { display:flex; gap:4px; flex:1; overflow-x:auto; }
nav a { padding:6px 12px; border-radius:8px; color:var(--muted); text-decoration:none; white-space:nowrap; position:relative; }
nav a:hover { background:var(--panel); color:var(--tx); }
nav a.active { background:var(--panel); color:var(--blue); font-weight:600; }
nav a.live::after { content:""; position:absolute; top:6px; right:4px; width:7px; height:7px; border-radius:50%; background:var(--red); }
.me { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--muted); white-space:nowrap; }
.me button { margin:0; }
nav { min-width:0; }
/* narrow windows: brand + account on the first row, all pages on the second */
@media (max-width:860px) {
  .bar { gap:8px 12px; }
  .me { margin-left:auto; }
  nav { order:3; flex-basis:100%; }
  /* only the account's words are cut short: never the menus' boxes */
  .me .who-long { overflow:hidden; text-overflow:ellipsis; max-width:60vw; }
}

/* pages */
.page > h1 { font-size:20px; margin:4px 0 2px; }
.page > .lead { color:var(--muted); margin:0 0 18px; font-size:14px; }
/* second-level menu: a page's sections (subnav.js), under the top bar */
nav.subnav { position:sticky; top:var(--topbar-h, 0px); z-index:9; display:flex; flex-wrap:wrap; gap:6px; flex:none;
  margin:-6px -16px 14px; padding:8px 16px; background:var(--bg); border-bottom:1px solid var(--line); }
/* phones: one row that scrolls sideways, so the menu stays short */
@media (max-width:700px) { nav.subnav { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; } }
nav.subnav::-webkit-scrollbar { display:none; }
nav.subnav button { margin:0; padding:4px 12px; border:1px solid var(--line); border-radius:999px; background:var(--bg);
  color:var(--muted); font-size:13px; white-space:nowrap; }
nav.subnav button:hover { color:var(--tx); background:var(--panel); }
nav.subnav button.active { color:var(--blue); border-color:var(--blue); background:var(--panel); font-weight:600; }
@media (max-width:860px) { nav.subnav { order:0; flex-basis:auto; } }
body.mod-off-network_filters .trust-net, body.mod-off-reliability .trust-score { display:none; }
section { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:18px 20px; margin-bottom:16px; }
h2 { font-size:15px; margin:0 0 12px; }
h3 { font-size:14px; margin:16px 0 6px; }
.login { max-width:420px; margin:12vh auto 0; }
.login h1 { font-size:24px; margin:0 0 4px; }

label { display:block; font-size:13px; color:var(--muted); margin:8px 0 4px; }
input, select { width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--tx); font:inherit; }
input[type=file] { padding:6px; }
button { margin-top:12px; padding:8px 16px; border:0; border-radius:8px; background:var(--blue); color:#fff; font:inherit; cursor:pointer; }
button:disabled { opacity:.5; cursor:default; }
button.secondary { background:var(--panel); color:var(--tx); border:1px solid var(--line); }
button.small { margin:0 6px 4px 0; padding:4px 10px; font-size:13px; white-space:nowrap; }
.row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.row4 { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; }
@media (max-width:700px) { .row4 { grid-template-columns:1fr 1fr; } }
@media (max-width:600px) { .row { grid-template-columns:1fr; } }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); }
th { color:var(--muted); font-weight:500; font-size:12px; }
.table-wrap { overflow-x:auto; }
table.tasks { min-width:620px; }
pre { background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:12px; overflow:auto; font:12.5px/1.5 ui-monospace,Menlo,monospace; min-height:80px; white-space:pre-wrap; }
pre#t-log { max-height:360px; }
.status { font-size:13px; margin-top:8px; color:var(--muted); }
.status.err { color:var(--red); } .status.ok { color:var(--green); }
.stats { font:12px/1.6 ui-monospace,Menlo,monospace; color:var(--muted); margin-top:10px; }
.pill { display:inline-block; padding:1px 8px; border-radius:999px; font-size:12px; white-space:nowrap; }
.pill.free { background:rgba(22,163,74,.12); color:var(--green); }
.pill.busy { background:rgba(220,38,38,.1); color:var(--red); }
.pill.wait { background:rgba(37,99,235,.1); color:var(--blue); }
a.pill.pledge { text-decoration:none; cursor:pointer; }
details { margin-top:14px; } summary { cursor:pointer; color:var(--muted); font-size:14px; }
progress { width:100%; margin-top:10px; }
.kv { display:grid; grid-template-columns:90px minmax(0,1fr); gap:4px 12px; font-size:14px; margin:8px 0 12px; }
.kv dt { color:var(--muted); } .kv dd { margin:0; overflow-wrap:anywhere; }
#t-failures { font-size:13px; padding-left:20px; } #t-failures code { font-family:ui-monospace,Menlo,monospace; }

/* pairing code */
.pair { margin-top:14px; padding:14px 16px; border:1px dashed var(--blue); border-radius:10px; background:var(--bg); }
.pair .code { font:600 32px/1.2 ui-monospace,Menlo,monospace; letter-spacing:4px; color:var(--blue); }
.pair ol { padding-left:20px; margin:10px 0 4px; font-size:14px; }
.qrbox svg { width:200px; height:200px; display:block; margin:6px 0; background:#fff; border-radius:8px; }

/* remote screen */
.session { display:grid; grid-template-columns:minmax(0,1fr) 220px; gap:16px; align-items:start; }
@media (max-width:700px) { .session { grid-template-columns:1fr; } }
.screen { background:#000; border-radius:12px; display:flex; justify-content:center; min-height:200px; overflow:hidden; }
canvas#screen { max-width:100%; max-height:72vh; touch-action:none; cursor:pointer; display:block; }
.keys { display:flex; gap:8px; flex-wrap:wrap; }
.keys button { margin-top:0; background:var(--panel); color:var(--tx); border:1px solid var(--line); }
.keys button.recording { color:#dc2626; border-color:#dc2626; }
/* device logs */
#lg-panel .tools { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:8px 0; }
#lg-panel .tools button { margin:0; } #lg-panel .tools select { width:auto; } #lg-panel .tools input { flex:1 1 180px; width:auto; min-width:0; }
#lg-box { height:320px; overflow-y:auto; overscroll-behavior:contain; overflow-anchor:none; background:var(--bg); border:1px solid var(--line); border-radius:8px;
  padding:8px 10px; font:12px/1.5 ui-monospace,Menlo,monospace; }
#lg-box div { white-space:pre-wrap; overflow-wrap:anywhere; unicode-bidi:plaintext; }
#lg-box .lv-V, #lg-box .lv-D { color:var(--muted); } #lg-box .lv-W { color:#b45309; } #lg-box .lv-E, #lg-box .lv-F { color:var(--red); }
#lg-box .crash { background:rgba(220,38,38,.12); font-weight:600; } #lg-box .gap { color:var(--blue); }
.debt { background:rgba(220,38,38,.1); border-bottom:1px solid var(--red); color:var(--red); padding:8px 16px; display:flex; gap:12px; align-items:center; flex-wrap:wrap; font-size:14px; }
.debt button { margin:0; }
/* cleanup report */
dialog { border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--tx); width:min(720px,94vw); padding:18px 20px; }
dialog::backdrop { background:rgba(0,0,0,.45); }
/* session records */
.evidence-live { margin-top:10px; white-space:normal; }
#ev-dialog ul { margin:4px 0; padding-left:20px; font-size:13px; }
#ev-frames { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
#ev-frames figure { margin:0; cursor:pointer; } #ev-frames figcaption { font-size:11px; color:var(--muted); overflow-wrap:anywhere; }
#ev-frames canvas { display:block; width:100%; min-height:60px; background:#000; border-radius:6px; }
#ev-big { display:block; max-width:100%; max-height:70vh; margin:8px auto; border-radius:8px; }
dialog pre { min-height:0; max-height:200px; overflow-wrap:anywhere; }

/* ---- UX rework (docs/plans/ux-simplify.html) ---- */
:root { --amber:#b45309; --amber-bg:rgba(245,158,11,.12); --tabbar-h:0px; }
@media (prefers-color-scheme: dark) { :root { --amber:#fbbf24; --amber-bg:rgba(245,158,11,.16); } }
html, body { max-width:100%; overflow-x:clip; }
main { overflow-wrap:anywhere; }
code, pre { overflow-wrap:anywhere; }
.brand { color:var(--tx); text-decoration:none; }
button.primary { font-weight:600; }
button.danger { background:var(--red); }
button.icon { margin:0; padding:2px 10px; border-radius:999px; background:var(--panel); color:var(--tx); border:1px solid var(--line); font-weight:700; }
a { color:var(--blue); }
.hint { font-size:12px; color:var(--muted); margin:2px 0 0; }
.note { padding:8px 16px; font-size:13px; background:var(--panel); border-bottom:1px solid var(--line); }
.warnline { margin:8px 0; padding:8px 12px; border-radius:8px; background:var(--amber-bg); color:var(--amber); font-size:14px; display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.warnline button { margin:0; }
.okline { margin:8px 0; padding:8px 12px; border-radius:8px; background:rgba(22,163,74,.1); color:var(--green); font-size:14px; }
.safety { font-size:13px; color:var(--muted); margin:8px 0; }
.count { display:inline-block; min-width:18px; padding:0 5px; border-radius:999px; background:var(--red); color:#fff; font-size:11px; line-height:18px; text-align:center; }
.chip { display:inline-flex; gap:4px; align-items:center; padding:2px 10px; border-radius:999px; font-size:13px; white-space:nowrap; }
.chip.live { background:rgba(22,163,74,.12); color:var(--green); cursor:pointer; border:0; margin:0; }
.me .bal { color:var(--tx); font-weight:600; }

/* menus: 更多, 我 */
.menuwrap { position:relative; }
/* header (z-index 10) is above the page; a menu is above the rest of the header */
.menu { position:absolute; right:0; top:calc(100% + 6px); z-index:20; min-width:180px; background:var(--bg); border:1px solid var(--line);
  border-radius:10px; padding:6px; box-shadow:0 8px 24px rgba(0,0,0,.12); display:flex; flex-direction:column; }
.menu a, .menu button { display:block; text-align:left; margin:0; padding:8px 10px; border-radius:6px; color:var(--tx); background:transparent;
  text-decoration:none; font-size:14px; border:0; }
.menu a:hover, .menu button:hover { background:var(--panel); }
.menu .who { padding:6px 10px; font-size:12px; color:var(--muted); border-bottom:1px solid var(--line); margin-bottom:4px; }

/* error cards (errors.js) */
.errcard { margin:10px 0; padding:12px 14px; border:1px solid rgba(220,38,38,.35); border-radius:10px; background:rgba(220,38,38,.06); font-size:14px; }
.errcard strong { display:block; color:var(--red); margin-bottom:2px; }
.errcard .errbtns { margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }
.errcard .errbtns button { margin:0; }
.errcard details { margin-top:8px; } .errcard pre { min-height:0; font-size:12px; }

/* "?" tips (help.js) */
.tip { margin:0 0 0 4px; padding:0 6px; border-radius:999px; font-size:11px; line-height:16px; background:var(--panel); color:var(--muted); border:1px solid var(--line); vertical-align:1px; }
.tipbox { margin:6px 0; padding:8px 12px; border-radius:8px; background:var(--panel); border:1px solid var(--line); font-size:13px; color:var(--tx); }

/* home and guide */
.guide ol { list-style:none; padding:0; margin:10px 0 0; display:grid; gap:10px; }
.guide li { display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--bg); }
.guide li .n { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:var(--panel); border:1px solid var(--line); font-size:13px; }
.guide li.done .n { background:var(--green); color:#fff; border-color:var(--green); }
.guide li button { margin:0; }
.guide .head { display:flex; justify-content:space-between; gap:8px; align-items:center; flex-wrap:wrap; }
.guide .head button { margin:0; }
.trial { padding:10px 14px; border-radius:10px; background:rgba(37,99,235,.08); color:var(--tx); font-size:14px; margin:8px 0; }

/* 用手机: system switch, cards */
.seg { display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; }
.seg button { margin:0; border-radius:0; background:var(--bg); color:var(--tx); padding:6px 16px; }
.seg button.on { background:var(--blue); color:#fff; }
.pickbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.pickbar input { flex:1 1 180px; width:auto; min-width:0; }
.cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px; margin-top:12px; }
.card { border:1px solid var(--line); border-radius:12px; padding:12px 14px; background:var(--bg); display:flex; flex-direction:column; gap:6px; min-width:0; }
.card h3 { margin:0; font-size:15px; }
.card .sub { font-size:13px; color:var(--muted); }
.card .tags { display:flex; gap:6px; flex-wrap:wrap; }
.card .go { margin-top:auto; }
.card .go button { width:100%; margin:6px 0 0; }
.card .line { font-size:12px; color:var(--muted); }
.card details { margin-top:4px; font-size:12px; }
.before { border:1px solid var(--blue); border-radius:10px; padding:10px 12px; margin-top:6px; font-size:13px; background:var(--panel); }
.before ul { margin:6px 0; padding-left:18px; } .before li { margin:4px 0; }
.before button { margin:6px 6px 0 0; }

/* the running session */
.live { padding:12px; }
.livebar { display:flex; gap:8px 14px; flex-wrap:wrap; align-items:center; font-size:14px; }
.livebar b { color:var(--green); }
.livebar .grow { flex:1; }
.livebar button { margin:0; }
.steps { display:flex; gap:6px 14px; flex-wrap:wrap; font-size:13px; color:var(--muted); margin:8px 0; }
.steps .on { color:var(--blue); font-weight:600; } .steps .ok { color:var(--green); }
.screen { position:relative; }
.over { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:8px; padding:16px;
  background:rgba(0,0,0,.72); color:#fff; text-align:center; font-size:14px; }
.over button { margin:0 4px; }
/* An iPhone that is locked or being woken: a note right above the picture (never over it: taps reach the phone). */
.lockbar { margin:0 0 8px; padding:10px 12px; border-radius:10px; background:#0f172a; color:#fff; font-size:13px; line-height:1.5; }
.lockbar button { margin:6px 0 0; }
.session .side { display:flex; flex-direction:column; gap:8px; }
.keys button { min-width:64px; }

/* wallet */
.stat { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px,1fr)); gap:12px; }
.stat div { padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--bg); }
.stat b { display:block; font-size:20px; }

/* the bottom tab bar on phones */
.tabbar { display:none; }
@media (max-width:700px) {
  :root { --tabbar-h:56px; }
  main { padding-bottom:calc(var(--tabbar-h) + 32px); }
  header nav#nav, header .navmore { display:none; }
  .me .who-long, #topup-btn { display:none; }
  .tabbar:not(.hidden) { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; position:fixed; left:0; right:0; bottom:0; z-index:15;
    height:var(--tabbar-h); background:var(--bg); border-top:1px solid var(--line); }
  .tabbar a, .tabbar button { margin:0; display:flex; align-items:center; justify-content:center; font-size:13px; color:var(--muted);
    text-decoration:none; background:transparent; border-radius:0; }
  .tabbar a.active { color:var(--blue); font-weight:600; }
  #tab-more-menu { bottom:calc(var(--tabbar-h) + 6px); top:auto; right:8px; position:fixed; }
  section { padding:14px; }
  .session { grid-template-columns:1fr; }
  .keys { flex-wrap:nowrap; overflow-x:auto; }
  .card .go button { padding:12px; }
  /* tables become one card per row (narrow.js labels the cells) */
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap td { display:block; width:100%; min-width:0; }
  .table-wrap thead { display:none; }
  .table-wrap tr { border:1px solid var(--line); border-radius:10px; padding:6px 10px; margin-bottom:8px; background:var(--bg); }
  .table-wrap td { border:0; padding:3px 0; }
  .table-wrap td[data-label]::before { content:attr(data-label) "："; color:var(--muted); font-size:12px; }
  table.tasks { min-width:0; }
  .row4 { grid-template-columns:1fr; }
}
/* 一键重签并安装 (resign.js): a command with its copy button */
.codeline { display:flex; gap:8px; align-items:flex-start; min-width:0; }
.codeline pre { flex:1; min-width:0; margin:0; white-space:pre-wrap; word-break:break-all; }
#ml-resign .card { margin-bottom:12px; }
