/* TempMail · Ethereal Glassmorphism / Spatial Aura UI */

:root {
  --sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
  --r-xl: 28px;
  --r-lg: 24px;
  --r-md: 20px;
  --pill: 9999px;
  --blur: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grad: linear-gradient(135deg, #b9a3ff 0%, #f3a9d2 52%, #ffc79c 100%);
}

/* Aurora Oscura · Crepúsculo */
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0c0a1d;
  --bg-2: #1c1438;
  --text: #f6f3ff;
  --text-2: rgba(238, 233, 255, 0.74);
  --text-3: rgba(238, 233, 255, 0.5);
  --glass-hi: rgba(255, 255, 255, 0.11);
  --glass-lo: rgba(255, 255, 255, 0.035);
  --glass-solid: rgba(22, 17, 45, 0.82);
  --glass-border: rgba(255, 255, 255, 0.25);
  --hairline: rgba(255, 255, 255, 0.1);
  --fill: rgba(255, 255, 255, 0.055);
  --fill-2: rgba(255, 255, 255, 0.09);
  --fill-hover: rgba(255, 255, 255, 0.14);
  --spec: rgba(255, 255, 255, 0.22);
  --sheen: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 60px -28px rgba(4, 2, 20, 0.85), 0 2px 10px -4px rgba(4, 2, 20, 0.5);
  --accent: #cdbcff;
  --ring: rgba(200, 182, 255, 0.42);
  --ok: #7ee7c1;
  --warn: #ffd27a;
  --danger: #ff8fa3;
  --blob-opacity: 0.5;
  --blend: screen;
  --grain-opacity: 0.06;
}

/* Aurora Clara · Etérea */
[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f0ff;
  --bg-2: #fff0f7;
  --text: #1d1838;
  --text-2: rgba(29, 24, 56, 0.7);
  --text-3: rgba(29, 24, 56, 0.48);
  --glass-hi: rgba(255, 255, 255, 0.72);
  --glass-lo: rgba(255, 255, 255, 0.36);
  --glass-solid: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.78);
  --hairline: rgba(70, 45, 160, 0.1);
  --fill: rgba(255, 255, 255, 0.42);
  --fill-2: rgba(255, 255, 255, 0.62);
  --fill-hover: rgba(255, 255, 255, 0.86);
  --spec: rgba(255, 255, 255, 0.95);
  --sheen: rgba(255, 255, 255, 0.55);
  --shadow: 0 24px 50px -28px rgba(70, 45, 160, 0.38), 0 2px 8px -4px rgba(70, 45, 160, 0.12);
  --accent: #6248ee;
  --ring: rgba(98, 72, 238, 0.3);
  --ok: #0f9d76;
  --warn: #b86e00;
  --danger: #d92f55;
  --blob-opacity: 0.72;
  --blend: normal;
  --grain-opacity: 0.04;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
a {
  color: var(--accent);
}
em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection {
  background: rgba(185, 163, 255, 0.42);
}
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent;
}
.ico {
  width: 18px;
  height: 18px;
  flex: none;
}
.min0 {
  min-width: 0;
}
.truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spacer {
  flex: 1;
}

