:root {
  --bg: #f6f8fc;
  --fg: #202124;
  --muted: #5f6368;
  --line: #e8eaed;
  --line-strong: #dadce0;
  --accent: #1a73e8;
  --accent-hover: #1765cc;
  --danger: #d93025;
  --success: #137333;
  --card: #ffffff;
  --unread: #202124;
  --read: #5f6368;
  --hover: #f1f3f4;
  --row-unread: #ffffff;
  --row-read: #f6f8fc;
  --shadow-sm: 0 1px 2px 0 rgba(60,64,67,.10), 0 1px 3px 1px rgba(60,64,67,.05);
  --shadow-md: 0 1px 3px 0 rgba(60,64,67,.15), 0 4px 8px 3px rgba(60,64,67,.05);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f2023;
    --fg: #e8eaed;
    --muted: #9aa0a6;
    --line: #303134;
    --line-strong: #3c4043;
    --accent: #8ab4f8;
    --accent-hover: #aecbfa;
    --card: #292a2d;
    --unread: #e8eaed;
    --read: #9aa0a6;
    --hover: #35363a;
    --row-unread: #292a2d;
    --row-read: #1f2023;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15);
    --shadow-md: 0 1px 3px 0 rgba(0,0,0,.40), 0 4px 8px 3px rgba(0,0,0,.20);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Google Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.hidden { display: none !important; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; font-weight: 500; }
.login-card p { margin: 0 0 28px; color: var(--muted); }
.login-card label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.login-card input {
  display: block; width: 100%; padding: 12px 14px; margin-top: 6px;
  font-size: 15px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--card); color: var(--fg);
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.login-card button {
  width: 100%; padding: 12px; background: var(--accent); color: white;
  border: 0; border-radius: 24px; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.login-card button:hover { background: var(--accent-hover); box-shadow: var(--shadow-sm); }
.alert {
  background: #fce8e6; color: var(--danger);
  border: 1px solid #f5c6c2; padding: 10px 14px;
  border-radius: 8px; margin-bottom: 16px; font-size: 13px;
}
@media (prefers-color-scheme: dark) {
  .alert { background: #2d1716; border-color: #5c1f1d; color: #f6aea9; }
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg); font-weight: 500; font-size: 18px;
}
.topbar .brand a:hover { text-decoration: none; }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: white; font-size: 16px;
}
.topbar .meta { display: flex; align-items: center; gap: 14px; }
.badge {
  background: var(--accent); color: white; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 500;
  letter-spacing: .2px;
}
.badge.muted { background: var(--hover); color: var(--muted); }
.user-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: white;
  font-weight: 500; font-size: 14px;
  user-select: none;
}
.inline { display: inline; margin: 0; }
.link {
  background: none; border: 0; color: var(--accent);
  cursor: pointer; font-size: 13px; padding: 0;
}
.link.danger { color: var(--danger); }
.link:hover { text-decoration: underline; }
.link-tiny {
  background: none; border: 0; color: var(--muted);
  font-size: 12px; font-weight: 500; padding: 4px 6px;
  cursor: pointer; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}
.link-tiny:hover { background: var(--hover); color: var(--fg); }

/* Compose button (in topbar) */
.btn-compose {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 24px;
  padding: 8px 18px 8px 14px; font-weight: 500; font-size: 13px;
  box-shadow: var(--shadow-sm);
  cursor: pointer; transition: background .15s, box-shadow .15s;
}
.btn-compose:hover {
  background: var(--hover); text-decoration: none;
  box-shadow: var(--shadow-md);
}
.btn-compose .plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: white; font-size: 14px; line-height: 1;
}

/* List */
.list-wrap { max-width: 1100px; margin: 0 auto; padding: 12px; }
.empty {
  padding: 80px 20px; text-align: center;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line);
}
.empty code { background: var(--hover); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.email-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.email-row {
  border-bottom: 1px solid var(--line);
  background: var(--row-read);
  transition: background .1s, box-shadow .1s;
}
.email-row.unread { background: var(--row-unread); }
.email-row:last-child { border-bottom: 0; }
.email-row:hover {
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  z-index: 1; position: relative;
}
.row-link {
  display: grid;
  grid-template-columns: 220px 1fr 120px;
  gap: 16px;
  padding: 12px 20px;
  color: var(--read);
  align-items: baseline;
}
.email-row.unread .row-link { color: var(--unread); }
.email-row.unread .row-from,
.email-row.unread .row-subject strong { font-weight: 600; }
.row-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.row-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-subject strong { font-weight: 400; }
.row-preview {
  grid-column: 1 / -1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; padding-left: 236px; margin-top: -4px;
  color: var(--muted);
}
.row-date { text-align: right; white-space: nowrap; font-size: 12px; color: var(--muted); }
.email-row.unread .row-date { color: var(--fg); font-weight: 500; }
.dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%; margin-right: 8px;
  vertical-align: middle;
}
.paperclip { margin-left: 8px; font-size: 12px; color: var(--muted); }
.pager {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 4px; gap: 12px;
}

