/* MealSecretary — one consistent, calm interface for every surface. */
:root {
	--bg: #f5f7f8;
	--surface: #ffffff;
	--surface-2: #f9fafb;
	--text: #18212b;
	--muted: #5f6b7a;
	--border: #e2e6ea;
	--border-strong: #cfd5dc;
	--primary: #0e7a6d;
	--primary-strong: #0a5f55;
	--primary-soft: #e6f4f1;
	--focus: #2563eb;
	--good: #087443;
	--good-soft: #e7f6ee;
	--warn: #a15c07;
	--warn-soft: #fdf3e2;
	--bad: #b42318;
	--bad-soft: #fdecea;
	--info: #1d5fbf;
	--info-soft: #e9f1fc;
	--neutral-soft: #eef1f4;
	--radius: 10px;
	--radius-sm: 7px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
	--shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0f1418; --surface: #161d22; --surface-2: #1b242a; --text: #e8edf1; --muted: #9aa7b2;
		--border: #27323a; --border-strong: #34424c; --primary: #2bb3a2; --primary-strong: #48c9b8; --primary-soft: #12302c;
		--good: #4ccf8e; --good-soft: #10291d; --warn: #f0b04f; --warn-soft: #2e2311; --bad: #f2786d; --bad-soft: #321614;
		--info: #79a9f2; --info-soft: #132339; --neutral-soft: #212b32; color-scheme: dark;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ms { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
.ms a { color: var(--primary); text-decoration: none; }
.ms a:hover { text-decoration: underline; }
.ms h1, .ms h2, .ms h3 { line-height: 1.25; margin: 0; }
.ms h1 { font-size: 1.5rem; font-weight: 650; }
.ms h2 { font-size: 1.05rem; font-weight: 650; }
.ms h3 { font-size: 1rem; font-weight: 600; }
.ms p { margin: 0 0 .75rem; }
.ms :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ms-sr, .ms-skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ms-skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.ms-muted { color: var(--muted); }
.ms-small { font-size: .85rem; }
.ms-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; letter-spacing: .02em; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.ms-topbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.ms-topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 0 20px; min-height: 58px; }
.ms-brand { display: flex; align-items: center; gap: 10px; color: var(--text) !important; font-weight: 700; font-size: 1.05rem; text-decoration: none !important; white-space: nowrap; }
.ms-brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; overflow: hidden; background: #0e7a6d; color: #fff; font-size: .8rem; letter-spacing: .03em; }
.ms-primary-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.ms-primary-nav > a, .ms-primary-nav summary { color: var(--text); padding: 8px 12px; border-radius: 8px; font-weight: 500; cursor: pointer; list-style: none; white-space: nowrap; }
.ms-primary-nav summary::-webkit-details-marker { display: none; }
.ms-primary-nav > a:hover, .ms-primary-nav summary:hover { background: var(--surface-2); text-decoration: none; }
.ms-primary-nav .is-active { background: var(--primary-soft); color: var(--primary-strong); }
.ms-primary-nav--guest { justify-content: flex-end; }
.ms-nav-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ms-menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 1.1rem; color: var(--text); }
.ms-dropdown { position: relative; }
.ms-dropdown summary { display: flex; align-items: center; gap: 6px; }
.ms-dropdown summary::after { content: "▾"; font-size: .75em; color: var(--muted); }
.ms-dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; max-height: 70vh; overflow: auto; }
.ms-dropdown-menu--right, .ms-context .ms-dropdown-menu { left: auto; right: 0; }
.ms-dropdown-menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.ms-dropdown-menu a:hover { background: var(--surface-2); text-decoration: none; }
.ms-dropdown-label { display: block; padding: 8px 10px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ms-context summary { font-size: .9rem; border: 1px solid var(--border); }
.ms-bell { position: relative; padding: 8px 10px; border-radius: 8px; text-decoration: none !important; }
.ms-bell:hover { background: var(--surface-2); }
.ms-bell-count { position: absolute; top: 2px; right: 0; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 10px; padding: 0 5px; line-height: 16px; }
.ms-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; font-size: .8rem; flex: none; }
.ms-avatar--lg { width: 56px; height: 56px; font-size: 1.2rem; }
.ms-dev-banner { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: .82rem; padding: 6px 12px; border-bottom: 1px solid var(--border); }

/* ---------------------------------------------------------------- shell */
.ms-shell { max-width: 1280px; margin: 0 auto; padding: 24px 20px 64px; display: block; }
.ms-shell.has-sidenav { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.ms-shell.is-bare { max-width: 480px; }
.ms-main { min-width: 0; outline: none; }
.ms-sidenav { position: sticky; top: 82px; }
.ms-sidenav-title { font-weight: 700; padding: 0 10px 10px; display: flex; flex-direction: column; }
.ms-sidenav-title small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.ms-sidenav nav { display: flex; flex-direction: column; gap: 2px; }
.ms-sidenav nav a { display: flex; justify-content: space-between; align-items: center; color: var(--text); padding: 8px 10px; border-radius: 8px; font-size: .94rem; }
.ms-sidenav nav a:hover { background: var(--surface); text-decoration: none; }
.ms-sidenav nav a.is-active { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; color: var(--primary-strong); }
.ms-sidenav-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.ms-count { background: var(--warn-soft); color: var(--warn); font-size: .75rem; font-weight: 700; border-radius: 10px; padding: 0 7px; }
.ms-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }

/* ---------------------------------------------------------------- page structure */
.ms-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ms-page-head p { margin: 4px 0 0; }
.ms-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ms-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.ms-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ms-card-body { padding: 18px; }
.ms-card-body > :last-child { margin-bottom: 0; }
.ms-card--flush .ms-card-body { padding: 0; }
.ms-grid { display: grid; gap: 20px; }
.ms-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ms-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ms-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.ms-stat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text) !important; }
a.ms-stat:hover { border-color: var(--primary); text-decoration: none; }
.ms-stat-value { font-size: 1.6rem; font-weight: 700; }
.ms-stat-label { color: var(--muted); font-size: .88rem; }
.ms-stat-hint { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.ms-dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px 16px; margin: 0; }
.ms-dl dt { color: var(--muted); }
.ms-dl dd { margin: 0; overflow-wrap: anywhere; }
.ms-list { list-style: none; margin: 0; padding: 0; }
.ms-list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ms-list > li:last-child { border-bottom: 0; }
.ms-list-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ms-list-main > div { min-width: 0; }
.ms-list-title { font-weight: 600; }
.ms-list-sub { color: var(--muted); font-size: .86rem; }

