:root {
  color-scheme: light;
  font: 15px/1.55 Inter, "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  --canvas: #f4f7fc;
  --ink: #062654;
  --muted: #5b7297;
  --line: #ccd9ea;
  --paper: #fefefe;
  --soft: #e9f1fb;
  --brand: #0c4696;
  --brand-dark: #062654;
  --button-primary: #0c4696;
  --accent: #fdca4e;
  --danger: #a43e35;
  --warning: #9a6715;
  --sidebar-muted: #b9cce4;
  --topbar: rgb(244 247 252 / .92);
  --paper-glass: rgb(254 254 254 / .96);
  --field-line: #b8c8dc;
  --field-label: #314f76;
  --input: #fff;
  --focus: rgb(12 70 150 / .14);
  --hover: #f3f7fc;
  --empty-border: #aebfd5;
  --empty-bg: rgb(255 255 255 / .38);
  --notice-line: #e6c66d;
  --notice-ink: #624507;
  --notice-bg: #fff7d8;
  --warning-line: #d29a35;
  --warning-ink: #704d08;
  --warning-bg: #fff8e7;
  --summary-bg: #edf3fb;
  --chat-user-line: #9db8da;
  --chat-user-bg: #dfebf8;
  --error-line: #e4bbb7;
  --error-bg: #fff9f8;
  --disabled-ink: #7183a0;
  --disabled-bg: #e7edf6;
  --evidence-bg: #fbfcfe;
  --success-ink: #155a3b;
  --success-bg: #daf1e2;
  --pending-ink: #6b510d;
  --pending-bg: #f7eabd;
  --rejected-ink: #8b2f29;
  --rejected-bg: #f7ddda;
  --archived-ink: #59615e;
  --archived-bg: #e8eae8;
  --sidebar: 15.5rem;
  --radius: 1rem;
  --shadow: 0 8px 32px rgb(6 38 84 / .1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #07172e;
  --ink: #f2f6fc;
  --muted: #afc0d7;
  --line: #29496f;
  --paper: #0d2847;
  --soft: #15375f;
  --brand: #73a9e8;
  --brand-dark: #031226;
  --button-primary: #2f6fb7;
  --danger: #ff9b91;
  --warning: #ffe49a;
  --sidebar-muted: #b9cce4;
  --topbar: rgb(7 23 46 / .92);
  --paper-glass: rgb(13 40 71 / .96);
  --field-line: #42668f;
  --field-label: #c1d2e7;
  --input: #0a213d;
  --focus: rgb(115 169 232 / .25);
  --hover: #12345a;
  --empty-border: #42668f;
  --empty-bg: rgb(13 40 71 / .55);
  --notice-line: #745b1d;
  --notice-ink: #ffe49a;
  --notice-bg: #3d300c;
  --warning-line: #c49334;
  --warning-ink: #ffe49a;
  --warning-bg: #3d300c;
  --summary-bg: #102f52;
  --chat-user-line: #426c9e;
  --chat-user-bg: #153e6b;
  --error-line: #8c4c4a;
  --error-bg: #402322;
  --disabled-ink: #8296b1;
  --disabled-bg: #132b49;
  --evidence-bg: #0b2340;
  --success-ink: #9ee2b9;
  --success-bg: #174832;
  --pending-ink: #ffe49a;
  --pending-bg: #493b12;
  --rejected-ink: #ffb1aa;
  --rejected-bg: #4a2928;
  --archived-ink: #c3ceda;
  --archived-bg: #31445a;
  --shadow: 0 10px 34px rgb(0 0 0 / .3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 20rem; background: var(--brand-dark); }
body { min-height: 100vh; margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--brand); text-underline-offset: .2em; }
h1, h2, h3, h4, p, dl, dd { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.75rem, 3vw, 2.7rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin-bottom: .8rem; font-size: 1.35rem; line-height: 1.25; letter-spacing: -.015em; }
h3 { margin-bottom: .35rem; font-size: 1rem; }
p { margin-bottom: .8rem; }

.sr-only, .skip-link:not(:focus) { 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: 100; left: 1rem; top: 1rem; padding: .7rem 1rem; border-radius: .5rem; color: white; background: var(--brand-dark); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); display: flex; flex-direction: column; padding: 1.6rem 1.1rem; color: #ecf7ef; background: var(--brand-dark); }
.brand { display: flex; align-items: center; gap: .8rem; margin: 0 .45rem 2.2rem; }
.brand strong { display: block; font-size: 1.15rem; letter-spacing: .02em; }
.brand small { display: block; color: var(--sidebar-muted); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.brand-mark { flex: 0 0 auto; display: grid; place-items: center; width: 2.35rem; aspect-ratio: 1; border-radius: .75rem .75rem .75rem .18rem; color: var(--brand-dark); background: var(--accent); font-weight: 900; }
.side-nav { display: grid; gap: .35rem; }
.side-nav button, .mobile-nav button { border: 0; cursor: pointer; }
.side-nav button { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .76rem .85rem; border-radius: .7rem; color: var(--sidebar-muted); background: transparent; text-align: left; }
.side-nav button > span:first-child { width: 1.1rem; font-size: 1.15rem; text-align: center; }
.side-nav button:hover, .side-nav button:focus-visible, .side-nav button[aria-current="page"] { color: white; background: rgb(255 255 255 / .1); outline: none; }
.sidebar-identity { margin-top: auto; padding: 1rem .65rem 0; border-top: 1px solid rgb(255 255 255 / .12); color: var(--sidebar-muted); font-size: .78rem; }
.sidebar-identity strong { display: block; color: white; }

.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 1rem; min-height: 4.6rem; padding: .75rem clamp(1rem, 3vw, 2.4rem); border-bottom: 1px solid var(--line); background: var(--topbar); backdrop-filter: blur(16px); }
.mobile-brand { display: none; }
.global-search { position: relative; display: flex; align-items: center; width: min(42rem, 70%); }
.global-search > span { position: absolute; left: .9rem; color: var(--muted); font-size: 1.2rem; pointer-events: none; }
.global-search input { width: 100%; height: 2.85rem; padding: 0 4.2rem 0 2.65rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--paper); outline: none; }
.global-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.global-search kbd { position: absolute; right: .75rem; padding: .12rem .45rem; border: 1px solid var(--line); border-radius: .35rem; color: var(--muted); background: var(--soft); font: .68rem/1.4 inherit; }
.account-menu { position: relative; margin-left: auto; }
.account-menu summary { display: flex; align-items: center; gap: .55rem; list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; color: white; background: var(--brand); font-weight: 700; }
.account-popover { position: absolute; right: 0; top: calc(100% + .7rem); width: 19rem; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); box-shadow: var(--shadow); }
.theme-field { margin: .8rem 0; }
.account-popover .button { width: 100%; }
.account-actions { display: grid; gap: .25rem; margin-bottom: .55rem; padding-block: .55rem; border-block: 1px solid var(--line); }

