:root {
  --bg: #111114;
  --card: #18181b;
  --input: #1f1f23;
  --border: #27272a;
  --border2: #3f3f46;
  --blue: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --t1: #fafafa;
  --t2: #a1a1aa;
  --t3: #52525b;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--t1);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.header {
  height: 44px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--t1);
}
.header-brand svg { color: var(--blue); }
.header-right { display: flex; align-items: center; gap: 12px; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); display: inline-block;
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.live-label { font-size: 11px; color: var(--t3); display: flex; align-items: center; gap: 5px; }
.stat { font-size: 11px; color: var(--t3); }
.stat b { color: var(--t1); font-weight: 600; }

/* ── Tab bar (mobile) ── */
.tab-bar { display: none; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--t3); font-size: 13px; font-weight: 500; font-family: var(--sans);
  padding: 10px 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: color .15s;
}
.tab.active { color: var(--t1); border-bottom-color: var(--blue); }
.tab-badge {
  background: var(--blue); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 99px;
  display: none;
}
.tab-badge.show { display: inline-block; }

/* ── Layout ── */
.content { display: flex; flex: 1; overflow: hidden; }

/* ── Left sidebar ── */
.sidebar {
  width: 260px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto;
}

input {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--t1);
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
}
input:focus { border-color: var(--blue); }
input::placeholder { color: var(--t3); font-family: var(--sans); }

.btn-send {
  width: 100%; border: none; border-radius: 8px;
  background: var(--blue); color: #fff;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .15s;
  margin-top: 2px;
}
.btn-send:hover { opacity: .88; }
.btn-send:active { opacity: .75; transform: scale(.99); }

.sep { height: 1px; background: var(--border); margin: 8px 0; }


.sidebar-label {
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--t3);
  margin-bottom: 2px;
}

/* API ref */
.api-ref { margin-top: auto; padding-top: 12px; }
.api-ref summary {
  font-size: 11px; color: var(--t3); cursor: pointer;
  list-style: none; display: flex; align-items: center;
  gap: 4px; padding: 4px 0; user-select: none;
}
.api-ref summary::-webkit-details-marker { display: none; }
.api-ref summary::after { content: '▾'; margin-left: auto; font-size: 10px; }
.api-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.api-row {
  font-family: var(--mono); font-size: 11px; color: var(--t3);
  display: flex; align-items: center; gap: 6px;
}
.m-post { color: var(--blue); font-weight: 700; }
.m-get  { color: var(--green); font-weight: 700; }
.m-del  { color: var(--red); font-weight: 700; }

/* ── Inbox ── */
.inbox {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.inbox-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.inbox-bar input {
  flex: 1; font-family: var(--sans); font-size: 13px;
  padding: 7px 11px; border-radius: 8px;
}
.btn-clear {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--t3); font-family: var(--sans);
  padding: 6px 8px; border-radius: 6px;
  white-space: nowrap; transition: color .15s;
}
.btn-clear:hover { color: var(--red); }

.inbox-list {
  flex: 1; overflow-y: auto;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.inbox-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; color: var(--t3); font-size: 13px;
}
.inbox-empty svg { opacity: .2; }

/* ── Card ── */
.msg-card {
  background: linear-gradient(160deg, #1c2235 0%, #13161f 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  animation: up .25s ease;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
}
.msg-card::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,130,246,.45), transparent);
}
.msg-card:hover { border-color: rgba(255,255,255,.1); box-shadow: 0 8px 32px rgba(0,0,0,.45); }
.msg-card.verified::before { background: linear-gradient(90deg, transparent, rgba(34,197,94,.4), transparent); }
.msg-card.expired { opacity: .35; pointer-events: none; }
@keyframes up { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

/* Row 1 */
.r1 {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.r1-phone {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--t2); letter-spacing: .02em;
}
.r1-right { display: flex; align-items: center; gap: 8px; }
.r1-time { font-size: 11px; color: var(--t3); font-family: var(--mono); }

/* Pulse dot */
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--t3); position: relative; flex-shrink: 0;
}
.dot.active {
  background: var(--blue);
  box-shadow: 0 0 6px rgba(59,130,246,.6);
}
.dot.active::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%; border: 1px solid var(--blue);
  animation: ring 2.5s ease-out infinite; opacity: 0;
}
@keyframes ring {
  0%  { transform: scale(.5); opacity: .7; }
  100%{ transform: scale(2);  opacity: 0; }
}
.dot.verified-dot { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.5); }

/* Row 2 — OTP tiles */
.r2 {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.otp-tiles { display: flex; gap: 5px; }
.otp-tile {
  width: 36px; height: 46px;
  background: rgba(59,130,246,.06);
  border: 1px solid rgba(59,130,246,.14);
  border-radius: 10px;
  font-family: var(--mono); font-size: 22px; font-weight: 700;
  color: var(--t1);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.2);
  transition: border-color .2s;
}
.msg-card.verified .otp-tile { color: var(--green); border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.05); }
.msg-card.expired  .otp-tile { color: var(--t3); border-color: var(--border); background: transparent; }

.btn-copy {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; color: var(--t3);
  cursor: pointer; font-size: 11px; font-weight: 600;
  font-family: var(--sans); padding: 5px 10px;
  display: flex; align-items: center; gap: 4px;
  transition: all .15s; white-space: nowrap;
}
.btn-copy:hover { background: rgba(255,255,255,.09); color: var(--t1); border-color: rgba(255,255,255,.14); }
.btn-copy.copied { background: rgba(34,197,94,.1); color: var(--green); border-color: rgba(34,197,94,.25); }

.ref-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.ref-label {
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--t3);
}
.ref-tag {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--amber); letter-spacing: .08em;
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 6px; padding: 2px 8px;
  box-shadow: 0 0 10px rgba(245,158,11,.08);
}

/* Row 3 — timer */
.r3 { margin-bottom: 0; }
.timer-row {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--t3); font-family: var(--mono);
  margin-bottom: 6px;
}
.timer-track {
  height: 3px;
  background: rgba(255,255,255,.05);
  border-radius: 99px;
  overflow: hidden;
}
.timer-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
  box-shadow: 0 0 8px rgba(59,130,246,.5);
  transition: width 1s linear, background .4s, box-shadow .4s;
}
.timer-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 8px rgba(245,158,11,.4);
}
.timer-fill.crit {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 8px rgba(239,68,68,.4);
}


/* ── Toast ── */
.toast-container { position: fixed; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 999; }
.toast {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 8px; padding: 8px 14px;
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
  animation: slideIn .18s ease; box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.toast.success { color: var(--green); border-color: rgba(34,197,94,.3); }
.toast.error   { color: var(--red);   border-color: rgba(239,68,68,.3); }
.toast.info    { color: var(--blue);  border-color: rgba(59,130,246,.3); }
@keyframes slideIn { from{opacity:0;transform:translateX(8px)} to{opacity:1;transform:none} }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Mobile ── */
@media (max-width: 600px) {
  .tab-bar { display: flex; }
  .sidebar, .inbox { display: none; }
  .sidebar.active { display: flex; width: 100%; border: none; height: calc(100dvh - 88px); }
  .inbox.active   { display: flex; width: 100%; border: none; height: calc(100dvh - 88px); }
  .otp-num { font-size: 22px; letter-spacing: 4px; }
}
