/* ============================================================
   Mechanix UI Mockup — Alias Handheld
   Aesthetic: industrial instrument. OLED black, one amber accent,
   Overused Grotesk, tight geometry, dense and precise.
   ============================================================ */

@font-face {
  font-family: "Overused Grotesk";
  src: url("assets/overused-grotesk.woff2") format("woff2-variations");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  /* Mechanix palette (from mechanix.py) */
  --bg:        #000000;
  --card:      #121212;
  --secondary: #1c1c1c;
  --border:    #282828;
  --fg:        #ffffff;
  --muted:     #8c8c8c;
  --faint:     #5a5a5a;
  --accent:    #c67600;
  --accent-hi: #e89422;
  --danger:    #f33742;
  --online:    #6ed44a;

  /* spacing scale */
  --sp-xs: 4px;  --sp-sm: 8px;  --sp-md: 12px;  --sp-lg: 20px;  --sp-xl: 32px;
  /* tight Mechanix radii */
  --r-sm: 4px;   --r-md: 8px;   --r-lg: 12px;
  /* type scale */
  --t-display: 52px;
  --t-header:  26px;
  --t-title:   19px;
  --t-body:    15px;
  --t-label:   13px;
  --t-caption: 10.5px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #0a0a0a;
  font-family: "Overused Grotesk", "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* atmospheric backdrop behind the device */
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 16px;
  background:
    radial-gradient(60% 50% at 50% 38%, #1a160f 0%, #0a0a0a 70%),
    #0a0a0a;
}
body::after {           /* fine grain overlay */
  content: "";
  position: fixed; inset: 0; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- device frame ---------- */
.device {
  position: relative;
  padding: 14px;
  background: linear-gradient(160deg, #1d1d1d, #0c0c0c);
  border-radius: 30px;
  box-shadow:
    0 0 0 1px #2c2c2c,
    0 30px 70px -20px #000,
    inset 0 1px 0 #333;
}
.device::before {       /* a quiet camera/sensor dot on the bezel */
  content: ""; position: absolute; top: 20px; left: 50%;
  width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: #050505; box-shadow: inset 0 0 0 1px #2a2a2a;
}
.viewport {
  position: relative;
  width: 400px; height: 640px;
  background: var(--bg);
  color: var(--fg);            /* default text colour — never inherit black */
  border-radius: 18px;
  overflow: hidden;
}

/* ---------- screens & overlays ---------- */
.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
}
.screen.active { display: flex; animation: screen-in .32s var(--ease) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.body {
  flex: 1; overflow-y: auto;
  padding: var(--sp-md) var(--sp-lg) var(--sp-xl);
}
.body::-webkit-scrollbar { width: 0; }

.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: none;
}
.overlay.active { display: flex; animation: screen-in .26s var(--ease) both; }

/* staggered entrance for direct children of [data-stagger] in an active screen */
.screen.active [data-stagger] > *,
.overlay.active [data-stagger] > * {
  animation: rise .44s var(--ease) both;
}
[data-stagger] > *:nth-child(1){ animation-delay:.04s }
[data-stagger] > *:nth-child(2){ animation-delay:.09s }
[data-stagger] > *:nth-child(3){ animation-delay:.14s }
[data-stagger] > *:nth-child(4){ animation-delay:.19s }
[data-stagger] > *:nth-child(5){ animation-delay:.24s }
[data-stagger] > *:nth-child(6){ animation-delay:.29s }
[data-stagger] > *:nth-child(7){ animation-delay:.34s }
[data-stagger] > *:nth-child(8){ animation-delay:.39s }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- shared micro-type ---------- */
.eyebrow {
  font-size: var(--t-caption); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.num { font-variant-numeric: tabular-nums; }

/* ---------- status strip (home) ---------- */
.statusbar {
  display: flex; align-items: center; gap: var(--sp-md);
  height: 34px; padding: 0 var(--sp-md);
  border-bottom: 1px solid var(--border);
  font-size: var(--t-caption); color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase; flex-shrink: 0;
}
.statusbar .sig { color: var(--fg); }
.statusbar .spacer { flex: 1; }
.statusbar .clock { color: var(--fg); letter-spacing: .1em; font-weight: 600; }
.statusbar i { font-size: 11px; }
.statusbar .batt { color: var(--fg); }

/* ---------- app header (non-home screens) ---------- */
.appbar {
  display: flex; align-items: center; gap: var(--sp-md);
  height: 52px; padding: 0 var(--sp-md);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.appbar .back {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--fg); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.appbar .back:hover { border-color: var(--accent); color: var(--accent); }
.appbar .title {
  font-size: var(--t-label); font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}
.appbar .sub { font-size: var(--t-caption); color: var(--muted); letter-spacing:.06em; }
.appbar .grow { flex: 1; }
.appbar .avatar { margin-right: 2px; }

/* ---------- avatars ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--secondary); color: var(--fg);
  font-weight: 600; font-size: 15px;
  border: 1px solid var(--border);
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.alias { background: #1a1206; border-color: #4a3410; }
.avatar.alias img { width: 22px; height: 22px; }
.dot-online {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--online); box-shadow: 0 0 6px var(--online);
}

/* ============================================================
   HOME / LAUNCHER
   ============================================================ */
.home-head { padding: var(--sp-lg) var(--sp-lg) var(--sp-md); }
.home-brand { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.home-brand img { width: 22px; height: 22px; }
.home-brand .wordmark {
  font-size: var(--t-label); font-weight: 800;
  letter-spacing: .32em; text-transform: uppercase;
}
.home-brand .tag {
  margin-left: auto; font-size: var(--t-caption); color: var(--faint);
  letter-spacing: .14em; text-transform: uppercase;
}
.clock-big {
  font-size: var(--t-display); font-weight: 700; line-height: .95;
  letter-spacing: -.02em; color: var(--fg);
}
.clock-big .ampm { font-size: 18px; color: var(--muted); font-weight: 600; margin-left: 6px; letter-spacing: 0; }
.home-date { margin-top: 6px; font-size: var(--t-label); color: var(--muted); letter-spacing: .04em; }
.home-status {
  display: flex; align-items: center; gap: var(--sp-sm);
  margin-top: var(--sp-md); padding-top: var(--sp-md);
  border-top: 1px solid var(--border);
  font-size: var(--t-caption); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.home-status .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--online);
  animation: blip 2.4s var(--ease) infinite;
}
@keyframes blip { 0%,100%{ box-shadow:0 0 0 0 rgba(110,212,74,.5) } 50%{ box-shadow:0 0 0 5px rgba(110,212,74,0) } }
.home-status .ok { color: var(--online); }

/* app grid */
.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm);
  padding: 0 var(--sp-lg) var(--sp-lg);
}
.tile {
  position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  min-height: 104px;
  display: flex; flex-direction: column;
  cursor: pointer; overflow: hidden;
  transition: border-color .16s var(--ease), transform .16s var(--ease), background .16s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile:active { transform: translateY(0); }
.tile .ic {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: #1a1206; color: var(--accent); font-size: 17px;
  border: 1px solid #3a2a0e;
}
.tile .name {
  margin-top: auto; font-size: var(--t-body); font-weight: 600; color: var(--fg);
}
.tile .meta { margin-top: 3px; font-size: var(--t-caption); color: var(--muted); letter-spacing: .04em; }
.tile .corner {
  position: absolute; top: var(--sp-md); right: var(--sp-md);
  font-size: var(--t-caption); color: var(--accent); font-weight: 700;
  letter-spacing: .04em;
}
/* SOS tile */
.tile.sos { background: #160606; border-color: #4a1419; }
.tile.sos:hover { border-color: var(--danger); }
.tile.sos .ic { background: #2a0a0d; color: var(--danger); border-color: #5a1a20; }
.tile.sos .name { color: var(--danger); letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
.tile.sos .meta { color: #a05055; }

/* ============================================================
   LIST ROWS  (messages, matter, settings, contacts)
   ============================================================ */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-sm);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .14s;
}
.row:hover { background: var(--card); }
.col { flex: 1; min-width: 0; }
.row .name, .theme-row .name { font-size: var(--t-body); font-weight: 600; color: var(--fg); }
.row .preview, .theme-row .preview {
  font-size: var(--t-label); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.row .preview i { font-size: 10px; margin-right: 4px; color: var(--faint); }
.row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.row .time { font-size: var(--t-caption); color: var(--faint); letter-spacing: .04em; }
.row .unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #000; font-size: var(--t-caption);
  font-weight: 800; display: grid; place-items: center;
}
.row .chev { color: var(--faint); font-size: 13px; }
.row.pinned { background: linear-gradient(90deg, #150f05, transparent); }

/* section heading inside a list */
.section-head {
  padding: var(--sp-lg) var(--sp-sm) var(--sp-sm);
  font-size: var(--t-caption); font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--faint);
}
.section-head:first-child { padding-top: var(--sp-md); }

/* ============================================================
   CHAT  /  ASSISTANT
   ============================================================ */
.thread {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--sp-sm);
  padding: var(--sp-lg);
}
.thread::-webkit-scrollbar { width: 0; }
.bubble {
  max-width: 76%; padding: var(--sp-sm) var(--sp-md);
  font-size: var(--t-body); line-height: 1.4;
  border-radius: var(--r-md);
}
.bubble.in  { align-self: flex-start; background: var(--secondary); color: var(--fg); border-bottom-left-radius: var(--r-sm); }
.bubble.out { align-self: flex-end;  background: var(--accent); color: #000; font-weight: 500; border-bottom-right-radius: var(--r-sm); }
.bubble.sys {
  align-self: center; background: none; color: var(--faint);
  font-size: var(--t-caption); letter-spacing: .1em; text-transform: uppercase;
  padding: var(--sp-xs) 0;
}
.stamp { font-size: var(--t-caption); color: var(--faint); margin-top: 1px; }
.stamp.out { align-self: flex-end; }
.stamp.in  { align-self: flex-start; }

/* voice message bubble */
.voice { display: flex; align-items: center; gap: var(--sp-sm); }
.voice .play {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 10px;
  background: #000; color: var(--accent);
}
.bubble.out .voice .play { background: rgba(0,0,0,.25); color: #000; }
.wave { display: flex; align-items: center; gap: 2.5px; height: 22px; }
.wave span { width: 2.5px; border-radius: 2px; background: currentColor; opacity: .55; }
.voice .dur { font-size: var(--t-caption); font-variant-numeric: tabular-nums; }

/* assistant reply marker */
.bubble.alias { border-left: 2px solid var(--accent); }
.alias-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; margin-top: 2px; }
.chip {
  font-size: var(--t-caption); padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 20px;
  color: var(--muted); cursor: pointer; letter-spacing: .04em;
  transition: border-color .14s, color .14s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* input / PTT bar */
.inputbar {
  display: flex; align-items: center; gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.inputbar .field {
  flex: 1; height: 38px; padding: 0 var(--sp-md);
  display: flex; align-items: center;
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--muted); font-size: var(--t-label);
}
.inputbar .btn-round {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; cursor: pointer; font-size: 14px;
}
.inputbar .ptt  { background: #1a1206; color: var(--accent); border: 1px solid #3a2a0e; }
.inputbar .send { background: var(--accent); color: #000; }
.inputbar .ptt:hover { background: #241a08; }

/* ============================================================
   MAP / RADAR
   ============================================================ */
.radar-wrap { flex: 1; display: grid; place-items: center; padding: var(--sp-lg); }
.radar {
  position: relative; width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, #0d0d0d 0%, #000 72%);
  border: 1px solid var(--border);
}
.radar .ring {
  position: absolute; border: 1px solid var(--border); border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.radar .ring.r1 { width: 33%; height: 33%; }
.radar .ring.r2 { width: 66%; height: 66%; }
.radar .ring.r3 { width: 100%; height: 100%; }
.radar .cross, .radar .cross-v {
  position: absolute; background: var(--border);
}
.radar .cross   { top: 50%; left: 0; width: 100%; height: 1px; }
.radar .cross-v { left: 50%; top: 0; height: 100%; width: 1px; }
.radar .sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(198,118,0,.32), transparent 60deg);
  animation: sweep 3.6s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.radar .you {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(198,118,0,.18);
}
.radar .you::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--accent); animation: ping 2.6s var(--ease) infinite;
}
@keyframes ping { 0%{transform:scale(.6);opacity:.8} 100%{transform:scale(2.6);opacity:0} }
.blip {
  position: absolute; transform: translate(-50%,-50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
}
.blip .pt {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--fg); box-shadow: 0 0 7px rgba(255,255,255,.55);
}
.blip .lbl {
  font-size: var(--t-caption); color: var(--muted);
  letter-spacing: .06em; white-space: nowrap;
}
.blip:hover .pt { background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.blip:hover .lbl { color: var(--accent); }
.map-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-top: 1px solid var(--border);
  font-size: var(--t-caption); letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); flex-shrink: 0;
}
.pair-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid #3a2a0e; border-radius: var(--r-sm);
  background: #1a1206; color: var(--accent); cursor: pointer;
  font-size: var(--t-caption); font-weight: 700; letter-spacing: .1em;
}
.pair-btn:hover { border-color: var(--accent); }

/* ============================================================
   NODE SHEET
   ============================================================ */
.node-screen { background: #060606; }
.node-radarhint {
  flex: 1; background:
    radial-gradient(circle at 50% 30%, #131008 0%, #000 65%);
  display: grid; place-items: center;
}
.node-radarhint .ghost {
  width: 150px; height: 150px; border-radius: 50%;
  border: 1px solid var(--border); position: relative; opacity: .5;
}
.node-radarhint .ghost::before {
  content:""; position:absolute; inset:36px; border-radius:50%; border:1px solid var(--border);
}
.sheet {
  background: var(--card); border-top: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: var(--sp-lg); flex-shrink: 0;
}
.sheet .grip { width: 36px; height: 3px; border-radius: 2px; background: var(--border); margin: 0 auto var(--sp-md); }
.sheet .id-row { display: flex; align-items: center; gap: var(--sp-md); }
.sheet .id-row .nm { font-size: var(--t-header); font-weight: 700; }
.sheet .close {
  margin-left: auto; width: 30px; height: 30px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--secondary);
  border: 1px solid var(--border); color: var(--muted); cursor: pointer;
}
.sheet .close:hover { color: var(--fg); border-color: var(--accent); }
.metrics { display: flex; gap: var(--sp-sm); margin: var(--sp-md) 0 var(--sp-lg); }
.metric {
  flex: 1; background: var(--secondary); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: var(--sp-sm) var(--sp-md);
}
.metric .k { font-size: var(--t-caption); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.metric .v { font-size: var(--t-title); font-weight: 700; margin-top: 3px; }
.metric .v.sig { color: var(--online); }
.sheet-actions { display: flex; gap: var(--sp-sm); }

/* big action buttons */
.btn {
  flex: 1; height: 46px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--t-label); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; cursor: pointer; border: 1px solid transparent;
  transition: transform .14s, filter .14s;
}
.btn:active { transform: scale(.98); }
.btn.primary  { background: var(--accent); color: #000; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost    { background: var(--secondary); color: var(--fg); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger   { background: var(--danger); color: #fff; }

/* ============================================================
   MATTER toggles
   ============================================================ */
.row .ic-sq {
  width: 36px; height: 36px; border-radius: var(--r-sm); flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px;
  background: var(--secondary); border: 1px solid var(--border); color: var(--muted);
}
.row.on .ic-sq { background: #1a1206; border-color: #3a2a0e; color: var(--accent); }
.toggle {
  width: 42px; height: 24px; border-radius: 12px; flex-shrink: 0;
  background: var(--secondary); border: 1px solid var(--border);
  position: relative; cursor: pointer; transition: background .18s;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--faint);
  transition: transform .18s var(--ease), background .18s;
}
.toggle.on { background: #3a2a0e; border-color: var(--accent); }
.toggle.on::after { transform: translateX(18px); background: var(--accent); }
.row .status-txt { font-size: var(--t-label); color: var(--muted); }
.row.on .status-txt { color: var(--accent); }

/* ============================================================
   SETTINGS — theme picker
   ============================================================ */
.theme-row {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-sm);
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.theme-row:hover { background: var(--card); }
.swatch {
  width: 44px; height: 44px; border-radius: var(--r-sm); flex-shrink: 0;
  border: 1px solid var(--border); overflow: hidden; display: flex;
}
.swatch span { flex: 1; }
.swatch.dark  span:nth-child(1){ background:#0d1017 } .swatch.dark span:nth-child(2){ background:#6ed44a; flex:.4 }
.swatch.mech  span:nth-child(1){ background:#000 }    .swatch.mech span:nth-child(2){ background:#c67600; flex:.4 }
.theme-row .check {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px;
}
.theme-row.selected .check { background: var(--accent); color: #000; }
.theme-row .check.off { border: 1px solid var(--border); }
.dev-foot {
  margin-top: var(--sp-xl); padding-top: var(--sp-md);
  border-top: 1px solid var(--border);
  font-size: var(--t-caption); color: var(--faint);
  letter-spacing: .08em; line-height: 1.7;
}

/* ============================================================
   EMERGENCY OVERLAY
   ============================================================ */
#emergency { background: radial-gradient(circle at 50% 32%, #3a0d10 0%, #120304 72%); }
.emg {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--sp-md);
  text-align: center; padding: var(--sp-xl);
}
.emg .ring {
  width: 132px; height: 132px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: var(--sp-sm);
  border: 2px solid var(--danger); color: var(--danger); font-size: 40px;
  position: relative;
}
.emg .ring::before, .emg .ring::after {
  content:""; position:absolute; inset:-2px; border-radius:50%;
  border: 2px solid var(--danger);
  animation: emg-ping 2.2s var(--ease) infinite;
}
.emg .ring::after { animation-delay: 1.1s; }
@keyframes emg-ping { 0%{transform:scale(1);opacity:.7} 100%{transform:scale(1.7);opacity:0} }
.emg .label {
  font-size: 30px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: #fff;
}
.emg .timer {
  font-size: 46px; font-weight: 700; color: var(--danger);
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.emg .sub {
  font-size: var(--t-label); color: #d98b8f;
  letter-spacing: .1em; text-transform: uppercase;
}
.emg .btn { flex: 0 0 auto; width: 220px; margin-top: var(--sp-md); }

/* ============================================================
   PAIRING OVERLAY
   ============================================================ */
#pairing { background: rgba(0,0,0,.78); backdrop-filter: blur(3px); }
.pair-card {
  margin: auto; width: 300px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-xl) var(--sp-lg) var(--sp-lg);
  text-align: center;
}
.pair-card .nfc {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto var(--sp-md);
  display: grid; place-items: center; font-size: 30px;
  background: #1a1206; color: var(--accent); border: 1px solid #3a2a0e;
  position: relative;
}
.pair-card .nfc::after {
  content:""; position:absolute; inset:-6px; border-radius:50%;
  border:1px solid var(--accent); animation: ping 2.4s var(--ease) infinite;
}
.pair-card .ttl { font-size: var(--t-header); font-weight: 700; }
.pair-card .who { font-size: var(--t-label); color: var(--muted); margin-top: 4px; }
.pair-card .hash {
  margin: var(--sp-md) 0 var(--sp-lg); padding: var(--sp-sm);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: var(--t-caption); color: var(--faint);
  letter-spacing: .1em; font-variant-numeric: tabular-nums;
}
.pair-card .pair-actions { display: flex; gap: var(--sp-sm); }

/* generic helpers */
.scroll-cap { height: var(--sp-lg); flex-shrink: 0; }
.caption-line {
  padding: var(--sp-md) var(--sp-sm) var(--sp-sm);
  font-size: var(--t-caption); letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
