:root {
  --navy: #07172f;
  --navy-2: #132744;
  --ink: #121922;
  --muted: #69717d;
  --soft: #f2f3f5;
  --line: #e2e5e9;
  --gold: #aa8546;
  --red: #a92d3d;
  --green: #24765a;
  --white: #ffffff;
  --nav-h: 68px;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: #e8eaed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { color: inherit; font: inherit; letter-spacing: 0; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #3d6da7; outline-offset: 2px; }

.app-shell {
  position: relative;
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #f7f8f9;
}
.app-main { min-height: 100dvh; }
.page { display: none; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); }
.page.active { display: block; }

.brand-header {
  min-height: 116px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 17px;
  background: var(--navy);
  color: white;
}
.brand-row, .title-row, .section-heading, .account-top, .mail-top, .profile-hero,
.detail-header, .action-row, .agenda-row, .info-row, .initiative-top, .toolbar-row {
  display: flex;
  align-items: center;
}
.brand-row { min-height: 38px; gap: 12px; }
.header-person { display: grid; width: 36px; height: 36px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; place-items: center; }
.brand-logo { width: 106px; height: 25px; object-fit: contain; object-position: left center; }
.brand-context { min-width: 0; flex: 1; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.24); }
.brand-context b { display: block; font: 600 12px/1.25 Georgia, "Times New Roman", serif; }
.brand-context span { display: block; margin-top: 2px; color: rgba(255,255,255,.66); font-size: 10px; }
.header-avatar { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; object-fit: cover; }
.brand-greeting { margin: 16px 0 0; font: 400 25px/1.15 Georgia, "Times New Roman", serif; }
.brand-subtitle { margin: 5px 0 0; color: rgba(255,255,255,.7); font-size: 11.5px; }

