/* ==================================================================== *
 * SmartMail front end
 *
 * Two components live here: the branded webmail login card
 * ([smartmail_login]) and the mail desk ([smartmail_desk]).
 *
 * IMPORTANT — why there is no prefers-color-scheme here.
 * That media query reports the *visitor's* OS preference, which says nothing
 * about the background the *theme* actually paints. A visitor in dark mode on
 * a light theme got light text on a white page and the desk became unreadable.
 * So the desk paints its own surface and uses one fixed, high-contrast palette
 * that works on any theme. A dark presentation is opt-in per shortcode
 * (theme="dark"), never inferred.
 * ==================================================================== */

/* -------------------------------------------------------------------- *
 * Webmail login card
 * -------------------------------------------------------------------- */

.smartmail-login-card {
	max-width: 480px;
	margin: 3rem auto;
	padding: 2.5rem 2rem;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.smartmail-login-logo { max-width: 140px; height: auto; margin: 0 auto 1.5rem; display: block; }
.smartmail-login-heading { margin: 0 0 0.5rem; font-size: 1.75rem; font-weight: 700; color: #1d2327; line-height: 1.2; }
.smartmail-login-tagline { margin: 0 0 1.5rem; font-size: 1rem; color: #50575e; }

.smartmail-login-hint {
	margin: 0 0 2rem;
	padding: 0.75rem 1rem;
	background: #f0f6fc;
	border-radius: 6px;
	font-size: 0.95rem;
	color: #1d2327;
}
.smartmail-login-hint strong { color: #2271b1; font-family: monospace; }

.smartmail-login-button {
	display: inline-block;
	padding: 0.85rem 2rem;
	background: #2271b1;
	color: #fff !important;
	border-radius: 8px;
	text-decoration: none !important;
	font-size: 1.05rem;
	font-weight: 600;
	transition: background 0.15s ease, transform 0.15s ease;
	box-shadow: 0 2px 8px rgba(34, 113, 177, 0.25);
}
.smartmail-login-button:hover { background: #135e96; transform: translateY(-1px); }
.smartmail-login-button:active { transform: translateY(0); }

.smartmail-login-help {
	margin-top: 2.5rem;
	text-align: left;
	font-size: 0.9rem;
	color: #50575e;
	border-top: 1px solid #f0f0f1;
	padding-top: 1.5rem;
}
.smartmail-login-help summary { cursor: pointer; color: #2271b1; font-weight: 500; margin-bottom: 0.5rem; }
.smartmail-login-help ul { margin: 0.5rem 0 0 1.25rem; padding: 0; }
.smartmail-login-help li { margin-bottom: 0.4rem; line-height: 1.5; }

/* ==================================================================== *
 * Mail desk
 * ==================================================================== */

.smartmail-desk,
.smartmail-modal {
	--sm-fg: #1d2327;
	--sm-muted: #5c6269;
	--sm-line: #dbdee1;
	--sm-bg: #fff;
	--sm-canvas: #f2f3f5;
	--sm-sunk: #f6f7f7;
	--sm-accent: #2271b1;
	--sm-accent-fg: #fff;
	--sm-danger: #b32d2e;
	--sm-ok: #1a7f4b;
	--sm-warn: #9a6c00;
	--sm-radius: 12px;
	--sm-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Opt-in dark presentation: [smartmail_desk theme="dark"] */
.smartmail-desk--dark,
.smartmail-modal--dark {
	--sm-fg: #e9eaeb;
	--sm-muted: #a7acb1;
	--sm-line: #3a4149;
	--sm-bg: #1e2429;
	--sm-canvas: #14181c;
	--sm-sunk: #262c32;
	--sm-accent: #5aa0dd;
	--sm-accent-fg: #0b1013;
	--sm-danger: #e8797a;
	--sm-ok: #56c08d;
	--sm-warn: #e0b649;
	--sm-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/*
 * The desk paints its own canvas, so every colour below sits on a surface we
 * control rather than on whatever the theme happens to render.
 */
.smartmail-desk {
	max-width: 1280px;
	margin: 0 auto;
	padding: 22px;
	background: var(--sm-canvas);
	border-radius: 16px;
	color: var(--sm-fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}

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

/*
 * Themes routinely colour headings and labels directly, and that beats an
 * inherited colour. Pin ours so section titles cannot disappear.
 */
.smartmail-desk h1,
.smartmail-desk h2,
.smartmail-desk h3,
.smartmail-desk h4,
.smartmail-desk label,
.smartmail-desk legend,
.smartmail-desk strong,
.smartmail-desk p { color: var(--sm-fg); }

/* Themes also set `display` on containers, which beats the [hidden] default. */
.smartmail-desk [hidden],
.smartmail-list .smartmail-card[hidden] { display: none !important; }

/* --- account bar ----------------------------------------------------- */

.smartmail-account {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	justify-content: flex-end;
	margin-bottom: 0.9rem;
}

.smartmail-profile { position: relative; }

.smartmail-profile-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.3rem 0.6rem 0.3rem 0.35rem;
	border: 1px solid var(--sm-line);
	border-radius: 999px;
	background: var(--sm-bg);
	color: var(--sm-fg);
	font-family: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	box-shadow: var(--sm-shadow);
}
.smartmail-profile-trigger:hover { background: var(--sm-sunk); }

.smartmail-profile-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--sm-accent);
	color: var(--sm-accent-fg);
	font-size: 0.78rem;
	font-weight: 700;
}
.smartmail-profile-who { font-weight: 600; }
.smartmail-profile-caret { font-size: 0.65rem; color: var(--sm-muted); }

.smartmail-profile-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 50;
	min-width: 230px;
	border: 1px solid var(--sm-line);
	border-radius: 10px;
	background: var(--sm-bg);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
	overflow: hidden;
}

.smartmail-profile-head {
	padding: 0.75rem 0.9rem;
	background: var(--sm-sunk);
	border-bottom: 1px solid var(--sm-line);
}
.smartmail-profile-name { font-size: 0.9rem; font-weight: 700; color: var(--sm-fg); }
.smartmail-profile-email { margin-top: 0.1rem; font-size: 0.78rem; color: var(--sm-muted); word-break: break-all; }
.smartmail-profile-role {
	display: inline-block;
	margin-top: 0.35rem;
	padding: 0.05rem 0.45rem;
	border-radius: 999px;
	background: rgba(34, 113, 177, 0.12);
	color: var(--sm-accent);
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.smartmail-desk .smartmail-profile-item {
	display: block;
	width: 100%;
	padding: 0.6rem 0.9rem;
	border: 0;
	background: none;
	color: var(--sm-fg);
	font-family: inherit;
	font-size: 0.85rem;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.smartmail-desk .smartmail-profile-item:hover { background: var(--sm-sunk); }
.smartmail-desk .smartmail-profile-logout {
	border-top: 1px solid var(--sm-line);
	color: var(--sm-danger);
	font-weight: 600;
}

/* --- change-password dialog ------------------------------------------ */

.smartmail-pwd-wrap { position: relative; display: flex; }
.smartmail-pwd-wrap input { width: 100%; padding-right: 2.4rem !important; }
.smartmail-pwd-eye {
	position: absolute;
	top: 50%;
	right: 0.4rem;
	transform: translateY(-50%);
	padding: 0.2rem 0.3rem;
	border: 0;
	background: none;
	color: var(--sm-muted);
	font-size: 0.95rem;
	line-height: 1;
	cursor: pointer;
}

.smartmail-pwd-meter {
	display: block;
	height: 4px;
	margin: 0.4rem 0 0.25rem;
	border-radius: 999px;
	background: var(--sm-sunk);
	border: 1px solid var(--sm-line);
	overflow: hidden;
}
.smartmail-pwd-meter-fill { display: block; height: 100%; width: 0; transition: width 0.2s ease; }
.smartmail-pwd-meter-fill.is-1 { background: var(--sm-danger); }
.smartmail-pwd-meter-fill.is-2 { background: var(--sm-warn); }
.smartmail-pwd-meter-fill.is-3 { background: var(--sm-ok); }

/* Result of a dialog action, shown beside the fields it refers to. */
.smartmail-pwd-msg,
.smartmail-form-msg {
	margin: 0.9rem 0 0;
	padding: 0.65rem 0.8rem;
	border-radius: 8px;
	border-left: 4px solid transparent;
	font-size: 0.85rem;
	line-height: 1.45;
}
.smartmail-pwd-msg.is-ok,
.smartmail-form-msg.is-ok {
	background: rgba(26, 127, 75, 0.1);
	border-left-color: var(--sm-ok);
	color: var(--sm-ok);
}
.smartmail-pwd-msg.is-error,
.smartmail-form-msg.is-error {
	background: rgba(179, 45, 46, 0.1);
	border-left-color: var(--sm-danger);
	color: var(--sm-danger);
	font-weight: 500;
}

/* --- header ---------------------------------------------------------- */

.smartmail-desk-head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 1.25rem;
}
.smartmail-desk-title {
	margin: 0;
	padding: 0;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--sm-fg);
}
.smartmail-desk-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* --- buttons --------------------------------------------------------- */

.smartmail-desk .smartmail-btn,
.smartmail-modal .smartmail-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35em;
	padding: 0.5rem 0.9rem;
	border: 1px solid var(--sm-line);
	border-radius: 8px;
	background: var(--sm-bg);
	color: var(--sm-fg);
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: var(--sm-shadow);
	transition: background 0.12s ease, border-color 0.12s ease;
}
.smartmail-desk .smartmail-btn:hover:not(:disabled),
.smartmail-modal .smartmail-btn:hover:not(:disabled) { background: var(--sm-sunk); border-color: var(--sm-muted); }
.smartmail-desk .smartmail-btn:disabled,
.smartmail-modal .smartmail-btn:disabled { opacity: 0.55; cursor: default; }
.smartmail-desk .smartmail-btn:focus-visible,
.smartmail-modal .smartmail-btn:focus-visible { outline: 2px solid var(--sm-accent); outline-offset: 2px; }

.smartmail-desk .smartmail-btn-primary,
.smartmail-modal .smartmail-btn-primary {
	background: var(--sm-accent);
	border-color: var(--sm-accent);
	color: var(--sm-accent-fg);
}
.smartmail-desk .smartmail-btn-primary:hover:not(:disabled),
.smartmail-modal .smartmail-btn-primary:hover:not(:disabled) { filter: brightness(0.93); background: var(--sm-accent); }

.smartmail-desk .smartmail-btn-small,
.smartmail-modal .smartmail-btn-small { padding: 0.34rem 0.6rem; font-size: 0.8rem; }

.smartmail-desk .smartmail-btn-link,
.smartmail-modal .smartmail-btn-link {
	background: none;
	border: 0;
	padding: 0 0.2rem;
	color: var(--sm-accent);
	cursor: pointer;
	font-size: 0.95rem;
	line-height: 1;
}

/* --- notices --------------------------------------------------------- */

.smartmail-desk .smartmail-notice {
	margin: 0 0 1rem;
	padding: 0.8rem 1rem;
	border: 1px solid var(--sm-line);
	border-left: 4px solid var(--sm-accent);
	border-radius: 8px;
	background: var(--sm-bg);
}
.smartmail-desk .smartmail-notice p { margin: 0 0 0.35rem; }
.smartmail-desk .smartmail-notice p:last-child { margin-bottom: 0; }
.smartmail-desk .smartmail-notice-updated { border-left-color: var(--sm-ok); }
.smartmail-desk .smartmail-notice-error { border-left-color: var(--sm-danger); }
.smartmail-notice-detail { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; word-break: break-all; }

/* --- stat tiles ------------------------------------------------------ */

.smartmail-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0.75rem;
	margin-bottom: 1rem;
}
.smartmail-stat {
	padding: 0.9rem 1rem;
	border: 1px solid var(--sm-line);
	border-radius: var(--sm-radius);
	background: var(--sm-bg);
	box-shadow: var(--sm-shadow);
	text-align: center;
}
.smartmail-stat-value { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.15; color: var(--sm-fg); }
.smartmail-stat-label {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--sm-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* --- filter bar ------------------------------------------------------ */

.smartmail-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin: 0 0 1rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--sm-line);
	border-radius: var(--sm-radius);
	background: var(--sm-bg);
	box-shadow: var(--sm-shadow);
}
.smartmail-filters input[type="search"],
.smartmail-filters select {
	padding: 0.45rem 0.65rem;
	border: 1px solid var(--sm-line);
	border-radius: 8px;
	background: var(--sm-bg);
	color: var(--sm-fg);
	font-family: inherit;
	font-size: 0.9rem;
}
.smartmail-filters input[type="search"]::placeholder { color: var(--sm-muted); opacity: 1; }

/* Search field, with room at the right edge for the busy spinner. */
.smartmail-search {
	position: relative;
	display: flex;
	flex: 1 1 260px;
	min-width: 240px;
}
.smartmail-search input[type="search"] {
	width: 100%;
	padding-right: 2.2rem;
}

/*
 * Shown while a search is pending. The authoritative search is a page load, so
 * this covers the debounce and the round-trip — without it, typing looks like
 * nothing is happening until the page suddenly changes.
 */
.smartmail-spinner {
	position: absolute;
	top: 50%;
	right: 0.65rem;
	width: 15px;
	height: 15px;
	margin-top: -8px;
	border: 2px solid var(--sm-line);
	border-top-color: var(--sm-accent);
	border-radius: 50%;
	animation: smartmail-spin 0.7s linear infinite;
	pointer-events: none;
}

@keyframes smartmail-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.smartmail-spinner { animation-duration: 2.4s; }
}
.smartmail-result-count { margin-left: auto; font-size: 0.85rem; color: var(--sm-muted); }
.smartmail-result-count strong { color: var(--sm-fg); }

/* --- mailbox list ---------------------------------------------------- */

.smartmail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

/*
 * Three zones side by side once there is room, stacked below. `auto` on the
 * action column keeps the controls at their natural size instead of stretching
 * them across the full width of a wide screen.
 */
.smartmail-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.6rem 1.25rem;
	align-items: center;
	padding: 0.8rem 1rem;
	border: 1px solid var(--sm-line);
	border-left: 4px solid var(--sm-ok);
	border-radius: var(--sm-radius);
	background: var(--sm-bg);
	box-shadow: var(--sm-shadow);
}
.smartmail-card.is-disabled { border-left-color: var(--sm-muted); background: var(--sm-sunk); }