#content { width: min(96rem, 100%); margin-inline: auto; padding: clamp(1.3rem, 3vw, 2.6rem); padding-bottom: 5rem; }
#content:focus { outline: none; }
.status { position: fixed; z-index: 50; right: 1rem; bottom: 1rem; min-height: 0; margin: 0; }
.status:not(:empty) { padding: .65rem .9rem; border-radius: .6rem; color: white; background: var(--brand-dark); box-shadow: var(--shadow); }
#notice-region:empty { display: none; }
.notice { display: flex; gap: .7rem; margin: 1rem clamp(1rem, 3vw, 2.4rem) 0; padding: .8rem 1rem; border: 1px solid var(--notice-line); border-radius: .7rem; color: var(--notice-ink); background: var(--notice-bg); }
.requirement-anchor { position: relative; }
.requirement-anchor:hover { outline: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: .25rem; }
.requirement-citation { position: absolute; z-index: 80; top: calc(100% + .45rem); right: 0; display: none; width: min(25rem, calc(100vw - 2rem)); padding: .8rem .9rem; border: 1px solid var(--line); border-radius: .75rem; color: white; background: var(--brand-dark); box-shadow: var(--shadow); text-align: left; text-decoration: none; }
.requirement-anchor:hover > .requirement-citation, .requirement-anchor:focus-within > .requirement-citation { display: grid; gap: .25rem; }
.requirement-citation strong { color: var(--accent); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.requirement-citation q { color: white; font-size: .84rem; font-style: normal; }
.requirement-citation span { color: var(--sidebar-muted); font-size: .72rem; font-weight: 700; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.page-head p { margin: 0; color: var(--muted); }
.page-head--collection > div:first-child { max-width: 56rem; }
.page-head--detail { align-items: flex-start; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.visit-head-detail { display: grid; gap: .15rem; margin-top: .55rem; }
.visit-head-detail .visit-head-equipment { color: var(--ink); font-weight: 700; }
.visit-head-detail time { color: var(--muted); font-size: .84rem; }
.page-head--workspace { align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.page-head--workspace h1 { font-size: clamp(1.55rem, 2.5vw, 2.15rem); }
.eyebrow { margin-bottom: .25rem; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.lede { color: var(--muted); font-size: 1.05rem; }
.section { margin-top: 2.1rem; }
.section--primary { margin-top: 1.25rem; }
.section--primary > .section-head h2 { font-size: 1.5rem; }
.section--supporting { margin-top: 2.6rem; }
.section--administrative { margin-top: 2.8rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.section--administrative > .section-head h2 { color: var(--muted); font-size: 1rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section-head h2 { margin: 0; }
.section-head a, .text-button { border: 0; color: var(--brand); background: transparent; cursor: pointer; font-weight: 700; text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr)); gap: 1rem; }
.grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.stat { min-height: 8.4rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.stat small { display: block; color: var(--muted); }
.stat strong { display: block; margin-top: .6rem; font-size: 2rem; line-height: 1; }
.stat a { display: inline-block; margin-top: .8rem; font-size: .78rem; font-weight: 700; }

.panel, .card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 2px 12px rgb(6 38 84 / .06); }
.panel { padding: 1.15rem; }
.card { position: relative; display: flex; min-width: 0; overflow: hidden; }
.card__body { display: block; flex: 1; width: 100%; min-height: 100%; padding: 1.05rem; border: 0; color: inherit; background: transparent; text-align: left; text-decoration: none; }
button.card__body { cursor: pointer; }
.card:has(.card__body:hover), .card:has(.card__body:focus-visible) { background: var(--hover); }
button.card__body:hover, button.card__body:focus-visible, a.card__body:hover, a.card__body:focus-visible { background: transparent; outline: none; }
.card--browse { box-shadow: none; }
.card--work { border-left: .3rem solid var(--accent); }
.technician-home { --work-top: 4.6rem; --work-identity-height: 0px; }
.technician-work-slot { min-width: 0; }
.work-visit-list { display: grid; gap: .75rem; }
.work-visit-row { position: relative; min-width: 0; padding: .25rem .75rem .75rem 3rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); box-shadow: var(--shadow); }
.work-visit-row:has(.work-pick:hover) { border-color: var(--brand); background: var(--hover); }
.work-visit-row.is-selected { border: 2px solid var(--brand); background: var(--soft); box-shadow: inset 4px 0 var(--brand); }
.work-selected-label { color: var(--brand); font-size: .7rem; margin-left: auto; white-space: nowrap; }
.work-details-arrow { position: absolute; top: 0; left: 0; width: 44px; height: 44px; border: 0; background: transparent; color: var(--brand); font-size: 1.5rem; cursor: pointer; }
.work-identity-line { display: flex; align-items: center; gap: .35rem; min-width: 0; font-size: .8rem; min-height: 44px; }
.work-case-numbers { display: flex; align-items: center; gap: .6rem; overflow-x: auto; white-space: nowrap; }
.work-case-numbers a { display: inline-flex; align-items: center; min-height: 44px; flex-shrink: 0; }
.work-visit-number { flex-shrink: 0; white-space: nowrap; }
.work-pick { display: grid; position: relative; width: 100%; gap: .2rem; min-height: 44px; padding: 0; border: 0; text-align: left; background: transparent; cursor: pointer; }
.work-pick > small { color: var(--muted); font-size: .72rem; }
.work-location { font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; }
.work-problem { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .8rem; color: var(--muted); }
.selected-work-head { position: sticky; top: var(--work-top); z-index: 14; background: var(--canvas); }
.selected-work-head .work-visit-row { padding-right: 1.8rem; }
.selected-work-head .work-identity-line { flex-wrap: wrap; gap: 0 .35rem; }
.work-picker-chevron { position: absolute; right: -1.25rem; top: .1rem; }
.visit-workspace { padding: 0 0 calc(var(--work-composer-height, 64px) + 1rem); background: transparent; min-width: 0; }
.visit-workspace[hidden], .visit-workspace [hidden] { display: none !important; }
.work-mode-actions { display: flex; gap: .2rem; width: max-content; max-width: 100%; padding: .2rem; margin: 0 auto .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.technician-home .work-mode-actions { position: sticky; top: calc(var(--work-top) + var(--work-identity-height)); z-index: 14; }
.work-mode-actions button { min-width: 0; min-height: 44px; padding: .45rem .7rem; white-space: normal; border: 0; border-radius: 999px; cursor: pointer; background: transparent; }
.work-mode-actions [aria-selected=true] { background: var(--brand); color: white; }
.visit-workspace > [role=status]:empty { display: none; }
.work-equipment { font-size: .82rem; border-bottom: 1px solid var(--line); margin-block: .75rem; }
.work-equipment-identity { line-height: 1.6; margin-bottom: .35rem; }
.work-equipment .equipment-context { margin: .8rem 0; }
.work-references { margin: .75rem 0; border: 1px solid var(--line); border-radius: .6rem; padding: .5rem .75rem; }
.work-references > summary { min-height: 44px; align-content: center; cursor: pointer; font-size: .85rem; }
.work-saved-reports { margin: .75rem 0; }
.work-question-suggestions { display: grid; gap: .5rem; margin: 1rem 0; }
.work-question-suggestions h3 { margin: 0; }
.work-question-suggestions button { text-align: left; justify-content: flex-start; white-space: normal; }
.work-task-hint { margin: .75rem 0; color: var(--muted); font-size: .85rem; }
.work-unit-manual h3 { font-size: .85rem; margin: .75rem 0 .35rem; }
.visit-workspace .work-unit-manual .visit-reference-tile { flex: 1; max-width: none; }
.visit-workspace .work-unit-manual .visit-reference-tile__copy strong { display: block; }
.work-save-status { color: var(--brand); font-size: .85rem; }
.evidence-stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); align-items: start; gap: .65rem; }
.evidence-note { position: relative; min-width: 0; padding: .65rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--paper); overflow-wrap: anywhere; }
.evidence-note-meta { padding-right: 2rem; }
.evidence-note .evidence-note-text { max-height: 12rem; overflow: auto; }
.evidence-stack > .meta { grid-column: 1 / -1; }
.evidence-note-meta { display: flex; flex-wrap: wrap; gap: .2rem .6rem; color: var(--muted); font-size: .7rem; margin-bottom: .3rem; }
.evidence-note-text { white-space: pre-wrap; line-height: 1.65; }
.configuration-details { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .8rem; line-height: 1.6; }
.configuration-details th, .configuration-details td { padding: .45rem .35rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.configuration-details th { width: 40%; padding-left: calc(.35rem + var(--depth) * .8rem); font-weight: 500; color: var(--muted); }
.configuration-details .configuration-group th { color: var(--ink); font-weight: 700; background: var(--soft); }
.configuration-details small { display: block; margin-top: .3rem; }
.configuration-details ul { margin: 0; padding-left: 1rem; }
.definition-list > div:has(.configuration-details) { grid-column: 1 / -1; }
.definition-list dd:has(.configuration-details) { margin: .35rem 0 0; }
.evidence-note :is(p, h4) { margin-bottom: .3rem; }
.evidence-note > .work-evidence-open { display: block; width: 100%; }
.evidence-note .object-actions { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .8rem; }
.evidence-photo { display: block; width: 100%; height: 8rem; object-fit: contain; border-radius: .3rem; background: var(--soft); }
.work-evidence-open { padding: 0; border: 0; background: transparent; cursor: pointer; }
.work-evidence-menu { position: absolute; top: .2rem; right: 0; z-index: 2; }
.work-evidence-menu > summary { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; list-style: none; font-size: 1.35rem; }
.work-evidence-menu[open] { z-index: 16; }
.work-evidence-menu .object-actions { position: absolute; right: 0; min-width: 11rem; padding: .5rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--paper); box-shadow: var(--shadow); }
.evidence-document { padding: 1rem; border: 1px solid var(--line); background: var(--soft); border-radius: .5rem; }
.visit-workspace .button { min-height: 2.75rem; }
.visit-workspace :is(button, a, summary):focus-visible, .technician-home :is(button, a):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.card--evidence { background: var(--evidence-bg); box-shadow: none; }
.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.card__top h3 { margin-bottom: .55rem; }
.card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .8rem; padding-top: .75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.card .card__foot > span { flex-basis: 100%; min-width: 0; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .84rem; }
.muted { color: var(--muted); }
.empty { padding: 2.4rem 1rem; border: 1px dashed var(--empty-border); border-radius: var(--radius); color: var(--muted); text-align: center; background: var(--empty-bg); }
.empty strong { display: block; margin-bottom: .3rem; color: var(--ink); }
.empty--action { display: block; width: 100%; font: inherit; cursor: pointer; }
.empty--action:hover, .empty--action:focus-visible { border-color: var(--brand); outline: 3px solid var(--focus); }
.warning { margin: 0 0 .6rem; padding: .72rem .85rem; border-left: .25rem solid var(--warning-line); color: var(--warning-ink); background: var(--warning-bg); }
.dialog [role="alert"]:empty { display: none; }

.badge { display: inline-flex; align-items: center; gap: .3rem; width: max-content; padding: .23rem .55rem; border-radius: 999px; color: var(--ink); background: var(--soft); font-size: .68rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.badge--approved, .badge--succeeded, .badge--resolved { color: var(--success-ink); background: var(--success-bg); }
.badge--draft, .badge--pending { color: var(--pending-ink); background: var(--pending-bg); }
.badge--rejected, .badge--failed { color: var(--rejected-ink); background: var(--rejected-bg); }
.badge--archived { color: var(--archived-ink); background: var(--archived-bg); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.55rem; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: .65rem; color: var(--ink); background: var(--paper); cursor: pointer; font-weight: 700; text-decoration: none; }
.button:hover, .button:focus-visible { border-color: var(--brand); outline: 3px solid var(--focus); }
.button--primary { border-color: var(--button-primary); color: white; background: var(--button-primary); }
.button--accent { border-color: var(--accent); color: var(--brand-dark); background: var(--accent); }
.button--danger { border-color: var(--error-line); color: var(--danger); background: var(--error-bg); }
.button--quiet { min-height: auto; padding: .35rem .55rem; background: transparent; }
.button:disabled, .button[aria-disabled="true"] { opacity: .48; cursor: not-allowed; }
.more-actions { position: relative; }
.more-actions > summary { min-height: 2.55rem; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: .65rem; cursor: pointer; font-weight: 700; list-style: none; }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions__menu { position: absolute; z-index: 25; right: 0; display: grid; gap: .4rem; min-width: 13rem; margin-top: .35rem; padding: .5rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--paper); box-shadow: var(--shadow); }
.more-actions__menu .button { width: 100%; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .65rem; align-items: end; margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.field { display: grid; gap: .3rem; min-width: 0; }
.field label { color: var(--field-label); font-size: .75rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: .62rem .7rem; border: 1px solid var(--field-line); border-radius: .55rem; color: var(--ink); background: var(--input); outline: none; }
.field textarea { min-height: 5.8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.field input:disabled { color: var(--disabled-ink); background: var(--disabled-bg); }
.form-hint { margin: .15rem 0 0; color: var(--muted); font-size: .7rem; }

.definition-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; margin: 0; }
.object-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.binary-choice { display: grid; gap: .35rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.binary-choice > legend { color: var(--field-label); font-size: .75rem; font-weight: 700; }
.binary-switch { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; min-height: 3.35rem; padding: .55rem .65rem; border: 1px solid var(--field-line); border-radius: .7rem; color: var(--ink); background: var(--input); cursor: pointer; }
.binary-switch__copy { display: grid; min-width: 0; }
.binary-switch__value { font-size: .86rem; line-height: 1.25; }
.binary-switch__next { color: var(--muted); font-size: .7rem; font-weight: 600; }
.binary-switch input { position: absolute; width: 1px; height: 1px; margin: -1px; opacity: 0; }
.binary-switch__track { position: relative; width: 3.5rem; height: 2rem; border-radius: 999px; background: var(--field-line); transition: background .15s ease; }
.binary-switch__thumb { position: absolute; top: .2rem; left: .2rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 4px rgb(6 38 84 / .3); transition: transform .15s ease; }
.binary-switch:has(input:checked) { border-color: var(--brand); background: var(--soft); }
.binary-switch:has(input:checked) .binary-switch__track { background: var(--brand); }
.binary-switch:has(input:checked) .binary-switch__thumb { transform: translateX(1.5rem); }
.binary-switch:has(input:focus-visible) { border-color: var(--brand); outline: 3px solid var(--focus); }
.managed-card { display: flex; flex-direction: column; gap: 0; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 2px 12px rgb(6 38 84 / .06); }
.managed-card > .card { flex: 1; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.managed-card:has(> .card--browse) { box-shadow: none; }
.managed-card:has(> .card--work) { border-left: .3rem solid var(--accent); }
.managed-card:has(> .card--evidence) { background: var(--evidence-bg); box-shadow: none; }
.managed-card > .object-actions { padding: .7rem 1.05rem 1.05rem; }
.managed-card:has(.card__body:hover), .managed-card:has(.card__body:focus-visible) { background: var(--hover); }
:where(.card, .managed-card):has(.card__body:focus-visible) { box-shadow: 0 0 0 3px var(--focus); }
.object-card { display: grid; gap: 1rem; }
.object-actions { justify-content: flex-end; margin-top: auto; }
.object-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.object-form .field:has(textarea) { grid-column: 1 / -1; }
.object-form .field--wide { grid-column: 1 / -1; }
.definition-list div { min-width: 0; }
.definition-list dt { color: var(--muted); font-size: .72rem; }
.definition-list dd { overflow-wrap: anywhere; }
.visit-card__summary { grid-column: 1 / -1; }
.visit-card__summary dd { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(17rem, .75fr); gap: 1rem; align-items: start; }
.sticky-panel { position: sticky; top: 5.5rem; }
.summary-box { padding: 1rem; border-left: .25rem solid var(--accent); background: var(--summary-bg); }
.workflow-grid, .evidence-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; }
.chat-home { margin-top: 1.2rem; }
.chat-shell, .chat-shell__content { display: grid; gap: 1rem; }
.technician-workspace, .unit-finder, .unit-candidates { display: grid; gap: 1rem; }
.unit-card .definition-list { margin-top: .85rem; }
.page-tabs { margin-top: 1rem; }
[data-unit-tab-panel] { min-width: 0; }
.chat-transcript { display: grid; gap: .8rem; }
.chat-harness { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem 1rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: .75rem; color: var(--muted); background: var(--soft); font-size: .78rem; }
.chat-harness strong { color: var(--brand); }
.chat-access { padding: .75rem .9rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); }
.chat-access summary { cursor: pointer; font-weight: 800; }
.chat-permissions { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .45rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.chat-permissions li { display: grid; padding: .55rem .65rem; border-radius: .55rem; background: var(--soft); }
.chat-permissions span { color: var(--muted); font-size: .72rem; }
.chat-messages { display: grid; gap: .75rem; }
.chat-message { width: min(48rem, 88%); }
.chat-message--assistant { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: .75rem; align-items: start; }
.chat-avatar { width: 3.25rem; height: 3.25rem; overflow: hidden; border: 2px solid var(--accent); border-radius: 50%; background: white; }
.chat-avatar__image { display: block; width: 230%; max-width: none; transform: translate(-28%, -7%); }
.chat-message__bubble { min-width: 0; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 1rem 1rem 1rem .25rem; background: var(--paper); box-shadow: var(--shadow); }
.chat-message--user { justify-self: end; }
.chat-message--user .chat-message__bubble { border-color: var(--chat-user-line); border-radius: 1rem 1rem .25rem 1rem; background: var(--chat-user-bg); }
.chat-message--error .chat-message__bubble { border-color: var(--error-line); color: var(--danger); background: var(--error-bg); }
.chat-thinking .chat-message__bubble { display: flex; align-items: center; gap: .35rem; min-height: 3.25rem; }
.chat-thinking__dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand); animation: chat-thinking 1s ease-in-out infinite; }
.chat-thinking__dot:nth-child(2) { animation-delay: .15s; }
.chat-thinking__dot:nth-child(3) { animation-delay: .3s; }
@keyframes chat-thinking { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-.25rem); } }
.chat-message small { display: block; margin-bottom: .25rem; color: var(--muted); font-weight: 800; }
.chat-message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-answer-sections { display: grid; gap: .65rem; margin-top: .8rem; }
.chat-answer-sections h4 { margin-bottom: .3rem; }
.chat-answer-sections ol { margin: 0; padding-left: 1.3rem; }
.chat-references { display: grid; gap: .45rem; margin-top: .8rem; }
.cited-evidence { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .6rem; padding: .65rem .7rem; border: 1px solid var(--line); border-radius: .65rem; color: inherit; background: var(--soft); text-decoration: none; }
.cited-evidence > span { color: var(--muted); font-size: .72rem; }
.cited-evidence .equipment-match { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: max-content; padding: .2rem .45rem; border-radius: 999px; color: var(--ink); background: var(--paper); font-weight: 750; }
.equipment-match--configuration_differs { color: var(--warning-ink) !important; background: var(--warning-bg) !important; }
.interaction-feedback { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .8rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.interaction-feedback__heading { grid-column: 1 / -1; }
.interaction-feedback__heading p { margin: .2rem 0 0; }
.interaction-feedback fieldset { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; border: 0; }
.interaction-feedback fieldset.binary-choice { display: grid; }
.interaction-feedback fieldset.split-pill-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.interaction-feedback legend { width: 100%; color: var(--field-label); font-size: .72rem; font-weight: 750; }
.interaction-feedback label { font-size: .76rem; }
.split-pill-choice legend { grid-column: 1 / -1; margin-bottom: .4rem; }
.split-pill-choice label { position: relative; min-width: 0; }
.split-pill-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.split-pill-choice label > span { display: grid; min-height: 3rem; place-items: center; padding: .5rem .65rem; border: 1px solid var(--line); color: var(--muted); background: var(--paper); cursor: pointer; font-weight: 750; text-align: center; }
.split-pill-choice label + label > span { margin-left: -1px; }
.split-pill-choice label:first-of-type > span { border-radius: 999px 0 0 999px; }
.split-pill-choice label:last-of-type > span { border-radius: 0 999px 999px 0; }
.split-pill-choice input:checked + span { position: relative; z-index: 1; border-color: var(--button-primary); color: white; background: var(--button-primary); }
.split-pill-choice input:focus-visible + span { position: relative; z-index: 2; outline: 3px solid var(--focus); outline-offset: 2px; }
.split-pill-choice label:hover > span { color: var(--ink); background: var(--hover); }
.split-pill-choice label:hover > input:checked + span { color: white; background: var(--button-primary-hover); }
.interaction-feedback > .button { align-self: end; }
.chat-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; align-items: end; padding: .9rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); box-shadow: var(--shadow); }
.chat-composer--attachments { position: relative; grid-template-columns: auto minmax(0, 1fr) auto; }
.chat-composer--files { grid-template-rows: repeat(2, 3.75rem); }
.chat-composer textarea { min-height: 4.8rem; max-height: 14rem; }
.chat-composer .button { min-width: 6rem; }
.chat-attachment { position: relative; align-self: end; }
.chat-attachment > summary, .chat-attachment-preview__remove { display: grid; width: 3rem; height: 3rem; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--paper); cursor: pointer; font: 1.2rem/1 system-ui, sans-serif; list-style: none; }
.chat-attachment__icon { display: block; width: 1.35rem; height: 1.35rem; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.44%2011.05l-9.19%209.19a6%206%200%200%201-8.49-8.49l9.19-9.19a4%204%200%200%201%205.66%205.66l-9.2%209.19a2%202%200%200%201-2.83-2.83l8.49-8.48' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.44%2011.05l-9.19%209.19a6%206%200%200%201-8.49-8.49l9.19-9.19a4%204%200%200%201%205.66%205.66l-9.2%209.19a2%202%200%200%201-2.83-2.83l8.49-8.48' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.chat-attachment > summary::-webkit-details-marker { display: none; }
.chat-attachment > summary:hover, .chat-attachment > summary:focus-visible, .chat-attachment-preview__remove:hover, .chat-attachment-preview__remove:focus-visible { border-color: var(--brand); outline: 3px solid var(--focus); }
.chat-attachment__menu { position: absolute; z-index: 4; bottom: calc(100% + .45rem); left: 0; display: grid; gap: .2rem; min-width: 10rem; padding: .35rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--paper); box-shadow: var(--shadow); }
.chat-attachment__option { position: relative; display: flex; min-height: 2.75rem; align-items: center; padding: .55rem .7rem; border: 0; border-radius: .5rem; color: var(--ink); background: transparent; cursor: pointer; font: inherit; font-weight: 700; text-align: left; }
.chat-attachment__option:hover, .chat-attachment__option:focus-visible, .chat-attachment__option:focus-within { outline: 0; background: var(--hover); }
.chat-attachment__file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.chat-attachment-previews { position: absolute; z-index: 3; bottom: calc(100% + .45rem); left: 0; display: flex; width: min(20rem, 100%); gap: .4rem; overflow-x: auto; overscroll-behavior-inline: contain; }
.chat-attachment-preview { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; flex: 0 0 100%; min-height: 3.6rem; align-items: center; gap: .55rem; padding: .5rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); box-shadow: var(--shadow); }
.chat-attachment-preview img, .chat-attachment-preview__icon { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: .5rem; object-fit: cover; color: var(--brand); background: var(--soft); font-size: .75rem; font-weight: 800; }
.chat-attachment-preview__copy { min-width: 0; }
.chat-attachment-preview__copy strong, .chat-attachment-preview__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment-preview__copy small { margin-top: .12rem; color: var(--muted); }
.chat-attachment-preview__remove { width: 2rem; height: 2rem; border: 0; font-size: 1.1rem; }
.chat-composer--files .chat-attachment-previews { position: static; grid-row: 1; grid-column: 1 / 3; width: 100%; height: 100%; }
.chat-composer--files .chat-attachment-preview { flex-basis: min(16rem, 90%); min-height: 0; height: 100%; }
.chat-composer--files .chat-attachment { grid-row: 2; grid-column: 1; }
.chat-composer--files > .field { display: grid; grid-row: 2; grid-column: 2; height: 100%; grid-template-rows: auto minmax(0, 1fr); }
.chat-composer--files > .field textarea { min-height: 0; height: 100%; resize: none; }
.chat-composer--files > .button { min-height: 0; padding: .35rem; font-size: .78rem; line-height: 1.1; white-space: normal; }
.chat-composer--files > .button--primary { grid-row: 2; grid-column: 3; }
.chat-composer--files > .chat-composer__add-files { grid-row: 1; grid-column: 3; }
.briefing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.equipment-context { margin: 1rem 0; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); box-shadow: 0 2px 12px rgb(6 38 84 / .06); }
.equipment-context h2, .equipment-context p { margin-bottom: .25rem; }
.equipment-line { font-weight: 800; }
.field-work-strip { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--soft); }
.outcome-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.outcome-form .field--wide, .outcome-form .button { grid-column: 1 / -1; }
.technician-visit-details { padding: 1rem; }
.technician-visit-details > summary { cursor: pointer; font-weight: 800; }
.technician-visit-details[open] > summary { margin-bottom: 1rem; }
.source-link-list { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: .8rem; }
.readable-record { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1rem; margin: .8rem 0 0; }
.readable-record__fact, .readable-record__group { min-width: 0; }
.readable-record__group { grid-column: 1 / -1; padding-top: .35rem; border-top: 1px solid var(--line); }
.readable-record dt { color: var(--muted); font-size: .72rem; }
.readable-record dd { margin: .15rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.readable-record h4 { margin: 0 0 .45rem; }

.timeline { position: relative; display: grid; gap: .8rem; padding-left: 1.2rem; }
.timeline::before { content: ""; position: absolute; left: .27rem; top: .8rem; bottom: .8rem; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); }
.timeline-item::before { content: ""; position: absolute; left: -1.2rem; top: 1.35rem; width: .55rem; height: .55rem; border: 2px solid var(--canvas); border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.timeline-item__head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.repair-lifecycle { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.repair-lifecycle li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .55rem; min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); }
.repair-lifecycle li:not(:last-child)::after { content: "→"; position: absolute; z-index: 1; right: -.48rem; top: 50%; width: .9rem; color: var(--muted); background: var(--canvas); text-align: center; transform: translateY(-50%); }
.repair-lifecycle li > span { display: grid; place-items: center; align-self: start; width: 1.55rem; height: 1.55rem; border-radius: 50%; color: white; background: var(--brand); font-weight: 800; }
.repair-lifecycle strong, .repair-lifecycle small { display: block; }
.repair-lifecycle small { margin-top: .2rem; color: var(--muted); line-height: 1.35; }
.knowledge-rollup, .knowledge-grid, .visit-detail { display: grid; gap: .8rem; }
.knowledge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.knowledge-section { min-width: 0; }
.knowledge-section > h3 { margin-top: 0; }
.legacy-case-knowledge { margin-top: .7rem; border-style: dashed; }
.visit-report-toolbar { position: static; margin: 0 0 .8rem; }
.object-actions--start { justify-content: flex-start; }

