:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --sidebar-w: 380px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.08), 0 12px 32px -12px rgba(0,0,0,.35);
  --shadow-2: 0 8px 24px -12px rgba(0,0,0,.5), 0 40px 80px -30px rgba(0,0,0,.5);
  --shadow-glow: 0 0 0 1px var(--c-accent-a2), 0 20px 60px -15px var(--c-accent-a3);
  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --focus: 0 0 0 3px var(--c-accent-a2);

  --c-bg: #070910;
  --c-bg-2: #0a0d16;
  --c-surface: rgba(22, 26, 38, 0.7);
  --c-surface-2: rgba(30, 35, 50, 0.6);
  --c-surface-3: rgba(44, 50, 70, 0.7);
  --c-border: rgba(255,255,255,0.07);
  --c-border-2: rgba(255,255,255,0.12);
  --c-border-hover: rgba(255,255,255,0.18);
  --c-text: #EEF0F7;
  --c-text-2: #A0A6BD;
  --c-text-3: #636983;
  --c-accent: #6C8EFF;
  --c-accent-2: #9B7CFF;
  --c-accent-3: #36D5E7;
  --c-accent-a2: rgba(108, 142, 255, 0.32);
  --c-accent-a3: rgba(108, 142, 255, 0.22);
  --c-ok: #4ADE80;
  --c-ok-a1: rgba(74,222,128,.14);
  --c-ok-a2: rgba(74,222,128,.3);
  --c-warn: #FBBF24;
  --c-err: #FB7185;
  --c-err-a1: rgba(251,113,133,.14);
  --c-err-a2: rgba(251,113,133,.3);
  --c-otp: #F472B6;
  --c-otp-a1: rgba(244,114,182,.14);
  --c-otp-a2: rgba(244,114,182,.3);
  --c-grad-btn: linear-gradient(135deg,#6C8EFF 0%,#9B7CFF 50%,#36D5E7 100%);
  --c-grad-soft: linear-gradient(135deg, rgba(108,142,255,.18), rgba(155,124,255,.16) 50%, rgba(54,213,231,.12));
}
.aurora.a1 { background: radial-gradient(circle at 15% 20%, rgba(108,142,255,.35), transparent 45%); }
.aurora.a2 { background: radial-gradient(circle at 85% 10%, rgba(155,124,255,.30), transparent 45%); }
.aurora.a3 { background: radial-gradient(circle at 50% 100%, rgba(54,213,231,.22), transparent 50%); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  font-feature-settings: "cv11", "ss01";
}

/* Backgrounds */
.bg-aurora {
  position: fixed; inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--c-bg);
}
.aurora {
  position: absolute;
  filter: blur(80px);
  opacity: .9;
  animation: floatA 22s ease-in-out infinite alternate;
}
.aurora.a1 { top: -10%; left: -10%; width: 55%; height: 60%; border-radius: 50%; }
.aurora.a2 { top: -15%; right: -10%; width: 50%; height: 55%; border-radius: 50%; animation-delay: -8s; animation-name: floatB; }
.aurora.a3 { bottom: -20%; left: 20%; width: 70%; height: 60%; border-radius: 50%; animation-delay: -14s; animation-name: floatC; }
@keyframes floatA { 0%{ transform: translate3d(0,0,0) scale(1); } 100%{ transform: translate3d(40px,20px,0) scale(1.08); } }
@keyframes floatB { 0%{ transform: translate3d(0,0,0) scale(1); } 100%{ transform: translate3d(-30px,25px,0) scale(1.06); } }
@keyframes floatC { 0%{ transform: translate3d(0,0,0) scale(1); } 100%{ transform: translate3d(20px,-30px,0) scale(1.1); } }

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  pointer-events: none;
}

/* App Layout */
#app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  gap: 0;
}

