:root {
  --bg: oklch(0.17 0.012 250);
  --bg-2: oklch(0.20 0.015 252);
  --card: oklch(0.225 0.017 252);
  --card-2: oklch(0.26 0.020 252);
  --line: oklch(0.32 0.020 252);
  --text: oklch(0.98 0.005 250);
  --text-2: oklch(0.78 0.010 250);
  --text-3: oklch(0.58 0.012 250);
  --accent: oklch(0.84 0.22 140);
  --accent-2: oklch(0.72 0.19 145);
  --accent-ink: oklch(0.18 0.02 145);
  --danger: oklch(0.72 0.19 28);
  --warn: oklch(0.82 0.17 75);
  --blue: oklch(0.72 0.15 240);
  --fg: var(--text);
  --muted: var(--text-3);
  --border: oklch(1 0 0 / 0.06);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  color: var(--text);
  font-family: 'Inter Tight', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01';
}
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 80% -10%, oklch(0.26 0.04 145 / 0.18), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, oklch(0.28 0.05 250 / 0.22), transparent 60%),
    #0b0d10;
  background-attachment: fixed;
  padding-bottom: 96px;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(to bottom, #0b0d10 60%, transparent);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  filter: drop-shadow(0 4px 12px oklch(0.84 0.22 140 / 0.35));
  flex-shrink: 0;
  display: block;
}
.brand-eyebrow {
  font-size: 10px; letter-spacing: 1.4px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
}
h1 { font-size: 15px; margin: 0; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 5px 11px; border-radius: 999px;
  font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  background: oklch(1 0 0 / 0.06); color: var(--text-2);
  border: 1px solid oklch(1 0 0 / 0.04);
  white-space: nowrap;
}
.status::before {
  content: ''; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
}
.status[data-state="open"] { background: oklch(0.84 0.22 140 / 0.14); color: var(--accent); }
.status[data-state="closed"],
.status[data-state="logged_out"] { background: oklch(0.72 0.19 28 / 0.14); color: var(--danger); }
.status[data-state="connecting"],
.status[data-state="reconnecting"],
.status[data-state="awaiting_pairing"] { background: oklch(0.82 0.17 75 / 0.14); color: var(--warn); }

main { padding: 4px 18px 20px; max-width: 520px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid oklch(1 0 0 / 0.04);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.05) inset, 0 8px 24px oklch(0 0 0 / 0.25);
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 10px; }
.stack-inline { display: flex; gap: 8px; flex-shrink: 0; }

.eyebrow {
  font-size: 11px; color: var(--text-3);
  letter-spacing: 0.9px; font-weight: 600; text-transform: uppercase;
}
.muted { color: var(--text-3); font-size: 12.5px; }

