/* ============================================================
   ADR Tempmail — UI v2 "paper & ink"
   Design language ported from tryclico.com (same as dl.adrnode.com,
   gateway.adrnode.com, predict.adrnode.com):
     cream paper on lavender, graph-paper substrate, 2px black outlines,
     zero-blur offset shadows, Instrument Serif display /
     Instrument Sans UI / JetBrains Mono for addresses & timestamps.

   Every class name is preserved — web/app.js drives .message-item,
   .message-avatar, .empty-state, .email-render, .domain-select, etc.
   and was NOT touched.
   ============================================================ */

/* ── self-hosted fonts (latin subset) ───────────────────────── */
@font-face{font-family:'Instrument Sans';font-style:normal;font-weight:400 700;font-display:swap;
  src:url('/fonts/InstrumentSans-400.woff2') format('woff2')}
@font-face{font-family:'Instrument Serif';font-style:normal;font-weight:400;font-display:swap;
  src:url('/fonts/InstrumentSerif-400.woff2') format('woff2')}
@font-face{font-family:'Instrument Serif';font-style:italic;font-weight:400;font-display:swap;
  src:url('/fonts/InstrumentSerif-400-italic.woff2') format('woff2')}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400 700;font-display:swap;
  src:url('/fonts/JetBrainsMono-400.woff2') format('woff2')}

:root {
  --page: #c8bff5;      /* lavender field */
  --card: #f6f3ec;      /* cream paper */
  --surface: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #3c3c42;
  --ink-3: #46464c;
  --hair: rgba(10, 10, 10, 0.12);
  --grid: rgba(120, 100, 80, 0.10);

  --lime: #c1f04c;
  --blue: #5b5bd6;
  --orange: #f26b3a;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-hard: 2px 2px 0 var(--ink);
  --shadow-btn: 3px 3px 0 var(--ink);
  --shadow-btn-hover: 5px 5px 0 var(--ink);
  --shadow-card: 4px 4px 0 var(--ink);
  --bounce: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);

  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--page);
  color: var(--ink);
  min-height: 100svh;
  position: relative;
  overflow-x: hidden;
  padding: 22px 16px 34px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 900px) { body { padding: 34px 40px 48px; } }

/* the old radial glow layer — neutralised, the paper sheet carries the texture */
.bg-glow { display: none; }

/* ── the cream paper sheet ───────────────────────────────────── */
.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 34px;
  position: relative;
  z-index: 1;
  background-color: var(--card);
  background-image:
    linear-gradient(90deg, var(--grid) 1px, transparent 0),
    linear-gradient(var(--grid) 1px, transparent 0);
  background-size: 24px 24px;
  background-attachment: fixed;
  /* shrink-wrap the sheet to its content — a fixed tall sheet left a band of
     empty cream under the last card on short/empty states */
  height: fit-content;
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  /* background-attachment:fixed + a radius can leave a 1px unpainted strip at
     the rounded edges on some engines; clip explicitly to the border box. */
  background-clip: border-box;
}
@media (min-width: 720px) { .app { padding: 34px 34px 40px; } }

/* accent bloom at the top of the sheet */
.app::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 240px;
  pointer-events: none;
  background: radial-gradient(62% 100% at 50% 0%,
    rgba(91, 91, 214, 0.13) 0%, transparent 74%);
}
.app > * { position: relative; }

/* ── entrance ────────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
header, .inbox-card, .panel {
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
header      { animation-delay: 0.02s; }
.inbox-card { animation-delay: 0.08s; }
.panel      { animation-delay: 0.14s; }

/* ═══════════════════ HEADER ═══════════════════ */
header {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--ink);
}
/* the header rule and the cards below must share one left/right edge */
header, .inbox-card, .new-box, .panel { margin-left: 0; margin-right: 0; }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
/* the inline SVG paints with url(#grad) — force it to ink so the mark
   reads on cream instead of using the old indigo→cyan gradient */
.logo svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 6px;
  background: var(--lime);
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow: var(--shadow-hard);
  stroke: var(--ink) !important;
  box-sizing: border-box;
}
.logo svg linearGradient stop { stop-color: #0a0a0a !important; }

.logo h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  /* kill the old gradient-clip text */
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: currentColor;
  background-clip: initial;
}

header p {
  margin-left: 52px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: help;
}

