:root {
  color-scheme: light;
  --bg: #ffffff; --surface: #f7f8fa; --sidebar: #fafbfc; --ink: #202735;
  --muted: #667080; --line: #e3e6ec; --hover: #eef0f5; --primary: #3454ce;
  --primary-hover: #2945b1; --active: #eef1fc; --active-ink: #3049ac;
  --success-bg: #eaf5ee; --success-ink: #226446; --warning-bg: #fff5df;
  --warning-ink: #795a17; --error-bg: #fff0ef; --error-ink: #a33631;
  --focus-bg: #f0f3ff; --focus-edge: #526fe0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55; font-synthesis: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15191f; --surface: #1d222b; --sidebar: #191e25; --ink: #e9edf4;
  --muted: #a2adbc; --line: #343b48; --hover: #29313d; --primary: #6785ef;
  --primary-hover: #7d97f4; --active: #293650; --active-ink: #b4c5ff;
  --success-bg: #1b352b; --success-ink: #9bdbb7; --warning-bg: #362f20;
  --warning-ink: #e4ca89; --error-bg: #3b2428; --error-ink: #ffb4ac;
  --focus-bg: #242f47; --focus-edge: #9bb1ff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-underline-offset: .22em; }
button, .button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button { color: inherit; }
/* Direkta temabyten undviker WebKits cache av variabler under färgövergångar. */
button:focus-visible, a:focus-visible, .table-scroll:focus-visible { outline: 2px solid var(--focus-edge); outline-offset: 3px; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--focus-edge); box-shadow: inset 0 0 0 1px var(--focus-edge); background-color: var(--focus-bg); }
input[aria-invalid="true"] { border-color: var(--error-ink); }
h1,h2,h3,p { margin: 0; }
h1 { font-size: 2.375rem; font-weight: 650; letter-spacing: -.045em; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.4; }
h3 { font-size: 1rem; }
p { max-width: 76ch; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
kbd { display: inline-block; font: inherit; font-size: .8rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.demo-notice { display: flex; gap: 10px; align-items: baseline; font-size: .875rem; color: var(--warning-ink); margin-bottom: 31px; font-weight: 650; }
.demo-notice span { font-weight: 400; color: var(--muted); }
.page-heading { margin: 0 0 36px; }
.page-heading h1 + .lead { margin-top: 12px; }
.lead { font-size: 1rem; color: var(--muted); line-height: 1.6; }
.eyebrow { font-size: .8125rem; color: var(--muted); margin-bottom: 10px; }
.heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border-radius: 7px; border: 1px solid transparent; text-decoration: none; font-size: .875rem; font-weight: 600; line-height: 1.4; }
.button .icon { width: 17px; height: 17px; }
.primary { background: var(--primary); color: #fff; }
:root[data-theme="dark"] .primary { color: #0e172c; }
.primary:hover { background: var(--primary-hover); }
.secondary { background: var(--bg); color: var(--ink); border-color: var(--line); }
.secondary:hover { background: var(--hover); }
.text-button { min-height: 44px; padding: 9px 0; border: 0; background: none; font-size: .875rem; font-weight: 550; }
.text-link { font-size: .875rem; font-weight: 550; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.danger-text { color: var(--error-ink); }
.section { margin-top: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.person-link { color: var(--ink); text-decoration: none; font-weight: 600; display: inline-block; min-width: 100px; }
.person-link:hover { color: var(--primary); }
.subtext { display: block; color: var(--muted); font-size: .75rem; margin-top: 3px; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 5px; font-size: .875rem; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--hover); color: var(--muted); }
.status-bokad,.status-ankommen { background: var(--active); color: var(--active-ink); }
.status-vantar,.status-komplettering,.status-eskalerad { background: var(--warning-bg); color: var(--warning-ink); }
.status-godkand { background: var(--success-bg); color: var(--success-ink); }
.status-nekad { background: var(--error-bg); color: var(--error-ink); }
.quiet-note { font-size: .875rem; color: var(--muted); margin: 26px 0; max-width: 90ch; }
.muted { color: var(--muted); }
.search-field { display: flex; align-items: center; gap: 10px; width: min(100%,380px); position: relative; }
.search-field .icon { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-field input[type="search"] { padding-left: 39px; }
input:not([type="checkbox"]), select { display: block; width: 100%; min-height: 45px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: .9375rem; line-height: 1.4; }
input::placeholder { color: var(--muted); opacity: .85; }
.select-wrap { position: relative; width: 100%; }
.select-wrap select { appearance: none; padding-right: 40px; }
.select-wrap::after { content: ""; position: absolute; top: calc(50% - 5px); right: 17px; width: 7px; height: 7px; border-bottom: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.list-footnote { color: var(--muted); font-size: .8125rem; margin-top: 20px; }
.back-link { display: inline-block; margin-bottom: 22px; text-decoration: none; font-size: .875rem; color: var(--muted); }
.back-link:hover { color: var(--ink); }
.entry-form { max-width: 880px; }
.form-section { padding: 0 0 30px; margin: 0 0 30px; border-bottom: 1px solid var(--line); }
.form-section h2 { margin-bottom: 22px; }
.form-section p + p { margin-top: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px 28px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label,.field-label,.login-form > label { font-size: .875rem; font-weight: 550; }
.help { color: var(--muted); font-size: .8125rem; line-height: 1.55; }
.field-error { color: var(--error-ink); font-size: .8125rem; }
.fixed-value { min-height: 45px; padding-top: 10px; font-size: .9375rem; }
.checkbox-label { display: flex; align-items: flex-start; gap: 12px; margin-top: 24px; cursor: pointer; font-size: .9375rem; min-height: 30px; }
input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--primary); }
.date-field { max-width: 280px; margin-bottom: 12px; }
.form-actions { display: flex; align-items: center; gap: 25px; }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 16px 19px; margin: 0 0 24px; border-radius: 6px; font-size: .875rem; }
.notice strong { font-weight: 650; }
.notice p { margin-top: 5px; }
.notice a { display: inline-block; margin-top: 9px; color: inherit; text-decoration: underline; }
.notice.success { background: var(--success-bg); color: var(--success-ink); }
.notice.error { background: var(--error-bg); color: var(--error-ink); }
.notice.warning { background: var(--warning-bg); color: var(--warning-ink); }
.notice .icon { margin-top: 2px; }
.heading-status { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: .875rem; margin-top: 17px; }
.detail-section { margin-bottom: 36px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.detail-section h2 { margin-bottom: 18px; }
.detail-section .section-heading h2 { margin-bottom: 0; }
.detail-section > p { margin-bottom: 20px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0; }
.facts dt { color: var(--muted); font-size: .8125rem; margin-bottom: 6px; }
.facts dd { margin: 0; font-size: .9375rem; font-weight: 500; }
.subtle-label { font-size: .75rem; color: var(--muted); }
.check-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; cursor: pointer; }
.check-row + .check-row { border-top: 1px solid var(--line); }
.check-row strong { display: block; font-size: .9375rem; font-weight: 550; }
.check-row .help { display: block; margin-top: 4px; }
.checklist-form > .button { margin-top: 20px; }
.outcome-form > .field { margin: 29px 0 20px; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.button-row .danger-text { margin-left: 3px; }
.project-response .field { margin-bottom: 18px; }
.outcome-reason { margin-bottom: 28px; font-size: .875rem; color: var(--muted); }
.history h2 { margin-bottom: 23px; }
.history ol { list-style: none; padding: 0; margin: 0; }
.history li { padding: 0 0 23px 17px; border-left: 1px solid var(--line); position: relative; }
.history li::before { content: ""; position: absolute; left: -3px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.history strong { display: block; font-size: .8125rem; font-weight: 600; margin-bottom: 5px; }
.history span { display: block; font-size: .75rem; color: var(--muted); }
.history-outcome { margin-top: 5px; }
.supplier-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding: 30px 0; border-top: 1px solid var(--line); }
.supplier-summary h2 { margin-bottom: 6px; }
.supplier-summary p { color: var(--muted); font-size: .875rem; }
.supplier-summary .status { margin: 12px 0 10px; }
.supplier-summary .help { font-size: .8125rem; }
.supplier-waiting { margin-top: 11px; }
.supplier-action { min-width: 240px; max-width: 310px; display: grid; gap: 14px; }
.supplier-action .button { justify-self: start; }
.reading { max-width: 760px; }
.reading section { margin-top: 34px; }
.reading h2 { margin-bottom: 15px; }
.reading p + p { margin-top: 14px; }
.reading ol { padding-left: 23px; }
.reading li { padding-left: 5px; margin: 0 0 15px; }
.empty { padding: 50px 0; }
.empty p { color: var(--muted); margin-bottom: 20px; }
.error-page { max-width: 700px; padding: 40px 0; }
.error-page .lead { margin: 20px 0 28px; }
dialog { width: min(640px,calc(100% - 32px)); border: 1px solid var(--line); padding: 24px; border-radius: 12px; background: var(--bg); color: var(--ink); box-shadow: 0 20px 70px #0003; max-height: min(75vh,650px); }
dialog::backdrop { background: #11182777; }
.palette-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.palette-heading h2 { font-size: 1rem; }
.palette-heading .text-button { padding: 0; min-height: 32px; color: var(--muted); }
.palette-results { margin-top: 13px; display: grid; gap: 3px; }
.palette-results button { display: block; width: 100%; border: 0; border-radius: 5px; text-align: left; padding: 12px; background: none; font-size: .9375rem; }
.palette-results button:hover,.palette-results button:focus { background: var(--hover); }
.palette-results p { padding: 14px 4px; color: var(--muted); font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 15px; top: -70px; z-index: 50; padding: 10px 16px; background: var(--bg); }
.skip-link:focus { top: 10px; }
[hidden] { display: none !important; }



@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .select-wrap select { appearance: auto; } .select-wrap::after { display: none; } .primary { border-color: ButtonText; } .brand-mark { border: 1px solid CanvasText; } }

.saved-checks { list-style: none; padding: 0; margin: 0; }
.saved-checks li { display: flex; gap: 12px; padding: 12px 0; font-size: .9375rem; }
.saved-checks .icon { color: var(--success-ink); margin-top: 2px; }
.saved-checks .help { display: block; }
.history-checks { margin-top: 9px; font-size: .75rem; color: var(--muted); }
.history-checks summary { cursor: pointer; min-height: 24px; }
.history-checks p { margin-top: 6px; }

/* En sammanhållen appyta med uppgiften i fokus. */
:root { --nav-shadow: 0 8px 32px #18213b20; }
:root[data-theme="dark"] { --nav-shadow: 0 8px 32px #0008; }
h1 { font-size: 2rem; letter-spacing: -.035em; }
.main-shell { min-height: 100vh; margin: 0; }
.app-header { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-top: env(safe-area-inset-top,0px); }
.app-header-inner { max-width: 820px; margin: auto; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.app-identity,.login-identity { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.5rem; letter-spacing: -.04em; }
.trv-logo { display: block; flex: 0 0 auto; width: 38px; height: 38px; overflow: hidden; }
.contract-label { color: var(--muted); font-size: .875rem; text-align: right; max-width: 48%; }
.content { max-width: 820px; margin: 0 auto; padding: 15px 28px 140px; }
.demo-notice { margin-bottom: 28px; font-size: .875rem; flex-wrap: wrap; gap: 3px 8px; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 + .lead { margin-top: 7px; font-size: .9375rem; }
.worklist-search { width: 100%; margin-bottom: 18px; }
.worklist-search input { min-height: 52px; border-radius: 13px; background: var(--surface); font-size: 1rem; }
.worklist-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.day-switch { display: flex; align-items: center; gap: 20px; }
.day-switch a { padding: 12px 0; min-height: 46px; color: var(--muted); text-decoration: none; font-size: .875rem; border-bottom: 2px solid transparent; }
.day-switch .selected { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }
.inline-filter { position: relative; }
.inline-filter summary { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 46px; cursor: pointer; font-size: .875rem; color: var(--muted); list-style: none; max-width: 190px; }
.inline-filter summary::-webkit-details-marker,.app-menu summary::-webkit-details-marker { display: none; }
.inline-filter .icon { width: 18px; height: 18px; }
.filter-panel { position: absolute; right: 0; top: calc(100% + 5px); z-index: 15; width: min(280px,calc(100vw - 40px)); padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--nav-shadow); display: grid; gap: 10px; }
.filter-panel label { font-size: .875rem; }
.filter-panel .button { justify-self: start; margin-top: 4px; }
.people-list { list-style: none; padding: 0; margin: 0; }
.people-list li { border-bottom: 1px solid var(--line); }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 94px; padding: 20px 0; color: var(--ink); text-decoration: none; }
.person-row:hover .person-info strong { color: var(--primary); }
.person-info { min-width: 0; }
.person-info strong { font-size: 1.0625rem; font-weight: 600; display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.person-info > span { font-size: .875rem; color: var(--muted); }
.person-date { display: block; margin-top: 3px; }
.person-row .status { max-width: 43%; white-space: normal; flex: 0 0 auto; text-align: center; }
.list-footnote { margin-top: 18px; }
.search-empty { padding: 35px 0; font-size: .9375rem; }
.bottom-nav { position: fixed; bottom: max(16px,env(safe-area-inset-bottom,16px)); left: 50%; transform: translateX(-50%); width: min(360px,calc(100% - 32px)); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; padding: 7px; border: 1px solid var(--line); border-radius: 24px; background: var(--bg); box-shadow: var(--nav-shadow); z-index: 20; }
.bottom-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 63px; padding: 7px 4px; border-radius: 17px; font-size: .875rem; font-weight: 500; line-height: 1.35; text-decoration: none; color: var(--muted); cursor: pointer; list-style: none; }
.bottom-item .icon { width: 24px; height: 24px; stroke-width: 1.7; }
.bottom-item:hover { background: var(--surface); color: var(--ink); }
.bottom-item.active { color: var(--active-ink); background: var(--active); }
.app-menu { position: relative; }
.app-menu[open] > summary { color: var(--ink); background: var(--hover); }
.menu-panel { position: absolute; right: -7px; bottom: calc(100% + 18px); width: min(310px,calc(100vw - 40px)); max-height: min(70vh,540px); overflow-y: auto; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); box-shadow: var(--nav-shadow); }
.menu-account { padding-bottom: 15px; margin-bottom: 9px; border-bottom: 1px solid var(--line); }
.menu-account strong { display: block; font-size: .9375rem; font-weight: 600; }
.menu-account span { display: block; font-size: .8125rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.menu-link { display: flex; align-items: center; gap: 11px; min-height: 46px; width: 100%; background: none; border: 0; border-radius: 8px; padding: 10px 6px; color: var(--ink); text-align: left; font-size: .875rem; text-decoration: none; }
.menu-link:hover { background: var(--surface); }
.menu-link kbd { margin-left: auto; }
.menu-setting { margin: 15px 0; }
.menu-setting label { display: block; font-size: .8125rem; color: var(--muted); margin-bottom: 7px; }
.detail-layout { display: block; }
.history { margin-top: 15px; }
.history > summary { min-height: 48px; padding: 10px 0; font-size: 1.0625rem; font-weight: 600; cursor: pointer; }
.history > ol { margin-top: 18px; }
.facts dd { overflow-wrap: anywhere; }
.public-page .content { max-width: 480px; padding: 38px 28px 60px; }
.public-page .demo-notice { margin-bottom: 32px; font-size: .8125rem; }
.login-identity { margin: 0 0 42px; font-size: 1.75rem; }
.login-identity .trv-logo { width: 48px; height: 48px; }
.login-content h1 { font-size: 1.875rem; }
.login-form { width: 100%; }
.login-form > label { display: block; font-size: .875rem; margin: 18px 0 8px; }
.login-form > .button { width: 100%; min-height: 49px; margin-top: 16px; border-radius: 11px; }
.login-form .microsoft-login { margin-top: 0; }
.login-simulation { margin-top: 10px; }
.demo-login { border-top: 1px solid var(--line); margin-top: 29px; padding-top: 23px; }
.demo-account { display: grid; gap: 3px; margin-bottom: 4px; }
.demo-account strong { font-size: .9375rem; font-weight: 600; }
.demo-account span { font-size: .875rem; color: var(--muted); }
.extra-demo { margin-top: 24px; }
.extra-demo summary { cursor: pointer; min-height: 36px; font-size: .875rem; color: var(--muted); }
.login-footnote { font-size: .8125rem; color: var(--muted); margin-top: 24px; }
.login-content > .back-link { margin-top: 24px; }
@media (max-width: 650px) {
 .app-header-inner { padding: 20px; }
 .content { padding: 10px 20px 132px; }
 .person-row { gap: 14px; }
 .person-row .status { max-width: 46%; }
 .inline-filter summary { max-width: 150px; }
 .field-grid { grid-template-columns: 1fr; gap: 23px; }
 .facts { gap: 22px 16px; }
 .supplier-row { flex-direction: column; gap: 22px; }
 .supplier-action { width: 100%; max-width: none; }
 .supplier-action .field { max-width: 280px; }
 .button-row { align-items: stretch; flex-direction: column; }
 .button-row .danger-text { align-self: flex-start; }
 .public-page .content { padding: 24px 24px 50px; }
 .palette-heading { align-items: flex-start; }
}

summary:focus-visible { outline: 2px solid var(--focus-edge); outline-offset: 3px; border-radius: 6px; }

.search-and-scan { display: flex; align-items: center; gap: 10px; min-width: 0; }
.search-and-scan > input,.search-and-scan > .search-field { flex: 1; min-width: 0; }
.worklist-scan { margin-bottom: 18px; }
.worklist-scan .worklist-search { margin-bottom: 0; }
.worklist-scan .scan-control > summary { min-height: 52px; }
.scan-control { position: relative; flex: 0 0 auto; }
.scan-control > summary { list-style: none; min-height: 45px; }
.scan-control > summary::-webkit-details-marker { display: none; }
.scan-options { position: absolute; z-index: 30; right: 0; top: calc(100% + 8px); width: min(290px,calc(100vw - 40px)); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px #0002; padding: 8px; }
.scan-options .help { padding: 10px; }
.scan-status { margin-top: 10px; }
