:root {
  --ink: #17202a;
  --navy: #16324f;
  --navy-soft: #244c70;
  --paper: #f6f0e4;
  --paper-deep: #e9deca;
  --white: #fffdf8;
  --line: #d7cbb7;
  --muted: #6e716f;
  --accent: #d95136;
  --accent-dark: #ad3927;
  --gold: #d9a441;
  --success: #276749;
  --danger: #9f2d20;
  --shadow: 0 18px 50px rgb(22 50 79 / 14%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-width: 0; min-height: 100%; margin: 0; }
html { background: var(--paper); }
body {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgb(217 164 65 / 16%), transparent 28rem),
    linear-gradient(135deg, #faf6ed 0%, var(--paper) 58%, #e8dfcf 100%);
}
::selection { color: #fff; background: var(--accent); }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .58; }
:focus-visible { outline: 3px solid rgb(217 81 54 / 38%); outline-offset: 2px; }

.eyebrow {
  margin: 0 0 .28rem;
  color: var(--accent);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.brand-mark {
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  border-radius: 1.25rem 1.25rem .35rem 1.25rem;
  color: var(--white);
  font-size: 2rem;
  font-weight: 700;
  background: var(--navy);
  box-shadow: 8px 8px 0 var(--gold);
}
.brand-mark-small { width: 2.7rem; height: 2.7rem; border-radius: .8rem .8rem .2rem .8rem; font-size: 1.25rem; box-shadow: 5px 5px 0 var(--gold); }
.button {
  min-height: 2.55rem;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  font-weight: 800;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--accent); box-shadow: 0 6px 16px rgb(217 81 54 / 20%); }
.button-primary:hover { background: var(--accent-dark); }
.button-quiet { color: var(--navy); border-color: var(--line); background: var(--white); }
.button-quiet[aria-pressed="true"] { color: #fff; border-color: var(--navy); background: var(--navy); }
.button-ghost { color: var(--muted); background: transparent; }
.button-ghost:hover { color: var(--danger); background: rgb(159 45 32 / 8%); }

.login-page { display: grid; min-height: 100vh; padding: 1.5rem; place-items: center; }
.login-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image: linear-gradient(rgb(22 50 79 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(22 50 79 / 5%) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom right, #000, transparent 75%);
}
.login-card {
  width: min(100%, 29rem);
  padding: 3.1rem;
  border: 1px solid rgb(22 50 79 / 14%);
  border-radius: 1.7rem .45rem 1.7rem 1.7rem;
  background: rgb(255 253 248 / 92%);
  box-shadow: var(--shadow);
}
.login-card .brand-mark { margin-bottom: 2rem; }
.login-card h1 { margin: 0; color: var(--navy); font-size: 2.35rem; font-weight: 700; line-height: 1.08; }
.login-copy { margin: .8rem 0 1.8rem; color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: .65rem; }
.login-form label { color: var(--navy); font-size: .82rem; font-weight: 800; }
.login-form input, .search-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: .75rem;
  color: var(--ink);
  background: var(--white);
}
.login-form input { padding: .9rem 1rem; margin-bottom: .35rem; }
.login-form input:focus, .search-field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgb(217 81 54 / 12%); }
.form-error { margin: 0 0 1rem; padding: .75rem .9rem; border-left: 4px solid var(--danger); color: var(--danger); background: rgb(159 45 32 / 8%); }
.login-footnote { margin: 1.5rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }

.dashboard-page { height: 100vh; overflow: hidden; overscroll-behavior: none; }
@supports (height: 100dvh) {
  .dashboard-page { height: 100dvh; }
}
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  height: 5.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgb(255 253 248 / 88%);
  backdrop-filter: blur(15px);
}
.brand-lockup { display: flex; min-width: 0; align-items: center; gap: 1rem; }
.brand-lockup > div { min-width: 0; }
.brand-lockup h1 { margin: 0; overflow: hidden; color: var(--navy); font-size: 1.35rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; flex: none; align-items: center; gap: .5rem; }
.topbar-actions form { margin: 0; }
.mobile-nav { display: none; }
.app-shell { display: grid; width: 100%; height: calc(100vh - 5.25rem); overflow: hidden; grid-template-columns: minmax(15rem, 19rem) minmax(20rem, 26rem) minmax(26rem, 1fr); }
@supports (height: 100dvh) {
  .app-shell { height: calc(100dvh - 5.25rem); }
}
.pane { min-width: 0; min-height: 0; }
.folders-pane { padding: 1.4rem 1rem; overflow-y: auto; border-right: 1px solid var(--line); background: rgb(246 240 228 / 76%); }
.pane-heading { padding: 0 .55rem 1.1rem; }
.pane-heading h2, .list-context h2 { margin: 0; color: var(--navy); font-size: 1.25rem; font-weight: 700; }
.folder-tree { display: grid; gap: 1.1rem; }
.category-title { display: flex; align-items: center; justify-content: space-between; padding: 0 .55rem .4rem; color: var(--navy); font-size: .9rem; font-weight: 700; }
.category-count { min-width: 1.4rem; color: var(--accent); font-size: .72rem; font-weight: 800; text-align: right; }
.subcategory-list { display: grid; gap: .22rem; }
.folder-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .66rem .72rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  color: #47515a;
  background: transparent;
  text-align: left;
}
.folder-button:hover { color: var(--navy); background: rgb(255 253 248 / 75%); }
.folder-button.is-selected { color: #fff; border-color: var(--navy); background: var(--navy); }
.unread-count { min-width: 1.45rem; padding: .12rem .38rem; border-radius: 999px; color: #fff; background: var(--accent); font-size: .68rem; text-align: center; }

.list-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgb(255 253 248 / 88%); }
.list-toolbar { padding: 1.1rem; border-bottom: 1px solid var(--line); }
.search-field span { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-field input { padding: .72rem .85rem; }
.list-context { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.count-label { min-width: 2rem; padding: .18rem .5rem; border-radius: 999px; color: var(--navy); background: var(--paper-deep); font-size: .72rem; text-align: center; }
.emails-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.mail-card {
  display: block;
  width: 100%;
  padding: 1rem 1.1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: background-color .16s ease, box-shadow .16s ease;
}
.mail-card:hover { background: #fff; }
.mail-card.is-unread { box-shadow: inset 4px 0 var(--accent); background: rgb(217 164 65 / 7%); }
.mail-card.is-selected { background: var(--paper-deep); }
.mail-meta { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; }
.mail-sender, .mail-subject, .mail-summary { overflow: hidden; text-overflow: ellipsis; }
.mail-sender { color: var(--navy); font-size: .79rem; white-space: nowrap; }
.is-unread .mail-sender, .is-unread .mail-subject { font-weight: 800; }
.mail-date { flex: none; color: var(--muted); font-size: .68rem; }
.mail-subject { margin-top: .4rem; font-size: .97rem; font-weight: 700; white-space: nowrap; }
.mail-summary { display: -webkit-box; margin: .38rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.badge-row, .fact-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.badge-row { margin-top: .65rem; }
.badge { padding: .22rem .45rem; border-radius: .35rem; color: var(--navy); background: var(--paper-deep); font-size: .66rem; }
.badge-urgent { color: var(--danger); background: rgb(217 81 54 / 10%); }
.state-message { padding: 3rem 1rem; color: var(--muted); text-align: center; }

.detail-pane { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--white); scrollbar-gutter: stable; }
.detail-empty { display: grid; min-height: 100%; padding: 2rem; place-content: center; color: var(--muted); text-align: center; }
.detail-empty span { color: var(--gold); font-size: 3rem; font-weight: 700; }
.detail-empty h2 { margin: .5rem 0 0; color: var(--navy); font-size: 1.6rem; font-weight: 700; }
.detail-empty p { margin: .5rem 0 0; }
.email-detail { width: min(100%, 58rem); margin: 0 auto; padding: 2rem clamp(1.2rem, 4vw, 3.6rem) 5rem; }
.summary-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem .25rem 1rem 1rem; background: var(--paper); }
.summary-card > div { min-width: 0; }
.summary-card .button { flex: none; }
.summary-text { margin: .35rem 0 0; line-height: 1.55; }
.fact-row { margin: .85rem 0 1.6rem; }
.fact { padding: .48rem .7rem; border-left: 3px solid var(--gold); color: var(--navy); background: #f9f2e5; font-size: .78rem; font-weight: 800; }
.fact-action { border-color: var(--accent); color: var(--danger); }
.message-header { padding-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.message-header h2 { margin: 0 0 1.2rem; color: var(--navy); font-size: clamp(1.55rem, 3vw, 2.45rem); font-weight: 700; line-height: 1.16; }
.message-header dl { display: grid; gap: .35rem; margin: 0; }
.message-header dl div { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: .6rem; }
.message-header dt { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.message-header dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: .84rem; }
.email-body { margin-top: 1.7rem; overflow-wrap: anywhere; font-family: inherit; font-size: .98rem; line-height: 1.65; }
.email-body img, .email-body video, .email-body canvas, .email-body svg { max-width: 100%; height: auto; }
.email-body iframe { max-width: 100%; }
.email-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.email-body td, .email-body th { padding: .45rem; border: 1px solid var(--line); }
.email-body a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.email-body pre { max-width: 100%; padding: .8rem; overflow-x: auto; background: var(--paper); }
.email-body blockquote { margin-inline: 0; padding-left: 1rem; border-left: 3px solid var(--gold); color: var(--muted); }
.toast { position: fixed; right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 20; width: min(26rem, calc(100vw - 2rem)); padding: .9rem 1rem; border-left: 5px solid var(--success); border-radius: .55rem; color: #fff; background: var(--navy); box-shadow: var(--shadow); }
.toast.is-error { border-color: var(--accent); }

/* The desktop columns need more room than a portrait tablet can provide. */
@media (max-width: 1099px) {
  .dashboard-page { overflow: hidden; }
  .topbar { height: 4.6rem; padding: .65rem .8rem; }
  .brand-lockup .eyebrow { display: none; }
  .brand-lockup h1 { font-size: 1.05rem; }
  .brand-mark-small { width: 2.35rem; height: 2.35rem; }
  .topbar-actions { gap: .2rem; }
  .topbar-actions .button { min-height: 2.2rem; padding: .5rem .62rem; font-size: .73rem; }
  .mobile-nav { display: grid; height: 3.15rem; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: var(--white); }
  .mobile-nav button { border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; font-size: .75rem; font-weight: 800; }
  .mobile-nav button.is-active { color: var(--accent); box-shadow: inset 0 -3px var(--accent); }
  .app-shell { display: block; height: calc(100vh - 7.75rem); }
  @supports (height: 100dvh) {
    .app-shell { height: calc(100dvh - 7.75rem); }
  }
  .pane { display: none; width: 100%; height: 100%; border-right: 0; }
  .pane.is-mobile-active { display: flex; }
  .folders-pane { flex-direction: column; }
  .detail-pane.is-mobile-active { display: block; }
  .email-detail { padding: 1.25rem 1rem 4rem; }
  .summary-card { flex-direction: column; }
}

@media (max-width: 520px) {
  .brand-lockup h1 { display: none; }
  .brand-lockup { gap: .45rem; }
  .topbar { padding-right: max(.45rem, env(safe-area-inset-right)); padding-left: max(.55rem, env(safe-area-inset-left)); }
  .topbar-actions { gap: 0; }
  .topbar-actions .button { min-height: 2.35rem; padding-inline: .48rem; font-size: .69rem; }
  .topbar-actions .button-ghost { padding-inline: .35rem; }
  .login-card { padding: 2rem 1.4rem; }
  .login-card h1 { font-size: 1.9rem; }
}

@media (max-width: 350px) {
  .brand-mark-small { width: 2rem; height: 2rem; font-size: 1rem; box-shadow: 3px 3px 0 var(--gold); }
  .topbar-actions .button { padding-inline: .35rem; font-size: .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Clean SaaS redesign */
:root {
  --ink: #17202b;
  --navy: #3446a5;
  --navy-soft: #4455b7;
  --paper: #f8f8f6;
  --paper-deep: #f0f1ef;
  --white: #fff;
  --line: #e5e7eb;
  --muted: #7b8492;
  --accent: #5968d8;
  --accent-dark: #4452bd;
  --gold: #d2a74d;
  --success: #2f8067;
  --danger: #b84c4c;
  --shadow: 0 14px 36px rgb(24 32 48 / 8%);
}

html { background: var(--paper); }
body {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.eyebrow {
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.brand-mark {
  border-radius: 13px;
  background: var(--navy);
  box-shadow: 0 10px 24px rgb(52 70 165 / 22%);
}
.brand-mark svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.brand-mark-small { border-radius: 9px; box-shadow: 0 5px 14px rgb(52 70 165 / 20%); }
.brand-mark-small svg { width: 1.35rem; height: 1.35rem; }

.button {
  display: inline-flex;
  min-height: 2.45rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .55rem .8rem;
  border-radius: 8px;
  font-size: .79rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.button-icon { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.button-primary { background: var(--accent); box-shadow: 0 5px 14px rgb(89 104 216 / 19%); }
.button-primary:hover { background: var(--accent-dark); box-shadow: 0 7px 18px rgb(89 104 216 / 25%); }
.button-quiet { color: #344154; border-color: var(--line); background: var(--white); box-shadow: 0 1px 2px rgb(24 32 48 / 4%); }
.button-quiet:hover, .button-quiet[aria-pressed="true"] { color: var(--navy); border-color: #cbd2fa; background: #eef1ff; box-shadow: none; }
.button-ghost:hover { color: var(--danger); background: #fff1f1; }

.login-page { background: radial-gradient(circle at 50% -20%, #fff 0, var(--paper) 56%); }
.login-page::before {
  opacity: .45;
  background-image: linear-gradient(#eef2f6 1px, transparent 1px), linear-gradient(90deg, #eef2f6 1px, transparent 1px);
}
.login-card { width: min(100%, 27rem); padding: 2.7rem; border-color: var(--line); border-radius: 18px; background: rgb(255 255 255 / 92%); }
.login-card h1 { color: var(--ink); font: inherit; font-size: 2rem; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.login-form label { color: #344154; font-size: .78rem; }
.login-form input { border-color: var(--line); border-radius: 8px; background: var(--white); }
.login-form input:focus { border-color: #aeb8f2; box-shadow: 0 0 0 3px rgb(89 104 216 / 13%); }
.form-error { border: 1px solid #f5cece; border-left-width: 1px; border-radius: 8px; background: #fff5f5; font-size: .84rem; }

.topbar { height: 4.6rem; padding: .75rem 1.35rem; border-color: var(--line); background: rgb(255 255 255 / 90%); }
.brand-lockup { gap: .8rem; }
.brand-copy { min-width: 0; }
.brand-lockup h1 { color: var(--ink); font: inherit; font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.brand-lockup .eyebrow { margin-bottom: .2rem; color: var(--accent); font-size: .59rem; }
.topbar-actions { gap: .35rem; }
.topbar-actions form { display: flex; }
.app-shell { height: calc(100vh - 4.6rem); grid-template-columns: minmax(14rem, 17rem) minmax(19rem, 25rem) minmax(25rem, 1fr); }
@supports (height: 100dvh) { .app-shell { height: calc(100dvh - 4.6rem); } }

.folders-pane { padding: 1.5rem .8rem; border-color: var(--line); background: #f5f6f7; scrollbar-gutter: stable; }
.pane-heading { padding: 0 .65rem 1rem; }
.pane-heading h2, .list-context h2 { color: var(--ink); font: inherit; font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
.folder-tree { gap: 1.15rem; }
.category-title { padding: 0 .65rem .4rem; color: var(--muted); font: inherit; font-size: .66rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.category-count { min-width: 1.8rem; padding: .2rem .4rem; border-radius: 999px; color: var(--muted); background: #e9ebef; font: inherit; font-size: .64rem; text-align: center; }
.subcategory-list { gap: .18rem; }
.folder-button {
  min-height: 2.3rem;
  padding: .5rem .65rem;
  border-radius: 8px;
  color: #344154;
  font-size: .82rem;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.folder-button > span:first-child { display: flex; min-width: 0; align-items: center; gap: .55rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-button > span:first-child::before { width: .42rem; height: .42rem; flex: none; border: 1.5px solid currentColor; border-radius: 2px; content: ""; opacity: .58; transform: rotate(45deg); }
.folder-button:hover { color: var(--navy); background: #fff; }
.folder-button.is-selected { color: var(--navy); border-color: #d8ddff; background: #eef1ff; font-weight: 700; }
.folder-button.is-selected > span:first-child::before { background: var(--accent); border-color: var(--accent); opacity: 1; transform: none; }
.unread-count { min-width: 1.5rem; padding: .18rem .4rem; color: #5c6676; background: #e9ebef; font-size: .65rem; }
.folder-button.is-selected .unread-count { color: var(--navy); background: #dce2ff; }

.list-pane { border-color: var(--line); background: #fbfbfa; }
.list-toolbar { padding: 1.35rem 1.1rem .9rem; border-color: var(--line); }
.search-field > span:first-child { display: block; margin-bottom: .42rem; color: var(--muted); font-size: .66rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.search-control { display: flex; width: 100%; min-height: 2.55rem; align-items: center; gap: .55rem; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); transition: border-color .16s ease, box-shadow .16s ease; }
.search-control:focus-within { border-color: #aeb8f2; box-shadow: 0 0 0 3px rgb(89 104 216 / 13%); }
.search-control svg { width: 1rem; height: 1rem; flex: none; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.search-control input { min-width: 0; flex: 1; padding: .62rem 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .82rem; }
.search-control input::placeholder { color: #a0a7b2; }
.list-context { margin-top: 1.1rem; }
.count-label { min-width: 1.9rem; padding: .22rem .48rem; color: var(--muted); background: var(--paper-deep); font-size: .67rem; font-weight: 700; }
.emails-list { display: grid; align-content: start; gap: .5rem; padding: .65rem; }
.mail-card { position: relative; padding: .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 1px 2px rgb(24 32 48 / 4%); transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.mail-card:hover { border-color: #d4d9e2; background: #fff; box-shadow: 0 5px 14px rgb(24 32 48 / 7%); transform: translateY(-1px); }
.mail-card.is-unread { padding-left: calc(.85rem - 2px); border-left: 3px solid var(--accent); background: var(--white); box-shadow: 0 1px 2px rgb(24 32 48 / 4%); }
.mail-card.is-selected, .mail-card.is-unread.is-selected { border-color: #b9c1fa; background: #eef1ff; box-shadow: 0 0 0 2px rgb(89 104 216 / 10%); }
.mail-sender { color: var(--muted); font-size: .72rem; font-weight: 600; }
.is-unread .mail-sender { color: #344154; }
.mail-date { font-size: .66rem; }
.mail-subject { color: var(--ink); font: inherit; font-size: .87rem; font-weight: 700; letter-spacing: -.01em; }
.mail-summary { font-size: .74rem; line-height: 1.45; }
.badge-row { margin-top: .62rem; }
.badge { padding: .24rem .48rem; border-radius: 999px; color: #626d7d; background: #eef0f3; font-size: .63rem; font-weight: 650; }
.badge-urgent { color: #a34848; background: #fff0f0; }

.detail-pane { background: var(--white); }
.detail-empty span { color: #b2b9c4; font: inherit; font-size: 2.8rem; font-weight: 300; }
.detail-empty h2 { color: var(--ink); font: inherit; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.detail-empty p { max-width: 22rem; margin-inline: auto; font-size: .82rem; line-height: 1.5; }
.email-detail { width: min(100%, 60rem); padding-top: 1.65rem; }
.summary-card { padding: 1rem 1.1rem; border-color: #e0e5ff; border-radius: 12px; background: #f8f9ff; }
.summary-card .eyebrow { color: var(--accent); }
.summary-text { color: #344154; font-size: .84rem; }
.fact { padding: .35rem .55rem; border: 1px solid #eef2f6; border-radius: 999px; color: #626d7d; background: #f7f8fa; font-size: .68rem; font-weight: 650; }
.fact-action { border-color: #f5d8d8; color: var(--danger); background: #fff6f6; }
.message-header { border-color: var(--line); }
.message-header h2 { color: var(--ink); font: inherit; font-size: clamp(1.35rem, 2.3vw, 2rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.2; }
.message-header dl { gap: .42rem; }
.message-header dl div { grid-template-columns: 3.8rem minmax(0, 1fr); align-items: baseline; }
.message-header dt { font-size: .67rem; letter-spacing: .05em; }
.message-header dd { color: #344154; font-size: .78rem; }
.email-body { color: #3f4a5a; font-family: inherit; font-size: .91rem; line-height: 1.7; }
.email-content table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border: 0; border-collapse: collapse; font-family: inherit; }
.email-content td, .email-content th { padding: 8px 12px; border: 1px solid #eef2f6; }
.email-content th { color: #344154; background: #fafbfc; font-weight: 700; }
.email-body iframe { border: 0; }
.email-body pre { border: 1px solid #eef2f6; border-radius: 8px; background: #fafbfc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.email-body blockquote { border-color: #ccd3ff; }
.toast { border: 1px solid #dbe4df; border-left: 4px solid var(--success); color: var(--ink); background: #fff; font-size: .82rem; }
.toast.is-error { border-color: #f0d3d3; border-left-color: var(--danger); }

@media (max-width: 1099px) {
  .topbar { height: 4.25rem; }
  .topbar-actions { gap: .2rem; }
  .topbar-actions .button { min-height: 2.25rem; }
  .mobile-nav { height: 3.05rem; border-color: var(--line); }
  .mobile-nav button { color: var(--muted); font-size: .72rem; }
  .mobile-nav button.is-active { color: var(--navy); box-shadow: inset 0 -2px var(--accent); }
  .app-shell { height: calc(100vh - 7.3rem); }
  @supports (height: 100dvh) { .app-shell { height: calc(100dvh - 7.3rem); } }
}

@media (max-width: 520px) {
  .topbar-actions .button { min-height: 2.3rem; padding-inline: .45rem; font-size: .68rem; }
  .topbar-actions .button-icon { width: .9rem; height: .9rem; }
  .login-card { padding: 2rem 1.4rem; }
  .login-card h1 { font-size: 1.8rem; }
}

@media (max-width: 350px) {
  .topbar-actions .button-label { display: none; }
  .topbar-actions .button { width: 2.35rem; padding-inline: 0; }
}
