@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Raleway:wght@700;800&display=swap");

:root {
  color-scheme: light;
  --background: #fbfaf9;
  --foreground: #24211f;
  --card: #ffffff;
  --card-foreground: #24211f;
  --muted: #f1eeeb;
  --muted-foreground: #786f68;
  --border: #ded8d2;
  --input: #e8e2dc;
  --primary: #db2777;
  --primary-foreground: #fff7fb;
  --primary-hover: #be185d;
  --secondary: #f6f2ef;
  --secondary-foreground: #312c28;
  --accent: #fff1f6;
  --accent-foreground: #9d174d;
  --warning: #f59e0b;
  --warning-soft: #fff7e6;
  --danger: #b42318;
  --ring: #f472b6;
  --radius: 6px;
  --sidebar-width: 264px;
  --sidebar-collapsed: 74px;
  font-family: Outfit, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgb(255 241 246 / 54%), transparent 320px),
    var(--background);
  color: var(--foreground);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--foreground);
  font-family: Raleway, Outfit, sans-serif;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 800;
}

.brand-menu {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: var(--radius);
  padding: 0;
  background: var(--primary);
  color: var(--primary-foreground);
}

.brand-text,
.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: rgb(255 255 255 / 88%);
  backdrop-filter: blur(18px);
  transition:
    width 180ms ease,
    transform 180ms ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 4px 10px;
  color: var(--muted-foreground);
  font-weight: 700;
  text-decoration: none;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hamburger-button {
  gap: 5px;
  flex-direction: column;
}

.hamburger-button span {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 2.5px;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.sidebar-account {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.sidebar-account div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-account strong,
.sidebar-account span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account span {
  color: var(--muted-foreground);
  font-size: 13px;
}

.shell-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.shell-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  background: rgb(251 250 249 / 78%);
  backdrop-filter: blur(18px);
}

.topbar-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.topbar-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Raleway, Outfit, sans-serif;
  font-size: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.crumb {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

body[data-sidebar-collapsed="true"] .app-shell {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

body[data-sidebar-collapsed="true"] .brand-text,
body[data-sidebar-collapsed="true"] .nav-label,
body[data-sidebar-collapsed="true"] .sidebar-account div,
body[data-sidebar-collapsed="true"] .sidebar-account button {
  display: none;
}

body[data-sidebar-collapsed="true"] .brand {
  display: none;
}

body[data-sidebar-collapsed="true"] .sidebar-head {
  justify-content: center;
  padding-inline: 0;
}

body[data-sidebar-collapsed="true"] .sidebar-head,
body[data-sidebar-collapsed="true"] .sidebar-nav {
  place-items: center;
}

body[data-sidebar-collapsed="true"] .sidebar-nav a {
  justify-content: center;
  min-width: 44px;
  width: 44px;
  padding: 4px;
}

.sidebar-scrim {
  display: none;
}

.mobile-menu {
  display: none;
}

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.app-page {
  width: auto;
  display: grid;
  height: calc(100vh - 66px);
  min-height: 0;
  margin: 0;
  padding: 28px;
  overflow: hidden;
}

.admin-page {
  padding: 0;
  overflow: hidden;
}

.mail-workspace {
  padding: 0;
}

.auth-panel {
  width: min(460px, 100%);
  margin: 80px auto;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 18px 54px rgb(36 33 31 / 8%);
}

.auth-panel h1,
.section-head h1 {
  margin: 0 0 8px;
  font-family: Raleway, Outfit, sans-serif;
  font-size: 28px;
  letter-spacing: 0;
}

.auth-panel p,
.section-head p {
  margin: 0;
  color: var(--muted-foreground);
}

.auth-panel form {
  margin-top: 20px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fff;
  color: var(--foreground);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgb(244 114 182 / 22%);
  outline: none;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  border-color: var(--border);
  background: var(--card);
  color: var(--secondary-foreground);
}

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

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

.status {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

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

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 178px minmax(250px, 330px) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--card);
}

.admin-sections {
  padding: 18px 12px;
  border-right: 1px solid var(--border);
  background: var(--secondary);
}

.admin-sections a {
  display: block;
  margin-bottom: 3px;
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--muted-foreground);
  font-weight: 700;
  text-decoration: none;
}

.admin-sections a.active,
.admin-sections a:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.admin-objects {
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--border);
}

