:root {
  --bg: #060a12;
  --bg-soft: #0a1120;
  --panel: #0d1526;
  --panel-2: #111b2f;
  --line: #1d2a44;
  --line-soft: #16213479;
  --text: #e7eefb;
  --muted: #8b9ab8;
  --accent: #4f8cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 8% -12%, #16305f55, transparent 60%),
    radial-gradient(900px 520px at 92% 4%, #0e4a5a44, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: .9rem; }

/* ------------------------------- buttons ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .58rem .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #2c3f63; background: #16223a; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #3b7bff, #2b5fd9);
  border-color: #3b7bff;
  color: #fff;
  box-shadow: 0 8px 24px -10px #3b7bffcc;
}
.btn.primary:hover { background: linear-gradient(135deg, #548dff, #3468e6); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ffd9d9; border-color: #48233a; background: #2a1526; }
.btn.danger:hover { border-color: #7a2f4d; background: #351828; }
.btn.small { padding: .34rem .6rem; font-size: .8rem; }
.btn.icon { padding: .38rem .5rem; }

/* -------------------------------- forms -------------------------------- */

.input, select.input, textarea.input {
  width: 100%;
  padding: .62rem .8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #0a1222;
  color: var(--text);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #5d6c89; }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #4f8cff26;
}
label.field { display: block; margin-bottom: .85rem; }
label.field > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; font-weight: 500; }
.hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); }
.checkbox input { accent-color: var(--accent); width: 16px; height: 16px; }

/* --------------------------------- cards -------------------------------- */

.card {
  background: linear-gradient(180deg, #101a2d, #0c1424);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 1px 0 #ffffff08 inset;
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card-title { font-size: .95rem; font-weight: 600; margin-bottom: .9rem; }

.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* --------------------------------- stats -------------------------------- */

.stat { padding: 1rem 1.1rem; }
.stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .value { font-size: 1.7rem; font-weight: 650; letter-spacing: -.03em; margin-top: .2rem; }
.stat .value.accent { color: var(--accent-2); }

/* --------------------------------- table -------------------------------- */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left;
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line);
  background: #0c1424;
  white-space: nowrap;
}
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #ffffff06; }
.table .actions { display: flex; gap: .35rem; justify-content: flex-end; }

.empty { padding: 2.4rem 1rem; text-align: center; color: var(--muted); }

/* --------------------------------- badges ------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .14rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #0c1424;
  white-space: nowrap;
}
.badge.ok { color: #9ff0cd; border-color: #1d5344; background: #0c2a22; }
.badge.warn { color: #ffdc9a; border-color: #5a4318; background: #2a210d; }
.badge.danger { color: #ffbdbd; border-color: #5a2431; background: #2a1017; }
.badge.accent { color: #bcd4ff; border-color: #2a4680; background: #0f1e3a; }

/* --------------------------------- alerts ------------------------------- */