/* Sidebar */
.sidebar {
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0) 50%);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  padding: 18px 16px 14px;
  gap: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--c-accent-a2) 30%, var(--c-accent-a2) 70%, transparent);
  pointer-events: none;
}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--c-border-2); border-radius: 8px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--c-border);
}
.brand-mark {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--c-grad-soft);
  border: 1px solid var(--c-border-2);
  position: relative;
}
.brand-mark::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: var(--c-grad-btn);
  opacity: .0;
  transition: opacity .3s var(--ease);
  z-index: -1;
  filter: blur(12px);
}
.brand-mark:hover::before { opacity: .35; }
.logo-svg { width: 24px; height: 24px; }
.brand-text .brand-title { font-weight: 800; font-size: 16px; letter-spacing: .2px; }
.brand-sub { font-size: 10.5px; color: var(--c-text-3); letter-spacing: 1.7px; font-weight: 700; margin-top: 2px; }
.brand-title { font-weight: 800; font-size: 16px; }

/* Sidebar tabs */
.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 4px;
  backdrop-filter: blur(10px);
}
.sb-tab {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  color: var(--c-text-3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.sb-tab:hover { color: var(--c-text-2); background: var(--c-surface); }
.sb-tab.active {
  color: var(--c-text);
  background: var(--c-surface-3);
  border-color: var(--c-border-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.03);
}
.i-svg { width: 16px; height: 16px; flex-shrink: 0; }
.i-svg-sm { width: 14px; height: 14px; flex-shrink: 0; }
.sb-tab.active .i-svg {
  color: var(--c-accent);
}

/* Panel heads */
.sb-panel { display: flex; flex-direction: column; gap: 14px; }
.panel-head {
  display: flex; align-items: center; gap: 11px;
  padding: 2px 2px;
}
.ph-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--c-grad-soft);
  border: 1px solid var(--c-border-2);
  color: var(--c-accent);
  flex-shrink: 0;
}
.ph-icon-alt { color: var(--c-accent-2); }
.ph-title { font-weight: 700; font-size: 14px; }
.ph-sub { font-size: 11.5px; color: var(--c-text-3); margin-top: 1px; }

/* Fields */
.field { display: block; }
.field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  color: var(--c-text-2);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: .1px;
}
.field-label em {
  margin-left: auto;
  font-style: normal;
  font-weight: 500;
  color: var(--c-text-3);
  font-size: 10.5px;
}
.input-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  transition: all .2s var(--ease);
}
.input-wrap:focus-within {
  border-color: var(--c-accent);
  box-shadow: var(--focus);
  background: var(--c-surface-2);
}
input, .select {
  width: 100%;
  background: transparent;
  color: var(--c-text);
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  border-radius: inherit;
}
input::placeholder { color: var(--c-text-3); }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
}
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 30px;
  cursor: pointer;
}
.select option {
  color: #fff !important;
  background-color: var(--c-surface);
}
.select.sm { padding-top: 7px 28px 7px 10px; font-size: 12.5px; background-position: right 8px center; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.field-span { grid-column: 1 / -1; }

/* Switches */
.field-switch {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  transition: all .2s var(--ease);
  cursor: pointer;
  margin-bottom: 10px;
}
.field-switch:hover { border-color: var(--c-border-2); }
.field-switch:has(.sw:checked) {
  border-color: var(--c-accent-a2);
  background: var(--c-surface-2);
}
.sw { display: none; }
.sw-track {
  width: 34px; height: 20px;
  border-radius: 999px;
  background: var(--c-border-2);
  position: relative;
  transition: all .22s var(--ease);
  flex-shrink: 0;
}
.sw-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: all .22s var(--ease);
}
.sw:checked + .sw-track {
  background: var(--c-grad-btn);
  box-shadow: 0 0 0 2px var(--c-accent-a2);
}
.sw:checked + .sw-track .sw-thumb { transform: translateX(14px); }
.sw-title { font-size: 12.5px; font-weight: 600; color: var(--c-text); }
.sw-sub { font-size: 11px; color: var(--c-text-3); margin-top: 1px; }

