:root {
    color-scheme: light;
    --pine: #003399;
    --pine-soft: #003399;
    --ink: #202020;
    --muted: #53616B;
    --paper: #F4F5F6;
    --surface: #ffffff;
    --line: #D8E0E7;
    --lime: #EAE456;
    --amber: #EAE456;
    --orange: #009FE8;
    --red: #a63d30;
    --radius: 6px;
}

* { box-sizing: border-box; }
.maintenance-warning { padding: 12px 24px; background: #fff3c4; color: #493900; border-bottom: 2px solid #d5a900; text-align: center; }
.maintenance-warning[hidden] { display: none; }
.maintenance-warning strong { margin-right: 8px; }
.maintenance-overlay { position: fixed; inset: 0; z-index: 1001; display: grid; place-items: center; padding: 20px; background: rgb(23 33 43 / 65%); }
.maintenance-overlay[hidden] { display: none; }
.maintenance-overlay-content { width: min(100%, 520px); border-radius: 8px; padding: 24px; background: #fff; box-shadow: 0 12px 35px rgb(0 0 0 / 25%); }
.maintenance-overlay-content h2 { margin: 0 0 12px; font-size: 22px; }
.maintenance-overlay-content p { line-height: 1.5; }
.maintenance-overlay-actions { display: flex; flex-wrap: wrap; gap: 10px; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}
a { color: inherit; }
.topbar {
    min-height: 66px;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--pine);
    color: white;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 2px solid white;
    border-radius: 50%;
    background: white;
    object-fit: cover;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1.2; }
.brand small { margin-top: 3px; color: #DCE7F3; font-size: 11px; }
.account-bar { display: flex; align-items: center; gap: 15px; }
.member-nav { color: #E3EDF8; font-size: 13px; font-weight: 700; text-decoration: none; }
.member-nav:hover { color: var(--lime); }
.account-name { color: #E3EDF8; font-size: 13px; }
.account-bar form { margin: 0; }
.page-shell { width: min(1180px, calc(100% - 48px)); min-height: calc(100vh - 120px); margin: 0 auto; padding: 44px 0 64px; }
.site-footer { padding: 17px 24px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 12px; }
.site-footer span { padding: 0 5px; color: var(--orange); }
.footer-links { display: flex; justify-content: center; gap: 18px; margin-top: 8px; }
.footer-links a { color: var(--muted); }
.legal-page { max-width: 820px; margin: 0 auto; color: var(--ink); line-height: 1.65; }
.legal-page h1 { margin: 0 0 20px; }
.legal-page h2 { margin: 30px 0 8px; font-size: 20px; }
.legal-page p, .legal-page ul { margin: 8px 0 14px; }
.legal-page li { margin: 8px 0; }
.legal-page address { font-style: normal; }
.legal-page a { color: var(--blue); }
.legal-notice { padding: 14px 16px; border-left: 4px solid var(--yellow); background: #fffbea; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--pine-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.1; }
.page-intro, .form-heading p:last-child { margin: 9px 0 0; color: var(--muted); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius); padding: 0 16px; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--pine); color: white; }
.button-primary:hover { background: #002B73; }
.button-secondary { border-color: var(--line); background: white; color: var(--ink); }
.button-quiet { min-height: 34px; padding: 0 10px; background: transparent; color: #E6EEF8; font-size: 13px; }
.button-quiet:hover { background: #002B73; }
.button-filter { min-height: 40px; background: var(--pine-soft); color: white; }
.button-small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.button-danger { background: #fae5df; color: #913a2b; }
.button-wide { width: 100%; margin-top: 5px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.summary-item { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.summary-item span { color: var(--muted); font-size: 12px; font-weight: 600; }
.summary-item strong { font-size: 27px; line-height: 1; }
.summary-total { border-color: var(--pine); background: var(--pine); color: white; }
.summary-total span { color: #DCE7F3; }
.summary-action { border-color: #EAE456; background: #FFFDE0; }
.summary-action strong { color: #5D5600; }
.summary-action.is-selected { box-shadow: inset 0 0 0 2px var(--amber); }
.summary-unknown { border-color: #8BCFEA; background: #EFF9FD; }
.summary-unknown strong { color: #005078; }
.summary-unknown.is-selected { box-shadow: inset 0 0 0 2px #009FE8; }
.filter-bar { display: grid; grid-template-columns: minmax(200px, 1fr) repeat(3, minmax(150px, 190px)) auto auto; gap: 9px; margin-bottom: 14px; }
.filter-bar input, .filter-bar select, .input-control, .field input, .field select, .field textarea {
    width: 100%; min-height: 42px; border: 1px solid #CBD4DF; border-radius: var(--radius); padding: 9px 11px; background: white; color: var(--ink); font: inherit;
}
.filter-bar input:focus, .filter-bar select:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid #B9E8FB; border-color: var(--pine-soft); }
.clear-link { align-self: center; color: var(--muted); font-size: 13px; text-decoration-thickness: 1px; }
.inventory-section { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.list-heading, .material-row { display: grid; grid-template-columns: minmax(260px, 1.6fr) minmax(170px, .9fr) minmax(190px, 1fr) 90px; align-items: center; gap: 14px; padding: 13px 18px; }
.list-heading { min-height: 42px; border-bottom: 1px solid var(--line); background: #EEF2F6; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.material-row { min-height: 82px; border-bottom: 1px solid #E8EDF2; }
.material-row:last-child { border-bottom: 0; }
.item-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.item-index { flex: 0 0 34px; color: #78838B; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.item-identity h2 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 700; text-overflow: ellipsis; }
.material-detail-link { text-decoration: none; }
.material-detail-link:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.item-location { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.item-consumable { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.item-location span { color: #53616B; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.item-category { display: flex; align-items: center; gap: 8px; color: #40484F; font-size: 12px; }
.category-mark { width: 9px; height: 9px; border-radius: 2px; background: var(--pine-soft); }
.category-group { background: var(--amber); }
.category-verbund { background: #009FE8; }
.item-status { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.status-label, .mark-missing { display: inline-flex; align-items: center; min-height: 24px; border-radius: 3px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.status-ready { background: #e7f1df; color: #315c2b; }
.status-unknown { background: #EEF2F6; color: #53616B; }
.status-limited { background: #fff0d6; color: #865615; }
.status-defect { background: #fae5df; color: #913a2b; }
.mark-missing { background: #fff1d2; color: #8c4e12; }
.mark-unknown { background: #EFF9FD; color: #005078; }
.text-action { color: var(--pine-soft); font-size: 12px; font-weight: 700; }
.empty-state { display: flex; flex-direction: column; gap: 5px; padding: 40px 20px; text-align: center; }
.empty-state span { color: var(--muted); font-size: 13px; }
.messages { margin-bottom: 18px; }
.message { margin: 0; border-left: 3px solid var(--pine-soft); padding: 10px 13px; background: white; }
.form-page { max-width: 680px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--pine-soft); font-size: 13px; font-weight: 700; text-decoration: none; }
.form-heading { margin-bottom: 25px; }
.form-heading h1 { font-size: 32px; }
.material-detail-heading { margin-top: 0; }
.material-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 30px; align-items: start; }
.material-photo-frame { min-height: 300px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.material-photo-frame img { display: block; width: 100%; max-height: 560px; aspect-ratio: 4 / 3; object-fit: contain; }
.material-photo-empty { margin: 0; padding: 32px; color: var(--muted); text-align: center; }
.material-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; margin: 0; }
.material-specs > div { min-width: 0; border-bottom: 1px solid var(--line); padding: 12px 0; }
.material-specs dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.material-specs dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.material-notes { margin-top: 22px; }
.material-notes h2 { margin: 0 0 7px; font-size: 16px; }
.material-notes p { margin: 0; overflow-wrap: anywhere; }
.material-form-photo { display: grid; justify-items: start; gap: 6px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.material-form-photo img { width: min(100%, 360px); max-height: 260px; border: 1px solid var(--line); border-radius: var(--radius); object-fit: contain; background: white; }
.field-admin-layout { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr); gap: 24px; align-items: start; }
.field-admin-layout > .data-form { margin: 0; }
.field-admin-layout h2 { margin: 0 0 16px; font-size: 18px; }
.field-admin-list-heading, .field-admin-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .4fr); gap: 14px; padding: 12px 16px; }
.field-admin-list-heading { border-bottom: 1px solid var(--line); background: #EEF2F6; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.field-admin-row { border-bottom: 1px solid var(--line); }
.field-admin-row:last-child { border-bottom: 0; }
.data-form { display: grid; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.field { display: grid; gap: 6px; }
.field label { color: #35414A; font-size: 13px; font-weight: 700; }
.field textarea { resize: vertical; }
.checkbox-field { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 0; color: var(--ink); font-weight: 600; }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--pine); }
.field-help { color: var(--muted); }
.field-error, .form-alert { margin: 0; border-left: 3px solid var(--red); padding: 10px 12px; background: #fff0ec; color: #812d23; font-size: 13px; }
.form-actions { display: flex; gap: 9px; margin-top: 4px; }
.location-picker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.location-dialog { width: min(520px, calc(100% - 28px)); max-width: 520px; max-height: min(90vh, 760px); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink); }
.location-dialog::backdrop { background: rgb(16 24 32 / 55%); }
.location-dialog .data-form { border: 0; }
.location-dialog .form-heading { margin: 0; }
.location-dialog .form-heading h2 { margin: 0; font-size: 24px; }
.location-dialog-error[hidden] { display: none; }
.login-layout { display: grid; grid-template-columns: minmax(320px, 470px) 1fr; min-height: 510px; max-width: 900px; margin: 24px auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.login-panel { align-self: center; padding: 48px; }
.login-panel h1 { font-size: 36px; }
.login-copy { margin: 12px 0 28px; color: var(--muted); }
.login-panel .form-stack { display: grid; gap: 17px; }
.login-panel .field { display: grid; gap: 7px; }
.login-panel label { color: #35414A; font-size: 13px; font-weight: 700; }
.login-panel input { min-height: 44px; border: 1px solid #CBD4DF; border-radius: var(--radius); padding: 9px 11px; font: inherit; }
.login-panel input:focus { outline: 3px solid #B9E8FB; border-color: var(--pine-soft); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 12px; font-size: 13px; }
.auth-links a { color: var(--pine-soft); font-weight: 700; }
.login-aside { position: relative; display: flex; align-items: center; overflow: hidden; padding: 36px; background: var(--pine); color: white; }
.login-aside p { margin: 0; font-size: clamp(30px, 4vw, 48px); font-weight: 500; line-height: 1.12; }
.login-aside strong { color: var(--lime); font-weight: 700; }
.aside-rule { position: absolute; top: 0; right: 40px; width: 14px; height: 100%; background: var(--amber); }
.aside-code { position: absolute; left: 36px; bottom: 25px; color: #DCE7F3; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.message-page { max-width: 650px; margin: 42px auto; padding: 30px; border-left: 5px solid var(--pine-soft); background: white; }
.message-page h1 { font-size: 30px; }
.message-page p:not(.eyebrow) { margin: 12px 0 22px; color: var(--muted); }
.member-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
.member-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.member-list-heading, .member-row { display: grid; grid-template-columns: minmax(210px, 1.4fr) minmax(130px, .8fr) minmax(140px, .8fr) minmax(250px, 1.5fr); align-items: start; gap: 14px; padding: 15px 18px; }
.member-list-heading { background: #EEF2F6; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.member-row { border-top: 1px solid #E8EDF2; }
.member-identity { display: grid; gap: 4px; overflow-wrap: anywhere; }
.member-identity strong { font-size: 14px; }
.member-identity span { color: var(--muted); font-size: 12px; }
.member-status { display: inline-flex; border-radius: 3px; padding: 4px 8px; background: #EEF2F6; color: #414A52; font-size: 11px; font-weight: 700; }
.status-approval_pending { background: #fff0d6; color: #865615; }
.status-email_pending { background: #EFF9FD; color: #005078; }
.status-approved, .status-active { background: #e7f1df; color: #315c2b; }
.status-rejected, .status-inactive { background: #fae5df; color: #913a2b; }
.member-roles, .member-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.member-actions form { margin: 0; }
.role-chip { display: inline-flex; border-radius: 3px; padding: 3px 7px; font-size: 11px; font-weight: 700; }
.role-admin { background: #EAE456; color: #3D3B1B; }
.role-manager { background: #EFF9FD; color: #005078; }
.role-empty { color: var(--muted); font-size: 12px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.dashboard-stat { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: white; text-decoration: none; }
.dashboard-stat span { color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.3; }
.dashboard-stat strong { color: var(--pine); font-size: 26px; line-height: 1; }
.dashboard-stat:hover { border-color: var(--pine-soft); }
.stat-classification { border-top: 3px solid #009FE8; }
.stat-missing { border-top: 3px solid var(--amber); }
.stat-unknown { border-top: 3px solid #009FE8; }
.stat-status { border-top: 3px solid #c88938; }
.stat-defect { border-top: 3px solid var(--red); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dashboard-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.dashboard-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px 12px; border-bottom: 1px solid #E8EDF2; }
.dashboard-panel header .eyebrow { margin-bottom: 4px; }
.dashboard-panel h2 { margin: 0; font-size: 16px; }
.dashboard-panel header > strong { color: var(--pine); font-size: 24px; }
.dashboard-panel-defects header > strong { color: var(--red); }
.dashboard-panel-todos { grid-column: 1 / -1; }
.dashboard-todo-main { display: grid; justify-content: initial; }
.dashboard-todo-main small { overflow: visible; text-overflow: initial; white-space: normal; }
.dashboard-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 17px; border-bottom: 1px solid #E8EDF2; }
.dashboard-item:hover { background: #F3F8FC; }
.dashboard-item-main { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 11px 0; color: inherit; text-decoration: none; }
.dashboard-item-main span:first-child { display: grid; gap: 3px; min-width: 0; }
.dashboard-item strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.dashboard-item small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-item-arrow { color: var(--pine); font-size: 20px; }
.dashboard-email-link { flex: 0 0 auto; color: var(--pine-soft); font-size: 11px; font-weight: 700; }
.dashboard-empty { margin: 0; padding: 17px; color: var(--muted); font-size: 12px; }
.panel-link { display: inline-block; margin: 10px 17px 14px; color: var(--pine-soft); font-size: 12px; font-weight: 700; }
.thwin-page-actions, .thwin-tree-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.thwin-tree-controls { margin: 14px 0; }
.thwin-correction-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); gap: 18px; align-items: end; margin: 14px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.thwin-correction-tools h2 { margin: 0 0 5px; font-size: 15px; }
.thwin-correction-tools p:not(.eyebrow) { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.thwin-correction-tools form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.thwin-correction-tools label { width: 100%; color: var(--muted); font-size: 11px; font-weight: 700; }
.thwin-correction-tools input[type="file"] { min-width: 180px; flex: 1; font-size: 12px; }
.thwin-tree { display: grid; gap: 6px; }
.thwin-node, .thwin-leaf { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.thwin-summary { display: grid; grid-template-columns: 58px minmax(180px, 1fr) minmax(150px, .7fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 9px 12px; cursor: pointer; list-style: none; }
.thwin-summary::-webkit-details-marker { display: none; }
.thwin-node[open] > .thwin-summary { border-bottom: 1px solid #E8EDF2; background: #F7F9FA; }
.thwin-summary strong { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.thwin-art { display: inline-flex; width: fit-content; min-width: 42px; justify-content: center; border-radius: 3px; padding: 4px 6px; background: #E8EEF1; color: #35545A; font-size: 10px; font-weight: 800; }
.thwin-number, .thwin-child-count { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.thwin-node-body { padding: 10px 12px 12px; }
.thwin-children { display: grid; gap: 6px; margin: 10px 0 0 12px; padding-left: 12px; border-left: 2px solid #CAD6D9; }
.thwin-metadata { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.thwin-metadata > div { min-width: 0; }
.thwin-metadata dt { color: var(--muted); font-size: 10px; font-weight: 700; }
.thwin-metadata dd { margin: 2px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.thwin-metadata .thwin-raw { grid-column: 1 / -1; }
.thwin-low-confidence { color: #963C2B; font-weight: 800; }
.thwin-correct-link { display: inline-block; margin-top: 10px; color: var(--pine-soft); font-size: 12px; font-weight: 700; }
.thwin-set-list { display: grid; gap: 8px; }
.thwin-set-section { min-width: 0; border-top: 1px solid var(--line); background: white; scroll-margin-top: 88px; }
.thwin-set-heading { display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(130px, .7fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 9px 10px; cursor: pointer; list-style: none; }
.thwin-set-heading::-webkit-details-marker { display: none; }
.thwin-set-heading strong { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.thwin-set-number { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.thwin-set-content { padding: 0 10px 12px; }
.thwin-context-path { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.thwin-context-path span:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--pine-soft); }
.thwin-parts-table { display: grid; width: 100%; }
.thwin-part-heading, .thwin-part-row { display: grid; grid-template-columns: 55px minmax(190px, 1.5fr) minmax(110px, .7fr) minmax(145px, .9fr) minmax(110px, .7fr) minmax(150px, .9fr) minmax(170px, 1fr) 52px; align-items: start; gap: 10px; padding: 8px 6px; }
.thwin-part-heading { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.thwin-part-row { border-top: 1px solid #E8EDF2; font-size: 12px; }
.thwin-part-name { min-width: 0; overflow-wrap: anywhere; }
.thwin-part-name small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.thwin-nested-set-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; font-size: 11px; }
.thwin-nested-set-links > strong { margin-right: 4px; }
.thwin-nested-set-links > a, .thwin-nested-set-links > span { display: inline-flex; gap: 5px; border-radius: 3px; padding: 5px 7px; background: #EEF2F6; text-decoration: none; }
.thwin-nested-set-links > a span { color: var(--muted); }
.consumable-section { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.consumable-list-heading, .consumable-row { display: grid; grid-template-columns: minmax(210px, 1.4fr) minmax(190px, 1fr) minmax(160px, 1fr) minmax(120px, .7fr); align-items: center; gap: 14px; padding: 13px 18px; }
.consumable-list-heading { min-height: 42px; border-bottom: 1px solid var(--line); background: #EEF2F6; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.consumable-row { min-height: 78px; border-bottom: 1px solid #E8EDF2; }
.consumable-row:last-child { border-bottom: 0; }
.consumable-identity { min-width: 0; }
.consumable-identity h2 { margin: 0; font-size: 14px; }
.consumable-identity p, .consumable-stock small { display: block; margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.consumable-stock { display: grid; gap: 3px; }
.consumable-stock > strong { font-size: 14px; }
.consumable-location { color: #40484F; font-size: 12px; }
.consumable-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.wishlist-section { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.wishlist-list-heading, .wishlist-row { display: grid; grid-template-columns: minmax(210px, 1.5fr) minmax(130px, .8fr) minmax(135px, .8fr) minmax(130px, .8fr) minmax(80px, .5fr); align-items: start; gap: 13px; padding: 14px 17px; }
.wishlist-list-heading { min-height: 42px; align-items: center; border-bottom: 1px solid var(--line); background: #EEF2F6; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.wishlist-row { border-bottom: 1px solid #E8EDF2; }
.wishlist-row:last-child { border-bottom: 0; }
.wishlist-identity { min-width: 0; }
.wishlist-identity h2 { margin: 0; font-size: 14px; }
.wishlist-identity p { margin: 4px 0; color: #40484F; font-size: 12px; }
.wishlist-identity small, .wishlist-requester small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.wishlist-manager-note { color: #865615 !important; }
.wishlist-quantity { display: grid; justify-items: start; gap: 6px; font-size: 12px; }
.priority-label, .wishlist-status { display: inline-flex; align-items: center; min-height: 24px; border-radius: 3px; padding: 2px 8px; background: #EEF2F6; color: #414A52; font-size: 11px; font-weight: 700; }
.priority-high { background: #fae5df; color: #913a2b; }
.priority-low { background: #EFF9FD; color: #005078; }
.wishlist-status-approved { background: #fff0d6; color: #865615; }
.wishlist-status-ordered, .wishlist-status-acquired { background: #e7f1df; color: #315c2b; }
.wishlist-status-deferred { background: #EEF2F6; color: #53616B; }
.wishlist-requester { font-size: 12px; }
.wishlist-filter { grid-template-columns: minmax(180px, 260px) auto auto; }
.draft-recipient { display: grid; gap: 3px; margin-bottom: 18px; border-left: 4px solid var(--amber); padding: 11px 14px; background: white; }
.draft-recipient span, .draft-recipient small { color: var(--muted); font-size: 12px; }
.draft-recipient strong { font-size: 14px; }
.draft-modes { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.draft-modes a { border-bottom: 3px solid transparent; padding: 10px 12px; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.draft-modes a.is-active { border-color: var(--pine); color: var(--pine); }
.draft-fields { display: grid; gap: 17px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: white; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }
.draft-body { min-height: 300px; resize: vertical; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; }
.copy-button { align-self: flex-start; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.repair-case-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.repair-case-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto 18px; align-items: center; gap: 16px; min-height: 76px; padding: 13px 17px; border-bottom: 1px solid #E8EDF2; text-decoration: none; }
.repair-case-row:last-child { border-bottom: 0; }
.repair-case-row:hover { background: #F7FAFC; }
.repair-case-ref { color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.repair-case-main { display: grid; min-width: 0; gap: 3px; }
.repair-case-main strong { overflow-wrap: anywhere; }
.repair-case-main small { color: var(--muted); font-size: 12px; }
.repair-case-arrow { color: var(--muted); font-size: 22px; }
.repair-status { display: inline-flex; align-items: center; min-height: 25px; border-radius: 3px; padding: 3px 9px; background: #EEF2F6; color: #414A52; font-size: 11px; font-weight: 700; white-space: nowrap; }
.repair-status-open { background: #fae5df; color: #913a2b; }
.repair-status-waiting { background: #fff0d6; color: #865615; }
.repair-status-in_repair { background: #EFF9FD; color: #005078; }
.repair-status-waiting_parts { background: #FFFDE0; color: #5D5600; }
.repair-status-completed { background: #e7f1df; color: #315c2b; }
.repair-status-requested { background: #EFF9FD; color: #005078; }
.repair-status-ordered, .repair-status-partially_received { background: #fff0d6; color: #865615; }
.repair-status-received { background: #e7f1df; color: #315c2b; }
.repair-status-send_failed { background: #fae5df; color: #913a2b; }
.repair-status-cancelled { background: #EEF2F6; color: #53616B; }
.repair-case-heading { align-items: center; }
.repair-workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); align-items: start; gap: 20px; }
.repair-history-column, .repair-actions-column { display: grid; gap: 15px; min-width: 0; }
.repair-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: white; }
.repair-panel h2 { margin: 0 0 13px; font-size: 17px; }
.repair-panel > p:last-child { margin-bottom: 0; }
.repair-form { gap: 12px; border: 0; padding: 0; background: transparent; }
.repair-timeline { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.repair-event { min-width: 0; border-left: 3px solid #9AA8B3; padding: 11px 13px; background: #F5F7F9; overflow-wrap: anywhere; }
.repair-event-created, .repair-event-status { border-color: var(--orange); }
.repair-event-email_sent { border-color: var(--pine); }
.repair-event-email_received { border-color: #39834A; }
.repair-event-email_failed { border-color: var(--red); }
.repair-event-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; }
.repair-event-heading time, .repair-event-meta { color: var(--muted); font-size: 12px; }
.repair-event-meta { margin: 4px 0 8px; }
.repair-event-body { margin: 8px 0 0; line-height: 1.55; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 760px) {
    .topbar { min-height: 60px; align-items: flex-start; flex-direction: column; gap: 10px; padding: 10px 16px; }
    .account-bar { width: 100%; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
    .member-nav, .account-bar form { flex: 0 0 auto; white-space: nowrap; }
    .page-shell { width: calc(100% - 32px); padding: 28px 0 44px; }
    .account-name { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
    .page-heading .button { width: 100%; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .summary-item { min-height: 84px; padding: 10px; }
    .summary-item span { font-size: 10px; line-height: 1.25; }
    .summary-item strong { font-size: 23px; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .search-field { grid-column: 1 / -1; }
    .button-filter { width: 100%; }
    .clear-link { justify-self: center; }
    .list-heading { display: none; }
    .material-row { grid-template-columns: 1fr auto; gap: 8px 10px; padding: 14px 12px; }
    .item-identity { grid-column: 1 / -1; }
    .item-category { grid-column: 1; }
    .item-status { grid-column: 1; }
    .item-action { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
    .item-location { overflow-wrap: anywhere; }
    .login-layout { grid-template-columns: 1fr; min-height: 0; margin: 8px auto; }
    .login-panel { padding: 30px 22px; }
    .login-panel h1 { font-size: 32px; }
    .login-aside { display: none; }
    .auth-links { align-items: flex-start; flex-direction: column; }
    .message-page { margin: 8px auto; padding: 22px 18px; }
    .member-list-heading { display: none; }
    .member-row { grid-template-columns: 1fr; gap: 10px; padding: 14px 12px; }
    .consumable-list-heading { display: none; }
    .consumable-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 14px 12px; }
    .consumable-identity { grid-column: 1 / -1; }
    .consumable-stock, .consumable-location { grid-column: 1; }
    .consumable-actions { grid-column: 2; grid-row: 2 / span 2; justify-self: end; }
    .wishlist-list-heading { display: none; }
    .wishlist-row { grid-template-columns: 1fr auto; gap: 8px 10px; padding: 14px 12px; }
    .wishlist-identity { grid-column: 1 / -1; }
    .wishlist-quantity, .wishlist-requester { grid-column: 1; }
    .wishlist-row > div:nth-child(3) { grid-column: 1; }
    .wishlist-row > div:nth-child(5) { grid-column: 2; grid-row: 2 / span 3; align-self: center; justify-self: end; }
    .wishlist-filter { grid-template-columns: 1fr; }
    .repair-case-row { grid-template-columns: 1fr auto; gap: 7px 10px; padding: 13px 12px; }
    .repair-case-ref, .repair-case-main { grid-column: 1; }
    .repair-status { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
    .repair-case-arrow { display: none; }
    .repair-workspace { grid-template-columns: 1fr; gap: 12px; }
    .repair-panel { padding: 14px; }
    .repair-case-heading > .repair-status { grid-column: auto; grid-row: auto; justify-self: start; }
    .location-picker-row { grid-template-columns: 1fr; }
    .page-heading > .button { width: 100%; }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .dashboard-stat { min-height: 82px; padding: 10px; }
    .dashboard-stat span { font-size: 10px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 10px; }
    .thwin-correction-tools { grid-template-columns: 1fr; gap: 12px; }
    .thwin-summary { grid-template-columns: 48px minmax(0, 1fr); gap: 6px 8px; }
    .thwin-number, .thwin-child-count { grid-column: 2; }
    .thwin-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .thwin-set-heading { grid-template-columns: 48px minmax(0, 1fr); gap: 6px 8px; }
    .thwin-set-heading .thwin-set-number, .thwin-set-heading .thwin-child-count { grid-column: 2; }
    .thwin-part-heading { display: none; }
    .thwin-part-row { grid-template-columns: 48px minmax(0, 1fr); gap: 5px 8px; }
    .thwin-part-row > :nth-child(n+3) { grid-column: 2; }
    .thwin-part-name { grid-column: 2; }
    .draft-fields { padding: 14px; }
    .copy-row { align-items: stretch; flex-direction: column; }
    .draft-modes a { flex: 1; padding-inline: 5px; text-align: center; }
    .data-form { padding: 17px; }
}

/* Responsive operations UI refresh */
:root {
    color-scheme: light;
    --pine: #003399;
    --pine-soft: #174ca6;
    --ink: #17212b;
    --muted: #596875;
    --paper: #f3f5f7;
    --surface: #ffffff;
    --line: #d6dee7;
    --lime: #e8df65;
    --amber: #e8df65;
    --orange: #168fc4;
    --red: #a53d33;
    --radius: 8px;
    --shadow-panel: 0 2px 8px rgb(22 37 53 / 5%), 0 14px 34px rgb(22 37 53 / 4%);
}

html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
a { text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 3px solid #68b7df;
    outline-offset: 2px;
}
.skip-link {
    position: fixed;
    z-index: 1000;
    top: 8px;
    left: 8px;
    transform: translateY(-160%);
    border-radius: 6px;
    padding: 10px 14px;
    background: var(--pine);
    color: #fff;
    font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }
.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: 76px;
    padding: 0;
    border-bottom: 1px solid var(--line);
    background: rgb(255 255 255 / 96%);
    color: var(--ink);
    box-shadow: 0 3px 14px rgb(23 33 43 / 4%);
    backdrop-filter: blur(12px);
}
.topbar-inner {
    width: min(1600px, calc(100% - 64px));
    min-height: 76px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
}
.brand { gap: 12px; color: var(--ink); }
.brand-mark { flex-basis: 46px; width: 46px; height: 46px; border: 0; border-radius: 8px; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; }
.nav-disclosure { display: contents; }
.nav-toggle { display: none; }
.account-bar { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.member-nav { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0 11px; color: #344454; font-size: 13px; font-weight: 650; white-space: nowrap; }
.member-nav:hover { background: #edf2f8; color: var(--pine); text-decoration: none; }
.account-tools { display: flex; align-items: center; gap: 12px; }
.account-name { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-tools form { margin: 0; }
.button { min-height: 44px; border-radius: 7px; padding: 0 17px; font-size: 14px; transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button:hover { text-decoration: none; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--pine); color: #fff; box-shadow: 0 2px 4px rgb(0 51 153 / 15%); }
.button-primary:hover { background: #002d7f; box-shadow: 0 4px 12px rgb(0 51 153 / 18%); }
.button-secondary { border-color: #cbd5df; background: #fff; color: #253444; }
.button-secondary:hover { border-color: #9cacc0; background: #f8fafc; }
.button-quiet { min-height: 44px; border: 1px solid #d5dee8; padding: 0 13px; background: #fff; color: #344454; font-size: 13px; }
.button-quiet:hover { background: #f2f5f8; }
.button-filter { min-height: 48px; background: var(--pine); }
.button-small { min-height: 44px; padding: 0 13px; font-size: 13px; }
.button-danger { border: 1px solid #edc7c3; background: #fff1ef; color: #8f3028; }
.button-danger:hover { border-color: #dba29c; background: #ffe8e5; }
.page-shell { width: min(1520px, calc(100% - 64px)); min-height: calc(100vh - 150px); padding: 36px 0 64px; }
.page-heading { align-items: center; gap: 28px; margin-bottom: 26px; }
.eyebrow { margin-bottom: 7px; color: var(--pine); font-size: 11px; letter-spacing: .08em; }
h1 { font-size: 34px; line-height: 1.15; }
h2 { line-height: 1.25; }
.page-intro, .form-heading p:last-child { margin-top: 8px; color: var(--muted); font-size: 15px; }
.site-footer { margin-top: 24px; padding: 24px 24px; background: #fff; color: var(--muted); }
.footer-links { gap: 20px; }
.footer-links a:hover { color: var(--pine); }
.summary-grid { gap: 16px; margin-bottom: 24px; }
.summary-item, .dashboard-stat {
    min-height: 108px;
    border-color: #dbe2e9;
    border-radius: var(--radius);
    padding: 17px 19px;
    background: var(--surface);
    box-shadow: var(--shadow-panel);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.summary-item:hover, .dashboard-stat:hover { border-color: #aabbd0; box-shadow: 0 5px 16px rgb(22 37 53 / 9%); transform: translateY(-1px); }
.summary-item span, .dashboard-stat span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.summary-item strong, .dashboard-stat strong { font-size: 30px; }
.summary-total { border-color: var(--pine); background: var(--pine); }
.summary-action { border-color: #e3dc8d; background: #fffef3; }
.filter-bar { grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(155px, 205px)) auto auto; gap: 11px; margin-bottom: 18px; }
.filter-bar input, .filter-bar select, .input-control, .field input, .field select, .field textarea, .login-panel input {
    min-height: 48px;
    border: 1px solid #c9d3dd;
    border-radius: 7px;
    padding: 10px 13px;
    background: #fff;
    color: var(--ink);
    box-shadow: inset 0 1px 2px rgb(22 37 53 / 3%);
}
.filter-bar input:focus, .filter-bar select:focus, .field input:focus, .field select:focus, .field textarea:focus, .login-panel input:focus { outline: 3px solid #b9e2f2; border-color: var(--pine-soft); }
.clear-link { min-height: 44px; display: inline-flex; align-items: center; }
.inventory-section, .member-list, .consumable-section, .wishlist-section, .repair-case-list {
    border: 1px solid #dbe2e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-panel);
}
.list-heading, .material-row { grid-template-columns: minmax(260px, 1.55fr) minmax(150px, .75fr) minmax(190px, 1fr) minmax(145px, .65fr); gap: 18px; padding-inline: 22px; }
.list-heading, .member-list-heading, .consumable-list-heading, .wishlist-list-heading {
    min-height: 48px;
    background: #f2f5f8;
    color: #536271;
    font-size: 10px;
    letter-spacing: .07em;
}
.material-row { min-height: 88px; border-color: #edf0f3; transition: background-color .14s ease; }
.material-row:hover { background: #f8fafc; }
.item-index { color: #778593; }
.item-identity h2 { font-size: 15px; line-height: 1.35; }
.item-location { line-height: 1.45; }
.item-location span { font-family: inherit; font-size: 12px; }
.text-action, .panel-link, .thwin-correct-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--pine); font-size: 13px; }
.text-action:hover, .panel-link:hover, .thwin-correct-link:hover { color: #002a76; }
.status-label, .mark-missing, .mark-unknown, .member-status, .priority-label, .wishlist-status, .repair-status {
    min-height: 28px;
    border-radius: 5px;
    padding: 4px 9px;
    font-size: 12px;
}
.empty-state { padding: 52px 24px; }
.empty-state span { font-size: 14px; }
.messages { margin-bottom: 22px; }
.message { border: 1px solid #dbe4ec; border-left: 4px solid var(--pine-soft); border-radius: 7px; padding: 13px 16px; box-shadow: 0 2px 8px rgb(22 37 53 / 4%); }
.form-page { max-width: 860px; }
.back-link { min-height: 44px; display: inline-flex; align-items: center; margin-bottom: 20px; color: var(--pine); font-size: 14px; }
.form-heading { margin-bottom: 24px; }
.form-heading h1 { font-size: 32px; }
.data-form { gap: 18px; border: 1px solid #dbe2e9; border-radius: 8px; padding: 26px; background: #fff; box-shadow: var(--shadow-panel); }
.field { gap: 8px; }
.field label { color: #2d3b49; font-size: 13px; }
.field textarea { min-height: 120px; line-height: 1.55; }
.field-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.field-error, .form-alert { border-radius: 6px; padding: 12px 14px; }
.form-actions { flex-wrap: wrap; gap: 10px; }
.location-dialog { box-shadow: 0 20px 60px rgb(15 31 48 / 25%); }
.login-layout { max-width: 1040px; min-height: 560px; margin: 32px auto; border: 1px solid #dbe2e9; border-radius: 8px; box-shadow: var(--shadow-panel); }
.login-panel { padding: 54px; }
.login-panel h1 { font-size: 34px; }
.login-panel .form-stack { gap: 18px; }
.login-panel label { font-size: 13px; }
.login-aside { padding: 48px; background: #0c347d; }
.login-aside p { font-size: 42px; }
.message-page { max-width: 760px; margin: 34px auto; border: 1px solid #dbe2e9; border-left: 5px solid var(--pine-soft); border-radius: 8px; padding: 34px; box-shadow: var(--shadow-panel); }
.member-summary { max-width: 720px; }
.member-list { overflow: hidden; }
.member-list-heading, .member-row { grid-template-columns: minmax(210px, 1.35fr) minmax(130px, .75fr) minmax(145px, .8fr) minmax(250px, 1.5fr); gap: 18px; padding: 16px 21px; }
.member-row { border-color: #edf0f3; }
.member-identity strong { font-size: 15px; }
.role-chip { min-height: 28px; align-items: center; padding: 4px 9px; border-radius: 5px; }
.dashboard-stats { gap: 14px; margin-bottom: 25px; }
.dashboard-grid { gap: 18px; }
.dashboard-panel { border-color: #dbe2e9; border-radius: 8px; box-shadow: var(--shadow-panel); }
.dashboard-panel header { padding: 18px 20px 15px; border-color: #e8edf2; }
.dashboard-panel h2 { font-size: 18px; }
.dashboard-panel header > strong { font-size: 27px; }
.dashboard-item { min-height: 66px; padding-inline: 20px; border-color: #edf0f3; }
.dashboard-item-main { gap: 18px; padding-block: 12px; }
.dashboard-item strong { font-size: 14px; }
.dashboard-item small { font-size: 12px; }
.dashboard-email-link { min-height: 44px; display: inline-flex; align-items: center; font-size: 12px; }
.panel-link { margin: 12px 20px 16px; }
.thwin-correction-tools { grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 24px; padding-block: 20px; }
.thwin-node, .thwin-leaf, .thwin-set-section { border-color: #dbe2e9; border-radius: 8px; box-shadow: 0 2px 7px rgb(22 37 53 / 4%); }
.thwin-summary, .thwin-set-heading { min-height: 60px; padding: 12px 16px; }
.thwin-summary strong, .thwin-set-heading strong { font-size: 15px; }
.thwin-node-body { padding: 16px; }
.thwin-children { gap: 9px; }
.thwin-metadata { gap: 12px 18px; }
.thwin-metadata dt { font-size: 11px; }
.thwin-metadata dd { font-size: 13px; }
.thwin-set-content { padding: 0 16px 16px; }
.thwin-part-heading, .thwin-part-row { gap: 13px; padding: 11px 8px; }
.consumable-list-heading, .consumable-row { grid-template-columns: minmax(230px, 1.4fr) minmax(200px, 1fr) minmax(160px, .9fr) minmax(150px, .8fr); gap: 18px; padding-inline: 22px; }
.consumable-row { min-height: 86px; border-color: #edf0f3; }
.consumable-identity h2 { font-size: 15px; }
.consumable-identity p, .consumable-stock small { font-size: 12px; }
.consumable-actions { gap: 8px; }
.wishlist-list-heading, .wishlist-row { grid-template-columns: minmax(230px, 1.45fr) minmax(140px, .8fr) minmax(150px, .8fr) minmax(150px, .85fr) minmax(100px, .55fr); gap: 16px; padding-inline: 20px; }
.wishlist-row { padding-block: 17px; border-color: #edf0f3; }
.wishlist-identity h2 { font-size: 15px; }
.wishlist-identity p { line-height: 1.5; }
.wishlist-identity small, .wishlist-requester small { font-size: 12px; }
.repair-case-row { min-height: 84px; padding-inline: 21px; }
.repair-workspace { grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 22px; }
.repair-history-column, .repair-actions-column { gap: 18px; }
.repair-panel { border-color: #dbe2e9; border-radius: 8px; padding: 21px; box-shadow: var(--shadow-panel); }
.repair-panel h2 { font-size: 18px; }
.repair-form { box-shadow: none; }
.repair-timeline { gap: 13px; }
.repair-event { border-radius: 0 7px 7px 0; padding: 14px 16px; background: #f5f7f9; }
.repair-event-heading strong { font-size: 14px; }
.repair-event-heading time, .repair-event-meta { font-size: 12px; }
.repair-event-body { font-size: 14px; }
.order-lines { display: grid; gap: 9px; }
.order-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; border-bottom: 1px solid #e8edf2; padding: 11px 0; }
.order-line:last-child { border-bottom: 0; padding-bottom: 0; }
.order-line > div { display: grid; gap: 3px; min-width: 0; }
.order-line strong { overflow-wrap: anywhere; }
.order-line small { color: var(--muted); font-size: 12px; }
.order-line > span { font-weight: 700; }
.stocktake-create-page { max-width: 900px; }
.stocktake-location-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; margin: 0; padding: 14px; border: 1px solid #d6dee7; border-radius: 7px; background: #f8fafc; }
.stocktake-location-option { min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px; border-radius: 5px; padding: 6px 8px; cursor: pointer; }
.stocktake-location-option:hover { background: #edf2f8; }
.stocktake-location-option input { flex: 0 0 18px; width: 18px; min-height: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--pine); }
.stocktake-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stocktake-filter { grid-template-columns: minmax(220px, 1fr) minmax(200px, 320px) auto auto; }
.stocktake-lines { display: grid; gap: 12px; }
.stocktake-bulk-count-form { display: grid; gap: 12px; }
.stocktake-bulk-actions { position: sticky; bottom: 8px; z-index: 20; display: flex; justify-content: flex-end; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgb(255 255 255 / 96%); box-shadow: 0 4px 18px rgb(22 37 53 / 12%); }
.stocktake-bulk-actions .button { min-height: 48px; }
.stocktake-bulk-count-form { display: grid; gap: 12px; }
.stocktake-bulk-actions { position: sticky; bottom: 8px; z-index: 20; display: flex; justify-content: flex-end; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgb(255 255 255 / 96%); box-shadow: 0 4px 18px rgb(22 37 53 / 12%); }
.stocktake-bulk-actions .button { min-height: 48px; }
.stocktake-line { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 20px; min-width: 0; border: 1px solid #dbe2e9; border-radius: 8px; padding: 18px 20px; background: #fff; box-shadow: var(--shadow-panel); }
.stocktake-line.is-counted { border-left: 4px solid #4f8658; }
.stocktake-line-main { min-width: 0; }
.stocktake-line-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stocktake-line-title .eyebrow { overflow-wrap: anywhere; }
.stocktake-line-title h2 { margin: 0; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.stocktake-count-state { flex: 0 0 auto; border-radius: 5px; padding: 5px 9px; background: #e7f1df; color: #315c2b; font-size: 11px; font-weight: 700; }
.stocktake-count-state.is-open { background: #fff0d6; color: #865615; }
.stocktake-identifiers { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 13px; }
.stocktake-identifiers span { display: grid; min-width: 100px; gap: 2px; }
.stocktake-identifiers small { color: var(--muted); font-size: 11px; }
.stocktake-identifiers strong { font-size: 13px; overflow-wrap: anywhere; }
.stocktake-reference-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 15px 0 0; }
.stocktake-reference-values > div { min-width: 0; border: 1px solid #e3e8ee; border-radius: 6px; padding: 8px 10px; background: #f7f9fb; }
.stocktake-reference-values dt { color: var(--muted); font-size: 10px; line-height: 1.3; }
.stocktake-reference-values dd { margin: 3px 0 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.stocktake-count-meta, .stocktake-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.stocktake-note { color: #815c17; }
.stocktake-count-form { display: grid; grid-template-columns: minmax(105px, .45fr) minmax(140px, 1fr); align-content: center; align-items: end; gap: 10px; }
.stocktake-count-input input { min-height: 54px; font-size: 20px; font-weight: 700; }
.stocktake-note-input { grid-column: 1 / -1; }
.stocktake-count-form > .button { grid-column: 1 / -1; width: 100%; }
.stocktake-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 20px 0; }
.stocktake-pagination > span { color: var(--muted); font-size: 13px; }
.stocktake-complete-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 22px 0; border: 1px solid #cbd9ce; border-radius: 8px; padding: 18px 20px; background: #f1f7f2; }
.stocktake-complete-panel h2 { margin: 0; font-size: 17px; }
.stocktake-complete-panel p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.stocktake-decision-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.stocktake-decision-actions form { margin: 0; }
.delta-report-table { overflow-x: auto; margin-top: 20px; }
.delta-report-header, .delta-report-row { display: grid; grid-template-columns: minmax(210px, 2fr) repeat(8, minmax(80px, .7fr)) minmax(190px, 1.5fr); gap: 12px; align-items: center; min-width: 1260px; padding: 12px 16px; }
.delta-report-header { border-bottom: 1px solid var(--line); background: #EEF2F6; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.delta-report-row { border-bottom: 1px solid var(--line); font-size: 13px; }
.delta-report-row:last-child { border-bottom: 0; }
.delta-report-row > div { min-width: 0; }
.delta-report-row strong, .delta-report-row small { display: block; overflow-wrap: anywhere; }
.delta-report-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.delta-status-ready > :nth-child(6) { font-weight: 800; }
.delta-status-partial > :last-child, .delta-status-stale > :last-child, .delta-status-local_changed > :last-child, .delta-status-incomplete > :last-child { color: #8c4e12; }
.stocktake-history { margin-top: 20px; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.site-footer { line-height: 1.5; }

@media (min-width: 1440px) {
    .topbar-inner { gap: 32px; }
    .account-bar { gap: 7px; }
    .member-nav { padding-inline: 13px; }
    .page-shell { padding-top: 42px; }
    .dashboard-grid { gap: 20px; }
}

@media (max-width: 1023px) {
    .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; padding-block: 10px; }
    .account-bar { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
    .account-tools { grid-column: 2; grid-row: 1; }
    .page-shell { width: min(100% - 48px, 900px); padding-top: 30px; }
    .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search-field { grid-column: 1 / -1; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .repair-workspace { grid-template-columns: minmax(0, 1fr) minmax(290px, .82fr); gap: 16px; }
    .thwin-part-heading, .thwin-part-row { grid-template-columns: 44px minmax(150px, 1.4fr) minmax(90px, .7fr) minmax(115px, .9fr) minmax(85px, .7fr) minmax(125px, .9fr) minmax(135px, 1fr) 44px; gap: 7px; }
}

@media (max-width: 767px) {
    .topbar { position: static; }
    .thwin-set-section { scroll-margin-top: 16px; }
    .topbar-inner { width: calc(100% - 32px); display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding-block: 12px; }
    .brand { align-self: flex-start; }
    .nav-disclosure { display: grid; gap: 4px; }
    .nav-toggle { min-height: 44px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #d5dee8; border-radius: 6px; padding: 0 12px; background: #fff; color: #344454; font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; }
    .nav-toggle::-webkit-details-marker { display: none; }
    .nav-toggle::after { content: "+"; color: var(--pine); font-size: 20px; font-weight: 500; }
    .nav-disclosure[open] > .nav-toggle::after { content: "−"; }
    .nav-disclosure:not([open]) > .account-bar { display: none; }
    .nav-disclosure[open] > .account-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px 0; }
    .member-nav { justify-content: flex-start; min-height: 44px; padding-inline: 10px; white-space: normal; }
    .account-tools { justify-content: space-between; padding-top: 5px; border-top: 1px solid #e8edf2; }
    .account-name { display: block; max-width: 60%; }
    .page-shell { width: calc(100% - 32px); min-height: calc(100vh - 220px); padding: 24px 0 42px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 22px; }
    .material-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .material-detail-heading > .button { width: 100%; }
    .material-photo-frame { min-height: 220px; }
    .material-specs { grid-template-columns: minmax(0, 1fr); }
    .field-admin-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    h1 { font-size: 28px; }
    .form-heading h1 { font-size: 28px; }
    .page-intro, .form-heading p:last-child { font-size: 14px; }
    .thwin-page-actions, .form-actions { width: 100%; }
    .thwin-page-actions > *, .form-actions > .button { flex: 1 1 100%; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .summary-item, .dashboard-stat { min-height: 92px; padding: 12px 13px; }
    .summary-item span, .dashboard-stat span { font-size: 11px; }
    .summary-item strong, .dashboard-stat strong { font-size: 24px; }
    .filter-bar { grid-template-columns: minmax(0, 1fr); gap: 9px; }
    .search-field { grid-column: auto; }
    .clear-link { justify-self: center; }
    .list-heading, .member-list-heading, .consumable-list-heading, .wishlist-list-heading { display: none; }
    .material-row { grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; padding: 15px 13px; }
    .item-identity { grid-column: 1 / -1; }
    .item-category { grid-column: 1; }
    .item-status { grid-column: 1; }
    .item-action { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
    .item-location { overflow-wrap: anywhere; }
    .item-location span { font-size: 11px; }
    .member-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 15px 13px; }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .dashboard-panel-todos { grid-column: auto; }
    .dashboard-panel header { padding: 14px 14px 12px; }
    .dashboard-item { align-items: flex-start; flex-wrap: wrap; padding-inline: 14px; }
    .dashboard-item-main { min-width: 0; }
    .dashboard-email-link { margin: 0 0 10px 0; }
    .thwin-correction-tools { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .thwin-correction-tools form { align-items: stretch; }
    .thwin-correction-tools form .button { width: 100%; }
    .thwin-summary { grid-template-columns: 48px minmax(0, 1fr); gap: 7px 9px; padding: 12px; }
    .thwin-number, .thwin-child-count { grid-column: 2; }
    .thwin-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .thwin-set-heading { grid-template-columns: 48px minmax(0, 1fr); gap: 7px 9px; padding: 12px; }
    .thwin-set-heading .thwin-set-number, .thwin-set-heading .thwin-child-count { grid-column: 2; }
    .thwin-part-heading { display: none; }
    .thwin-part-row { grid-template-columns: 44px minmax(0, 1fr); gap: 6px 9px; padding: 11px 4px; }
    .thwin-part-row > :nth-child(n+3) { grid-column: 2; }
    .thwin-part-name { grid-column: 2; }
    .consumable-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 11px; padding: 14px 13px; }
    .consumable-identity { grid-column: 1 / -1; }
    .consumable-stock, .consumable-location { grid-column: 1; }
    .consumable-actions { grid-column: 2; grid-row: 2 / span 2; justify-self: end; }
    .wishlist-row { grid-template-columns: minmax(0, 1fr) auto; gap: 9px 10px; padding: 14px 13px; }
    .wishlist-identity { grid-column: 1 / -1; }
    .wishlist-quantity, .wishlist-requester, .wishlist-row > div:nth-child(3) { grid-column: 1; }
    .wishlist-row > div:nth-child(5) { grid-column: 2; grid-row: 2 / span 3; align-self: center; justify-self: end; }
    .stocktake-create-page { max-width: 100%; }
    .stocktake-location-options { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 9px; }
    .stocktake-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stocktake-filter { grid-template-columns: minmax(0, 1fr); }
    .stocktake-line { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
    .stocktake-bulk-actions { bottom: 4px; }
    .stocktake-bulk-actions .button { width: 100%; }
    .stocktake-line-title h2 { font-size: 15px; }
    .stocktake-identifiers { gap: 8px 12px; }
    .stocktake-reference-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stocktake-count-form { grid-template-columns: minmax(0, 1fr); }
    .stocktake-note-input, .stocktake-count-form > .button { grid-column: auto; }
    .stocktake-bulk-actions { bottom: 4px; }
    .stocktake-bulk-actions .button { width: 100%; }
    .stocktake-complete-panel { align-items: stretch; flex-direction: column; padding: 15px; }
    .stocktake-complete-panel .button { width: 100%; }
    .stocktake-decision-actions { flex-direction: column; }
    .repair-case-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 14px 13px; }
    .repair-case-ref, .repair-case-main { grid-column: 1; }
    .repair-case-row > .repair-status { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
    .repair-case-arrow { display: none; }
    .repair-workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .repair-panel { padding: 15px; }
    .repair-case-heading > .repair-status { grid-column: auto; grid-row: auto; justify-self: start; }
    .data-form { gap: 15px; padding: 17px; }
    .form-actions { flex-wrap: wrap; }
    .location-picker-row { grid-template-columns: minmax(0, 1fr); }
    .location-picker-row > .button { width: 100%; }
    .login-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; margin: 8px auto; }
    .login-panel { padding: 28px 20px; }
    .login-panel h1 { font-size: 29px; }
    .login-aside { display: none; }
    .auth-links { align-items: flex-start; flex-direction: column; }
    .message-page { margin: 8px auto; padding: 24px 18px; }
    .draft-fields { padding: 15px; }
    .copy-row { flex-direction: column; }
    .draft-modes a { flex: 1; padding-inline: 5px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}