.compare-layout { display: grid; grid-template-columns: minmax(22rem, 1.25fr) minmax(16rem, .75fr); gap: 1rem; align-items: start; }
.compare-column { min-width: 0; }
.compare-column > h2 { display: flex; align-items: center; gap: .5rem; font-size: .93rem; text-transform: uppercase; letter-spacing: .05em; }
.compare-column > h2 span { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: .45rem; color: var(--brand); background: var(--soft); }
.compare-column .panel + .panel { margin-top: .8rem; }
.review-form { display: grid; gap: .85rem; }
.form-section { border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); overflow: hidden; }
.form-section summary { padding: .85rem 1rem; cursor: pointer; font-weight: 800; }
.form-section[open] summary { border-bottom: 1px solid var(--line); }
.form-section__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; padding: .85rem 1rem 1rem; }
.form-section__body .field--wide { grid-column: 1 / -1; }
.case-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin: 0 0 1.1rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); }
.case-toolbar__actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.json { max-height: 28rem; margin: 0; padding: .85rem; overflow: auto; border-radius: .55rem; color: #dff4e7; background: #16312e; font: .75rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence-list { display: grid; gap: .6rem; }
.evidence { padding: .75rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--evidence-bg); }
.evidence p:last-child { margin-bottom: 0; }
.source-material-list, .source-detail, .audit-layout { display: grid; gap: .7rem; }
.source-material-item .card__body { padding: .78rem .9rem; }
.source-material-item .card__foot { margin-top: .55rem; padding-top: .5rem; }
.source-content-panel { min-width: 0; }
.source-preview pre { width: 100%; max-width: 100%; margin: 0; padding: 1rem; overflow-x: auto; border-radius: .65rem; background: var(--evidence-bg); font: .84rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.secondary-disclosure { margin-top: .8rem; padding: .75rem; border: 1px solid var(--line); border-radius: .7rem; }
.secondary-disclosure > summary { cursor: pointer; font-weight: 750; }
.secondary-disclosure[open] > summary { margin-bottom: .7rem; }
.context-summary { align-self: start; border-left: .25rem solid var(--brand); }
.context-summary--unit { border-left-color: var(--brand); }
.context-summary--case { border-left-color: var(--accent); }
.context-summary--visit { border-left-color: var(--success-ink); }
.visit-context-references { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.visit-context-references h3 { margin: 0 0 .65rem; font-size: .95rem; }
.visit-reference-tiles { display: flex; flex-wrap: wrap; gap: .6rem; }
.visit-reference-tile { display: grid; flex: 1 1 8rem; max-width: 11rem; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: .7rem; color: var(--ink); background: var(--paper); cursor: pointer; font: inherit; text-align: left; text-decoration: none; }
.visit-reference-tile:hover, .visit-reference-tile:focus-visible { border-color: var(--brand); outline: 3px solid var(--focus); }
.visit-reference-tile__preview { display: grid; height: 5.5rem; place-items: center; overflow: hidden; color: var(--muted); background: var(--soft); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.visit-reference-tile__preview img { width: 100%; height: 100%; object-fit: cover; }
.visit-reference-tile__preview--pdf { color: var(--brand); }
.visit-reference-tile__pdf { display: grid; width: 2.8rem; height: 3.4rem; place-items: end center; padding-bottom: .45rem; border: 2px solid currentColor; border-radius: .25rem; font-size: .68rem; }
.visit-reference-tile__copy { display: grid; gap: .15rem; min-width: 0; padding: .55rem .65rem .65rem; }
.visit-reference-tile__copy strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .78rem; overflow-wrap: anywhere; }
.visit-reference-tile__copy small { color: var(--muted); font-size: .68rem; }

.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; overflow-x: auto; }
.tabs button { flex: 0 0 auto; padding: .5rem .8rem; border: 0; border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; }
.tabs button[aria-selected="true"], .tabs button[aria-pressed="true"] { color: white; background: var(--button-primary); }
.visit-detail--tabbed { padding-bottom: 13rem; }
.visit-tab-panel { min-width: 0; }
.visit-chat-dock { position: fixed; z-index: 18; right: 1rem; bottom: 1rem; left: calc(var(--sidebar) + 1rem); display: grid; gap: .5rem; width: auto; max-width: 90rem; margin-inline: auto; }
.visit-chat-dock .chat-composer { position: relative; }
body:has(.visit-chat-dock) .status { bottom: 9.5rem; }
.processing-bar { display: grid; grid-template-columns: var(--succeeded, 1fr) var(--pending, 0) var(--failed, 0); height: .55rem; margin: 1rem 0; overflow: hidden; border-radius: 999px; background: var(--line); }
.processing-bar span:nth-child(1) { background: #49a36f; }
.processing-bar span:nth-child(2) { background: #e0b03c; }
.processing-bar span:nth-child(3) { background: #c95d55; }

.auth-gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1.2rem; background: radial-gradient(circle at 15% 10%, #1651a2, var(--brand-dark) 45%); }
.auth-gate[hidden] { display: none; }
.auth-card { width: min(62rem, 100%); min-height: 32rem; display: grid; grid-template-columns: 1fr .8fr; gap: clamp(2rem, 7vw, 6rem); align-items: center; padding: clamp(1.6rem, 5vw, 4rem); border: 1px solid rgb(255 255 255 / .14); border-radius: 1.4rem; color: white; background: rgb(3 18 38 / .82); box-shadow: 0 30px 70px rgb(0 0 0 / .25); }
.brand--auth { position: absolute; align-self: start; margin: 0; }
.auth-card .eyebrow { color: var(--accent); }
.auth-card .lede { color: #c7d8eb; }
.auth-form { display: grid; gap: .55rem; padding: 1.25rem; border-radius: 1rem; color: var(--ink); background: var(--paper); }
.auth-form input { padding: .7rem; border: 1px solid var(--line); border-radius: .55rem; }
.login-method { margin-bottom: .25rem; }
.login-method legend { margin-bottom: .45rem; font-weight: 700; }
.login-panel { display: grid; gap: .55rem; }
.login-panel[hidden], .login-error[hidden] { display: none; }
.login-error { margin: .15rem 0; color: var(--danger); font-size: .8rem; }
.google-login { display: grid; justify-items: stretch; gap: .35rem; text-align: center; }
.google-login[hidden] { display: none; }
.google-button { min-height: 40px; }
.google-login .google-button { overflow: hidden; border-radius: 4px; }
.google-login .google-button:focus-within { outline: 2px solid #00639b; outline-offset: 2px; }
.mobile-nav { display: none; }

.dialog { width: min(35rem, calc(100% - 2rem)); padding: 0; border: 0; border-radius: 1rem; color: var(--ink); background: transparent; }
.dialog--wide { width: min(72rem, calc(100% - 2rem)); }
.dialog::backdrop { background: rgb(3 18 38 / .68); backdrop-filter: blur(3px); }
.dialog-card { position: relative; max-height: min(48rem, calc(100vh - 2rem)); padding: 1.35rem; overflow: auto; border-radius: 1rem; background: var(--paper); }
.dialog-close { position: absolute; right: .8rem; top: .65rem; border: 0; background: transparent; font-size: 1.6rem; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.google-account, .totp-setup { display: grid; justify-items: start; gap: .8rem; }
.totp-setup img { width: 12rem; max-width: 100%; border-radius: .5rem; background: white; }
.case-create-form { display: grid; grid-template-columns: minmax(16rem, .7fr) minmax(26rem, 1.3fr); gap: 1rem; align-items: start; }
.source-choice-list { display: grid; gap: .5rem; max-height: 32rem; overflow: auto; }
.source-choice { display: grid; grid-template-columns: auto 1fr; gap: .55rem; align-items: start; padding: .65rem; border: 1px solid var(--line); border-radius: .6rem; cursor: pointer; }
.source-choice:has(input:checked) { border-color: var(--brand); background: var(--soft); }
.field-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-group legend { margin-bottom: .35rem; color: var(--field-label); font-size: .75rem; font-weight: 700; }
.source-ingest-form { border: 2px dashed transparent; border-radius: .8rem; }
.source-ingest-form:has(.source-drop-zone:not([hidden])) { border-color: var(--line); padding: .8rem; }
.source-drop-zone { padding: 1rem; border-radius: .7rem; background: var(--soft); }
.source-drop-zone input { width: 100%; }

.skeleton-stack { display: grid; gap: .75rem; }
.skeleton-stack span { height: 6.5rem; border-radius: 1rem; background: linear-gradient(100deg, var(--soft) 20%, var(--paper) 40%, var(--soft) 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

@media (max-width: 72rem) {
  :root { --sidebar: 12.5rem; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
  body { padding-bottom: calc(4.2rem + env(safe-area-inset-bottom)); }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { min-height: 100vh; }
  .topbar { min-height: 4.2rem; padding: .65rem .85rem; }
  .mobile-brand { display: flex; align-items: center; gap: .45rem; }
  .mobile-brand .brand-mark { width: 2rem; border-radius: .6rem .6rem .6rem .15rem; }
  .global-search { width: auto; flex: 1; }
  .global-search input { padding-right: .8rem; }
  .global-search kbd, .account-menu summary > span:last-child { display: none; }
  .account-popover { position: fixed; right: .75rem; top: 4rem; }
  #content { padding: 1.15rem .9rem 2rem; }
  .mobile-nav { position: fixed; z-index: 30; inset: auto 0 0; display: grid; grid-template-columns: repeat(6, 1fr); padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper-glass); backdrop-filter: blur(16px); }
  .mobile-nav:has([data-route="users"]:not([hidden])) { grid-template-columns: repeat(7, 1fr); }
  .technician-view .mobile-nav { grid-template-columns: repeat(5, 1fr); }
  .mobile-nav button { display: grid; justify-items: center; gap: .1rem; padding: .35rem .2rem; border-radius: .55rem; color: var(--muted); background: transparent; }
  .mobile-nav button > span { font-size: 1.15rem; }
  .mobile-nav button[aria-current="page"] { color: var(--brand); background: var(--soft); }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 1.2rem; }
  .page-head--workspace { padding: .9rem; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { min-height: 7.6rem; }
  .detail-layout, .compare-layout { grid-template-columns: 1fr; }
  .repair-lifecycle { grid-template-columns: 1fr; }
  .repair-lifecycle li:not(:last-child)::after { content: "↓"; right: auto; top: auto; bottom: -.65rem; left: 1.05rem; transform: none; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .briefing-grid, .case-create-form { grid-template-columns: 1fr; }
  .chat-composer { grid-template-columns: minmax(0, 1fr) auto; padding: .7rem; }
  .chat-composer--attachments { grid-template-columns: auto minmax(0, 1fr) auto; gap: .45rem; padding: .55rem; }
  .chat-composer textarea { min-height: 3.5rem; max-height: 8rem; }
  .chat-composer .button { width: auto; min-width: 4.5rem; align-self: stretch; }
  body:has(.chat-shell:not(.chat-shell--main-purpose) > .chat-composer) #content { padding-bottom: 12rem; }
  .visit-detail--tabbed { padding-bottom: 15rem; }
  .chat-shell:not(.chat-shell--main-purpose) > .chat-composer,
  .visit-chat-dock { position: fixed; z-index: 18; right: .7rem; bottom: calc(5.5rem + env(safe-area-inset-bottom)); left: .7rem; max-width: none; margin: 0; }
  .visit-chat-dock .chat-composer { position: relative; }
  body:has(.chat-shell:not(.chat-shell--main-purpose) > .chat-composer) .status,
  body:has(.visit-chat-dock) .status { bottom: auto; }
  .chat-message { width: 94%; }
  .chat-message--assistant { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .chat-avatar { width: 2.75rem; height: 2.75rem; }
  .compare-column--evidence { grid-column: auto; }
  .sticky-panel { position: static; }
  .case-toolbar { align-items: flex-start; flex-direction: column; }
  .case-toolbar__actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .case-toolbar__actions .button { flex: 0 0 auto; }
  .filters { grid-template-columns: 1fr; padding: .8rem; }
  .definition-list { grid-template-columns: 1fr; }
  .object-form { grid-template-columns: 1fr; }
  .readable-record { grid-template-columns: 1fr; }
  .form-section__body { grid-template-columns: 1fr; }
  .interaction-feedback, .outcome-form { grid-template-columns: 1fr; }
  .interaction-feedback > *, .outcome-form .field--wide, .outcome-form .button { grid-column: auto; }
  .cited-evidence { grid-template-columns: 1fr; }
  .cited-evidence .equipment-match { grid-column: 1; grid-row: auto; }
  .field-work-strip { align-items: stretch; flex-direction: column; }
  .form-section__body .field--wide { grid-column: auto; }
  .auth-card { min-height: 0; grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem; }
  .brand--auth { position: static; }
  .auth-card h1 { font-size: 2rem; }
  .status { top: 4.7rem; right: auto; bottom: auto; left: 50%; max-width: calc(100vw - 1.8rem); transform: translateX(-50%); text-align: center; }
  .notice { margin: .7rem .9rem 0; }
  .dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .dialog-card { min-height: 100dvh; max-height: 100dvh; padding: 1.1rem .9rem calc(1rem + env(safe-area-inset-bottom)); border-radius: 0; }
  .dialog-actions { position: sticky; bottom: 0; padding: .7rem 0; background: var(--paper); }
}

@media (max-width: 25rem) {
  .mobile-brand strong { display: none; }
  .stats { grid-template-columns: 1fr; }
  .topbar { gap: .5rem; }
  .avatar { width: 2rem; height: 2rem; }
}

.technician-home { gap: .5rem; }
.technician-home .unit-finder { padding-bottom: 6rem; }
.work-composer-dock, .technician-home .unit-finder > .chat-shell > .chat-composer { position: fixed; z-index: 18; bottom: 1rem; left: calc(var(--sidebar) + 1rem); right: 1rem; max-width: 90rem; margin-inline: auto; }
.work-shared-composer.chat-composer { display: grid; position: relative; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: .3rem; margin: 0; padding: .4rem; }
.work-shared-composer .field { position: relative; margin: 0; min-width: 0; }
.work-shared-composer .field:has(.work-clear:not([hidden])) textarea { padding-right: 44px; }
.work-shared-composer textarea { min-height: 44px; max-height: 112px; padding: .55rem; resize: none; }
.work-shared-composer .button { min-width: 4.1rem; width: auto; min-height: 44px; padding: .4rem; }
.work-attach { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; }
.work-clear { position: absolute; bottom: 0; right: 0; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; }
.work-shared-composer > input:not([type=file]) { grid-column: 1 / -1; min-width: 0; }
.evidence-capture-preview { grid-column: 1 / -1; display: flex; gap: .4rem; overflow-x: auto; }
.work-file-preview { position: relative; display: flex; align-items: center; gap: .4rem; min-width: 8rem; max-width: 13rem; min-height: 48px; padding: .2rem 44px .2rem .3rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--soft); }
.work-file-preview img { width: 44px; height: 44px; object-fit: contain; }
.work-file-preview > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .72rem; }
.work-file-preview button { position: absolute; top: 0; right: 0; height: 44px; width: 44px; border: 0; background: transparent; cursor: pointer; }
.work-link-preview { padding-right: .5rem; }
.visit-workspace .visit-context-references { margin: 0; padding: 0; border: 0; background: transparent; }
.visit-workspace .visit-context-references > h3 { display: none; }
.visit-workspace .visit-reference-tiles { display: flex; flex-wrap: nowrap; gap: .5rem; overflow-x: auto; padding: .2rem; }
.visit-workspace .visit-reference-tile { display: flex; align-items: center; flex: 0 0 10rem; max-width: 10rem; min-height: 64px; padding: .3rem; text-align: left; }
.visit-workspace .visit-reference-tile__preview { flex: 0 0 44px; width: 44px; height: 48px; min-height: 0; }
.visit-workspace .visit-reference-tile__copy { min-width: 0; padding: .3rem; }
.visit-workspace .visit-reference-tile__copy strong { font-size: .75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.visit-workspace .visit-reference-tile__copy small { display: block; }
.visit-workspace .chat-evidence-note { display: none; }
.technician-home .unit-finder .chat-composer label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.technician-home .unit-finder textarea { min-height: 44px; height: 44px; }
.work-tour { position: fixed; z-index: 80; width: min(320px, calc(100vw - 24px)); padding: .8rem; border: 1px solid var(--brand); border-radius: .7rem; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); font-size: .85rem; }
.work-tour p { margin: .35rem 0 .6rem; }
.work-tour .button { min-height: 44px; }
.work-tour-target { outline: 3px solid var(--brand) !important; outline-offset: 3px; }
.work-photo-viewer { padding: 44px .5rem .5rem; border: 1px solid var(--line); border-radius: .5rem; max-width: 95vw; max-height: 90dvh; background: var(--paper); }
.work-photo-viewer img { display: block; max-width: 100%; max-height: 75dvh; object-fit: contain; }
.work-photo-viewer button { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; }
@media (max-width: 48rem) {
  .technician-home { --work-top: 4.2rem; }
  body:has(.technician-home) #content { padding-top: .5rem; padding-bottom: 0; }
  .work-composer-dock, .technician-home .unit-finder > .chat-shell > .chat-composer { left: .5rem; right: .5rem; bottom: calc(5rem + env(safe-area-inset-bottom)); }
  .work-shared-composer .field { grid-column: 2; }
  .work-shared-composer > button[type=submit] { grid-column: 3; }
  body.work-keyboard .mobile-nav { display: none; }
  body.work-keyboard .work-composer-dock { bottom: var(--work-keyboard-offset, 0px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