@media (min-width: 900px) {
	.smartmail-card { grid-template-columns: minmax(0, 1fr) 210px auto; }
}

.smartmail-card-identity { min-width: 0; }
.smartmail-card-line { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.smartmail-card-address { font-size: 0.95rem; font-weight: 600; word-break: break-all; color: var(--sm-fg); }
.smartmail-card-name { margin-top: 0.1rem; font-size: 0.85rem; color: var(--sm-muted); }
.smartmail-card-contact { margin-top: 0.1rem; font-size: 0.78rem; color: var(--sm-muted); display: flex; flex-wrap: wrap; gap: 0.75rem; }

.smartmail-card-usage { min-width: 0; }
.smartmail-usage-line { display: flex; gap: 0.3rem; align-items: baseline; font-size: 0.85rem; color: var(--sm-fg); }
.smartmail-usage-of { color: var(--sm-muted); }
.smartmail-usage-pct { display: inline-block; margin-top: 0.15rem; font-size: 0.72rem; color: var(--sm-muted); }

.smartmail-desk .smartmail-status {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	font-size: 0.66rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
}
.smartmail-desk .smartmail-status-active { background: rgba(26, 127, 75, 0.12); color: var(--sm-ok); }
.smartmail-desk .smartmail-status-disabled { background: rgba(92, 98, 105, 0.14); color: var(--sm-muted); }

.smartmail-desk .smartmail-bar {
	height: 6px;
	margin-top: 0.3rem;
	border-radius: 999px;
	background: var(--sm-sunk);
	border: 1px solid var(--sm-line);
	overflow: hidden;
}
.smartmail-desk .smartmail-bar-fill { height: 100%; background: var(--sm-accent); transition: width 0.25s ease; }
.smartmail-desk .smartmail-bar.is-full .smartmail-bar-fill { background: var(--sm-danger); }

.smartmail-card-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
	justify-content: flex-start;
}
@media (min-width: 900px) {
	.smartmail-card-tools { justify-content: flex-end; flex-wrap: nowrap; }
}