button {
  background: var(--accent); color: var(--accent-ink);
  border: 0; padding: 12px 18px;
  border-radius: 14px; font-weight: 700; cursor: pointer;
  font-size: 14px; font-family: inherit;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 18px oklch(0.84 0.22 140 / 0.3);
  transition: transform .12s, box-shadow .15s, background .15s;
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled {
  background: oklch(1 0 0 / 0.06);
  color: var(--text-3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
button.ghost {
  background: oklch(1 0 0 / 0.05);
  color: var(--text);
  box-shadow: none;
  border: 1px solid oklch(1 0 0 / 0.06);
}
button.ghost:hover { background: oklch(1 0 0 / 0.08); }
button.danger {
  background: oklch(0.72 0.19 28 / 0.15);
  color: var(--danger);
  box-shadow: none;
  border: 1px solid oklch(0.72 0.19 28 / 0.3);
}

input, textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  background: oklch(1 0 0 / 0.05); color: var(--text);
  border: 1px solid oklch(1 0 0 / 0.06);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: oklch(0.84 0.22 140 / 0.45);
  background: oklch(1 0 0 / 0.06);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%238a97aa' stroke-width='2' stroke-linecap='round' d='M3 5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  color-scheme: dark;
}
select option {
  background: #1a1d22;
  color: var(--text);
  padding: 10px;
}

nav {
  position: fixed; bottom: 12px; left: 12px; right: 12px;
  background: oklch(0.19 0.015 252 / 0.9);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid oklch(1 0 0 / 0.06);
  border-radius: 22px; padding: 6px;
  display: flex; gap: 2px;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.05) inset, 0 12px 30px oklch(0 0 0 / 0.4);
  z-index: 30;
  max-width: 520px; margin: 0 auto;
}
nav button {
  flex: 1;
  background: transparent; color: oklch(0.70 0.012 250);
  padding: 11px 6px; font-weight: 600; font-size: 12.5px;
  border-radius: 16px;
  letter-spacing: 0.3px;
  box-shadow: none;
}
nav button:hover { transform: none; color: var(--text); }
nav button.active {
  background: oklch(0.84 0.22 140 / 0.12);
  color: var(--accent);
}

.toggle {
  width: 56px; height: 32px; padding: 3px;
  background: oklch(1 0 0 / 0.10);
  border-radius: 999px;
  position: relative; cursor: pointer;
  transition: background .2s, box-shadow .2s;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.05);
  flex-shrink: 0;
}
.toggle.on {
  background: var(--accent);
  box-shadow: 0 0 0 1px oklch(0.84 0.22 140 / 0.5), 0 0 24px oklch(0.84 0.22 140 / 0.35);
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; background: #fff; border-radius: 50%;
  transition: left .2s cubic-bezier(.4,1.4,.5,1), background .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.toggle.on::after { left: 27px; background: #0b0d10; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: oklch(1 0 0 / 0.06); color: var(--text-2);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px;
}
.pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
}
.pill.live { background: oklch(0.84 0.22 140 / 0.14); color: var(--accent); }
.pill.warn { background: oklch(0.82 0.17 75 / 0.14); color: var(--warn); }
.pill.danger { background: oklch(0.72 0.19 28 / 0.14); color: var(--danger); }

/* Hero toggle card — pulse animation */
.hero {
  padding: 22px;
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, oklch(0.26 0.05 145 / 0.9), var(--card) 55%);
}
.hero.paused {
  background: var(--card);
}
.hero .pulse-ring {
  position: absolute; top: 30px; left: -20px;
  width: 120px; height: 120px; border-radius: 999px;
  border: 1px solid var(--accent);
  opacity: 0.35;
  animation: mbpulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes mbpulse {
  0% { transform: scale(0.3); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}
.hero-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin: 4px 0 2px; }
.hero-sub { color: var(--text-2); font-size: 13.5px; }
.hero-divider {
  border-top: 1px dashed oklch(1 0 0 / 0.08);
  margin-top: 18px; padding-top: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hero-phone {
  font-size: 16px; font-weight: 500; margin-top: 2px;
  color: var(--text);
}

/* dashboard big number card */
.stat-card { padding: 16px; }
.stat-num { font-size: 28px; font-weight: 700; letter-spacing: -0.8px; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Contacts */
.contact-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid oklch(1 0 0 / 0.04);
}
.contact-item:last-child { border-bottom: 0; }

/* Contacts tab: search bar + list row */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: oklch(1 0 0 / 0.05);
  border: 1px solid oklch(1 0 0 / 0.04);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.search-bar input { color: var(--text); outline: none; }
.search-bar input::placeholder { color: var(--text-3); }

.contact-list-card { padding: 4px 0; overflow: hidden; }

.contact-list-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px;
  background: transparent; color: var(--text);
  border: none; border-bottom: 1px solid oklch(1 0 0 / 0.04);
  border-radius: 0;
  cursor: pointer; font-family: inherit; text-align: left;
  box-shadow: none; letter-spacing: 0;
  transition: background .1s;
}
.contact-list-row:last-child { border-bottom: none; }
.contact-list-row:hover { background: oklch(1 0 0 / 0.03); transform: none; }
.contact-list-row .chevron {
  color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.contact-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.contact-phone {
  font-size: 11.5px; color: var(--text-3); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.contact-footer {
  display: flex; align-items: center; gap: 6px; margin-top: 5px;
  flex-wrap: wrap;
}
.contact-group-eyebrow {
  font-size: 10.5px; color: var(--text-3);
  letter-spacing: 0.5px; font-weight: 600;
  text-transform: uppercase;
  max-width: 160px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.contact-dot {
  width: 3px; height: 3px; border-radius: 999px;
  background: var(--text-3); flex-shrink: 0;
}
.pill-sm { padding: 2px 8px; font-size: 10.5px; }
.pill.blue { background: oklch(0.72 0.15 240 / 0.14); color: var(--blue); }

.avatar.initials {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
  letter-spacing: -0.3px;
}

.contact-empty {
  padding: 30px 20px; text-align: center;
}

.hint-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 12px;
  border-radius: 14px;
  background: oklch(0.72 0.15 240 / 0.08);
  border: 1px solid oklch(0.72 0.15 240 / 0.15);
  font-size: 12px; color: var(--text-2);
  line-height: 1.45;
}
.hint-banner .info-dot {
  background: oklch(0.72 0.15 240 / 0.2); color: var(--blue);
  flex-shrink: 0;
}

/* Wizard: progress bar + step cards */
.progress-track {
  display: flex; gap: 6px; margin: 4px 0 20px;
}
.progress-seg {
  flex: 1; height: 4px; border-radius: 99px;
  background: oklch(1 0 0 / 0.08);
  transition: all .3s;
}
.progress-seg.on {
  background: var(--accent);
  box-shadow: 0 0 12px oklch(0.84 0.22 140 / 0.4);
}

.select-list {
  display: flex; flex-direction: column; gap: 10px;
}
.select-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px; border-radius: 18px;
  background: var(--card);
  border: 1px solid oklch(1 0 0 / 0.04);
  color: var(--text); text-align: left; font-family: inherit;
  font-weight: inherit; letter-spacing: 0;
  cursor: pointer; box-shadow: none;
  transition: all .15s;
}
.select-card:hover { background: var(--card-2); transform: none; }
.select-card.selected {
  background: oklch(0.84 0.22 140 / 0.10);
  border-color: var(--accent);
}
.select-icon {
  width: 44px; height: 44px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.2);
}
.select-card-body { flex: 1; min-width: 0; }
.select-card-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.select-card-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.radio {
  width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0;
  background: transparent;
  border: 1.5px solid oklch(1 0 0 / 0.15);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-ink);
  transition: all .15s;
}
.radio.on {
  background: var(--accent);
  border-color: var(--accent);
}