/* Email view */
.email-wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px; }
.subject { font-size: 22px; font-weight: 400; margin: 0 0 24px; line-height: 1.3; }
.headers {
  width: 100%; border-collapse: collapse; margin-bottom: 20px;
  font-size: 13px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.headers th, .headers td {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.headers tr:last-child th, .headers tr:last-child td { border-bottom: 0; }
.headers th { width: 110px; color: var(--muted); font-weight: 500; }

.attachments {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.attachments h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.attachments ul { list-style: none; margin: 0; padding: 0; }
.attachments li { padding: 4px 0; }

.body {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--line);
  background: var(--card);
}
.tab {
  background: none; border: 0; padding: 12px 18px;
  font: inherit; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent;
  font-weight: 500; font-size: 13px;
  transition: color .15s, border-color .15s;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--fg); }
.tab.active:hover { color: var(--accent); }
.tab-pane { display: none; padding: 20px; margin: 0; }
.tab-pane.active { display: block; }
pre.tab-pane {
  white-space: pre-wrap; word-break: break-word;
  font: 13px/1.6 ui-monospace, "SF Mono", Menlo, monospace;
}
#tab-html iframe {
  width: 100%; min-height: 500px; border: 0;
  background: white; border-radius: 4px;
}

/* Generic buttons */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; line-height: 1.2;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--card); color: var(--fg); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--hover); text-decoration: none; }
.btn-primary.small, .btn-secondary.small { padding: 5px 12px; font-size: 12px; }

/* ===== Compose page (Gmail-style) ===== */
.compose-page {
  display: flex; justify-content: center;
  padding: 32px 16px 80px;
}
.compose-card {
  width: 100%; max-width: 760px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.compose-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 12px 20px;
  background: #404040;
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .compose-header { background: #1f1f1f; }
}
.compose-title { font-size: 14px; font-weight: 500; letter-spacing: .2px; }
.compose-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 4px;
  color: #fff; font-size: 22px; line-height: 1;
  opacity: .85; transition: background .15s, opacity .15s;
}
.compose-close:hover {
  background: rgba(255,255,255,.12); text-decoration: none; opacity: 1;
}

.banner {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 12px 16px 0;
  padding: 12px 14px; border-radius: 8px;
  font-size: 13px; line-height: 1.4;
  border: 1px solid transparent;
}
.banner.success {
  background: #e6f4ea; border-color: #ceead6; color: var(--success);
}
.banner.error {
  background: #fce8e6; border-color: #f5c6c2; color: var(--danger);
}
.banner .banner-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: currentColor; color: #fff;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.banner .muted { color: inherit; opacity: .75; margin-left: 4px; }
@media (prefers-color-scheme: dark) {
  .banner.success { background: #102a17; border-color: #1e5631; color: #81c995; }
  .banner.error { background: #2d1716; border-color: #5c1f1d; color: #f6aea9; }
}

.compose-form {
  display: flex; flex-direction: column;
  padding: 8px 4px 12px;
}
.field-row {
  display: flex; align-items: center;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.field-row.hidden { display: none; }
.field-label {
  width: 56px; color: var(--muted); font-size: 13px;
  flex-shrink: 0;
}
.field-row input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  color: var(--fg);
  font: inherit; padding: 6px 0;
}
.field-row input::placeholder { color: var(--muted); }
.field-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}
.subject-input {
  font-size: 14px !important;
}

.body-row {
  padding: 12px 20px;
  flex: 1;
}
.body-row textarea {
  width: 100%;
  min-height: 320px;
  border: 0; outline: 0; background: transparent;
  color: var(--fg);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  resize: vertical;
  padding: 0;
}
.body-row textarea::placeholder { color: var(--muted); }

.compose-actions {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.btn-send {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 24px;
  padding: 10px 24px;
  font: inherit; font-weight: 500; font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .15s, box-shadow .15s;
}
.btn-send:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn-send:disabled { opacity: .6; cursor: progress; }
.btn-send-icon {
  font-size: 12px; transform: translateY(-1px);
}
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--muted); font-size: 16px;
  margin-left: auto;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--hover); color: var(--fg); text-decoration: none; }