/* ═══════════════════ INBOX CARD ═══════════════════ */
.inbox-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 20px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.inbox-label {
  display: block;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.inbox-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

/* the address select is the hero datum — mono, prominent */
.inbox-row select {
  flex: 1;
  min-width: 0;
  padding: 13px 40px 13px 15px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%230a0a0a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: var(--bounce);
}
.inbox-row select.is-placeholder {
  color: var(--ink-2);
  font-style: italic;
  font-family: var(--sans);
  font-size: 0.82rem;
}
.inbox-row select:disabled {
  border-color: var(--hair);
  background-color: var(--card);
  cursor: not-allowed;
  opacity: 0.9;
  /* no chevron — there is nothing to open */
  background-image: none;
  padding-right: 15px;
}
.inbox-row select:focus {
  outline: none;
  background-color: var(--surface);
  border-color: var(--ink);
  box-shadow: var(--shadow-btn);
  transform: translate(-1px, -1px);
}

.inbox-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}
/* all three share one height so colour alone carries the emphasis, and the
   gutter clears the 3px offset shadow */
.inbox-actions .btn { min-height: 42px; }

/* ═══════════════════ BUTTONS ═══════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 17px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--bounce);
}
.btn:hover {
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}
.btn:active { box-shadow: 1px 1px 0 var(--ink); transform: translate(1px, 1px); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn:disabled, .btn.is-disabled,
.btn-icon:disabled, .btn-icon.is-disabled {
  background: var(--card);
  color: var(--ink-3);
  border-color: var(--hair);
  box-shadow: 1px 1px 0 var(--hair);
  transform: none;
  cursor: not-allowed;
  opacity: 0.85;
}
.btn:disabled:hover, .btn.is-disabled:hover,
.btn-icon:disabled:hover, .btn-icon.is-disabled:hover {
  background: var(--card);
  box-shadow: 1px 1px 0 var(--hair);
  transform: none;
}

.btn-icon {
  min-height: 42px;
  padding: 10px 13px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn-icon:hover { background: var(--lime); }
.btn-icon .btn-text { display: none; }

.btn-primary {
  background: var(--lime);
  color: var(--ink);
  box-shadow: var(--shadow-hard);   /* same as siblings — colour carries emphasis */
}
.btn-primary:hover {
  background: var(--lime);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.btn.btn-demoted {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-hard);   /* full parity with Refresh / Delete */
}
.btn.btn-demoted:hover { background: var(--card); box-shadow: 4px 4px 0 var(--ink); }

.btn-secondary { background: var(--surface); color: var(--ink); }
.btn-secondary:hover { background: var(--card); }