.select-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; background: transparent;
  border: none; border-bottom: 1px solid oklch(1 0 0 / 0.04);
  border-radius: 0; cursor: pointer;
  color: var(--text); text-align: left;
  font-family: inherit; font-weight: inherit; letter-spacing: 0;
  box-shadow: none;
  transition: background .1s;
}
.select-row:last-child { border-bottom: none; }
.select-row:hover { background: oklch(1 0 0 / 0.03); transform: none; }
.select-row.selected { background: oklch(0.84 0.22 140 / 0.10); }

.contact-header-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid oklch(1 0 0 / 0.04);
  border-radius: 18px; padding: 14px;
  margin-bottom: 14px;
}

.sticker-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.link-btn {
  background: transparent; color: var(--accent);
  border: none; padding: 6px 0;
  font-size: 13px; font-weight: 600;
  box-shadow: none;
}
.link-btn:hover { transform: none; opacity: 0.85; }

.sticker-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 0;
}
.sticker-tile {
  aspect-ratio: 1; border-radius: 16px;
  padding: 6px; position: relative;
  background: var(--card);
  border: 1.5px solid oklch(1 0 0 / 0.04);
  color: inherit; font-family: inherit;
  box-shadow: none; letter-spacing: 0;
  transition: all .15s;
}
.sticker-tile:hover { transform: none; background: var(--card-2); }
.sticker-tile.selected {
  background: oklch(0.84 0.22 140 / 0.12);
  border-color: var(--accent);
}
.sticker-tile .sticker-thumb {
  width: 100%; height: 100%;
  background: oklch(0 0 0 / 0.2); border-radius: 10px;
}
.sticker-tile .sticker-thumb.placeholder {
  background: oklch(1 0 0 / 0.05);
}
.sticker-check {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 999px;
  background: transparent;
  border: 1.5px solid oklch(1 0 0 / 0.15);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-ink);
}
.sticker-check.on {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 2px 8px oklch(0.84 0.22 140 / 0.4);
}