/* ---------------------------------------------------------------- buttons */
.ms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font: 600 .92rem/1.2 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; min-height: 40px; }
.ms-btn--primary { background: var(--primary); color: #fff !important; }
.ms-btn--primary:hover { background: var(--primary-strong); }
.ms-btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text) !important; }
.ms-btn--secondary:hover { background: var(--surface-2); }
.ms-btn--ghost { background: transparent; color: var(--primary) !important; }
.ms-btn--ghost:hover { background: var(--primary-soft); }
.ms-btn--danger { background: var(--surface); border-color: var(--bad); color: var(--bad) !important; }
.ms-btn--danger:hover { background: var(--bad-soft); }
.ms-btn--sm { padding: 5px 10px; min-height: 32px; font-size: .85rem; }
.ms-btn--lg { padding: 13px 22px; min-height: 50px; font-size: 1.02rem; }
.ms-btn--block { width: 100%; }
.ms-btn[disabled], .ms-btn.is-busy { opacity: .6; cursor: progress; }
.ms-btn.is-busy::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ms-spin .7s linear infinite; }
@keyframes ms-spin { to { transform: rotate(360deg); } }
.ms-icon-btn { background: none; border: 0; font-size: 1.5rem; line-height: 1; padding: 2px 8px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.ms-icon-btn:hover { background: var(--surface-2); }
.ms-link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.ms-link-btn:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- badges & notices */
.ms-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.ms-badge--good { background: var(--good-soft); color: var(--good); }
.ms-badge--warn { background: var(--warn-soft); color: var(--warn); }
.ms-badge--bad { background: var(--bad-soft); color: var(--bad); }
.ms-badge--info { background: var(--info-soft); color: var(--info); }
.ms-badge--neutral { background: var(--neutral-soft); color: var(--muted); }
.ms-notice { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; }
.ms-notice--info { background: var(--info-soft); color: var(--info); }
.ms-notice--good { background: var(--good-soft); color: var(--good); }
.ms-notice--warn { background: var(--warn-soft); color: var(--warn); }
.ms-notice--bad { background: var(--bad-soft); color: var(--bad); }
.ms-dev-code { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; font-size: .9rem; }
.ms-dev-code strong { font-family: ui-monospace, monospace; font-size: 1.1rem; letter-spacing: .15em; }

/* ---------------------------------------------------------------- forms */
.ms-form { display: block; }
.ms-field { margin-bottom: 16px; border: 0; padding: 0; min-width: 0; }
.ms-field label, .ms-field legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.ms-optional { font-weight: 400; color: var(--muted); }
.ms input[type=text], .ms input[type=email], .ms input[type=tel], .ms input[type=password], .ms input[type=number], .ms input[type=date], .ms input[type=time], .ms input[type=search], .ms select, .ms textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 15px/1.4 var(--font); min-height: 42px;
}
.ms textarea { min-height: 80px; resize: vertical; }
.ms input:focus, .ms select:focus, .ms textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.ms .has-error input, .ms .has-error select, .ms .has-error textarea, .ms .has-error .ms-select-toggle { border-color: var(--bad); }
.ms-help { color: var(--muted); font-size: .84rem; margin: 6px 0 0 !important; }
.ms-field-error { color: var(--bad); font-size: .85rem; margin: 6px 0 0 !important; }
.ms-form-error { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.ms-form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.ms-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ms-form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ms-check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; cursor: pointer; font-weight: 400 !important; }
.ms-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chip-check { position: relative; }
.ms-chip-check input { position: absolute; opacity: 0; }
.ms-chip-check span { display: inline-block; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; font-size: .88rem; user-select: none; }
.ms-chip-check input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.ms-chip-check input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.ms-segment { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; padding: 3px; gap: 3px; background: var(--surface-2); margin-bottom: 16px; }
.ms-segment button { border: 0; background: transparent; padding: 7px 16px; border-radius: 7px; font: 600 .9rem var(--font); color: var(--muted); cursor: pointer; }
.ms-segment button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.ms-otp { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; font-family: ui-monospace, monospace; }

/* search select (SingleSearchSelect / MultiSearchSelect) */
.ms-select { position: relative; }
.ms-select-toggle { width: 100%; text-align: left; padding: 10px 34px 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 15px/1.4 var(--font); min-height: 42px; cursor: pointer; position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-select-toggle::after { content: "▾"; position: absolute; right: 12px; color: var(--muted); }
.ms-select-toggle.is-placeholder { color: var(--muted); }
.ms-select-panel { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.ms-select-panel input { margin-bottom: 6px; }
.ms-select-options { max-height: 260px; overflow: auto; }
.ms-select-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; cursor: pointer; color: var(--text); font: 15px var(--font); }
.ms-select-option:hover, .ms-select-option.is-active { background: var(--primary-soft); }
.ms-select-option small { color: var(--muted); }
.ms-select-empty { padding: 10px; color: var(--muted); font-size: .9rem; }
.ms-select-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ms-select-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary-strong); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: .86rem; font-weight: 600; }
.ms-select-chip button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 1rem; line-height: 1; padding: 0 6px; }
.ms-select--multi .ms-select-search { width: 100%; }

/* identifier + country */
.ms-identifier-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ms-identifier-row.with-country { grid-template-columns: minmax(130px, 38%) minmax(0, 1fr); }
.ms-identifier-row .ms-field { margin-bottom: 0; }

/* ---------------------------------------------------------------- tables */
.ms-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ms-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ms-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.ms-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ms-table tr:last-child td { border-bottom: 0; }
.ms-table tbody tr:hover td { background: var(--surface-2); }
.ms-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ms-table .ms-actions { justify-content: flex-end; flex-wrap: nowrap; }
.ms-row-link { font-weight: 600; color: var(--text) !important; }
.ms-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; }

/* filter bar */
.ms-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ms-filter-search { flex: 1 1 260px; position: relative; }
.ms-filter-search::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1.1rem; }
.ms-filter-search input { padding-left: 34px !important; }
.ms-filter select { width: auto; min-width: 150px; flex: 0 1 auto; }
[data-live-region].is-loading { opacity: .55; transition: opacity .15s; }

/* empty state */
.ms-empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.ms-empty h3 { color: var(--text); margin-bottom: 6px; }
.ms-empty-icon { font-size: 2rem; opacity: .4; margin-bottom: 6px; }
.ms-empty .ms-btn { margin-top: 10px; }