.btn-danger { background: var(--orange); color: var(--ink); }
.btn-danger:hover { background: #e05427; color: var(--ink); }

/* ═══════════════════ NEW BOX ═══════════════════ */
.new-box {
  margin-bottom: 20px;
  animation: slideDown 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.new-box-inner {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
  padding: 16px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* .domain-select is injected by app.js */
.domain-select {
  min-width: 170px;
  padding: 11px 38px 11px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%230a0a0a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
  transition: var(--bounce);
}
.domain-select:focus {
  outline: none;
  background-color: var(--surface);
  box-shadow: var(--shadow-btn);
  transform: translate(-1px, -1px);
}

.new-box-inner input {
  flex: 1;
  min-width: 190px;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  transition: var(--bounce);
}
.new-box-inner input:focus {
  outline: none;
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  transform: translate(-1px, -1px);
}
.new-box-inner input::placeholder { color: var(--ink-3); opacity: 0.7; }

/* ═══════════════════ PANEL ═══════════════════ */
.panel {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  /* the list was top-heavy: header gap above the first card measured ~33px
     while only ~20px sat under the last one */
  padding: 22px 22px 26px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
/* the address field is a read-only value slot, not an editable placeholder */
.inbox-row select.is-placeholder { cursor: not-allowed; }

/* the current inbox address — mono, it's data not a heading */
.panel-head h2 {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  word-break: break-all;
  min-width: 0;
}

/* feat-tag pill */
.badge.is-zero {
  background: var(--card);
  border-color: var(--hair);
  color: var(--ink-3);
}
.badge {
  flex-shrink: 0;
  padding: 3px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.6;
  white-space: nowrap;
}

/* ═══════════════════ MESSAGE LIST ═══════════════════ */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  background: var(--card);
  cursor: pointer;
  transition: var(--bounce);
}
.message-item:hover {
  background: var(--lime);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}
.message-item:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(1px, 1px);
}

.message-item-left {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  flex: 1 1 auto;
  min-width: 0;
}

/* square ink tile instead of a gradient circle */
.message-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  /* ink, not --blue: indigo appeared nowhere else in the palette and read as
     an off-theme accent across every row */
  background: var(--ink);
  color: var(--card);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.message-info { flex: 1; min-width: 0; }

.message-from {
  min-width: 0;                /* allow the ellipsis to actually engage */
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the subject is the thing you scan for → display serif */
.message-subject {
  margin-bottom: 3px;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-preview {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-time {
  flex: 0 0 auto;              /* never squeezed by a long sender address */
  align-self: flex-start;
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ═══════════════════ EMPTY STATE ═══════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 34px 20px 30px;
  color: var(--ink-2);
}
.empty-state svg {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  padding: 8px;
  /* deliberately NOT the lime logo tile — that read as a misplaced brand mark
     and looked clickable while doing nothing */
  background: var(--card);
  border: 2px dashed var(--hair);
  border-radius: var(--radius);
  stroke: var(--ink-3);
  opacity: 1;
  box-sizing: border-box;
}
.empty-state p {
  max-width: 26ch;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.empty-state p strong { color: var(--ink); font-weight: 700; }
.empty-sub {
  display: block;
  max-width: 28ch;
  margin: -6px 0 18px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-2);
  text-transform: none;
  letter-spacing: 0;
}
.empty-cta { padding: 11px 20px; box-shadow: var(--shadow-hard); }
.empty-cta:hover { box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }

/* ═══════════════════ MESSAGE OVERLAY ═══════════════════ */
.message-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(200, 191, 245, 0.9);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.overlay-content {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  animation: overlaySlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes overlaySlideIn {
  from { transform: translate(4px, 12px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.overlay-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 2px solid var(--ink);
  background: var(--card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  flex-shrink: 0;
}

.overlay-close { margin-top: 1px; flex-shrink: 0; }

.overlay-title-area { flex: 1; min-width: 0; }

.overlay-title-area h3 {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
}

.overlay-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-from {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  word-break: break-all;
}
.meta-sep { color: var(--ink-3); font-size: 0.7rem; }
.meta-time {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}

.overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}

/* ═══════════ EMAIL HTML RENDERER ═══════════
   Inbound email HTML is authored for LIGHT backgrounds. The old dark theme
   forced color:#fff here, which made any email that set its own dark text
   (most of them) render white-on-white. Rendering on white with dark ink is
   both on-theme and closer to how the sender intended it. */
.email-render {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #1a1a1a;
  background: #ffffff;
  word-break: break-word;
  overflow-wrap: break-word;
}

.email-render table {
  border-collapse: collapse;
  max-width: 100% !important;
}
.email-render td,
.email-render th { word-break: break-word; }

.email-render img {
  max-width: 100% !important;
  height: auto !important;
  display: inline-block;
}

.email-render a {
  color: var(--blue);
  text-decoration: underline;
}
.email-render a[href] img { border: none; }
.email-render center { text-align: center; }

.email-render hr {
  border: none;
  border-top: 1px solid var(--hair);
  margin: 16px 0;
}

/* ═══════════ PLAIN TEXT EMAIL ═══════════ */
.message-full-body {
  padding: 22px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #1a1a1a;
  word-break: break-word;
  overflow-wrap: break-word;
}
.message-full-body a {
  color: var(--blue);
  text-decoration: underline;
  word-break: break-all;
}
.message-full-body img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  margin: 10px 0;
  display: block;
}
.message-full-body p { margin-bottom: 12px; }

.message-plain {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 22px;
  color: #1a1a1a;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
}

.email-plain {
  padding: 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: #1a1a1a;
}
.email-plain img {
  max-width: 220px;
  height: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  margin: 10px 0;
  display: block;
}

/* ═══════════════════ UTILITY ═══════════════════ */
.hidden { display: none !important; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
::selection { background: var(--lime); color: var(--ink); }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--card); }
::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 3px solid var(--card);
  border-radius: 99px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 600px) {
  body { padding: 16px 12px 28px; }
  .app { padding: 22px 18px 26px; border-radius: 14px; }

  header { margin-bottom: 20px; padding-bottom: 18px; }
  .logo svg { width: 34px; height: 34px; padding: 5px; }
  header p { margin-left: 46px; font-size: 0.58rem; }

  .inbox-card { padding: 17px; }
  .inbox-actions { flex-direction: column; }
  .inbox-actions .btn { justify-content: center; width: 100%; }
  .btn-icon .btn-text { display: inline; }
  .inbox-row select { font-size: 0.78rem; padding-right: 36px; }

  .panel { padding: 17px; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .panel-head h2 { font-size: 0.78rem; }

  .message-item { padding: 12px; }
  .message-avatar { width: 34px; height: 34px; font-size: 1.1rem; }
  .message-subject { font-size: 1rem; white-space: normal;
                     display: -webkit-box; -webkit-line-clamp: 2;
                     -webkit-box-orient: vertical; }

  .message-overlay { padding: 10px 8px; }
  .overlay-content { max-height: calc(100vh - 20px); }
  .overlay-header { padding: 15px 14px; }
  .overlay-title-area h3 { font-size: 1.25rem; }

  .message-full-body, .message-plain, .email-plain { padding: 16px; }
}

@media (max-width: 380px) {
  .logo h1 { font-size: 1.65rem; }
  .new-box-inner input { min-width: 0; }
  .domain-select { min-width: 0; width: 100%; }
}