.gen-pw-link {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--c-accent);
  font-weight: 600;
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all .15s var(--ease);
  font-family: inherit;
}
.gen-pw-link:hover { background: var(--c-accent-a2); }

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s var(--ease-out);
  user-select: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  color: #fff;
  background: var(--c-grad-btn);
  background-size: 200% 200%;
  background-position: 0% 50%;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 8px 24px -10px var(--c-accent-a3);
  border: 1px solid rgba(255,255,255,.08);
}
.btn-primary:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 14px 32px -12px var(--c-accent);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; transform: none; cursor: not-allowed; filter: grayscale(.2); }

.btn-secondary {
  color: var(--c-text);
  background: var(--c-surface-3);
  border-color: var(--c-border-2);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  border-color: var(--c-accent);
  color: var(--c-text);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -10px var(--c-accent-a2);
}
.btn-ghost {
  color: var(--c-text-2);
  background: var(--c-surface);
  border-color: var(--c-border);
}
.btn-ghost:hover {
  color: var(--c-text);
  background: var(--c-surface-2);
  border-color: var(--c-border-2);
  transform: translateY(-1px);
}
.btn-danger:hover {
  border-color: var(--c-err-a2);
  color: var(--c-err);
}
#login-btn, #cr-random-btn, #cc-create-btn, #cb-bulk-btn, #ak-create-btn, #admin-verify {
  width: 100%;
  margin-top: 4px;
}
#ak-create-btn { margin-top: 6px; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--c-text-2);
  transition: all .18s var(--ease);
  flex-shrink: 0;
}
.icon-btn:hover {
  color: var(--c-accent);
  border-color: var(--c-accent-a2);
  background: var(--c-surface-2);
}

/* Err box */
.err-box {
  margin-top: 10px;
  font-size: 12px;
  color: var(--c-err);
  background: var(--c-err-a1);
  border: 1px solid var(--c-err-a2);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: none;
  font-weight: 500;
}
.err-box.show { display: block; animation: shake .35s var(--ease); }
@keyframes shake { 0%,100%{ transform: translateX(0); } 25%{ transform: translateX(-4px); } 75%{ transform: translateX(4px); } }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-border), transparent);
  margin: 4px 0;
}

/* Session card */
.session-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}
.session-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--c-grad-btn);
  opacity: .8;
}
.sc-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.sc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-ok);
  box-shadow: 0 0 0 3px var(--c-ok-a1);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 3px var(--c-ok-a1); } 50%{ box-shadow: 0 0 0 5px var(--c-ok-a1), 0 0 10px var(--c-ok); } }
.sc-title { font-size: 10px; letter-spacing: 1.6px; color: var(--c-text-3); font-weight: 700; }
.sc-email {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  padding: 10px 11px;
  border-radius: var(--radius-sm);
}
.sc-email-text {
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
  color: var(--c-text);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-meta {
  display: flex; gap: 6px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
}
.chip-ok {
  color: var(--c-ok);
  background: var(--c-ok-a1);
  border-color: var(--c-ok-a2);
}
.chip-otp {
  color: var(--c-otp);
  background: var(--c-otp-a1);
  border-color: var(--c-otp-a2);
}
.chip-err {
  color: var(--c-err);
  background: var(--c-err-a1);
  border-color: var(--c-err-a2);
}

.sc-actions {
  display: flex; flex-direction: column; gap: 7px;
}
.sc-actions .btn-secondary,
.sc-actions .btn-ghost { width: 100%; }

/* Sub tabs */
.sub-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 4px;
}
.sub-tab {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 4px;
  color: var(--c-text-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.sub-tab:hover { color: var(--c-text-2); }
.sub-tab.active {
  color: var(--c-text);
  background: var(--c-surface-3);
  border-color: var(--c-border-2);
}

/* Sub head */
.sub-head {
  display: flex; align-items: center; gap: 7px;
  color: var(--c-accent);
  font-weight: 700;
  font-size: 12px;
  margin: 10px 2px 8px;
  letter-spacing: .2px;
}

/* Sidebar bottom */
.sidebar-bottom { margin-top: auto; }
.foot-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px 2px 4px;
}
.ft-col { display: flex; flex-direction: column; gap: 6px; }
.ft-label {
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: var(--c-text-3);
  font-weight: 700;
}

.foot-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 10.5px;
  color: var(--c-text-3);
  letter-spacing: .5px;
  font-weight: 500;
}
.dot-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-ok);
  box-shadow: 0 0 6px var(--c-ok);
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100%{ opacity: 1; } 50%{ opacity: .4; } }

