/* ILYGO Mail-Gateway — tokens from www.ilygo.ch, verified 19 October 2026. */
:root {
  color-scheme: light;
  --ink: #213150;
  --muted: #5b6577;
  --paper: #f5f7fb;
  --white: #fff;
  --line: #e2e7f0;
  --brand: #213150;
  --brand-deep: #16223a;
  --turquoise: #1b9fb4;
  --turquoise-ink: #087386;
  --warm: #e8834c;
  --tint: #e4f4f7;
  /* Compatibility names for the existing integration and UAT components. */
  --green: var(--brand);
  --green-dark: var(--brand-deep);
  --green-pale: var(--tint);
  --accent: #d3eef3;
  --danger: #b42332;
  --shadow: 0 18px 60px #2131501f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 30px; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-underline-offset: 4px; }
a:hover { color: var(--turquoise-ink); }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .46; }
:focus-visible { outline: 3px solid var(--turquoise-ink); outline-offset: 4px; }
.hidden { display: none !important; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { letter-spacing: -.035em; line-height: 1.22; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 20px; background: white; border: 2px solid var(--brand); }
.skip-link:focus { top: 12px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; gap: 11px; text-decoration: none; color: var(--brand); font-size: 21px; font-weight: 800; letter-spacing: .025em; }
.brand b { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: -.015em; padding-left: 12px; margin-left: 7px; border-left: 1px solid var(--line); }
.brand-mark { display: grid; grid-template-columns: 9px 9px; grid-template-rows: 9px 9px; gap: 3px; transform: rotate(-10deg); }
.brand-mark i { display: block; border-radius: 2px; background: var(--brand); }
.brand-mark i:nth-child(2) { background: var(--turquoise); }
.brand-mark i:nth-child(3) { grid-column: 2; background: var(--warm); }
.eyebrow { color: var(--turquoise-ink); font-size: 10px; font-weight: 750; letter-spacing: .14em; line-height: 1.6; margin: 0 0 12px; }
.eyebrow-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warm); vertical-align: 1px; margin-right: 6px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 8px; padding: 12px 18px; text-decoration: none; cursor: pointer; font-size: 13px; font-weight: 650; line-height: 1.4; transition: background .15s, border-color .15s, box-shadow .15s; }
.button.primary { background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-deep); box-shadow: 0 5px 15px #2131501a; }
.button.secondary { background: white; color: var(--ink); border-color: var(--line); }
.button.secondary:hover { background: var(--paper); border-color: #b7c3d5; }
.button.danger { background: var(--danger); color: white; }
.button.small { padding: 9px 12px; font-size: 12px; }
.button.wide { width: 100%; padding: 14px 18px; }
.text-button { border: 0; background: none; color: var(--brand); cursor: pointer; font-weight: 600; padding: 7px 4px; line-height: 1.5; text-align: left; }
.text-button:hover { color: var(--turquoise-ink); }
.destructive { color: var(--danger); }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); cursor: pointer; font-size: 21px; line-height: 1; }
.icon-button:hover { background: var(--paper); }
.inline-link { font-size: 13px; font-weight: 600; }
.notice { display: block; position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 14px 20px; border-radius: 10px; background: var(--brand); color: white; box-shadow: var(--shadow); text-align: center; }
.notice.error { background: var(--danger); }
.mailbox-recovery-action { display: grid; justify-items: start; gap: 14px; margin-top: 14px; line-height: 1.6; }
.notice .mailbox-recovery-action { justify-items: center; }
.empty-list .mailbox-recovery-action { justify-items: center; }
.reconnect-steps { padding-left: 22px; color: var(--muted); line-height: 1.7; }
.reconnect-steps li + li { margin-top: 12px; }
/* Public website and sign-in share one entrance. */
.auth-shell { background: white; min-height: 100dvh; }
.public-header { max-width: 1312px; margin: auto; padding: 26px 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.public-header nav { display: flex; gap: 28px; align-items: center; font-size: 12px; font-weight: 600; }
.public-header nav a { text-decoration: none; }
.landing-hero { max-width: 1312px; margin: auto; padding: 86px 48px 90px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 88px; align-items: center; }
.hero-copy h1 { font-size: clamp(40px, 4.3vw, 62px); line-height: 1.1; font-weight: 750; letter-spacing: -.055em; margin: 22px 0; }
.hero-copy em { color: var(--turquoise-ink); font-style: normal; }
.hero-lead { max-width: 515px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 30px; }
.provider-strip { display: flex; flex-wrap: wrap; gap: 22px; margin: 48px 0 16px; color: var(--muted); font-size: 12px; font-weight: 600; }
.provider-strip > span { display: inline-flex; align-items: center; gap: 7px; }
.mini-microsoft { color: #396caa; font-size: 23px; }
.mini-google { color: #346cbd; font-size: 18px; font-weight: 800; }
.mini-imap { color: var(--turquoise-ink); font-size: 20px; }
.hero-footnote { color: var(--muted); font-size: 11px; line-height: 1.75; }
.auth-column { position: relative; padding: 18px 0; }
.auth-column::before { content: ""; position: absolute; inset: -25px -25px 25px 25px; border-radius: 28px; background: var(--paper); z-index: 0; }
.auth-card { position: relative; width: 100%; padding: 36px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 45px #2131500a; scroll-margin-top: 60px; }
.auth-help { position: relative; margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.auth-help a { font-weight: 600; }
.login-symbol { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--turquoise-ink); font-size: 24px; margin-bottom: 28px; }
.auth-form { display: grid; gap: 20px; }
.auth-form h2 { font-size: 31px; margin: 8px 0 14px; font-weight: 700; }
.auth-form p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.auth-form .eyebrow { font-size: 9px; color: var(--turquoise-ink); }
.auth-form .sso-note { font-size: 11px; text-align: center; line-height: 1.6; }
.auth-sso { margin-top: 8px; }
.auth-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tab { border: 0; border-bottom: 2px solid transparent; background: none; padding: 0 0 12px; color: var(--muted); font-weight: 600; cursor: pointer; }
.tab.active { color: var(--brand); border-color: var(--turquoise-ink); }
.auth-divider { text-align: center; font-size: 12px; }
.landing-section { padding: 64px 48px 76px; border-top: 1px solid var(--line); background: var(--paper); }
.section-intro { max-width: 1216px; margin: auto; }
.section-intro h2 { font-size: clamp(28px, 3vw, 38px); margin-bottom: 16px; }
.section-intro > p:last-child { color: var(--muted); font-size: 14px; max-width: 500px; line-height: 1.8; }
.journey-cards { max-width: 1216px; margin: 36px auto 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.journey-cards li { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 30px; }
.step-number { display: block; color: var(--turquoise-ink); font-size: 12px; font-weight: 700; margin-bottom: 28px; }
.journey-cards h3 { font-size: 18px; letter-spacing: -.025em; margin-bottom: 12px; }
.journey-cards p { font-size: 13px; line-height: 1.85; color: var(--muted); margin-bottom: 22px; }
.journey-cards a { text-decoration: none; font-size: 12px; font-weight: 650; }
.landing-guide { display: flex; align-items: center; justify-content: space-between; gap: 30px; max-width: 1312px; margin: auto; padding: 64px 48px; }
.landing-guide h2 { font-size: 30px; margin-bottom: 14px; }
.landing-guide p:last-child { max-width: 620px; color: var(--muted); font-size: 13px; line-height: 1.8; margin-bottom: 0; }
.landing-guide .button { flex-shrink: 0; }
.public-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 28px; padding: 30px max(24px, calc((100% - 1216px) / 2)); border-top: 1px solid var(--line); }
.public-footer .brand { font-size: 16px; }
.public-footer .brand b { font-size: 11px; }
.public-footer nav { margin-left: auto; display: flex; gap: 22px; font-size: 11px; }
.public-footer nav a { text-decoration: none; color: var(--muted); }
.public-footer small { color: var(--muted); font-size: 10px; }
/* Fields and dialogs. All action IDs and permission checks remain in app.js. */
label { display: grid; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 650; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid #cdd5e2; border-radius: 7px; padding: 11px 12px; color: var(--ink); background: white; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--turquoise-ink); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: #6c7789; }
input[readonly] { background: var(--paper); font-family: ui-monospace, monospace; font-size: 12px; }
textarea { resize: vertical; line-height: 1.65; }
.form-message { display: block; min-height: 18px; margin: 0; color: var(--turquoise-ink); font-size: 12px; }
.form-message:empty { min-height: 0; }
.form-message.error { color: var(--danger); }
dialog { width: min(580px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: white; color: var(--ink); box-shadow: var(--shadow); margin: auto; }
dialog::backdrop { background: #16223a66; backdrop-filter: blur(3px); }
dialog h2 { font-size: 25px; margin: 0 0 6px; }
dialog h3 { font-size: 15px; margin: 0; }
.dialog-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 28px; overflow-y: auto; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-head .eyebrow { margin-bottom: 7px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding-top: 8px; }
.dialog-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.connection-form { display: grid; gap: 18px; }
.access-options { min-width: 0; display: grid; gap: 4px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.access-options legend { padding: 0 6px; font-size: 12px; font-weight: 700; }
.access-options label { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 5px; cursor: pointer; font-weight: 450; font-size: 12px; }
.access-options label:has(input:checked) { background: var(--tint); }
.access-options input { flex-shrink: 0; width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.imap-server { gap: 12px; }
.imap-server label:not(:has(input[type="checkbox"])) { display: grid; align-items: stretch; gap: 6px; background: transparent; padding: 0; }
.imap-server label:not(:has(input[type="checkbox"])) input, .imap-server select { width: 100%; height: auto; }
.provider-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; color: inherit; text-align: left; cursor: pointer; }
.provider-card:hover { border-color: var(--turquoise-ink); background: #f7fbfc; }
.provider-card strong, .provider-card small { display: block; }
.provider-card strong { font-size: 13px; }
.provider-card small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.provider-card > span:last-child { color: var(--muted); font-size: 23px; }
.google-mark, .imap-mark, .provider-letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--paper); color: #346cbd; font-weight: 750; font-size: 23px; }
.imap-mark { color: var(--turquoise-ink); }
.microsoft-mark { width: 28px; height: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.microsoft-mark i:nth-child(1) { background: #f35325; }.microsoft-mark i:nth-child(2) { background: #81bc06; }.microsoft-mark i:nth-child(3) { background: #05a6f0; }.microsoft-mark i:nth-child(4) { background: #ffba08; }
.provider-back { justify-self: start; }
.chosen-provider { margin: 0; font-size: 14px; font-weight: 650; }
.integration-shell { min-height: 100dvh; display: grid; place-items: center; padding: 48px 16px; }
.integration-card { width: min(100%, 620px); }
.integration-card h1 { font-size: clamp(28px, 5vw, 36px); margin-bottom: 18px; }
.integration-card > p { color: var(--muted); line-height: 1.8; }
/* Mail workspace: navigation, conversations, reading pane. */
.app-shell { height: calc(100dvh - var(--ilygo-uat-banner-h, 0px) - var(--preview-banner-h, 0px)); min-height: 0; display: grid; grid-template-rows: 66px minmax(0, 1fr); overflow: hidden; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 26px; border-bottom: 1px solid var(--line); background: white; }
.app-header-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-toggle { display: none; }
.user-menu { display: flex; align-items: center; gap: 30px; color: var(--muted); font-size: 12px; }
.help-link { text-decoration: none; font-size: 11px; }
.user-tools, .account-tools { position: relative; }
.user-tools summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.user-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--tint); color: var(--turquoise-ink); font-weight: 700; font-size: 12px; }
#user-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.dropdown-panel { position: absolute; z-index: 12; top: calc(100% + 12px); right: 0; min-width: 250px; max-width: calc(100vw - 32px); background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; }
.dropdown-panel .text-button, .dropdown-panel > a { display: block; width: 100%; padding: 10px 12px; border-radius: 6px; font-size: 12px; text-align: left; text-decoration: none; font-weight: 500; }
.dropdown-panel .text-button:hover, .dropdown-panel > a:hover { background: var(--paper); }
.dropdown-label { margin: 6px 12px 1px; padding-top: 8px; font-size: 9px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.mail-layout { min-height: 0; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { min-height: 0; display: flex; flex-direction: column; padding: 25px 16px 18px; border-right: 1px solid var(--line); background: var(--paper); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 14px; }
.sidebar-head .eyebrow { margin: 0; color: var(--muted); font-size: 9px; }
.sidebar-head .icon-button { background: transparent; border: 0; width: 28px; height: 28px; }
.account-list { display: grid; gap: 5px; max-height: 32%; overflow-y: auto; }
.account-item { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 8px; padding: 10px 8px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.account-item:hover { background: white; }
.account-item.active { background: white; border-color: var(--line); box-shadow: 0 2px 4px #21315004; }
.account-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--brand); font-size: 12px; font-weight: 700; }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 11px; font-weight: 650; }
.account-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.account-menu { color: var(--muted); }
.empty-side { padding: 10px 6px; color: var(--muted); font-size: 12px; }
.compose-button { width: 100%; margin-top: 22px; background: var(--brand); color: white; }
.compose-button:hover { background: var(--brand-deep); }
.compose-button span { font-size: 19px; font-weight: 400; }
.folder-section { min-height: 0; flex: 1; display: flex; flex-direction: column; margin-top: 30px; }
.folder-section .eyebrow { margin: 0 10px 12px; color: var(--muted); font-size: 9px; }
.folder-list { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 4px; }
.folder-item { width: 100%; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 0; border-radius: 7px; padding: 10px 10px 10px calc(10px + var(--folder-depth, 0) * 14px); background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.folder-item:hover { background: #eaf0f7; }
.folder-item.active { color: var(--brand); background: #e4eaf4; font-weight: 650; }
.folder-item.drop-target { background: var(--tint); outline: 2px solid var(--turquoise-ink); outline-offset: -2px; }
.folder-icon { display: grid; place-items: center; color: inherit; font-size: 17px; }
.folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.folder-count { min-width: 20px; text-align: center; border-radius: 4px; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.folder-item.active .folder-count { background: white; padding: 1px 5px; }
.sidebar-foot { margin-top: auto; padding: 20px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.sidebar-foot a { display: block; color: var(--muted); line-height: 1.7; text-decoration: none; margin-bottom: 18px; }
.sidebar-foot p { display: flex; gap: 7px; align-items: center; margin: 0; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--turquoise-ink); }
.mail-content { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: white; }
.content-head { min-height: 93px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.content-head .eyebrow { font-size: 9px; color: var(--muted); margin-bottom: 5px; letter-spacing: .055em; overflow-wrap: anywhere; }
.content-head h1 { margin: 0; font-size: 23px; font-weight: 650; }
.head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.account-tools > summary { list-style: none; }
.search-launch > span { font-size: 22px; line-height: .5; }
.welcome-state, .message-placeholder { display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.welcome-state { padding: 45px 20px; }
.welcome-state .eyebrow { margin: 24px 0 0; }
.welcome-state h2 { margin: 12px 0; color: var(--ink); font-size: 30px; font-weight: 650; }
.welcome-state > p:not(.eyebrow) { margin: 0 0 26px; font-size: 13px; line-height: 1.8; }
.welcome-icon { display: grid; place-items: center; width: 66px; height: 66px; border: 1px solid #c2e6ec; border-radius: 20px; background: var(--tint); color: var(--turquoise-ink); font-size: 30px; }
.mail-columns { min-height: 0; display: grid; grid-template-columns: minmax(290px, 35%) minmax(0, 1fr); }
.message-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--line); background: white; }
.message-card { display: grid; gap: 6px; width: 100%; border: 0; border-bottom: 1px solid #eaf0f5; padding: 20px 22px; background: white; color: inherit; text-align: left; cursor: pointer; }
.message-card:hover { background: #f7f9fc; }
.message-card.active { background: #eef6f9; box-shadow: inset 3px 0 var(--turquoise); }
.message-card.unread { border-left: 3px solid var(--brand); padding-left: 19px; }
.message-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.message-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; }
.message-card.unread .message-top strong, .message-card.unread h3 { font-weight: 750; }
.message-top time { flex: none; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.message-card h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; letter-spacing: 0; }
.message-card p { margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.conversation-count, .attachment-indicator { color: var(--muted); font-size: 10px; }
.message-more { display: block; width: calc(100% - 32px); margin: 16px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--brand); cursor: pointer; font-size: 12px; font-weight: 600; }
.message-view { min-width: 0; overflow-y: auto; padding: 32px clamp(20px, 3vw, 44px); background: #fcfdff; }
.message-placeholder { height: 100%; font-size: 13px; line-height: 1.8; }
.message-placeholder span { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid var(--line); border-radius: 18px; background: white; font-size: 28px; color: var(--muted); margin-bottom: 20px; }
.message-head { padding-bottom: 26px; }
.message-head h2 { margin: 0 0 10px; font-size: 27px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.conversation-summary { color: var(--muted); margin: 0; font-size: 11px; }
.thread-item { margin-top: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.thread-preview { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.thread-actions .text-button { font-size: 11px; }
.thread-actions select { width: auto; max-width: 100%; font-size: 11px; padding: 8px; }
.thread-item .message-body { padding: 26px 0 8px; }
.thread-attachment-marker { margin-left: auto; font-size: 15px; }
.message-attachments { margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 11px; }
.message-attachments ul { margin: 8px 0 0; padding-left: 16px; }
.message-attachments li { margin-top: 8px; overflow-wrap: anywhere; }
.mobile-back { display: none; margin-bottom: 24px; }
.sender { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sender > div { min-width: 0; }
.sender strong { font-size: 12px; }
.sender-avatar { display: grid; flex-shrink: 0; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--tint); color: var(--turquoise-ink); font-weight: 700; }
.sender small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; overflow-wrap: anywhere; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #314058; font-size: 13px; line-height: 1.85; }
.loading, .empty-list { padding: 40px 24px; color: var(--muted); text-align: center; font-size: 12px; }
.from-line { margin: 0; padding: 12px; border-radius: 7px; background: var(--paper); color: var(--muted); font-size: 12px; }
#compose-dialog { width: min(740px, calc(100% - 32px)); }
.compose-form textarea { min-height: 180px; }
.mobile-compose { display: none; }
/* Contacts. */
#contacts-dialog { width: min(1180px, calc(100% - 40px)); height: min(800px, calc(100dvh - 64px)); max-height: none; }
.contacts-shell { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100%; }
.contacts-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.contacts-head h2 { margin: 0; font-size: 26px; }
.contacts-head p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.contacts-head-actions { display: flex; gap: 9px; align-items: center; }
.contact-permission { margin: 16px 24px 0; padding: 12px 16px; border: 1px solid #c2e6ec; border-radius: 8px; background: var(--tint); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contact-permission p { margin: 0; font-size: 12px; line-height: 1.6; }
.contacts-workspace { min-height: 0; display: grid; grid-template-columns: minmax(280px, 34%) minmax(0, 1fr); }
.contacts-browser { display: flex; flex-direction: column; min-height: 0; padding: 22px; border-right: 1px solid var(--line); background: var(--paper); }
.contact-search-label { margin-bottom: 7px; }
.contacts-progress { min-height: 18px; margin: 12px 0; color: var(--muted); font-size: 11px; }
.contacts-list { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.contact { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 11px; padding: 14px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.contact.active, .contact:hover { background: white; border-color: var(--line); }
.contact-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--tint); color: var(--turquoise-ink); font-weight: 650; }
.contact strong, .contact small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact strong { font-size: 12px; }
.contact small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.contact-detail, .contact-form { min-width: 0; overflow-y: auto; padding: 30px; }
.contact-placeholder { display: grid; place-items: center; align-content: center; height: 100%; text-align: center; color: var(--muted); }
.contact-placeholder span { font-size: 36px; }
.contact-placeholder h3 { margin: 20px 0 10px; }
.contact-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 30px; }
.contact-hero h3 { font-size: 27px; margin: 0 0 6px; }
.contact-hero p { margin: 0; color: var(--muted); }
.contact-detail-head { display: flex; justify-content: flex-start; align-items: center; gap: 20px; }
.contact-detail h3 { font-size: 27px; }
.contact-detail dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 18px; line-height: 1.7; }
.contact-detail dt { color: var(--muted); font-size: 12px; }
.contact-detail dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.contact-detail dd a { display: block; }
.contact-form { display: grid; align-content: start; gap: 20px; }
.contact-form-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-wide { grid-column: 1 / -1; }
/* Security and administration. */
.token-list { display: grid; gap: 10px; }
.token-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.token-item span { display: grid; gap: 5px; min-width: 0; }
.token-item strong, .token-item small { overflow-wrap: anywhere; }
.token-item strong { font-size: 12px; }
.token-item small { color: var(--muted); font-size: 11px; }
#archives-dialog { width: min(900px, calc(100% - 32px)); }
#archives-dialog .dialog-body { max-height: 85dvh; }
.archives-list { display: grid; gap: 12px; }
.technical-admin { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 8px; }
.technical-admin > p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.technical-admin .archives-list { margin-top: 14px; }
.technical-admin .archive-card button { margin-top: 10px; }
.archive-card { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: var(--paper); }
.archive-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.archive-card-head strong { overflow-wrap: anywhere; }
.archive-card p { margin: 10px 0 0; color: var(--muted); overflow-wrap: anywhere; font-size: 11px; line-height: 1.7; }
.archive-state { color: var(--turquoise-ink); }
.archive-failed { color: var(--danger); font-weight: 650; }
#technical-reveal, #token-reveal, #send-token-reveal, #mfa-recovery { padding: 18px; background: var(--tint); border-radius: 8px; }
#technical-reveal label { margin-top: 10px; }
#token-reveal { display: grid; gap: 12px; }
#token-reveal p { margin: 0; }
.mfa-qr { display: block; width: 200px; height: 200px; max-width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; }
#mfa-recovery-codes { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
#mfa-manual-secret { overflow-wrap: anywhere; user-select: all; }
.search-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 0; }
#contact-search-advanced { padding: 8px 0; font-size: 11px; }
summary { cursor: pointer; }
/* UAT indicator remains distinct from both production and the local fictitious demo. */
#ilygo-uat-banner { position: sticky; top: 0; z-index: 30; min-height: 40px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: center; padding: 6px 14px; background: #92400e; border-bottom: 3px solid #f59e0b; color: white; font: 500 13px/1.35 system-ui, sans-serif; text-align: center; }
#ilygo-uat-banner a { color: white; text-decoration: underline; }
.uat-chip { background: #7c2d12; border-radius: 4px; padding: 2px 7px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.uat-more, .uat-toggle { background: none; color: white; cursor: pointer; font: inherit; border: 1px solid #ffffff99; border-radius: 5px; padding: 3px 10px; }
.uat-toggle { border-color: transparent; text-decoration: underline; padding: 3px 4px; }
.uat-short { display: none; }
#ilygo-uat-banner[data-collapsed] { min-height: 28px; padding: 2px 14px; }
#ilygo-uat-banner[data-collapsed] .uat-txt, #ilygo-uat-banner[data-collapsed] .uat-mail-lead, #ilygo-uat-banner[data-collapsed] .uat-more { display: none; }
#ilygo-uat-banner[data-collapsed] .uat-short { display: inline; }
.uat-dialog-body p { margin: 0; line-height: 1.6; }
.uat-foot { border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .landing-hero { gap: 45px; padding: 65px 36px 75px; }
  .public-header { padding: 24px 36px; }
  .mail-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .mail-columns { grid-template-columns: minmax(265px, 40%) minmax(0, 1fr); }
  #user-name { max-width: 145px; }
  .head-actions { gap: 5px; }
  .head-actions .button { font-size: 11px; padding: 9px; }
}
@media (max-width: 860px) {
  .public-header nav { gap: 20px; }
  .public-header nav > a:first-child { display: none; }
  .landing-hero { grid-template-columns: minmax(0, 1fr) minmax(295px, .8fr); gap: 30px; }
  .hero-copy h1 { font-size: 39px; }
  .hero-lead { font-size: 14px; }
  .hero-actions { gap: 16px; }
  .auth-card { padding: 26px; }
  .auth-column::before { inset: -12px -12px 20px 12px; }
  .journey-cards { gap: 14px; }
  .journey-cards li { padding: 23px; }
  .landing-guide { align-items: flex-start; flex-direction: column; }
  .mail-columns { grid-template-columns: 1fr; }
  .message-view { display: none; }
  .mail-columns.show-message .message-list { display: none; }
  .mail-columns.show-message .message-view { display: block; }
  .mobile-back { display: inline-flex; }
  .content-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .head-actions { width: 100%; justify-content: flex-start; }
  .contacts-workspace { grid-template-columns: minmax(230px, 38%) minmax(0, 1fr); }
  .contact-fields { grid-template-columns: 1fr; }
  .public-footer .brand b { display: none; }
  .help-link { display: none; }
}
@media (max-width: 620px) {
  .public-header { padding: 20px; gap: 10px; }
  .public-header .brand b { display: none; }
  .public-header nav { gap: 12px; font-size: 11px; }
  .public-header nav .button { font-size: 11px; padding: 10px; }
  .landing-hero { display: flex; flex-direction: column; padding: 44px 24px 48px; gap: 36px; align-items: stretch; }
  .hero-copy h1 { font-size: clamp(35px, 9vw, 48px); }
  .hero-copy .eyebrow { font-size: 9px; }
  .hero-lead { font-size: 15px; }
  .provider-strip { gap: 18px; margin-top: 30px; font-size: 11px; }
  .auth-column { padding: 0; }
  .auth-column::before { display: none; }
  .auth-card { padding: 28px; }
  .landing-section { padding: 44px 24px; }
  .journey-cards { grid-template-columns: 1fr; gap: 16px; }
  .step-number { margin-bottom: 18px; }
  .landing-guide { padding: 44px 24px; }
  .public-footer { padding: 26px 24px; gap: 18px; }
  .public-footer nav { margin-left: 0; width: 100%; }
  .app-shell { grid-template-rows: 58px minmax(0, 1fr); }
  .app-header { padding: 0 14px; gap: 10px; }
  .app-header .brand { font-size: 17px; gap: 7px; }
  .app-header .brand b { display: none; }
  .sidebar-toggle { display: inline-grid; border: 0; background: transparent; width: 30px; height: 40px; }
  #user-name { display: none; }
  .user-tools summary > span:last-child { display: none; }
  .mail-layout { grid-template-columns: 1fr; position: relative; }
  .sidebar { display: none; position: absolute; z-index: 10; inset: 0; background: var(--paper); padding: 22px; }
  .app-shell[data-nav-open] .sidebar { display: flex; }
  .account-list { max-height: 34%; }
  .compose-button { margin-top: 18px; }
  .folder-section { margin-top: 22px; }
  .folder-item { min-height: 43px; }
  .sidebar-foot { padding-top: 14px; }
  .sidebar-foot a { margin-bottom: 12px; }
  .content-head { padding: 20px 18px 16px; gap: 14px; }
  .content-head h1 { font-size: 22px; }
  .head-actions { justify-content: space-between; gap: 6px; }
  .head-actions .button { min-height: 38px; font-size: 11px; padding: 8px 10px; }
  .head-actions .icon-button { width: 36px; height: 38px; }
  .dropdown-panel { min-width: 240px; }
  .mobile-compose:not(.hidden) { display: inline-flex; position: fixed; z-index: 8; right: 20px; bottom: 22px; box-shadow: 0 7px 24px #21315030; min-height: 46px; }
  .message-list { padding-bottom: 80px; }
  .message-card { padding: 20px; }
  .message-card.unread { padding-left: 17px; }
  .message-top strong, .message-card h3 { font-size: 13px; }
  .message-card p { font-size: 12px; }
  .message-view { padding: 22px 18px 90px; }
  .message-head h2 { font-size: 24px; }
  .thread-item { padding: 18px; }
  .thread-actions { gap: 10px; }
  .thread-actions .text-button { min-height: 40px; }
  .sender small { font-size: 10px; }
  dialog, #compose-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .dialog-body { padding: 22px; gap: 18px; }
  .dialog-actions .button { min-height: 43px; }
  .search-fields { grid-template-columns: 1fr; }
  #contacts-dialog { width: calc(100% - 16px); height: calc(100dvh - 24px); }
  .contacts-head { padding: 18px; align-items: flex-start; }
  .contacts-head h2 { font-size: 23px; }
  .contacts-head-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .contacts-head-actions .button { font-size: 10px; padding: 8px; }
  .contact-permission { margin: 12px; display: block; }
  .contact-permission .button { margin-top: 10px; }
  .contacts-workspace { display: block; overflow-y: auto; }
  .contacts-browser { height: 40%; min-height: 220px; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .contact-detail, .contact-form { min-height: 60%; height: auto; overflow: visible; padding: 22px; }
  .contact-detail dl { grid-template-columns: 1fr; gap: 8px; }
  .contact-detail dd { margin-bottom: 16px; }
  #ilygo-uat-banner .uat-txt, #ilygo-uat-banner .uat-mail-lead { display: none; }
  #ilygo-uat-banner .uat-short { display: inline; }
  #ilygo-uat-banner[data-collapsed] { flex-wrap: nowrap; }
  #ilygo-uat-banner[data-collapsed] .uat-short { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print { .app-header, .sidebar, .head-actions, .mobile-compose, .thread-actions { display: none !important; } .app-shell, .mail-layout, .mail-columns { display: block; height: auto; overflow: visible; } .message-list { display: none; } .message-view { display: block; overflow: visible; } #ilygo-uat-banner { position: static; } }
/* Internal ILYGO connection console. */
.workspace-tabs { align-self: stretch; display: flex; gap: 28px; margin: 0 auto 0 55px; }
.workspace-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 2px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.workspace-tab.active { color: var(--brand); border-color: var(--turquoise-ink); }
.connections-view { min-height: 0; overflow-y: auto; padding: 50px max(36px, calc((100% - 1216px) / 2)); background: var(--paper); }
.connections-heading { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.connections-heading .eyebrow { font-size: 9px; margin-bottom: 12px; }
.connections-heading h1 { font-size: 35px; margin: 0 0 14px; font-weight: 650; }
.connections-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.connections-heading > .button { flex-shrink: 0; }
.connection-summary { display: flex; align-items: center; gap: 40px; padding: 24px 28px; margin-top: 32px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.connection-summary > div { display: flex; align-items: baseline; gap: 12px; }
.connection-summary strong { font-size: 26px; font-weight: 650; letter-spacing: -.03em; }
.connection-summary span { color: var(--muted); font-size: 11px; }
.connection-summary .summary-auth { margin-left: auto; align-items: center; }
.connection-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: 40px 0 20px; }
.connection-section-head h2 { font-size: 17px; font-weight: 650; margin: 0; }
.connection-section-head a { font-size: 11px; text-decoration: none; }
.connection-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.connection-card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; }
.connection-card-top { display: flex; gap: 10px; align-items: center; margin-bottom: 26px; }
.connection-provider { font-size: 11px; color: var(--muted); }
.connection-kind { margin-left: auto; padding: 3px 7px; border-radius: 5px; background: var(--paper); color: var(--muted); font-size: 9px; }
.connection-card h3 { font-size: 17px; font-weight: 650; margin-bottom: 8px; }
.connection-address { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin-bottom: 22px; }
.connection-permissions { display: flex; flex-wrap: wrap; gap: 7px; }
.connection-permissions > span { font-size: 10px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; color: #4d617b; background: #fafbfd; }
.connection-parent { color: var(--muted); font-size: 10px; line-height: 1.8; margin: 12px 0 0; overflow-wrap: anywhere; }
.connection-actions { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 26px; }
.connection-actions > .button { font-size: 10px; padding: 9px 11px; }
.connection-actions > details { margin-left: auto; }
.connection-actions .icon-button { width: 30px; height: 32px; font-size: 20px; list-style: none; }
.connection-actions .dropdown-panel { min-width: 245px; }
.console-note { display: flex; align-items: center; gap: 20px; padding: 24px 26px; margin-top: 34px; border: 1px solid #c8e4eb; border-radius: 10px; background: #edf7f9; }
.console-note > span { color: var(--turquoise-ink); font-size: 24px; }
.console-note p { margin: 0; color: #486077; font-size: 11px; line-height: 1.8; max-width: 820px; }
.console-note p strong { color: var(--brand); display: block; margin-bottom: 4px; font-size: 12px; }
.console-note a { margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 600; }
.connections-empty { display: flex; flex-direction: column; align-items: center; padding: 45px 24px; text-align: center; background: white; border: 1px dashed #b4c2d5; border-radius: 12px; }
.connections-empty h2 { font-size: 25px; margin: 24px 0 12px; }
.connections-empty p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.connections-empty > a { margin-top: 18px; font-size: 11px; }
.contact-detail-head .contact-avatar { width: 50px; height: 50px; font-size: 18px; }
.contact-detail-head h3 { margin: 0 0 6px; }
.contact-detail-subtitle { color: var(--muted); margin: 0; font-size: 12px; }
.contact-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0; }
@media(min-width: 861px) and (max-width: 1150px) { .connection-cards { grid-template-columns: repeat(2, minmax(0,1fr)); } .workspace-tabs { margin-left: 15px; gap: 20px; } .user-menu { gap: 12px; } }
@media(max-width: 860px) { .connection-cards { grid-template-columns: repeat(2,minmax(0,1fr)); } .connections-view {padding:36px 26px;} .workspace-tabs {margin-left:auto;gap:20px;} .app-header .brand b {display:none;} .connection-card {padding:20px;} .connections-heading h1 {font-size:29px;} .connection-summary {gap:24px;padding:20px;} .connection-summary .summary-auth {display:none;} }
@media(max-width: 620px) {
  .connections-view {padding:28px 20px;}
  .connections-heading {align-items:flex-start;flex-direction:column;gap:22px;}
  .connections-heading h1 {font-size:30px;}
  .connection-summary {gap:32px;margin-top:24px;padding:18px 22px;}
  .connection-summary > div {display:block;}
  .connection-summary strong {display:block;margin-bottom:3px;}
  .connection-cards {grid-template-columns:1fr;gap:16px;}
  .connection-section-head {margin-top:30px;display:block;}
  .connection-section-head a {display:inline-block;margin-top:10px;line-height:1.8;}
  .connection-card {padding:24px;}
  .connection-actions > .button {font-size:11px;min-height:40px;}
  .connection-card .icon-button {width:38px;height:40px;}
  .connection-card-top {margin-bottom:22px;}
  .connection-card h3 {font-size:19px;}
  .connection-address {font-size:13px;}
  .console-note {align-items:flex-start;padding:20px;gap:12px;flex-wrap:wrap;}
  .console-note p {flex:1;min-width:200px;}
  .console-note a {margin-left:35px;}
  .workspace-tabs {gap:14px;margin-left:auto;}
  .workspace-tab {font-size:11px;}
  .app-header {gap:12px;}
  .user-menu {gap:0;}
  .app-header-brand {gap:5px;}
  .app-header .brand {font-size:15px;}
  .app-header .brand-mark {display:none;}
  .app-shell:has(#connections-view:not(.hidden)) .sidebar-toggle {display:none;}
  .hero-copy h1 {font-size:42px;}
}

.brand-logo { display:block; width:23px; height:38px; object-fit:contain; flex-shrink:0; }
@media(max-width:620px){ .app-header .brand-logo {width:18px;height:31px;} }

.admin-tabs { display:flex; align-items:stretch; gap:26px; border-bottom:1px solid var(--line); padding-bottom:0; }
.admin-tabs .workspace-tab {padding:6px 0 14px;}
#admin-archive-panel > h3 {margin-bottom:16px;}
#admin-archive-panel > .form-message {margin-bottom:14px;}
#technical-admin {border:0;margin:0;padding:0;}
#technical-admin > h3 {margin-bottom:12px;}
#technical-admin h4 {margin:26px 0 12px;font-size:13px;}
@media(max-width:620px){.workspace-tabs {gap:11px;}.workspace-tab {font-size:10px;} .workspace-tabs:has(#platform-apps-button:not(.hidden)) {gap:9px;} .app-header:has(#platform-apps-button:not(.hidden)) .brand {font-size:13px;}.app-header:has(#platform-apps-button:not(.hidden)) .brand-logo {display:none;} }