.smartmail-inline { display: inline-flex; gap: 0.25rem; align-items: center; margin: 0; }
.smartmail-quota-form { gap: 0.2rem; }
.smartmail-quota-input {
	width: 5.5em;
	padding: 0.3rem 0.4rem;
	border: 1px solid var(--sm-line);
	border-radius: 8px;
	background: var(--sm-bg);
	color: var(--sm-fg);
	font-family: inherit;
	font-size: 0.8rem;
}
.smartmail-quota-unit { font-size: 0.75rem; color: var(--sm-muted); }

.smartmail-empty {
	padding: 2.5rem 1rem;
	border: 1px dashed var(--sm-line);
	border-radius: var(--sm-radius);
	text-align: center;
	color: var(--sm-muted);
	background: var(--sm-bg);
}

/* --- pagination ------------------------------------------------------ */

.smartmail-pagination { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 1.25rem; justify-content: center; }
.smartmail-page {
	min-width: 2.1rem;
	padding: 0.35rem 0.6rem;
	border: 1px solid var(--sm-line);
	border-radius: 8px;
	background: var(--sm-bg);
	color: var(--sm-fg) !important;
	text-align: center;
	text-decoration: none;
	font-size: 0.85rem;
	line-height: 1.3;
	box-shadow: var(--sm-shadow);
}
.smartmail-page:hover { background: var(--sm-sunk); }
.smartmail-page.current {
	background: var(--sm-accent);
	border-color: var(--sm-accent);
	color: var(--sm-accent-fg) !important;
	font-weight: 700;
}

