:root { color-scheme: light; font: 16px/1.5 Inter, system-ui, sans-serif; color: #191a17; background: #f5f4ef; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { background: #292522; color: #fff; }
.shell { width: min(94%, 1120px); margin-inline: auto; }
.header { display: flex; gap: 16px; align-items: center; min-height: 62px; }
.brand { letter-spacing: .08em; }
.test { border: 1px solid #d2c28b; color: #f5db8d; padding: 2px 8px; font-size: .8rem; border-radius: 4px; }
.header a { margin-left: auto; color: inherit; }
h1, h2 { font-family: Georgia, serif; font-weight: normal; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(2rem, 6vw, 3.3rem); margin-block: 2rem 1rem; }
h2 { font-size: 1.65rem; margin-bottom: .7rem; }
main { padding-bottom: 2rem; }
.panel, dialog { background: #fff; border: 1px solid #d8d7cb; border-radius: 12px; padding: clamp(14px, 3vw, 26px); }
.panel { margin-block: 16px; }
.narrow, dialog { width: min(100%, 430px); }
dialog { width: min(94%, 430px); }
dialog::backdrop { background: #29252288; }
label { display: grid; gap: 4px; font-size: .88rem; }
.narrow label, dialog label { margin-bottom: 12px; }
input, select, button { font: inherit; padding: 7px 12px; border: 1px solid #77796d; border-radius: 6px; min-height: 44px; background: #fff; color: inherit; }
input { width: 100%; }
button { background: #302c29; color: #fff; cursor: pointer; }
button.secondary { background: #fff; color: #302c29; }
button:disabled { opacity: .6; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #747940; outline-offset: 2px; }
.muted { color: #4b4e43; }
#notice[data-error], #edit-error { color: #902d20; }
.toolbar, .panel-heading, #search, .paging, .actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
#logout, .panel-heading form { margin-left: auto; }
.paging { margin-top: 12px; align-items: center; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid #e0e0d7; }
td { font-size: .9rem; font-variant-numeric: tabular-nums; }
td small { display: block; }
#audit, #weekly-items { list-style: none; padding: 0; margin: 0; }
#audit li, #weekly-items li { padding: 8px 0; border-top: 1px solid #e0e0d7; overflow-wrap: anywhere; }
#audit li p { margin: 4px 0; }
@media (max-width: 550px) {
  .panel-heading form { margin-left: 0; }
  th, td { padding-right: 8px; }
  td button { min-width: 100px; }
}
.barcode-action { margin-top: 4px; }
#barcode-error { color: #902d20; }
#label { padding: 12px; margin-top: 12px; border: 1px solid #77796d; color: #000; background: #fff; text-align: center; }
#label p { margin: 3px; }
#label-bars { display: block; max-width: 100%; margin: auto; }
#label-code { font: .85rem ui-monospace, monospace; letter-spacing: .06em; }
@media print {
  body > :not(#barcode-dialog), #barcode-dialog > :not(#label) { display: none !important; }
  #barcode-dialog { position: static; width: 100%; max-width: none; padding: 0; margin: 0; border: 0; }
  #barcode-dialog::backdrop { display: none; }
  #label { margin: 0; display: inline-block; break-inside: avoid; min-width: 65mm; max-width: 120mm; }
  #label-bars { width: 100%; }
}
.languages { display: flex; gap: 3px; }
.languages button { min-height: 34px; padding: 4px 7px; background: transparent; color: #fff; }
.languages button[aria-pressed="true"] { background: #e6d7a7; color: #292522; }
@media (max-width: 420px) {
  .header { gap: 8px; font-size: .85rem; }
  .header a { text-align: center; }
}
@media (max-width: 550px) {
  .table-scroll { overflow: visible; }
  table, tbody { display: block; }
  thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #e0e0d7; border-radius: 8px; margin-block: 10px; padding: 10px; }
  td { display: block; padding: 4px; border: 0; overflow-wrap: anywhere; }
  td:is(:first-child, :nth-child(2), :last-child) { grid-column: 1 / -1; }
  td:first-child { font-weight: 600; }
  td:not(:first-child, :last-child)::before { display: block; color: #4b4e43; font-size: .75rem; content: attr(data-label); }
  td:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
  .barcode-action { margin-top: 0; }
}
#search label { min-width: 0; }
@media (max-width: 550px) {
  #search { width: 100%; flex-wrap: nowrap; }
  #search label { flex: 1; }
}

.planning-cards {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:.65rem;list-style:none;margin:.55rem 0;padding:0}
.planning-cards > * {border:1px solid #d9d1c5;padding:.75rem;border-radius:6px}
.planning-cards p {margin:.4rem 0}

.hq-tools {display:flex;gap:.5rem;flex-wrap:wrap;margin-block:1rem}
.hq-tools a {padding:.65rem 1rem;border-radius:6px;background:#fff;border:1px solid #c8c1b8;color:#302c29;text-decoration:none;font-weight:560}
.hq-tools a:focus-visible,.hq-tools a:hover {background:#eae5de}

@media screen {
  main.shell .store-header {background:transparent;color:#302c29;padding:0}
  .store-header .languages {margin-left:auto}
  .store-header .languages button {color:#302c29;border-color:#cdc6bd}
  .store-header .languages button[aria-pressed=true] {background:#e0dad2}
  body:has(#desktop-menu) #hq-tools {display:none}
  .shell > h1,.shell > h2 {margin:1.2rem 0;font:500 1.65rem Georgia,serif}
  .shell .panel {border-color:#ded9d2;border-radius:10px}
  .shell #desktop-menu {z-index:5}
}
@media screen {
  main.shell:has(> #desktop-menu) {width:auto;max-width:none;margin:0 0 0 var(--rail)}
}

@media screen {#desktop-menu[aria-label='Inventory HQ'] {overflow-y:auto} #desktop-menu [hidden] {display:none!important}}
@media screen {
  body:not(.hq-authenticated) main.shell {width:auto;max-width:none;margin:0;min-height:100dvh}
  body:not(.hq-authenticated) main.shell:has(> #desktop-menu) {margin:0}
  body:not(.hq-authenticated) #desktop-menu {display:none!important}
  body:not(.hq-authenticated) main.shell:not(:has(#workspace)) > :not(header):not(nav) {visibility:hidden}
  .shell #login {margin:clamp(36px,10vh,100px) auto;background:white;padding:32px;border-radius:12px;box-shadow:0 8px 32px #51403209}
  #login button {width:100%}
  #notice:empty {margin:0}
  .inventory-heading,.stock-toolbar {display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
  .inventory-heading {margin:24px 0 16px}
  .inventory-heading h2 {margin:0;font:400 clamp(1.85rem,3vw,2.65rem)/1.1 Georgia,serif;letter-spacing:-.04em}
  #store-links,#definitions {position:relative}
  #store-links summary,#definitions summary {font:500 13px/1.5 system-ui;cursor:pointer}
  #store-links summary {border:1px solid #c9c2ba;background:white;border-radius:7px;padding:8px 13px}
  #definitions summary {color:#504a43;padding:6px 0}
  #store-links ul,#definitions dl {position:absolute;top:100%;right:0;background:white;z-index:3;border:1px solid #cfcbc4;box-shadow:0 10px 24px #30282014;border-radius:8px;margin:6px 0;min-width:230px;padding:12px}
  #store-links ul {list-style:none}
  #store-links li {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 4px;font-size:.88rem}
  #store-links small {color:#68605a} #store-links a {color:#2d2925}
  #definitions dl {width:min(265px,75vw);font-size:.85rem;line-height:1.4} #definitions dt {font-weight:650}
  #definitions dd {margin:0 0 7px} #definitions dd:last-child {margin-bottom:0}
  #location-tabs {display:flex;flex-wrap:wrap;gap:5px;margin:0 0 18px}
  #location-tabs button {background:#fff;color:#38312c;border:1px solid #d4cdc4;padding:6px 11px;font:500 .83rem/1.25 system-ui;min-height:34px;border-radius:6px}
  #location-tabs button[aria-pressed=true] {background:#302c29;color:#fff;border-color:#302c29}
  #location-stock {margin:0;padding:clamp(12px,2vw,24px)}
  .stock-toolbar #search {align-items:center;gap:6px}
  .stock-toolbar #search input {min-width:min(280px,42vw);min-height:38px}
  .stock-toolbar #search button {min-height:38px}
  .visually-hidden {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .stock-quantities {display:flex;flex-wrap:wrap;gap:clamp(18px,4vw,64px);padding:14px 0;border-bottom:1px solid #dad5ce}
  .stock-quantities div {display:grid;gap:1px}
  .stock-quantities span {font-size:.78rem;color:#675d54}
  .stock-quantities strong {font-size:1.35rem;line-height:1.2;font-weight:550;font-variant-numeric:tabular-nums}
  #location-stock th {font-size:.8rem;color:#544b43;font-weight:600}
  #location-stock td {padding-block:8px}
  #location-stock td:first-child {font-weight:600}
  #location-stock td small {font-weight:400;color:#685f56}
  #stock .secondary {min-height:32px;padding:4px 10px}
  #stock td:nth-child(3) {max-width:240px;overflow-wrap:anywhere;font-size:.78rem;color:#655d56}
  #prompt-settings {max-width:680px}
  #prompt-settings fieldset {border:0;padding:0;margin:0;min-width:0}
  #prompt-settings legend {font:400 1.45rem Georgia,serif;padding:0}
  #prompt-settings label {display:flex;align-items:center;justify-content:space-between;flex-direction:row-reverse;gap:16px;padding:15px 0;border-bottom:1px solid #ece8e2;font-size:.95rem}
  #prompt-settings input[type=checkbox] {width:20px;height:20px;min-height:20px;flex:none;accent-color:#302c29}
  #prompt-settings button {margin-top:16px}
  @media(min-width:701px) {
    #location-stock :is(td,th):is(:nth-child(4),:nth-child(5),:nth-child(6)) {text-align:right;padding-right:24px}
    #location-stock tr:hover td {background:#faf8f5}
  }
  @media(max-width:700px){
    #location-tabs {flex-wrap:nowrap;overflow-x:auto;padding-bottom:5px}
    #location-tabs button {flex:none}
    .stock-toolbar {gap:4px} .stock-toolbar #search {width:100%}
    .stock-toolbar #search label {flex:1} .stock-toolbar #search input {min-width:0}
    #definitions dl {left:0;right:auto}
  }
  @media(max-width:550px){
    #stock td:nth-child(3) {grid-column:1 / -1;max-width:none}
    #stock td:nth-child(3)::before {display:none}
    .stock-quantities {gap:18px} .stock-quantities strong {font-size:1.12rem}
  }
}
@media screen and (max-width:600px){
  main.shell .store-header {gap:8px;height:auto;min-height:42px;flex-wrap:wrap}
  main.shell .store-header .shop-title img {width:104px}
  main.shell .store-header .shop-title span {font-size:13px;letter-spacing:.02em}
  .store-header .languages button {padding:3px 5px}
}