/* Responsive */
@media (max-width: 720px) {
  .row-link { grid-template-columns: 140px 1fr 80px; gap: 8px; padding: 12px 14px; }
  .row-preview { padding-left: 0; grid-column: 1 / -1; }
  .topbar { padding: 8px 14px; }
  .field-label { width: 40px; }
  .compose-page { padding: 16px 8px 60px; }
}

/* tempmail — redesigned */
:root {
  --tm-surface: #fafafa;
  --tm-card: #ffffff;
  --tm-border: #e6e8eb;
  --tm-border-strong: #d0d4da;
  --tm-accent: #2563eb;
  --tm-accent-soft: #eff4ff;
  --tm-text: #1a1c20;
  --tm-text-secondary: #5c6068;
  --tm-text-tertiary: #8f939b;
  --tm-success-bg: #e9f7ef;
  --tm-success-text: #106b3e;
  --tm-error-bg: #fdecea;
  --tm-error-text: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --tm-surface: #131416;
    --tm-card: #1c1e22;
    --tm-border: #2a2c31;
    --tm-border-strong: #36383e;
    --tm-accent: #5b8dee;
    --tm-accent-soft: #1a2340;
    --tm-text: #e4e6ea;
    --tm-text-secondary: #9a9ea8;
    --tm-text-tertiary: #6b6f79;
    --tm-success-bg: #112618;
    --tm-success-text: #6cdb9a;
    --tm-error-bg: #2d1414;
    --tm-error-text: #f87171;
  }
}

.tm-page {
  min-height: 100vh;
  margin: 0;
  background: var(--tm-surface);
}

.tm-glow {
  display: none;
}

.tm-hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px;
  background: var(--tm-card);
  border: 1px solid var(--tm-border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.tm-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tm-accent);
}

.tm-hero h1 {
  margin: 6px 0 0;
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--tm-text);
}

.tm-copy {
  margin: 8px 0 0;
  max-width: 64ch;
  font-size: 14px;
  color: var(--tm-text-secondary);
  line-height: 1.55;
}

.tm-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tm-pills span {
  border-radius: 8px;
  border: 1px solid var(--tm-border);
  background: var(--tm-card);
  font-size: 11px;
  font-weight: 500;
  color: var(--tm-text-secondary);
  padding: 6px 10px;
  letter-spacing: .01em;
}

.tm-grid {
  max-width: 1120px;
  margin: 16px auto 32px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
}

.tm-panel {
  background: var(--tm-card);
  border: 1px solid var(--tm-border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  padding: 16px;
  margin: 0;
}

.tm-panel h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tm-text-secondary);
}

.tm-controls {
  display: grid;
  align-content: start;
  gap: 10px;
}

.tm-field {
  display: grid;
  gap: 5px;
}

.tm-field > span {
  color: var(--tm-text-secondary);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.tm-inline-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--tm-border);
  border-radius: 10px;
  background: var(--tm-card);
  min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}

.tm-inline-field:focus-within {
  border-color: var(--tm-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.tm-inline-field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--tm-text);
  font-size: 14px;
  padding: 10px 12px;
}

.tm-inline-field small {
  flex-shrink: 0;
  padding: 0 2px 0 0;
  color: var(--tm-text-tertiary);
  font-family: inherit;
  font-size: 14px;
}

.tm-domain-select {
  flex-shrink: 0;
  min-width: 130px;
  min-height: 32px;
  margin: 4px;
  padding: 4px 24px 4px 8px;
  border: 1px solid var(--tm-border);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--tm-text-tertiary) 50%),
    linear-gradient(135deg, var(--tm-text-tertiary) 50%, transparent 50%),
    var(--tm-card);
  background-position:
    calc(100% - 10px) calc(50% - 2px),
    calc(100% - 6px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--tm-text);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
}

.tm-domain-select:focus {
  border-color: var(--tm-accent);
}

.tm-box {
  border: 1px solid var(--tm-border);
  border-radius: 10px;
  background: var(--tm-surface);
  padding: 10px 12px;
}

.tm-box label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tm-text-tertiary);
}

.tm-box strong {
  display: block;
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--tm-text);
  word-break: break-all;
}

.tm-status {
  border: 1px dashed var(--tm-border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tm-status span {
  font-size: 12px;
  color: var(--tm-text-secondary);
}

.tm-status strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--tm-text);
}

