:root {
  color-scheme: light;
  --ui-scale: 0.9;
  --ink: #12202a;
  --ink-soft: #30424d;
  --muted: #64717b;
  --line: #14212a;
  --line-soft: #e9edf0;
  --paper: #fffefa;
  --paper-blue: #f0f9ff;
  --paper-rose: #fff1f7;
  --paper-warm: #fff6df;
  --ocean: #0ea5e9;
  --ocean-deep: #03679e;
  --coral: #ff6b35;
  --coral-deep: #d4622c;
  --pink: #ff6b9d;
  --yellow: #ffd166;
  --mint: #10b981;
  --danger: #dc2626;
  --warn: #b76a00;
  --radius: 22px;
  --radius-sm: 14px;
  --app-pad: calc(18px * var(--ui-scale));
  --app-gap: calc(20px * var(--ui-scale));
  --rail-width: calc(286px * var(--ui-scale));
  --control-min: calc(42px * var(--ui-scale));
  --control-py: calc(10px * var(--ui-scale));
  --control-px: calc(16px * var(--ui-scale));
  --field-py: calc(11px * var(--ui-scale));
  --field-px: calc(13px * var(--ui-scale));
  --panel-radius: calc(28px * var(--ui-scale));
  --shadow-hard: 7px 7px 0 rgba(18, 32, 42, 0.15);
  --shadow-soft: 0 18px 55px rgba(18, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: #f0f9ff;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font: calc(15px * var(--ui-scale)) Inter, Athletics-Regular, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(125deg, #e9f8ff 0%, #fffefa 34%, #fff1f7 70%, #fff6df 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18, 32, 42, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(18, 32, 42, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 74%);
}

a {
  color: var(--ocean-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
.button {
  min-height: var(--control-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: var(--control-py) var(--control-px);
  background: var(--coral);
  color: #fff;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover,
.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(18, 32, 42, 0.22);
  text-decoration: none;
}

.button.secondary,
button.secondary {
  background: var(--ocean);
}

.button.ghost,
button.ghost {
  background: var(--paper);
  color: var(--ink);
}

.button.danger,
button.danger {
  background: var(--danger);
}

.compose-wide {
  width: 100%;
}

input,
textarea,
select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  padding: var(--field-py) var(--field-px);
  font: inherit;
  box-shadow: inset 0 -2px 0 rgba(18, 32, 42, 0.06);
}

input[type="checkbox"] {
  width: auto;
  accent-color: var(--coral);
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(14, 165, 233, 0.24);
  outline-offset: 1px;
}

textarea {
  min-height: 330px;
  resize: vertical;
  line-height: 1.55;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  gap: var(--app-gap);
  padding: var(--app-pad);
}

.rail,
.folder-pane,
.surface,
.message-card,
.side-panel,
.settings-section,
.compose,
.metric,
.login-panel {
  border: 2px solid var(--line);
  border-radius: var(--panel-radius);
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--shadow-hard);
}

.rail {
  position: sticky;
  top: var(--app-pad);
  height: calc(100vh - var(--app-pad) - var(--app-pad));
  display: flex;
  flex-direction: column;
  gap: calc(16px * var(--ui-scale));
  padding: calc(16px * var(--ui-scale));
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: calc(12px * var(--ui-scale));
}

.mark {
  width: calc(54px * var(--ui-scale));
  height: calc(54px * var(--ui-scale));
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: calc(19px * var(--ui-scale));
  background: linear-gradient(135deg, var(--yellow), #fff3a5);
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.18);
}

.mark-icon {
  width: calc(38px * var(--ui-scale));
  height: calc(38px * var(--ui-scale));
  display: block;
  fill: currentColor;
}

.brand-title,
.login-panel h1,
.message-card h2,
.settings-section h2,
.surface h2,
.side-panel h3,
.compose h2 {
  margin-top: 0;
  font-family: "Arial Black", Impact, Inter, system-ui, sans-serif;
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.brand-title {
  font-size: calc(24px * var(--ui-scale));
}

.account {
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, #e0f2fe, #fffefa);
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.1);
}

.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: calc(42px * var(--ui-scale));
  height: calc(42px * var(--ui-scale));
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-weight: 900;
}

.account-email {
  color: #53636d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--ui-scale));
  min-height: 0;
  overflow-y: auto;
  padding-right: calc(4px * var(--ui-scale));
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 11px 13px;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.nav a::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
}

.nav a:nth-child(2)::before {
  background: var(--coral);
}

.nav a:nth-child(3)::before {
  background: var(--mint);
}

.nav a:nth-child(4)::before {
  background: var(--pink);
}

.nav a.active,
.nav a:hover {
  border-color: var(--line);
  background: var(--ocean);
  color: #fff;
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.16);
}

.nav a:nth-child(2).active,
.nav a:nth-child(2):hover {
  background: var(--coral);
}

.nav a:nth-child(3).active,
.nav a:nth-child(3):hover {
  background: var(--mint);
}

.rail-foot {
  flex: 0 0 auto;
  margin-top: auto;
}

.main {
  min-width: 0;
}

.content {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding-top: 20px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(470px, 100%);
  position: relative;
  padding: 30px;
}

.login-panel::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 58px;
  height: 14px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 22px 0 var(--ocean), 0 44px 0 var(--pink);
}

.login-panel h1 {
  margin: 22px 0 8px;
  font-size: 40px;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
  font-weight: 850;
}

.panel-error {
  padding: 0 16px;
}

.notice {
  color: var(--ocean-deep);
  font-weight: 850;
}