/* ---------- Fondo aurora ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(120vmax 80vmax at 85% -10%, var(--bg-2), transparent 60%), var(--bg);
}
.blob {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  opacity: var(--blob-opacity);
  mix-blend-mode: var(--blend);
  will-change: transform;
  animation: drift 34s var(--ease) infinite alternate;
}
.b1 { background: radial-gradient(closest-side, #b7a2ff, transparent); top: -24vmax; left: -16vmax; }
.b2 { background: radial-gradient(closest-side, #f1a7cf, transparent); top: -12vmax; right: -24vmax; animation-duration: 41s; animation-delay: -8s; }
.b3 { background: radial-gradient(closest-side, #86c9fb, transparent); bottom: -32vmax; left: 6vmax; animation-duration: 47s; animation-delay: -16s; }
.b4 { background: radial-gradient(closest-side, #ffbe92, transparent); bottom: -26vmax; right: -12vmax; width: 48vmax; height: 48vmax; animation-duration: 38s; animation-delay: -4s; }
.b5 { background: radial-gradient(closest-side, #ffe08a, transparent); top: 34%; left: 42%; width: 28vmax; height: 28vmax; opacity: calc(var(--blob-opacity) * 0.45); animation-duration: 53s; animation-delay: -20s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50% { transform: translate3d(5vmax, 3vmax, 0) scale(1.08) rotate(8deg); }
  100% { transform: translate3d(-4vmax, 6vmax, 0) scale(0.95) rotate(-6deg); }
}
.grain {
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Superficies de cristal ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: linear-gradient(150deg, var(--glass-hi), var(--glass-lo));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--spec);
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(140% 70% at 0% 0%, var(--sheen), transparent 52%),
    radial-gradient(90% 50% at 100% 100%, rgba(255, 199, 156, 0.08), transparent 60%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}

/* ---------- Orbe (marca) ---------- */
.orb {
  display: inline-block;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff4e6 0, #f6b3d6 30%, #a98bff 64%, #7cc8fb 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 10px 30px -6px rgba(169, 139, 255, 0.65), 0 0 60px -10px rgba(246, 179, 214, 0.7);
  animation: float 6s ease-in-out infinite;
}
.orb-sm {
  width: 26px;
  height: 26px;
  animation: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 6px 18px -6px rgba(169, 139, 255, 0.8);
}
.orb-lg {
  width: 64px;
  height: 64px;
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { transform: scale(0.92); opacity: 0.75; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

/* ---------- Botones ---------- */
.btn,
.icon-btn,
.chip {
  --mx: 50%;
  --my: 50%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn::after,
.icon-btn::after,
.chip::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(90px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.42), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.btn:hover::after,
.icon-btn:hover::after,
.chip:hover::after {
  opacity: 1;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: var(--fill-2);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--spec);
  transition: transform 0.25s var(--ease), background-color 0.25s, box-shadow 0.3s var(--ease), opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn-primary {
  color: #1b1238;
  background: var(--grad);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 26px -12px rgba(185, 163, 255, 0.9);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 14px 32px -12px rgba(243, 169, 210, 0.95); }
.btn-ghost { background: var(--fill); }
.btn.is-on { background: var(--fill-hover); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn-lg { height: 54px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; gap: 6px; }
.btn.sm .ico { width: 16px; height: 16px; }
.btn.is-loading { pointer-events: none; opacity: 0.75; }
.btn.is-copied,
.chip.is-copied {
  color: #0d2b22;
  background: linear-gradient(135deg, #a7f3d0, #bfe3ff);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: var(--pill);
  color: var(--text-2);
  background: var(--fill);
  border: 1px solid var(--hairline);
  transition: transform 0.25s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s, width 0.3s var(--ease);
}
.icon-btn:hover {
  color: var(--text);
  background: var(--fill-hover);
  border-color: var(--glass-border);
  transform: translateY(-1px);
}
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.is-on {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  border-color: color-mix(in srgb, var(--warn) 42%, transparent);
}
.icon-btn.confirm {
  display: inline-flex;
  gap: 6px;
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.spinning .ico { animation: spin 0.9s linear infinite; }

/* ---------- Carga inicial ---------- */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

/* ---------- Pantalla de PIN ---------- */
.lock {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}
.lock-theme {
  position: absolute;
  top: 20px;
  right: 20px;
}
.lock-card {
  width: min(420px, 100%);
  padding: 40px 32px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  animation: rise 0.8s var(--ease) both;
}
.lock-card .orb { margin-bottom: 6px; }
.eyebrow {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.lock-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.lock-title em,
.empty-title em {
  font-size: 1.16em;
  padding-right: 0.06em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lock-sub {
  margin: 0 0 8px;
  max-width: 32ch;
  font-size: 14px;
  color: var(--text-2);
}
.pin-field {
  width: 100%;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 22px;
  border-radius: var(--pill);
  color: var(--text-3);
  background: var(--fill);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pin-field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 4px var(--ring), inset 0 2px 8px rgba(0, 0, 0, 0.12);
}
.pin-field input {
  flex: 1;
  min-width: 0;
  padding-left: 0.45em;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.45em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.pin-field input::placeholder { color: var(--text-3); letter-spacing: 0.3em; }
.pin-field.shake { animation: shake 0.45s var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.form-error {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
}

/* ---------- Estructura de la app ---------- */
.app {
  height: 100dvh;
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fade 0.5s var(--ease) both;
}
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--pill);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-accent {
  margin-left: -4px;
  font-size: 20px;
  color: var(--text-2);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--pill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--fill);
  border: 1px solid var(--hairline);
}
.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
.status[data-state='live'] .status-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status[data-state='live'] .status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  animation: ping 2.4s var(--ease) infinite;
}
.status[data-state='syncing'] .status-dot { background: var(--accent); animation: breathe 1s ease-in-out infinite; }
.status[data-state='error'] { color: var(--danger); }
.status[data-state='error'] .status-dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 80%, 100% { transform: scale(1.9); opacity: 0; } }

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 14px;
}
.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.panes {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 14px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 12px;
}
.panel-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.panel-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.panel-sub em { font-size: 15.5px; color: var(--text-2); }
.count {
  padding: 1px 8px;
  border-radius: var(--pill);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--fill-2);
}
.count:empty { display: none; }

/* ---------- Barra lateral (multi-buzón) ---------- */
.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
}
.mailbox-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 2px;
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mailbox {
  display: flex;
  align-items: center;
  border-radius: var(--pill);
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}
.mailbox:hover { background: var(--fill); }
.mailbox.is-active {
  background: var(--fill-2);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 var(--spec);
}
.mailbox-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px 9px 14px;
  text-align: left;
}
.mailbox-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--text-3);
  opacity: 0.5;
}
.mailbox.is-active .mailbox-dot { background: var(--grad); opacity: 1; box-shadow: 0 0 10px rgba(243, 169, 210, 0.85); }
.mailbox-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mailbox-local,
.mailbox-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-local { font-size: 14px; font-weight: 600; }
.mailbox-domain { font-size: 12px; color: var(--text-3); }
.mailbox .icon-btn { margin-right: 5px; opacity: 0; }
.mailbox:hover .icon-btn,
.mailbox .icon-btn:focus-visible,
.mailbox .icon-btn.confirm { opacity: 1; }
@media (hover: none) { .mailbox .icon-btn { opacity: 0.7; } }
.mailbox-empty { padding: 12px 14px; font-size: 13px; color: var(--text-3); }
.sidebar-foot {
  margin: 12px 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-3);
}
.sidebar-foot .ico { width: 15px; height: 15px; margin-top: 1px; color: var(--ok); }

