/* Temp Mail demo — styles */
:root {
  --bg: #0a0d0c;
  --panel: #0f1413;
  --panel-2: #131a17;
  --line: #1f2a26;
  --line-2: #2a3733;
  --text: #e9efec;
  --muted: #8a9a93;
  --faint: #5d6b64;
  --accent: #7ff0c4;
  --accent-ink: #06231a;
  --accent-soft: rgba(127, 240, 196, .10);
  --danger: #ff9c9c;
  --warn: #ffcf80;
  --r: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Arabic",
    "Noto Sans Devanagari", "Noto Sans Bengali", "PingFang SC", "Hiragino Sans", "Microsoft YaHei",
    Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -12%, rgba(127, 240, 196, .10), transparent 62%),
    radial-gradient(760px 420px at -10% 0%, rgba(96, 140, 255, .07), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px) 0 0 / 44px 100%;
}
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 20px 64px; }

/* ---------- top ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(160deg, #173a2f, #0e1a16); border: 1px solid var(--line-2); color: var(--accent);
}
.brand em {
  font-style: normal; font-size: 11px; color: var(--accent); border: 1px solid rgba(127, 240, 196, .25);
  background: var(--accent-soft); padding: 2px 7px; border-radius: 99px; letter-spacing: .04em;
}
.top-right { display: flex; align-items: center; gap: 10px; }
.lang {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2);
  border-radius: 999px; background: var(--panel-2); color: var(--muted); cursor: pointer;
}
.lang select {
  appearance: none; background: transparent; border: 0; color: var(--text); font-size: 12.5px;
  max-width: 130px; cursor: pointer; outline: none; padding: 0;
}
.lang select option { background: #121917; color: var(--text); }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.pulse {
  width: 7px; height: 7px; border-radius: 99px; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(127, 240, 196, .5); animation: pulse 2.4s infinite;
}
.pulse.bad { background: var(--warn); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(127, 240, 196, .45); }
  70% { box-shadow: 0 0 0 8px rgba(127, 240, 196, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 240, 196, 0); }
}
.chip.install { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); border-color: rgba(127,240,196,.35); }

/* ---------- hero ---------- */
.hero {
  border: 1px solid var(--line); border-radius: 22px; padding: 22px 22px 18px; margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0) 60%), var(--panel);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 60px -40px rgba(0, 0, 0, .9);
}
.eyebrow { margin: 0 0 10px; font-size: 12px; color: var(--faint); letter-spacing: .04em; }
.address-row { display: flex; align-items: center; justify-content: center; gap: 10px; direction: ltr; flex-wrap: wrap; }
.address {
  min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; text-align: left;
  font-size: clamp(17px, 3.2vw, 26px); font-weight: 600; letter-spacing: -.02em; padding: 10px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f2fffa;
}
.address .at { color: var(--faint); font-weight: 400; }
.copy {
  padding: 0 16px; height: 42px; border-radius: 12px; border: 1px solid rgba(127, 240, 196, .3);
  background: var(--accent); color: var(--accent-ink); font-weight: 650; font-size: 14px; cursor: pointer;
  transition: .16s; display: flex; gap: 8px; align-items: center; flex: none;
}
.copy:hover { filter: brightness(1.06); }
.copy:active { transform: translateY(1px); }
.icon-btn {
  width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: .16s;
}
.icon-btn:hover { background: #182120; border-color: #38473f; color: var(--accent); }
.icon-btn:active { transform: translateY(1px); }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.btn {
  font-size: 13px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); cursor: pointer; transition: .16s;
}
.btn:hover { color: var(--text); border-color: #3a4a43; background: rgba(255, 255, 255, .03); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn.solid:hover { filter: brightness(1.06); color: var(--accent-ink); }
.btn:disabled { opacity: .6; cursor: default; }
.ttl { margin-inline-start: auto; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ttl b { color: var(--muted); font-weight: 600; }
body.expired .ttl b { color: var(--danger); }
.expired-bar {
  display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(255, 156, 156, .3); background: rgba(255, 156, 156, .07);
}
.expired-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.expired-text strong { color: var(--danger); font-weight: 600; }

/* ---------- workspace ---------- */
.workspace { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.workspace > * { min-width: 0; }
.panel {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
}
.panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.badge {
  font-size: 11px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(127, 240, 196, .2);
  padding: 1px 8px; border-radius: 99px; font-variant-numeric: tabular-nums;
}

/* inbox */
.list { list-style: none; margin: 0; padding: 6px; max-height: min(62vh, 620px); overflow: auto; flex: 1; }
.item {
  display: block; width: 100%; text-align: start; border: 0; background: transparent; color: inherit;
  padding: 11px 12px; border-radius: 11px; cursor: pointer; transition: background .14s;
  border-inline-start: 2px solid transparent;
}
.item:hover { background: rgba(255, 255, 255, .035); }
.item.sel { background: var(--accent-soft); border-inline-start-color: var(--accent); }
.item .r1 { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.item .from { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .when { font-size: 11px; color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.item .subj { font-size: 14px; color: var(--text); margin: 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.item .prev { font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subj bdi, .prev bdi, .mail-head h2 bdi { white-space: nowrap; }
.empty { padding: 34px 18px; text-align: center; color: var(--faint); font-size: 13px; display: none; }
.empty.show { display: block; }
.empty svg { opacity: .5; margin-bottom: 8px; }
.empty .sub { font-size: 12.5px; color: #6b7873; margin-top: 2px; }

/* viewer */
.viewer { min-height: 560px; }
.v-empty { margin: auto; padding: 48px 24px; text-align: center; color: var(--faint); max-width: 420px; }
.v-empty .ring {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--accent);
}
.v-empty p { margin: 4px 0; font-size: 13.5px; }
.v-empty .sub { font-size: 12.5px; color: #6b7873; }
.v-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.mail-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mail-head .mail-info { min-width: 0; flex: 1; }
.mail-head .back { display: none; }
.mail-head h2 { margin: 0 0 4px; font-size: 16.5px; line-height: 1.35; font-weight: 650; word-break: break-word; overflow-wrap: anywhere; }
.mail-meta { font-size: 12px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-start; }
.mail-meta .from { color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.mail-actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }
.chip {
  font-size: 12px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); cursor: pointer; transition: .14s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: #3a4a43; }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.chip.danger:hover { color: var(--danger); border-color: rgba(255, 156, 156, .4); }
.tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.tabs button { font-size: 12px; padding: 4px 10px; border-radius: 7px; border: 0; background: transparent; color: var(--faint); cursor: pointer; }
.tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .06); color: var(--text); }
.tabs button:disabled { opacity: .35; cursor: default; }
.attachments {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .12);
}
.attach {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; direction: ltr;
  padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--panel-2); color: var(--text); text-decoration: none; font-size: 12.5px;
}
.attach:hover { border-color: #3a4a43; }
.attach .attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.attach .attach-size { color: var(--faint); font-size: 11px; }
.mail-content {
  flex: 1; min-height: 380px; background: var(--panel); position: relative; overflow: auto;
  display: flex; flex-direction: column;
}
.mail-content.dark { background: #0b0f0e; }
.mail-content.light { background: #fff; }
.mail-content iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; background: #fff; flex: 1; }
.mail-content pre {
  margin: 0; padding: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word; direction: ltr; text-align: left; color: #c9d6d0;
}
.mail-content .loading { margin: auto; padding: 24px; color: var(--faint); font-size: 13px; }

/* ---------- dialogs ---------- */
.dlg {
  border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); color: var(--text);
  padding: 22px; width: min(440px, calc(100vw - 32px)); margin: auto;
  box-shadow: 0 40px 80px -30px #000;
}
.dlg::backdrop { background: rgba(4, 8, 7, .72); backdrop-filter: blur(3px); }
.dlg h3 { margin: 0 0 16px; font-size: 17px; font-weight: 650; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--faint); margin-bottom: 6px; }
.field input[type="text"], .field select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-size: 14px;
}
.field input[type="text"]::placeholder { color: #4f5c56; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills label { position: relative; flex: 1; min-width: 92px; }
.pills input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.pills span {
  display: block; text-align: center; padding: 9px 8px; border: 1px solid var(--line-2);
  border-radius: 10px; font-size: 12.5px; color: var(--muted); transition: .15s;
}
.pills input:checked + span { background: var(--accent-soft); border-color: rgba(127, 240, 196, .45); color: var(--accent); }
.pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dlg-error { margin: 0 0 12px; font-size: 12.5px; color: var(--danger); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.qr-dlg { text-align: center; }
.qr-dlg h3 { text-align: center; }
.qr-frame { display: inline-block; padding: 12px; border-radius: 14px; background: #fff; margin: 4px auto 10px; }
.qr-frame img { display: block; width: 200px; height: 200px; }
.qr-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--faint); }
#qrLink {
  display: block; font-size: 11.5px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; inset-inline: 0; bottom: 24px; margin: auto; width: max-content; max-width: 90vw;
  background: #16211d; border: 1px solid #2c3d36; color: var(--text); padding: 9px 16px; border-radius: 10px;
  font-size: 13px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; z-index: 50;
  box-shadow: 0 12px 30px -12px #000;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .viewer { display: none; min-height: 0; }
  body.reading .viewer { display: flex; }
  body.reading .inbox { display: none; }
  .mail-head .back {
    display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px;
    border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer;
  }
  .list { max-height: 58vh; }
  .hero { padding: 18px 16px 14px; }
  .address { font-size: 16px; }
}
@media (max-width: 620px) {
  .mail-actions { order: 3; width: 100%; margin-inline-start: 0; }
  .mail-head { padding: 12px; gap: 10px; }
  .mail-head h2 { font-size: 15px; }
  .mail-meta { font-size: 11px; gap: 4px 8px; }
  .mail-meta .sep { display: none; }
  .v-empty { padding: 40px 16px; }
  .wrap { padding: 18px 14px 48px; }
  .status #statusText { display: none; }
  .lang select { max-width: 92px; }
  .brand em { display: none; }
  .chip.install { width: 38px; padding: 0; justify-content: center; }
  .chip.install span { display: none; }
  .address { font-size: 14px; max-width: 100%; }
  .copy { padding: 0; width: 42px; justify-content: center; }
  .copy .lbl { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .address-row { gap: 8px; }
  .hero-foot .ttl { margin-inline-start: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