/* ---------------------------------------------------------------- dialogs & toasts */
.ms-dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.ms-dialog::backdrop { background: rgba(15, 23, 32, .45); }
.ms-dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ms-dialog-body { padding: 18px 20px 20px; max-height: 75vh; overflow: auto; }
.ms-toasts { position: fixed; z-index: 100; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.ms-toast { pointer-events: auto; background: #18212b; color: #fff; border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: ms-in .18s ease-out; font-size: .94rem; }
.ms-toast--bad { background: var(--bad); }
.ms-toast--good::before { content: "✓"; font-weight: 700; }
@keyframes ms-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- auth pages */
.ms-auth { max-width: 440px; margin: 24px auto; }
.ms-auth .ms-card-body { padding: 26px; }
.ms-auth h1 { margin-bottom: 6px; }
.ms-auth-foot { text-align: center; margin-top: 16px; color: var(--muted); }
.ms-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.ms-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.ms-steps span.is-done { background: var(--primary); }
.ms-password-wrap { position: relative; }
.ms-password-wrap input { padding-right: 70px; }
.ms-password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--primary); font: 600 .85rem var(--font); cursor: pointer; padding: 6px; }

/* ---------------------------------------------------------------- meals (member view) */
.ms-day { margin-bottom: 18px; }
.ms-day-title { font-weight: 700; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; }
.ms-day-title small { color: var(--muted); font-weight: 400; }
.ms-meal { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.ms-meal--good { border-left-color: var(--good); }
.ms-meal--warn { border-left-color: var(--warn); }
.ms-meal-title { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ms-meal-meta { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.ms-meal-extra { grid-column: 1 / -1; font-size: .88rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 8px; }
.ms-meal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------------------------------------------------------------- serving station */
.ms-surface-serve .ms-shell { max-width: 1280px; }
.ms-serve { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.ms-serve-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ms-serve-counters { display: flex; gap: 10px; flex-wrap: wrap; }
.ms-counter { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; text-align: center; min-width: 92px; }
.ms-counter b { display: block; font-size: 1.4rem; }
.ms-counter span { font-size: .78rem; color: var(--muted); }
.ms-scan { display: flex; gap: 10px; }
.ms-scan input { font-size: 1.25rem !important; min-height: 56px !important; font-family: ui-monospace, monospace; }
.ms-scan .ms-btn { min-height: 56px; }
.ms-serve-panel { min-height: 240px; display: grid; place-items: center; text-align: center; border-radius: 14px; border: 2px dashed var(--border-strong); background: var(--surface); padding: 22px; margin-top: 16px; transition: background .2s, border-color .2s; }
.ms-serve-panel.is-ok { border: 2px solid var(--good); background: var(--good-soft); }
.ms-serve-panel.is-bad { border: 2px solid var(--bad); background: var(--bad-soft); }
.ms-serve-panel.is-info { border: 2px solid var(--info); background: var(--surface); }
.ms-serve-person { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.ms-serve-person h2 { font-size: 1.6rem; }
.ms-serve-big { font-size: 2.2rem; font-weight: 800; }
.ms-alloc-list { width: 100%; max-width: 460px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ms-alloc { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; text-align: left; }
.ms-recent li { padding: 10px 16px; }
.ms-recent .is-reversed { opacity: .55; text-decoration: line-through; }

/* ---------------------------------------------------------------- misc */
.ms-kbd { display: inline-block; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font-size: .8rem; font-family: ui-monospace, monospace; }
.ms-progress { height: 8px; background: var(--neutral-soft); border-radius: 8px; overflow: hidden; }
.ms-progress > span { display: block; height: 100%; background: var(--primary); }
.ms-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ms-plan { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.ms-plan.is-current { border: 2px solid var(--primary); }
.ms-plan-price { font-size: 1.4rem; font-weight: 700; }
.ms-plan ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
.ms-plan .ms-btn { margin-top: auto; }
.ms-code { font-family: ui-monospace, monospace; font-size: 1.4rem; letter-spacing: .12em; background: var(--surface-2); border: 1px dashed var(--border-strong); padding: 10px 14px; border-radius: 8px; text-align: center; }
.ms-tree-indent { display: inline-block; width: calc(var(--depth, 0) * 18px); }
.ms-search-results { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; }
.ms-search-group { padding: 6px; border-bottom: 1px solid var(--border); }
.ms-search-group:last-child { border-bottom: 0; }
.ms-search-group > span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 8px; }
.ms-search-group a { display: block; padding: 8px; border-radius: 6px; color: var(--text); }
.ms-search-group a:hover { background: var(--surface-2); text-decoration: none; }
.ms-search-group small { display: block; color: var(--muted); }
.ms-global-search { position: relative; max-width: 560px; margin-bottom: 20px; }
.ms-print-card { width: 340px; border: 1px solid #ccc; border-radius: 12px; padding: 16px; background: #fff; color: #111; font-family: var(--font); }
.ms-print-card svg { width: 100%; height: auto; }
.ms-footer-note { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 30px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
	.ms-shell.has-sidenav { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.ms-sidenav { position: static; margin: -8px -20px 0; padding: 0 20px 4px; overflow-x: auto; }
	.ms-sidenav-title { padding: 0 0 6px; }
	.ms-sidenav nav { flex-direction: row; gap: 6px; padding-bottom: 6px; }
	.ms-sidenav nav a { white-space: nowrap; background: var(--surface); border: 1px solid var(--border); }
	.ms-sidenav-heading { display: none; }
	.ms-serve { grid-template-columns: minmax(0, 1fr); }
	.ms-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	.ms-topbar-inner { flex-wrap: wrap; padding: 0 16px; }
	.ms-menu-toggle { display: inline-block; }
	.ms-primary-nav:not(.ms-primary-nav--guest) { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
	.ms-primary-nav.is-open { display: flex; }
	.ms-nav-right { margin-left: 0; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 8px; }
	.ms-dropdown-menu { position: static; box-shadow: none; border: 0; padding-left: 12px; }
	.ms-shell { padding: 16px 16px 56px; }
	.ms-sidenav { margin: -4px -16px 0; padding: 0 16px 4px; }
	.ms-grid-2, .ms-grid-3, .ms-form-row, .ms-form-row-3 { grid-template-columns: minmax(0, 1fr); }
	.ms-page-head { flex-direction: column; }
	.ms-meal { grid-template-columns: minmax(0, 1fr); }
	.ms-meal-actions { justify-content: flex-start; }
	.ms-dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
	.ms-dl dd { margin-bottom: 10px; }
	.ms-table--stack thead { display: none; }
	.ms-table--stack tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
	.ms-table--stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 14px; }
	.ms-table--stack td::before { content: attr(data-label); color: var(--muted); font: 400 .82rem/1.4 var(--font); letter-spacing: normal; text-transform: none; }
	.ms-table--stack td.num { text-align: right; }
	.ms-identifier-row.with-country { grid-template-columns: minmax(0, 1fr); }
	.ms-brand-name { display: none; }
	.ms-scan { flex-direction: column; }
}
@media print {
	.ms-topbar, .ms-sidenav, .ms-dev-banner, .ms-no-print { display: none !important; }
	body.ms { background: #fff; }
}

/* Onboarding chooser */
.ms-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.ms-choice { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.ms-choice h2 { margin: 0; font-size: 1.1rem; }
.ms-choice p { margin: 0; color: var(--muted); }
.ms-choice .ms-btn { margin-top: auto; }
.ms-choice.is-picked { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset, var(--shadow); }
.ms-choice-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-strong); }
.ms-choice-tag { font-size: .8rem; font-weight: 700; color: var(--primary-strong) !important; }
.ms-intent-note { background: var(--primary-soft); color: var(--primary-strong); padding: 10px 12px; border-radius: var(--radius-sm); font-size: .92rem; }
.ms-onboard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; counter-reset: obs; }
.ms-onboard-steps li { counter-increment: obs; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); font-size: .82rem; font-weight: 600; }
.ms-onboard-steps li::before { content: counter(obs); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); font-size: .72rem; }
.ms-onboard-steps li.is-current { background: var(--primary-soft); color: var(--primary-strong); }
.ms-onboard-steps li.is-current::before { background: var(--primary); color: #fff; }
.ms-bell { display: inline-flex; align-items: center; color: var(--text); }
.ms-nav-home { color: var(--muted) !important; }

/* ================================================================ Instruction 2: navigation, Person workspace, charts */
:root { --primary-fill: #0e7a6d; --c1: #00897b; --c2: #eb6834; --c2-text: #b5461a; --c3: #5b6ee1; --c4: #c2417a; --c5: #8a6d1f; --c6: #6b7785; }
@media (prefers-color-scheme: dark) { :root { --primary-fill: #127a6b; --c1: #159c86; --c2: #d95926; --c2-text: #f08a5d; --c3: #8a9bf0; --c4: #e07aa8; --c5: #caa64a; --c6: #9aa7b2; } }
.ms-ico { flex: none; vertical-align: -3px; }

/* ---- global navbar */
.ms-primary-nav > a, .ms-primary-nav summary { display: inline-flex; align-items: center; gap: 7px; }
.ms-primary-nav .ms-ico { color: var(--muted); }
.ms-primary-nav .is-active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 650; box-shadow: inset 0 -2px 0 var(--primary); }
.ms-primary-nav .is-active .ms-ico { color: currentColor; }
.ms-topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ms-primary-nav { flex: 1 1 auto; }
.ms-profile-menu > summary { padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; list-style: none; }
.ms-profile-menu > summary::-webkit-details-marker { display: none; }
.ms-profile-menu > summary:hover { background: var(--surface-2); }
.ms-user-name { display: flex; flex-direction: column; line-height: 1.1; font-weight: 600; font-size: .9rem; color: var(--text); }
.ms-user-name small { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); }
.ms-profile-panel { width: 300px; padding: 8px; }
.ms-profile-panel a { display: flex; align-items: center; gap: 10px; }
.ms-profile-panel a .ms-ico { color: var(--muted); }
.ms-profile-panel hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.ms-profile-head, .ms-profile-ctx { display: flex; gap: 10px; align-items: center; padding: 8px 10px; }
.ms-profile-head div, .ms-profile-ctx div { display: flex; flex-direction: column; min-width: 0; }
.ms-profile-head small, .ms-profile-ctx small { color: var(--muted); font-size: .8rem; }
.ms-profile-ctx { background: var(--warn-soft); border-radius: 8px; margin-bottom: 4px; }
.ms-profile-ctx small:first-child { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--warn); font-size: .7rem; }
.ms-profile-return { font-weight: 650; color: var(--primary-strong) !important; }
.ms-profile-person span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ms-profile-person small { color: var(--muted); font-size: .78rem; }
.ms-profile-person .ms-avatar { width: 26px; height: 26px; font-size: .7rem; }
.ms-profile-person[aria-current] { background: var(--primary-soft); font-weight: 650; }

/* ---- persistent context indicator */
.ms-context-bar { background: var(--warn-soft); border-bottom: 1px solid var(--border); }
.ms-context-bar.is-pro { background: var(--info-soft); }
.ms-context-bar-inner { max-width: 1280px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ms-context-who { display: flex; align-items: center; gap: 8px; color: var(--text); }
.ms-context-who .ms-avatar { width: 26px; height: 26px; font-size: .7rem; }
.ms-context-actor { color: var(--muted); font-size: .88rem; }

/* ---- context sidebar + context hamburger */
.ms-context-toggle { display: none; }
.ms-sidenav-title.has-avatar { flex-direction: row; align-items: center; gap: 10px; }
.ms-sidenav-title.has-avatar > span { display: flex; flex-direction: column; min-width: 0; }
.ms-sidenav-label { display: inline-flex; align-items: center; gap: 9px; }
.ms-sidenav-label .ms-ico { color: var(--muted); }
.ms-sidenav nav a.is-active { box-shadow: inset 3px 0 0 var(--primary), var(--shadow); }
.ms-sidenav nav a.is-active .ms-ico { color: var(--primary-strong); }
.ms-bottom-action { display: none; }

/* ---- shared bits */
.ms-section-title { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.ms-plain-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.ms-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--neutral-soft); border-radius: 4px; padding: 1px 6px; vertical-align: 1px; }
.ms-card-pad { padding: 16px 18px; margin: 0; }
.ms-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.ms-tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.ms-tabs a:hover { color: var(--text); text-decoration: none; }
.ms-tabs a.is-active { color: var(--primary-strong); border-bottom-color: var(--primary); }
.ms-status { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 650; }
.ms-status--good { color: var(--good); }
.ms-status--warn { color: var(--warn); }
.ms-status--neutral { color: var(--muted); }
.ms-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.ms-alert--allergy { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.ms-card--alert { border-color: var(--bad); }
.ms-hist-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-strong); flex: none; }
.ms-hist-ico.is-alert { background: var(--bad-soft); color: var(--bad); }
.ms-btn .ms-ico { margin: 0 -1px; }
.ms-btn.is-disabled { opacity: .45; cursor: not-allowed; }
.ms-explain summary { cursor: pointer; color: var(--primary); font-weight: 600; margin-top: 10px; }
.ms-explain p { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.ms-steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.ms-star.is-on { color: var(--warn) !important; }
.ms-star.is-on .ms-ico { fill: currentColor; }
.ms-prov { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; }

/* ---- date navigation */
.ms-datenav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ms-datenav-pick input { width: auto; min-height: 32px; padding: 4px 10px; }

/* ---- day layout & timeline */
.ms-day-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.ms-day-side .ms-card-body > * + * { margin-top: 14px; }
.ms-day-status { margin-bottom: 4px; }
.ms-timeline { list-style: none; margin: 0 0 20px; padding: 0; position: relative; }
.ms-timeline::before { content: ""; position: absolute; left: 89px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.ms-tl-item { display: grid; grid-template-columns: 72px 36px minmax(0, 1fr); gap: 0 8px; margin-bottom: 14px; position: relative; }
.ms-tl-time { display: flex; align-items: flex-start; gap: 4px; justify-content: flex-end; text-align: right; color: var(--muted); font-size: .84rem; padding-top: 12px; font-variant-numeric: tabular-nums; }
.ms-tl-time .ms-ico { display: none; }
.ms-tl-dot { width: 32px; height: 32px; margin-top: 6px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--primary); color: var(--primary-strong); position: relative; z-index: 1; }
.ms-tl-item.is-org .ms-tl-dot { border-color: var(--info); color: var(--info); }
.ms-tl-item.is-water .ms-tl-dot { border-color: var(--c3); color: var(--c3); }
.ms-tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; min-width: 0; }
.ms-tl-item.is-org .ms-tl-card { border-left: 4px solid var(--info); }
.ms-tl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ms-tl-head h3 { font-size: 1rem; }
.ms-tl-amount { font-weight: 400; color: var(--muted); }
.ms-source { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 650; color: var(--muted); background: var(--neutral-soft); border-radius: 999px; padding: 2px 9px; }
.ms-tl-sub { color: var(--muted); font-size: .88rem; margin: 2px 0 6px !important; }
.ms-tl-facts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 6px 0; }
.ms-fact { display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.ms-fact--good { color: var(--good); }
.ms-frac { display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--primary-strong); }
.ms-frac.is-unknown { color: var(--muted); }
.ms-frac-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; padding: 8px; background: var(--surface-2); border-radius: 8px; }
.ms-frac-q { font-size: .85rem; font-weight: 600; margin-right: 4px; }
.ms-chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text) !important; border-radius: 999px; padding: 4px 12px; font: 600 .85rem var(--font); cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; text-decoration: none !important; }
.ms-chip:hover { border-color: var(--primary); }
.ms-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff !important; }
.ms-chip.is-on::before { content: "✓ "; }
.ms-tl-items { list-style: none; margin: 6px 0 0; padding: 0; }
.ms-tl-items li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--border); font-size: .92rem; flex-wrap: wrap; }
.ms-kcal { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.ms-kcal.is-unknown { color: var(--muted); font-weight: 400; display: inline-flex; gap: 4px; align-items: center; font-size: .85rem; }
.ms-tl-note { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .86rem; margin: 6px 0 0 !important; }
.ms-tl-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: .86rem; font-weight: 600; }
.ms-tl-foot .ms-muted { font-weight: 400; }
.ms-tl-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ms-planned { border-style: dashed; border-width: 2px; box-shadow: none; }
.ms-water { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-empty--meal { color: var(--muted); }
.ms-empty--meal > .ms-ico, .ms-empty > .ms-ico { color: var(--primary); opacity: .8; margin-bottom: 6px; }

/* ---- progress & coverage */
.ms-progress-row + .ms-progress-row { margin-top: 14px; }
.ms-progress-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; font-size: .9rem; }
.ms-progress-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.ms-progress-label .ms-ico { color: var(--muted); }
.ms-progress-value { font-variant-numeric: tabular-nums; }
.ms-progress-note { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.ms-progress > span { background: var(--c1); }
.ms-progress.is-over > span { background: var(--c2); }
.ms-coverage { display: flex; align-items: center; gap: 12px; }
.ms-coverage-cap { font-size: .86rem; color: var(--muted); }

/* ---- charts */
.ms-figure { margin: 0; }
.ms-chart { width: 100%; height: auto; display: block; overflow: visible; }
.ms-chart-legend { font-size: .8rem; color: var(--muted); margin: 6px 0 0 !important; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.ms-dist { display: flex; height: 18px; border-radius: 9px; overflow: hidden; gap: 2px; background: var(--neutral-soft); }
.ms-dist-seg { min-width: 4px; }
.c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); } .c4 { background: var(--c4); } .c5 { background: var(--c5); } .c6 { background: var(--c6); }
.ms-dist-legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: .9rem; }
.ms-dist-legend li { display: flex; align-items: center; gap: 7px; }
.ms-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.ms-swatch--planned { border: 2px dashed var(--muted); background: transparent; }

