/* simplatform on Sabre's theme tokens (sabre/theme-tokens.css, served from Sabre.Shared.Web) and Syncfusion bootstrap5.3.
   The shell mirrors Sabre's App: Sabre.App.Web/Shared/MainLayout.razor(.css), MainTopToolbarComponent, MainLeftNavComponent. */

/* Dark: Sabre's App takes dark values from the tenant's theme; simplatform has no tenant, so it sets its own. */
.layout-root.e-dark-mode {
    --gnt-surface-color: #1d1f24; --gnt-text-color: #e6e8ee; --gnt-border-color: #3a3f4a;
    --gnt-primary-tint: #1f2c45; --gnt-selected-bg: #24395f; --sim-muted: #9aa3b2; --sim-page-bg: #16181c;
}

:root { --sim-muted: #64748b; --sim-page-bg: #f4f6fa; --sim-warn: #9a6b00; --sim-err: #b42318; --sim-ok: #1f7a3e; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--gnt-font-body); font-size: var(--gnt-font-size); color: var(--gnt-text-color); background: var(--gnt-surface-color); }
* { box-sizing: border-box; }

/* ---- shell ---- */
.layout-root { display: flex; flex-direction: column; height: calc(100vh / var(--sim-zoom, 1)); width: 100%; overflow: hidden; background: var(--gnt-surface-color); color: var(--gnt-text-color); }
.layout-header { flex: 0 0 auto; border-bottom: 1px solid var(--gnt-border-color); }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 40px; padding: 2px 8px; background: var(--sabre-chrome-bg); color: var(--sabre-chrome-fg); }
.header-left { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.header-home { display: flex; }
.header-brand-image { display: block; width: 112px; height: 36px; object-fit: contain; }
.header-brand-name { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
.header-center { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; gap: 12px; }
.toolbar-selectors { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; }
.selector-group { display: flex; align-items: center; gap: 6px; color: var(--sabre-chrome-fg-muted); font-size: var(--gnt-font-size-sm); }
.selector { background: transparent; color: var(--sabre-chrome-fg); border: 1px solid var(--sabre-chrome-border); border-radius: 4px; padding: 2px 6px; font: inherit; font-size: var(--gnt-font-size); }
.selector option { color: #172033; }
.selector-empty { color: var(--sabre-chrome-fg-muted); font-size: var(--gnt-font-size); }
.right-strip { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chrome-icon, .chrome-signin { color: var(--sabre-chrome-fg); text-decoration: none; padding: 4px 8px; border-radius: 4px; }
.chrome-icon:hover, .chrome-signin:hover { background: rgba(255, 255, 255, .08); }
.chrome-signin { border: 1px solid var(--sabre-chrome-border); }

.layout-bodywrap { flex: 1 1 auto; min-height: 0; }
.layout-bodywrap .e-splitter { border: 0; }
.side-pane { height: 100%; background: var(--gnt-surface-color); border-right: 1px solid var(--gnt-border-color); }
.main-left-nav { display: flex; flex-direction: column; height: 100%; padding: 8px 6px; gap: 6px; }
.main-left-nav-title { font-weight: 600; font-size: var(--gnt-font-size-sm); color: var(--sim-muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px; }
.main-left-nav-search { width: 100%; }
.main-left-nav-scroll { flex: 1 1 auto; overflow: auto; }
.main-left-nav-empty { color: var(--sim-muted); padding: 4px; }

.main-pane { display: flex; flex-direction: column; height: 100%; min-width: 0; background: var(--sim-page-bg); }
.sim-tabs { display: flex; gap: 2px; padding: 4px 8px 0; border-bottom: 1px solid var(--gnt-border-color); background: var(--gnt-surface-color); overflow-x: auto; flex: 0 0 auto; }
.sim-tab { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; white-space: nowrap; }
.sim-tab.is-active { background: var(--sim-page-bg); border-color: var(--gnt-border-color); margin-bottom: -1px; }
.sim-tab__label { color: var(--gnt-text-color); text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.sim-tab.is-active .sim-tab__label { font-weight: 600; color: var(--gnt-primary-color); }
.sim-tab__close { border: 0; background: transparent; color: var(--sim-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.sim-tab__close:hover { color: var(--gnt-text-color); }
.main-body { flex: 1 1 auto; overflow: auto; padding: 16px; }

/* The footer on the App's model (MainLayout.razor.css, BuildVersionFooter.razor.css, the tool tray in site.css). */
.layout-footer { position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 30px; min-height: 30px;
    font-size: .8rem; background: var(--sabre-chrome-bg); color: var(--sabre-chrome-fg); border-top: 1px solid var(--sabre-chrome-border); }
.gnt-build-footer-group { position: absolute; left: 16px; top: 0; bottom: 0; display: flex; align-items: center; gap: 10px; }
.gnt-build-footer { opacity: .65; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: default; }
.gnt-env-footer { padding: 1px 10px; border-radius: 3px; background: var(--gnt-danger-color); color: var(--gnt-text-inverse);
    font-weight: 700; letter-spacing: .08em; white-space: nowrap; cursor: default; }
.layout-footer__copyright { flex: 0 0 auto; margin-left: auto; padding-left: 16px; color: var(--sabre-chrome-fg-muted); }
.layout-footer__right { flex: 0 1 auto; min-width: 0; margin-left: auto; padding-right: 16px; height: 100%; display: flex; align-items: center; gap: 14px; }
.gnt-footer-tray { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.gnt-footer-tray__chip { display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px; box-sizing: border-box; height: 22px; width: 78px;
    padding: 0 6px; font: inherit; font-size: 11px; line-height: 1; color: var(--sabre-chrome-fg); background: transparent;
    border: 1px solid var(--sabre-chrome-border); border-radius: var(--gnt-radius); cursor: pointer; overflow: hidden; white-space: nowrap; }
.gnt-footer-tray__chip:hover { background: var(--sabre-chrome-border); }
.gnt-footer-tray__chip > .gnt-footer-tray__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gnt-footer-tray__glyph { flex: 0 0 auto; width: 12px; text-align: center; font-size: 12px; opacity: .85; }
.gnt-footer-tray__glyph.gnt-icon { --gnticon-size: 13px; width: 13px; }
.gnt-footer-tray__glyph--density-compact, .gnt-footer-tray__glyph--density-normal, .gnt-footer-tray__glyph--density-comfortable {
    display: inline-flex; flex-direction: column; justify-content: center; height: 14px; }
.gnt-footer-tray__glyph--density-compact > i, .gnt-footer-tray__glyph--density-normal > i, .gnt-footer-tray__glyph--density-comfortable > i {
    display: block; width: 11px; height: 1.5px; background: currentColor; border-radius: 1px; }
.gnt-footer-tray__glyph--density-compact > i + i { margin-top: 2px; }
.gnt-footer-tray__glyph--density-normal > i + i { margin-top: 3.5px; }
.gnt-footer-tray__glyph--density-comfortable > i + i { margin-top: 5px; }

/* Syncfusion menus on the dark chrome bar: tuned through the menu's own CssClass, not global overrides. */
.sim-chrome-menu ul.e-menu { background: transparent; border: 0; }
.sim-chrome-menu ul.e-menu > .e-menu-item, .sim-chrome-menu ul.e-menu > .e-menu-item .e-caret { color: var(--sabre-chrome-fg); }
.sim-chrome-menu ul.e-menu > .e-menu-item.e-focused, .sim-chrome-menu ul.e-menu > .e-menu-item.e-selected { background: rgba(255, 255, 255, .08); color: var(--sabre-chrome-fg); }

/* ---- density (footer chip), on Sabre's data-gnt-density attribute ---- */
[data-gnt-density="compact"] th, [data-gnt-density="compact"] td { padding: 2px 6px; }
[data-gnt-density="comfortable"] th, [data-gnt-density="comfortable"] td { padding: 7px 10px; }

/* ---- page content ---- */
h1 { font-size: 1.25rem; margin: 0 0 12px; } h2 { font-size: 1.05rem; margin: 22px 0 8px; } h3 { font-size: .95rem; margin: 16px 0 6px; }
a { color: var(--gnt-primary-color); }
.muted { color: var(--sim-muted); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; background: var(--gnt-surface-color); margin: 4px 0 12px; }
th, td { border: 1px solid var(--gnt-border-color); padding: 4px 8px; text-align: left; vertical-align: top; }
th { font-weight: 600; background: var(--gnt-primary-tint); }
code, pre { font-family: var(--gnt-mono-font); font-size: .85em; }
pre.log { background: var(--gnt-surface-color); border: 1px solid var(--gnt-border-color); padding: 8px; max-height: 480px; overflow: auto; white-space: pre-wrap; }
.err { color: var(--sim-err); } .warn { color: var(--sim-warn); } .ok { color: var(--sim-ok); }
.pill { display: inline-block; padding: 0 6px; border-radius: 8px; border: 1px solid var(--gnt-border-color); font-size: var(--gnt-font-size-sm); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; font-size: var(--gnt-font-size-sm); color: var(--sim-muted); }
select, button, input { font: inherit; padding: 3px 6px; }
nav.tabs a { margin-right: 12px; }
tr.stall td { background: color-mix(in srgb, var(--sim-warn) 14%, var(--gnt-surface-color)); }
tr.failed td.outcome { color: var(--sim-err); }
img.thumb { width: 160px; border: 1px solid var(--gnt-border-color); display: block; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.compare img { width: 100%; border: 1px solid var(--gnt-border-color); }
#blazor-error-ui { background: var(--sim-err); color: #fff; position: fixed; bottom: 0; left: 0; right: 0; padding: 8px 16px; z-index: 1000; }
#blazor-error-ui a { color: #fff; }

/* ---- the harness (SIM-D48) and Sim assist (SIM-D56) ---- */
.harness { display: flex; flex-direction: column; height: calc(100vh / var(--sim-zoom, 1) - 150px); min-height: 520px; gap: 8px; }
.harness-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 8px 10px; background: var(--gnt-surface-color);
    border: 1px solid var(--gnt-border-color); border-radius: var(--gnt-radius); }
.harness-bar label { display: flex; flex-direction: column; font-size: var(--gnt-font-size-sm); color: var(--sim-muted); }
.harness-cycle { font-size: var(--gnt-font-size-sm); color: var(--sim-muted); padding-bottom: 4px; }
.harness-spacer { flex: 1 1 auto; }
.harness-button { border: 1px solid var(--gnt-border-color); background: var(--gnt-surface-color); color: var(--gnt-text-color);
    border-radius: var(--gnt-radius); padding: 3px 10px; font: inherit; cursor: pointer; }
.harness-button:hover:not(:disabled) { background: var(--gnt-primary-tint); }
.harness-button:disabled { opacity: .5; cursor: default; }
.harness-button.primary { background: var(--gnt-primary-color); color: var(--gnt-text-inverse); border-color: var(--gnt-primary-color); }
.harness-body { display: flex; gap: 8px; flex: 1 1 auto; min-height: 0; }
.harness-panes { display: flex; gap: 8px; flex: 1 1 auto; min-width: 0; }
.harness-pane { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; border: 1px solid var(--gnt-border-color);
    border-radius: var(--gnt-radius); background: var(--gnt-surface-color); overflow: hidden; }
.harness-pane > header { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--sabre-chrome-bg); color: var(--sabre-chrome-fg); }
.harness-pane > header .muted { color: var(--sabre-chrome-fg-muted); }
.harness-pane > header .harness-button { background: transparent; color: var(--sabre-chrome-fg); border-color: var(--sabre-chrome-border); }
.harness-notice { padding: 4px 10px; font-size: var(--gnt-font-size-sm); background: var(--gnt-primary-tint); color: var(--gnt-text-color); }
.harness-pane iframe { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
.assist { display: flex; flex-direction: column; flex: 0 0 380px; min-width: 0; border: 1px solid var(--gnt-border-color);
    border-radius: var(--gnt-radius); background: var(--gnt-surface-color); padding: 8px; gap: 8px; overflow: auto; }
.assist-tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--gnt-border-color); padding-bottom: 6px; }
.assist-tabs button { border: 0; background: transparent; padding: 3px 8px; font: inherit; cursor: pointer; color: var(--gnt-text-color); border-radius: var(--gnt-radius); }
.assist-tabs button.active { background: var(--gnt-primary-tint); font-weight: 600; }
.assist-model { font-size: var(--gnt-font-size-sm); }
.assist-log { flex: 1 1 auto; overflow: auto; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.assist-turn { padding: 6px 8px; border-radius: var(--gnt-radius); }
.assist-turn.user { background: var(--gnt-primary-tint); align-self: flex-end; max-width: 90%; }
.assist-turn.assistant { border: 1px solid var(--gnt-border-color); }
.assist-turn p { margin: 0 0 6px; }
.assist-step { font-size: var(--gnt-font-size-sm); margin: 4px 0; }
.assist-input, .assist-instructions textarea { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; }
.assist-actions { display: flex; justify-content: flex-end; gap: 6px; }
.assist-preview pre, .assist-tool pre { white-space: pre-wrap; font-size: .78rem; max-height: 260px; overflow: auto; background: var(--gnt-primary-tint); padding: 6px; }
.assist-tool { border-bottom: 1px solid var(--gnt-border-color); padding: 4px 0; }
.assist-tool summary { cursor: pointer; font-family: var(--gnt-mono-font); }
.assist-tool label { display: flex; flex-direction: column; font-size: var(--gnt-font-size-sm); color: var(--sim-muted); margin: 4px 0; }
.harness-pane.mobile { flex: 0 0 auto; width: 430px; }
.harness-phone { flex: 1 1 auto; display: flex; justify-content: center; align-items: flex-start; padding: 12px; background: var(--gnt-primary-tint); overflow: auto; }
.harness-phone iframe { flex: 0 0 auto; width: 390px; height: 844px; max-height: 100%; border: 10px solid #1f2328; border-radius: 28px; background: #fff; }

/* Signed-out pages (Layout/SignInLayout.razor) and the host page's loading splash (index.html): Sabre's App sign-in look,
   copied from Sabre.App.Web/Pages/Index.razor.css (signin-theme) and Sabre.Shared.Web/Components/MicrosoftSignInButton.razor.css. */
.signin-theme { display: flex; flex-direction: column; min-height: 100vh; width: 100%; background: var(--gnt-surface-color); }
.signin-theme__header { display: flex; align-items: center; gap: .75rem; flex: 0 0 auto; min-height: 50px; padding: 4px 16px; box-sizing: border-box;
    background: var(--sabre-chrome-bg); color: var(--sabre-chrome-fg); border-bottom: 1px solid var(--sabre-chrome-border); }
.signin-theme__logo { display: block; height: 36px; width: auto; }
.signin-theme__appname { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
.signin-theme__body { position: relative; flex: 1 1 auto; min-height: 0; }
.signin-theme__welcome { position: absolute; top: 50%; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 12px;
    transform: translate(-50%, -50%); text-align: center; width: min(520px, calc(100vw - 48px)); }
.signin-theme__welcome h1 { margin: 0; font-size: 2rem; font-weight: 400; line-height: 1.2; }
.signin-theme__note { margin: 0; color: var(--sim-muted); }
/* The router focuses the page's h1 for screen readers; the App's welcome heading shows no focus box, nor does this one. */
.signin-theme__welcome h1:focus { outline: none; }
.signin-theme__error { margin: 8px 0 0; color: var(--sim-err); }
.welcome-wordmark { height: 1.55em; width: auto; vertical-align: -0.42em; }
.login-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.gnt-ms-signin { display: inline-flex; align-items: center; justify-content: center; gap: 12px; box-sizing: border-box; min-height: 41px; padding: 0 12px;
    border: 1px solid var(--gnt-ms-signin-border); border-radius: 0; background: var(--gnt-ms-signin-face); color: var(--gnt-ms-signin-text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; }
.gnt-ms-signin:hover { background: var(--gnt-ms-signin-face-hover); }
.gnt-ms-signin:focus-visible { outline: 2px solid var(--gnt-ms-signin-text); outline-offset: 2px; }
.gnt-ms-signin__logo { flex: 0 0 auto; width: 21px; height: 21px; }

/* A page heading with its actions on the right (the gap ledger's Support report). */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { margin-bottom: 0; }
.support-report { border: 1px solid var(--gnt-border-color); border-radius: 6px; margin: 12px 0; background: var(--gnt-surface, #fff); }
.support-report__bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--gnt-border-color); }
.support-report__bar .muted { flex: 1; }
.support-report pre { margin: 0; padding: 10px; max-height: 360px; overflow: auto; white-space: pre-wrap; font-size: var(--gnt-font-size-sm); }

/* This Sim properties (ThisSim.razor): label column. */
.props th { text-align: left; width: 200px; color: var(--sim-muted); font-weight: 500; }
/* This Sim beside Sim assist: the page scrolls on its own, the assist panel fills the height on the right. */
.sim-view { display: flex; gap: 12px; height: calc(100vh / var(--sim-zoom, 1) - 150px); min-height: 520px; }
.sim-view-main { flex: 1 1 auto; min-width: 0; overflow: auto; }
/* A change Sim assist proposes, with Approve and Reject. */
.assist-proposal { border: 1px solid var(--gnt-border-color); border-left: 3px solid var(--gnt-primary-color, #2563eb); border-radius: 4px; padding: 6px 8px; margin: 6px 0; }
.assist-proposal ul { margin: 4px 0 6px 18px; padding: 0; }

/* The rest of the App's tool tray (site.css): text-size A, the wide picker chips and the panel above the footer. */
.gnt-footer-tray__glyph--font-small { font-size: 9px; }
.gnt-footer-tray__glyph--font-normal { font-size: 12px; }
.gnt-footer-tray__glyph--font-large { font-size: 15px; font-weight: 700; }
.gnt-footer-tray__chip--wide { width: 112px; }
.gnt-footer-tray__chip.is-open { background: var(--sabre-chrome-border); }
.gnt-footer-tray__backdrop { position: fixed; inset: 0; z-index: 1049; }
.gnt-footer-tray__panel { position: fixed; right: 16px; bottom: 40px; z-index: 1050; min-width: 360px; padding: 10px 12px; color: var(--gnt-text-color);
    background: var(--gnt-surface-color); border: 1px solid var(--gnt-border-soft); border-radius: var(--gnt-radius); box-shadow: var(--gnt-shadow-sm); }
.gnt-footer-tray__panel .selector { width: 100%; }
.gnt-footer-tray__title { font-weight: 600; margin-bottom: 8px; }
.gnt-footer-tray__note { margin-top: 8px; font-size: .78rem; color: var(--sim-muted); }

/* Discovery (Pages/Discovery.razor): one question at a time, then the playback. */
.discovery { max-width: 960px; display: flex; flex-direction: column; gap: 12px; }
.discovery-progress { display: flex; gap: 16px; flex-wrap: wrap; }
.discovery-card { background: var(--gnt-surface-color); border: 1px solid var(--gnt-border-color); border-radius: 8px; padding: 20px; }
.discovery-card h2 { font-size: 1.25rem; font-weight: 500; margin: 0 0 16px; }
.discovery-story { width: 100%; box-sizing: border-box; margin-bottom: 16px; font: inherit; padding: 8px; }
.discovery-prompt { margin-bottom: 14px; }
.discovery-prompt__label { font-weight: 600; margin-bottom: 6px; }
.discovery-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.discovery-choices .is-chosen { text-decoration: underline; }
.discovery-actions { display: flex; gap: 8px; margin-top: 18px; }
.discovery-playback { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.discovery-playback th, .discovery-playback td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--gnt-border-color); vertical-align: top; }
.discovery-playback tr.is-assumed td { color: var(--sim-warn); }
.discovery-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 8px 0 16px; }
.discovery-examples .discovery-prompt__label { grid-column: 1 / -1; }
.discovery-example { text-align: left; font: inherit; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.discovery-example:hover { border-color: #0b6efd; background: #f5f9ff; }
.discovery-example span { color: #555; font-size: 0.9em; line-height: 1.4; }