.tm-actions {
  display: grid;
  gap: 6px;
}

.tm-btn {
  appearance: none;
  border-radius: 10px;
  border: 1px solid var(--tm-border-strong);
  background: var(--tm-card);
  color: var(--tm-text);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, box-shadow .12s, transform .12s;
  user-select: none;
  -webkit-user-select: none;
}

.tm-btn:hover:enabled {
  background: var(--tm-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

.tm-btn:active:enabled {
  transform: translateY(0);
  box-shadow: none;
}

.tm-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.tm-btn-primary {
  border-color: var(--tm-accent);
  background: var(--tm-accent);
  color: #ffffff;
  font-weight: 600;
}

.tm-btn-primary:hover:enabled {
  background: color-mix(in srgb, var(--tm-accent) 88%, #000);
  border-color: color-mix(in srgb, var(--tm-accent) 88%, #000);
}

.tm-hints {
  margin: 2px 0 0;
  padding: 0 0 0 14px;
  display: grid;
  gap: 4px;
  color: var(--tm-text-tertiary);
  font-size: 11px;
  line-height: 1.5;
}

.tm-notice {
  margin: 0;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12px;
  border: 1px solid transparent;
  line-height: 1.45;
}

.tm-notice.is-success {
  color: var(--tm-success-text);
  background: var(--tm-success-bg);
  border-color: color-mix(in srgb, var(--tm-success-text) 15%, transparent);
}

.tm-notice.is-error {
  color: var(--tm-error-text);
  background: var(--tm-error-bg);
  border-color: color-mix(in srgb, var(--tm-error-text) 15%, transparent);
}

.tm-inbox {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.tm-inbox-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tm-inbox-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tm-text-secondary);
}

.tm-inbox-head span {
  font-size: 11px;
  font-weight: 500;
  color: var(--tm-text-tertiary);
}

.tm-inbox-layout {
  display: grid;
  grid-template-columns: minmax(240px, 36%) 1fr;
  gap: 10px;
  min-height: 460px;
}

.tm-list,
.tm-view {
  min-height: 0;
  border: 1px solid var(--tm-border);
  border-radius: 10px;
  background: var(--tm-card);
}

.tm-list {
  overflow: auto;
  padding: 6px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.tm-item {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  transition: background .12s, border-color .12s;
  font-family: inherit;
}

.tm-item:hover {
  background: var(--tm-surface);
  border-color: var(--tm-border);
}

.tm-item.is-selected {
  background: var(--tm-accent-soft);
  border-color: color-mix(in srgb, var(--tm-accent) 30%, transparent);
}

.tm-item header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.tm-item strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--tm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-item header span {
  font-size: 10px;
  color: var(--tm-text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.tm-item h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--tm-text);
  line-height: 1.3;
}

.tm-item p {
  margin: 0;
  font-size: 11px;
  color: var(--tm-text-tertiary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tm-view {
  overflow: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.tm-view header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.tm-view header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--tm-text);
  line-height: 1.35;
}

.tm-view header span {
  font-size: 11px;
  color: var(--tm-text-tertiary);
  white-space: nowrap;
}

.tm-view dl {
  margin: 0;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px 8px;
  font-size: 12px;
}

.tm-view dt {
  color: var(--tm-text-tertiary);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.tm-view dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--tm-text);
  word-break: break-all;
}

.tm-view pre {
  margin: 2px 0 0;
  padding: 12px;
  border: 1px solid var(--tm-border);
  border-radius: 8px;
  background: var(--tm-surface);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--tm-text);
}

.tm-empty {
  margin: 0;
  color: var(--tm-text-tertiary);
  font-size: 12px;
  padding: 14px;
}

@media (max-width: 1080px) {
  .tm-grid {
    grid-template-columns: 1fr;
  }

  .tm-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px 0;
  }

  .tm-grid {
    padding: 0 20px;
  }

  .tm-inbox-layout {
    grid-template-columns: 1fr;
  }

  .tm-list {
    max-height: 280px;
  }
}

@media (max-width: 600px) {
  .tm-hero {
    padding: 20px 16px 0;
  }

  .tm-grid {
    padding: 0 16px;
  }

  .tm-panel {
    padding: 12px;
  }

  .tm-inline-field {
    min-height: 40px;
  }

  .tm-btn {
    padding: 9px 10px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-btn,
  .tm-inline-field,
  .tm-item,
  .tm-notice {
    transition: none !important;
  }
}
/* end tempmail — redesigned */