/* Content area */
.content { position: relative; display: flex; flex-direction: column; min-width: 0; }

/* Topbar */
.topbar {
  height: 62px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--c-border);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.crumbs {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.crumb-root {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.crumb-root .i-svg-sm { color: var(--c-accent); }
.crumb-sep {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--c-border-2);
}
.crumb-addr {
  font-family: var(--font-mono);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  padding: 4px 0;
}
.crumb-addr:empty::after {
  content: "— no inbox —";
  color: var(--c-text-3);
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 12.5px;
}
.top-actions { display: flex; gap: 8px; }

.spinner { animation: spin 1.1s linear infinite; animation-play-state: paused; }
.refreshing .spinner { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  flex: 1; min-height: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow-y: auto;
}
.empty-card {
  max-width: 560px;
  width: 100%;
  text-align: center;
  position: relative;
}
.empty-orb {
  position: relative;
  width: 112px; height: 112px;
  margin: 0 auto 24px;
}
.orb-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--c-grad-btn);
  opacity: .14;
  filter: blur(18px);
  animation: orbPulse 4s ease-in-out infinite;
}
@keyframes orbPulse { 0%,100%{ transform: scale(1); opacity: .14; } 50%{ transform: scale(1.08); opacity: .22; } }
.orb-core {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 28px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  display: grid; place-items: center;
  box-shadow: var(--shadow-2);
}
.orb-core svg { width: 48px; height: 48px; }

.empty-card h1 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.3px;
  background: linear-gradient(135deg, var(--c-text), var(--c-text-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.empty-card p {
  color: var(--c-text-2);
  margin: 0 auto 28px;
  max-width: 440px;
  font-size: 14px;
  line-height: 1.6;
}
.empty-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
  text-align: left;
}
.eq-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  transition: all .25s var(--ease);
  cursor: default;
}
.eq-item:hover {
  transform: translateY(-3px);
  border-color: var(--c-border-hover);
  box-shadow: var(--shadow-1);
}
.eq-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--c-grad-soft);
  border: 1px solid var(--c-border-2);
  color: var(--c-accent);
  margin-bottom: 10px;
}
.eq-icon-alt { color: var(--c-accent-2); }
.eq-icon-3 { color: var(--c-accent-3); }
.eq-title {
  font-size: 13px; font-weight: 700; margin-bottom: 2px;
}
.eq-sub {
  font-size: 11.5px; color: var(--c-text-3);
}
.empty-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  color: var(--c-text-2);
  font-size: 12.5px;
  max-width: 100%;
}
.empty-tip .i-svg-sm { color: var(--c-accent); flex-shrink: 0; }
.empty-tip code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--c-bg-2);
  color: var(--c-accent);
  border: 1px solid var(--c-border);
  margin: 0 2px;
  font-weight: 600;
}

/* Inbox view */
.inbox-view {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 400px 1fr;
}