.grid-mail {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.folder-pane {
  position: sticky;
  top: 116px;
  padding: 14px;
}

.folder-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 17px;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.folder-item:hover,
.folder-item.active {
  background: var(--paper-blue);
  text-decoration: none;
}

.folder-item.active {
  outline: 2px solid var(--line);
}

.count {
  min-width: 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.unread {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
}

.surface {
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 2px solid var(--line);
  background: linear-gradient(90deg, #fffefa, #e0f2fe);
}

.toolbar form {
  display: flex;
  flex: 1;
  gap: 8px;
}

.mail-list {
  display: flex;
  flex-direction: column;
}

.message-row {
  display: grid;
  grid-template-columns: 34px minmax(150px, 230px) minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 2px solid #eef0ef;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.message-row:hover {
  transform: translateX(2px);
  background: var(--paper-warm);
  text-decoration: none;
}

.message-row.unseen {
  background: var(--paper-blue);
  font-weight: 850;
}

.sender,
.subject-text,
.preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.preview {
  color: var(--muted);
  font-weight: 500;
}

.date-cell {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.star {
  color: var(--coral);
  font-weight: 900;
}

.empty {
  padding: 48px;
  color: var(--muted);
  text-align: center;
}

.message-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 18px;
}

.message-card {
  padding: 24px;
}

.message-card h2 {
  margin: 6px 0 12px;
  font-size: 34px;
}

.message-meta {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--paper-warm);
}

.body {
  white-space: pre-wrap;
  line-height: 1.62;
  font-size: 16px;
}

.plain-body,
.html-body {
  margin-top: 16px;
}

.html-body {
  overflow-x: auto;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: #1f2937;
  line-height: 1.55;
}

.html-body :first-child {
  margin-top: 0;
}

.html-body :last-child {
  margin-bottom: 0;
}

.html-body img {
  max-width: 100%;
  height: auto;
}

.html-body table {
  max-width: 100%;
  border-collapse: collapse;
}

.html-body td,
.html-body th {
  padding: 4px;
}

.attachment-box {
  margin-top: calc(18px * var(--ui-scale));
  padding: calc(14px * var(--ui-scale));
  border: 2px solid var(--line);
  border-radius: calc(18px * var(--ui-scale));
  background: var(--paper-blue);
}

.attachment-box h3 {
  margin: 0 0 calc(10px * var(--ui-scale));
  font-size: calc(14px * var(--ui-scale));
  text-transform: uppercase;
}

.attachment-list {
  display: grid;
  gap: calc(8px * var(--ui-scale));
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12px * var(--ui-scale));
  border: 2px solid var(--line);
  border-radius: calc(14px * var(--ui-scale));
  padding: calc(9px * var(--ui-scale)) calc(11px * var(--ui-scale));
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.attachment-item:hover {
  background: var(--paper-warm);
  text-decoration: none;
}

.attachment-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: calc(12px * var(--ui-scale));
}

.pre {
  overflow: auto;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--paper-blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.side-panel {
  padding: 16px;
}

.side-actions {
  display: grid;
  gap: 10px;
}

.compose {
  padding: 22px;
}

.compose h2 {
  margin: 0 0 18px;
  font-size: 33px;
}

.compose {
  display: flex;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.compose form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.compose-body-row {
  display: flex;
  min-height: calc(330px * var(--ui-scale));
  flex: 1 1 auto;
  flex-direction: column;
}

.compose-body-row textarea {
  min-height: calc(330px * var(--ui-scale));
  flex: 1 1 auto;
}

.compose-actions {
  flex: 0 0 auto;
}

.compose-pane {
  overflow: hidden;
}

.compose-pane .compose {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.compose-attachments {
  flex: 0 0 auto;
  margin-bottom: calc(13px * var(--ui-scale));
}

.compose-attachments input[type="file"] {
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row {
  margin: 0 0 13px;
}

.label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: calc(18px * var(--ui-scale));
}

.settings-section {
  margin-bottom: calc(18px * var(--ui-scale));
  padding: calc(18px * var(--ui-scale));
}

.domain-page {
  display: grid;
  gap: calc(16px * var(--ui-scale));
}

.domain-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px * var(--ui-scale));
  border: 2px solid var(--line);
  border-radius: var(--panel-radius);
  background: linear-gradient(135deg, var(--paper), var(--paper-blue));
  box-shadow: var(--shadow-hard);
}

.domain-page-head h1 {
  margin: 0;
  font: 900 calc(30px * var(--ui-scale)) "Arial Black", Impact, Inter, system-ui, sans-serif;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--coral-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.domain-panel {
  margin-bottom: 0;
}

.domain-dashboard {
  display: grid;
  gap: calc(16px * var(--ui-scale));
}

.domain-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(14px * var(--ui-scale));
}

.stat-card {
  min-height: 128px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: calc(18px * var(--ui-scale));
  border: 2px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--paper);
  box-shadow: var(--shadow-hard);
}

.stat-card span,
.domain-limit-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-card strong {
  overflow-wrap: anywhere;
  font: 900 calc(31px * var(--ui-scale)) "Arial Black", Impact, Inter, system-ui, sans-serif;
}

.accent-coral {
  background: linear-gradient(135deg, var(--paper), #ffe2d5);
}

.accent-ocean {
  background: linear-gradient(135deg, var(--paper), #dff5ff);
}

.accent-mint {
  background: linear-gradient(135deg, var(--paper), #dcfce7);
}

.accent-yellow {
  background: linear-gradient(135deg, var(--paper), #fff1b9);
}

.accent-pink {
  background: linear-gradient(135deg, var(--paper), #ffe1ed);
}

.domain-limit-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: calc(14px * var(--ui-scale));
  border: 2px solid var(--line);
  border-radius: var(--panel-radius);
  background: rgba(255, 254, 250, 0.92);
  box-shadow: var(--shadow-hard);
}

.domain-limit-strip div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.domain-limit-strip strong {
  overflow-wrap: anywhere;
  font-weight: 900;
}

.storage-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.storage-breakdown div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: calc(14px * var(--ui-scale));
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.68);
}

.storage-breakdown span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.storage-breakdown strong {
  overflow-wrap: anywhere;
  font-size: calc(20px * var(--ui-scale));
  font-weight: 900;
}

.storage-breakdown small {
  color: var(--muted);
  line-height: 1.35;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: calc(14px * var(--ui-scale));
  border: 2px solid var(--danger);
  border-radius: var(--radius-sm);
  background: rgba(255, 230, 230, 0.72);
}

.danger-zone div {
  display: grid;
  gap: 4px;
}

.danger-zone small {
  color: var(--muted);
}

.domain-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(16px * var(--ui-scale));
}

.range-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
}

.range-field .label {
  margin: 0;
}

.range-field small {
  color: var(--muted);
  font-size: 12px;
}

.range-control {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 104px;
  gap: 10px;
  align-items: center;
}

.range-control input[type="range"] {
  padding: 0;
  box-shadow: none;
}

.compact-number {
  min-height: calc(36px * var(--ui-scale));
  padding: calc(7px * var(--ui-scale)) calc(9px * var(--ui-scale));
  text-align: right;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mailbox-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.domain-admin-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: calc(18px * var(--ui-scale));
  align-items: start;
}

.domain-admin-menu {
  position: sticky;
  top: calc(16px * var(--ui-scale));
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 4px 4px 0 rgba(18, 32, 42, 0.08);
}

.domain-admin-menu-title {
  overflow: hidden;
  padding: 4px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.domain-admin-menu a {
  display: block;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 9px 10px;
  color: var(--ink);
  font-weight: 900;
}

.domain-admin-menu a:hover,
.domain-admin-menu a:focus-visible {
  border-color: var(--line);
  background: var(--yellow);
  text-decoration: none;
  transform: translateY(1px);
}

.domain-admin-content {
  min-width: 0;
}

.domain-admin-content .settings-section {
  scroll-margin-top: 18px;
}

.domain-subsection {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--line-soft);
}

.domain-subsection h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.switch-row,
.switch-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-row small,
.spam-level-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.switch-inline {
  justify-content: flex-start;
  margin-top: 8px;
}

.switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.switch-control {
  box-sizing: border-box;
  width: 42px;
  height: 25px;
  position: relative;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 32, 42, 0.16);
  box-shadow: inset 0 2px 0 rgba(18, 32, 42, 0.08);
}

