:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #182631;
    background: #f5f7fa;
    line-height: 1.5;
    --muted: #526474;
    --line: #dce4ea;
    --primary: #1766be;
    --primary-ink: #fff;
    --accent-text: color-mix(in srgb, var(--primary) 40%, #182631);
    --accent-surface: color-mix(in srgb, var(--primary) 10%, #fff);
    --topbar-height: 4rem;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent-text); text-underline-offset: .2em; }
a:hover { color: #182631; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; letter-spacing: -.02em; }
small, .muted { color: var(--muted); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip-link { position: fixed; z-index: 10; top: .5rem; left: .5rem; background: #fff; padding: .65rem; transform: translateY(-160%); }
.skip-link:focus-visible { transform: none; }
.workspace {
    --sidebar-width: 15rem;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
}
.workspace.sidebar-collapsed { --sidebar-width: 4.5rem; }
.topbar {
    grid-column: 1 / -1;
    position: sticky;
    z-index: 5;
    top: 0;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem clamp(.8rem, 3vw, 1.7rem);
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.sidebar-toggle, .account-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: .65rem;
    background: #fff;
    min-height: 2.65rem;
    min-width: 2.65rem;
    color: #263d4a;
    cursor: pointer;
}
[hidden] { display: none !important; }
.sidebar-toggle:hover, .account-trigger:hover, .account-menu[open] .account-trigger { background: var(--accent-surface); }
.sidebar-toggle-icon { display: block; width: 1rem; height: .85rem; border: 1.5px solid currentColor; border-radius: .15rem; }
.sidebar-toggle-icon::before { display: block; content: ""; height: 100%; width: .32rem; border-right: 1.5px solid currentColor; }
.brand { display: flex; gap: .65rem; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.brand:hover { color: inherit; }
.brand strong { font-size: 1.1rem; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
.brand-logo { display: block; width: 2.55rem; height: 2.55rem; border-radius: .55rem; object-fit: contain; flex: none; background: #fff; }
.account-menu { margin-left: auto; position: relative; min-width: max-content; }
.account-trigger { gap: .55rem; padding: .28rem .65rem .28rem .32rem; list-style: none; font-size: .89rem; }
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger::after { content: ""; width: .38rem; height: .38rem; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); margin: -.2rem .1rem 0 .15rem; }
.account-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11rem; }
.avatar { display: grid; place-items: center; flex: none; height: 1.95rem; width: 1.95rem; border-radius: 50%; background: var(--accent-surface); color: var(--accent-text); font-weight: 750; }
.account-dropdown { position: absolute; top: calc(100% + .55rem); right: 0; width: min(16rem, calc(100vw - 1.6rem)); padding: .35rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 12px 36px #263d4a22; }
.account-heading { display: grid; padding: .6rem .7rem; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); margin-bottom: .25rem; }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; padding: .65rem .7rem; border: 0; border-radius: .4rem; color: #263d4a; background: transparent; text-align: left; text-decoration: none; font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer; }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--accent-surface); }
.account-dropdown form { border-top: 1px solid var(--line); padding-top: .25rem; margin-top: .25rem; }
.sidebar {
    position: sticky;
    top: var(--topbar-height);
    height: calc(100dvh - var(--topbar-height));
    overflow-y: auto;
    padding: .95rem .65rem;
    border-right: 1px solid var(--line);
    background: #fff;
}
.sidebar nav { display: grid; gap: .25rem; }
.nav-link { display: flex; align-items: center; gap: .65rem; min-height: 2.7rem; padding: .45rem .65rem; border-radius: .5rem; color: #42566a; text-decoration: none; font-weight: 650; font-size: .9rem; }
.nav-link[aria-current], .nav-link:hover { background: var(--accent-surface); color: var(--accent-text); }
.nav-link[aria-current] { box-shadow: inset 3px 0 var(--primary); }
.nav-icon { flex: none; width: 1.25rem; text-align: center; font-size: 1.13rem; font-weight: 750; }
.sidebar-collapsed .nav-link { justify-content: center; }
.sidebar-collapsed .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.text-button { background: transparent; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; font: inherit; }
.main-content { width: 100%; max-width: 104rem; padding: clamp(1rem, 3vw, 2.6rem); margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1.65rem; }
.page-head h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.page-head p { color: var(--muted); margin-top: .5rem; }
.back-link { display: inline-block; margin-bottom: .7rem; font-weight: 600; }
.page-head .eyebrow { color: #07665c; font-weight: 750; margin: 0 0 .4rem; font-size: .86rem; }
.panel, .stat { background: #fff; border: 1px solid var(--line); border-radius: .9rem; box-shadow: 0 3px 10px #172a3908; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.5rem; }
.stat { display: grid; gap: .4rem; min-height: 6.7rem; padding: .9rem 1.05rem; border-top: 3px solid #4b8da2; text-decoration: none; color: #214753; }
.stat:hover { box-shadow: 0 4px 12px #172a391a; }
.stat span { font-weight: 650; font-size: .9rem; }
.stat strong { font-size: 2rem; color: #182631; line-height: 1.1; }
.stat.indigo { border-top-color: #748bea; }
.stat.amber { border-top-color: #ba791f; }
.stat.green { border-top-color: #369c79; }
.section-head { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: space-between; align-items: baseline; padding: 1rem 1.18rem; }
.section-head a { font-size: .9rem; font-weight: 650; }
.scroll-table { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .8rem 1.15rem; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: #3f5668; background: #f7fafb; font-size: .81rem; font-weight: 700; white-space: nowrap; }
td { font-size: .91rem; }
.ticket-link { color: #154d51; font-weight: 700; text-decoration: none; }
.ticket-link:hover { text-decoration: underline; }
.table-meta { display: block; margin-top: .2rem; font-size: .81rem; }
.date { white-space: nowrap; }
.status { display: inline-block; border-radius: .4rem; padding: .2rem .52rem; background: #e9eff4; color: #39546a; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.status.AwaitingCr, .status.PreparingWorkbook { background: #fcf0d8; color: #724600; }
.status.AwaitingMindId { background: #eaeffd; color: #35468e; }
.status.ReadyToExecute, .status.Completed { background: #def3e8; color: #18573c; }
.status.Rejected { background: #ffe9e5; color: #882b25; }
.empty { padding: 2.6rem 1rem; text-align: center; color: var(--muted); }
.empty p { margin-top: .3rem; }
.button { display: inline-flex; min-height: 2.55rem; align-items: center; justify-content: center; padding: .5rem .9rem; border: 1px solid transparent; border-radius: .45rem; font: inherit; font-size: .91rem; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; }
.button.primary { background: var(--primary); color: var(--primary-ink); }
.button.primary:hover { box-shadow: inset 0 0 0 2px var(--primary-ink); }
.button.secondary { background: #fff; border-color: #b9cbd0; color: #24555c; }
.button.secondary:hover { background: #eef6f5; }
.toolbar { display: grid; gap: .6rem; margin-bottom: 1rem; }
.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; padding: .85rem 1rem; }
.filters label:first-child { flex: 1 1 11rem; }
.filters label { flex: 0 1 12rem; }
.template-panel { padding: .6rem 1rem; }
.template-panel a { display: inline-block; margin: .55rem .7rem .2rem 0; }
.pagination { display: flex; align-items: center; gap: .8rem; justify-content: center; margin-top: 1rem; }
.form-panel { padding: 1.3rem; max-width: 52rem; }
.form-stack { display: grid; gap: .9rem; }
.form-stack > .button { justify-self: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
label { display: grid; gap: .35rem; color: #263d4a; font-size: .9rem; font-weight: 650; min-width: 0; }
input, select, textarea { width: 100%; min-height: 2.55rem; padding: .5rem .65rem; border: 1px solid #b8c9d2; border-radius: .45rem; background: #fff; color: #182631; font: inherit; font-weight: 400; }
textarea { min-height: 5rem; resize: vertical; }
input[type=file] { font-size: .84rem; }
input[type=checkbox] { margin: .15em 0 0; padding: 0; height: 1rem; width: 1rem; min-height: 1rem; accent-color: var(--primary); }
.check, .checklist label { display: flex; align-items: start; gap: .55rem; font-weight: 500; }
.checklist { display: grid; gap: .35rem; border: 1px solid var(--line); border-radius: .45rem; margin: 0; padding: .5rem .7rem .65rem; }
.checklist legend { padding: 0 .3rem; color: #3f5668; font-size: .88rem; font-weight: 700; }
.button-row, .inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.inline-form select { width: auto; }
.after-form { margin-top: .8rem; }
.notice { padding: .8rem 1rem; border-radius: .55rem; background: #e1f4ee; border: 1px solid #aad6c7; margin-bottom: .85rem; color: #1d5348; overflow-wrap: anywhere; }
.notice.error, .validation { color: #882b25; }
.notice.error { background: #fff1ee; border-color: #efc3bc; }
.notice ul, .validation ul { margin: .25rem 0 0; padding-left: 1.15rem; }
.validation-summary-valid { display: none; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1rem; }
.column { display: flex; min-width: 0; flex-direction: column; gap: 1rem; }
.detail-panel { padding: 1.15rem; overflow-wrap: anywhere; }
.detail-panel h2 { margin-bottom: .7rem; }
.detail-panel p.muted { margin-bottom: .7rem; }
.metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: .85rem 0 0; }
.metadata dt { color: var(--muted); font-size: .83rem; font-weight: 700; }
.metadata dd { margin: .12rem 0 0; font-size: .93rem; }
.preline { white-space: pre-line; }
.document-list, .timeline { list-style: none; padding: 0; margin: 0; }
.document-list li, .timeline li { border-top: 1px solid var(--line); padding: .72rem 0; }
.document-list small, .timeline small { display: block; margin-top: .18rem; font-size: .81rem; }
.timeline p { margin-top: .33rem; font-size: .9rem; }
.simulation-ticket-head { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: .45rem 1rem; }
.simulation-ticket-head p.muted { margin-bottom: .2rem; font-size: .88rem; }
.simulation-ticket-head h2, .simulation .form-stack h2 { margin-bottom: 0; }
.simulation .form-stack h2 + p.muted { margin: .35rem 0 0; }
.simulation-company select, .simulation-workbook .button { justify-self: start; }
.upload-panel { border-top: 1px solid var(--line); padding: .6rem 0; }
.upload-panel form { margin-top: .6rem; }
summary { font-weight: 650; color: #174d50; cursor: pointer; }
#create-user { scroll-margin-top: calc(var(--topbar-height) + 1rem); }
.settings-section { margin-top: 1.35rem; }
.settings-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow-wrap: anywhere; }
.settings-summary > div { display: grid; align-content: start; gap: .25rem; padding: 1rem 1.2rem; }
.settings-summary > div + div { border-left: 1px solid var(--line); }
.settings-summary span, .settings-card > span:last-child { color: var(--muted); font-size: .9rem; }
.settings-summary strong { font-size: 1.1rem; }
.settings-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: .7rem; }
.settings-card { display: grid; align-content: start; gap: .32rem; text-decoration: none; color: #182631; padding: 1rem 1.15rem; }
.settings-card:hover { border-color: var(--primary); background: var(--accent-surface); }
.settings-icon { display: grid; place-items: center; inline-size: 2.25rem; block-size: 2.25rem; border-radius: .55rem; margin-bottom: .35rem; background: var(--accent-surface); color: var(--accent-text); font-size: 1.15rem; }
.branding-field { padding: .7rem 1rem 1rem; gap: .65rem; }
.branding-input { display: grid; width: min(100%, 28rem); }
.branding-input input[type=color] { width: 4.5rem; cursor: pointer; }
.brand-preview { display: grid; place-items: center; width: 6rem; height: 6rem; border-radius: .65rem; border: 1px solid var(--line); background: #fff; }
.brand-preview img { width: 85%; height: 85%; object-fit: contain; }
.favicon-preview { width: 3rem; height: 3rem; }
.favicon-preview img { width: 1.5rem; height: 1.5rem; }
.profile-card { max-width: 38rem; }
.profile-avatar { width: 3.75rem; height: 3.75rem; font-size: 1.6rem; margin-bottom: 1rem; }
.manual { max-width: 58rem; }
.manual section { padding: 1.15rem 1.35rem; margin-top: 1rem; scroll-margin-top: calc(var(--topbar-height) + 1rem); }
.manual p + p { margin-top: .7rem; }
.manual h3 { font-size: 1rem; margin: 1.2rem 0 .55rem; }
.manual li + li { margin-top: .4rem; }
.manual ol, .manual ul { padding-inline-start: 1.4rem; }
.manual-index ul { display: flex; flex-wrap: wrap; gap: .55rem 1.25rem; margin-bottom: 0; }
.manual-index li + li { margin-top: 0; }
.interactive-demo { max-width: 70rem; }
.demo-controls { display: grid; gap: .55rem; margin-bottom: 1rem; padding: 1rem; }
.demo-controls label { font-weight: 650; }
.demo-controls select { max-width: 100%; }
.demo-playback { display: grid; gap: .35rem; }
.demo-playback p { color: var(--muted); font-size: .9rem; }
.demo-playback progress { width: 100%; height: .6rem; accent-color: var(--primary); }
.demo-buttons, .demo-links { display: flex; flex-wrap: wrap; gap: .55rem 1rem; }
.demo-buttons button[aria-disabled="true"] { opacity: .55; cursor: default; }
.demo-scenario { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 1rem; margin-bottom: 1rem; }
.demo-links { margin-top: 1rem; }
.demo-scenario h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.demo-ticket-ref { color: var(--muted); font-size: .9rem; }
.demo-step { border-inline-start: .25rem solid var(--primary); }
.demo-metadata { margin: 1rem 0 0; }
.demo-metadata dd { overflow-wrap: anywhere; }
.demo-metadata .status { white-space: normal; }
.demo-history .timeline { margin-bottom: 0; }
.demo-history [aria-current="step"] strong { color: var(--accent-text); }
.demo-overview summary { cursor: pointer; font-weight: 650; }
.demo-overview p { margin-top: .7rem; }
@media (max-width: 720px) {
    .demo-scenario { grid-template-columns: minmax(0, 1fr); }
}

.guest { display: grid; place-items: center; padding: 1.2rem; background: linear-gradient(135deg, #ebf3f6, #f7fbf9 70%); }
.guest-content { width: min(29rem, 100%); }
.guest-brand { margin: 0 0 1.05rem .1rem; }
.guest-card { background: #fff; padding: clamp(1rem, 4vw, 2rem); border: 1px solid var(--line); border-radius: .95rem; box-shadow: 0 10px 36px #183e4a12; max-width: 34rem; }
.guest-card h1 { font-size: 2rem; }
.guest-card p { margin: .5rem 0 1.3rem; }
.guest-card .form-stack > button { width: 100%; margin-top: .15rem; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: #fff; }
.login-intro { display: grid; grid-template-rows: auto 1fr; gap: 2.5rem; background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 24%, #142538), #142538 76%); color: #fff; padding: clamp(1.6rem, 5vw, 4.25rem); }
.login-brand { display: flex; align-items: center; gap: .85rem; font-size: 1.2rem; font-weight: 750; overflow-wrap: anywhere; }
.login-brand .brand-logo { width: 3rem; height: 3rem; }
.login-intro-content { align-self: center; padding-block: 1.5rem 5rem; max-width: 36rem; }
.login-intro h2 { font-size: clamp(2.25rem, 4.6vw, 4.65rem); line-height: 1.02; letter-spacing: -.055em; }
.login-intro p { margin-top: 1.2rem; font-size: 1.08rem; color: #d8e5f4; max-width: 31rem; }
.login-workflow { margin-top: 2rem; border-radius: .9rem; border: 1px solid #ffffff4a; padding: 1rem 1.1rem; background: #ffffff0e; }
.login-workflow ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; list-style: none; padding: 0; margin: .7rem 0 0; }
.login-workflow li { border-top: .25rem solid #a9c9ef; padding-top: .45rem; font-size: .88rem; }
.login-form-side { display: grid; place-items: center; padding: clamp(1.35rem, 5vw, 5rem); }
.login-form-inner { width: min(100%, 25rem); }
.login-mobile-brand { display: none; }
.login-form { margin-top: 1.5rem; }
.login-form .button { justify-self: stretch; justify-content: space-between; min-height: 2.9rem; padding-inline: 1rem; }
.login-help { color: var(--muted); font-size: .9rem; margin-top: 1.25rem; }
.login-content > .notice { margin: .7rem; }

@media (max-width: 950px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .workspace, .workspace.sidebar-collapsed { display: block; }
    .topbar-brand { flex: 1; }
    .topbar-brand strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .account-name { display: none; }
    .sidebar { position: static; height: auto; border: 0; border-bottom: 1px solid var(--line); }
    .workspace-interactive .sidebar { position: fixed; z-index: 4; inset: var(--topbar-height) auto 0 0; width: min(17rem, 88vw); border-radius: 0 .7rem 0 0; }
    .sidebar-backdrop { position: fixed; z-index: 3; inset: var(--topbar-height) 0 0; background: #172b4266; }
    .stats { gap: .5rem; }
    .stat { min-height: 5.5rem; padding: .65rem; }
    .form-grid { grid-template-columns: 1fr; }
    th, td { padding: .65rem .8rem; }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { display: none; }
    .login-mobile-brand { display: flex; margin-bottom: 2.4rem; }
}
@media (max-width: 480px) {
    .settings-cards, .settings-summary { grid-template-columns: 1fr; }
    .settings-summary > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
