@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0d10;
  --sidebar: #101318;
  --surface: #151920;
  --surface-2: #1a1f27;
  --border: #252b34;
  --border-strong: #333b47;
  --text: #f1f3f5;
  --text-dim: #929aa6;
  --text-faint: #6d7583;
  --accent: #7c8cf8;
  --accent-hover: #93a1fa;
  --accent-soft: rgba(124, 140, 248, 0.12);
  --danger: #f0736a;
  --danger-soft: rgba(240, 115, 106, 0.1);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 21px;
  --tap: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.mono,
.addr,
.box-addr {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--text-faint);
}

/* ---------- brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.brand-sm {
  font-size: var(--fs-sm);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--accent);
  color: #0a0c10;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-subtle {
  background: var(--surface-2);
  border-color: var(--border);
}

.btn-subtle:hover {
  border-color: var(--border-strong);
}

.btn-ghost {
  color: var(--text-dim);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(240, 115, 106, 0.32);
  color: #f7a9a3;
}

.btn-danger:hover {
  background: rgba(240, 115, 106, 0.16);
  border-color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 32px;
  padding: 0 10px;
  font-size: var(--fs-sm);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.icon-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- auth ---------- */

.auth {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.auth-head {
  padding: 20px 20px 0;
}

.auth-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.auth-panel {
  width: 100%;
  max-width: 384px;
  padding: 26px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.auth-panel h1 {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.lede {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-dim);
}

.field input {
  height: 42px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-md);
  transition: border-color 0.15s ease;
}

.field input:hover {
  border-color: var(--border-strong);
}

.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint {
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

.captcha {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 108px;
}

.captcha .h-captcha {
  width: 100%;
}

.captcha .h-captcha iframe {
  display: block;
  transform-origin: 0 0;
}

.alert {
  margin-top: 18px;
  padding: 10px 12px;
  background: var(--danger-soft);
  border: 1px solid rgba(240, 115, 106, 0.28);
  border-radius: var(--radius);
  color: #f7a9a3;
  font-size: var(--fs-sm);
}

.auth-switch {
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.auth-switch a {
  display: inline-block;
  padding: 12px 0;
}

.auth-note {
  color: var(--text-faint);
  font-size: var(--fs-xs);
  text-align: center;
}

.auth-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.auth-back:hover {
  color: var(--text);
  text-decoration: none;
}

.acct-list {
  display: flex;
  flex-direction: column;
  margin: 18px 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.acct-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}

.acct-row dt {
  color: var(--text-dim);
}

.acct-row dd {
  margin: 0;
  text-align: right;
}

.acct-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.acct-actions .auth-note {
  margin-top: 8px;
}

.twofa {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.twofa h2 {
  font-size: var(--fs-md);
  font-weight: 600;
}

.twofa .hint {
  margin-top: 8px;
  line-height: 1.6;
}

.twofa-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.code-account {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}

.steps {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.steps li + li {
  margin-top: 4px;
}

.secret-box,
.recovery-code {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.secret-box {
  margin-top: 14px;
}

.secret-value,
.recovery-value {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.link-line {
  margin-top: 10px;
}

.link-line a {
  color: var(--accent-hover);
}

.qr-box {
  width: fit-content;
  max-width: 100%;
  margin-top: 14px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.qr-svg {
  display: block;
  width: 168px;
  height: 168px;
  max-width: 100%;
}

.qr-hint {
  margin-top: 10px;
}

.qr-hint a {
  color: var(--accent-hover);
}

.recovery-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  flex: none;
  padding: 3px 8px;
  border: 1px solid rgba(124, 140, 248, 0.32);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.life {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.life-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.life-opt {
  position: relative;
  display: block;
  cursor: pointer;
}

.life-opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.life-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.life-opt:hover span {
  border-color: var(--border-strong);
}

.life-opt input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 500;
}

.life-opt input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.life-opt.is-wide {
  grid-column: 1 / -1;
}

.life .hint {
  margin-top: 2px;
}

.creds {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.cred {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cred-label {
  grid-column: 1 / -1;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

.cred-value {
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.cred-note {
  margin-top: 14px;
}

.cred-open {
  margin-top: 8px;
}

.cred-open + .auth-note {
  margin-top: 14px;
}

.err-code {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 44px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
}

.err-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.err-actions .btn {
  flex: 1 1 auto;
}

.err-actions + .auth-note {
  margin-top: 16px;
}

/* ---------- app shell ---------- */

.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100dvh;
  padding: 14px 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}

.sidebar-head {
  padding: 4px 8px 2px;
}

.side-addr {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.side-addr-label {
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

.side-addr-value {
  font-size: var(--fs-sm);
  font-weight: 500;
}

.side-addr .btn {
  width: 100%;
  margin-top: 4px;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding: 6px 8px 4px;
}

.side-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

.sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.side-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.side-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.quota {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.quota-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.quota-bar {
  height: 4px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 999px;
}

.quota-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.account-name {
  overflow: hidden;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.addr-block {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.addr {
  overflow: hidden;
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 56px 24px;
  text-align: center;
}

.empty-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
  color: var(--text-faint);
}

.empty h2 {
  font-size: var(--fs-lg);
  font-weight: 600;
}

.empty p {
  max-width: 34ch;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* ---------- mobile ---------- */

.bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 40;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 820px) {
  .app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    min-height: 100dvh;
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 52px;
    padding: 0 max(14px, env(safe-area-inset-left)) 0 max(14px, env(safe-area-inset-right));
  }

  .empty {
    padding: 40px 22px;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(16, 19, 24, 0.94);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }

  .bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-height: var(--tap);
    padding: 7px 0;
    border: 0;
    background: none;
    color: var(--text-faint);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
  }

  .bottom-item svg {
    width: 18px;
    height: 18px;
  }

  .bottom-item.is-active {
    color: var(--accent);
  }

  .toast {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }
}

/* ---------- message list ---------- */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.topbar-title {
  margin-left: 4px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.msg-list {
  width: 100%;
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.msg-list > li + li {
  border-top: 1px solid var(--border);
}

.msg-row {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text);
  min-height: 64px;
}

.msg-row:hover {
  background: var(--surface);
  text-decoration: none;
}

.msg-row.is-unread {
  background: rgba(124, 140, 248, 0.045);
}

.msg-dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 50%;
  background: transparent;
}

.msg-row.is-unread .msg-dot {
  background: var(--accent);
}

.msg-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.msg-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.msg-from {
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-time {
  flex: none;
  color: var(--text-faint);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.msg-subject {
  overflow: hidden;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-row.is-unread .msg-subject {
  color: var(--text);
  font-weight: 600;
}

.msg-snippet {
  overflow: hidden;
  color: var(--text-faint);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- message view ---------- */

.message {
  width: 100%;
  max-width: 900px;
  padding: 22px 16px 48px;
}

.msg-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 14px;
}

.msg-sender {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.msg-meta .msg-addr {
  color: var(--text-dim);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.msg-submeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

.expiry {
  color: var(--text-dim);
}

.msg-expiry {
  margin-top: 8px;
  color: var(--accent-hover);
  font-size: var(--fs-xs);
}

.msg-frame {
  display: block;
  width: 100%;
  height: min(70vh, 720px);
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.msg-plain {
  margin: 20px 0 0;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.attachments {
  margin-top: 20px;
}

.attachments-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--fs-sm);
}

.attachment:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.attachment svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--text-faint);
}

.attachment-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-size {
  flex: none;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

/* ---------- quota fill ---------- */

.quota-fill.q0 { width: 0; }
.quota-fill.q5 { width: 5%; }
.quota-fill.q10 { width: 10%; }
.quota-fill.q15 { width: 15%; }
.quota-fill.q20 { width: 20%; }
.quota-fill.q25 { width: 25%; }
.quota-fill.q30 { width: 30%; }
.quota-fill.q35 { width: 35%; }
.quota-fill.q40 { width: 40%; }
.quota-fill.q45 { width: 45%; }
.quota-fill.q50 { width: 50%; }
.quota-fill.q55 { width: 55%; }
.quota-fill.q60 { width: 60%; }
.quota-fill.q65 { width: 65%; }
.quota-fill.q70 { width: 70%; }
.quota-fill.q75 { width: 75%; }
.quota-fill.q80 { width: 80%; }
.quota-fill.q85 { width: 85%; }
.quota-fill.q90 { width: 90%; }
.quota-fill.q95 { width: 95%; }
.quota-fill.q100 { width: 100%; }

@media (max-width: 820px) {
  .btn-sm {
    height: 40px;
    padding: 0 12px;
  }

  .msg-row {
    padding: 12px 14px;
  }

  .message {
    padding: 18px max(16px, env(safe-area-inset-left)) 40px max(16px, env(safe-area-inset-right));
  }

  .msg-title {
    font-size: 19px;
  }

  .msg-frame {
    height: 62vh;
  }
}

@media (min-width: 480px) {
  .recovery-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* ---------- paid workspace ---------- */

.page-paid {
  background: var(--bg);
}

.paid-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.paid-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(10px);
}

.paid-badge {
  padding: 2px 8px;
  border: 1px solid rgba(124, 140, 248, 0.3);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paid-nav {
  display: flex;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.paid-nav::-webkit-scrollbar {
  display: none;
}

.paid-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.paid-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.paid-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.paid-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.paid-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px max(16px, env(safe-area-inset-left)) 64px max(16px, env(safe-area-inset-right));
}

.paid-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

.paid-heading {
  margin-bottom: 20px;
}

.paid-heading h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.paid-card {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.page-paid .btn-sm {
  height: 40px;
  padding: 0 12px;
}

.page-paid .secret-label {
  margin-top: 18px;
  margin-bottom: 0;
}

.auth-card {
  max-width: 440px;
  margin: 8vh auto 0;
}

.auth-card h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.card-title {
  margin-bottom: 14px;
  font-size: var(--fs-lg);
}

.notice {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(124, 140, 248, 0.28);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: #c3cbfb;
  font-size: var(--fs-sm);
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 8px 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.choice legend {
  padding: 0 4px;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.choice-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.field select {
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-md);
}

.field select:hover {
  border-color: var(--border-strong);
}

.field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.inline {
  display: inline;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-hover);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.link-btn.danger {
  color: #f7a9a3;
}

.form.compact {
  gap: 8px;
  min-width: 200px;
  margin-top: 6px;
}

.form.compact .field input {
  height: 40px;
}

.table-wrap {
  width: 100%;
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.paid-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.paid-table th,
.paid-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.paid-table th {
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.paid-table tr:last-child td {
  border-bottom: 0;
}

.paid-table .wrap {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.row-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--accent-hover);
  cursor: pointer;
  font-size: var(--fs-sm);
}

.paid-details {
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.paid-details > summary {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-weight: 600;
  cursor: pointer;
}

.paid-details .form {
  margin-top: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.stat-n {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-l {
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

.paid-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.paid-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

.paid-tile:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}

.paid-tile strong {
  font-size: var(--fs-md);
}

.paid-tile span {
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-list dt {
  color: var(--text-faint);
  font-size: var(--fs-sm);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: var(--fs-sm);
}

.compose-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.compose-form {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.field textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-md);
  line-height: 1.6;
}

.field textarea:hover {
  border-color: var(--border-strong);
}

.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mail-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.mail-side {
  position: sticky;
  top: 84px;
}

.side-title {
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.folder-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.folder-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.folder-link svg {
  width: 16px;
  height: 16px;
}

.folder-link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.folder-link.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.side-hint {
  margin-top: 14px;
}

.mail-main {
  min-width: 0;
}

.mail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mail-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.mail-heading h1 {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.message-list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  list-style: none;
}

.message-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}

.message-row:last-child {
  border-bottom: 0;
}

.message-row.unread .pm-subject {
  color: var(--text);
  font-weight: 600;
}

.message-link {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 2px 14px;
  padding: 12px 14px 6px;
  color: var(--text);
}

.message-link:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.pm-from,
.pm-subject,
.pm-snippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-from {
  color: var(--text);
  font-size: var(--fs-sm);
}

.pm-subject {
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.pm-snippet {
  grid-column: 2;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

.pm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 14px 10px;
  color: var(--text-faint);
  font-size: 11px;
}

.tag {
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-faint);
}

.empty-state svg {
  width: 28px;
  height: 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

.message-card {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.message-head {
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.message-head h1 {
  font-size: 21px;
  letter-spacing: -0.01em;
}

.message-meta {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
}

.message-meta div {
  display: flex;
  gap: 10px;
  font-size: var(--fs-sm);
}

.message-meta dt {
  min-width: 70px;
  color: var(--text-faint);
}

.message-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-dim);
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}

.message-actions select {
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
}

.message-frame {
  display: block;
  width: 100%;
  height: 60vh;
  border: 0;
  background: #fff;
}

.message-text {
  margin: 0;
  padding: 18px;
  overflow-wrap: anywhere;
  color: var(--text-dim);
  font: inherit;
  white-space: pre-wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .paid-head {
    gap: 10px;
    padding: 10px 14px;
  }

  .paid-user {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .paid-nav {
    order: 3;
    width: 100%;
  }

  .paid-main {
    padding: 20px 14px 48px;
  }

  .paid-grid,
  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .mail-side {
    position: static;
  }

  .folder-nav {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .folder-nav::-webkit-scrollbar {
    display: none;
  }

  .folder-link {
    white-space: nowrap;
  }

  .message-link {
    grid-template-columns: minmax(0, 1fr);
  }

  .pm-snippet {
    grid-column: 1;
  }

  .paid-table {
    min-width: 0;
  }

  .paid-table th,
  .paid-table td {
    padding: 9px 10px;
  }
}

@media (max-width: 420px) {
  .paid-head .brand span {
    display: none;
  }

  .detail-list div {
    flex-direction: column;
    gap: 2px;
  }

  .detail-list dd {
    text-align: left;
  }
}
