:root {
  --accent: #176bff;
  --accent-dark: #0d4fd7;
  --accent-soft: #edf4ff;
  --navy: #101727;
  --navy-soft: #1a2436;
  --page: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e2e7ef;
  --border-strong: #d4dbe6;
  --text: #172033;
  --text-soft: #536079;
  --text-muted: #8490a6;
  --success: #12a66a;
  --success-soft: #eaf8f2;
  --warning: #ef9700;
  --warning-soft: #fff6e5;
  --danger: #df4b4b;
  --danger-soft: #fff0f0;
  --info: #176bff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 10px 30px rgba(27, 39, 63, .07);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--page); color: var(--text); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 50; left: 16px; top: -60px; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.skip-link:focus { top: 16px; }

.app-shell { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 252px; padding: 22px 14px 16px; background: var(--navy); color: #dfe7f4; display: flex; flex-direction: column; }
.brand { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 2px 9px 18px; }
.brand-mark { position: relative; display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid #344159; border-radius: 11px; background: #151f31; }
.brand-mark::before { content: ""; width: 13px; height: 13px; border: 2px solid #fff; border-radius: 4px; }
.brand-mark span { position: absolute; right: 6px; bottom: 6px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 2px var(--navy); }
.brand-copy { min-width: 0; display: grid; gap: 2px; }
.brand-copy strong { color: #fff; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy small { color: #8f9bb0; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-groups { display: grid; gap: 26px; margin-top: 18px; }
.nav-group { display: grid; gap: 5px; }
.nav-label { margin: 0 11px 5px; color: #647087; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.nav-item { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #9eabc0; display: flex; align-items: center; gap: 11px; text-align: left; font-size: 13px; font-weight: 600; transition: color 160ms ease-out, background-color 160ms ease-out, transform 160ms ease-out; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item:active { transform: translateY(1px); }
.nav-item.is-active { color: #fff; background: #263147; box-shadow: inset 3px 0 var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-count { margin-left: auto; min-width: 23px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; color: #cbd7ea; background: #303c53; font-size: 12px; font-variant-numeric: tabular-nums; }
.sidebar-footer { margin-top: auto; display: grid; gap: 9px; }
.environment-card { display: flex; align-items: center; gap: 10px; margin: 0 2px; padding: 12px; border: 1px solid #2e3a4f; border-radius: 11px; background: #141d2d; }
.environment-card div { min-width: 0; display: grid; gap: 2px; }
.environment-card strong { color: #e9eef7; font-size: 13px; }
.environment-card small { color: #738098; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.environment-dot, .status-indicator, .session-orb, .metric-dot { display: block; border-radius: 999px; flex: 0 0 auto; }
.environment-dot { width: 8px; height: 8px; background: #7b879c; box-shadow: 0 0 0 4px rgba(123,135,156,.11); }
.environment-dot.online { background: var(--success); box-shadow: 0 0 0 4px rgba(18,166,106,.12); }
.user-menu { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid #273246; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; background: #29364d; color: #f5f8ff; font-size: 13px; font-weight: 800; }
.user-copy { min-width: 0; display: grid; gap: 2px; }
.user-copy strong, .user-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy strong { color: #f6f8fc; font-size: 13px; }
.user-copy small { color: #77849a; font-size: 12px; }

.content-shell { min-height: 100dvh; margin-left: 252px; }
.topbar { min-height: 98px; padding: 20px clamp(20px, 3vw, 42px); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); display: flex; align-items: center; gap: 18px; }
.page-heading { min-width: 0; }
.page-heading .eyebrow { margin-bottom: 3px; }
.page-heading h1 { margin: 0; font-size: clamp(21px, 2vw, 27px); line-height: 1.25; letter-spacing: -.025em; text-wrap: balance; }
.page-heading > p:last-child { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; text-wrap: pretty; }
.eyebrow { margin: 0; color: var(--accent); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.environment-chip, .period-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--surface); font-size: 12px; white-space: nowrap; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-soft); display: grid; place-items: center; transition: background-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out; }
.icon-button:hover { color: var(--text); background: var(--surface-muted); }
.icon-button:active { transform: translateY(1px); }
.icon-button svg { width: 18px; height: 18px; }
.icon-button.subtle { margin-left: auto; width: 30px; height: 30px; color: #7f8ba1; border: 0; background: transparent; }
.icon-button.subtle:hover { color: #fff; background: #232f44; }
.mobile-menu { display: none; }
.button { min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 700; transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out; }
.button:active { transform: translateY(1px); }
.button svg { width: 16px; height: 16px; }
.button.compact { min-height: 36px; padding: 0 12px; font-size: 13px; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.secondary { color: var(--text-soft); background: var(--surface); border-color: var(--border); }
.button.secondary:hover, .button.tertiary:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-muted); }
.button.tertiary { color: var(--accent); background: transparent; border-color: var(--border); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(23,107,255,.2); outline-offset: 2px; }

main { padding: 26px clamp(20px, 3vw, 42px) 48px; }
.view { max-width: 1480px; margin: 0 auto; }
.view.is-active { animation: view-in 160ms ease-out both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.operations-strip { min-height: 78px; padding: 13px 18px; display: flex; align-items: center; gap: 18px; }
.strip-item { min-width: 0; display: flex; align-items: center; gap: 11px; }
.strip-item > div { display: grid; gap: 3px; }
.strip-item small { color: var(--text-muted); font-size: 12px; }
.strip-item strong { color: var(--text); font-size: 12px; }
.strip-separator { width: 1px; height: 36px; background: var(--border); }
.strip-meta { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.status-indicator { width: 9px; height: 9px; background: #9aa5b7; box-shadow: 0 0 0 5px rgba(154,165,183,.11); }
.status-indicator.online { background: var(--success); box-shadow: 0 0 0 5px rgba(18,166,106,.11); }
.portal-icon, .queue-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--text-soft); background: var(--surface-muted); }
.portal-icon svg, .queue-icon svg { width: 16px; height: 16px; }
.metrics-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 153px; padding: 19px; overflow: hidden; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--text-soft); font-size: 13px; }
.metric-dot { width: 7px; height: 7px; }
.metric-dot.warning, i.warning { background: var(--warning); }
.metric-dot.info { background: var(--info); }
.metric-dot.success, i.success { background: var(--success); }
.metric-dot.neutral { background: #a3adbd; }
i.danger { background: var(--danger); }
.metric-value { display: block; margin-top: 17px; font-size: 29px; line-height: 1; letter-spacing: -.035em; }
.metric-card p { margin: 10px 0 0; color: var(--text-muted); font-size: 12px; }
.metric-icon { position: absolute; right: 16px; bottom: 14px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #9aa5b7; background: var(--surface-muted); }
.metric-icon svg { width: 17px; height: 17px; }
.overview-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 14px; }
.results-card, .session-card, .requests-preview, .full-table-card, .users-card, .invitation-card, .access-summary { padding: 21px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.card-heading h2, .simulator-guide h2, .access-summary h2 { margin: 5px 0 0; font-size: 16px; line-height: 1.35; letter-spacing: -.015em; text-wrap: balance; }
.card-heading p:not(.eyebrow), .simulator-guide > p:not(.eyebrow), .access-summary > p:not(.eyebrow) { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; text-wrap: pretty; }
.result-total { margin-top: 26px; display: flex; align-items: baseline; gap: 8px; }
.result-total strong { font-size: 27px; letter-spacing: -.03em; }
.result-total span { color: var(--text-muted); font-size: 12px; }
.distribution { height: 8px; margin-top: 19px; display: flex; overflow: hidden; border-radius: 999px; background: #edf1f6; }
.distribution span { min-width: 0; transition: flex-basis 180ms ease-out; }
#successBar { background: var(--success); } #reviewBar { background: var(--warning); } #failureBar { background: var(--danger); }
.legend { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 18px; }
.legend span { color: var(--text-soft); display: flex; align-items: center; gap: 7px; font-size: 12px; }
.legend i { width: 7px; height: 7px; border-radius: 999px; }
.legend strong { margin-left: 2px; color: var(--text); font-variant-numeric: tabular-nums; }
.session-orb { width: 10px; height: 10px; background: #9aa5b7; box-shadow: 0 0 0 5px rgba(154,165,183,.11); }
.session-orb.authenticated { background: var(--success); box-shadow: 0 0 0 5px rgba(18,166,106,.11); }
.session-orb.attention { background: var(--warning); box-shadow: 0 0 0 5px rgba(239,151,0,.11); }
.session-orb.error { background: var(--danger); box-shadow: 0 0 0 5px rgba(223,75,75,.11); }
.session-state { margin-top: 30px; }
.session-state strong { font-size: 14px; }
.session-state p { min-height: 34px; margin: 7px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.session-footer { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: 12px; }
.session-footer strong { color: var(--text-soft); font-weight: 600; }
.requests-preview { margin-top: 16px; }
.table-wrap { margin-top: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { padding: 10px 11px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-weight: 750; text-align: left; text-transform: uppercase; }
td { padding: 14px 11px; border-bottom: 1px solid #edf0f4; color: var(--text-soft); font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfd; }
.cell-primary { display: grid; gap: 3px; min-width: 0; }
.cell-primary strong, .cell-primary span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-primary strong { color: var(--text); font-size: 13px; }
.cell-primary span { color: var(--text-muted); font-size: 12px; }
.table-empty { min-height: 72px; display: grid; place-items: center; color: var(--text-muted); text-align: center; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.status-badge.success { color: #08754a; background: var(--success-soft); }
.status-badge.warning { color: #9a5d00; background: var(--warning-soft); }
.status-badge.danger { color: #a52f2f; background: var(--danger-soft); }
.status-badge.info { color: #1457c0; background: var(--accent-soft); }
.status-badge.neutral { color: #5b6679; background: #eef1f5; }

.service-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .7fr); gap: 16px; }
.conversation-card { min-height: calc(100dvh - 150px); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.conversation-header { min-height: 72px; padding: 14px 17px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.bot-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.bot-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; }
.bot-identity > div:last-child { min-width: 0; display: grid; gap: 2px; }
.bot-identity strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-identity span { color: var(--text-muted); font-size: 12px; }
.messages { min-height: 380px; padding: 20px; background: var(--surface-muted); overflow-y: auto; display: flex; flex-direction: column; gap: 11px; }
.message { max-width: min(78%, 560px); padding: 11px 13px 8px; border: 1px solid var(--border); border-radius: 13px 13px 13px 4px; background: var(--surface); box-shadow: var(--shadow-sm); }
.message.user { margin-left: auto; color: #fff; border-color: var(--accent); border-radius: 13px 13px 4px 13px; background: var(--accent); }
.message p { margin: 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.message time { display: block; margin-top: 5px; color: var(--text-muted); font-size: 13px; text-align: right; }
.message.user time { color: rgba(255,255,255,.7); }
.message-options { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.message-options button { min-height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--accent); background: var(--surface); font-size: 12px; font-weight: 700; }
.composer { min-height: 68px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); display: flex; gap: 9px; }
.composer input, .stack-form input, .stack-form select, .invite-result input, .filter-group select { width: 100%; min-height: 43px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13px; }
.composer input:focus, .stack-form input:focus, .stack-form select:focus, .invite-result input:focus, .filter-group select:focus { border-color: var(--accent); }
.send-button { width: 43px; height: 43px; flex: 0 0 43px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); display: grid; place-items: center; }
.send-button:hover { background: var(--accent-dark); }
.send-button svg { width: 18px; height: 18px; }
.simulator-guide { align-self: start; padding: 22px; }
.simulator-guide ul { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 15px; }
.simulator-guide li { display: flex; align-items: center; gap: 11px; color: var(--text-soft); font-size: 13px; }
.simulator-guide li span { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 800; }
.notice { margin-top: 26px; padding: 14px; border: 1px solid #cfe0ff; border-radius: 11px; background: var(--accent-soft); }
.notice strong { color: #1457c0; font-size: 12px; }
.notice p { margin: 5px 0 0; color: #4e6590; font-size: 12px; line-height: 1.5; }
.full-table-card { min-height: calc(100dvh - 150px); }
.filter-group { min-width: 160px; display: grid; gap: 5px; }
.filter-group label { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.filter-group select { min-height: 36px; }

.access-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(310px, .9fr); gap: 16px; }
.batch-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 16px; }
.batch-form-card, .batch-info-card, .batch-runs-card { padding: 21px; }
.batch-info-card > p:not(.eyebrow) { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.batch-runs-card { margin-top: 16px; }.batch-runs { display: grid; gap: 12px; margin-top: 18px; }
.batch-run { padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-muted); }
.batch-run-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }.batch-run-head > div { display: grid; gap: 4px; }.batch-run-head strong { font-size: 13px; }.batch-run-head span:not(.status-badge) { color: var(--text-muted); font-size: 12px; }
.batch-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 13px 0; color: var(--text-soft); font-size: 12px; }.batch-details { margin-top: 14px; color: var(--text-soft); font-size: 12px; }.batch-details summary { cursor: pointer; font-weight: 700; }.batch-log-list { display: grid; gap: 6px; margin-top: 10px; }.batch-log { display: grid; grid-template-columns: 75px minmax(0,1fr); gap: 5px 10px; padding: 8px; border-radius: 8px; background: var(--surface); }.batch-log small { grid-column: 2; color: var(--text-muted); overflow-wrap: anywhere; }
.stack-form { margin-top: 22px; display: grid; gap: 15px; }
.stack-form label { display: grid; gap: 7px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.form-feedback { min-height: 16px; margin: 0; color: var(--danger); font-size: 12px; }
.invite-result { margin-top: 18px; padding: 14px; border: 1px solid #cfe0ff; border-radius: 11px; background: var(--accent-soft); }
.invite-result > p { margin: 0 0 8px; color: #1457c0; font-size: 12px; font-weight: 800; }
.invite-result > div { display: flex; gap: 8px; }
.invite-result input { min-width: 0; min-height: 36px; background: #fff; }
.invite-result small { display: block; margin-top: 8px; color: #637495; font-size: 12px; }
.role-list { margin-top: 21px; display: grid; gap: 12px; }
.role-list > div { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.role-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 9px; font-size: 12px; font-weight: 850; }
.role-icon.owner { color: #805600; background: #fff4d9; } .role-icon.admin { color: #1457c0; background: var(--accent-soft); } .role-icon.operator { color: #08754a; background: var(--success-soft); } .role-icon.viewer { color: #5b6679; background: #eef1f5; }
.role-list strong { font-size: 12px; }
.role-list p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.users-card { margin-top: 16px; }
.access-content { margin-top: 18px; }
.access-section + .access-section { margin-top: 24px; }
.access-section-header { margin-bottom: 9px; display: flex; justify-content: space-between; align-items: center; }
.access-section-header h3 { margin: 0; font-size: 13px; }
.access-section-header span { color: var(--text-muted); font-size: 12px; }
.user-row, .invite-row { min-height: 58px; padding: 10px 5px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(190px, 1fr) minmax(120px, .5fr) minmax(120px, .5fr) auto; align-items: center; gap: 12px; }
.user-row:last-child, .invite-row:last-child { border-bottom: 0; }
.user-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.mini-avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 9px; background: #edf1f7; color: var(--text-soft); font-size: 12px; font-weight: 800; }
.user-identity div { min-width: 0; display: grid; gap: 2px; }
.user-identity strong, .user-identity span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-identity strong { font-size: 12px; }
.user-identity span, .row-meta { color: var(--text-muted); font-size: 12px; }
.role-badge { justify-self: start; padding: 5px 8px; border-radius: 7px; color: var(--text-soft); background: #eef1f5; font-size: 12px; font-weight: 700; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.tiny-button { min-height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-soft); background: var(--surface); font-size: 12px; font-weight: 700; }
.tiny-button:hover { border-color: var(--border-strong); background: var(--surface-muted); }
.content-skeleton { min-height: 110px; display: grid; place-items: center; color: var(--text-muted); font-size: 12px; }

.toast-region { position: fixed; z-index: 60; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 36px)); display: grid; gap: 8px; }
.toast { padding: 13px 14px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); background: var(--surface); box-shadow: var(--shadow-md); font-size: 13px; animation: toast-in 160ms ease-out both; }
.toast.error { border-color: #f2c7c7; background: var(--danger-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-layout { grid-template-columns: 1fr; }
  .simulator-guide { display: none; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform 180ms ease-out; box-shadow: var(--shadow-md); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 20; background: rgba(12,18,29,.48); }
  .content-shell { margin-left: 0; }
  .mobile-menu { display: grid; }
  .overview-grid, .access-grid, .batch-layout { grid-template-columns: 1fr; }
  .topbar { padding-inline: 18px; }
  main { padding-inline: 16px; }
}
@media (max-width: 640px) {
  .topbar { min-height: 82px; align-items: flex-start; padding-top: 15px; }
  .page-heading .eyebrow, .page-heading > p:last-child, .environment-chip, .topbar-actions .button span { display: none; }
  .page-heading h1 { margin-top: 6px; font-size: 20px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .button { width: 38px; padding: 0; font-size: 0; }
  .operations-strip { align-items: stretch; flex-direction: column; gap: 0; padding: 5px 17px; }
  .strip-item { min-height: 57px; }
  .strip-separator { width: 100%; height: 1px; }
  .strip-meta { margin: 0; padding: 10px 0; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 134px; }
  .card-heading { align-items: flex-start; }
  .period-chip { display: none; }
  .legend { gap: 10px; }
  .requests-preview .table-wrap, .full-table-card .table-wrap { overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  tbody { display: grid; gap: 9px; }
  tbody tr { padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
  td { min-height: 0; padding: 6px 0; border: 0; }
  tbody tr:hover td { background: transparent; }
  .table-empty { min-height: 72px; }
  .message { max-width: 90%; }
  .conversation-card { min-height: calc(100dvh - 122px); }
  .filter-group { min-width: 120px; }
  .user-row, .invite-row { grid-template-columns: 1fr auto; }
  .user-row > :nth-child(3), .invite-row > :nth-child(3) { display: none; }
  .row-meta { grid-column: 1; }
  .row-actions { grid-column: 2; grid-row: 1 / span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.diagnostics-card { padding: 24px; }
.diagnostics-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.diagnostics-summary .pill { padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); background: var(--surface-muted); color: var(--text-soft); }
.diagnostics-summary .pill.ok { color: var(--success); background: var(--success-soft); border-color: transparent; }
.diagnostics-summary .pill.fail { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.diagnostics-summary .pill.warn { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.diagnostics-groups { display: grid; gap: 18px; }
.diagnostic-group { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.diagnostic-group-head { padding: 12px 16px; background: var(--surface-muted); border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text-soft); }
.diagnostic-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--border); }
.diagnostic-row:first-of-type { border-top: 0; }
.diagnostic-badge { flex: 0 0 auto; min-width: 68px; padding: 3px 9px; border-radius: 999px; text-align: center; font-size: 11px; font-weight: 800; }
.diagnostic-badge.ok { color: var(--success); background: var(--success-soft); }
.diagnostic-badge.fail { color: var(--danger); background: var(--danger-soft); }
.diagnostic-badge.warn { color: var(--warning); background: var(--warning-soft); }
.diagnostic-badge.info { color: var(--info); background: var(--accent-soft); }
.diagnostic-badge.skip { color: var(--text-muted); background: var(--surface-muted); }
.diagnostic-copy { min-width: 0; display: grid; gap: 2px; }
.diagnostic-copy strong { font-size: 13px; }
.diagnostic-copy span { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.login-console-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.login-console-card, .login-console-guide { padding: 24px; }
.login-console-status { border-radius: 999px; background: var(--surface-muted); color: var(--text-soft); padding: 7px 11px; font-size: 12px; font-weight: 700; }
.login-console-status.active { background: var(--warning-soft); color: var(--warning); }
.login-console-notice { display: grid; gap: 4px; padding: 12px 14px; background: var(--warning-soft); color: var(--text); border-radius: 10px; margin: 16px 0; font-size: 13px; }
.login-console-screen { position: relative; aspect-ratio: 16 / 10; background: #111827; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: grid; place-items: center; color: #cbd5e1; }
.login-console-screen img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: crosshair; }
.login-console-screen.is-loading img { opacity: .28; }
.login-console-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; color: #e5e7eb; font-size: 14px; font-weight: 650; text-align: center; background: rgb(17 24 39 / .55); }
.login-console-spinner { width: 18px; height: 18px; border: 2px solid rgb(255 255 255 / .3); border-top-color: #fff; border-radius: 50%; animation: login-console-spin .8s linear infinite; }
@keyframes login-console-spin { to { transform: rotate(360deg); } }
.login-console-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.login-console-keyboard { margin-top: 18px; display: grid; gap: 8px; font-size: 13px; }
.login-console-keyboard > div { display: flex; gap: 8px; }
.login-console-keyboard input { flex: 1; min-width: 0; }
.login-console-keys { flex-wrap: wrap; }
.login-console-keys button { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 7px 10px; color: var(--text); cursor: pointer; }
.login-console-guide ol { padding-left: 20px; display: grid; gap: 10px; }
.login-console-guide p { color: var(--text-soft); line-height: 1.55; }
@media (max-width: 900px) { .login-console-layout { grid-template-columns: 1fr; } }