/* ---- calendar */
.ms-cal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.ms-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ms-cal th { font-size: .78rem; color: var(--muted); font-weight: 600; padding: 8px 4px; text-transform: uppercase; letter-spacing: .04em; }
.ms-cal td { border: 1px solid var(--border); height: 84px; vertical-align: top; padding: 0; }
.ms-cal td a { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 6px; color: var(--text); text-decoration: none; }
.ms-cal td a:hover { background: var(--surface-2); }
.ms-cal td.is-complete { background: var(--good-soft); }
.ms-cal td.is-partial { background: var(--warn-soft); }
.ms-cal td.is-future, .ms-cal td.is-pad { background: var(--surface-2); color: var(--muted); }
.ms-cal td.is-future .ms-cal-num { display: block; padding: 6px; }
.ms-cal td.is-today { outline: 2px solid var(--primary); outline-offset: -2px; }
.ms-cal-num { font-weight: 700; }
.ms-cal-kcal { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ms-cal .ms-status { font-size: .72rem; }
.ms-cal-legend { font-size: .88rem; line-height: 2; }
.ms-range-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.ms-range-form .ms-field { margin: 0; }
.ms-hist-day .ms-card-head h2 a { color: var(--text); }

/* ---- entry form */
.ms-fieldset-plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.ms-radio-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-radio-chips .ms-chip-check span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.ms-chip-check input:checked + span::before { content: "✓"; font-weight: 700; }
.ms-inline-field { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ms-inline-field label { font-weight: 600; font-size: .88rem; margin: 0; }
.ms-inline-field input { width: auto; max-width: 220px; }
.ms-inline-field--wide input { max-width: 420px; width: 100%; }
.ms-entry { max-width: 820px; }
.ms-entry-warnings { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0; font-weight: 600; }
.ms-entry-warnings p { margin: 0; }
.ms-entry-meta { max-width: 820px; margin-top: 20px; }
.ms-org-facts { display: flex; gap: 14px; align-items: flex-start; }
.ms-org-facts > div:first-child { color: var(--info); }

/* ---- item picker */
.ms-picker { margin-bottom: 16px; position: relative; }
.ms-picker-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.ms-picker-search { position: relative; }
.ms-picker-search > .ms-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.ms-picker-search input { padding-left: 38px !important; }
.ms-picker-results { position: absolute; z-index: 60; left: 0; right: 0; list-style: none; margin: 4px 0 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; }
.ms-picker-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 2px; }
.ms-picker-opt { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; }
.ms-picker-opt small { color: var(--muted); }
.ms-picker-opt:hover, .ms-picker-opt.is-active { background: var(--primary-soft); }
.ms-picker-opt.is-typed { font-weight: 600; color: var(--primary-strong); border-top: 1px solid var(--border); margin-top: 4px; }
.ms-picker-empty { color: var(--muted); font-size: .9rem; padding: 10px 0; margin: 0; }
.ms-picker-rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ms-picker-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.ms-picker-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ms-picker-row-head strong { flex: 1 1 auto; min-width: 0; }
.ms-picker-row-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 8px; }
.ms-mini { display: flex; flex-direction: column; gap: 3px; }
.ms-mini label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.ms-mini input { width: 110px !important; min-height: 36px !important; padding: 6px 8px !important; }
.ms-mini select { width: auto !important; min-width: 110px; min-height: 36px !important; padding: 6px 8px !important; }
.ms-mini-check { margin: 0 0 6px !important; }

