@font-face {
  font-family: "Open Sans";
  src: url("./assets/OpenSans-Regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("./assets/OpenSans-Semibold.woff") format("woff");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("./assets/OpenSans-Bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif";
  src: url("./assets/NotoSerif-Bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --white: #fff;
  --ink: #141414;
  --muted: #625e67;
  --subtle: #f7f7f8;
  --border: #e9e6e9;
  --brand: #792134;
  --brand-dark: #611a29;
  --brand-soft: #fbf2f4;
  --brand-edge: #ead4db;
  --brand-pink: #ebc2c9;
  --shadow: 0 16px 42px #24151c1c, 0 2px 6px #24151c0a;
  --serif: "Noto Serif", Georgia, serif;
  font-family: "Open Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; min-width: 20rem; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
img, svg { display: block; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--white);
  color: var(--brand);
  border-radius: 0.5rem;
}

.mail-app {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 1rem;
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.brand-home {
  min-height: 4.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 0.25rem;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-home img { width: min(100%, 11.25rem); height: auto; }

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  background: var(--brand);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 140ms ease;
}

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

.compose-button {
  justify-content: flex-start;
  width: 100%;
  margin: 1rem 0 1.375rem;
  padding-left: 0.9rem;
}

.folder-nav { display: grid; gap: 0.25rem; }

.folder-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.65rem;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 0.5rem;
  text-align: left;
  background: transparent;
  color: #433e46;
  font-size: 0.875rem;
  font-weight: 600;
}

.folder-button > svg { flex: 0 0 auto; color: var(--muted); }
.folder-button:hover { background: var(--subtle); }

.folder-button[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.folder-button[aria-current="page"] > svg { color: var(--brand); }

.folder-count {
  display: grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.3rem;
  margin-left: auto;
  border-radius: 0.4rem;
  background: var(--subtle);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.folder-button[aria-current="page"] .folder-count {
  background: #f1dfe4;
  color: var(--brand);
}

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

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: min(100%, 30rem);
  min-width: 0;
  min-height: 2.65rem;
  padding: 0 0.7rem 0 0.8rem;
  border: 1px solid #eeecef;
  border-radius: 0.6rem;
  background: var(--subtle);
  color: var(--muted);
}

.search-box:focus-within {
  border-color: var(--brand-edge);
  outline: 1px solid var(--brand-edge);
  background: var(--white);
}

.search-box input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.875rem;
}

.search-box input::placeholder { color: var(--muted); }
.search-box input::-webkit-search-cancel-button { display: none; }

.search-box kbd {
  padding: 0.12rem 0.34rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: var(--white);
  color: var(--muted);
  font: 600 0.75rem/1.35 "Open Sans", system-ui, sans-serif;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
}

.icon-button:hover { color: var(--brand); background: var(--brand-soft); }
.icon-button > span { display: grid; place-items: center; }
.icon-button.is-starred { color: var(--brand); }
.icon-button.is-starred svg { fill: var(--brand-pink); }
.icon-button.clear-search { width: 1.75rem; height: 1.75rem; }

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.avatar.rose { background: #f2dce2; color: #792134; }
.avatar.blue { background: #e2eaf5; color: #2e4d76; }
.avatar.violet { background: #ece5f6; color: #5b3e80; }
.avatar.green { background: #e1efea; color: #315d4d; }
.avatar.stone { background: #ecebf0; color: #514c61; }
.account-avatar { background: var(--brand); color: var(--white); }

.account { position: relative; flex: 0 0 auto; }

.account-button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0 0.25rem 0.25rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  text-align: left;
}

.account-button:hover .account-chevron { color: var(--brand); }

.account-label { display: grid; gap: 0.12rem; line-height: 1.25; }
.account-label strong { font-size: 0.875rem; }
.account-label > span { color: var(--muted); font-size: 0.75rem; }
.account-chevron { margin-left: 0.25rem; color: var(--muted); }

.account-popover {
  position: absolute;
  z-index: 4;
  top: calc(100% + 0.65rem);
  right: 0;
  width: max-content;
  max-width: min(18rem, 90vw);
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.account-info {
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.account-info strong { font-size: 0.875rem; }
.account-info > span { color: var(--muted); font-size: 0.8125rem; }

.account-popover button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 600;
}

.account-popover button:hover { background: var(--brand-soft); }

.mail-layout {
  display: grid;
  grid-template-columns: clamp(20rem, 29vw, 27.5rem) minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.list-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
  outline: 0;
}

.folder-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0.65rem;
}

.folder-heading h1 {
  margin: 0;
  font: 700 clamp(1.75rem, 2.2vw, 2rem)/1.23 var(--serif);
  letter-spacing: -0.045em;
}

.folder-heading p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.list-filters {
  display: flex;
  flex: 0 0 auto;
  gap: 1.4rem;
  min-height: 2.65rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.filter-button {
  position: relative;
  padding: 0.55rem 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.filter-button:hover, .filter-button[aria-pressed="true"] { color: var(--brand); }

.filter-button[aria-pressed="true"]::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  content: "";
  background: var(--brand);
}

.message-list, .reading-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d7d1d6 transparent;
}

.message-list { flex: 1 1 auto; }

.message-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  align-items: start;
  min-width: 0;
  padding-right: 0.95rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.message-row:hover { background: var(--subtle); }
.message-row.is-active { background: var(--brand-soft); }

.message-row.is-active::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--brand);
}

.message-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  width: 100%;
  min-width: 0;
  min-height: 5.35rem;
  padding: 0.85rem 0.1rem 0.85rem 1.3rem;
  border: 0;
  background: transparent;
  text-align: left;
}

.message-open:focus-visible { outline-offset: -3px; }

.message-open .avatar { margin-top: 0.1rem; }
.message-summary { display: grid; gap: 0.18rem; min-width: 0; }
.message-meta { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.message-name, .message-subject, .message-preview { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message-name { color: #302b32; font-size: 0.875rem; font-weight: 600; }

.message-meta time {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.message-subject { color: var(--ink); font-size: 0.875rem; font-weight: 600; }
.message-preview { color: var(--muted); font-size: 0.8125rem; }
.message-row.is-unread .message-name, .message-row.is-unread .message-subject { font-weight: 700; }
.message-row.is-unread time { color: var(--brand); font-weight: 700; }

.unread-dot {
  flex: 0 0 auto;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--brand);
}

.row-end {
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  padding-top: 0.78rem;
  color: var(--muted);
}

.row-end .icon-button { width: 1.9rem; height: 1.9rem; }
.row-end .icon-button:not(.is-starred) { color: #746d77; }
.row-end .icon-button:not(.is-starred):hover { color: var(--brand); }

.reading-pane {
  display: grid;
  grid-template-rows: 3.65rem minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: var(--white);
}

.reading-toolbar {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  min-width: 0;
  padding: 0 1.3rem;
  border-bottom: 1px solid var(--border);
}

.tool-divider { align-self: center; width: 1px; height: 1.3rem; margin: 0 0.35rem; background: var(--border); }

.toolbar-label {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.toolbar-label:hover { color: var(--brand); background: var(--brand-soft); }

.reading-content {
  width: min(100%, 52rem);
  margin: 0 auto;
  padding: 2.25rem clamp(1.5rem, 3.6vw, 3.65rem) 2.75rem;
}

.reading-content h2 {
  margin: 0 0 1.45rem;
  overflow-wrap: anywhere;
  font: 700 clamp(1.6rem, 2.25vw, 2.1rem)/1.26 var(--serif);
  letter-spacing: -0.035em;
}

.sender-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: start;
  padding-bottom: 1.1rem;
  margin-bottom: 1.55rem;
  border-bottom: 1px solid var(--border);
}

.sender-bar > .avatar { width: 2.75rem; height: 2.75rem; font-size: 0.875rem; }

.sender-info { flex: 1 1 12rem; display: grid; min-width: 0; gap: 0.14rem; }
.sender-name { color: var(--ink); font-size: 0.95rem; line-height: 1.4; }
.sender-bar > time { margin-left: auto; padding-top: 0.18rem; color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }

.sender-details { position: relative; min-width: 0; color: var(--muted); }
.sender-details summary { display: flex; align-items: center; gap: 0.3rem; width: fit-content; max-width: 100%; list-style: none; cursor: pointer; font-size: 0.8125rem; }
.sender-details summary::-webkit-details-marker { display: none; }
.sender-details[open] summary svg { transform: rotate(180deg); }
.sender-details summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-details summary > svg { flex: 0 0 auto; }
.sender-details summary:hover { color: var(--brand); }

.sender-details dl {
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem 0.7rem;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.sender-details dt { font-weight: 700; }
.sender-details dd { margin: 0; }

.message-body { color: #252228; font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.message-body p { margin: 0 0 1rem; white-space: pre-wrap; }

.attachment-section { margin-top: 1.65rem; }
.attachment-section h3 { margin: 0 0 0.55rem; font-size: 0.875rem; font-weight: 700; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.attachment-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
  width: 18.5rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--white);
  color: var(--ink);
  text-align: left;
}

.attachment-card:hover { border-color: var(--brand-edge); background: var(--brand-soft); }
.attachment-card > svg { flex: 0 0 auto; margin-left: auto; color: var(--muted); }

.attachment-icon {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  border-radius: 0.45rem;
  color: var(--brand);
  background: var(--brand-soft);
}

.attachment-copy { display: grid; gap: 0.12rem; min-width: 0; }
.attachment-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; font-weight: 600; }
.attachment-copy > span { color: var(--muted); font-size: 0.75rem; }

.reply-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.55rem; }

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  color: #443d47;
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
}

.secondary-button:hover { border-color: var(--brand-edge); color: var(--brand); background: var(--brand-soft); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.empty-state p { margin: 0; font-size: 0.875rem; }
.empty-state img { width: 2.6rem; height: 2.6rem; }
.reader-empty { padding-top: 13vh; }

.mobile-nav, .mobile-compose, .mobile-back, .sidebar-scrim { display: none; }

.compose-dialog {
  position: fixed;
  inset: auto 1.5rem 1.4rem auto;
  width: min(36rem, calc(100vw - 3rem));
  max-width: none;
  max-height: calc(100dvh - 2.8rem);
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.compose-dialog::backdrop { background: #20182036; }

.compose-form { display: flex; flex-direction: column; min-height: 0; }
.compose-header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.2rem; border-bottom: 1px solid var(--border); }
.compose-header h2 { margin: 0; font: 700 1.25rem/1.25 var(--serif); letter-spacing: -0.025em; }
.compose-fields { display: flex; flex-direction: column; min-height: 0; padding: 0 1.2rem; }

.compose-fields > label:not(.sr-only) {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  align-items: center;
  min-height: 2.95rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.compose-fields label > span { color: var(--muted); font-weight: 600; }
.compose-fields input { width: 100%; min-width: 0; min-height: 2.25rem; padding: 0.3rem; border: 0; border-radius: 0.25rem; color: var(--ink); background: var(--white); }
.compose-fields input::placeholder { color: var(--muted); }
.compose-attachments { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.8rem; }
.compose-chip { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; max-width: 100%; padding: 0.15rem 0.25rem 0.15rem 0.55rem; border: 1px solid var(--border); border-radius: 0.4rem; background: var(--subtle); color: #443d47; font-size: 0.8125rem; }
.compose-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.compose-chip .icon-button { width: 1.5rem; height: 1.5rem; }

.compose-footer { display: flex; align-items: center; gap: 0.4rem; padding: 0.75rem 1.2rem; border-top: 1px solid var(--border); }
.compose-spacer { margin-left: auto; }

.toast {
  position: fixed;
  z-index: 5;
  inset: auto auto 1.3rem 15rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: calc(100vw - 16rem);
  min-height: 3rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
}

.toast-icon { color: var(--brand); }
.toast button { padding: 0.35rem 0.45rem; border: 0; border-radius: 0.35rem; color: var(--brand); background: var(--brand-soft); font-weight: 700; }

@media (max-width: 72rem) {
  .mail-app { grid-template-columns: 12.5rem minmax(0, 1fr); }
  .sidebar { padding-inline: 0.8rem; }
  .mail-layout { grid-template-columns: clamp(19rem, 31vw, 24rem) minmax(0, 1fr); }
  .topbar { padding-inline: 1.35rem; }
  .toast { left: 13.5rem; }
}

@media (max-width: 55rem) {
  .mail-app { grid-template-columns: minmax(0, 1fr); }
  .workspace { grid-template-rows: 4rem minmax(0, 1fr); }
  .topbar { justify-content: initial; gap: 0.65rem; padding-inline: 0.75rem; }
  .topbar .account { margin-left: auto; }
  .search-box { flex: 1; width: auto; max-width: 32rem; }

  .sidebar {
    position: fixed;
    z-index: 9;
    inset: 0 auto 0 0;
    width: min(16rem, 85vw);
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-100%);
    transition: transform 160ms ease, visibility 160ms;
  }

  .nav-open .sidebar { visibility: visible; pointer-events: auto; transform: translateX(0); }
  .nav-open .sidebar-scrim { display: block; position: fixed; z-index: 8; inset: 0; width: 100%; border: 0; background: #20182055; }
  .mobile-nav { display: inline-grid; }
  .mobile-compose { display: inline-grid; width: 2.75rem; padding: 0; }
  .mobile-back { display: inline-flex; }

  .mail-layout { grid-template-columns: minmax(0, 1fr); }
  .list-pane { border-right: 0; }
  .reading-pane { display: none; }
  .mail-layout.reading-open .list-pane { display: none; }
  .mail-layout.reading-open .reading-pane { display: grid; }
  .reading-toolbar { padding-inline: 0.7rem; }
  .reading-content { padding-inline: clamp(1.15rem, 5vw, 2.5rem); }
  .toast { left: 1rem; max-width: calc(100vw - 2rem); }
}

@media (max-width: 41rem) {
  .account-label, .account-chevron, .search-box kbd { display: none; }
  .account-button { padding: 0; }
  .search-box { padding-left: 0.6rem; }
  .search-box input, .compose-fields input { font-size: 1rem; }
  .folder-heading { padding-inline: 1.15rem; }
  .list-filters { padding-inline: 1.15rem; }
  .message-open { padding-left: 1.1rem; }
  .message-row { padding-right: 0.65rem; }
  .reading-content { padding-top: 1.5rem; }
  .sender-bar { gap: 0.45rem 0.7rem; }
  .sender-info { flex-basis: 8rem; }
  .sender-bar > time { white-space: normal; text-align: right; }
  .compose-dialog { inset: auto 0 0; width: 100%; max-height: calc(100dvh - 0.75rem); border-radius: 0.85rem 0.85rem 0 0; }
  .compose-footer { padding-bottom: max(0.75rem, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

.entrance {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.25rem, 5vw, 3rem);
  background: var(--white);
}

.login-panel {
  width: min(100%, 28rem);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--white);
  box-shadow: 0 12px 40px #24151c0b;
}

.login-logo { width: 11.25rem; max-width: 100%; margin-bottom: 2rem; }
.login-panel h1 { margin: 0; font: 700 2.15rem/1.2 var(--serif); letter-spacing: -0.035em; }
.login-intro { margin: 0.55rem 0 1.65rem; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
.login-form { display: grid; }
.login-form label { margin-bottom: 0.35rem; font-size: 0.875rem; font-weight: 700; }
.login-form > input { margin-bottom: 1rem; }

.login-form input {
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
}

.login-form input::placeholder { color: var(--muted); }
.password-field { position: relative; }
.password-field input { padding-right: 4.2rem; }
.password-toggle { position: absolute; inset: 0.27rem 0.33rem 0.27rem auto; border: 0; border-radius: 0.35rem; padding: 0 0.5rem; background: transparent; color: var(--brand); font-size: 0.8125rem; font-weight: 700; }
.password-toggle:hover { background: var(--brand-soft); }
.login-form > .primary-button { margin-top: 1.25rem; }
.primary-button:disabled { opacity: 0.65; }
.form-error { margin: 0.7rem 0 0; color: var(--brand); font-size: 0.875rem; line-height: 1.5; }
.compose-error { margin: 0.2rem 1.2rem 0.85rem; }
.session-progress { display: grid; place-items: center; gap: 0.75rem; color: var(--muted); }
.session-progress img { width: 3rem; height: 3rem; }
.session-progress p { margin: 0; font-size: 0.875rem; }
.heading-actions { display: flex; align-items: center; gap: 0.35rem; }
.heading-actions [aria-busy="true"] { opacity: 0.55; }
.list-page-actions { display: flex; justify-content: center; padding: 0.95rem 1rem; }
.reader-state { padding: 1.4rem 0; color: var(--muted); }
.reader-state p { margin: 0 0 0.75rem; font-size: 0.9375rem; }

.message-html-frame {
  display: block;
  width: 100%;
  height: 18rem;
  border: 0;
  background: var(--white);
}

.remote-image-action { margin-bottom: 1rem; }
.compose-from { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); align-items: center; min-height: 2.45rem; color: var(--muted); font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.compose-from > span { font-weight: 600; }
.compose-from > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.3rem; }

.format-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.format-button {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.05rem;
  border: 0;
  border-radius: 0.375rem;
  background: var(--white);
  color: var(--ink);
  font-size: 0.95rem;
}

.format-button:hover, .format-button[aria-pressed="true"], .format-button[aria-expanded="true"] { color: var(--brand); background: var(--brand-soft); }
.format-button > i { font-family: Georgia, serif; }
.link-editor { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; }
.link-editor > input { border: 1px solid var(--border); padding-left: 0.45rem; }

.compose-editor {
  display: block;
  min-height: 7rem;
  height: clamp(7rem, 27vh, 15.5rem);
  margin: 0.5rem 0;
  padding: 0.6rem 0.25rem;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.55;
}
.compose-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.compose-editor a { color: var(--brand); }
.compose-editor p { margin: 0 0 0.65rem; }
.compose-editor blockquote { margin: 0.5rem 0; padding-left: 0.8rem; border-left: 2px solid var(--border); color: var(--muted); }

.settings-dialog, .email-preview-dialog {
  width: min(36rem, calc(100vw - 1.5rem));
  max-width: none;
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.settings-dialog::backdrop, .email-preview-dialog::backdrop { background: #20182036; }
.settings-form { display: flex; flex-direction: column; max-height: inherit; }
.settings-fields { display: grid; gap: 0.5rem; overflow: auto; padding: 1rem 1.2rem; }
.settings-fields label { font-size: 0.875rem; font-weight: 700; }
.settings-fields .form-error { color: var(--brand); }
.settings-fields p { margin: 0 0 0.45rem; color: var(--muted); font-size: 0.875rem; line-height: 1.55; }
.settings-fields > p.settings-account { overflow-wrap: anywhere; }
.settings-fields input {
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.58rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--ink);
  background: var(--white);
}
.identity-phone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.identity-phone-grid > div { display: grid; gap: 0.5rem; }
.settings-actions { justify-content: flex-end; }

.email-preview-dialog { width: min(44rem, calc(100vw - 1.5rem)); }
.email-preview-scroll { max-height: calc(100dvh - 6rem); min-height: 5rem; overflow: auto; }
.email-preview-scroll > p { margin: 0; padding: 1.1rem 1.2rem; color: var(--muted); font-size: 0.875rem; }

@media (max-width: 41rem) {
  .compose-preview-button > span:last-child { display: none; }
  .compose-preview-button { min-width: 2.5rem; padding-inline: 0.5rem; }
  .compose-editor { height: clamp(5rem, 28vh, 14rem); }
}

.compose-thread {
  margin: 0 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--white);
}

.compose-thread summary {
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.compose-thread-body {
  max-height: 18rem;
  overflow: auto;
  border-top: 1px solid var(--border);
  padding: 0.8rem;
}