.switch-control::after {
  box-sizing: border-box;
  content: "";
  position: absolute;
  left: 1px;
  top: calc(50% - 1px);
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  transform: translateY(-50%);
  transition: transform 0.16s ease;
}

.switch-input:checked + .switch-control {
  background: var(--mint);
}

.switch-input:checked + .switch-control::after {
  transform: translate(17px, -50%);
}

.spam-policy-section {
  display: grid;
  gap: calc(16px * var(--ui-scale));
}

.spam-policy-section .section-head {
  margin-bottom: 0;
}

.spam-policy-form,
.spam-list-layout {
  display: grid;
  gap: 14px;
}

.spam-level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mailbox-spam-levels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spam-level-card {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.12);
}

.spam-level-card.clean {
  background: color-mix(in srgb, var(--mint) 34%, white);
}

.spam-level-card.danger {
  background: color-mix(in srgb, var(--coral) 22%, white);
}

.spam-level-controls {
  display: grid;
  grid-template-columns: auto auto minmax(64px, 1fr);
  align-items: center;
  gap: 8px;
}

.spam-level-controls input[type="number"] {
  min-width: 0;
  padding-inline: 8px;
}

.spam-list-form {
  display: grid;
  grid-template-columns: 120px 130px minmax(190px, 1fr) minmax(150px, 0.7fr) auto;
  gap: 8px;
  align-items: end;
}

.scale-control {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid var(--line-soft);
}

.scale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scale-row .label {
  margin-bottom: 0;
}

.scale-row output {
  color: var(--ink);
  font-weight: 900;
}