.mail-list {
  border-right: 1px solid var(--c-border);
  background: rgba(255,255,255,0.015);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.ml-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(10px);
}
.ml-title {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--c-text-3);
  font-weight: 700;
}
.ml-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--c-grad-btn);
  color: #fff;
  font-weight: 600;
}
.mail-list-inner {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.mail-list-inner::-webkit-scrollbar { width: 8px; }
.mail-list-inner::-webkit-scrollbar-thumb { background: var(--c-border-2); border-radius: 8px; }

.mail-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 4px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: start;
  transition: all .18s var(--ease);
  position: relative;
}
.mail-item:hover {
  background: var(--c-surface);
  border-color: var(--c-border);
  transform: translateX(2px);
}
.mail-item.selected {
  background: var(--c-surface-2);
  border-color: var(--c-accent-a2);
  box-shadow: 0 0 0 2px var(--c-accent-a2), var(--shadow-1);
}
.mail-item.unread::before {
  content: "";
  position: absolute;
  left: 4px; top: 18px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-a2);
}
.mail-from-dot {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--c-grad-soft);
  border: 1px solid var(--c-border-2);
  font-weight: 800;
  font-size: 12.5px;
  color: var(--c-text);
  flex-shrink: 0;
  letter-spacing: .3px;
}
.mail-core { min-width: 0; }
.mail-from {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--c-text);
}
.mail-item.unread .mail-from { color: var(--c-text); }
.mail-subject {
  font-size: 12.5px;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  font-weight: 500;
}
.mail-preview {
  font-size: 11.5px;
  color: var(--c-text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.mail-meta-col {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.mail-time {
  font-size: 10.5px;
  color: var(--c-text-3);
  font-weight: 600;
  white-space: nowrap;
}
.mail-otp-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--c-otp-a1);
  color: var(--c-otp);
  border: 1px solid var(--c-otp-a2);
}

.mail-list-empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--c-text-3);
  display: flex; flex-direction: column; align-items: center;
}
.mail-list-empty .me-big {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px) 0 0 / 12px 12px,
    var(--c-surface-3);
  border: 1px solid var(--c-border-2);
}

/* Mail pane */
.mail-pane {
  background: rgba(255,255,255,0.008);
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mail-empty {
  margin: auto;
  text-align: center;
  padding: 48px 28px;
  color: var(--c-text-3);
  max-width: 420px;
}
.me-wrap { display: flex; flex-direction: column; align-items: center; }
.me-orb {
  width: 96px; height: 96px;
  border-radius: 28px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  display: grid; place-items: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-1);
  position: relative;
}
.me-orb::before {
  content: "";
  position: absolute; inset: -6px;
  border-radius: inherit;
  background: var(--c-grad-btn);
  opacity: .12;
  filter: blur(16px);
}
.me-orb svg { width: 44px; height: 44px; position: relative; }
.mail-empty h2 { color: var(--c-text-2); margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.mail-empty p { color: var(--c-text-3); margin: 0; font-size: 13px; }

.mail-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mail-head {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
}
.mail-head h2 {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.1px;
  color: var(--c-text);
}
.mail-meta {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 16px 24px;
  align-items: center;
}
.mm-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mm-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--c-grad-btn);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  letter-spacing: .3px;
}
.mm-col { display: flex; flex-direction: column; min-width: 0; }
.mm-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--c-text-3);
  font-weight: 700;
  margin-bottom: 2px;
}
.mm-from {
  font-size: 13px;
  color: var(--c-text-2);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.mm-time { font-size: 13px; color: var(--c-text-2); }
.mm-time-wrap .i-svg-sm { color: var(--c-text-3); }
.mm-chips { display: flex; gap: 8px; justify-content: flex-end; }
.mm-chips .chip .i-svg-sm { width: 12px; height: 12px; }

/* Tabs */
.tabs {
  display: flex; gap: 2px;
  padding: 14px 28px 0;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-2);
}
.tab {
  display: flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 9px 14px;
  color: var(--c-text-3);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: -1px;
  transition: all .18s var(--ease);
}
.tab:hover { color: var(--c-text-2); }
.tab.active {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border);
  border-bottom-color: var(--c-bg);
  position: relative;
}
.tab.active::before {
  content: "";
  position: absolute;
  bottom: -1px; left: 8px; right: 8px;
  height: 2px;
  background: var(--c-grad-btn);
  border-radius: 2px;
}

