:root {
  --bg: #07080a; --bg-raised: #0e1013; --bg-elevated: #15181d; --bg-hover: #1e2127;
  --fg: #f2f1ee; --fg-dim: #8b8680; --line: #24272e;
  --accent: #edfd00; --on-accent: #0a0a0a; --danger: #ff6a6a; --ok: #7bd88f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.logo { width: 28px; height: 28px; border-radius: 6px; }
.who { margin-left: auto; color: var(--fg-dim); font-size: 0.85rem; }
main { flex: 1; padding: 16px; max-width: 560px; width: 100%; margin: 0 auto; }
h1 { font-size: 1.25rem; margin: 8px 0 12px; }
p { color: var(--fg-dim); }
.field { display: block; margin: 0 0 14px; border: 0; padding: 0; }
.field > span, .field > legend { display: block; font-size: 0.85rem; color: var(--fg-dim); margin-bottom: 6px; padding: 0; }
small { color: var(--fg-dim); font-weight: normal; }
input, select { width: 100%; font: inherit; color: var(--fg); background: var(--bg-elevated); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 48px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=file] { padding: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg-elevated); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; min-height: 0; }
.seg span { display: block; text-align: center; padding: 10px 6px; border-radius: 7px; color: var(--fg-dim); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
button { font: inherit; cursor: pointer; }
.primary { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 10px; padding: 12px 16px; font-weight: 600; min-height: 48px; }
.primary.big { width: 100%; margin-top: 6px; }
.primary:disabled { opacity: 0.5; }
#pair-form { display: grid; gap: 10px; }
.msg { min-height: 1.4em; margin-top: 12px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }
.incoming { margin-bottom: 14px; }
.incoming:empty { display: none; }
.card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 12px; align-items: center; overflow: hidden; }
.card img, .card video { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg-elevated); }
.card .t { min-width: 0; }
.card .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .t span { color: var(--fg-dim); font-size: 0.85rem; overflow-wrap: anywhere; }
.foot { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 0.85rem; }
.foot a, .link { color: var(--fg-dim); background: none; border: 0; padding: 0; text-decoration: underline; }
.steps { padding-left: 1.2em; color: var(--fg); }
.steps li { margin: 0 0 10px; }
code, .copy { font-family: ui-monospace, monospace; font-size: 0.85rem; background: var(--bg-elevated); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; overflow-wrap: anywhere; }
.copyrow { display: flex; gap: 8px; align-items: center; margin: 6px 0 12px; }
.copyrow input { flex: 1; min-height: 40px; padding: 8px; font-family: ui-monospace, monospace; font-size: 0.8rem; }
.copyrow button { flex: none; background: var(--bg-elevated); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.ghostbtn { width: 100%; margin: -6px 0 14px; background: var(--bg-elevated); color: var(--fg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px; min-height: 44px; }
