:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #12151a;
  --panel-2: #171b21;
  --line: #252b33;
  --muted: #8d96a4;
  --text: #f4f6f8;
  --accent: #d9ff43;
  --accent-ink: #101300;
  --blue: #8cd4ff;
  --danger: #ff6b6b;
  --shadow: 0 28px 80px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px; border-right: 1px solid var(--line); background: #0e1115; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--accent-ink); background: var(--accent); font-weight: 900; }
.sidebar nav { margin-top: 46px; display: grid; gap: 8px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--panel-2); }
.nav-item span { color: var(--accent); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 14px; }
.security-pill { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(217,255,67,.08); }
.security-pill strong, .security-pill small { display: block; font-size: 12px; }
.security-pill small { color: var(--muted); margin-top: 2px; }

.workspace { width: min(1180px, 100%); padding: 48px clamp(24px, 5vw, 72px) 80px; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
.topbar h1 { margin-bottom: 0; font-size: clamp(32px, 4vw, 50px); letter-spacing: -.05em; }
.primary, .ghost, .danger { border: 0; border-radius: 10px; padding: 12px 17px; font-weight: 750; cursor: pointer; }
.primary { color: var(--accent-ink); background: var(--accent); }
.primary:hover { filter: brightness(.94); }
.ghost { background: var(--panel-2); border: 1px solid var(--line); }
.danger { background: var(--danger); color: #220404; }
button:disabled { opacity: .55; cursor: wait; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 36px 0 22px; }
.stats-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(150deg, var(--panel-2), var(--panel)); }
.stats-grid span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.stats-grid strong { display: block; margin: 10px 0 4px; font-size: 32px; }
.stats-grid small { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 0; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; max-width: 410px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.filter-group { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.filter { border: 0; border-radius: 7px; padding: 7px 12px; color: var(--muted); background: transparent; cursor: pointer; }
.filter.active { color: var(--text); background: var(--panel-2); }

.inbox-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.inbox-row { min-height: 78px; display: grid; grid-template-columns: 1fr 110px 120px 42px 42px; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: #15191f; }
.inbox-main { min-width: 0; display: flex; align-items: center; gap: 14px; border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.mail-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: rgba(140,212,255,.1); color: var(--blue); font-weight: 800; }
.inbox-copy { min-width: 0; }
.inbox-copy strong, .inbox-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-copy small { margin-top: 5px; color: var(--muted); }
.mode { justify-self: start; padding: 5px 9px; border-radius: 999px; text-transform: capitalize; font-size: 11px; font-weight: 750; }
.mode.temporary { color: #ffca80; background: rgba(255,174,66,.12); }
.mode.permanent { color: var(--accent); background: rgba(217,255,67,.1); }
.expiry { color: var(--muted); font-size: 12px; }
.row-action, .icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; }
.row-action:hover, .icon-button:hover { color: var(--text); background: var(--panel-2); }
.row-action.delete:hover { color: var(--danger); }
.empty-list, .empty-state { padding: 60px 24px; text-align: center; color: var(--muted); }
.empty-list > div, .empty-state > span { font-size: 28px; color: var(--accent); }
.empty-list h3, .empty-state h3 { margin: 14px 0 6px; color: var(--text); }

dialog { width: min(560px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 18px; padding: 0; color: var(--text); background: var(--panel); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2,4,7,.78); backdrop-filter: blur(5px); }
.dialog-card { padding: 28px; }
.dialog-card.compact { text-align: center; }
.dialog-head, .dialog-actions, .mail-head, .mail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { margin-bottom: 0; font-size: 28px; letter-spacing: -.03em; }
.muted { color: var(--muted); line-height: 1.6; }
.dialog-card > label, .dialog-card fieldset { display: grid; gap: 8px; margin: 20px 0; color: #c7cdd5; font-size: 13px; font-weight: 700; }
.dialog-card input, .dialog-card select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 12px; color: var(--text); background: #0f1216; outline: none; }
.address-field { display: grid; grid-template-columns: minmax(100px, 1fr) auto minmax(155px, .8fr); align-items: center; gap: 9px; }
fieldset { border: 0; padding: 0; }
legend { margin-bottom: 10px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-grid label { position: relative; }
.mode-grid input { position: absolute; opacity: 0; }
.mode-grid span { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.mode-grid small { color: var(--muted); font-weight: 500; }
.mode-grid input:checked + span { border-color: var(--accent); background: rgba(217,255,67,.06); }
.dialog-actions { justify-content: flex-end; margin-top: 24px; }
.form-error { min-height: 20px; margin: 8px 0; color: var(--danger); font-size: 13px; }
.danger-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; color: var(--danger); background: rgba(255,107,107,.12); font-size: 24px; font-weight: 900; }
.address-confirm { padding: 12px; border-radius: 10px; background: #0e1115; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.mail-dialog { width: min(1100px, calc(100vw - 24px)); max-width: none; }
.mail-shell { min-height: min(720px, calc(100vh - 30px)); display: flex; flex-direction: column; }
.mail-head { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.mail-head h2 { margin: 0; font-size: 23px; }
.mail-layout { min-height: 0; flex: 1; display: grid; grid-template-columns: 360px 1fr; }
.message-list { overflow: auto; border-right: 1px solid var(--line); }
.message-row { position: relative; width: 100%; display: grid; gap: 5px; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--line); color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.message-row:hover { background: var(--panel-2); }
.message-row.unread { box-shadow: inset 3px 0 var(--accent); }
.message-row strong, .message-from { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-row time { margin-top: 5px; font-size: 11px; }
.otp-mini { position: absolute; right: 15px; top: 15px; padding: 4px 7px; border-radius: 6px; color: var(--accent-ink); background: var(--accent); font-size: 10px; font-style: normal; font-weight: 800; }
.message-view { overflow: auto; padding: clamp(24px, 4vw, 48px); }
.message-view h2 { font-size: 30px; letter-spacing: -.03em; }
.message-meta { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.message-meta strong { display: inline-block; width: 45px; color: var(--text); }
.message-body { margin-top: 28px; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.75 ui-sans-serif, system-ui, sans-serif; color: #d8dde4; }
.otp-card { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 14px 17px; border: 1px solid rgba(217,255,67,.3); border-radius: 12px; color: var(--text); background: rgba(217,255,67,.07); cursor: pointer; }
.otp-card span, .otp-card small { color: var(--muted); font-size: 10px; letter-spacing: .11em; }
.otp-card strong { font-size: 24px; letter-spacing: .13em; }
.attachments { display: grid; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.attachments span { color: var(--muted); font-size: 13px; }
.loading { padding: 40px; color: var(--muted); text-align: center; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 50; transform: translate(-50%, 20px); padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: .2s ease; font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.login-page { min-height: 100vh; background: radial-gradient(circle at 15% 25%, rgba(217,255,67,.11), transparent 28%), var(--bg); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(30px, 6vw, 84px); border-right: 1px solid var(--line); }
.login-brand h1 { margin: 0 0 22px; font-size: clamp(48px, 7vw, 92px); line-height: .94; letter-spacing: -.07em; }
.lede { max-width: 570px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.privacy-note { margin: 0; color: var(--muted); font-size: 13px; }
.login-card { align-self: center; margin: clamp(24px, 7vw, 100px); padding: clamp(26px, 4vw, 46px); border: 1px solid var(--line); border-radius: 18px; background: rgba(18,21,26,.86); box-shadow: var(--shadow); }
.login-card h2 { margin-bottom: 9px; font-size: 30px; letter-spacing: -.04em; }
.login-card form { display: grid; gap: 18px; margin-top: 32px; }
.login-card label { display: grid; gap: 8px; color: #c7cdd5; font-size: 13px; font-weight: 700; }
.login-card input { border: 1px solid var(--line); border-radius: 10px; padding: 13px; color: var(--text); background: #0d1014; }
.wide { width: 100%; display: flex; justify-content: space-between; }

[hidden] { display: none !important; }

@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { margin: 0 0 0 auto; display: flex; }
  .sidebar-bottom, .sidebar nav .nav-item:first-child { display: none; }
  .workspace { padding: 30px 18px 60px; }
  .inbox-row { grid-template-columns: 1fr 38px 38px; }
  .inbox-row .mode, .inbox-row .expiry { display: none; }
  .mail-layout { grid-template-columns: 1fr; }
  .message-list { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 52vh; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .brand span:last-child { display: none; }
  .topbar { align-items: center; }
  .topbar h1 { font-size: 32px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid article:first-child { grid-column: 1 / -1; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { max-width: none; }
  .filter-group { overflow-x: auto; }
  .address-field { grid-template-columns: 1fr; }
  .address-field > span { display: none; }
  .mode-grid { grid-template-columns: 1fr; }
  .mail-actions .ghost { display: none; }
  .login-brand h1 { font-size: 48px; }
  .login-card { margin: 22px; }
}