.wizard-footer {
  position: sticky; bottom: 80px;
  margin: 20px -18px 0;
  padding: 14px 18px 12px;
  background: linear-gradient(to top, #0b0d10 70%, transparent);
  z-index: 5;
}
.cta-btn {
  width: 100%; height: 54px; border-radius: 16px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 24px oklch(0.84 0.22 140 / 0.3);
  display: flex; align-items: center; justify-content: center;
}
.cta-btn:disabled {
  background: oklch(1 0 0 / 0.06);
  color: var(--text-3);
  box-shadow: none;
}

.avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: oklch(1 0 0 / 0.06); object-fit: cover;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08);
}
.avatar.placeholder { display: inline-block; }
.participant-row { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.participant-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.participant-info > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.participant-info > .muted {
  font-size: 11.5px;
  max-width: 100%;
}

/* Pairing code */
.pairing {
  font-size: 34px; font-weight: 700; letter-spacing: 6px; text-align: center;
  padding: 22px;
  background: linear-gradient(135deg, oklch(0.25 0.04 145 / 0.5), oklch(0.22 0.02 250 / 0.4));
  border: 1px solid oklch(0.84 0.22 140 / 0.2);
  border-radius: 18px; margin: 12px 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--accent);
  text-shadow: 0 0 30px oklch(0.84 0.22 140 / 0.4);
}

/* Sticker grid */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.sticker-cell {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px; border: 1.5px solid oklch(1 0 0 / 0.04);
  border-radius: 16px; cursor: pointer;
  background: var(--card-2);
  transition: border-color .15s, background .15s;
}
.sticker-cell:has(input:checked) {
  border-color: var(--accent);
  background: oklch(0.84 0.22 140 / 0.10);
}
.sticker-thumb {
  width: 80px; height: 80px; object-fit: contain;
  background: oklch(0 0 0 / 0.2); border-radius: 10px;
}
.sticker-thumb.placeholder {
  background: oklch(1 0 0 / 0.05);
  width: 80px; height: 80px;
}
.sticker-cell input[type=checkbox] {
  width: auto; margin-top: 6px;
  accent-color: var(--accent);
}

/* Config tab: section headers, setting rows, link rows */
.section-label {
  font-size: 11px; color: var(--text-3);
  font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase;
  margin: 18px 4px 8px;
}
.section-label:first-child { margin-top: 8px; }

.card.flush { padding: 0; overflow: hidden; }

.setting-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid oklch(1 0 0 / 0.04);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .setting-info { flex: 1; min-width: 0; }
.setting-row .setting-label { font-size: 14px; font-weight: 500; }
.setting-row .setting-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.link-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px;
  background: transparent; border: none;
  border-bottom: 1px solid oklch(1 0 0 / 0.04);
  cursor: pointer; text-align: left;
  color: var(--text); font-family: inherit;
  font-size: 14px; font-weight: 500;
  box-shadow: none;
  border-radius: 0;
}
.link-row:hover { background: oklch(1 0 0 / 0.03); transform: none; }
.link-row:last-child { border-bottom: none; }
.link-row.danger { color: var(--danger); background: transparent; border-color: oklch(1 0 0 / 0.04); }
.link-row.danger:hover { background: oklch(0.72 0.19 28 / 0.08); }
.link-row .link-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: oklch(1 0 0 / 0.05); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.link-row.danger .link-icon {
  background: oklch(0.72 0.19 28 / 0.12);
  color: var(--danger);
}
.link-row .link-label { flex: 1; min-width: 0; }
.link-row .chevron {
  color: var(--text-3); margin-left: auto;
  display: inline-flex; align-items: center;
}
.link-row.danger .chevron { color: var(--danger); }

.token-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.link-icon.warn {
  width: 36px; height: 36px; border-radius: 11px;
  background: oklch(0.82 0.17 75 / 0.15); color: var(--warn);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-row button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; border-radius: 11px;
}

.token-display {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px;
  background: oklch(0 0 0 / 0.35);
  border: 1px solid oklch(1 0 0 / 0.05);
  margin-top: 10px;
}
.token-display .token-text {
  flex: 1; font-family: 'JetBrains Mono', monospace;
  font-size: 13px; letter-spacing: 0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.token-display .eye-btn {
  background: none; border: none; color: var(--text-3);
  padding: 4px; cursor: pointer; box-shadow: none;
  font-size: 16px;
}
.token-display .eye-btn:hover { color: var(--text); transform: none; }

.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row > button { flex: 1; }

.version-footer {
  text-align: center; margin-top: 24px;
  font-size: 11px; color: var(--text-3);
}

.char-counter {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-3); margin-top: 8px;
}