.content { padding: 16px; }
.section { margin-bottom: 20px; }
.section-heading { justify-content: space-between; min-height: 28px; margin-bottom: 9px; }
.section-heading h2 { margin: 0; font: 600 17px/1.2 Georgia, "Times New Roman", serif; }
.section-heading p, .section-heading span { margin: 0; color: var(--muted); font-size: 10.5px; }
.section-heading button { border: 0; background: none; color: #315e93; font-size: 11px; padding: 6px 0 6px 8px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.metric { min-width: 0; padding: 12px 8px 11px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric strong { display: block; font: 600 21px/1 Georgia, "Times New Roman", serif; }
.metric span { display: block; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.metric.red strong { color: var(--red); }.metric.green strong { color: var(--green); }.metric.gold strong { color: var(--gold); }

.agenda-list, .action-list, .account-list, .initiative-list, .mail-list { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.agenda-row { width: 100%; min-height: 72px; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.agenda-row:last-child, .action-row:last-child, .account-row:last-child, .initiative-row:last-child, .mail-row:last-child { border-bottom: 0; }
.agenda-time { width: 50px; flex: none; align-self: flex-start; }
.agenda-time b { display: block; font-size: 12px; }.agenda-time span { color: var(--muted); font-size: 9.5px; }
.agenda-line { width: 3px; height: 38px; margin-right: 11px; border-radius: 2px; background: var(--navy); }
.agenda-line.gold { background: var(--gold); }.agenda-line.green { background: var(--green); }
.agenda-info, .action-copy, .account-copy, .mail-copy, .profile-copy { min-width: 0; flex: 1; }
.agenda-info b, .action-copy b { display: block; overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-info span, .action-copy span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mini-avatars { display: flex; margin-left: 8px; }
.mini-avatars i { width: 24px; height: 24px; margin-left: -6px; border: 2px solid white; border-radius: 50%; background: #e4e8ee; color: #4f5966; font: normal 700 8px/20px sans-serif; text-align: center; }

.action-row { width: 100%; min-height: 61px; gap: 11px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.action-icon { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 6px; background: #edf1f5; color: var(--navy); }
.action-icon svg { width: 17px; height: 17px; }
.action-icon.red { background: #f8ecee; color: var(--red); }.action-icon.gold { background: #f7f1e6; color: #8e6a2d; }.action-icon.green { background: #eaf3ef; color: var(--green); }
.action-due { flex: none; color: var(--muted); font-size: 9.5px; }

.program-band { position: relative; overflow: hidden; padding: 16px; border-radius: var(--radius); background: var(--navy); color: white; }
.program-band:after { position: absolute; top: 0; right: 0; width: 5px; height: 100%; background: var(--gold); content: ""; }
.program-band small { color: #d9c192; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.program-band h3 { margin: 7px 0 5px; font: 500 18px/1.2 Georgia, "Times New Roman", serif; }
.program-band p { max-width: 400px; margin: 0; color: rgba(255,255,255,.68); font-size: 10.5px; line-height: 1.5; }
.program-meta { display: flex; gap: 16px; margin-top: 13px; font-size: 9.5px; }
.program-meta span { display: inline-flex; align-items: center; gap: 5px; }
.program-meta svg { width: 13px; height: 13px; }

.plain-header { padding: calc(15px + env(safe-area-inset-top)) 16px 13px; background: white; border-bottom: 1px solid var(--line); }
.plain-header.search-host { padding-top: 0; }
.title-row { justify-content: space-between; min-height: 39px; }
.page-kicker { margin: 0 0 3px; color: var(--gold); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.title-row h1 { margin: 0; font: 600 24px/1.1 Georgia, "Times New Roman", serif; }
.icon-button, .compose-button, .send-button { display: grid; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: white; place-items: center; }
.icon-button svg, .compose-button svg, .send-button svg { width: 18px; height: 18px; }
.compose-button { border-color: var(--navy); background: var(--navy); color: white; }

.search-bar { display: flex; align-items: center; height: 42px; gap: 9px; margin: 12px 0 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #f5f6f7; }
.search-bar svg { width: 17px; height: 17px; color: #7a828c; }
.search-bar input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 1px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: none; min-height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px; background: white; color: #626b76; font-size: 10px; }
.filter-chip.active { border-color: var(--navy); background: var(--navy); color: white; }
.list-content { padding: 12px 16px 18px; }

.account-row { display: block; width: 100%; padding: 13px 12px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.account-top { gap: 11px; }
.account-mark { display: grid; width: 38px; height: 38px; flex: none; border-radius: 6px; background: var(--navy); color: white; font: 700 10px/1 sans-serif; place-items: center; }
.account-copy b, .mail-copy b { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy span, .mail-copy span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.status-pill, .label-pill { flex: none; padding: 4px 7px; border-radius: 10px; background: #edf1f5; color: #536071; font-size: 8.5px; font-weight: 700; }
.status-pill.red { background: #f8e9ec; color: var(--red); }.status-pill.green { background: #e7f2ed; color: var(--green); }.status-pill.navy { background: #e9edf3; color: var(--navy); }
.account-bottom { display: grid; grid-template-columns: 1.1fr .8fr 1.3fr; gap: 8px; margin: 12px 0 0 49px; }
.account-bottom span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.account-bottom b { display: block; margin-top: 2px; color: var(--ink); font-size: 10px; }
.empty-state { padding: 42px 24px; text-align: center; color: var(--muted); font-size: 12px; }

.sector-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.sector-cell { min-height: 72px; padding: 11px 9px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.sector-cell b { display: block; font: 600 18px/1 Georgia, "Times New Roman", serif; }
.sector-cell span { display: block; margin-top: 8px; color: var(--muted); font-size: 8.5px; line-height: 1.3; }
.maison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.maison-card { min-height: 137px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: white; text-align: left; }
.maison-accent { width: 20px; height: 3px; margin-bottom: 11px; }
.maison-card h3 { margin: 0; font: 600 14px/1.2 Georgia, "Times New Roman", serif; }
.maison-card p { height: 26px; margin: 5px 0 9px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.progress-line { height: 3px; overflow: hidden; border-radius: 2px; background: #eceff2; }
.progress-line i { display: block; height: 100%; background: var(--navy); }
.maison-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 8.5px; }
.initiative-list { margin-top: 10px; }
.initiative-row { width: 100%; padding: 13px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.initiative-top { justify-content: space-between; gap: 10px; }
.initiative-top b { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.initiative-row p { margin: 5px 0 10px; color: var(--muted); font-size: 9.5px; }

.mail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 0; }
.mail-summary div { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.mail-summary strong { display: block; font: 600 18px/1 Georgia, "Times New Roman", serif; }
.mail-summary span { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.mail-row { display: flex; width: 100%; min-height: 92px; gap: 10px; padding: 13px 10px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.sender-mark { display: grid; width: 38px; height: 38px; flex: none; border-radius: 50%; background: #e9edf2; color: var(--navy); font: 700 10px/1 sans-serif; place-items: center; }
.mail-row.unread { box-shadow: inset 3px 0 var(--navy); }
.mail-row.unread .mail-copy b { font-weight: 750; }
.mail-top { gap: 8px; }
.mail-top .mail-copy { flex: 1; }
.mail-time { flex: none; color: var(--muted); font-size: 9px; }
.mail-subject { margin-top: 6px; overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.mail-preview { display: -webkit-box; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9.5px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mail-tags { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.label-pill { padding: 3px 6px; border-radius: 4px; background: #f0f2f5; }
.attachment-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 8.5px; }
.attachment-tag svg { width: 11px; height: 11px; }
.star-button { display: grid; width: 27px; height: 27px; flex: none; border: 0; background: transparent; color: #9ca3ad; place-items: center; }
.star-button.starred { color: var(--gold); }
.star-button svg { width: 16px; height: 16px; }

.profile-cover { height: 112px; padding: calc(16px + env(safe-area-inset-top)) 18px 14px; background: var(--navy); color: white; }
.profile-cover img { width: 105px; height: 25px; object-fit: contain; object-position: left; }
.profile-panel { margin: -46px 16px 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 7px 22px rgba(7,23,47,.08); }
.profile-hero { gap: 12px; }
.profile-photo { width: 64px; height: 64px; flex: none; border: 3px solid white; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.profile-copy h1 { margin: 0; font: 600 22px/1.1 Georgia, "Times New Roman", serif; }
.profile-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.profile-bio { margin: 14px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: #505966; font: 400 12px/1.55 Georgia, "Times New Roman", serif; }
.profile-content { padding: 14px 16px 18px; }
.info-group { overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.info-row { width: 100%; min-height: 55px; gap: 11px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.info-row:last-child { border-bottom: 0; }
.info-row > svg { width: 17px; height: 17px; flex: none; color: #566272; }
.info-copy { min-width: 0; flex: 1; }
.info-copy b { display: block; font-size: 11px; }.info-copy span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.info-row .chevron { width: 15px; color: #a2a8b0; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 560px);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.97);
}
.nav-item { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; color: #7b838e; }
.nav-item svg { width: 21px; height: 21px; stroke-width: 1.8; }
.nav-item span:last-child { overflow: hidden; max-width: 100%; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active { color: var(--navy); }
.nav-item.active:after { position: absolute; bottom: calc(4px + env(safe-area-inset-bottom)); width: 18px; height: 2px; background: var(--gold); content: ""; }
.nav-icon-wrap { position: relative; height: 21px; }
.nav-icon-wrap b { position: absolute; top: -7px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; border: 2px solid white; border-radius: 8px; background: var(--red); color: white; font: 700 8px/12px sans-serif; text-align: center; }

.detail-view, .compose-view { position: fixed; z-index: 60; top: 0; bottom: 0; left: 50%; width: min(100%, 560px); overflow-y: auto; background: #f7f8f9; transform: translateX(110%); transition: transform .28s cubic-bezier(.22,.75,.28,1); }
.detail-view.open, .compose-view.open { transform: translateX(-50%); }
.detail-view:not(.open), .compose-view:not(.open) { left: 100%; }
.detail-header { position: sticky; z-index: 2; top: 0; min-height: calc(63px + env(safe-area-inset-top)); justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.detail-header > div { min-width: 0; flex: 1; text-align: center; }
.detail-header p { margin: 0 0 2px; color: var(--gold); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.detail-header h1 { margin: 0; overflow: hidden; font: 600 17px/1.2 Georgia, "Times New Roman", serif; text-overflow: ellipsis; white-space: nowrap; }
.detail-body { padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); }
.detail-hero { padding: 17px; border-radius: var(--radius); background: var(--navy); color: white; }
.detail-hero small { color: #d5bd8a; font-size: 9px; text-transform: uppercase; }
.detail-hero h2 { margin: 8px 0 5px; font: 500 24px/1.15 Georgia, "Times New Roman", serif; }
.detail-hero p { margin: 0; color: rgba(255,255,255,.67); font-size: 10.5px; line-height: 1.5; }
.detail-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; border-top: 1px solid rgba(255,255,255,.18); }
.detail-stat-grid div { padding: 11px 6px 0 0; }
.detail-stat-grid b { display: block; font-size: 13px; }.detail-stat-grid span { display: block; margin-top: 3px; color: rgba(255,255,255,.58); font-size: 8px; }
.detail-section { margin-top: 18px; }
.detail-section h3 { margin: 0 0 9px; font: 600 15px/1.2 Georgia, "Times New Roman", serif; }
.detail-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.detail-list-row { display: flex; min-height: 53px; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.detail-list-row:last-child { border-bottom: 0; }
.detail-list-row div { min-width: 0; flex: 1; }.detail-list-row b { display: block; font-size: 11px; }.detail-list-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.detail-list-row > strong { flex: none; color: var(--navy); font-size: 10px; }
.health-ring { display: grid; width: 48px; height: 48px; flex: none; border: 5px solid #dfe8e3; border-top-color: var(--green); border-radius: 50%; color: var(--green); font-size: 10px; place-items: center; }
.detail-list-row span.health-ring { display: grid; margin-top: 0; color: var(--green); font-size: 10px; line-height: 1; place-items: center; }
.contact-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.contact-actions button { display: flex; min-height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--navy); font-size: 8.5px; }
.contact-actions svg { width: 17px; height: 17px; }
.mail-detail-header { display: flex; align-items: center; gap: 11px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.mail-detail-header .sender-mark { width: 44px; height: 44px; }
.mail-detail-header span.sender-mark { display: grid; margin-top: 0; color: var(--navy); font-size: 10px; line-height: 1; place-items: center; }
.mail-detail-header div { min-width: 0; flex: 1; }.mail-detail-header b { display: block; font-size: 13px; }.mail-detail-header span { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.mail-subject-detail { margin: 18px 0 12px; font: 600 22px/1.25 Georgia, "Times New Roman", serif; }
.mail-body { margin: 0; white-space: pre-wrap; color: #343d49; font: 400 12.5px/1.7 Georgia, "Times New Roman", serif; }
.attachment-card { display: flex; min-height: 52px; align-items: center; gap: 10px; margin-top: 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.attachment-card svg { width: 19px; color: var(--red); }.attachment-card div { min-width: 0; flex: 1; }.attachment-card b { display: block; overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }.attachment-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; }

.compose-view { z-index: 70; background: white; }
.text-button { min-width: 54px; border: 0; background: transparent; color: #506174; font-size: 11px; }
.send-button { border: 0; background: var(--navy); color: white; }
.compose-form { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.compose-form label { display: flex; min-height: 54px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.compose-form label span { width: 51px; color: var(--muted); font-size: 11px; }
.compose-form input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 12px; }
.compose-form textarea { width: 100%; min-height: 280px; resize: none; padding: 16px 0; border: 0; outline: 0; font-size: 13px; line-height: 1.6; }
.attachment-button { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: white; color: #536071; font-size: 10px; }
.attachment-button svg { width: 15px; height: 15px; }

.toast { position: fixed; z-index: 100; bottom: calc(82px + env(safe-area-inset-bottom)); left: 50%; max-width: calc(100% - 48px); padding: 10px 14px; border-radius: 6px; background: rgba(7,23,47,.94); color: white; font-size: 10.5px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.muted-note { color: var(--muted); font-size: 9.5px; line-height: 1.5; }

@media (min-width: 700px) {
  .app-shell { box-shadow: 0 0 42px rgba(18,25,34,.16); }
  .detail-view, .compose-view { box-shadow: 0 0 42px rgba(18,25,34,.18); }
}

@media (max-width: 370px) {
  .content, .list-content, .detail-body { padding-right: 12px; padding-left: 12px; }
  .filter-row { padding-left: 12px; }
  .account-bottom { grid-template-columns: 1fr 1fr; }
  .account-bottom span:last-child { grid-column: 1 / -1; }
  .maison-grid { gap: 7px; }
  .brand-context span { display: none; }
}

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