/* --- create form (inside its dialog) --------------------------------- */

.smartmail-create h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.smartmail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.9rem; }
.smartmail-field { margin: 0; }
.smartmail-field-wide { grid-column: 1 / -1; }
.smartmail-field label { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; font-weight: 600; }
.smartmail-field input[type="text"],
.smartmail-field input[type="email"],
.smartmail-field input[type="tel"],
.smartmail-field select,
.smartmail-field textarea {
	width: 100%;
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--sm-line);
	border-radius: 8px;
	background: var(--sm-bg);
	color: var(--sm-fg);
	font-family: inherit;
	font-size: 0.9rem;
}
.smartmail-input-group { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.smartmail-input-group input { flex: 1 1 auto; min-width: 0; }
.smartmail-suffix { font-size: 0.85rem; color: var(--sm-muted); }
.smartmail-req { color: var(--sm-danger); }
.smartmail-hint { display: block; margin-top: 0.25rem; font-size: 0.78rem; color: var(--sm-muted); }
.smartmail-form-actions { display: flex; gap: 0.5rem; margin: 1.1rem 0 0; }

/* --- staff self-service ---------------------------------------------- */

.smartmail-mine {
	max-width: 480px;
	margin: 0 auto;
	padding: 1.5rem;
	border: 1px solid var(--sm-line);
	border-radius: var(--sm-radius);
	background: var(--sm-bg);
	box-shadow: var(--sm-shadow);
	text-align: center;
}
.smartmail-mine-title { margin: 0 0 0.5rem; font-size: 1.25rem; }
.smartmail-mine-address { margin: 0 0 1.25rem; font-size: 1.05rem; word-break: break-all; }
.smartmail-mine-usage { margin-bottom: 1.25rem; }
.smartmail-mine .smartmail-usage-line { justify-content: center; }
.smartmail-mine-actions { margin: 0 0 0.75rem; }
.smartmail-warn { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--sm-warn); text-align: center; }