/* ---------- Generador ---------- */
.generator {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}
.gen-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.segmented {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: var(--pill);
  background: var(--fill);
  border: 1px solid var(--hairline);
}
.segmented button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--pill);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  transition: color 0.25s;
}
.segmented button[aria-selected='true'] { color: var(--text); }
.segmented .ico { width: 16px; height: 16px; }
.seg-glider {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--w, 0px);
  transform: translateX(var(--x, 0px));
  border-radius: var(--pill);
  background: var(--fill-hover);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--spec), 0 6px 16px -8px rgba(0, 0, 0, 0.35);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease);
}
.lbl-short { display: none; }

.address-pill {
  position: relative;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 22px;
  border-radius: var(--pill);
  background: var(--fill);
  box-shadow: inset 0 1px 0 var(--spec), 0 16px 40px -26px rgba(185, 163, 255, 0.9);
}
.address-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(185, 163, 255, 0.95), rgba(243, 169, 210, 0.65), rgba(255, 199, 156, 0.85), rgba(134, 201, 251, 0.75));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.address-pill > .ico { width: 20px; height: 20px; color: var(--accent); }
.address-display {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(16px, 1.9vw, 21px);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.address-display.flash { animation: flash 0.7s var(--ease); }
@keyframes flash { from { opacity: 0; transform: translateY(5px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
.addr-domain { color: var(--text-3); font-weight: 500; }

.custom-row { display: flex; align-items: center; gap: 10px; animation: pop 0.35s var(--ease); }
.custom-field {
  flex: 1;
  min-width: 0;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-radius: var(--pill);
  background: var(--fill);
  border: 1px solid var(--glass-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.custom-field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 4px var(--ring);
}
.custom-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: right;
  font-size: 16px;
  font-weight: 600;
}
.custom-field input::placeholder { color: var(--text-3); font-weight: 500; }
.custom-field .addr-domain { font-size: 16px; white-space: nowrap; }

.gen-foot {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.gen-hint { margin: 0; padding-left: 8px; font-size: 13px; color: var(--text-3); }
.gen-hint.is-error { color: var(--danger); font-weight: 500; }
.gen-hint.is-ok { color: var(--ok); font-weight: 500; }
.password-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 3px 0 15px;
  border-radius: var(--pill);
  background: var(--fill-2);
  border: 1px solid var(--glass-border);
  animation: pop 0.4s var(--ease);
}
.password-chip code { font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em; user-select: all; }

/* ---------- Bandeja de entrada ---------- */
.inbox,
.viewer {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.inbox { padding: 18px 10px 10px; }
.inbox .panel-head { padding: 0 8px 12px; }
.email-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px 4px;
}
.mail-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: var(--fill);
  border: 1px solid var(--hairline);
  cursor: pointer;
  outline: none;
  transition: background-color 0.2s, border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.3s;
}
.mail-card:hover { background: var(--fill-2); transform: translateY(-1px); }
.mail-card:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.mail-card.is-selected {
  background: var(--fill-hover);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 var(--spec), 0 10px 24px -16px rgba(0, 0, 0, 0.5);
}
.mail-card.is-selected::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad);
}
.mail-card.is-new { animation: arrive 1.3s var(--ease) both; }
@keyframes arrive {
  0% { opacity: 0; transform: translateY(-10px) scale(0.97); box-shadow: 0 0 0 0 rgba(243, 169, 210, 0); }
  35% { opacity: 1; box-shadow: 0 0 0 6px rgba(243, 169, 210, 0.22), 0 0 44px rgba(185, 163, 255, 0.4); }
  100% { opacity: 1; transform: none; box-shadow: 0 0 0 0 rgba(243, 169, 210, 0); }
}
.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1b1238;
  background: linear-gradient(135deg, hsl(var(--h, 260) 90% 83%), hsl(calc(var(--h, 260) + 45) 90% 74%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 14px -8px rgba(0, 0, 0, 0.45);
}
.mail-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mail-top { display: flex; align-items: center; gap: 6px; }
.mail-from {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.pin-flag { display: inline-flex; color: var(--warn); }
.pin-flag .ico { width: 14px; height: 14px; }
.mail-time { font-size: 12px; white-space: nowrap; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mail-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 700; }
.mail-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-3);
}

.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--pill);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--fill-2);
  border: 1px solid var(--glass-border);
  transition: transform 0.2s var(--ease), background-color 0.2s;
}
.chip:hover { transform: translateY(-1px); }
.chip .ico { width: 15px; height: 15px; }
.chip-otp { background: linear-gradient(135deg, rgba(185, 163, 255, 0.3), rgba(243, 169, 210, 0.22)); }
.chip-otp code { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; }
.chip-link { background: linear-gradient(135deg, rgba(134, 201, 251, 0.28), rgba(126, 231, 193, 0.18)); }
.chip-label { font-weight: 500; color: var(--text-2); }
.chip.is-copied .chip-label { color: inherit; }
.quick-lg { margin-top: 0; }
.quick-lg .chip { height: 42px; padding: 0 17px; font-size: 13.5px; }
.quick-lg .chip-otp code { font-size: 17px; }

