:root {
  --brand: #c70f18; --brand-dark: #8f0a10; --brand-soft: #fff0f1;
  --charcoal: #252936; --ink: #1b2029; --muted: #667080;
  --line: #dfe3e8; --line-dark: #c9cfd6; --paper: #fff; --canvas: #f4f5f7;
  --ok: #18794e; --ok-soft: #eaf7f0; --warning: #9a6700; --warning-soft: #fff6dc;
  --danger: #b4232d; --shadow: 0 7px 24px rgba(25,31,40,.07);
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
}
[hidden] { display:none!important; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button,input,select,textarea { font: inherit; }
button,select { cursor: pointer; }
button,h1,h2,h3,p { letter-spacing: 0; }
h1,h2,h3,p { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto auto minmax(220px,540px) auto auto auto; align-items: center; gap: 18px; height: 76px; padding: 9px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.98); }
.brand-button { width: 174px; padding: 0; border: 0; background: transparent; }
.brand-button img { display: block; width: 100%; max-height: 56px; object-fit: contain; object-position: left center; }
.topbar-title { display: grid; gap: 2px; min-width: 170px; }
.topbar-title strong { font-size: 15px; }
.topbar-title span { color: var(--muted); font-size: 12px; }
.search-field input { width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: #f8f9fa; }
.search-field input:focus,input:focus,select:focus,textarea:focus { outline: 3px solid rgba(199,15,24,.12); border-color: var(--brand); }
.role-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #f2f3f5; }
.role-switch button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.role-switch button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.09); }
.user-button,.icon-button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--charcoal); font-weight: 800; }
.mobile-only { display: none; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: calc(100vh - 76px); }
.sidebar { position: sticky; top: 76px; height: calc(100vh - 76px); display: flex; flex-direction: column; padding: 20px 14px; border-right: 1px solid var(--line); background: #fff; }
.main-nav,.sidebar-section { display: grid; gap: 5px; }
.main-nav button,.sidebar-section button { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; min-height: 43px; padding: 0 12px; border: 0; border-radius: 6px; color: #4d5664; background: transparent; text-align: left; font-size: 14px; font-weight: 700; }
.main-nav button:hover,.sidebar-section button:hover { background: #f5f6f7; }
.main-nav button.active,.sidebar-section button.active { color: var(--brand-dark); background: var(--brand-soft); }
.main-nav button b { min-width: 21px; padding: 3px 6px; border-radius: 10px; color: #fff; background: var(--brand); text-align: center; font-size: 10px; }
.sidebar-section { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar-section p { margin: 0 12px 7px; color: #9198a3; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; display: grid; gap: 3px; padding: 14px 12px 0; border-top: 1px solid var(--line); }
.sidebar-footer span { color: var(--muted); font-size: 11px; }
.sidebar-footer strong { font-size: 13px; }

.main-content { width: 100%; max-width: 1500px; min-width: 0; padding: 30px clamp(20px,3vw,44px) 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.eyebrow { margin-bottom: 6px; color: var(--brand-dark); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.page-head h1 { margin-bottom: 5px; font-size: 28px; line-height: 1.2; }
.page-head p:last-child { margin-bottom: 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; font-weight: 750; }
.button.primary { color: #fff; background: var(--brand); }
.button.secondary { color: #fff; background: var(--charcoal); }
.button.ghost { border-color: var(--line-dark); color: var(--ink); background: #fff; }
.button.danger { border-color: #f1bdc1; color: var(--danger); background: #fff5f5; }
.button.small { min-height: 33px; padding: 0 10px; font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 20px; }
.kpi { min-height: 118px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.kpi>span { color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi strong { display: block; margin: 8px 0 5px; font-size: 29px; }
.kpi small { color: var(--muted); }
.kpi.alert strong { color: var(--brand); }
.content-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.75fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.panel+.panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 62px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 18px; }
.panel-empty { padding: 44px 20px; color: var(--muted); text-align: center; }
.data-list { display: grid; }
.data-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; min-height: 72px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: 0; }
.data-row:hover { background: #fafafb; }
.data-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.data-icon { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 6px; color: var(--brand-dark); background: var(--brand-soft); font-weight: 850; }
.data-copy { min-width: 0; }
.data-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.row-meta { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.row-meta>span { color: var(--muted); font-size: 12px; text-align: right; }
.link-button { padding: 6px; border: 0; color: var(--brand-dark); background: transparent; font-weight: 800; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 800; }
.status.ok { color: var(--ok); background: var(--ok-soft); }
.status.warning { color: var(--warning); background: var(--warning-soft); }
.status.danger { color: var(--danger); background: var(--brand-soft); }
.status.neutral { color: #57606c; background: #eef0f2; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.breadcrumb button { padding: 0; border: 0; color: var(--brand-dark); background: transparent; }
.detail-band { display: grid; grid-template-columns: minmax(0,1fr) repeat(3,150px); gap: 20px; margin-bottom: 18px; padding: 20px; border-left: 5px solid var(--brand); background: var(--charcoal); color: #fff; }
.detail-band h1 { margin-bottom: 5px; font-size: 25px; }
.detail-band p { margin: 0; color: #d7d9de; font-size: 13px; }
.detail-stat { padding-left: 18px; border-left: 1px solid #555b66; }
.detail-stat span { display: block; color: #c1c5cc; font-size: 11px; }
.detail-stat strong { display: block; margin-top: 7px; font-size: 18px; }
.equipment-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.equipment-card { min-height: 168px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.equipment-card header { display: flex; justify-content: space-between; gap: 10px; }
.equipment-card h3 { margin: 11px 0 4px; font-size: 16px; }
.equipment-card p { margin-bottom: 13px; color: var(--muted); font-size: 12px; }
.equipment-card dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 9px; margin: 0; font-size: 12px; }
.equipment-card dt { color: var(--muted); }
.equipment-card dd { margin: 0; font-weight: 700; }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 15px; }
.filterbar input,.filterbar select { min-height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.filterbar input { flex: 1 1 240px; }
.timeline { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 105px 18px minmax(0,1fr); gap: 12px; min-height: 77px; }
.timeline-date { color: var(--muted); font-size: 12px; text-align: right; }
.timeline-line { position: relative; border-left: 2px solid var(--line); }
.timeline-line::before { content: ""; position: absolute; top: 2px; left: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline-copy strong { display: block; font-size: 13px; }
.timeline-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.check-layout { display: grid; grid-template-columns: 245px minmax(0,1fr); gap: 16px; align-items: start; }
.part-aside { position: sticky; top: 96px; }
.part-progress { padding: 18px; }
.progress-ring { display: grid; place-items: center; width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 50%; background: conic-gradient(var(--brand) var(--progress),#e5e7ea 0); }
.progress-ring::before { content: attr(data-progress); display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: #fff; font-weight: 850; }
.part-nav { display: grid; padding: 0 10px 12px; }
.part-nav a { padding: 9px; border-radius: 5px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.part-nav a:hover { color: var(--brand-dark); background: var(--brand-soft); }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; padding: 18px; }
.field { display: grid; gap: 6px; }
.field.wide { grid-column: 1/-1; }
.field span { color: var(--muted); font-size: 11px; font-weight: 750; }
.field input,.field select,.field textarea { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; }
.field textarea { resize: vertical; }
.check-section { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.check-section>header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 15px; color: #fff; background: var(--charcoal); }
.check-section h3 { margin: 0; font-size: 14px; }
.check-section>header small { display: block; margin-bottom: 3px; color: #d9dce2; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.check-row { display: grid; grid-template-columns: minmax(180px,1.3fr) 105px 115px 110px minmax(150px,1fr); gap: 9px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.check-row:nth-child(odd) { background: #fafafa; }
.check-label { font-size: 13px; font-weight: 700; }
.check-row input,.check-row select { width: 100%; min-height: 36px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 12px; }
.check-row.invalid { border-left: 4px solid var(--brand); background: var(--brand-soft); }
.check-head { color: var(--muted); background: #f0f2f4; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px; }
.photo-tile { position: relative; width: 112px; height: 84px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.68); }
.signature-box { display: grid; place-items: center; min-height: 94px; border: 1px dashed var(--line-dark); border-radius: 6px; color: var(--muted); background: #fafafa; }
.dialog { width: min(560px,calc(100% - 28px)); max-height: 88vh; padding: 0; border: 0; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.27); }
.dialog::backdrop { background: rgba(19,23,30,.55); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f2f4; }
.dialog .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 62vh; overflow: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 80; right: 22px; bottom: 22px; max-width: 360px; padding: 13px 17px; border-radius: 6px; color: #fff; background: var(--charcoal); box-shadow: 0 12px 35px rgba(0,0,0,.2); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.technician-mode .office-only { display: none!important; }
.notice { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid #f0d19a; border-left: 4px solid var(--warning); border-radius: 6px; color: #624a13; background: var(--warning-soft); }
.notice strong { flex: 0 0 auto; }
.notice span { font-size: 13px; }
.success-notice { color:#17603a; border-color:#b7dec8; border-left-color:#16834f; background:#edf8f2; }
.warning-notice { border-color: #efb9bd; border-left-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.scope-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; padding: 4px; width: fit-content; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.scope-tabs button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-weight: 750; }
.scope-tabs button.active { color: #fff; background: var(--charcoal); }
.scope-tabs span { padding: 8px 11px; color: var(--muted); font-size: 13px; }
.builder-list { display: grid; gap: 14px; }
.builder-section { margin: 0!important; }
.builder-title { display: grid; flex: 1; gap: 4px; }
.builder-title span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.builder-title input { width: 100%; min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; font-weight: 800; }
.builder-items { display: grid; }
.builder-item { display: grid; grid-template-columns: 34px minmax(220px,1fr) 120px 155px auto auto; gap: 9px; align-items: center; min-height: 64px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.builder-item:nth-child(even) { background: #fafafa; }
.builder-item input,.builder-item select { min-height: 37px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.builder-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); background: #eef0f2; font-size: 11px; font-weight: 800; }
.builder-footer { padding: 12px 14px; }
.danger-text { color: var(--danger); }
.audit-note { padding: 10px 12px; border-radius: 5px; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; }
.save-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 18px 20px; border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.save-footer div { display: grid; gap: 4px; }
.save-footer span { color: var(--muted); font-size: 12px; }
.save-footer .button { flex: 0 0 auto; }
.compact-date { display:grid; gap:3px; }
.compact-date span { color:var(--muted); font-size:10px; font-weight:750; }
.compact-date input { width:100%; }
.due-badge { display:inline-flex; margin:5px 0 0 8px; padding:2px 6px; border-radius:10px; font-size:9px; font-weight:800; vertical-align:middle; }
.due-badge.required { color:var(--danger); background:var(--brand-soft); }
.due-badge.advance { color:var(--warning); background:var(--warning-soft); }
.due-badge.later { color:var(--muted); background:#eef0f2; }
.check-row.not-due { color:#747c88; background:#f6f7f8; }
.period-label { color:var(--muted); font-size:12px; text-align:center; }
.wide-dialog { width:min(760px,calc(100% - 28px)); }
.assignment-field { display:block; margin:0; padding:13px; border:1px solid var(--line); border-radius:6px; }
.assignment-field legend { padding:0 5px; color:var(--muted); font-size:11px; font-weight:750; }
.assignment-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; }
.assignment-toolbar input { min-width:0; }
.assignment-field .assignment-toolbar input { width:100%; min-height:38px; }
.assignment-toolbar span { color:var(--muted); font-size:12px; font-weight:750; white-space:nowrap; }
.assignment-actions { display:flex; gap:16px; padding:9px 2px 7px; border-bottom:1px solid var(--line); }
.assignment-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-height:250px; padding-top:9px; overflow:auto; }
.assignment-field label { display:flex; align-items:center; gap:8px; min-height:48px; padding:7px 8px; border-radius:4px; background:#f7f8f9; font-size:12px; }
.assignment-field input { width:16px; min-height:16px; }
.assignment-field label span { display:grid; gap:2px; min-width:0; }
.assignment-field label strong,.assignment-field label small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.assignment-field label small { color:var(--muted); }

.auth-screen,.setup-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:#f2f4f6; }
.auth-screen[hidden],#authenticatedApp[hidden] { display:none!important; }
.auth-card,.setup-card { width:min(440px,100%); padding:34px; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:0 18px 55px rgba(26,31,43,.12); }
.auth-card>img,.setup-card>img { width:150px; height:auto; margin-bottom:24px; }
.auth-card h1,.setup-card h1 { margin:4px 0 8px; font-size:27px; }
.auth-card p,.setup-card p { color:var(--muted); }
.auth-card form,.setup-card form { display:grid; gap:16px; margin-top:24px; }
.auth-card label,.setup-card label,.activation-links label { display:grid; gap:7px; color:var(--muted); font-size:12px; font-weight:750; }
.auth-card input,.setup-card input,.activation-links input { width:100%; min-height:44px; padding:9px 12px; border:1px solid var(--line); border-radius:5px; font:inherit; color:var(--ink); }
.auth-card .button,.setup-card .button { min-height:44px; justify-content:center; }
.auth-error { min-height:20px; margin:14px 0 0; color:var(--red)!important; font-weight:700; }
.role-badge { justify-self:end; padding:8px 12px; border:1px solid var(--line); border-radius:5px; background:#f7f8f9; color:var(--muted); font-size:12px; font-weight:800; white-space:nowrap; }
.logout-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:40px; padding:0 12px; border:1px solid var(--line-dark); border-radius:5px; color:var(--brand-dark); background:#fff; font-size:12px; font-weight:800; white-space:nowrap; }
.logout-button:hover { border-color:var(--brand); background:var(--brand-soft); }
.activation-links { display:grid; gap:12px; max-height:50vh; overflow:auto; margin:18px 0; }
.activation-links label { padding:10px; background:#f7f8f9; border-radius:5px; }
.activation-links small { font-weight:500; }
.field-divider { display:grid; gap:3px; margin-top:4px; padding-top:14px; border-top:1px solid var(--line); }
.field-divider strong { font-size:14px; }
.field-divider span { color:var(--muted); font-size:12px; }

@media (max-width:1120px) {
  .topbar { grid-template-columns: auto minmax(220px,1fr) auto auto auto; }
  .topbar-title { display:none; }
  .search-field { grid-column:2; }
  .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .content-grid { grid-template-columns:1fr; }
  .equipment-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-band { grid-template-columns:minmax(0,1fr) repeat(2,130px); }
  .detail-stat:last-child { display:none; }
  .check-row { grid-template-columns:minmax(180px,1fr) 100px 110px minmax(140px,1fr); }
  .check-row>:nth-child(4) { display:none; }
  .role-badge { font-size:10px; }
}
@media (max-width:780px) {
  .topbar { grid-template-columns:40px minmax(90px,1fr) auto auto; height:auto; min-height:68px; padding:8px 12px; gap:10px; }
  .mobile-only { display:block; }
  .brand-button { width:118px; }
  .search-field { grid-column:1/-1; grid-row:2; }
  .role-badge { justify-self:end; }
  .user-button { display:none; }
  .app-shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; z-index:40; top:0; left:0; width:min(290px,85vw); height:100vh; padding-top:84px; transform:translateX(-105%); transition:transform .2s ease; box-shadow:10px 0 35px rgba(0,0,0,.18); }
  .sidebar.open { transform:translateX(0); }
  .main-content { padding:22px 14px 50px; }
  .page-head { align-items:flex-start; flex-direction:column; }
  .page-head .actions { width:100%; }
  .page-head .button { flex:1; }
  .detail-band { grid-template-columns:1fr 1fr; }
  .detail-band>div:first-child { grid-column:1/-1; }
  .detail-stat { padding-left:0; border-left:0; }
  .equipment-grid { grid-template-columns:1fr; }
  .check-layout { grid-template-columns:1fr; }
  .part-aside { position:static; }
  .part-nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .form-grid { grid-template-columns:1fr; }
  .field.wide { grid-column:auto; }
  .check-head { display:none; }
  .check-row { grid-template-columns:1fr 1fr; padding:13px; }
  .check-row>* { display:block!important; }
  .check-label { grid-column:1/-1; }
  .check-row input:last-child { grid-column:1/-1; }
  .builder-item { grid-template-columns: 28px minmax(0,1fr) 120px 150px; }
  .builder-item .link-button { grid-column: auto; }
  .notice { align-items: flex-start; flex-direction: column; }
  .save-footer { align-items: stretch; flex-direction: column; }
}
@media (max-width:480px) {
  .role-badge { padding:6px; }
  .kpi-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .kpi { min-height:98px; padding:13px; }
  .kpi strong { font-size:24px; }
  .data-row { grid-template-columns:1fr; }
  .row-meta { justify-content:space-between; }
  .detail-band { grid-template-columns:1fr; }
  .detail-band>div:first-child { grid-column:auto; }
  .dialog .form-grid { grid-template-columns:1fr; }
  .assignment-toolbar,.assignment-list { grid-template-columns:1fr; }
  .assignment-toolbar span { white-space:normal; }
  .role-badge { grid-column: 3; }
  .logout-button { width:40px; padding:0; font-size:0; }
  .logout-button span { font-size:19px; }
  .builder-item { grid-template-columns: 28px minmax(0,1fr); }
  .builder-item select { grid-column: 2; }
  .scope-tabs { width: 100%; }
  .scope-tabs button { flex: 1; padding: 0 7px; font-size: 11px; }
}
@media print {
  .topbar,.sidebar,.page-head .actions,.part-aside,.button { display:none!important; }
  .app-shell,.check-layout { display:block; }
  .main-content { max-width:none; padding:0; }
  .panel { box-shadow:none; break-inside:avoid; }
}