/* ---- planned vs actual */
.ms-pva { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ms-pva li { display: grid; grid-template-columns: 120px minmax(80px, 1fr) auto; gap: 10px; align-items: center; font-size: .88rem; }
.ms-pva-bars { position: relative; height: 14px; }
.ms-pva-planned { position: absolute; inset: 0; border: 2px dashed var(--muted); border-radius: 7px; }
.ms-pva-actual { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c1); border-radius: 7px; }

/* ---- permissions editor */
.ms-perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ms-perm-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 0; margin: 0; }
.ms-perm-group legend { font-size: .82rem; font-weight: 700; padding: 0 4px; }
.ms-perm-group .ms-check { margin-bottom: 8px; font-size: .9rem; }
.ms-nutri-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

@media (max-width: 960px) {
	.ms-day-layout, .ms-nutri-grid { grid-template-columns: minmax(0, 1fr); }
	.ms-context-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 8px; padding: 8px 12px; font: 600 .92rem var(--font); cursor: pointer; justify-self: start; }
	.ms-shell.has-sidenav .ms-sidenav { display: none; position: static; margin: 0; padding: 10px; overflow: visible; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
	.ms-shell.has-sidenav .ms-sidenav.is-open { display: block; }
	.ms-shell.has-sidenav .ms-sidenav nav { flex-direction: column; gap: 2px; padding-bottom: 0; }
	.ms-shell.has-sidenav .ms-sidenav nav a { background: transparent; border: 0; white-space: normal; }
	.ms-shell.has-sidenav .ms-sidenav nav a.is-active { background: var(--primary-soft); }
	.ms-shell.has-sidenav .ms-sidenav-heading { display: block; }
}
@media (max-width: 760px) {
	.ms-topbar-inner { flex-wrap: wrap; gap: 8px; }
	.ms-brand { order: 1; }
	.ms-menu-toggle { order: 2; margin-left: 0; display: inline-flex; align-items: center; }
	.ms-topbar-right { order: 3; margin-left: auto; }
	.ms-primary-nav:not(.ms-primary-nav--guest) { order: 4; flex-basis: 100%; }
	.ms-primary-nav > a, .ms-primary-nav summary { padding: 10px 12px; }
	.ms-primary-nav .is-active { box-shadow: inset 3px 0 0 var(--primary); }
	.ms-user-name { display: none; }
	.ms-profile-menu > summary { padding: 3px; }
	.ms-profile-panel { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; max-height: calc(100vh - 80px); }
	.ms-brand-name { display: inline; font-size: .98rem; }
	.ms-context-bar-inner { padding: 8px 16px; }
	.ms-context-actor { display: block; }
	.ms-timeline::before { left: 15px; }
	.ms-tl-item { grid-template-columns: 32px minmax(0, 1fr); }
	.ms-tl-time { grid-column: 2; grid-row: 1; justify-content: flex-start; text-align: left; padding: 0 0 4px; }
	.ms-tl-time .ms-ico { display: inline; }
	.ms-tl-dot { grid-column: 1; grid-row: 1 / span 2; margin-top: 0; }
	.ms-tl-card { grid-column: 2; }
	.ms-cal td { height: 64px; }
	.ms-cal .ms-status { font-size: .6rem; line-height: 1.1; }
	.ms-cal .ms-status .ms-ico { display: none; }
	.ms-cal td a { padding: 4px; }
	.ms-cal-kcal { display: none; }
	.ms-pva li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
	.ms-bottom-action { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(16, 24, 40, .08); }
	.ms-bottom-action .ms-btn { width: 100%; }
	body.has-bottom-action .ms-shell { padding-bottom: 96px; }
	body.has-bottom-action .ms-toasts { bottom: 86px; }
	.ms-datenav .ms-btn span { display: none; }
}
@media (max-width: 400px) { .ms-brand-name { display: none; } }