/* Screen titles, title rows */
.screen-title, .title-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin: 4px 0 16px;
}
.screen-title-text {
  font-size: 28px; font-weight: 700; letter-spacing: -0.6px;
  margin-top: 2px;
}
.title-row { align-items: center; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
.icon-btn.primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 16px oklch(0.84 0.22 140 / 0.3);
}
.icon-btn.ghost, .ghost.icon-btn {
  background: oklch(1 0 0 / 0.05); color: var(--text);
  border: 1px solid oklch(1 0 0 / 0.06); box-shadow: none;
}

/* Dashboard stat cards row + monitored-row */
.stats-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 12px;
}
.card.stat-card { padding: 16px; }
.stat-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.stat-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.blue {
  background: oklch(0.72 0.15 240 / 0.15); color: var(--blue);
}
.stat-icon.accent {
  background: oklch(0.84 0.22 140 / 0.15); color: var(--accent);
}
.stat-delta {
  font-size: 11px; color: var(--accent); font-weight: 600;
}
.stat-delta-muted {
  font-size: 11px; color: var(--text-3); font-weight: 600;
}

.quick-action {
  background: var(--card);
  color: var(--text);
  border: 1px solid oklch(1 0 0 / 0.04);
  border-radius: 18px; padding: 14px;
  text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: none; font-weight: inherit; letter-spacing: 0;
}
.quick-action:hover { background: var(--card-2); transform: none; }
.qa-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: oklch(1 0 0 / 0.06); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qa-label { font-size: 14px; font-weight: 600; color: var(--text); }
.qa-hint { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.card-header { margin-bottom: 12px; }
.group-trocar-btn {
  padding: 7px 14px; font-size: 13px; box-shadow: none;
  border: 1px solid oklch(1 0 0 / 0.08);
}

.monitored-row {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 0;
}
.monitored-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: oklch(1 0 0 / 0.05); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.monitored-info { flex: 1; min-width: 0; }
.monitored-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.monitored-sub {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
}

/* Conexão — field box with icon + number cells */
.field-box {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: oklch(1 0 0 / 0.04);
  border: 1px solid oklch(1 0 0 / 0.05);
}
.field-box input {
  flex: 1; background: transparent; border: none;
  outline: none; padding: 0;
  color: var(--text); font-size: 16px; font-weight: 500;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.3px;
}
.field-icon, .field-icon-inline {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); flex-shrink: 0;
}
.hint-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 12px; color: var(--text-3);
}