.scale-control input[type="range"] {
  padding: 0;
  box-shadow: none;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  padding: 11px 8px;
  border-bottom: 2px solid #eef0ef;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-form input,
.inline-form select {
  min-width: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  padding: 16px;
  background: linear-gradient(135deg, #fffefa, #fff6df);
}

.metric:nth-child(2n) {
  background: linear-gradient(135deg, #fffefa, #e0f2fe);
}

.metric:nth-child(3n) {
  background: linear-gradient(135deg, #fffefa, #fff1f7);
}

.metric-value {
  font: 900 30px "Arial Black", Impact, sans-serif;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.insight-section {
  display: grid;
  gap: 14px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.insight-card {
  min-height: 94px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #fffefa, #f7fbff);
  box-shadow: 4px 4px 0 rgba(18, 23, 36, 0.08);
}

.insight-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insight-card strong {
  color: var(--ink);
  font: 900 26px "Arial Black", Impact, Inter, system-ui, sans-serif;
}

.insight-card.danger {
  background: linear-gradient(135deg, #fffefa, #ffe7e7);
}

.insight-card.mint {
  background: linear-gradient(135deg, #fffefa, #defbea);
}

.insight-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.insight-panels.single-column {
  grid-template-columns: 1fr;
}

.insight-panel {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 254, 250, 0.68);
}

.insight-panel h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.compact-table th,
.compact-table td {
  padding: 6px 6px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.debug-scope-block {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 0;
  background: rgba(255, 255, 255, 0.48);
}

.debug-scope-block > summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--ocean-deep);
  font-weight: 900;
  list-style-position: inside;
}

.debug-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(90px, 0.5fr) minmax(180px, 1.4fr) auto;
  gap: 8px;
  padding: 0 12px 12px;
}

.debug-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.debug-form input,
.debug-form select {
  min-height: 34px;
  border-width: 1px;
  font-size: 12px;
}

.debug-form button {
  align-self: end;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.dns {
  display: grid;
  gap: 12px;
}

.dns-row {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 21px;
  background: linear-gradient(135deg, #fffefa, #f0f9ff);
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.1);
}

.dns-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.dns-fields {
  display: grid;
  grid-template-columns: 1fr 88px 2fr;
  gap: 8px;
}

.dns-fields.compact {
  grid-template-columns: minmax(150px, 1fr) 82px minmax(220px, 2fr);
}

.dns-fields label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.dns-fields input {
  margin-top: 5px;
  background: #fff;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.dns-compact {
  gap: 8px;
}

.dns-compact .dns-row {
  padding: 11px;
}

.dns-status {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dns-status-ok .dns-status {
  background: var(--mint);
}

.dns-status-missing .dns-status,
.dns-status-mismatch .dns-status {
  background: var(--pink);
  color: #fff;
}

.dns-actual {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.dns-actual p {
  margin: 5px 0 0;
  word-break: break-word;
}

.copy-field {
  display: flex;
  gap: 6px;
}

.copy-field input {
  background: #fff;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.copy-field button {
  flex: 0 0 auto;
  padding: 8px 10px;
  background: var(--ocean);
}

.copy-field.copied button {
  background: var(--mint);
}

[data-copy-value].copied,
.copy-field.copied input {
  outline: 2px solid var(--mint);
}

.note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.domain-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.domain-tabs a {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 850;
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.1);
}

.domain-tabs a.active {
  background: var(--pink);
  color: #fff;
  text-decoration: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.section-actions form {
  margin: 0;
}

.limit-summary {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.compact-metrics {
  margin-bottom: 16px;
}

.admin-table td {
  vertical-align: top;
}

.role-row td {
  padding-top: 0;
  border-top: 0;
}

.compact-inline {
  align-items: center;
  gap: 8px;
}

.log-filter {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.domain-log-filter {
  grid-template-columns: minmax(220px, 2fr) minmax(130px, 1fr) minmax(180px, 1fr) auto;
}

.audit-table td {
  vertical-align: top;
}

.log-blocks {
  display: grid;
  gap: 14px;
}

.log-block {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.62);
}

.log-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.log-block > summary::-webkit-details-marker {
  display: none;
}

.log-block > summary::after {
  content: "+";
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 760;
}

.log-block[open] > summary::after {
  content: "-";
}

.log-block h2 {
  margin: 0 0 4px;
}

.log-block p {
  margin: 0;
}

.lazy-log-panel {
  border-top: 1px solid var(--line-soft);
  padding: 14px;
}

.lazy-log-placeholder,
.lazy-log-loading,
.lazy-log-error {
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.lazy-log-error {
  color: var(--danger);
}

.server-log-filter {
  grid-template-columns: minmax(240px, 2fr) minmax(120px, 0.75fr) minmax(140px, 1fr) minmax(180px, 1fr) minmax(96px, 0.55fr) auto;
}

.domain-server-log-filter {
  grid-template-columns: minmax(240px, 2fr) minmax(120px, 0.75fr) minmax(180px, 1fr) minmax(96px, 0.55fr) auto;
}

.server-log-table {
  table-layout: fixed;
}

.server-log-table th:nth-child(1) {
  width: 68px;
}

.server-log-table th:nth-child(2) {
  width: 166px;
}

.server-log-table th:nth-child(3) {
  width: 82px;
}

.server-log-table th:nth-child(4) {
  width: 168px;
}

.server-log-table th:nth-child(5) {
  width: 142px;
}

.server-log-table th:nth-child(6) {
  width: 190px;
}

.server-log-time,
.server-log-table td {
  overflow-wrap: anywhere;
}

.server-log-table th,
.server-log-table td {
  padding: 6px 7px;
}

.server-log-table-form {
  overflow-x: auto;
}

.server-log-filter-row th {
  vertical-align: top;
}

.server-log-filter-row input,
.server-log-filter-row select {
  min-height: 30px;
  border-width: 1px;
  padding: 5px 7px;
  font-size: 11px;
}

.server-log-filter-row th > input + input {
  margin-top: 5px;
}

.server-log-filter-actions {
  display: grid;
  grid-template-columns: minmax(62px, 0.75fr) auto;
  gap: 5px;
  margin-top: 5px;
}

.server-log-filter-actions button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.flow-icon {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--muted);
  line-height: 0;
}

.flow-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.flow-incoming {
  color: #059669;
}

.flow-outgoing {
  color: #059669;
}

.flow-blocked {
  color: var(--danger);
}

.flow-spam {
  color: var(--danger);
}

.flow-info {
  color: #d9a400;
}

.server-log-level {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  color: #fff;
  background: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.server-log-level.level-debug {
  color: var(--ink);
  background: var(--paper-warm);
}

.server-log-level.level-info {
  background: var(--ocean);
}

.server-log-level.level-warn {
  background: var(--warn);
}

.server-log-level.level-error {
  background: var(--danger);
}

.server-log-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.server-log-kv {
  display: inline-flex;
  max-width: 100%;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 254, 250, 0.76);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.server-log-kv b {
  color: var(--muted);
  font-weight: 850;
}

.server-log-event {
  font-weight: 760;
}

.server-log-detail summary {
  cursor: pointer;
  color: var(--ocean-deep);
  font-size: 11px;
  font-weight: 850;
  list-style-position: inside;
}

.server-log-detail[open] summary {
  margin-bottom: 4px;
}

.server-log-line {
  display: block;
  margin-top: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 7px;
  background: rgba(240, 249, 255, 0.7);
  color: var(--ink-soft);
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.status-delivered {
  color: var(--mint);
  font-weight: 850;
}

.status-queued,
.status-sending {
  color: var(--warn);
  font-weight: 850;
}

.status-failed {
  color: var(--danger);
  font-weight: 850;
}

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

  .rail {
    position: static;
    height: auto;
  }

  .grid-mail,
  .message-shell,
  .settings-grid,
  .domain-admin-shell {
    grid-template-columns: 1fr;
  }

  .domain-stat-grid,
  .domain-limit-strip,
  .domain-settings-form,
  .mailbox-create-form {
    grid-template-columns: 1fr 1fr;
  }

  .insight-grid,
  .insight-panels,
  .debug-form,
  .spam-level-grid {
    grid-template-columns: 1fr 1fr;
  }

  .domain-admin-menu {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: auto;
  }

  .domain-admin-menu-title {
    grid-column: 1 / -1;
  }

  .domain-admin-menu a {
    text-align: center;
    white-space: nowrap;
  }

  .folder-pane {
    position: static;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .message-row {
    grid-template-columns: 28px minmax(0, 1fr) 70px;
  }

  .message-row .sender {
    display: none;
  }

  .form-grid,
  .dns-fields,
  .range-control,
  .domain-stat-grid,
  .domain-limit-strip,
  .domain-settings-form,
  .mailbox-create-form,
  .insight-grid,
  .insight-panels,
  .debug-form,
  .spam-list-form,
  .domain-log-filter,
  .domain-server-log-filter,
  .server-log-filter,
  .log-filter {
    grid-template-columns: 1fr;
  }

  .content {
    padding-top: 14px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .insight-grid,
  .insight-panels,
  .debug-form,
  .spam-level-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar form {
    width: 100%;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .message-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .date-cell {
    display: none;
  }

  .rail {
    padding: 12px;
    border-radius: 22px;
  }

  .nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .account {
    display: none;
  }

  .message-card h2 {
    font-size: 26px;
  }
}

/* Default-layout support for the Slab visual style. */
.app {
  height: 100vh;
  min-height: 0;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
}

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: calc(24px * var(--ui-scale));
  font-family: "Arial Black", Impact, Inter, system-ui, sans-serif;
  line-height: 1.02;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-copy span {
  color: var(--muted);
  font-size: calc(12px * var(--ui-scale));
}

.nav a,
.nav-disabled {
  display: flex;
  min-height: calc(44px * var(--ui-scale));
  align-items: center;
  gap: calc(10px * var(--ui-scale));
  border: 2px solid transparent;
  border-radius: 999px;
  padding: calc(9px * var(--ui-scale)) calc(12px * var(--ui-scale));
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.nav a::before {
  content: none;
}

.nav-disabled {
  color: rgba(18, 32, 42, 0.42);
  cursor: default;
}

.nav-glyph {
  display: inline-flex;
  width: calc(25px * var(--ui-scale));
  height: calc(25px * var(--ui-scale));
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: calc(11px * var(--ui-scale));
  font-weight: 900;
}

.nav-label {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.nav-label small {
  overflow: hidden;
  color: var(--muted);
  font-size: calc(10px * var(--ui-scale));
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav a:nth-child(2) .nav-glyph {
  background: var(--coral);
}

.nav a:nth-child(3) .nav-glyph {
  background: var(--mint);
}

.nav a:nth-child(4) .nav-glyph {
  background: var(--pink);
}

.nav-disabled .nav-glyph {
  background: var(--line-soft);
}

.nav a.active .nav-glyph,
.nav a:hover .nav-glyph {
  background: #fff;
}

.nav-folder-list {
  display: grid;
  gap: calc(5px * var(--ui-scale));
  margin: calc(-2px * var(--ui-scale)) 0 calc(8px * var(--ui-scale)) calc(35px * var(--ui-scale));
}

.nav-sublist {
  display: grid;
  gap: calc(4px * var(--ui-scale));
  margin: calc(-2px * var(--ui-scale)) 0 calc(8px * var(--ui-scale)) calc(35px * var(--ui-scale));
  padding-left: calc(7px * var(--ui-scale));
  border-left: 2px solid rgba(20, 33, 42, 0.16);
}

.nav-subitem {
  display: flex;
  min-height: calc(30px * var(--ui-scale));
  align-items: center;
  border: 2px solid transparent;
  border-radius: 13px;
  padding: calc(5px * var(--ui-scale)) calc(9px * var(--ui-scale));
  color: var(--ink);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 850;
  text-decoration: none;
}

.nav-subitem:hover,
.nav-subitem.active {
  border-color: var(--line);
  background: var(--paper-blue);
  text-decoration: none;
}

.nav-folder-item {
  display: flex;
  min-height: calc(32px * var(--ui-scale));
  align-items: center;
  justify-content: space-between;
  gap: calc(8px * var(--ui-scale));
  border: 2px solid transparent;
  border-radius: 14px;
  padding: calc(5px * var(--ui-scale)) calc(9px * var(--ui-scale));
  color: var(--ink);
  font-size: calc(13px * var(--ui-scale));
  font-weight: 800;
  text-decoration: none;
}

.nav-folder-item:hover,
.nav-folder-item.active {
  border-color: var(--line);
  background: var(--paper-blue);
  text-decoration: none;
}

.nav-folder-item.active .count {
  color: var(--muted);
}

.nav-folder-item .unread[hidden] {
  display: none;
}

.nav-folder-list.drag-active .nav-folder-item {
  border-color: rgba(20, 33, 42, 0.32);
}

.nav-folder-item.drag-over {
  border-color: var(--line);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.18);
  text-decoration: none;
}

.rail-tool-row {
  display: grid;
  grid-template-columns: calc(48px * var(--ui-scale)) calc(48px * var(--ui-scale));
  gap: calc(10px * var(--ui-scale));
  align-items: end;
}

.menu-wrap {
  position: relative;
  min-width: 0;
}

.account-menu {
  grid-column: 1;
}

.system-menu {
  grid-column: 2;
}

.account-button,
.icon-button {
  min-height: calc(46px * var(--ui-scale));
  border: 2px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #e0f2fe, #fffefa);
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.14);
}

.account-button {
  width: calc(48px * var(--ui-scale));
  justify-content: center;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  text-transform: none;
}

.account-button:hover,
.account-button:focus-visible,
.account-button.active,
.account-button[aria-expanded="true"] {
  background: transparent;
  box-shadow: none;
}

.account-button:focus-visible {
  outline: 2px solid var(--ocean);
  outline-offset: 4px;
}

.account-button.active .avatar,
.account-button[aria-expanded="true"] .avatar {
  outline: 2px solid var(--ocean);
  outline-offset: 2px;
}

.icon-button {
  width: calc(48px * var(--ui-scale));
  padding: 0;
}

.gear-button {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.gear-button:hover,
.gear-button:focus-visible,
.gear-button[aria-expanded="true"] {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.gear-button:focus-visible {
  outline: 2px solid var(--ocean);
  outline-offset: 4px;
}

.account-button .avatar {
  width: calc(34px * var(--ui-scale));
  height: calc(34px * var(--ui-scale));
}

.account-mini {
  display: block;
  min-width: 0;
  text-align: left;
}

.account-mini strong,
.account-mini .account-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mini strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.1;
}

.gear-icon,
.theme-icon {
  position: relative;
  width: calc(21px * var(--ui-scale));
  height: calc(21px * var(--ui-scale));
}

.gear-icon {
  display: grid;
  place-items: center;
}

.gear-icon svg {
  grid-area: 1 / 1;
  width: calc(23px * var(--ui-scale));
  height: calc(23px * var(--ui-scale));
  fill: currentColor;
}

.gear-icon-hover {
  display: none;
}

.gear-button:hover .gear-icon-normal,
.gear-button:focus-visible .gear-icon-normal,
.gear-button[aria-expanded="true"] .gear-icon-normal {
  display: none;
}

.gear-button:hover .gear-icon-hover,
.gear-button:focus-visible .gear-icon-hover,
.gear-button[aria-expanded="true"] .gear-icon-hover {
  display: block;
}

.theme-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-icon::before {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  content: "";
}

html[data-color-mode="dark"] .theme-icon::before {
  inset: 4px;
  width: auto;
  height: auto;
  background: currentColor;
  box-shadow: 0 -8px 0 -5px currentColor, 0 8px 0 -5px currentColor, -8px 0 0 -5px currentColor, 8px 0 0 -5px currentColor;
}

.popover-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 20;
  display: grid;
  width: max-content;
  min-width: calc(230px * var(--ui-scale));
  max-width: min(330px, calc(100vw - 40px));
  gap: calc(4px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale));
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-hard);
}

.popover-menu[hidden] {
  display: none;
}

.system-popover {
  right: 0;
  left: auto;
}

.popover-menu a,
.menu-heading {
  border-radius: 13px;
  padding: calc(9px * var(--ui-scale)) calc(11px * var(--ui-scale));
}

.popover-menu a {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.popover-menu a:hover,
.popover-menu a:focus-visible {
  background: var(--paper-blue);
}

.menu-heading {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.main {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.content {
  min-height: 0;
  max-width: none;
  margin: 0;
  padding-top: 0;
  overflow: auto;
}

.content:has(.mail-workspace) {
  overflow: hidden;
}

.mail-workspace {
  --mail-list-width: clamp(calc(330px * var(--ui-scale)), 36vw, calc(520px * var(--ui-scale)));
  display: grid;
  width: 100%;
  grid-template-columns: minmax(calc(280px * var(--ui-scale)), var(--mail-list-width)) calc(12px * var(--ui-scale)) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  gap: calc(8px * var(--ui-scale));
  align-items: stretch;
}

.mail-resizer {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
  border-radius: 999px;
  cursor: col-resize;
  touch-action: none;
}

.mail-resizer::before {
  content: none;
}

.mail-resizer:hover::before,
.mail-resizer:focus-visible::before,
.mail-workspace.resizing .mail-resizer::before {
  content: none;
}

.mail-resizer:focus-visible {
  outline: 2px solid var(--ocean);
  outline-offset: 3px;
}

.mail-workspace.resizing {
  user-select: none;
}

.message-list-pane,
.reading-pane {
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: var(--panel-radius);
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--shadow-hard);
}

.message-list-pane,
.reading-pane,
.folder-pane {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.folder-pane {
  position: static;
}

.pane-title,
.eyebrow {
  margin: 0 0 10px;
  color: var(--ocean-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.list-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: calc(10px * var(--ui-scale));
  padding: calc(14px * var(--ui-scale)) calc(14px * var(--ui-scale)) 0;
}

.list-head h2 {
  margin: 0;
  font: 900 calc(26px * var(--ui-scale)) "Arial Black", Impact, Inter, system-ui, sans-serif;
  text-transform: uppercase;
}

.list-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: calc(8px * var(--ui-scale));
}

.compose-header-button {
  min-height: calc(34px * var(--ui-scale));
  padding: calc(6px * var(--ui-scale)) calc(12px * var(--ui-scale));
  font-size: calc(12px * var(--ui-scale));
}

.search-row {
  display: flex;
  min-width: 0;
  gap: calc(8px * var(--ui-scale));
  padding: calc(14px * var(--ui-scale));
  border-bottom: 2px solid var(--line);
  background: linear-gradient(90deg, #fffefa, #e0f2fe);
}

.search-row input {
  min-width: 0;
  flex: 1 1 auto;
}

.search-row button {
  flex: 0 0 auto;
}

.mail-list {
  display: grid;
  align-content: start;
  min-height: 0;
  gap: calc(10px * var(--ui-scale));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(14px * var(--ui-scale));
}

.mail-list-loader {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
}

.message-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: calc(4px * var(--ui-scale)) calc(10px * var(--ui-scale));
  padding: calc(13px * var(--ui-scale)) calc(14px * var(--ui-scale));
  border: 2px solid var(--line);
  border-radius: calc(20px * var(--ui-scale));
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.12);
}

.message-card-row[draggable="true"] {
  cursor: grab;
}

.message-card-row.dragging,
.message-card-row.moving {
  opacity: 0.58;
  cursor: grabbing;
}

.message-card-row:hover {
  transform: translate(-1px, -1px);
  background: var(--paper-warm);
  box-shadow: 5px 5px 0 rgba(18, 32, 42, 0.16);
  text-decoration: none;
}

.message-card-row.active {
  background: var(--paper-blue);
  box-shadow: inset 7px 0 0 var(--ocean), 3px 3px 0 rgba(18, 32, 42, 0.14);
}

.message-card-row.keyboard-active:not(.active) {
  background: var(--paper-warm);
  box-shadow: inset 7px 0 0 var(--yellow), 3px 3px 0 rgba(18, 32, 42, 0.14);
}

.message-card-row:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.3);
  outline-offset: 2px;
}

.message-card-row.unseen {
  background: var(--paper-blue);
}

.message-card-row.unseen .subject-text {
  font-weight: 900;
}

.message-card-row.label-priority-1 {
  --label-row-bg: #ffe5e2;
  --label-row-bg-hover: #ffd2cc;
  --label-row-color: #cc1f1a;
  background: var(--label-row-bg);
  border-color: color-mix(in srgb, var(--label-row-color) 68%, var(--line));
  box-shadow: inset 7px 0 0 var(--label-row-color), 3px 3px 0 rgba(18, 32, 42, 0.12);
}

.message-card-row.label-priority-2 {
  --label-row-bg: #ffedcf;
  --label-row-bg-hover: #ffdfaa;
  --label-row-color: #c76b00;
  background: var(--label-row-bg);
  border-color: color-mix(in srgb, var(--label-row-color) 68%, var(--line));
  box-shadow: inset 7px 0 0 var(--label-row-color), 3px 3px 0 rgba(18, 32, 42, 0.12);
}

.message-card-row.label-priority-3 {
  --label-row-bg: #ddf5e7;
  --label-row-bg-hover: #c5edda;
  --label-row-color: #12813f;
  background: var(--label-row-bg);
  border-color: color-mix(in srgb, var(--label-row-color) 68%, var(--line));
  box-shadow: inset 7px 0 0 var(--label-row-color), 3px 3px 0 rgba(18, 32, 42, 0.12);
}

.message-card-row.label-priority-4 {
  --label-row-bg: #e0e9ff;
  --label-row-bg-hover: #ccd9ff;
  --label-row-color: #2459d1;
  background: var(--label-row-bg);
  border-color: color-mix(in srgb, var(--label-row-color) 68%, var(--line));
  box-shadow: inset 7px 0 0 var(--label-row-color), 3px 3px 0 rgba(18, 32, 42, 0.12);
}

.message-card-row.label-priority-5 {
  --label-row-bg: #f0e2fb;
  --label-row-bg-hover: #e6d0f8;
  --label-row-color: #7d32b3;
  background: var(--label-row-bg);
  border-color: color-mix(in srgb, var(--label-row-color) 68%, var(--line));
  box-shadow: inset 7px 0 0 var(--label-row-color), 3px 3px 0 rgba(18, 32, 42, 0.12);
}

.message-card-row[class*="label-priority-"]:hover,
.message-card-row[class*="label-priority-"].keyboard-active:not(.active),
.message-card-row[class*="label-priority-"].active {
  background: var(--label-row-bg-hover);
}

.message-card-row[class*="label-priority-"]:hover {
  box-shadow: inset 7px 0 0 var(--label-row-color), 5px 5px 0 rgba(18, 32, 42, 0.16);
}

.message-card-row[class*="label-priority-"].active {
  box-shadow: inset 7px 0 0 var(--label-row-color), 3px 3px 0 rgba(18, 32, 42, 0.14);
}

.row-kicker {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: calc(5px * var(--ui-scale));
  min-width: 0;
  color: var(--muted);
  font-size: calc(12px * var(--ui-scale));
  text-align: right;
  white-space: nowrap;
}

.subject-text {
  grid-column: 1 / -1;
}

.preview {
  grid-column: 1 / -1;
}

.message-labels {
  display: flex;
  flex-wrap: wrap;
  gap: calc(5px * var(--ui-scale));
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.label-chip {
  display: inline-flex;
  align-items: center;
  min-height: calc(20px * var(--ui-scale));
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: calc(2px * var(--ui-scale)) calc(7px * var(--ui-scale));
  background: color-mix(in srgb, currentColor 12%, #fff);
  font-size: calc(11px * var(--ui-scale));
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.label-dot {
  display: inline-block;
  width: calc(8px * var(--ui-scale));
  height: calc(8px * var(--ui-scale));
  border: 1px solid rgba(18, 32, 42, 0.22);
  border-radius: 50%;
  background: currentColor;
  font-size: 0;
  line-height: 0;
}

.label-1 {
  color: #cc1f1a;
}

.label-2 {
  color: #c76b00;
}

.label-3 {
  color: #12813f;
}

.label-4 {
  color: #2459d1;
}

.label-5 {
  color: #7d32b3;
}

.reading-pane {
  padding: calc(24px * var(--ui-scale));
  overflow-y: auto;
}

.empty-reading {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-state {
  max-width: 340px;
}

.empty-mark {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 rgba(18, 32, 42, 0.16);
  font: 900 18px "Arial Black", Impact, sans-serif;
}

.message-head {
  padding-bottom: calc(16px * var(--ui-scale));
  border-bottom: 2px solid var(--line);
}

.back-link {
  display: none;
  margin-bottom: 12px;
}

.message-head h2 {
  margin: 0 0 calc(16px * var(--ui-scale));
  font-size: calc(26px * var(--ui-scale));
}

.message-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.message-meta > div,
.message-header-basic > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-meta > div > strong,
.message-meta > div > span,
.message-header-basic strong,
.message-header-basic > span > span {
  display: block;
}

.message-meta strong,
.message-header-basic strong {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-header-details {
  display: block;
}

.message-header-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.message-header-summary::-webkit-details-marker {
  display: none;
}

.message-header-summary:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.24);
  outline-offset: 4px;
  border-radius: 14px;
}

.message-header-basic {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.header-toggle-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
}

.header-icon {
  width: 28px;
  height: 28px;
  display: none;
  fill: currentColor;
}

.message-header-details:not([open]) .header-icon-closed,
.message-header-details:not([open]) .message-header-summary:hover .header-icon-closed-hover,
.message-header-details[open] .header-icon-open,
.message-header-details[open] .message-header-summary:hover .header-icon-open-hover {
  display: block;
}

.message-header-details:not([open]) .message-header-summary:hover .header-icon-closed,
.message-header-details[open] .message-header-summary:hover .header-icon-open {
  display: none;
}

.message-header-raw {
  max-height: 320px;
  margin: 14px 0 0;
}

.message-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(14px * var(--ui-scale));
  margin: calc(16px * var(--ui-scale)) 0 calc(18px * var(--ui-scale));
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(10px * var(--ui-scale));
  min-width: 0;
}

.message-actions form {
  display: flex;
  gap: calc(8px * var(--ui-scale));
}

.message-actions select {
  min-width: 150px;
}

.star-toggle-button {
  width: var(--control-min);
  min-width: var(--control-min);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.star-toggle-button.is-flagged {
  background: transparent;
  color: rgb(255, 212, 59);
}

.star-toggle-button:hover,
.star-toggle-button:focus-visible {
  background: transparent;
  box-shadow: none;
}

.star-toggle-icon {
  width: calc(23px * var(--ui-scale));
  height: calc(23px * var(--ui-scale));
  display: block;
  fill: currentColor;
}

.star-toggle-hover {
  display: none;
}

.star-toggle-button:hover .star-toggle-normal,
.star-toggle-button:focus-visible .star-toggle-normal {
  display: none;
}

.star-toggle-button:hover .star-toggle-hover,
.star-toggle-button:focus-visible .star-toggle-hover {
  display: block;
}

.label-menu-wrap {
  align-self: center;
}

.label-menu-wrap .label-popover {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  min-width: calc(210px * var(--ui-scale));
}

.bookmark-label-button {
  width: var(--control-min);
  min-width: var(--control-min);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.bookmark-label-button.label-priority-1 {
  color: #cc1f1a;
}

.bookmark-label-button.label-priority-2 {
  color: #c76b00;
}

.bookmark-label-button.label-priority-3 {
  color: #12813f;
}

.bookmark-label-button.label-priority-4 {
  color: #2459d1;
}

.bookmark-label-button.label-priority-5 {
  color: #7d32b3;
}

.bookmark-label-button:hover,
.bookmark-label-button:focus-visible,
.bookmark-label-button[aria-expanded="true"] {
  background: transparent;
  color: rgb(255, 212, 59);
  box-shadow: none;
  transform: none;
}

.bookmark-label-button.label-priority-1:hover,
.bookmark-label-button.label-priority-1:focus-visible,
.bookmark-label-button.label-priority-1[aria-expanded="true"] {
  color: #cc1f1a;
}

.bookmark-label-button.label-priority-2:hover,
.bookmark-label-button.label-priority-2:focus-visible,
.bookmark-label-button.label-priority-2[aria-expanded="true"] {
  color: #c76b00;
}

.bookmark-label-button.label-priority-3:hover,
.bookmark-label-button.label-priority-3:focus-visible,
.bookmark-label-button.label-priority-3[aria-expanded="true"] {
  color: #12813f;
}

.bookmark-label-button.label-priority-4:hover,
.bookmark-label-button.label-priority-4:focus-visible,
.bookmark-label-button.label-priority-4[aria-expanded="true"] {
  color: #2459d1;
}

.bookmark-label-button.label-priority-5:hover,
.bookmark-label-button.label-priority-5:focus-visible,
.bookmark-label-button.label-priority-5[aria-expanded="true"] {
  color: #7d32b3;
}

.bookmark-label-icon {
  width: calc(23px * var(--ui-scale));
  height: calc(23px * var(--ui-scale));
  display: block;
}

.bookmark-label-icon path {
  fill: currentColor;
}

.bookmark-label-hover {
  display: none;
}

.bookmark-label-button:hover .bookmark-label-normal,
.bookmark-label-button:focus-visible .bookmark-label-normal,
.bookmark-label-button[aria-expanded="true"] .bookmark-label-normal {
  display: none;
}

.bookmark-label-button:hover .bookmark-label-hover,
.bookmark-label-button:focus-visible .bookmark-label-hover,
.bookmark-label-button[aria-expanded="true"] .bookmark-label-hover {
  display: block;
}

.label-menu-form {
  margin: 0;
}

.label-menu-item {
  width: 100%;
  min-height: calc(36px * var(--ui-scale));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: calc(9px * var(--ui-scale));
  align-items: center;
  justify-content: stretch;
  border: 0;
  border-radius: 13px;
  padding: calc(8px * var(--ui-scale)) calc(10px * var(--ui-scale));
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-weight: 850;
  text-align: left;
  text-transform: none;
}

.label-menu-item:hover,
.label-menu-item:focus-visible,
.label-menu-item.active {
  background: var(--paper-blue);
  box-shadow: none;
  transform: none;
}

.label-menu-item.active {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.label-menu-item .label-key {
  width: calc(18px * var(--ui-scale));
  height: calc(18px * var(--ui-scale));
  font-size: calc(10px * var(--ui-scale));
}

.label-actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(7px * var(--ui-scale));
  align-items: center;
}

.label-actions form {
  display: contents;
}

.label-button {
  min-height: calc(34px * var(--ui-scale));
  gap: calc(7px * var(--ui-scale));
  border-color: currentColor;
  padding: calc(6px * var(--ui-scale)) calc(10px * var(--ui-scale));
  background: #fff;
  box-shadow: 2px 2px 0 rgba(18, 32, 42, 0.12);
  color: var(--ink);
  font-size: calc(12px * var(--ui-scale));
  text-transform: none;
}

.label-button.label-1 {
  color: #cc1f1a;
}

.label-button.label-2 {
  color: #c76b00;
}

.label-button.label-3 {
  color: #12813f;
}

.label-button.label-4 {
  color: #2459d1;
}

.label-button.label-5 {
  color: #7d32b3;
}

.label-button.active {
  background: color-mix(in srgb, currentColor 18%, #fff);
}

.label-key {
  display: grid;
  width: calc(20px * var(--ui-scale));
  height: calc(20px * var(--ui-scale));
  place-items: center;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: calc(11px * var(--ui-scale));
  font-weight: 950;
}

.message-media-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-left: auto;
}

.load-external-button {
  display: inline-flex;
  align-items: center;
  gap: calc(8px * var(--ui-scale));
  white-space: nowrap;
}

.external-media-icon {
  display: block;
  width: calc(22px * var(--ui-scale));
  height: calc(22px * var(--ui-scale));
  flex: 0 0 auto;
}

html[data-color-mode="dark"] {
  color-scheme: dark;
  --ink: #f6f7fb;
  --ink-soft: #d9e0e5;
  --muted: #9ba9b2;
  --line: #e8f0f4;
  --line-soft: #26323a;
  --paper: #142029;
  --paper-blue: #173247;
  --paper-rose: #3a1e31;
  --paper-warm: #35291c;
  --shadow-hard: 7px 7px 0 rgba(0, 0, 0, 0.32);
}

html[data-color-mode="dark"] body {
  background:
    linear-gradient(125deg, #07131b 0%, #121b20 38%, #201322 72%, #21170f 100%);
}

html[data-color-mode="dark"] .rail,
html[data-color-mode="dark"] .folder-pane,
html[data-color-mode="dark"] .surface,
html[data-color-mode="dark"] .message-card,
html[data-color-mode="dark"] .side-panel,
html[data-color-mode="dark"] .settings-section,
html[data-color-mode="dark"] .compose,
html[data-color-mode="dark"] .metric,
html[data-color-mode="dark"] .login-panel,
html[data-color-mode="dark"] .message-list-pane,
html[data-color-mode="dark"] .reading-pane,
html[data-color-mode="dark"] .popover-menu {
  background: rgba(20, 32, 41, 0.96);
}

html[data-color-mode="dark"] input,
html[data-color-mode="dark"] textarea,
html[data-color-mode="dark"] select,
html[data-color-mode="dark"] .message-card-row,
html[data-color-mode="dark"] .html-body,
html[data-color-mode="dark"] .pre {
  color: var(--ink);
  background: #101a22;
}

html[data-color-mode="dark"] .brand-copy strong,
html[data-color-mode="dark"] .account-mini strong,
html[data-color-mode="dark"] .nav a,
html[data-color-mode="dark"] .nav-disabled,
html[data-color-mode="dark"] .folder-item,
html[data-color-mode="dark"] .message-card-row {
  color: var(--ink);
}

html[data-color-mode="dark"] .message-card-row[class*="label-priority-"] {
  background: color-mix(in srgb, var(--label-row-color) 24%, #101a22);
  border-color: color-mix(in srgb, var(--label-row-color) 70%, var(--line));
}

html[data-color-mode="dark"] .message-card-row[class*="label-priority-"]:hover,
html[data-color-mode="dark"] .message-card-row[class*="label-priority-"].keyboard-active:not(.active),
html[data-color-mode="dark"] .message-card-row[class*="label-priority-"].active {
  background: color-mix(in srgb, var(--label-row-color) 34%, #101a22);
}

html[data-color-mode="dark"] .account-button,
html[data-color-mode="dark"] .icon-button {
  background: #101a22;
  color: var(--ink);
}

html[data-color-mode="dark"] .account-button,
html[data-color-mode="dark"] .account-button:hover,
html[data-color-mode="dark"] .account-button:focus-visible,
html[data-color-mode="dark"] .account-button.active,
html[data-color-mode="dark"] .account-button[aria-expanded="true"] {
  background: transparent;
}

html[data-color-mode="dark"] .gear-button,
html[data-color-mode="dark"] .gear-button:hover,
html[data-color-mode="dark"] .gear-button:focus-visible,
html[data-color-mode="dark"] .gear-button[aria-expanded="true"] {
  background: transparent;
}

html[data-color-mode="dark"] .account-mini .account-email {
  color: var(--ink-soft);
}

html[data-color-mode="dark"] .theme-icon::before {
  background: currentColor;
}

@media (max-width: 1280px) {
  .mail-workspace {
    --mail-list-width: clamp(300px, 35vw, 440px);
  }
}

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

  .mail-workspace {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    height: auto;
    min-height: auto;
  }

  .mail-resizer {
    display: none;
  }

  .reading-pane {
    grid-column: 1 / -1;
    min-height: 420px;
  }

  .message-meta,
  .message-header-basic {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .brand-copy,
  .nav a span:last-child,
  .nav-disabled span:last-child,
  .nav-folder-list,
  .nav-sublist {
    display: none;
  }

  .mail-workspace {
    grid-template-columns: 1fr;
  }

  .folder-list {
    flex-direction: row;
    overflow-x: auto;
  }

  .search-row,
  .message-toolbar,
  .message-actions,
  .message-actions form {
    align-items: stretch;
    flex-direction: column;
  }

  .message-media-actions {
    width: 100%;
  }

  .load-external-button {
    justify-content: center;
  }

  .back-link {
    display: inline-flex;
  }
}
