@media screen {
  /* Editorial hierarchy sits above the existing operational controls. */
  main { padding-bottom: 48px; }
  .page-title { font: 600 clamp(29px, 3vw, 43px)/1.05 var(--brand-serif); letter-spacing: -.025em; text-transform: none; color: var(--ink); margin: 2px 0 20px; }
  .page-title:before { width: 3px; height: 28px; background: var(--selvage); }
  .page-title:after { border-color: var(--line2); }
  .hero-title { font: 600 clamp(40px, 4vw, 55px)/1 var(--brand-serif); letter-spacing: -.025em; }
  .hero-kicker { font: 700 11px/1.4 'Inter',system-ui,sans-serif; letter-spacing: .18em; color: #755c2c; }
  .home-hero { background: #f7f2e8; border-color: var(--line2); box-shadow: none; border-radius: 16px; padding: 26px; }
  .home-hero:after { opacity: .055; }
  .workroom-stats { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
  .workroom-stats .stat { text-align: left; min-width: 0; min-height: 118px; padding: 18px; }
  .workroom-stats button.stat { cursor: pointer; }
  .workroom-stats .n { font: 600 clamp(23px,2.2vw,32px)/1.1 'Inter',system-ui,sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.04em; overflow-wrap: anywhere; }
  .workroom-stats .l { font: 700 11px/1.35 'Inter',system-ui,sans-serif; letter-spacing: .07em; margin-top: 8px; }
  .workroom-stats .stat-alert { background: #f9ece7; border-color: #e8c9be; color: #863d32; }
  .workroom-stats .stat-alert .l { color: #863d32; }
  .workroom-stats .stat-breakdown .sm { margin-top: 8px; }
  .workroom-actions { margin-top: 16px; }
  .workroom-main-actions,.workroom-more-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .workroom-main-actions .btn:first-child { background: #a78548; color: #fff; }
  .workroom-more { margin-top: 10px; }
  .workroom-more summary { width: fit-content; min-height: 38px; display: flex; align-items: center; cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 600; }
  .workroom-more-actions { margin-top: 8px; }
  .workroom-more-actions .btn { min-width: 130px; }
  .home-receipts .receipt-row { width: 100%; text-align: left; background: none; padding-left: 26px; }
  .home-receipts .receipt-row .grow,.home-receipts .receipt-row .t,.home-receipts .receipt-row .s { display: block; }
  .receipt-more { padding: 10px 0 10px 26px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
  .home-stock-panel { border-left: 3px solid #ab7447; }
  .home-stock-panel summary { min-height: 56px; }
  .catalog-tools { margin-bottom: 12px; }
  .catalog-tools>summary { display: none; }
  .catalog-create-actions .btn:first-child { background: #a78548; }
  .catalog-tree .card { padding: 0 16px; margin-bottom: 8px; }
  .catalog-column-head { display: grid; grid-template-columns: minmax(0,1fr) 118px 118px 80px; gap: 8px; padding: 8px 18px; color: var(--ink2); font: 700 10px/1.3 system-ui,sans-serif; text-transform: uppercase; letter-spacing: .1em; }
  .catalog-column-head span:not(:first-child) { text-align: right; }
  .tree-row { min-height: 52px; }
  .tree-disclosure { width: 42px; height: 42px; border-radius: 9px; }
  .tree-details { min-height: 40px; display: inline-flex; align-items: center; font-size: 12px; }
  .tree-row .qty { font-size: 13px; }
  .tree-row[role="button"],.tree-row[role="treeitem"] { cursor: pointer; }
  .roll-list .li[role="button"],.orders-list .li[role="button"] { width: 100%; }
  .roll-list .li:hover,.orders-list .li:hover,.catalog-tree .tree-row:hover { background: #f8f4eb; }
  .roll-filters>summary,.roll-bulk>summary { display: none; }
  .catalog-tools:not([open])>summary,.roll-filters:not([open])>summary,.roll-bulk:not([open])>summary,.order-actions:not([open])>summary,.detail-actions:not([open])>summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
  .roll-bulk .roll-select-bar { position: static; }
  .roll-list .ybar { max-width: 210px; height: 6px; background: var(--line2); }
  .roll-list .li .s { font-variant-numeric: tabular-nums; }
  .orders-list .li .badge { white-space: nowrap; }
  .orders-list .li { min-height: 68px; }
  .order-actions>summary { display: none; }
  .detail-actions>summary { display: none; }
  .template-intro { display: grid; grid-template-columns: minmax(210px,34%) minmax(0,1fr); gap: 24px; align-items: start; }
  .template-intro.no-image { grid-template-columns: 1fr; }
  .template-hero-img { width: 100%; max-height: 320px; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
  .template-copy h3,.variant-intro h3 { font: 600 clamp(27px,2.8vw,39px)/1.1 var(--brand-serif); }
  .template-variants .card { margin-bottom: 8px; }
  .template-variants .card:hover { border-color: var(--selvage); background: #faf6ed; }
  .variant-hero-img { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; }
  .listing-photo-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; margin-top: 14px; }
  .listing-photo { min-width: 0; }
  .listing-photo img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
  .listing-photo .chip { margin-right: 4px; }
  .scanpane { padding: 12px; }
  .scanpane video { max-height: 58vh; }
  .scanpane.scan-unavailable video { display: none; }
  .scanpane.scan-unavailable { padding: 14px 16px; }
  .scanpane.scan-unavailable #scanmsg { margin: 0 0 10px!important; }
  .scan-retry { margin-top: 2px; }
  .scan-retry[hidden] { display: none; }
}
@media screen and (max-width: 1000px) {
  main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 35px; margin-bottom: 14px; }
  .home-hero { padding: 20px; }
  .workroom-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workroom-stats .stat { min-height: 102px; }
  .catalog-tools>summary,.roll-filters>summary,.roll-bulk>summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
  .catalog-tools>summary::-webkit-details-marker,.roll-filters>summary::-webkit-details-marker,.roll-bulk>summary::-webkit-details-marker { display: none; }
  .catalog-filter-current { color: #765c2f; font-size: 12px; }
  .catalog-create-actions { padding-bottom: 8px; }
  .catalog-tree .card { padding: 0 10px; }
  .catalog-column-head { display: none; }
  .tree-row { grid-template-columns: minmax(0,1fr) auto; min-height: 62px; }
  .tree-row>.qty:nth-child(3),.tree-row>.rollct { display: none; }
  .tree-row .qty { max-width: 115px; font-size: 12px; }
  .tree-row .name { white-space: normal; }
  .tree-row .tree-label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
  .tree-product { padding-left: 12px; }
  .tree-variant { padding-left: 24px; }
  .tree-family h3 { font-size: 16px; }
  .roll-filters .grid2 { grid-template-columns: 1fr 1fr; }
  .roll-bulk .roll-select-bar { position: static; }
  .orders-list .li { align-items: center; }
  .order-actions>summary { display: flex; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; }
  .detail-actions>summary { display: flex; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; color: var(--ink); }
  .detail-actions { margin: 5px 0 10px; }
  .template-intro { grid-template-columns: 1fr; gap: 16px; }
  .template-hero-img { max-height: 280px; aspect-ratio: 3/2; }
  .variant-hero-img { width: 110px; height: 110px; }
}
@media screen and (max-width: 640px) {
  .page-title { font-size: 32px; }
  .home-hero { padding: 17px 14px; }
  .home-dashboard .hero-title { font-size: 40px; }
  .workroom-stats .stat { padding: 13px 12px; min-height: 94px; }
  .workroom-stats .n { font-size: 21px; }
  .workroom-stats .l { font-size: 10px; }
  .workroom-main-actions .btn { flex: 1; }
  .workroom-more-actions { display: grid; grid-template-columns: 1fr; }
  .workroom-more-actions .btn { width: 100%; }
  .home-receipts .receipt-row { padding-left: 10px; }
  .catalog-tools .tabs { margin: 0 0 10px; }
  .catalog-tools .tabs button { min-height: 42px; }
  .catalog-expand-actions,.catalog-create-actions { gap: 7px; }
  .catalog-tree .card { margin: 0; border-radius: 0; border-inline: 0; box-shadow: none; background: transparent; }
  .catalog-tree .tree-row .qty { display: none; }
  .catalog-tree .tree-row { display: flex; min-height: 66px; border-color: var(--line2); }
  .catalog-tree .tree-row .name { flex: 1; min-width: 0; gap: 10px; }
  .catalog-tree .tree-row .tree-label { flex: 1; }
  .catalog-tree .tree-type { padding-left: 12px; }
  .catalog-tree .tree-product { padding-left: 24px; }
  .catalog-tree .tree-variant { padding-left: 36px; }
  .tree-details { padding-inline: 6px; }
  .roll-filters .grid2 { grid-template-columns: 1fr; }
  .roll-list .li { align-items: center; }
  .roll-list .li .grow { min-width: 0; }
  .roll-list .li .s { white-space: normal; font-size: 12px; }
  .roll-list .ybar { display: none; }
  .roll-list .variant-thumb { width: 50px; height: 50px; }
  .roll-select { width: 24px; height: 24px; margin-top: 0; }
  .orders-list .li { min-height: 76px; }
  .orders-list .li .grow { min-width: 0; }
  .orders-list .li .badge { font-size: 10px; }
  .item-primary-actions .btn,.roll-primary-actions .btn { flex: 1; }
  .template-hero-img { max-height: 220px; }
  .template-variants .card { margin-bottom: 0; border-radius: 0; border-inline: 0; box-shadow: none; padding: 12px 4px; background: transparent; }
  .template-variants .card .badge { display: none; }
  .variant-hero-img { width: 86px; height: 86px; }
  .listing-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scan-location { padding: 10px 12px; margin-bottom: 8px; }
  .scan-location .cardhead { margin-bottom: 5px; }
  .scan-location .cardhead h2 { font-size: 13px; }
  .scanpane { margin-bottom: 8px; }
  .scanpane video { aspect-ratio: 4/3!important; max-height: 37vh; }
  .scan-help { margin: 10px 0; }
  .scan-help summary { min-height: 40px; cursor: pointer; }
  .scan-help p { margin: 5px 0 12px; }
  .label-delete { width: 36px; height: 36px; }
  .label-resize { width: 26px; height: 26px; }
}
.roll-pricing-section{grid-column:1/-1;border:1px solid var(--line,#d8dfd8);border-radius:12px;padding:16px;margin:14px 0;background:var(--surface,#fffdf8)}
.roll-pricing-section h3{margin:0 0 8px;font-size:16px}.roll-pricing-section p{margin:6px 0 12px}.roll-pricing-section input{max-width:100%}
.roll-pricing-section details{margin:14px 0}.roll-pricing-section summary{min-height:44px;padding:10px 0;cursor:pointer}
.roll-pricing-help{position:relative;display:inline-block}.roll-pricing-help button{display:grid;place-items:center;min-width:44px;min-height:44px;padding:0;cursor:pointer}
.roll-pricing-help [role=tooltip]{display:none;position:absolute;z-index:5;top:100%;left:0;width:min(250px,65vw);padding:12px;border-radius:8px;background:#163b34;color:white;font-size:13px;box-shadow:0 4px 16px #0003}.roll-pricing-help.above [role=tooltip]{top:auto;bottom:100%}
.roll-pricing-help:not([data-dismissed]):hover [role=tooltip],.roll-pricing-help:not([data-dismissed]):focus-within [role=tooltip],.roll-pricing-help.open:not([data-dismissed]) [role=tooltip]{display:block}
.roll-pricing-help button:focus-visible{outline:3px solid #b18c49;outline-offset:3px}
@media(max-width:600px){.roll-pricing-section{padding:12px}.roll-pricing-section .btn{white-space:normal;min-height:44px;width:100%}}