.workspace-column-head,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.workspace-column-head h1,
.detail-head h1,
.detail-empty h1 {
  margin: 2px 0 3px;
  font-family: Raleway, Outfit, sans-serif;
  font-size: 24px;
}

.column-kicker {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.object-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.object-list { display: grid; }
.object-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
  text-decoration: none;
}
.object-link:hover,
.object-link.active { background: var(--accent); }
.object-avatar,
.address-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--muted);
  color: var(--primary);
  font-weight: 800;
}
.object-link.active .object-avatar { background: var(--primary); color: white; }
.object-copy { display: grid; min-width: 0; gap: 2px; }
.object-copy strong,
.object-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-copy span { color: var(--muted-foreground); font-size: 12px; }
.status-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #37a169; }
.status-dot.pending { background: var(--warning); }
.empty-object { padding: 22px 16px; color: var(--muted-foreground); font-size: 13px; }

.admin-detail { min-width: 0; overflow: auto; background: var(--background); }
.detail-head { align-items: center; background: rgb(255 255 255 / 70%); }
.detail-head p { margin: 0; color: var(--muted-foreground); }
.settings-section { margin: 22px 26px 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: 0 12px 38px rgb(36 33 31 / 5%); }
.settings-section-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.settings-section h2 { margin: 0 0 5px; font-family: Raleway, Outfit, sans-serif; font-size: 17px; }
.settings-section p { margin: 0; color: var(--muted-foreground); font-size: 13px; }
.address-list { display: grid; gap: 8px; }
.address-row { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.address-row > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.address-row small { color: var(--muted-foreground); }
.address-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.address-actions form { margin: 0; }
.address-primary { color: var(--accent-foreground); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.link-button { min-height: auto; border: 0; padding: 0; background: transparent; color: var(--accent-foreground); font-size: 12px; font-weight: 800; }
.link-button:hover { background: transparent; color: var(--primary-hover); text-decoration: underline; }
.danger-link { color: var(--danger); }
.danger-link:hover { color: #8f1c13; }
.settings-form-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.settings-form-grid label { margin-bottom: 14px; }
.mailbox-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
.mailbox-info div,
.mailbox-info form { display: grid; gap: 5px; margin: 0; }
.mailbox-info span { color: var(--muted-foreground); font-size: 12px; }
.mailbox-info .link-button { justify-content: flex-start; }
.capitalize { text-transform: capitalize; }
.detail-empty { padding: 40px 28px; }
.detail-empty p { color: var(--muted-foreground); }
.admin-dialog { width: min(520px, calc(100vw - 28px)); }
.mailbox-input { display: flex; align-items: center; min-height: 40px; border: 1px solid var(--input); border-radius: var(--radius); background: white; }
.mailbox-input input { min-width: 0; border: 0; box-shadow: none; }
.mailbox-input span { padding-right: 10px; color: var(--muted-foreground); white-space: nowrap; }

.panel,
.table-wrap,
.mail-shell,
.message-view,
.compose {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 12px 38px rgb(36 33 31 / 6%);
}

.panel {
  padding: 18px;
}

.panel h2,
.compose h2 {
  margin: 0;
  font-family: Raleway, Outfit, sans-serif;
  font-size: 18px;
  letter-spacing: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--secondary);
  color: var(--muted-foreground);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 12px;
  font-weight: 700;
}

.badge.warning {
  background: var(--warning-soft);
  color: #8a5200;
}

.inline-form {
  display: inline;
}

.mail-shell {
  display: grid;
  grid-template-columns: 180px minmax(300px, 390px) minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.folders {
  border-right: 1px solid var(--border);
  background: var(--secondary);
  padding: 12px;
}

.folders a {
  display: flex;
  justify-content: space-between;
  border-radius: var(--radius);
  padding: 10px;
  color: var(--muted-foreground);
  font-weight: 700;
  text-decoration: none;
  text-transform: capitalize;
}

.folders a.active,
.folders a:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.message-list {
  border-right: 1px solid var(--border);
  overflow: auto;
}

.message-link {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.message-link.active,
.message-link:hover {
  background: var(--secondary);
}

.message-link strong {
  font-size: 14px;
}

.message-link span {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-view {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 18px;
  overflow: auto;
}

.message-meta {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 13px;
}

.message-meta h1 {
  margin: 0 0 8px;
  color: var(--foreground);
  font-family: Raleway, Outfit, sans-serif;
  font-size: 22px;
}

.message-body {
  margin: 18px 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compose-dialog {
  width: min(980px, calc(100vw - 44px));
  max-height: min(840px, calc(100vh - 44px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--card);
  box-shadow: 0 22px 80px rgb(36 33 31 / 24%);
}

.compose-dialog::backdrop {
  background: rgb(36 33 31 / 44%);
}

.compose {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 24px 28px 22px;
  background: var(--card);
}

.compose-head,
.compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compose-head {
  margin-bottom: 20px;
}

.compose-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.compose-head-actions { display: flex; gap: 8px; }

.compose-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 18px;
}

.compose-fields label { margin-bottom: 12px; }
.compose-fields label > span { color: var(--muted-foreground); font-size: 12px; }
.compose-fields .subject-field { grid-column: 1 / -1; }

.editor-wrap {
  margin: 4px 0 16px;
  overflow: hidden;
  border: 1px solid var(--input);
  border-radius: var(--radius);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--input);
  background: var(--secondary);
}

.toolbar-button {
  min-width: 32px;
  min-height: 32px;
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--muted-foreground);
}
.toolbar-button:hover { background: var(--card); color: var(--foreground); }
.toolbar-divider { width: 1px; height: 22px; margin: 0 5px; background: var(--border); }
.rich-editor {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  padding: 18px;
  line-height: 1.6;
  outline: none;
}
.rich-editor:empty::before { content: attr(data-placeholder); color: #a69c94; pointer-events: none; }
.rich-editor img { max-width: 100%; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; margin: -4px 0 16px; }
.attachment-list:empty { display: none; }
.attachment-list span { border-radius: 999px; padding: 5px 9px; background: var(--secondary); color: var(--muted-foreground); font-size: 12px; }
.send-button span { margin-left: 8px; opacity: .72; font-size: 11px; font-weight: 500; }
.form-hint { margin: 6px 0 16px; color: var(--muted-foreground); font-size: 13px; }

.compose-actions {
  justify-content: flex-start;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

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

@media (max-width: 1040px) {
  .mail-shell {
    grid-template-columns: 150px minmax(240px, 330px) minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  body[data-sidebar-collapsed="true"] .app-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    width: min(300px, calc(100vw - 56px));
    transform: translateX(-105%);
    box-shadow: 18px 0 52px rgb(36 33 31 / 20%);
  }

  body[data-sidebar-open="true"] .sidebar {
    transform: translateX(0);
  }

  body[data-sidebar-open="true"] .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgb(36 33 31 / 44%);
  }

  body[data-sidebar-collapsed="true"] .brand-text,
  body[data-sidebar-collapsed="true"] .nav-label,
  body[data-sidebar-collapsed="true"] .sidebar-account div,
  body[data-sidebar-collapsed="true"] .sidebar-account button {
    display: initial;
  }

  body[data-sidebar-collapsed="true"] .brand {
    display: inline-flex;
  }

  body[data-sidebar-collapsed="true"] .sidebar-head {
    justify-content: flex-start;
    padding-inline: 16px;
  }

  body[data-sidebar-collapsed="true"] .sidebar-account div,
  body[data-sidebar-collapsed="true"] .sidebar-account button {
    display: grid;
  }

  body[data-sidebar-collapsed="true"] .sidebar-nav a {
    justify-content: flex-start;
    width: auto;
    padding: 4px 8px;
  }

  .sidebar-collapse {
    display: none;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .shell-topbar {
    padding: 0 14px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .page,
  .app-page {
    width: min(100% - 24px, 760px);
    margin-top: 16px;
    margin-bottom: 16px;
  }

  .app-page {
    width: 100%;
    height: calc(100vh - 66px);
    min-height: 0;
    margin: 0;
    padding: 16px 12px;
  }

  .mail-workspace {
    padding: 0;
  }

  .section-head,
  .admin-grid,
  .compose-grid {
    grid-template-columns: 1fr;
  }

  .compose-fields { grid-template-columns: 1fr; }
  .compose-fields .subject-field { grid-column: auto; }

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

  .admin-grid {
    display: grid;
  }

  .admin-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  .admin-sections {
    display: grid;
    align-content: start;
    gap: 8px;
    overflow: auto;
    border: 0;
    padding: 16px 12px;
    background: var(--background);
  }

  .admin-sections a { margin: 0; padding: 16px; border: 1px solid var(--border); background: var(--card); }
  .admin-sections a::after { content: "›"; float: right; font-size: 22px; line-height: 16px; }
  .admin-objects { border: 0; }
  .workspace-column-head { padding: 18px 16px 14px; }
  .detail-head { padding: 18px 16px; }
  .settings-section { margin-inline: 16px; }

  /* Mobile admin is a drill-down: category, then mailbox, then settings. */
  .admin-workspace.mobile-stage-sections .admin-objects,
  .admin-workspace.mobile-stage-sections .admin-detail,
  .admin-workspace.mobile-stage-objects .admin-sections,
  .admin-workspace.mobile-stage-objects .admin-detail,
  .admin-workspace.mobile-stage-detail .admin-sections,
  .admin-workspace.mobile-stage-detail .admin-objects {
    display: none;
  }

  .admin-workspace.mobile-stage-detail .admin-detail {
    display: block;
  }

  .admin-workspace.mobile-stage-objects .admin-objects {
    display: block;
  }

  .mail-shell {
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
  }

  .folders {
    display: grid;
    align-content: start;
    gap: 8px;
    overflow: auto;
    border: 0;
    padding: 16px 12px;
    background: var(--background);
  }

  .folders a {
    min-width: 0;
    border: 1px solid var(--border);
    padding: 16px;
    background: var(--card);
  }

  .folders a::after { content: "›"; margin-left: auto; font-size: 22px; line-height: 16px; }

  .message-list {
    max-height: none;
    border-right: 0;
    border-bottom: 0;
  }

  .mobile-list-head { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); }
  .mobile-list-head h1 { margin: 0; font-family: Raleway, Outfit, sans-serif; font-size: 24px; text-transform: capitalize; }
  .mail-shell.mobile-stage-folders .message-list,
  .mail-shell.mobile-stage-folders .message-view,
  .mail-shell.mobile-stage-messages .folders,
  .mail-shell.mobile-stage-messages .message-view,
  .mail-shell.mobile-stage-message .folders,
  .mail-shell.mobile-stage-message .message-list { display: none; }
  .mail-shell.mobile-stage-message .message-view,
  .mail-shell.mobile-stage-messages .message-list { display: block; }
  .mobile-back-link { display: inline-flex; margin-bottom: 18px; color: var(--accent-foreground); font-weight: 700; text-decoration: none; }
}

@media (max-width: 520px) {
  .auth-panel {
    margin-top: 32px;
    padding: 20px;
  }

  .compose-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .compose { padding: 20px 16px 16px; }

  .settings-form-grid,
  .mailbox-info { grid-template-columns: 1fr; }
  .settings-section { padding: 16px; }

  .message-view {
    padding: 14px;
  }
}

@media (min-width: 861px) {
  .mobile-back-link,
  .mobile-list-head { display: none; }
}