/* ---------- Estados vacíos ---------- */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 22px;
  text-align: center;
}
.empty-orb {
  width: 74px;
  height: 74px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.04) 62%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--spec), 0 18px 40px -18px rgba(185, 163, 255, 0.85);
  animation: float 6s ease-in-out infinite;
}
.empty-orb .ico { width: 28px; height: 28px; }
.empty-title { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.empty-sub { margin: 0 0 10px; max-width: 34ch; font-size: 13.5px; color: var(--text-3); }
.listening { display: inline-flex; gap: 5px; margin: 2px 0 12px; }
.listening i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.35; animation: breathe 1.4s ease-in-out infinite; }
.listening i:nth-child(2) { animation-delay: 0.2s; }
.listening i:nth-child(3) { animation-delay: 0.4s; }

/* ---------- Lector ---------- */
.viewer { overflow: hidden; }
.reader {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
  animation: fade 0.35s var(--ease);
}
.reader > :not(.reader-content) { flex: none; }
.reader-head { display: flex; align-items: flex-start; gap: 12px; }
.reader-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.reader-subject {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.reader-from { display: flex; align-items: center; gap: 10px; }
.reader-from strong { font-size: 14px; }
.reader-from span { font-size: 12.5px; color: var(--text-3); }
.reader-date { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.reader-date .sep { opacity: 0.6; }
.reader-actions { display: flex; gap: 8px; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--pill);
  background: var(--fill);
  border: 1px solid var(--hairline);
}
.tabs button {
  height: 32px;
  padding: 0 15px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: background-color 0.2s, color 0.2s;
}
.tabs button[aria-selected='true'] {
  color: var(--text);
  background: var(--fill-hover);
  box-shadow: inset 0 1px 0 var(--spec), 0 4px 12px -6px rgba(0, 0, 0, 0.35);
}
.tabs button:disabled { opacity: 0.4; cursor: not-allowed; }
.badge { padding: 0 7px; border-radius: var(--pill); font-size: 11px; background: var(--fill-hover); }
.img-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 16px;
  border-radius: var(--pill);
  font-size: 12.5px;
  color: var(--text-2);
  background: linear-gradient(135deg, rgba(255, 210, 122, 0.16), rgba(243, 169, 210, 0.12));
  border: 1px solid var(--glass-border);
  animation: pop 0.35s var(--ease);
}
.img-banner > .ico { width: 16px; height: 16px; color: var(--warn); }
.img-banner span { flex: 1; }
.links-panel {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 20px;
  background: var(--fill);
  border: 1px solid var(--hairline);
  animation: pop 0.3s var(--ease);
}
.link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s;
}
.link-item:hover { background: var(--fill-hover); }
.link-item .ico { width: 15px; height: 15px; color: var(--text-3); }
.link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-label,
.link-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-label { font-weight: 600; }
.link-host { font-size: 12px; color: var(--text-3); }
.reader-content {
  position: relative;
  flex: 1;
  min-height: 240px;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--spec), 0 18px 40px -26px rgba(0, 0, 0, 0.6);
}
.reader-content.is-text { background: var(--fill); }
.reader-content iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.reader-text {
  height: 100%;
  margin: 0;
  padding: 20px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13.5px/1.65 var(--mono);
  color: var(--text);
}
.reader-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--glass-solid);
}
.reader-loading .ico { width: 28px; height: 28px; animation: spin 0.9s linear infinite; }