/* --- a11y ------------------------------------------------------------ */

.smartmail-desk .screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 600px) {
	.smartmail-desk { padding: 14px; border-radius: 12px; }
	.smartmail-result-count { margin-left: 0; width: 100%; }
	.smartmail-card-tools { justify-content: flex-start; }
}

/* --- signed-out gate: self-service reset ----------------------------- */

.smartmail-gate { max-width: 520px; margin: 0 auto; }

.smartmail-gate-card {
	padding: 1.6rem;
	border: 1px solid var(--sm-line);
	border-radius: var(--sm-radius);
	background: var(--sm-bg);
	box-shadow: var(--sm-shadow);
}
.smartmail-gate-title { margin: 0 0 0.5rem; font-size: 1.2rem; font-weight: 700; color: var(--sm-fg); }
.smartmail-gate-intro { margin: 0 0 1.2rem; font-size: 0.9rem; color: var(--sm-muted); line-height: 1.5; }
.smartmail-gate-form .smartmail-field input[type="email"] {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--sm-line);
	border-radius: 8px;
	background: var(--sm-bg);
	color: var(--sm-fg);
	font-family: inherit;
	font-size: 0.95rem;
}
.smartmail-gate-alt { margin: 1rem 0 0; text-align: center; font-size: 0.85rem; color: var(--sm-muted); }
.smartmail-gate-alt a { color: var(--sm-accent); }
.smartmail-gate-who {
	margin: 0 0 0.9rem;
	padding: 0.5rem 0.7rem;
	border-radius: 8px;
	background: var(--sm-sunk);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.85rem;
	color: var(--sm-fg);
	word-break: break-all;
}
.smartmail-gate-remember label { display: flex; gap: 0.4rem; align-items: center; font-weight: 400; font-size: 0.85rem; }
.smartmail-gate [hidden] { display: none !important; }

/* The gate reused inside the portal selector dialog: the dialog box already
   supplies the surface, so the desk wrapper contributes only its palette. */
.smartmail-desk--bare {
	max-width: none;
	margin: 0;
	padding: 0;
	background: none;
	border-radius: 0;
}
.smartmail-desk--bare .smartmail-gate { max-width: none; }
.smartmail-desk--bare .smartmail-gate-card { border: 0; box-shadow: none; padding: 0; background: none; }

/* Details inherited from HRMS: visible, but edited at source. */
.smartmail-src-tag {
	display: inline-block;
	margin-left: 0.35rem;
	padding: 0.02rem 0.35rem;
	border-radius: 999px;
	background: rgba(34, 113, 177, 0.12);
	color: var(--sm-accent);
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	vertical-align: middle;
}
.smartmail-form-msg.is-inherited {
	background: rgba(34, 113, 177, 0.08);
	border-left-color: var(--sm-accent);
	color: var(--sm-fg);
}
.smartmail-form-msg.is-inherited a { color: var(--sm-accent); }
.smartmail-field input.is-inherited {
	background: var(--sm-sunk);
	color: var(--sm-muted);
	cursor: not-allowed;
}