.card.code-hero {
  padding: 22px;
  background: linear-gradient(160deg, oklch(0.26 0.05 145 / 0.6), var(--card) 55%);
  position: relative; overflow: hidden;
}
.code-glow {
  position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px; border-radius: 999px;
  background: radial-gradient(circle, oklch(0.84 0.22 140 / 0.15), transparent 70%);
  pointer-events: none;
}
.code-key-badge {
  width: 38px; height: 38px; border-radius: 12px;
  background: oklch(0.84 0.22 140 / 0.15); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card.code-hero .btn-row button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 2px; height: 44px; border-radius: 12px;
}
.code-boxes {
  display: flex; gap: 8px; justify-content: space-between;
  position: relative; margin-bottom: 14px;
}
.code-box {
  flex: 1; aspect-ratio: 1 / 1.15;
  border-radius: 12px;
  background: oklch(0 0 0 / 0.35);
  border: 1px solid oklch(0.84 0.22 140 / 0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: var(--text);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.06), 0 4px 12px oklch(0 0 0 / 0.3);
}
.code-sep {
  width: 4px; align-self: center;
  color: var(--text-3); font-size: 24px; font-weight: 700;
}
.code-expire {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed oklch(1 0 0 / 0.08);
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2);
  position: relative;
}
.info-dot {
  width: 22px; height: 22px; border-radius: 999px;
  background: oklch(0.84 0.22 140 / 0.15); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.step-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.step-row:last-child { margin-bottom: 0; }
.step-num {
  width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0;
  background: oklch(1 0 0 / 0.06); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.step-text {
  font-size: 13px; color: var(--text-2); line-height: 1.5;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: oklch(0 0 0 / 0.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100; padding: 12px;
  animation: mfade .18s ease;
}
@keyframes mfade { from { opacity: 0 } to { opacity: 1 } }
.modal-sheet {
  background: var(--card); border-radius: 24px 24px 16px 16px;
  border: 1px solid oklch(1 0 0 / 0.06);
  width: 100%; max-width: 520px;
  max-height: 80vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: mslide .22s cubic-bezier(.4,1.2,.5,1);
}
@keyframes mslide { from { transform: translateY(30px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid oklch(1 0 0 / 0.04);
}
.modal-close {
  width: 36px; height: 36px; border-radius: 10px;
  padding: 0; font-size: 18px; background: oklch(1 0 0 / 0.05);
  color: var(--text); border: 1px solid oklch(1 0 0 / 0.06);
  box-shadow: none;
}
.modal-list {
  overflow-y: auto; padding: 10px 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.group-option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 14px;
  background: oklch(1 0 0 / 0.03);
  border: 1px solid oklch(1 0 0 / 0.04);
  color: var(--text); text-align: left; font-family: inherit;
  font-size: inherit; font-weight: inherit; letter-spacing: 0;
  cursor: pointer; box-shadow: none;
}
.group-option:hover { background: oklch(1 0 0 / 0.06); transform: none; }
.group-option.selected {
  background: oklch(0.84 0.22 140 / 0.10);
  border-color: var(--accent);
}
.group-option:disabled { opacity: 0.5; cursor: not-allowed; }

/* Toasts (top-right stack, auto-dismiss) */
.toast-stack {
  position: fixed; top: 14px; right: 14px; left: 14px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200; pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--card); color: var(--text);
  border: 1px solid oklch(1 0 0 / 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px; line-height: 1.35;
  box-shadow: 0 14px 32px oklch(0 0 0 / 0.45);
  animation: tfade .22s cubic-bezier(.4,1.2,.5,1);
  display: flex; align-items: flex-start; gap: 10px;
}
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--accent); }
.toast.info { border-left-color: var(--blue); }
.toast .toast-ico {
  flex: 0 0 auto; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.toast.error .toast-ico { color: var(--danger); }
.toast.info .toast-ico { color: var(--blue); }
.toast .toast-body { flex: 1; min-width: 0; word-wrap: break-word; }
.toast.leaving { animation: tfadeout .18s ease forwards; }
@keyframes tfade { from { transform: translateY(-10px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes tfadeout { to { transform: translateY(-10px); opacity: 0 } }
@media (min-width: 720px) {
  .toast-stack { left: auto; max-width: 380px; }
}

/* Confirm modal (centered sheet, 2 buttons) */
.modal-backdrop.centered { align-items: center; }
.confirm-sheet {
  background: var(--card); border-radius: 20px;
  border: 1px solid oklch(1 0 0 / 0.08);
  width: 100%; max-width: 440px;
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 14px;
  animation: mslide .22s cubic-bezier(.4,1.2,.5,1);
  box-shadow: 0 20px 50px oklch(0 0 0 / 0.55);
}
.confirm-title { font-size: 18px; font-weight: 700; color: var(--text); }
.confirm-body { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.prompt-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border-radius: 12px;
  background: oklch(1 0 0 / 0.04);
  border: 1px solid oklch(1 0 0 / 0.1);
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 14px; letter-spacing: 0.02em;
  outline: none;
}
.prompt-input:focus {
  border-color: var(--accent);
  background: oklch(1 0 0 / 0.06);
}
.confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 4px;
}
.confirm-actions button {
  min-width: 96px; padding: 10px 18px;
  border-radius: 12px; font-weight: 600; font-size: 14px;
}
.confirm-btn-cancel {
  background: oklch(1 0 0 / 0.05); color: var(--text);
  border: 1px solid oklch(1 0 0 / 0.08);
  box-shadow: none;
}
.confirm-btn-ok {
  background: var(--accent); color: oklch(0.14 0.02 140);
  border: 1px solid var(--accent);
}
.confirm-btn-ok.danger {
  background: var(--danger); color: #fff;
  border-color: var(--danger);
}

/* Responsive: wider columns on desktop */
@media (min-width: 720px) {
  main { max-width: 640px; padding: 6px 24px 24px; }
  nav { max-width: 640px; }
  .hero-title { font-size: 32px; }
}
@media (min-width: 1024px) {
  main { max-width: 720px; padding: 8px 32px 32px; }
  nav { max-width: 720px; }
  header { padding: 22px 32px 16px; }
}