.tab-pane {
  flex: 1; min-height: 0;
  overflow: auto;
  padding: 24px 28px 36px;
  display: none;
  line-height: 1.6;
}
.tab-pane.active { display: block; }
.tab-pane.pre {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--c-text-2);
  background: var(--c-bg-2);
  margin: 0;
  border-radius: 0;
}
#mb-html .html-sandbox {
  max-width: 100%;
  min-height: 400px;
  background: #fff;
  padding: 22px;
  color: #111;
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius);
  overflow: auto;
}
#mb-html .html-sandbox :root { color-scheme: light; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  animation: fadeIn .2s var(--ease);
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-2);
  animation: popIn .22s var(--ease-out);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
@keyframes popIn {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.modal-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--c-grad-soft);
  border: 1px solid var(--c-border-2);
  color: var(--c-accent);
  flex-shrink: 0;
}
.modal-title { font-weight: 700; font-size: 15px; }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* Toasts */
.toast-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  min-width: 240px;
  max-width: 380px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 12.5px;
  box-shadow: var(--shadow-2);
  animation: toastIn .25s var(--ease-out);
  pointer-events: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  font-weight: 500;
  color: var(--c-text);
}
.toast::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--c-accent);
}
.toast.ok::before { background: var(--c-ok); }
.toast.err::before { background: var(--c-err); }
.toast.warn::before { background: var(--c-warn); }
@keyframes toastIn {
  from { transform: translateY(14px) translateX(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Result box */
.result-box {
  margin-top: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-all;
  display: none;
  max-height: 280px;
  overflow-y: auto;
  animation: slideDown .25s var(--ease-out);
}
.result-box.show { display: block; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.r-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--c-border);
}
.r-row:last-child { border-bottom: none; }
.r-label {
  font-size: 10px;
  color: var(--c-text-3);
  letter-spacing: 1px;
  font-weight: 700;
  min-width: 70px;
  text-transform: uppercase;
}
.r-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.r-actions { display: flex; gap: 5px; flex-shrink: 0; }
.r-copy {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 7px;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  cursor: pointer;
  transition: all .15s var(--ease);
  font-family: inherit;
}
.r-copy:hover { color: var(--c-accent); border-color: var(--c-accent-a2); }
.r-group { padding: 4px 0 2px; }
.r-group-title {
  font-size: 10.5px;
  color: var(--c-accent);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.r-ok {
  color: var(--c-ok);
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--c-ok-a1);
  border: 1px solid var(--c-ok-a2);
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11.5px;
}
.r-err {
  color: var(--c-err);
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--c-err-a1);
  border: 1px solid var(--c-err-a2);
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11.5px;
}
.bulk-list {
  font-family: var(--font-mono);
  font-size: 11px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--c-bg-2);
  border-radius: var(--radius-sm);
  padding: 6px;
  border: 1px solid var(--c-border);
}
.bulk-item {
  padding: 5px 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.bulk-item + .bulk-item { margin-top: 2px; }
.bulk-item:nth-child(even) { background: var(--c-surface-2); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--c-surface-3);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--c-border-2);
  background-clip: padding-box;
  border: 2px solid transparent;
}
::-webkit-scrollbar-track { background: transparent; }

/* Responsive */
@media (max-width: 1100px) {
  :root { --sidebar-w: 340px; }
  .inbox-view { grid-template-columns: 340px 1fr; }
  .empty-quick { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar {
    height: auto;
    max-height: 55vh;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }
  .inbox-view { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mail-list {
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    max-height: 40vh;
  }
  .mail-meta { grid-template-columns: 1fr; }
}

/* Selection */
::selection {
  background: var(--c-accent-a2);
  color: var(--c-text);
}

/* Input autofill */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--c-surface) inset !important;
  -webkit-text-fill-color: var(--c-text) !important;
  transition: background-color 5000s ease-in-out 0s;
}