/* Filled primary surfaces with white text use a fill colour that keeps 4.5:1 contrast in light and dark mode. */
.ms-btn--primary, .ms-chip.is-on, .ms-chip-check input:checked + span { background: var(--primary-fill); border-color: var(--primary-fill); }
.ms-btn--primary:hover { background: var(--primary-strong); }
@media (prefers-color-scheme: dark) { .ms-btn--primary:hover { background: #0e6a5d; } }

/* ------------------------------------------------------------------ operations modules */
.ms-fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 4px; margin: 0 0 14px; min-width: 0; }
.ms-fieldset > legend { font-weight: 600; padding: 0 6px; font-size: .92rem; }
.ms-form-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ms-neg { color: var(--bad); font-variant-numeric: tabular-nums; }
.ms-pos { color: var(--good); font-variant-numeric: tabular-nums; }
.ms-input-sm { max-width: 9rem; }
.ms-actions--wrap { flex-wrap: wrap; }
.ms-kpi-good { color: var(--good); }
.ms-kpi-bad { color: var(--bad); }
.ms-check-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.ms-secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; background: var(--surface-2, var(--bg)); border: 1px dashed var(--border); padding: 10px 12px; border-radius: var(--radius-sm); user-select: all; }
.ms-ask-answer { border-left: 3px solid var(--primary); padding: 10px 14px; margin: 0 0 12px; background: var(--surface); }
.ms-ask-q { font-weight: 600; margin: 18px 0 6px; }
.ms-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
[data-ask-out] > div + div { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 4px; }
.ms-bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; margin: 6px 0; font-size: .9rem; }
.ms-bar { height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; }
.ms-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.ms-bar--warn > span { background: var(--warn); }
.ms-trace-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ms-trace-flow > div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.ms-trace-flow h3 { font-size: .95rem; margin: 0 0 6px; }
.ms-trace-flow ul { margin: 0; padding-left: 18px; font-size: .9rem; }
.ms-tray { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 6px; align-content: start; background: var(--surface); }
.ms-tray .ms-alert, .ms-tray .ms-notice, .ms-tray ul { margin: 0; }
.ms-tray-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
@media (max-width: 720px) { .ms-form-row--3 { grid-template-columns: minmax(0, 1fr); } .ms-bar-row { grid-template-columns: minmax(80px, 120px) 1fr auto; } }
.ms-form.ms-inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.ms-trace-flow a, .ms-card-body ul a { text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { .ms-bell-count { background: #b42318; color: #fff; } }
.ms-ask-turn { padding: 4px 0 10px; }
.ms-ask-turn + .ms-ask-turn { border-top: 1px solid var(--border); margin-top: 8px; }
.ms-ask-answer p { margin: 0 0 8px; }
.ms-ask-answer ul { margin: 0 0 8px; padding-left: 20px; }
.ms-ask-chart { margin: 10px 0 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.ms-ask-chart figcaption { font-weight: 600; margin-bottom: 6px; }
.ms-ask-chart svg { width: 100%; height: auto; max-height: 300px; display: block; }
.ms-ask-chart details { margin-top: 8px; font-size: .9rem; }
.ms-ch-grid { stroke: var(--border); stroke-width: 1; }
.ms-ch-label { fill: var(--muted, #667085); font-size: 11px; }
.ms-ch-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
rect.ms-ch-s0, i.ms-ch-s0 { fill: #0f766e; background: #0f766e; } polyline.ms-ch-s0 { stroke: #0f766e; }
rect.ms-ch-s1, i.ms-ch-s1 { fill: #b45309; background: #b45309; } polyline.ms-ch-s1 { stroke: #b45309; }
rect.ms-ch-s2, i.ms-ch-s2 { fill: #6d28d9; background: #6d28d9; } polyline.ms-ch-s2 { stroke: #6d28d9; }
@media (prefers-color-scheme: dark) {
	rect.ms-ch-s0, i.ms-ch-s0 { fill: #2dd4bf; background: #2dd4bf; } polyline.ms-ch-s0 { stroke: #2dd4bf; }
	rect.ms-ch-s1, i.ms-ch-s1 { fill: #fbbf24; background: #fbbf24; } polyline.ms-ch-s1 { stroke: #fbbf24; }
	rect.ms-ch-s2, i.ms-ch-s2 { fill: #c4b5fd; background: #c4b5fd; } polyline.ms-ch-s2 { stroke: #c4b5fd; }
}
.ms-ch-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; margin-top: 4px; }
.ms-ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* ------------------------------------------------------------------ floating Ask Meal Secretary */
.ms-ask-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px 12px 14px; border: 0; border-radius: 999px; background: var(--primary-fill, #0f766e); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(16, 24, 40, .22); }
.ms-ask-fab:hover { filter: brightness(1.06); }
.ms-ask-fab:focus-visible { outline: 3px solid var(--primary, #0f766e); outline-offset: 3px; }
.ms-ask-fab .ms-ico, .ms-ask-fab svg { flex: none; }
body.ms-ask-open .ms-ask-fab { display: none; }
.ms-ask-panel { position: fixed; right: 20px; bottom: 20px; z-index: 61; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 100px)); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 48px rgba(16, 24, 40, .24); overflow: hidden; }
.ms-ask-panel[hidden] { display: none; }
.ms-ask-panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--border); }
.ms-ask-panel-icon { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary-fill, #0f766e); color: #fff; flex: none; }
.ms-ask-panel-titles { flex: 1; min-width: 0; }
.ms-ask-panel-titles h2 { font-size: 1rem; margin: 0; }
.ms-ask-panel-titles p { margin: 0; font-size: .8rem; color: var(--muted, #667085); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-ask-panel-body { flex: 1; overflow-y: auto; padding: 4px 14px; overscroll-behavior: contain; }
.ms-ask-panel-body:empty { display: none; }
.ms-ask-panel-empty { flex: 1; padding: 14px; overflow-y: auto; }
.ms-ask-panel-empty[hidden] { display: none; }
.ms-ask-panel-empty p { color: var(--muted, #667085); margin: 0 0 6px; }
.ms-ask-panel-status { margin: 0; padding: 6px 14px; font-size: .9rem; }
.ms-ask-panel-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.ms-ask-panel-form input { flex: 1; min-width: 0; }
.ms-ask-panel-foot { margin: 0; padding: 0 14px 10px; font-size: .75rem; color: var(--muted, #667085); }
.ms-ask-panel .ms-ask-turn { font-size: .94rem; }
.ms-ask-panel .ms-ask-q { margin: 12px 0 6px auto; max-width: 85%; width: fit-content; background: var(--primary-soft, #e6f4f1); padding: 8px 12px; border-radius: 14px 14px 4px 14px; font-weight: 500; }
.ms-ask-panel .ms-ask-answer { border-left: 0; padding: 0; background: none; }
.ms-ask-panel .ms-ask-chart { padding: 8px; }
.ms-ask-panel .ms-ask-turn + .ms-ask-turn { border-top: 0; margin-top: 0; }
body.has-bottom-action .ms-ask-fab { bottom: 92px; }
@media (max-width: 720px) {
	.ms-ask-fab { right: 16px; bottom: 16px; padding: 14px; }
	.ms-ask-fab-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.ms-ask-panel { right: 0; left: 0; bottom: 0; width: 100%; height: min(88vh, calc(100vh - 56px)); border-radius: 16px 16px 0 0; border-bottom: 0; }
	body.has-bottom-action .ms-ask-fab { bottom: 84px; }
}
@media print { .ms-ask-fab, .ms-ask-panel { display: none !important; } }
.ms-ask-fab.is-left, .ms-ask-panel.is-left { right: auto; left: 20px; }
@media (max-width: 720px) { .ms-ask-fab.is-left { left: 16px; } .ms-ask-panel.is-left { left: 0; } }

/* ================================================================== Notifications, alerts & toasts (1.6, Instruction 4) */
.ms-sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ms-pad { padding: 14px 18px 0; }
.ms-section-title { margin: 28px 0 12px !important; font-size: 1.1rem !important; }
.ms-linkbtn { background: none; border: 0; padding: 4px 6px; color: var(--primary); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; border-radius: 6px; }
.ms-linkbtn:hover { text-decoration: underline; }
.ms-linkbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Toasts: success ≈5 s, info ≈7 s, warning/error/critical persistent with Dismiss, loading until done. */
.ms-toast-text { flex: 1; min-width: 0; }
.ms-toast-close { background: transparent; border: 0; color: inherit; font-size: 1.25rem; line-height: 1; padding: 0 2px; cursor: pointer; opacity: .85; border-radius: 4px; }
.ms-toast-close:hover { opacity: 1; }
.ms-toast-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ms-toast--warn { background: #8a4b06; }
.ms-toast--critical { background: #7a1610; font-weight: 600; }
.ms-toast--info { background: #1d4f99; }
.ms-toast--loading::before { content: ""; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: ms-spin .8s linear infinite; flex: none; margin-top: 3px; }
.ms-toast.is-leaving { opacity: 0; transition: opacity .25s; }
@keyframes ms-spin { to { transform: rotate(360deg); } }

/* Bell + dropdown */
.ms-notify { position: relative; display: inline-flex; }
button.ms-bell { background: none; border: 0; cursor: pointer; font: inherit; color: var(--text); display: inline-flex; align-items: center; }
button.ms-bell:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ms-notify.is-open .ms-bell { background: var(--surface-2); }
.ms-bell-count { min-width: 18px; text-align: center; }
.ms-notify-panel { position: absolute; right: -8px; top: calc(100% + 8px); z-index: 60; width: min(420px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: min(620px, calc(100vh - 90px)); }
.ms-notify-panel[hidden] { display: none; }
.ms-notify-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.ms-notify-head h2 { font-size: 1rem !important; }
.ms-notify-list { overflow-y: auto; padding: 4px 0; flex: 1; overscroll-behavior: contain; }
.ms-notify-empty { padding: 22px 16px; margin: 0 !important; text-align: center; color: var(--muted); }
.ms-notify-foot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: .9rem; font-weight: 600; }
@media (max-width: 720px) {
	.ms-notify { position: static; }
	.ms-notify-panel { position: fixed; left: 8px; right: 8px; top: 62px; width: auto; max-height: calc(100vh - 76px); }
}

/* Notification card */
.ms-nitem { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: relative; background: var(--surface); transition: opacity .2s; }
.ms-nitem:last-child { border-bottom: 0; }
.ms-nitem.is-unread { background: var(--primary-soft); }
.ms-nitem.is-unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.ms-nitem.is-leaving { opacity: 0; }
.ms-nitem-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-soft); color: var(--muted); }
.ms-nitem-icon--task { background: var(--info-soft); color: var(--info); }
.ms-nitem-icon--alert { background: var(--bad-soft); color: var(--bad); }
.ms-nitem-icon--reminder { background: var(--warn-soft); color: var(--warn); }
.ms-nitem-main { min-width: 0; flex: 1; }
.ms-nitem-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.ms-nctx { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--text); max-width: 100%; }
.ms-nctx span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-npri { font-weight: 700; padding: 0 6px; border-radius: 4px; }
.ms-npri--high { color: var(--warn); background: var(--warn-soft); }
.ms-npri--critical { color: var(--bad); background: var(--bad-soft); }
.ms-nstate { font-weight: 600; color: var(--muted); }
.ms-nstate.is-open { color: var(--info); }
.ms-nitem-title { font-size: .96rem !important; font-weight: 600; margin: 0 0 2px !important; overflow-wrap: anywhere; }
.ms-nitem:not(.is-unread) .ms-nitem-title { font-weight: 500; }
.ms-ncount { font-size: .78rem; font-weight: 600; color: var(--muted); }
.ms-nitem-body { margin: 0 0 6px !important; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.ms-nitem--compact .ms-nitem-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ms-nitem-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ms-nitem.is-critical .ms-nitem-icon { background: var(--bad); color: #fff; }
.ms-nlist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ms-nlist > .ms-empty { border: 0; }
.ms-nmore { display: flex; justify-content: center; margin: 14px 0; }
.ms-nfilters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin: 12px 0 14px; }
.ms-nfilters .ms-field { margin: 0; }
.ms-nfilters select, .ms-nfilters input { width: 100%; }
.ms-nfilters-actions { display: flex; gap: 6px; }
@media (max-width: 980px) { .ms-nfilters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ms-nfilters-actions { grid-column: 1 / -1; } }
@media (max-width: 560px) { .ms-nfilters { grid-template-columns: minmax(0, 1fr); } .ms-nitem { padding: 12px; } }

/* Preferences */
.ms-pref-table td, .ms-pref-table th { vertical-align: middle; }
.ms-pref-topic { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; }
.ms-check--inline { margin: 0; display: inline-flex; gap: 6px; align-items: center; }

/* Operational alerts */
.ms-alert-list { display: grid; gap: 12px; margin-top: 12px; }
.ms-alert-card { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border-strong); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.ms-alert-card.is-critical { border-left-color: var(--bad); }
.ms-alert-card.is-high { border-left-color: var(--warn); }
.ms-alert-card.is-normal { border-left-color: var(--info); }
.ms-alert-card.is-resolved, .ms-alert-card.is-closed { border-left-color: var(--good); }
.ms-alert-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.ms-sev { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; font-size: .82rem; padding: 2px 8px; border-radius: 999px; }
.ms-sev--critical { background: var(--bad-soft); color: var(--bad); }
.ms-sev--high { background: var(--warn-soft); color: var(--warn); }
.ms-sev--normal, .ms-sev--low { background: var(--info-soft); color: var(--info); }
.ms-alert-title { font-size: 1.05rem !important; margin-bottom: 4px !important; overflow-wrap: anywhere; }
.ms-alert-detail { color: var(--muted); }
.ms-alert-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 18px; margin: 8px 0 10px; font-size: .88rem; }
.ms-alert-facts dt { color: var(--muted); font-size: .78rem; }
.ms-alert-facts dd { margin: 0; overflow-wrap: anywhere; }
.ms-alert-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ms-policy { border-top: 1px solid var(--border); padding: 10px 0; }
.ms-policy summary { cursor: pointer; }
.ms-policy form { margin-top: 10px; }
.ms-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
[data-autohide].is-leaving { opacity: 0; transition: opacity .3s; }
@media (prefers-reduced-motion: reduce) {
	.ms-toast, .ms-nitem, .ms-toast--loading::before { animation: none !important; transition: none !important; }
}
.ms-pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; max-width: 100%; }
@media (max-width: 720px) { body.ms-notify-open .ms-ask-fab, body.ms-notify-open .ms-ask-panel { display: none !important; } }
.ms-page-head .ms-muted a, .ms-help a { text-decoration: underline; }
.ms-field input[type="datetime-local"] { width: 100%; }