.alert {
  padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #0c1424;
  font-size: .87rem;
  margin-bottom: 1rem;
}
.alert.error { border-color: #5a2431; background: #2a1017; color: #ffc9c9; }
.alert.ok { border-color: #1d5344; background: #0c2a22; color: #b6f2da; }
.alert.warn { border-color: #5a4318; background: #2a210d; color: #ffe2ad; }

/* --------------------------------- layout ------------------------------- */

.topbar-public {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: #060a12c9;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f8cff, #22d3ee);
  color: #04101f;
  font-size: .95rem;
  font-weight: 800;
  box-shadow: 0 6px 18px -8px #4f8cff;
}
.brand .logo svg { width: 17px; height: 17px; }
.brand small { color: var(--muted); font-weight: 500; }

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 1.6rem 1.4rem;
  color: var(--muted);
  font-size: .84rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --------------------------------- landing ------------------------------ */

.hero { max-width: 1080px; margin: 0 auto; padding: 4.5rem 1.4rem 3rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.035em; margin-bottom: 1rem; }
.hero h1 .grad {
  background: linear-gradient(100deg, #7aa8ff, #39e0f0 60%, #8fe6c4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead { max-width: 620px; color: var(--muted); font-size: 1.05rem; }
.hero .cta { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.6rem; }
.section { max-width: 1080px; margin: 0 auto; padding: 2.4rem 1.4rem 3.4rem; }
.section > h2 { font-size: 1.35rem; margin-bottom: 1.4rem; }

.feature { padding: 1.2rem; }
.feature .ico {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: #12233f; border: 1px solid #22406e;
  margin-bottom: .85rem; font-size: 1.05rem;
}
.feature h3 { margin-bottom: .35rem; }
.feature p { color: var(--muted); font-size: .89rem; margin: 0; }

.code-card {
  background: #080f1c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-card .head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: .78rem; color: var(--muted);
  background: #0b1423;
}
pre {
  margin: 0;
  padding: .95rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.6;
  color: #cfe1ff;
  tab-size: 2;
}
pre .c { color: #5f7594; }
pre .s { color: #8fe6c4; }
pre .k { color: #7aa8ff; }

/* --------------------------------- login -------------------------------- */

.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.2rem;
}
.auth-card {
  width: 100%;
  max-width: 410px;
  background: linear-gradient(180deg, #101a2dee, #0b1322ee);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.9rem 1.7rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.auth-card .brand { margin-bottom: 1.2rem; }
.auth-card h2 { font-size: 1.28rem; margin-bottom: .3rem; }
.auth-card .sub { color: var(--muted); font-size: .88rem; margin-bottom: 1.4rem; }
.auth-foot { margin-top: 1.3rem; text-align: center; color: var(--muted); font-size: .82rem; }
.otp-input {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: .5em;
  text-align: center;
  padding-left: 1.1rem;
}

/* ------------------------------- dashboard ------------------------------ */

.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100dvh; }
.sidebar {
  background: #08101d;
  border-right: 1px solid var(--line);
  padding: 1.1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.sidebar .brand { padding: .2rem .35rem .6rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem;
  border-radius: 9px;
  color: var(--muted);
  font-size: .89rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: #ffffff08; color: var(--text); }
.nav-item.active { background: #14223c; color: #cfe0ff; border-color: #20355c; }
.nav-item .ico { width: 18px; text-align: center; opacity: .85; }
.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: .9rem; display: flex; flex-direction: column; gap: .55rem; }
.sidebar-foot .who { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line-soft);
  background: #060a12aa;
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 1.12rem; margin: 0; font-weight: 620; }
.view { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .88rem; }
.kv dt { color: var(--muted); }

/* --------------------------------- modal -------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: #030711b8;
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 1.2rem;
  animation: fadein .12s ease-out;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  overflow: auto;
  background: linear-gradient(180deg, #101a2d, #0b1322);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: pop .14s ease-out;
}
.modal.wide { max-width: 860px; }
.modal .head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.3rem .7rem;
  border-bottom: 1px solid var(--line-soft);
}
.modal .head h3 { margin: 0; font-size: 1.05rem; }
.modal .head .sub { color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.modal .body { padding: 1.1rem 1.3rem; }
.modal .foot { padding: .8rem 1.3rem 1.2rem; display: flex; justify-content: flex-end; gap: .5rem; }
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99) } to { opacity: 1; transform: none } }

/* --------------------------------- toast -------------------------------- */

#toast-root { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: #111b2f;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: .6rem .9rem;
  font-size: .86rem;
  box-shadow: 0 12px 30px -12px #000;
  max-width: 340px;
  animation: slidein .16s ease-out;
}
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slidein { from { opacity: 0; transform: translateX(12px) } to { opacity: 1; transform: none } }

/* -------------------------------- message ------------------------------- */

.msg-frame {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  min-height: 380px;
}
.msg-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .83rem; color: var(--muted); margin-bottom: .9rem; }
.tabs { display: inline-flex; gap: .2rem; padding: .2rem; background: #0a1222; border: 1px solid var(--line); border-radius: 9px; margin-bottom: .8rem; }
.tabs button {
  border: none; background: none; color: var(--muted);
  font: inherit; font-size: .82rem; padding: .3rem .7rem; border-radius: 6px; cursor: pointer;
}
.tabs button.active { background: #16243c; color: var(--text); }
pre.msg-text { background: #080f1c; border: 1px solid var(--line); border-radius: 10px; white-space: pre-wrap; word-break: break-word; }

.secret-box {
  font-family: var(--mono);
  font-size: .85rem;
  background: #080f1c;
  border: 1px dashed #2a4680;
  border-radius: 10px;
  padding: .75rem .9rem;
  word-break: break-all;
  color: #bcd4ff;
}

/* ------------------------------- responsive ----------------------------- */

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: column;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .sidebar nav { flex-direction: row; overflow-x: auto; padding-bottom: .2rem; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .view { padding: 1rem; }
  .topbar { padding: .9rem 1rem; }
}

/* ========================================================================
   Pro layer — mail-server dashboard polish
   ======================================================================== */

:root {
  --bg: #070b14;
  --bg-soft: #0a1120;
  --panel: #0c1424;
  --panel-2: #111c31;
  --line: #1b2740;
  --line-soft: #16213466;
  --text: #e9effb;
  --muted: #8494b4;
  --accent: #5b8cff;
  --accent-2: #35e0d0;
}

body {
  background:
    radial-gradient(1200px 700px at 12% -18%, #1b3a7a44, transparent 62%),
    radial-gradient(900px 600px at 96% -6%, #0d5f6b33, transparent 58%),
    var(--bg);
}

.app { grid-template-columns: 258px 1fr; }

.sidebar {
  background: linear-gradient(180deg, #0b1322f2, #080e1af2);
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}

.brand { font-weight: 700; letter-spacing: -.02em; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6ba0ff, #3f6bd8);
  color: #041020; font-weight: 800; font-size: .95rem;
  box-shadow: 0 6px 18px -8px #5b8cffcc;
}
.brand small { color: var(--muted); font-weight: 500; }

.nav-item {
  border-radius: 10px;
  padding: .55rem .7rem;
  font-size: .89rem;
  color: #a7b4cd;
}
.nav-item.active {
  background: linear-gradient(90deg, #16264a, #111d37);
  color: #dbe7ff;
  border-color: #24375c;
  box-shadow: inset 2px 0 0 var(--accent);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #080e1ad9;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.card {
  background: linear-gradient(180deg, #0e1829f2, #0b1322f2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px -40px #000;
}

/* live indicator */
.live {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: #8ef0d2;
  background: #0b2b25; border: 1px solid #1c5a4b;
  padding: .28rem .6rem; border-radius: 999px;
}
.live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #35e0a8; box-shadow: 0 0 0 0 #35e0a880;
  animation: livepulse 1.8s infinite;
}
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 #35e0a880; }
  70% { box-shadow: 0 0 0 8px #35e0a800; }
  100% { box-shadow: 0 0 0 0 #35e0a800; }
}

/* ------------------------------ mail view ------------------------------ */

.mail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #0f1a2ef2, #0b1322f2);
  margin-bottom: .9rem;
}
.mail-address { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
.mail-head-left { min-width: 0; }

.mail-layout {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: .9rem;
  height: calc(100dvh - 205px);
  min-height: 480px;
}

.mail-list { overflow-y: auto; overscroll-behavior: contain; }

.mail-item {
  display: flex; align-items: flex-start; gap: .7rem;
  width: 100%;
  padding: .7rem .9rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.mail-item:hover { background: #ffffff06; }
.mail-item.active { background: #12203a; border-left-color: var(--accent); }
.mail-item.unread .mail-subject { color: #fff; font-weight: 600; }
.mail-item.unread .mail-avatar { background: #1d3a6e; color: #bcd4ff; }

.mail-avatar {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: #16223a; color: #93a6c9;
  font-size: .8rem; font-weight: 700;
}
.mail-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .12rem; }
.mail-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.mail-from { font-size: .82rem; color: #a9b8d4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-time { font-size: .72rem; color: #66779a; white-space: nowrap; }
.mail-subject {
  font-size: .87rem; color: #d3ddf2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mail-clip { font-size: .75rem; opacity: .7; }

.list-empty {
  display: grid; place-items: center; gap: .4rem;
  padding: 3rem 1.2rem; text-align: center; color: var(--muted); font-size: .88rem;
}

.spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #1e2c48; border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* reader */
.reader { overflow-y: auto; overscroll-behavior: contain; padding: 0; }
.reader-empty {
  height: 100%; display: grid; place-items: center; align-content: center;
  gap: .35rem; padding: 2rem; text-align: center; color: var(--muted);
}
.reader-empty-icon {
  font-size: 2rem; opacity: .5; margin-bottom: .3rem;
}

.reader-head { padding: 1.1rem 1.2rem .8rem; border-bottom: 1px solid var(--line-soft); }
.reader-subject { font-size: 1.1rem; font-weight: 650; letter-spacing: -.02em; margin-bottom: .3rem; }
.reader-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.dot-sep { color: #3a4a68; }

.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 1rem 1.2rem;
  padding: .9rem 1.1rem;
  border-radius: 14px;
  border: 1px solid #23584c;
  background: linear-gradient(135deg, #0d2b26, #0b1f2c);
  box-shadow: 0 18px 40px -30px #35e0a8;
}
.code-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: #7fd8c2; }
.code-value {
  font-size: 1.85rem; font-weight: 700; letter-spacing: .22em;
  color: #b8ffe9; margin-top: .15rem;
}

.reader-tabs {
  display: inline-flex; gap: .2rem; padding: .2rem;
  margin: 0 1.2rem .8rem;
  background: #0a1222; border: 1px solid var(--line); border-radius: 10px;
}
.reader-tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: .34rem .75rem; border-radius: 8px; font: inherit; font-size: .82rem; cursor: pointer;
}
.reader-tabs button.active { background: #16243c; color: var(--text); }
.reader-tabs button:disabled { opacity: .35; cursor: default; }

.reader-panel { padding: 0 1.2rem 1.2rem; }
.msg-text {
  margin: 0; padding: 1rem; border-radius: 12px;
  background: #080f1c; border: 1px solid var(--line-soft);
  max-height: 58vh; overflow: auto;
  font-family: var(--mono); font-size: .84rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.msg-frame {
  width: 100%; height: 60vh; border: 1px solid var(--line-soft);
  border-radius: 12px; background: #fff;
}
.file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: #0b1322;
}

/* ------------------------------- auth page ----------------------------- */

.auth-body {
  display: grid; place-items: center;
  min-height: 100dvh;
  padding: 1.5rem;
  background:
    radial-gradient(900px 600px at 50% -20%, #1d3f80aa, transparent 65%),
    radial-gradient(600px 400px at 100% 100%, #0d5f6b44, transparent 60%),
    #060a12;
}
.auth-card {
  width: 100%; max-width: 400px;
  padding: 1.9rem 1.8rem 1.6rem;
  border-radius: 20px;
  border: 1px solid #1d2a44;
  background: linear-gradient(180deg, #0e1829f5, #0a1220f5);
  box-shadow: 0 40px 90px -50px #000, 0 0 0 1px #ffffff06 inset;
}
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.auth-brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6ba0ff, #3f6bd8);
  color: #041020; font-weight: 800;
  box-shadow: 0 10px 26px -12px #5b8cffcc;
}
.auth-name { font-weight: 700; font-size: .98rem; letter-spacing: -.01em; }
.auth-sub { font-size: .76rem; color: var(--muted); }
.auth-card h2 { font-size: 1.3rem; margin-bottom: .25rem; }
.auth-card .sub { color: var(--muted); font-size: .87rem; margin-bottom: 1.35rem; }
.auth-submit { width: 100%; margin-top: .35rem; padding: .7rem; font-weight: 650; }
.auth-card .auth-foot { margin-top: 1.2rem; text-align: center; }

/* ------------------------------- responsive ---------------------------- */

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; flex-direction: row; align-items: center; gap: .5rem;
    padding: .6rem .8rem; overflow-x: auto;
  }
  .sidebar nav { flex-direction: row; gap: .3rem; }
  .sidebar-foot { border: 0; padding: 0; flex-direction: row; align-items: center; }
  .mail-layout { grid-template-columns: 1fr; height: auto; }
  .mail-list { max-height: 42vh; }
  .reader { min-height: 42vh; }
}
