/* TwitchMail — custom design system (no @apply, plays nicely with Tailwind CDN) */

:root {
  --bg-950: #07070d;
  --bg-900: #0b0b14;
  --bg-850: #0e0e1c;
  --bg-800: #11111d;
  --bg-700: #171727;
  --bg-600: #1d1d31;
  --bg-500: #262644;
  --line:   rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --text:   #e7e7f1;
  --text-2: rgba(231,231,241,0.72);
  --text-3: rgba(231,231,241,0.45);
  --text-4: rgba(231,231,241,0.30);
  --brand-300: #c4b5fd;
  --brand-400: #a78bfa;
  --brand-500: #8b5cf6;
  --brand-600: #7c3aed;
  --brand-700: #6d28d9;
  --emerald: #10b981;
  --rose:    #f43f5e;
  --amber:   #f59e0b;
  --sky:     #0ea5e9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  background: var(--bg-900);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background grid + glow */
.app-bg {
  background-image:
    radial-gradient(60rem 30rem at 80% -10%, rgba(139,92,246,0.18), transparent 60%),
    radial-gradient(50rem 30rem at -10% 110%, rgba(124,58,237,0.16), transparent 60%);
  background-attachment: fixed;
}
.app-bg-grid {
  background-image:
    radial-gradient(60rem 30rem at 80% -10%, rgba(139,92,246,0.18), transparent 60%),
    radial-gradient(50rem 30rem at -10% 110%, rgba(124,58,237,0.16), transparent 60%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}

/* ---------- Form fields ---------- */
.field {
  display: block;
  width: 100%;
  background: rgba(23,23,39,0.8);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
  font-family: inherit;
}
.field::placeholder { color: var(--text-4); }
.field:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(139,92,246,0.18);
  background: rgba(23,23,39,1);
}
textarea.field { resize: vertical; min-height: 76px; line-height: 1.5; }
select.field {
  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 24 24' fill='none' stroke='%23a78bfa' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.field-with-icon { position: relative; }
.field-with-icon .field { padding-left: 40px; }
.field-with-icon .field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-4); font-size: 14px; pointer-events: none;
}
.field-with-icon .field-action {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--text-3); cursor: pointer; padding: 6px;
  border-radius: 8px; font-size: 14px;
}
.field-with-icon .field-action:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.help { font-size: 11px; color: var(--text-4); margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  padding: 10px 14px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .05s, background .15s, border-color .15s, color .15s, box-shadow .15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn i { font-size: 12px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  box-shadow: 0 10px 30px -12px rgba(139,92,246,0.55), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
}
.btn-secondary {
  color: var(--text-2);
  background: rgba(255,255,255,0.04);
  border-color: var(--line);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-ghost { color: var(--text-3); background: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-danger {
  color: #fecdd3;
  background: rgba(244,63,94,0.10);
  border-color: rgba(244,63,94,0.30);
}
.btn-danger:hover { background: rgba(244,63,94,0.18); color: #fee2e2; }
.btn-icon { padding: 8px; min-width: 34px; min-height: 34px; }
.btn-block { width: 100%; padding: 12px 16px; font-size: 14px; }

/* ---------- Cards / panels ---------- */
.card {
  background: rgba(17,17,29,0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.card-pad { padding: 20px; }
.card-pad-lg { padding: 28px; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap;
}
.pill-ok   { color: #6ee7b7; background: rgba(16,185,129,0.10); border-color: rgba(16,185,129,0.30); }
.pill-err  { color: #fda4af; background: rgba(244,63,94,0.10); border-color: rgba(244,63,94,0.30); }
.pill-warn { color: #fcd34d; background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.30); }
.pill-info { color: #7dd3fc; background: rgba(14,165,233,0.10); border-color: rgba(14,165,233,0.30); }
.pill-brand{ color: #c4b5fd; background: rgba(139,92,246,0.10); border-color: rgba(139,92,246,0.30); }
.pill-mute { color: var(--text-3); background: rgba(255,255,255,0.04); border-color: var(--line); }
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 248px; flex: 0 0 248px;
  background: rgba(11,11,20,0.85);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  min-height: 100vh; position: sticky; top: 0;
}
.brand-row {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  box-shadow: 0 8px 28px -8px rgba(139,92,246,0.6);
}
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: 0.01em; }
.brand-sub  { font-size: 11px; color: var(--text-4); }
.nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; user-select: none;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(124,58,237,0.28), rgba(139,92,246,0.06));
  border-color: rgba(139,92,246,0.32);
}
.nav-item .nav-ico { width: 18px; text-align: center; opacity: .9; }
.nav-item .nav-tail { margin-left: auto; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11,11,20,0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 12px;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-4);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
}
.tbl tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.tbl tbody tr:hover { background: rgba(255,255,255,0.02); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.tbl-empty { padding: 48px 24px; text-align: center; color: var(--text-4); }
.tbl-empty i { font-size: 28px; display: block; margin-bottom: 10px; opacity: .6; }
.cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-3); }
.cell-truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Stat cards ---------- */
.stat {
  position: relative; overflow: hidden;
  padding: 18px 18px;
}
.stat-glow {
  position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 999px;
  filter: blur(28px); opacity: .35;
}
.stat-label { font-size: 11px; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; }
.stat-foot  { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.stat-ico {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
  box-shadow: 0 8px 22px -10px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.18);
}
.grad-violet  { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.grad-cyan    { background: linear-gradient(135deg, #06b6d4, #0ea5e9); }
.grad-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.grad-amber   { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.grad-rose    { background: linear-gradient(135deg, #f43f5e, #be123c); }
.grad-sky     { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.grad-fuchsia { background: linear-gradient(135deg, #d946ef, #a21caf); }

/* ---------- Toggle switch ---------- */
.toggle { display: inline-flex; align-items: center; cursor: pointer; user-select: none; gap: 10px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  width: 38px; height: 22px; border-radius: 999px;
  background: rgba(255,255,255,0.10);
  position: relative; transition: background .2s;
  border: 1px solid var(--line);
}
.toggle-track::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 999px;
  background: #fff; transition: transform .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.toggle input:checked + .toggle-track { background: var(--brand-500); border-color: rgba(139,92,246,0.6); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex; gap: 2px; padding: 4px;
  background: rgba(23,23,39,0.6);
  border: 1px solid var(--line); border-radius: 12px;
}
.tab {
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  border-radius: 8px; cursor: pointer; color: var(--text-3); border: 0; background: transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(7,7,13,0.75);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  width: 100%;
  background: rgba(17,17,29,0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.02);
  display: flex; flex-direction: column;
  max-height: 90vh;
}
.modal-sm { max-width: 480px; }
.modal-md { max-width: 640px; }
.modal-lg { max-width: 880px; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ---------- Toasts ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  padding: 12px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 500;
  border: 1px solid;
  box-shadow: 0 20px 40px -16px rgba(0,0,0,0.6);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s ease-out;
}
.toast-ok  { color: #6ee7b7; background: rgba(16,185,129,0.14); border-color: rgba(16,185,129,0.4); }
.toast-err { color: #fda4af; background: rgba(244,63,94,0.14); border-color: rgba(244,63,94,0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Misc ---------- */
.alert-error {
  background: rgba(244,63,94,0.10);
  border: 1px solid rgba(244,63,94,0.32);
  color: #fda4af;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 13px; }
.kv-key { color: var(--text-4); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.kv-val { color: var(--text); word-break: break-word; }

.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 8px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.truncate-1 { display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; word-break: break-all; }
.truncate-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* HTML email body container */
.email-html { font-size: 13px; line-height: 1.55; color: var(--text-2); }
.email-html a { color: var(--brand-300); text-decoration: underline; }
.email-html img { max-width: 100%; height: auto; border-radius: 8px; }
.email-html * { max-width: 100% !important; }

/* Pagination footer */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 100%; flex-basis: auto; min-height: auto; position: static; }
  .layout { flex-direction: column; }
}

/* =========================================================
   v2: Modern Inbox / Mail viewer / Temp-email designer
   ========================================================= */

/* ---- Mail layout (split pane) ---- */
.mail-split {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .mail-split { grid-template-columns: 1fr; }
}

.mail-list {
  background: rgba(17,17,29,0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 180px);
}
.mail-list-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.mail-list-body {
  flex: 1; overflow: auto; min-height: 320px;
}

/* one row in the inbox list */
.m-row {
  display: flex; gap: 12px; padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background .15s;
  position: relative;
}
.m-row:hover { background: rgba(255,255,255,0.03); }
.m-row.selected {
  background: linear-gradient(90deg, rgba(124,58,237,0.18), rgba(139,92,246,0.04));
  border-left: 3px solid var(--brand-500);
  padding-left: 11px;
}
.m-row.unread { background: rgba(139,92,246,0.045); }
.m-row.unread::before {
  content:''; position:absolute; left:6px; top:50%;
  transform:translateY(-50%);
  width:6px; height:6px; border-radius:999px;
  background: var(--brand-400);
  box-shadow: 0 0 8px var(--brand-500);
}
.m-avatar {
  flex-shrink: 0; width: 38px; height: 38px;
  border-radius: 12px; display:flex; align-items:center; justify-content:center;
  font-weight: 700; font-size: 14px; color:#fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  letter-spacing: -.01em;
}
.m-avatar.live  { background: linear-gradient(135deg, #f43f5e, #ec4899); }
.m-avatar.alias { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.m-meta { flex:1; min-width:0; }
.m-from {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-row:not(.unread) .m-from { font-weight: 500; color: var(--text-2); }
.m-subj {
  font-size: 12.5px; color: var(--text-2);
  margin-top: 2px;
  display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical;
  overflow:hidden;
}
.m-snippet {
  font-size: 11.5px; color: var(--text-4); margin-top: 3px;
  display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden;
}
.m-time {
  font-size: 11px; color: var(--text-4); white-space: nowrap;
  flex-shrink: 0; margin-left: 6px;
}
.m-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }

/* ---- Reader pane (selected email) ---- */
.mail-reader {
  background: rgba(17,17,29,0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 180px);
  overflow: hidden;
}
.mr-empty {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 60px 24px; text-align:center; color: var(--text-4);
}
.mr-empty i { font-size: 56px; opacity: .35; margin-bottom: 14px; }
.mr-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.mr-subject { font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--text); }
.mr-from-row { display:flex; align-items:center; gap:12px; margin-top:12px; }
.mr-from-info { flex:1; min-width:0; }
.mr-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.mr-addr { font-size: 11.5px; color: var(--text-3); margin-top: 2px;
  font-family: ui-monospace, monospace; word-break: break-all; }
.mr-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.mr-body {
  flex: 1; overflow: auto;
  padding: 20px 22px;
  background: rgba(7,7,13,0.4);
}
.mr-body .email-html {
  background: #fff; color: #111;
  border-radius: 10px; padding: 18px;
  font-size: 14px; line-height: 1.6;
}
.mr-body .email-html a { color: #6d28d9; }
.mr-body pre.text-body {
  background: rgba(7,7,13,0.6); border:1px solid var(--line);
  border-radius: 10px; padding: 14px; margin: 0;
  white-space: pre-wrap; word-break: break-word;
  font-size: 12.5px; color: var(--text-2);
  font-family: ui-monospace, monospace;
}

/* tracking-link hero */
.mr-tracking {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(139,92,246,0.10), rgba(56,189,248,0.06));
  border: 1px solid rgba(139,92,246,0.32);
  border-radius: 12px; padding: 14px;
}

/* ---- live indicator dot ---- */
.live-dot {
  display:inline-block; width:7px; height:7px; border-radius:999px;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.6);
  animation: livePulse 1.6s infinite;
  margin-right: 6px;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ---- Temp-email creator hero ---- */
.te-hero {
  background:
    radial-gradient(50rem 20rem at 100% -20%, rgba(139,92,246,0.20), transparent 60%),
    linear-gradient(135deg, rgba(139,92,246,0.10), rgba(56,189,248,0.04));
  border: 1px solid rgba(139,92,246,0.30);
  border-radius: 18px;
  padding: 24px;
}
.te-input-shell {
  display:flex; align-items:stretch;
  background: rgba(7,7,13,0.55);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.te-input-shell:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(139,92,246,0.18);
}
.te-input-shell input {
  flex:1; min-width:0;
  background: transparent; border: 0; outline: 0;
  color: var(--text); padding: 14px 16px;
  font-size: 16px; font-family: ui-monospace, monospace;
}
.te-input-shell .te-domain {
  display:flex; align-items:center; padding: 0 14px;
  color: var(--brand-300); font-family: ui-monospace, monospace; font-size: 14px;
  background: rgba(139,92,246,0.08); border-left: 1px solid var(--line);
}
.te-input-shell .te-roll {
  display:flex; align-items:center; padding: 0 14px; cursor: pointer;
  background: transparent; border: 0; border-left: 1px solid var(--line);
  color: var(--text-3);
}
.te-input-shell .te-roll:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.te-style-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 12px;
}
@media (max-width: 700px) { .te-style-grid { grid-template-columns: repeat(2,1fr); } }

.te-style-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
  cursor: pointer; color: var(--text-2);
  font-size: 12px; font-weight: 500;
  text-align: left; display: flex; flex-direction: column; gap: 4px;
  transition: all .15s;
  font-family: inherit;
}
.te-style-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.te-style-btn.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(139,92,246,0.06));
  border-color: var(--brand-500);
  color: var(--text);
}
.te-style-btn .te-style-name { font-weight: 600; font-size: 12.5px; }
.te-style-btn .te-style-ex { font-size: 10.5px; color: var(--text-4); font-family: ui-monospace, monospace; }
.te-style-btn.active .te-style-ex { color: var(--brand-300); }

.te-len-shell { display:flex; align-items:center; gap: 10px; }
.te-len-shell input[type=range] {
  flex: 1; appearance: none; -webkit-appearance: none;
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-500) var(--p, 50%), rgba(255,255,255,0.10) var(--p, 50%));
  outline: none;
}
.te-len-shell input[type=range]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 999px;
  background: #fff; cursor: pointer;
  box-shadow: 0 4px 10px rgba(139,92,246,.55);
  border: 2px solid var(--brand-500);
}
.te-len-val {
  min-width: 38px; text-align:center; font-weight: 700; color: var(--text);
  background: rgba(7,7,13,0.6); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 8px; font-size: 12px;
  font-family: ui-monospace, monospace;
}

/* ---- Tile-style alias card list ---- */
.alias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.alias-card {
  background: rgba(17,17,29,0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.alias-card:hover {
  border-color: rgba(139,92,246,0.32);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -16px rgba(139,92,246,.45);
}
.alias-card.unlinked { border-style: dashed; }
.alias-card .ac-addr {
  font-family: ui-monospace, monospace; font-size: 13px;
  color: var(--text); word-break: break-all; line-height: 1.4;
}
.alias-card .ac-meta {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  font-size: 11.5px; color: var(--text-3);
}
.alias-card .ac-num {
  font-size: 22px; font-weight: 700; color: var(--text); line-height: 1;
}
.alias-card .ac-body { display:flex; align-items:flex-end; justify-content:space-between; gap:10px; }
.alias-card .ac-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top: 4px; }
.alias-card .ac-glow {
  position: absolute; right: -40px; top: -40px;
  width: 130px; height: 130px; border-radius:999px;
  background: radial-gradient(circle, rgba(139,92,246,0.18), transparent 65%);
  pointer-events: none;
}

/* link-status badge inside alias card */
.link-pill {
  display:inline-flex; align-items:center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.link-pill.linked   { background: rgba(16,185,129,0.10); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.30); }
.link-pill.unlinked { background: rgba(245,158,11,0.10); color: #fcd34d; border: 1px solid rgba(245,158,11,0.30); }

/* ---- View toggle (table / grid) ---- */
.view-toggle {
  display:inline-flex; padding:3px; gap:2px;
  border:1px solid var(--line); border-radius:10px;
  background: rgba(23,23,39,0.5);
}
.view-toggle button {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 10px; border-radius: 7px;
  color: var(--text-3); font-size: 12px;
}
.view-toggle button.active {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: #fff;
}

/* ---- Linker rich list (one-click Twitch link) ---- */
.acc-pick {
  display:flex; gap:10px; align-items:center;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(7,7,13,0.4);
  cursor: pointer; transition: all .12s;
}
.acc-pick:hover { background: rgba(255,255,255,0.04); border-color: rgba(139,92,246,0.22); }
.acc-pick.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(139,92,246,0.04));
  border-color: var(--brand-500);
}
.acc-pick .ap-avatar {
  width:34px; height:34px; border-radius:10px;
  background: linear-gradient(135deg, #9146ff, #6441a5);
  display:flex; align-items:center; justify-content:center; color:#fff;
}
.acc-pick .ap-info { flex:1; min-width:0; }
.acc-pick .ap-name { font-size: 13px; font-weight: 600; color: var(--text); }
.acc-pick .ap-mail { font-size: 11px; color: var(--text-4); font-family: ui-monospace, monospace; }

/* ---- Fast-link hero (in temp emails) ---- */
.linker-banner {
  display:flex; gap:14px; align-items:center;
  padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(145,70,255,0.12), rgba(124,58,237,0.04));
  border: 1px solid rgba(145,70,255,0.30);
  margin-top: 12px;
}
.linker-banner .lb-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #9146ff, #6441a5);
  display:flex; align-items:center; justify-content:center;
  color: #fff; font-size: 16px;
}

/* ---- Live banner indicator on top ---- */
.live-pill-pulse {
  display:inline-flex; align-items:center; gap:6px;
  padding: 3px 9px; border-radius:999px;
  font-size: 10.5px; font-weight: 700;
  color: #6ee7b7;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.35);
}

/* ---------- Verification code pill (big & copyable) ---------- */
.code-pill {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(139,92,246,0.18));
    border: 1px solid rgba(168,85,247,0.4);
    border-radius: 8px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--brand-200, #d8b4fe);
    user-select: all;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.code-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168,85,247,0.25);
}

/* ---------- Mini spinner inline ---------- */
.spinner-mini {
    display: inline-block;
    width: 10px; height: 10px;
    border: 2px solid rgba(168,85,247,0.25);
    border-top-color: var(--brand-400, #c084fc);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Grid helper ---------- */
.grid { display: grid; }

/* ============================================================
   CHANNELS — live status grid
   ============================================================ */
.ch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.ch-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--line);
}
.ch-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.ch-card-live {
    border-color: rgba(248,113,113,0.45);
    box-shadow: 0 0 0 1px rgba(248,113,113,0.18) inset, 0 4px 16px rgba(248,113,113,0.10);
}
.ch-card-head { display: flex; gap: 12px; align-items: flex-start; }
.ch-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--line);
}
.ch-card-live .ch-avatar { border-color: #f87171; }
.ch-avatar-fallback {
    background: linear-gradient(135deg, #9146ff, #4d2c91);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px;
}
.ch-name { font-weight: 700; font-size: 14px; }
.ch-name a { color: var(--text); text-decoration: none; }
.ch-name a:hover { color: var(--brand-400); }
.ch-login { font-size: 11px; color: var(--text-4); margin-left: 6px; font-weight: 400; }
.ch-live { font-size: 12px; color: var(--text-2); }
.ch-live-off { color: var(--text-4); font-style: italic; }
.ch-title { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.ch-meta i { margin-right: 4px; color: var(--brand-400); }
.ch-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-sm { padding: 6px 10px !important; font-size: 12px !important; }
.pill-live {
    background: rgba(248,113,113,0.15);
    color: #fca5a5;
    border: 1px solid rgba(248,113,113,0.35);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.45); }
    50%      { box-shadow: 0 0 0 6px rgba(248,113,113,0); }
}

/* ============================================================
   TOTP / 2FA cards
   ============================================================ */
.totp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.totp-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(135deg, rgba(168,85,247,0.06), rgba(99,102,241,0.04));
    border: 1px solid var(--line);
    transition: transform 0.15s, box-shadow 0.15s;
}
.totp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(168,85,247,0.15); }
.totp-head { display: flex; gap: 10px; align-items: flex-start; }
.totp-issuer { font-size: 11px; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.totp-label { font-weight: 700; font-size: 14px; color: var(--text); margin-top: 2px; }
.totp-account { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.totp-actions { display: flex; gap: 4px; }
.totp-code-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.totp-code {
    font-family: ui-monospace, SF Mono, monospace;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--brand-400, #c084fc);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s, transform 0.1s;
}
.totp-code:hover { color: #d8b4fe; transform: scale(1.02); }
.totp-code:active { transform: scale(0.98); }
.totp-period { font-size: 12px; color: var(--text-3); font-weight: 600; }
.totp-progress {
    height: 4px;
    background: rgba(168,85,247,0.10);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.totp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #c084fc);
    border-radius: 999px;
    transition: width 1s linear;
}
.totp-progress.low .totp-progress-bar { background: linear-gradient(90deg, #f87171, #fca5a5); }

/* Inline TOTP cell inside accounts table */
.acc-totp { display: inline-flex; align-items: center; gap: 8px; }
.acc-totp-code {
    font-family: ui-monospace, SF Mono, monospace;
    font-size: 14px; font-weight: 700;
    letter-spacing: 1px;
    color: var(--brand-400, #c084fc);
    background: rgba(168,85,247,0.10);
    border: 1px solid rgba(168,85,247,0.25);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.acc-totp-code:hover { background: rgba(168,85,247,0.20); }
.acc-totp-timer {
    font-size: 11px;
    color: var(--text-4);
    font-variant-numeric: tabular-nums;
    min-width: 28px;
}

/* ============================================================
   Backup cards
   ============================================================ */
.backup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.backup-card { transition: transform 0.15s, box-shadow 0.15s; }
.backup-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.backup-ico {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.backup-gdrive {
    background: linear-gradient(135deg, rgba(66,133,244,0.20), rgba(15,157,88,0.15));
    color: #4285f4;
    border: 1px solid rgba(66,133,244,0.35);
}
.backup-mega {
    background: linear-gradient(135deg, rgba(220,38,38,0.18), rgba(220,38,38,0.10));
    color: #ef4444;
    border: 1px solid rgba(220,38,38,0.35);
}