/* ---------- Avisos ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 100;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: min(92vw, 480px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: var(--pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--glass-solid);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--spec);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast .ico { width: 17px; height: 17px; color: var(--ok); }
.toast.error .ico { color: var(--danger); }
.toast.mail .ico { color: var(--accent); }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noscript { position: fixed; inset: auto 0 40% 0; text-align: center; }

/* ---------- Responsive ---------- */
.scrim { display: none; }
.only-drawer,
.only-sheet { display: none !important; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 244px minmax(0, 1fr); }
  .panes { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .gen-top > .btn span { display: none; }
  .gen-top > .btn { width: 42px; padding: 0; }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .only-drawer { display: inline-grid !important; }
  .sidebar {
    position: fixed;
    z-index: 60;
    top: 12px;
    bottom: 12px;
    left: 12px;
    width: min(310px, 86vw);
    background: var(--glass-solid);
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.45s var(--ease);
  }
  body.drawer-open .sidebar { transform: none; }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(8, 6, 24, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .app { padding: 10px; gap: 10px; }
  .topbar { padding-left: 8px; }
  .brand-accent,
  .status-text { display: none; }
  .status { padding: 0 13px; }
  .panes { grid-template-columns: minmax(0, 1fr); }
  .generator { padding: 12px; gap: 12px; }
  .segmented { flex: 1; min-width: 0; }
  .segmented button { flex: 1 1 auto; padding: 0 8px; font-size: 12.5px; }
  .segmented .ico,
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
  .address-pill { min-height: 58px; padding-left: 18px; }
  .address-pill > .ico { display: none; }
  #copy-address-btn { width: 46px; padding: 0; }
  #copy-address-btn span { display: none; }
  .custom-field { padding: 0 16px; }
  .custom-row .btn span { display: none; }
  .custom-row .btn { width: 50px; height: 50px; padding: 0; }
  .viewer {
    position: fixed;
    inset: 0;
    z-index: 70;
    border-radius: 0;
    background: var(--glass-solid);
    transform: translateY(102%);
    transition: transform 0.5s var(--ease);
  }
  body.reading .viewer { transform: none; }
  .viewer .empty { display: none; }
  .only-sheet { display: inline-grid !important; }
  .reader { padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
  .reader-subject { font-size: 18px; }
  .lock-title { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
