/* Fito Wallet (phone) — same look as the desktop Fitochain wallet, built for a 390px screen first. */
:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1b1a17;
  --ink-2: #5d5a53;
  --ink-3: #8f8b82;
  --line: #e7e2d9;
  --accent: #b8791b;
  --accent-ink: #ffffff;
  --accent-soft: #f6ead6;
  --good: #2f7d4f;
  --good-soft: #e3f1e8;
  --bad: #b3372b;
  --bad-soft: #f8e3e0;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 8px 24px rgba(27, 26, 23, .06);
  --radius: 18px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Instrument Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110f;
    --surface: #1b1a17;
    --surface-2: #211f1b;
    --ink: #f1ede5;
    --ink-2: #b9b3a7;
    --ink-3: #847e73;
    --line: #2e2b26;
    --accent: #e0a23a;
    --accent-ink: #1b1a17;
    --accent-soft: #3a2d17;
    --good: #6cc38f;
    --good-soft: #1d3326;
    --bad: #ee7b6f;
    --bad-soft: #3c1f1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
input, textarea { font-size: 16px; } /* 16px stops iPhone Safari from zooming in on focus */
a { color: var(--accent); }
[hidden] { display: none !important; }
code { font-family: var(--mono); }
.center { text-align: center; }
body.locked { overflow: hidden; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
#origCard { scroll-margin-top: 72px; }

/* ---------------------------------------------------------------- brand */
.mark { width: 28px; height: 28px; flex: none; }
.mark.big { width: 56px; height: 56px; }

/* ---------------------------------------------------------------- buttons */
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer; transition: transform .06s ease, opacity .15s ease, background .15s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.plain { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn.small { padding: 8px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.lg { padding: 15px 18px; font-size: 16px; width: 100%; border-radius: 14px; }
.btn.danger { background: transparent; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .action:focus-visible, .pill:focus-visible, .iconbtn:focus-visible, .x:focus-visible, .linkrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--accent-ink); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.plain.busy::after { border-color: var(--ink-2); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.x { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex: none; display: grid; place-items: center; color: var(--ink-2); padding: 0; }
.x svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- forms */
form { display: grid; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; }
.field textarea { resize: vertical; min-height: 80px; }
.field .mono, textarea.mono { font-family: var(--mono); font-size: 15px; letter-spacing: .02em; }
.field .counter { float: right; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.field .hint { margin-top: 6px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.formerr { margin: 0; font-size: 13.5px; color: var(--bad); background: var(--bad-soft); padding: 9px 12px; border-radius: 10px; }
.label-sm { font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; font-weight: 500; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
.unitfield { position: relative; }
.unitfield input { padding-right: 64px; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.unitfield span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 500; pointer-events: none; }
.tofield { display: flex; gap: 8px; }
.tofield input { flex: 1; min-width: 0; }
.tofield .btn { padding: 0 14px; }
.pct { position: relative; }
.pct::after { content: '%'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.pct input { padding-right: 32px; }

/* ---------------------------------------------------------------- full screens */
.screen { min-height: 100vh; min-height: 100dvh; }
.boot { display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-2); padding: 24px; text-align: center; }
.boot .mark { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; transform: scale(.96); } }

.onboard { max-width: 480px; margin: 0 auto; padding: calc(28px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.onboard-top { display: grid; gap: 14px; position: relative; }
.onboard-actions { display: grid; gap: 10px; }
.onboard h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.025em; margin: 0; font-weight: 700; }
.onboard .lead { font-size: 16px; color: var(--ink-2); margin: 0; }
.eyebrow { margin: 6px 0 0; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
#welcome .onboard-top { padding-top: 8vh; }
.fine { font-size: 12px; color: var(--ink-3); text-align: center; margin: 6px 0 0; }
.back { position: absolute; left: -8px; top: -6px; border: 0; background: none; color: var(--ink-2); width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; }
.back svg { width: 22px; height: 22px; }
#restore .eyebrow { margin-top: 40px; }

.codebox { display: grid; gap: 10px; justify-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.codegrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; counter-reset: grp; }
.codegrid li { font: 500 15px/1 var(--mono); letter-spacing: .04em; text-align: center; padding: 10px 0 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; position: relative; counter-increment: grp; }
.codegrid li::before { content: counter(grp); position: absolute; top: 2px; left: 4px; font-size: 8.5px; color: var(--ink-3); letter-spacing: 0; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facts li { font-size: 14px; color: var(--ink-2); padding-left: 22px; position: relative; }
.facts li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.facts b { color: var(--ink); }

/* ---------------------------------------------------------------- app shell */
.app { padding-bottom: calc(24px + var(--safe-bottom)); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + var(--safe-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); min-width: 0; max-width: 220px; cursor: default; }
.pill.clickable { cursor: pointer; }
.pill #netName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill .chev { width: 14px; height: 14px; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.sync { background: var(--accent); animation: breathe 1.2s ease-in-out infinite; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.dot.off { background: var(--bad); }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); cursor: pointer; flex: none; padding: 0; }
.iconbtn svg { width: 19px; height: 19px; }

.install { margin: 4px 16px 0; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 13.5px; }
.install > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.install p { margin: 0; flex: 1; min-width: 0; }
.install .x { background: transparent; }

.layout { display: grid; gap: 14px; padding: 12px 16px 0; max-width: 1080px; margin: 0 auto; }
.col { display: grid; gap: 14px; min-width: 0; align-content: start; }
@media (min-width: 900px) {
  .topbar { padding-left: max(24px, calc((100vw - 1080px) / 2 + 16px)); padding-right: max(24px, calc((100vw - 1080px) / 2 + 16px)); }
  .layout { grid-template-columns: 400px minmax(0, 1fr); gap: 20px; padding: 20px 24px 0; align-items: start; }
  .layout > .col:first-child { position: sticky; top: 76px; }
  .install { max-width: 1032px; margin: 8px auto 0; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card h2 { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.count { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; letter-spacing: 0; color: var(--ink-2); vertical-align: 1px; }

/* ---------------------------------------------------------------- balance */
.hero { padding: 20px 18px 18px; background:
  radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 55%),
  linear-gradient(165deg, var(--surface) 0%, var(--surface-2) 100%); }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.status { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.amount { font-size: 54px; font-weight: 600; letter-spacing: -.035em; line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.amount small { font-size: 20px; font-weight: 500; color: var(--ink-2); margin-left: 8px; letter-spacing: 0; }
.amount.bump { animation: bump .5s ease; }
@keyframes bump { 40% { color: var(--good); transform: scale(1.03); } }
.amount { transform-origin: left center; }
.badge { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge.test { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.handle { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin-top: 12px; display: flex; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.handle .tag { color: var(--ink-3); font-weight: 500; }
.nameform { margin-top: 14px; gap: 8px; }
.nameform .label-sm { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.inline { display: flex; gap: 8px; }
.at { position: relative; flex: 1; min-width: 0; display: flex; }
.at::before { content: '@'; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.at input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 30px; }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; margin-top: 20px; }
.action { border: 0; background: none; padding: 4px 0; display: grid; justify-items: center; align-content: start; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer; border-radius: 12px; text-align: center; line-height: 1.2; }
.ai { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transition: transform .08s ease; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 28%, transparent); }
.action + .action .ai { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
#actSend .ai { background: var(--ink); color: var(--bg); border: 0; }
.action:active .ai { transform: scale(.94); }
.ai svg { width: 23px; height: 23px; }
.action.busy .ai svg { animation: spin 1s linear infinite; }

.links { padding: 6px 6px; display: grid; }
.linkrow { display: grid; grid-template-columns: 36px 1fr 18px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.linkrow + .linkrow { border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.linkrow .arrow { width: 18px; height: 18px; color: var(--ink-3); }
.links:not(:has(.linkrow:not([hidden]))) { display: none; }

/* ---------------------------------------------------------------- activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; padding-top: 2px; }
.icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.icon.in { background: var(--good-soft); color: var(--good); }
.icon.out { background: var(--accent-soft); color: var(--accent); }
.icon.orig { background: var(--accent-soft); color: var(--accent); }
.icon svg { width: 18px; height: 18px; }
.what { min-width: 0; }
.what strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow: hidden; overflow-wrap: anywhere; }
.what span { display: block; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.delta.in { color: var(--good); }
.empty { color: var(--ink-3); text-align: center; padding: 24px 8px; font-size: 14px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 2px; }

/* ---------------------------------------------------------------- originals */
.orig-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .orig-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; } }
.orig { display: block; width: 100%; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; overflow: hidden; min-width: 0; transition: transform .12s ease, box-shadow .12s ease; }
.orig:active { transform: scale(.98); }
@media (hover: hover) { .orig:hover { transform: translateY(-2px); box-shadow: var(--shadow); } }
.orig:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pic { aspect-ratio: 1; width: 100%; display: block; background: var(--accent-soft); position: relative; overflow: hidden; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic.ph { display: grid; place-items: center; background:
  radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 60%),
  linear-gradient(150deg, var(--accent-soft) 0%, var(--surface-2) 100%); }
.pic.ph .letter { font-size: 44px; font-weight: 700; color: var(--accent); letter-spacing: -.02em; text-transform: uppercase; opacity: .9; }
.orig .meta { padding: 9px 11px 11px; min-width: 0; }
.orig .meta strong { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orig .meta span { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: rgba(27, 26, 23, .72); color: #fff; }
.orig-empty { text-align: center; padding: 14px 8px 6px; color: var(--ink-2); }
.orig-empty .pic.ph { width: 72px; margin: 0 auto 12px; border-radius: 18px; }
.orig-empty .pic.ph .letter { font-size: 28px; }
.orig-empty p { margin: 0 auto 4px; max-width: 360px; font-size: 14px; }
.opic .pic { border-radius: 14px; width: min(100%, 320px); margin: 0 auto; }
.opic .pic.ph .letter { font-size: 80px; }
.about { margin: 0; color: var(--ink-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.drop { position: relative; display: grid; place-items: center; gap: 4px; text-align: center; border: 1.5px dashed var(--line); border-radius: 14px; padding: 18px 12px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; font-size: 14px; }
.drop:focus-within { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop svg { width: 26px; height: 26px; color: var(--accent); }
.drop b { color: var(--ink); }
.preview { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: var(--surface-2); }
.preview img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; display: block; }
.preview div { min-width: 0; font-size: 13px; color: var(--ink-3); display: grid; gap: 2px; justify-items: start; }
.preview strong { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.preview .btn { margin-top: 4px; }

/* ---------------------------------------------------------------- sheets */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(12, 11, 9, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet { background: var(--surface); width: 100%; max-width: 520px; max-height: calc(100dvh - 24px - var(--safe-top)); overflow-y: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0; padding: 10px 18px calc(20px + var(--safe-bottom)); display: grid; gap: 14px; align-content: start; animation: rise .24s cubic-bezier(.2, .9, .3, 1); }
.sheet::before { content: ''; justify-self: center; width: 38px; height: 5px; border-radius: 99px; background: var(--line); margin-bottom: 2px; }
@media (min-width: 640px) {
  .modal { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; padding: 20px 22px 22px; max-height: calc(100vh - 48px); }
  .sheet::before { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-head h3 { margin: 0; font-size: 19px; letter-spacing: -.01em; overflow-wrap: anywhere; min-width: 0; }
.divider { height: 1px; background: var(--line); }

.qrwrap { display: grid; place-items: center; }
.bigqr { width: min(260px, 72vw); aspect-ratio: 1; background: #fff; border-radius: 18px; padding: 12px; border: 1px solid var(--line); }
.bigqr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.qrfor { margin: 0; text-align: center; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.qrfor .tag { color: var(--ink-3); font-weight: 500; }
.btnrow { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.btnrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.addr { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.addr code { font-size: 11.5px; color: var(--ink-2); overflow-wrap: anywhere; display: block; line-height: 1.5; }

.confirm { display: grid; gap: 14px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 19px; flex: none; text-transform: uppercase; }
.who div { min-width: 0; }
.who strong { display: block; font-size: 16.5px; overflow-wrap: anywhere; }
.who code { display: block; font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn { font-size: 13.5px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 0; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; padding-left: 16px; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.kv dd.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv dd code { font-size: 12px; }
.kv .total { font-weight: 700; color: var(--ink); font-size: 16px; padding-top: 9px; border-top: 1px solid var(--line); }
.kv dd.total { font-variant-numeric: tabular-nums; }

.viewfinder { position: relative; aspect-ratio: 1; background: #000; border-radius: 16px; overflow: hidden; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewfinder::after { content: ''; position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 16px; }
.viewfinder p { position: absolute; inset: auto 0 0; margin: 0; padding: 12px; color: #fff; font-size: 13.5px; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.netlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.netlist button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.netlist button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.netlist strong { font-weight: 600; }
.netlist span { font-size: 12.5px; color: var(--ink-3); grid-column: 1; }
.netlist em { grid-row: 1 / span 2; grid-column: 2; font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent); }

.setgroup { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.sheet-head + .setgroup { border-top: 0; padding-top: 0; }
.setgroup h4 { margin: 0; font-size: 15px; }
.setgroup .btn { justify-self: start; }
.setgroup .codebox { box-shadow: none; }
.rules { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 4px; }
.dangerbox { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bad-soft); }
.dangerbox p { margin: 0; font-size: 13.5px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 15px; }
.inl { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }

.note { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 6px 0 0; }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; top: calc(12px + var(--safe-top)); transform: translateX(-50%) translateY(-16px); opacity: 0; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 500; font-size: 14.5px; transition: opacity .25s ease, transform .25s ease; width: max-content; max-width: calc(100% - 32px); pointer-events: none; z-index: 40; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
