@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --ink: #182622;
    --muted: #687772;
    --line: #dce4df;
    --paper: #f5f7f3;
    --white: #ffffff;
    --green: #28624e;
    --mint: #dbeee3;
    --orange: #ef793f;
    --soft-orange: #fff0e6;
    --text-xs: .68rem;
    --text-sm: .78rem;
    --text-md: .86rem;
    --text-base: .95rem;
    --panel-pad-x: clamp(1.25rem, 4vw, 2.7rem);
}

html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    margin: 0;
}

*, *::before, *::after { box-sizing: border-box; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

.content { padding: 0; }

.site-shell { min-height: 100vh; }

.site-header {
    align-items: center;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 78px;
    padding: 0 clamp(1.25rem, 4vw, 4.5rem);
}

.brand, .header-tools, .list-link, .user-link, .input-action, .table-tools, .table-footer { align-items: center; display: flex; }

.brand { gap: .85rem; }
.brand-logo { display: block; height: 42px; width: auto; }
.brand-service { border-left: 1px solid var(--line); color: var(--orange); font-size: var(--text-xs); font-weight: 700; letter-spacing: .16em; padding-left: .85rem; }
.header-tools { gap: clamp(.8rem, 2.5vw, 2rem); }
.language-picker { position: relative; }
.language-picker summary { align-items: center; cursor: pointer; display: flex; list-style: none; padding: .4rem .1rem; }
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.language-picker summary img, .language-menu img { border: 1px solid var(--line); display: block; height: 22px; object-fit: cover; width: 33px; }
.language-menu { background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(24,38,34,.12); display: flex; gap: .35rem; padding: .45rem; position: absolute; right: 0; top: calc(100% + .35rem); z-index: 5; }
.language-menu a { display: block; padding: .2rem; }
.language-menu a:hover, .language-menu a:focus-visible { background: var(--mint); outline: 0; }
.list-link { border-left: 1px solid var(--line); gap: .55rem; padding-left: 1.4rem; }
.shopping-list-icon { border: 1.5px solid var(--green); display: grid; gap: 3px; padding: 4px 3px; width: 21px; }
.shopping-list-icon span { background: var(--green); display: block; height: 1.5px; width: 12px; }
.list-label, .user-name { font-size: var(--text-md); font-weight: 600; }
.list-count { align-items: center; background: var(--orange); border-radius: 20px; color: white; display: flex; font-size: var(--text-xs); font-weight: 700; height: 21px; justify-content: center; width: 21px; }
.account-form { display: flex; }
.user-link { background: transparent; border: 0; border-left: 1px solid var(--line); color: inherit; cursor: pointer; gap: .6rem; padding: .2rem 0 .2rem 1.4rem; }
.user-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.avatar { align-items: center; background: var(--mint); border-radius: 50%; color: var(--green); display: flex; font-size: var(--text-xs); font-weight: 700; height: 31px; justify-content: center; width: 31px; }

.workspace { margin: 0 auto; max-width: 1480px; padding: clamp(2.2rem, 5vw, 4.8rem) clamp(1.25rem, 4vw, 4.5rem) 5rem; }
.workspace-heading { align-items: flex-end; display: flex; justify-content: space-between; margin-bottom: 2.8rem; }
.heading-actions { align-items: flex-end; display: grid; gap: .75rem; justify-items: end; }
.eyebrow, .section-kicker { color: var(--orange); font-size: var(--text-xs); font-weight: 700; letter-spacing: .14em; margin: 0 0 .7rem; text-transform: uppercase; }
h1, h2 { font-family: 'Space Grotesk', sans-serif; margin: 0; }
h1 { font-size: clamp(2.3rem, 4vw, 4rem); letter-spacing: -.05em; line-height: .98; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
.intro { color: var(--muted); font-size: var(--text-base); margin: 1rem 0 0; max-width: 500px; }
.status-chip { align-items: center; background: var(--mint); color: var(--green); display: flex; font-size: var(--text-xs); font-weight: 700; gap: .5rem; padding: .65rem .8rem; }
.status-dot { background: #52a579; border-radius: 50%; height: 7px; width: 7px; }
.question-panel, .lookup-panel, .type-panel { background: var(--green); color: white; display: grid; gap: 2rem; margin-bottom: 2rem; padding: clamp(1.5rem, 4vw, 2.7rem) var(--panel-pad-x); }
.question-panel { grid-template-columns: 1fr 1fr; }
.question-copy h2, .lookup-copy h2, .type-panel-copy h2 { font-size: 1.55rem; }
.question-copy p, .lookup-copy p, .type-panel-copy p { color: #c6ddd0; font-size: var(--text-md); line-height: 1.55; margin: .75rem 0 0; max-width: 360px; }
.question-copy .question-hint { color: white; font-size: var(--text-sm); font-weight: 600; margin-top: .6rem; }
.question-copy .section-kicker { color: var(--orange); }
.question-form { align-self: center; }
.question-form label, .lookup-form label, .type-fields label { color: #c6ddd0; display: block; font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; margin-bottom: .55rem; text-transform: uppercase; }
.question-form textarea { background: var(--paper); border: 1px solid var(--line); color: var(--ink); display: block; min-height: 92px; outline: 0; padding: .8rem 1rem; resize: vertical; width: 100%; }
.question-form textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(239,121,63,.2); }
.question-result { background: #d7dbd8; border: 1px solid #b9c2bc; color: #4d5953; cursor: default; display: block; padding: .65rem .8rem; width: 100%; }
.question-actions { align-items: center; display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-start; margin-top: .75rem; }
.question-loading-spinner { animation: question-spinner .75s linear infinite; border: 3px solid rgba(255,255,255,.45); border-radius: 50%; border-top-color: white; display: inline-block; height: 1.15rem; width: 1.15rem; }
@keyframes question-spinner { to { transform: rotate(360deg); } }
.question-message { color: var(--green); font-size: var(--text-sm); margin: 0; }

.selection-modes { border-bottom: 1px solid var(--line); display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.selection-modes button { background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-size: var(--text-sm); font-weight: 700; padding: .75rem .1rem .85rem; }
.selection-modes button.active { border-bottom-color: var(--orange); color: var(--green); }

.lookup-panel { grid-template-columns: 1fr 1.2fr; position: relative; }
.lookup-panel::after { border: 1px solid rgba(255,255,255,.14); content: ''; height: 78px; position: absolute; right: 2rem; top: 1.8rem; transform: rotate(45deg); width: 78px; }
.lookup-panel .section-kicker { color: var(--orange); }
.lookup-copy { position: relative; z-index: 1; }
.access-request-link { color: var(--orange); display: inline-block; font-size: var(--text-sm); font-weight: 700; margin-top: 1rem; text-decoration: underline; text-underline-offset: .2rem; }
.access-back-link { color: #c6ddd0; font-size: var(--text-sm); font-weight: 700; text-decoration: underline; text-underline-offset: .2rem; }
.lookup-form { align-self: center; position: relative; z-index: 1; }
.login-form { display: grid; gap: .8rem; max-width: 420px; width: 100%; }
.login-field input { background: white; border: 0; color: var(--ink); min-height: 46px; outline: 0; padding: 0 1rem; width: 100%; }
.login-field input:focus { box-shadow: 0 0 0 3px rgba(239,121,63,.35); }
.login-form .button { justify-self: start; }
.input-action { gap: .6rem; }
.input-action input, .search-field input { background: white; border: 0; color: var(--ink); min-height: 46px; outline: 0; padding: 0 1rem; width: 100%; }
.input-action input:focus, .search-field input:focus { box-shadow: 0 0 0 3px rgba(239,121,63,.35); }
.button { border: 0; font-size: var(--text-sm); font-weight: 700; min-height: 46px; padding: 0 1.15rem; white-space: nowrap; }
.button-dark { background: var(--orange); color: white; }
.button-dark:hover, .button-accent:hover { background: #d9622d; }
.lookup-message { font-size: var(--text-sm); margin: .65rem 0 0; }
.lookup-message.success { color: #bce5c9; }
.lookup-message.warning { color: #ffd0b7; }

.type-panel { grid-template-columns: .8fr 1.4fr; }
.type-fields { align-items: end; display: grid; gap: .75rem; grid-template-columns: repeat(3, 1fr) auto; }
.type-fields label { display: grid; gap: .45rem; margin-bottom: 0; }
.type-fields select { background: white; border: 0; color: var(--ink); min-height: 46px; min-width: 0; padding: 0 .75rem; }
@media (max-width: 760px) {
    .question-panel, .lookup-panel, .type-panel { grid-template-columns: minmax(0, 1fr); width: 100%; }
    .question-form { order: initial; }
    .input-action { align-items: stretch; flex-direction: column; }
    .input-action .button { width: 100%; }
    .login-form .button { width: 100%; }
    .type-fields { grid-template-columns: minmax(0, 1fr); }
    .type-fields .button { width: 100%; }
}
.selection-result { background: var(--white); border: 1px solid var(--line); display: grid; gap: .5rem; margin-top: 2rem; max-width: 560px; padding: 1.6rem; }
.selection-result > p, .selection-result > span:not(.section-kicker) { color: var(--muted); font-size: var(--text-sm); }
.selection-result strong { font-family: 'Space Grotesk'; font-size: 1.1rem; }
.selection-result .button { justify-self: start; margin-top: .5rem; }

.content-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 290px; }
.fleet-panel, .next-panel { background: var(--white); border: 1px solid var(--line); }
.fleet-panel { grid-column: 1 / -1; min-width: 0; }
.panel-heading { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 1.25rem var(--panel-pad-x); }
.panel-heading-dark { background: var(--green); border-bottom-color: var(--green); color: white; }
.panel-heading-dark .section-kicker { color: var(--orange); }
.role-switcher { background: var(--white); box-shadow: 0 1px 3px rgba(24,38,34,.1); color: var(--green); font-size: .7rem; font-weight: 700; padding: .55rem .7rem; }
.table-tools { border-bottom: 1px solid var(--line); gap: .8rem; justify-content: space-between; padding: .9rem 1.6rem; }
.search-field { align-items: center; border: 1px solid var(--line); display: flex; max-width: 330px; width: 100%; }
.search-field span { color: var(--orange); font-weight: 700; padding-left: .8rem; }
.search-field input { min-height: 36px; padding-left: .55rem; }
.filter-pills { display: flex; gap: .4rem; }
.filter-pill { background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: .68rem; padding: .52rem .65rem; }
.filter-pill.active { background: var(--mint); border-color: var(--mint); color: var(--green); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.fleet-table-wrap { max-height: 580px; overflow: auto; }
.parts-table-wrap { max-height: 520px; overflow: auto; }
.machine-table { border-collapse: collapse; min-width: 650px; width: 100%; }
.machine-table th { background: #fbfcfa; color: var(--muted); font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; padding: .95rem 1.6rem; text-align: left; text-transform: uppercase; }
.fleet-table-wrap .machine-table th, .parts-table-wrap .parts-table th { position: sticky; top: 0; z-index: 1; }
.machine-table td { border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); padding: 1.05rem 1.6rem; }
.machine-table tbody tr { cursor: pointer; transition: background .15s ease; }
.machine-table tbody tr:hover { background: #f3faf5; }
.machine-table tbody tr.selected { background: var(--mint); }
.machine-table td strong { color: var(--ink); font-size: .84rem; }
.serial { color: var(--green); font-family: 'Space Grotesk'; font-size: .76rem; font-weight: 700; }
.row-arrow { color: var(--orange) !important; font-weight: 700; text-align: right; }
.table-footer { color: var(--muted); font-size: var(--text-xs); justify-content: space-between; padding: 1rem 1.6rem; }

.next-panel { align-self: start; padding: 1.6rem; }
.next-panel h2 { line-height: 1.25; max-width: 200px; }
.empty-selection { border: 1px dashed #cbd9d1; margin: 1.8rem 0; padding: 1.1rem; }
.empty-icon { align-items: center; border: 1px solid var(--orange); color: var(--orange); display: flex; font-size: 1.2rem; height: 28px; justify-content: center; margin-bottom: .8rem; width: 28px; }
.empty-selection p { color: var(--muted); font-size: var(--text-sm); line-height: 1.5; margin: 0; }
.selected-machine { background: var(--mint); display: grid; gap: .35rem; margin: 1.8rem 0; padding: 1.2rem; }
.selected-label { color: var(--green); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.selected-machine strong { font-family: 'Space Grotesk'; font-size: 1rem; }
.selected-machine > span:not(.selected-label) { color: var(--muted); font-size: .76rem; }
.button-accent { background: var(--orange); color: white; margin-top: .8rem; }
.workspace-note { align-items: flex-start; border-top: 1px solid var(--line); color: var(--muted); display: flex; font-size: var(--text-xs); gap: .6rem; line-height: 1.45; padding-top: 1rem; }
.note-icon { align-items: center; border: 1px solid #a6bcb0; border-radius: 50%; color: var(--green); display: flex; flex: 0 0 17px; font-size: .65rem; font-weight: 700; height: 17px; justify-content: center; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }

.button-outline { align-items: center; border: 1px solid var(--green); color: var(--green); display: inline-flex; }
.shopping-list-grid { align-items: start; display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 330px; }
.shopping-machine-groups { display: grid; gap: 1.25rem; min-width: 0; }
.shopping-items, .shopping-summary, .shopping-empty { background: var(--white); border: 1px solid var(--line); }
.machine-context { color: #c6ddd0; display: block; font-size: .72rem; margin-top: .35rem; }
.machine-table-actions { align-items: flex-end; display: grid; gap: .45rem; justify-items: end; }
.parts-return-link { color: white; font-size: .7rem; font-weight: 700; text-decoration: underline; text-underline-offset: .2rem; }
.item-summary { color: var(--muted); font-size: .75rem; font-weight: 700; }
.shopping-item-list { border-top: 1px solid var(--line); }
.shopping-item { align-items: center; display: grid; gap: 1rem; grid-template-columns: 38px minmax(0, 1fr) auto auto; padding: 1.25rem 1.6rem; }
.shopping-item + .shopping-item { border-top: 1px solid var(--line); }
.part-mark { align-items: center; background: var(--mint); color: var(--green); display: flex; font-family: 'Space Grotesk'; font-weight: 700; height: 38px; justify-content: center; width: 38px; }
.part-details { display: grid; gap: .2rem; }
.part-details strong { color: var(--ink); font-size: .88rem; }
.part-details > span:last-child { color: var(--muted); font-size: .72rem; }
.part-details .part-price { color: var(--ink); font-size: .7rem; }
.part-price span { color: var(--muted); font-weight: 700; margin-right: .3rem; }
.quantity-control { align-items: center; border: 1px solid var(--line); display: flex; }
.quantity-control button { background: transparent; border: 0; color: var(--green); font-size: 1rem; height: 32px; width: 30px; }
.quantity-control output { color: var(--ink); font-size: .8rem; font-weight: 700; min-width: 28px; text-align: center; }
.remove-item { background: transparent; border: 0; color: var(--muted); font-size: .7rem; padding: .5rem 0 .5rem .5rem; }
.remove-item:hover { color: var(--orange); }
.shopping-summary { padding: 1.6rem; }
.shopping-summary h2 { line-height: 1.25; }
.shopping-summary > p { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.summary-details { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); margin: 1.4rem 0 .8rem; }
.summary-details div { display: flex; font-size: .75rem; justify-content: space-between; padding: .7rem 0; }
.summary-details div + div { border-top: 1px solid var(--line); }
.summary-details dt { color: var(--muted); }
.summary-details dd { color: var(--ink); font-weight: 700; margin: 0; text-align: right; }
.price-notice { background: var(--soft-orange); color: #8a4a2e !important; font-size: .72rem !important; line-height: 1.45; margin: 0 0 1.2rem; padding: .7rem .8rem; }
.summary-machines { border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; padding-bottom: .8rem; }
.summary-label { color: var(--muted); display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; margin-bottom: .65rem; text-transform: uppercase; }
.summary-machine { display: grid; gap: .2rem; padding: .55rem 0; }
.summary-machine + .summary-machine { border-top: 1px solid var(--line); }
.summary-machine strong { color: var(--ink); font-size: .78rem; }
.summary-machine span { color: var(--muted); font-size: .7rem; }
.shopping-summary .button { align-items: center; display: inline-flex; justify-content: center; width: 100%; }
.quote-message { color: var(--green) !important; font-size: .75rem !important; margin-bottom: 0; }
.shopping-empty { margin: 0 auto; max-width: 650px; padding: clamp(2rem, 6vw, 4.5rem); text-align: center; }
.shopping-empty .empty-icon { margin: 0 auto .9rem; }
.shopping-empty h2 { margin-bottom: .7rem; }
.shopping-empty p { color: var(--muted); font-size: .85rem; line-height: 1.5; margin: 0 auto 1.4rem; max-width: 390px; }
.shopping-empty .button { display: inline-flex; }

.parts-context { background: var(--mint); display: grid; gap: .25rem; padding: 1rem 1.2rem; }
.parts-context .section-kicker { margin-bottom: .1rem; }
.parts-context-row { align-items: baseline; display: grid; gap: .75rem; grid-template-columns: auto 1fr; }
.parts-context-row > span { color: var(--muted); font-size: var(--text-xs); text-transform: uppercase; }
.parts-context strong { color: var(--green); font-family: 'Space Grotesk'; font-size: .9rem; }
.parts-context > span:last-child { color: var(--muted); font-size: .72rem; }
.machine-parts-page .workspace-heading { align-items: flex-start; }
.parts-heading-side { align-items: flex-end; display: grid; gap: 1.4rem; }
.parts-back-button { margin: 0; }
.subassembly-panel { background: var(--white); border: 1px solid var(--line); margin-bottom: 2rem; }
.subassembly-context { color: #c6ddd0; font-size: .72rem; font-weight: 700; }
.subassembly-selectors { align-items: end; display: grid; gap: 1rem; grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.25fr); padding: 1.2rem var(--panel-pad-x); }
.subassembly-selector { color: var(--muted); display: grid; font-size: .75rem; font-weight: 700; gap: .45rem; letter-spacing: .08em; text-transform: uppercase; }
.subassembly-selector select { background: var(--white); border: 1px solid var(--line); color: var(--ink); font-size: .95rem; min-height: 46px; padding: 0 .8rem; width: 100%; }
.subassembly-selector select:disabled, .type-fields select:disabled { background: #f1f4f1; color: #9aa9a0; cursor: not-allowed; }
.parts-panel-actions { align-items: center; display: flex; gap: .75rem; }
.parts-filter-status { color: var(--muted); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.parts-panel-heading .button-outline { align-items: center; border-color: rgba(255,255,255,.5); color: white; display: inline-flex; gap: .55rem; line-height: 1; }
.parts-panel-heading .clear-ai-filter { background: var(--paper); border-color: var(--paper); color: var(--green); }
.parts-panel-heading .clear-ai-filter:hover { background: var(--white); border-color: var(--white); color: var(--green); }
.parts-panel-heading .list-count { flex: 0 0 21px; line-height: 1; margin-left: 0; }
.parts-tools { align-items: end; border-bottom: 1px solid var(--line); display: flex; gap: 1rem; justify-content: space-between; padding: 1rem 1.6rem; }
.parts-search { max-width: 410px; }
.subassembly-filter { color: var(--muted); display: grid; font-size: var(--text-xs); font-weight: 700; gap: .4rem; letter-spacing: .08em; text-transform: uppercase; }
.subassembly-filter select { background: white; border: 1px solid var(--line); color: var(--ink); min-height: 36px; min-width: 190px; padding: 0 .7rem; }
.parts-table th, .parts-table td { white-space: nowrap; }
.parts-table td:nth-child(3) { white-space: normal; }
.parts-action-cell { text-align: right; }
.cart-button { align-items: center; background: var(--mint); border: 0; color: var(--green); display: inline-flex; font-size: 1.1rem; font-weight: 700; height: 32px; justify-content: center; width: 32px; }
.cart-button:hover { background: var(--orange); color: white; }
.add-row td { background: #f3faf5; padding: 0; }
.add-panel { align-items: center; display: flex; gap: 1rem; justify-content: flex-end; padding: 1rem 1.6rem; }
.add-panel > div { display: grid; gap: .2rem; margin-right: auto; }
.add-panel > div span { color: var(--muted); font-size: var(--text-sm); }
.add-panel label { align-items: center; color: var(--muted); display: flex; font-size: var(--text-xs); font-weight: 700; gap: .5rem; }
.add-panel input { border: 1px solid var(--line); min-height: 36px; padding: 0 .5rem; width: 65px; }
.text-button { background: transparent; border: 0; color: var(--muted); font-size: var(--text-sm); }
.parts-empty { padding: 3rem 1.6rem; text-align: center; }
.parts-empty h2 { margin-bottom: .5rem; }
.parts-empty p { color: var(--muted); font-size: var(--text-sm); }
.parts-message { align-items: center; background: var(--mint); color: var(--green); display: flex; font-size: var(--text-sm); gap: .8rem; justify-content: space-between; margin-top: 1rem; padding: .9rem 1.1rem; }
.parts-message a { font-weight: 700; text-decoration: underline; }
.pdf-preview-panel { background: var(--white); border: 1px solid var(--line); margin-top: 2rem; }
.pdf-badge { border: 1px solid rgba(255,255,255,.45); font-size: .68rem; font-weight: 700; padding: .45rem .6rem; }
.pdf-preview-frame { background: #edf1ed; cursor: grab; min-height: 360px; overflow: auto; padding: 1.25rem; position: relative; text-align: center; touch-action: none; }
.pdf-preview-frame.is-panning { cursor: grabbing; }
.pdf-preview-selector { align-items: center; display: flex; gap: .55rem; margin-left: auto; width: min(32rem, 42vw); }
.pdf-preview-selector span { color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.pdf-preview-selector select { background: var(--white); border: 1px solid var(--line); color: var(--green); flex: 1; min-height: 2.2rem; min-width: 0; padding: 0 .5rem; width: 100%; }
.pdf-preview-controls { display: flex; flex-shrink: 0; gap: .35rem; margin-left: .6rem; }
.pdf-preview-control { align-items: center; background: var(--white); border: 1px solid var(--line); color: var(--green); cursor: pointer; display: inline-flex; font-size: 1rem; font-weight: 700; height: 2.2rem; justify-content: center; min-width: 2.2rem; padding: 0 .55rem; }
.pdf-preview-control:hover, .pdf-preview-control:focus-visible { background: var(--green); color: var(--white); }
.pdf-preview-reset { font-size: .7rem; min-width: 3.4rem; }
.pdf-preview-fallback { background: rgba(255,255,255,.94); bottom: 1.25rem; color: var(--muted); font-size: .75rem; left: 50%; margin: 0; padding: .65rem .8rem; position: absolute; transform: translateX(-50%); width: min(90%, 520px); }
.pdf-preview-fallback strong { color: var(--green); }

@media (max-width: 820px) {
    .subassembly-selectors { grid-template-columns: 1fr 1fr; }
    .shopping-list-grid { grid-template-columns: 1fr; }
    .pdf-preview-heading { align-items: flex-start; flex-wrap: wrap; }
    .pdf-preview-selector { margin-left: 0; order: 3; width: 100%; }
    .pdf-preview-selector select { flex: 1 1 auto; max-width: none; min-width: 0; width: 100%; }
    .pdf-preview-controls { margin-left: 0; }
}

@media (max-width: 640px) {
    .site-header { align-items: flex-start; flex-wrap: wrap; gap: .8rem; padding: .8rem 1rem; }
    .brand { min-width: 0; }
    .brand-logo { height: 34px; }
    .brand-service { font-size: .52rem; padding-left: .55rem; }
    .header-tools { gap: .7rem; margin-left: auto; }
    .list-link, .user-link { gap: .35rem; padding-left: .65rem; }
    .list-label, .user-name { font-size: .7rem; }
    .workspace { min-width: 0; padding: 1.5rem 1rem 3rem; width: 100%; }
    .workspace-heading > div, .heading-actions { width: 100%; }
    .heading-actions { align-items: stretch; justify-items: stretch; }
    .role-switcher { align-self: flex-start; }
    .question-panel, .lookup-panel, .type-panel { gap: 1.25rem; margin-bottom: 1.25rem; padding: 1.25rem; }
    .question-copy, .question-form, .lookup-copy, .lookup-form, .type-panel-copy, .type-fields { min-width: 0; width: 100%; }
    .subassembly-panel .panel-heading { align-items: flex-start; flex-direction: column; gap: .5rem; }
    .subassembly-selectors { grid-template-columns: 1fr; padding-left: 1.25rem; padding-right: 1.25rem; }
    .workspace-heading { align-items: flex-start; flex-direction: column; gap: 1.25rem; }
    .parts-panel-heading, .parts-tools { align-items: stretch; flex-direction: column; }
    .parts-panel-actions { align-items: stretch; flex-direction: column; }
    .parts-heading-side { align-items: stretch; width: 100%; }
    .parts-panel-heading .button-outline, .parts-search { max-width: none; width: 100%; }
    .subassembly-filter select { width: 100%; }
    .parts-table-wrap { overflow-x: hidden; }
    .parts-table { min-width: 0; table-layout: fixed; width: 100%; }
    .parts-table th, .parts-table td { overflow-wrap: anywhere; padding: .8rem .55rem; white-space: normal; }
    .parts-table th { font-size: .56rem; line-height: 1.25; }
    .parts-table td { font-size: .72rem; line-height: 1.35; }
    .parts-table td strong { font-size: .74rem; }
    .parts-table th:nth-child(1), .parts-table td:nth-child(1) { width: 12%; }
    .parts-table th:nth-child(2), .parts-table td:nth-child(2) { width: 23%; }
    .parts-table th:nth-child(3), .parts-table td:nth-child(3) { width: 27%; }
    .parts-table th:nth-child(4), .parts-table td:nth-child(4) { width: 16%; }
    .parts-table th:nth-child(5), .parts-table td:nth-child(5) { width: 12%; }
    .parts-table th:nth-child(6), .parts-table td:nth-child(6) { width: 10%; }
    .add-panel { align-items: stretch; flex-direction: column; }
    .add-panel > div { margin-right: 0; }
    .shopping-item { align-items: start; grid-template-columns: 38px minmax(0, 1fr) auto; }
    .shopping-item .quantity-control { grid-column: 2; }
    .shopping-item .remove-item { align-self: center; grid-column: 3; grid-row: 1 / span 2; }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
