 :root {
  color-scheme: light;
  --ink: #182a24;
  --ink-soft: #45564e;
  --muted: #77847c;
  --paper: #f4f7f5;
  --surface: #ffffff;
  --line: #e2e9e4;
  --line-strong: #d0ddd4;
  --green: #137a53;
  --green-dark: #0a5c3c;
  --green-soft: #e8f4ed;
  --amber: #9b650b;
  --amber-soft: #fff4db;
  --red: #a73c34;
  --red-soft: #fff0ed;
  --shadow: 0 16px 42px rgba(27, 52, 40, .055);
  font-family: 'DM Sans', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1160px; padding: 0 34px; margin: 0 auto; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e3eae5; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--green); box-shadow: 0 5px 12px rgba(19,122,83,.18); }
.brand-mark svg { width: 23px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: Manrope, sans-serif; font-size: 14px; line-height: 1.05; font-weight: 800; letter-spacing: .055em; }
.brand-name span { display: block; margin-top: 4px; color: var(--green); font-size: 9px; letter-spacing: .19em; }
.session-indicator { display: flex; align-items: center; gap: 9px; color: #66766c; font-size: 12px; }
.status-dot, .source-dot { width: 7px; height: 7px; border-radius: 50%; background: #34a46f; box-shadow: 0 0 0 3px #e0f1e7; }
main { padding-bottom: 45px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 48px 0 29px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.eyebrow-line { width: 16px; height: 2px; border-radius: 2px; background: #49a47b; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, sans-serif; }
h1 { margin: 0; font-size: clamp(32px, 4vw, 42px); line-height: 1.16; font-weight: 800; letter-spacing: -.055em; }
h1 span { color: var(--green); }
.intro-text { max-width: 510px; margin: 12px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.intro-note { max-width: 325px; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #e4ebe6; background: rgba(255,255,255,.65); color: #65746b; border-radius: 11px; font-size: 11px; line-height: 1.55; }
.intro-note strong { color: var(--ink); }
.note-icon { flex: 0 0 auto; display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid #9db9a6; border-radius: 50%; color: var(--green); font-size: 11px; font-weight: 700; }
.entry-card { position: relative; padding: 24px 25px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.entry-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.step-badge { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-soft); font: 800 11px Manrope,sans-serif; }
.entry-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.entry-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
#entry-form { display: grid; grid-template-columns: minmax(180px,1fr) minmax(120px,165px) 90px minmax(190px,205px); gap: 10px; align-items: stretch; }
.input-wrap { position: relative; display: flex; align-items: center; flex: 1; min-width: 130px; height: 49px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fcfdfc; transition: border-color .16s, box-shadow .16s; }
.input-wrap:focus-within { border-color: #6eae8e; box-shadow: 0 0 0 3px rgba(19,122,83,.10); }
.input-prefix { padding: 0 13px; border-right: 1px solid var(--line); color: var(--green); font: 800 11px Manrope,sans-serif; letter-spacing: .08em; }
#ca-input { width: 100%; min-width: 0; height: 100%; padding: 0 12px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 700 15px Manrope,sans-serif; letter-spacing: .03em; }
#ca-input::placeholder { color: #aab5ad; font: 500 13px 'DM Sans',sans-serif; letter-spacing: 0; }
.scan-button { flex: 0 0 44px; width: 44px; height: 100%; display: grid; place-items: center; border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; color: var(--green); background: #f5faf6; transition: background .16s,color .16s; }
.scan-button:hover { color: white; background: var(--green); }
.scan-button:focus-visible, .scanner-close:focus-visible { outline: 3px solid rgba(19,122,83,.3); outline-offset: 2px; }
.scan-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.qty-field { width: 100%; min-width: 0; height: 49px; display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: #fcfdfc; }
.qty-field label { padding: 0 10px; color: var(--muted); font-size: 11px; }
.qty-field input { width: 44px; height: 100%; padding: 0 4px; border: 0; outline: 0; background: transparent; color: var(--ink); text-align: center; font-weight: 700; }
.size-field { width: 100%; height: 49px; display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: #fcfdfc; }
.size-field:focus-within { border-color: #6eae8e; box-shadow: 0 0 0 3px rgba(19,122,83,.10); }
.size-field label { padding: 0 10px; border-right: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.size-field input { width: 100%; min-width: 0; height: 100%; padding: 0 9px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 600; }
.size-field input::placeholder { color: #aab5ad; font-size: 11px; font-weight: 400; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 0; border-radius: 9px; font-weight: 700; white-space: nowrap; transition: transform .16s, background .16s, box-shadow .16s; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button-primary { min-width: 205px; height: 49px; padding: 0 17px; color: white; background: var(--green); font-size: 12px; box-shadow: 0 5px 12px rgba(19,122,83,.15); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 8px 17px rgba(19,122,83,.2); }
.button-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.17); font-size: 17px; font-weight: 400; }
.button-label-mobile { display: none; }
.button-primary.loading .button-icon { animation: rotate 1s linear infinite; }
.input-hint { margin: 10px 0 0 1px; color: #849188; font-size: 10px; }
.lookup-alert { display: flex; align-items: flex-start; gap: 9px; margin-top: 15px; padding: 11px 13px; border-radius: 9px; font-size: 11px; line-height: 1.55; }
.lookup-alert[hidden] { display: none; }
.lookup-alert.warning { border: 1px solid #f0dfb8; color: #76510f; background: #fffbf1; }
.lookup-alert.error { border: 1px solid #efc9c2; color: #8d3028; background: #fff6f3; }
.lookup-alert.success { border: 1px solid #cbe6d5; color: #236744; background: #f3fbf6; }
.alert-symbol { flex: 0 0 auto; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: currentColor; color: white; font-weight: 800; font-size: 10px; }
.scanner-dialog { width: min(560px, calc(100vw - 28px)); max-height: min(90vh, 780px); padding: 0; border: 0; border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 70px rgba(12,34,22,.26); overflow: auto; }
.scanner-dialog::backdrop { background: rgba(15,31,23,.62); backdrop-filter: blur(3px); }
.scanner-panel { padding: 22px; }
.scanner-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.scanner-header .eyebrow { margin-bottom: 7px; }
.scanner-header h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.scanner-close { flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; font-size: 23px; line-height: 1; }
.scanner-close:hover { color: var(--red); background: var(--red-soft); }
.scanner-reader { width: 100%; min-height: 180px; overflow: hidden; border: 1px solid #27352d; border-radius: 12px; background: #111a14; }
#scanner-reader__scan_region { min-height: 230px; }
#scanner-reader video { width: 100%; max-height: 55vh; object-fit: cover; }
.scanner-status { min-height: 34px; margin: 12px 0 5px; color: #3f5949; font-size: 12px; line-height: 1.5; }
.scanner-help { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.scanner-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
.summary-strip { display: flex; justify-content: space-between; align-items: center; min-height: 82px; margin: 27px 0 37px; padding: 16px 22px; border-radius: 12px; background: #eaf2ed; }
.summary-label { display: flex; align-items: center; gap: 9px; color: #526a5b; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.summary-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: #d9eadf; color: var(--green); font-size: 15px; }
.summary-metrics { display: flex; align-items: center; gap: 33px; }
.summary-metrics > div { display: flex; align-items: baseline; gap: 7px; }
.summary-metrics strong { font: 800 20px Manrope,sans-serif; letter-spacing: -.04em; }
.summary-metrics span { color: #708077; font-size: 10px; }
.summary-metrics .metric-alert strong { color: #946213; }
.list-section { min-height: 210px; }
.list-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.list-heading .eyebrow { margin-bottom: 7px; }
.list-heading h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 21px; letter-spacing: -.04em; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; background: #e5eee8; color: var(--green); font: 700 11px 'DM Sans',sans-serif; }
.list-actions { display: flex; align-items: center; gap: 8px; }
.search-wrap { display: flex; align-items: center; width: 190px; height: 36px; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: #819087; background: #fff; font-size: 17px; }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-wrap input::placeholder { color: #a5b0a9; }
.button-quiet { height: 36px; padding: 0 12px; border: 1px solid var(--line); color: #5b6d62; background: #fff; font-size: 10px; }
.button-quiet:hover:not(:disabled) { background: #eff5f1; }
.button-quiet span { font-size: 15px; }
.empty-state { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 230px; margin-top: 16px; border: 1px dashed #d6e1da; border-radius: 12px; background: rgba(255,255,255,.55); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-illustration { position: relative; width: 70px; height: 62px; margin-bottom: 12px; }
.empty-shield { position: absolute; top: 1px; left: 15px; width: 41px; height: 47px; display: grid; place-items: center; clip-path: polygon(50% 0,100% 17%,92% 71%,50% 100%,8% 71%,0 17%); background: #e2f0e7; color: #248258; font: 24px Manrope,sans-serif; }
.empty-plus { position: absolute; right: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border: 3px solid var(--paper); border-radius: 50%; background: var(--green); color: white; font-size: 14px; }
.empty-line { position: absolute; bottom: 2px; left: 22px; width: 26px; height: 3px; border-radius: 2px; background: #c8ddd0; }
.empty-state h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.empty-state p { max-width: 300px; margin: 7px 0 0; color: #829087; font-size: 11px; line-height: 1.55; }
.epi-list { display: grid; gap: 12px; }
.epi-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 5px 16px rgba(27,52,40,.03); animation: appear .24s ease-out; }
.epi-card.needs-review { border-left: 3px solid #d8a341; }
.item-main { display: grid; grid-template-columns: 95px minmax(0, 1fr) 170px; gap: 20px; align-items: center; padding: 18px 20px 16px; }
.item-photo { width: 95px; height: 95px; display: grid; place-items: center; overflow: hidden; border: 1px solid #edf1ed; border-radius: 10px; background: #f8faf8; }
.product-image { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.image-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; color: #8e9b92; font-size: 9px; }
.image-placeholder span { color: #b7c6bc; font-size: 27px; line-height: 1; }
.item-topline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ca-chip { padding: 4px 8px; border: 1px solid #d9e8de; border-radius: 6px; background: #f3f8f4; color: #286e4c; font: 800 10px Manrope,sans-serif; letter-spacing: .035em; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 20px; font-size: 9px; font-weight: 600; }
.status-pill.good { background: var(--green-soft); color: #276a48; }
.status-pill.caution { background: var(--amber-soft); color: #8a5b0c; }
.status-pill.danger { background: var(--red-soft); color: var(--red); }
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.item-details h3 { margin: 8px 0 3px; font-size: 15px; line-height: 1.35; letter-spacing: -.035em; }
.item-subtitle { max-width: 560px; margin: 0; color: #77847b; font-size: 10px; line-height: 1.5; }
.item-meta { display: flex; align-items: baseline; gap: 9px; margin-top: 11px; }
.item-meta + .item-meta { margin-top: 5px; }
.item-size-meta .field-value { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 6px; background: #f0f7f2; color: #276a48; font-size: 12px; }
.item-size-meta .field-value.muted { background: #fbf6f1; }
.meta-label, .qty-label { color: #93a097; font-size: 8px; font-weight: 700; letter-spacing: .11em; }
.field-value { color: #33453a; font-size: 11px; font-weight: 700; }
.field-value.muted { color: #9a7461; font-weight: 500; }
.item-warning { margin: 8px 0 0; color: #8c5d14; font-size: 10px; line-height: 1.45; }
.item-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.stepper { display: flex; align-items: center; width: 122px; height: 35px; overflow: hidden; border: 1px solid #dce6de; border-radius: 8px; background: #fbfdfb; }
.stepper-button { width: 35px; height: 100%; border: 0; background: transparent; color: #718077; font-size: 18px; transition: background .15s,color .15s; }
.stepper-button:hover { background: #ebf4ed; color: var(--green); }
.stepper-button.plus { color: var(--green); font-size: 19px; }
.qty-value { flex: 1; width: 42px; min-width: 30px; border: 0; outline: 0; background: transparent; color: var(--ink); text-align: center; font: 700 13px Manrope,sans-serif; appearance: textfield; }
.qty-value::-webkit-inner-spin-button, .qty-value::-webkit-outer-spin-button { appearance: none; margin: 0; }
.open-source { color: #6f8175; text-decoration: none; font-size: 9px; }
.open-source:hover { color: var(--green); text-decoration: underline; }
.open-source span { color: var(--green); font-size: 12px; }
.item-footer { display: flex; justify-content: space-between; align-items: center; min-height: 36px; padding: 0 20px; border-top: 1px solid #eef2ef; background: #fdfefd; }
.source-mark { display: inline-flex; align-items: center; gap: 7px; color: #88948c; font-size: 9px; }
.source-dot { width: 5px; height: 5px; box-shadow: none; }
.item-actions { display: flex; align-items: center; gap: 16px; }
.text-button, .remove-button, .frame-close { padding: 0; border: 0; background: none; color: #537563; font-size: 9px; }
.text-button:hover, .remove-button:hover, .frame-close:hover { text-decoration: underline; }
.remove-button { color: #9a7067; }
.source-frame-wrap { padding: 13px 16px 15px; border-top: 1px solid #e8eee9; background: #f8faf8; }
.frame-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: #58695f; font-size: 10px; font-weight: 700; }
.source-frame { display: block; width: 100%; height: 500px; border: 1px solid #dce5de; border-radius: 8px; background: white; }
.frame-caption { margin: 7px 0 0; color: #87938b; font-size: 9px; }
.filter-empty { padding: 30px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); text-align: center; font-size: 12px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0 26px; border-top: 1px solid #e3eae5; color: #8a968e; font-size: 9px; }
footer span:first-child { color: #62736a; font: 800 9px Manrope,sans-serif; letter-spacing: .13em; }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; padding: 12px 17px; border: 1px solid #d9e8de; border-radius: 9px; background: #fff; color: #355846; box-shadow: 0 12px 32px rgba(20,45,31,.14); font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(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; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rotate { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .app-shell { padding: 0 19px; }
  .topbar { height: 66px; }
  .intro { display: block; padding: 36px 0 23px; }
  .intro-note { max-width: none; margin-top: 19px; }
  .entry-card { padding: 19px 17px 16px; }
  #entry-form { grid-template-columns: minmax(0,1.45fr) minmax(112px,1fr); }
  .input-wrap { grid-column: 1; }
  .size-field { grid-column: 2; }
  .qty-field { grid-column: 1; width: 90px; }
  .button-primary { grid-column: 2; min-width: 0; width: 100%; padding: 0 7px; gap: 7px; font-size: 11px; line-height: 1; white-space: nowrap; }
  .button-label-full { display: none; }
  .button-label-mobile { display: inline; }
  .summary-strip { display: block; padding: 16px; }
  .summary-metrics { justify-content: space-between; gap: 9px; margin-top: 15px; }
  .summary-metrics > div { gap: 5px; }
  .summary-metrics strong { font-size: 18px; }
  .summary-metrics span { font-size: 9px; }
  .list-heading { display: block; }
  .list-actions { margin-top: 13px; }
  .search-wrap { flex: 1; width: auto; }
  .item-main { grid-template-columns: 70px minmax(0,1fr); gap: 13px; padding: 15px; }
  .item-photo { width: 70px; height: 70px; }
  .item-details h3 { font-size: 13px; }
  .item-size-meta { flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 10px; }
  .item-size-meta .meta-label { font-size: 9px; }
  .item-size-meta .field-value { min-height: 27px; padding: 4px 10px; font-size: 13px; }
  .item-controls { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid #edf1ee; }
  .item-controls .qty-label { display: none; }
  .item-footer { padding: 0 15px; }
  .empty-state { min-height: 190px; }
  .source-frame-wrap { padding: 11px; }
  .source-frame { height: 430px; }
  footer { flex-direction: column; gap: 7px; }
}
@media (max-width: 390px) {
  .session-indicator { font-size: 10px; }
  .item-topline { gap: 5px; }
  .status-pill { font-size: 8px; }
  .summary-metrics span { font-size: 8px; }
}
@media (max-width: 350px) {
  #entry-form { grid-template-columns: minmax(0,1fr) 82px; }
  .input-wrap { grid-column: 1 / -1; }
  .size-field { grid-column: 1; }
  .qty-field { grid-column: 2; width: 82px; }
  .button-primary { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
