:root {
  color-scheme: light;
  --ink: #202826;
  --muted: #586461;
  --page: #f5f7f8;
  --white: #fff;
  --line: #dbe1e3;
  --pine: #175648;
  --pine-deep: #103e34;
  --selected: #e8f1ee;
  --price: #a74628;
  --radius: 6px;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body:has(.page-dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd { margin: 0; }
:focus-visible { outline: 2px solid #1d7664; outline-offset: 3px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clipping-path: inset(50%); clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; inset: 4px auto auto 14px; z-index: 9; background: #fff; color: var(--pine); padding: 8px; }
.frame { width: min(1392px, calc(100% - 64px)); margin-inline: auto; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 37px; padding: 7px 13px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 650; background: var(--white); }
.button.primary { border-color: var(--pine); background: var(--pine); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--pine-deep); }
.button.secondary { color: var(--pine); border-color: #9fb8af; }
.button.secondary:hover:not(:disabled) { background: var(--selected); }

.masthead, .page-top { background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { min-height: 76px; display: grid; grid-template-columns: minmax(164px, 1fr) minmax(290px, 1.72fr) minmax(max-content, 1fr); align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; font-size: 23px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.brand img { flex: none; border-radius: 8px; }
.search { display: flex; position: relative; min-width: 0; height: 43px; border: 1px solid #acb8b7; border-radius: var(--radius); }
.search input { flex: 1; min-width: 0; background: var(--white); border: 0; border-radius: inherit; padding: 0 12px 0 38px; }
.search button { border: 0; margin: -1px; padding: 0 22px; border-radius: 0 6px 6px 0; background: var(--pine); color: #fff; font-weight: 700; white-space: nowrap; }
.search button:hover { background: var(--pine-deep); }
.search-icon { position: absolute; top: 12px; left: 13px; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #687571; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; background: #687571; transform: rotate(48deg); top: 10px; left: 9px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.header-action { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 5px 0; white-space: nowrap; }
.header-action:hover { color: var(--pine); text-decoration: underline; text-underline-offset: 3px; }
.header-action.cart { border-inline: 1px solid var(--line); padding-inline: 11px; }
#cart-count { background: var(--selected); color: var(--pine); border-radius: 5px; padding: 0 5px; font-size: 11px; }
.top-nav { display: flex; align-items: stretch; gap: 23px; min-height: 45px; }
.top-nav button { padding: 0 11px; border: 0; border-bottom: 2px solid transparent; background: transparent; white-space: nowrap; }
.top-nav button[aria-pressed=true] { border-bottom-color: var(--pine); color: var(--pine); font-weight: 750; }

.market { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: start; padding-block: 25px 42px; min-height: 72vh; }
.category-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.category-panel h2 { font-size: 17px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.category-list { display: grid; }
.category-list button { position: relative; min-height: 40px; width: 100%; text-align: start; background: transparent; border: 0; border-bottom: 1px solid #e9ecee; padding: 7px 29px 7px 15px; }
.category-list button:last-child { border-bottom: 0; }
.category-list button::after { position: absolute; content: ""; right: 16px; top: 50%; transform: translateY(-50%) rotate(-45deg); width: 6px; height: 6px; border: solid #76827e; border-width: 0 1.5px 1.5px 0; }
.category-list button:hover, .category-list button[aria-pressed=true] { color: var(--pine); background: var(--selected); }
.category-list button[aria-pressed=true] { font-weight: 700; box-shadow: inset 2px 0 var(--pine); }
.catalog { min-width: 0; scroll-margin-top: 10px; }
.catalog-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; margin-bottom: 13px; }
.catalog-title h1, .dialog-page h1 { font-size: 26px; line-height: 1.35; font-weight: 800; overflow-wrap: anywhere; }
#catalog-search-label { color: var(--muted); overflow-wrap: anywhere; }
.breadcrumbs { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.catalog-title .breadcrumbs { flex-basis: 100%; margin-bottom: 5px; }
.market-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 44px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.market-shortcuts button { border: 0; border-bottom: 2px solid transparent; min-height: 43px; background: transparent; font-weight: 650; }
.market-shortcuts button + button { border-inline-start: 1px solid var(--line); }
.market-shortcuts button:hover, .market-shortcuts button[aria-pressed=true] { background: var(--selected); color: var(--pine); border-bottom-color: var(--pine); }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; padding: 11px 13px; margin-bottom: 17px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.filter-categories { grid-column: 1 / -1; }
.filter-label, .filter-select { font-size: 13px; white-space: nowrap; }
.filter-label { align-self: start; padding-top: 4px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.filter-options button { min-height: 28px; border: 1px solid var(--line); border-radius: 5px; padding: 3px 10px; background: #f9fafb; line-height: 1.35; font-size: 12px; }
.filter-options button:hover { border-color: #9fb8af; }
.filter-options button[aria-pressed=true] { background: var(--pine); border-color: var(--pine); color: #fff; font-weight: 650; }
.filter-select { display: flex; align-items: center; gap: 5px; }
.filters select { border-radius: 5px; min-height: 30px; border: 1px solid var(--line); padding: 3px 5px; background-color: var(--white); }
.filter-tools { justify-content: end; align-self: start; }
.mobile-format { display: none; }
.layout-switch { display: inline-flex; gap: 2px; }
.layout-switch button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 5px; background: var(--white); color: var(--muted); }
.layout-switch button[aria-pressed=true] { background: var(--selected); color: var(--pine); }
.layout-switch button:hover { border-color: #9fb8af; }
.list-icon, .grid-icon { display: block; width: 13px; height: 13px; }
.list-icon { background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 5px); }
.grid-icon { background: linear-gradient(currentColor 0 0) 0 0, linear-gradient(currentColor 0 0) 100% 0, linear-gradient(currentColor 0 0) 0 100%, linear-gradient(currentColor 0 0) 100% 100%; background-repeat: no-repeat; background-size: 5px 5px; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.product-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 9px; background: var(--white); display: flex; flex-direction: column; }
.product-card:hover { border-color: #aabeb6; }
.product-thumb { display: grid; width: 100%; aspect-ratio: 1.85; overflow: hidden; padding: 0; background: #f6f8f9; border: 1px solid #e0e5e7; border-radius: 5px; }
.product-thumb > * { min-width: 0; min-height: 0; }
.product-image { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product-info { padding: 9px 3px 2px; min-width: 0; display: flex; flex-direction: column; flex: 1; }
.product-heading { line-height: 1.35; font-size: 15px; }
.product-name, .bag-product-name { border: 0; background: transparent; padding: 0; font-weight: 700; text-align: start; overflow-wrap: anywhere; }
.product-name:hover, button.bag-product-name:hover { color: var(--pine); text-decoration: underline; text-underline-offset: 3px; }
.product-formats, .product-summary { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.product-summary { display: none; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: auto; padding-top: 10px; }
.product-price { color: var(--price); font-size: 17px; font-weight: 750; white-space: nowrap; }
.product-price.is-free { color: var(--pine); }
.product-price.is-preview { color: var(--muted); font-size: 13px; }
.product-actions { display: flex; align-items: center; gap: 5px; }
.product-save, .product-action { min-height: 30px; padding: 3px 8px; line-height: 1.25; border: 1px solid #cddad5; border-radius: 5px; color: var(--pine); background: var(--white); font-size: 12px; white-space: nowrap; }
.product-save { min-width: 29px; padding-inline: 4px; font-size: 17px; }
.product-save:hover, .product-save[aria-pressed=true] { background: var(--selected); }
.product-action { display: inline-flex; align-items: center; justify-content: center; border-color: var(--pine); background: var(--pine); color: #fff; }
.product-action:hover { background: var(--pine-deep); }
.list-view { grid-template-columns: minmax(0, 1fr); }
.list-view .product-card { display: grid; grid-template-columns: minmax(150px, 27%) minmax(0, 1fr); align-items: stretch; gap: 17px; padding: 12px; }
.list-view .product-thumb { align-self: start; }
.list-view .product-info { padding: 4px 6px; }
.list-view .product-heading { font-size: 19px; }
.list-view .product-summary { display: block; margin-block: 5px 1px; font-size: 13px; }
.list-view .product-formats { width: fit-content; color: var(--pine); border-radius: 4px; background: var(--selected); padding: 1px 6px; }

.product-visual { display: grid; place-items: center; align-content: center; min-height: 0; overflow: hidden; background: #eef2f4; }
.preview-network { position: relative; width: min(78%, 280px); display: grid; grid-template-columns: 1fr 1fr; place-items: center; column-gap: 9px; row-gap: 14px; color: #29465a; font-size: 11px; }
.preview-network > span { padding: 3px 5px; white-space: nowrap; border: 1px solid #9aafbf; border-radius: 4px; background: #fff; z-index: 1; }
.preview-network-core { grid-column: 1 / -1; }
.preview-network-line { position: absolute; width: 50%; height: 23px; top: 19px; left: 25%; border: 1px solid #7f99ad; border-bottom: 0; }
.preview-document { display: grid; justify-items: center; gap: 7px; color: #516361; font-size: 11px; }
.document-icon { background: #fff; display: grid; place-items: center; width: 49px; min-height: 50px; border: 1px solid #9dafaa; border-top: 4px solid var(--pine); border-radius: 4px; color: var(--pine); font-weight: 700; }
.empty-state { display: grid; place-items: center; align-content: center; min-height: 130px; gap: 8px; padding: 14px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--muted); }
.site-footer { background: var(--white); border-top: 1px solid var(--line); color: var(--muted); }
.site-footer .frame { display: flex; justify-content: space-between; gap: 10px; padding-block: 14px; font-size: 12px; }
.mobile-nav { display: none; }

.shop-dialog { color: var(--ink); background: var(--page); }
.shop-dialog::backdrop { background: #20332a77; }
.page-dialog { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: auto; }
.page-top .frame { min-height: 63px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.page-top .brand { font-size: 19px; gap: 7px; }
.back-link { background: transparent; border: 0; padding: 7px 0; color: var(--pine); white-space: nowrap; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.dialog-page { padding-block: 19px 36px; }
.dialog-page > .breadcrumbs, .dialog-page > h1 { margin-bottom: 13px; }
.detail-layout, .bag-layout { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(275px, 1fr); gap: 14px; }
.detail-layout:has(.detail-gallery[hidden]) { grid-template-columns: minmax(0, 1fr); }
.detail-gallery, .detail-body, .detail-description, .commerce-panel, .auth-panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; }
.detail-media { display: grid; overflow: hidden; aspect-ratio: 1.95; background: #f3f5f6; border: 1px solid var(--line); border-radius: 5px; }
.detail-media > * { min-width: 0; min-height: 0; }
.detail-media.drawing-stage { display: block; overflow: auto; background: #fff; }
.drawing-stage .drawing-sheet { width: 100%; max-width: none; height: 100%; object-fit: contain; }
.drawing-stage .drawing-unavailable { min-height: 100%; display: grid; place-items: center; color: var(--muted); }
.drawing-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; margin-top: 9px; }
.drawing-tools > p { color: var(--muted); overflow-wrap: anywhere; }
.drawing-tools > div { display: flex; flex-wrap: wrap; gap: 4px; }
.drawing-tools .button { min-height: 34px; min-width: 33px; padding: 4px 8px; }
.gallery-options.drawing-thumbnails button { display: grid; justify-items: center; align-content: start; width: 100px; max-width: 28%; font-size: 11px; gap: 3px; padding: 4px; overflow-wrap: anywhere; }
.drawing-thumbnails img { width: 100%; height: 47px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 3px; }
.product-card .drawing-count { align-self: start; padding: 2px 5px; background: var(--selected); color: var(--pine); border-radius: 3px; font-size: 11px; margin-top: 4px; }
.exhibit-view .product-thumb { aspect-ratio: 1.5; }
.product-grid.exhibit-view:not(.list-view) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); }
.exhibit-view:not(.list-view) .product-card { max-width: 650px; }
.detail-media .preview-network { font-size: 14px; }
.detail-file-preview { display: grid; align-content: center; justify-items: start; gap: 12px; padding: 24px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.gallery-options { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.gallery-options button { min-height: 34px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.gallery-options button[aria-pressed=true] { border-color: var(--pine); color: var(--pine); background: var(--selected); font-weight: 650; }
.detail-body { display: flex; flex-direction: column; align-self: start; gap: 9px; padding: 19px; }
.detail-body p { color: var(--muted); overflow-wrap: anywhere; }
.detail-price { font-size: 26px; color: var(--price); }
.detail-price.is-free { color: var(--pine); }
.detail-price.is-preview { font-size: 17px; color: var(--muted); }
.detail-fields { border-top: 1px solid var(--line); margin-bottom: 6px; font-size: 13px; }
.detail-fields > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.detail-fields dt { color: var(--muted); }
.detail-fields dd { overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-actions .is-in-cart, #detail-save.is-saved { background: var(--selected); }
.detail-description { margin-top: 14px; padding-top: 0; }
.detail-tabs { display: flex; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--line); }
.detail-tabs button { border: 0; border-bottom: 2px solid transparent; min-height: 41px; padding: 6px 7px; background: transparent; }
.detail-tabs button[aria-pressed=true] { border-bottom-color: var(--pine); color: var(--pine); font-weight: 700; }
#detail-content { padding-top: 11px; min-height: 55px; white-space: pre-wrap; overflow-wrap: anywhere; }
.product-page { max-width: 1260px; min-height: calc(100vh - 124px); }
.product-page .breadcrumbs a { color: var(--pine); }
.product-page .breadcrumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.product-page-heading { margin-bottom: 16px; }
.product-page-heading h1 { line-height: 1.25; font-size: clamp(23px, 2.6vw, 32px); overflow-wrap: anywhere; }
.product-page-heading p { margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }
.product-page-layout { grid-template-columns: minmax(0, 1.72fr) minmax(300px, 1fr); }
.product-buy-panel .detail-fields > div { grid-template-columns: 89px minmax(0, 1fr); }
.product-compatibility { white-space: pre-line; overflow-wrap: anywhere; }
.product-delivery { padding: 17px 20px; }
.product-delivery h2 { font-size: 17px; }
.product-delivery ul { margin: 8px 0 0; padding-inline-start: 21px; overflow-wrap: anywhere; }
.product-delivery li + li { margin-top: 4px; }
.product-delivery p { margin-top: 7px; }
.product-delivery h2:not(:first-child) { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); }
.bag-layout { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: start; }
.bag-layout.is-saved-layout { grid-template-columns: minmax(0, 1fr); }
.bag-main { display: grid; gap: 12px; }
.commerce-panel h2 { font-size: 15px; margin-bottom: 9px; }
.bag-items { display: grid; }
.bag-row { display: flex; align-items: center; gap: 11px; min-height: 63px; padding: 10px 0; border-top: 1px solid var(--line); }
.bag-row:first-child { border-top: 0; }
.bag-row + .bag-row { margin-top: 2px; }
.bag-thumb { flex: 0 0 72px; width: 72px; height: 43px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; pointer-events: none; }
.bag-thumb.product-visual { padding: 0; }
.bag-thumb .preview-document, .bag-thumb .preview-network { transform: scale(.64); }
.bag-row-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bag-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.bag-row-price { color: var(--price); font-weight: 650; white-space: nowrap; }
.bag-product-meta, .bag-order-note, .bag-empty { color: var(--muted); font-size: 12px; }
.bag-row-actions button, .bag-download { background: #fff; border: 1px solid #a6bcb3; color: var(--pine); min-height: 33px; padding: 4px 8px; border-radius: 5px; white-space: nowrap; }
.bag-download { display: inline-flex; align-items: center; }
.bag-row-actions button:hover, .bag-download:hover { background: var(--selected); }
.bag-footer strong { display: block; padding-block: 7px 11px; color: var(--price); font-size: 20px; border-top: 1px solid var(--line); }
.bag-footer-actions { display: grid; gap: 7px; }
.payment-icon { display: inline-block; width: 12px; height: 12px; margin-right: 7px; border-radius: 50%; border: 3px solid var(--pine); }
.library-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin-bottom: 13px; }
.order-center { max-width: 1050px; }
.orders-heading, .order-card-heading, .order-card-footer, .order-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.orders-heading > div { display: flex; flex-wrap: wrap; gap: 6px; }
.order-filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; border-bottom: 1px solid var(--line); }
.order-filters button { min-height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 6px 12px; }
.order-filters button[aria-pressed=true] { color: var(--pine); font-weight: 700; border-bottom-color: var(--pine); }
.order-list { display: grid; gap: 11px; margin-top: 10px; }
.order-card { min-width: 0; }
.order-card .bag-items { margin-block: 7px; }
.order-card-heading, .order-card-footer { padding-block: 5px 9px; }
.order-card-footer { border-top: 1px solid var(--line); padding-top: 10px; }
.order-reference, .order-muted { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.order-badge { padding: 3px 8px; border-radius: 4px; background: var(--selected); color: var(--pine); }
.order-badge[data-status=pending], .order-badge[data-status=refund_pending] { color: #874620; background: #fcf1e5; }
.order-badge[data-status=refunded] { background: var(--page); color: var(--muted); }
.order-refund-status { display: grid; gap: 4px; margin: 4px 0 10px; padding: 9px 11px; background: var(--page); overflow-wrap: anywhere; }
.order-refund-status p, .refund-reason { white-space: pre-wrap; overflow-wrap: anywhere; }
.order-refund-form { max-width: 100%; }
.order-refund-form[open] { width: 100%; }
.order-refund-form summary { cursor: pointer; }
.order-refund-form form, .admin-refund-form { display: grid; gap: 8px; justify-items: start; margin-top: 9px; }
.order-refund-form label, .admin-refund-form label { display: grid; gap: 4px; width: 100%; }
.order-refund-form textarea, .admin-refund-form textarea { width: 100%; padding: 7px 9px; font: inherit; border: 1px solid #9fb8af; border-radius: var(--radius); resize: vertical; }
.order-pagination { justify-content: center; margin-top: 12px; }
.account-label, .form-feedback { color: var(--muted); overflow-wrap: anywhere; }
#library-retry { margin-top: 9px; }
.auth-panel { width: min(100%, 430px); margin: 32px auto; padding: 23px 24px; }
.auth-panel h1 { margin-bottom: 19px; text-align: center; }
.auth-form { display: grid; gap: 7px; }
.auth-form label { font-weight: 650; font-size: 13px; }
.auth-form input { width: 100%; min-height: 40px; border: 1px solid #b3bfbd; border-radius: 5px; padding: 7px 10px; background: var(--white); }
.auth-form input + label { margin-top: 6px; }
.password-field { position: relative; }
.password-field input { padding-right: 57px; }
.password-field button { position: absolute; inset: 1px 1px 1px auto; padding: 0 10px; background: var(--white); color: var(--pine); border: 0; border-radius: 5px; }
.auth-form .primary { margin-top: 10px; }
.auth-switch-row { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 12px; color: var(--muted); font-size: 13px; }
.auth-switch { border: 0; background: transparent; min-height: 32px; color: var(--pine); padding-inline: 4px; font-weight: 650; }
.auth-switch:hover { text-decoration: underline; }
#auth-error { color: var(--price); }
.toast { position: fixed; z-index: 8; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); background: var(--pine-deep); color: #fff; border-radius: 5px; padding: 7px 12px; text-align: center; }
dialog .toast { width: max-content; }

@media (max-width: 1220px) {
  .frame { width: calc(100% - 40px); }
  .header-row { gap: 13px; }
  .header-actions { gap: 8px; }
  .market { grid-template-columns: 166px minmax(0, 1fr); gap: 15px; }
  .filters { grid-template-columns: 1fr; }
  .filter-tools { justify-content: start; }
  .layout-switch { margin-inline-start: auto; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid.list-view { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 850px) {
  .header-row { grid-template-columns: minmax(145px, 1fr) auto; gap: 8px 12px; padding-block: 10px 6px; }
  .search { grid-row: 2; grid-column: 1/-1; }
  .market { grid-template-columns: 144px minmax(0, 1fr); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .list-view .product-card { gap: 10px; grid-template-columns: minmax(115px, 30%) minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .frame { width: calc(100% - 24px); }
  .header-row { min-height: auto; grid-template-columns: minmax(0, 1fr) auto; }
  .brand { font-size: 20px; gap: 8px; }
  .brand img { width: 33px; height: 33px; }
  .header-action { font-size: 12px; }
  .header-action.cart { padding-inline: 6px; border: none; }
  #login-open, #library-open, #orders-open { display: none; }
  .search { height: 38px; }
  .search button { padding-inline: 15px; }
  .search-icon { top: 10px; }
  .top-nav { min-height: 40px; gap: 9px; }
  .top-nav button { padding-inline: 7px; font-size: 13px; }
  .market { display: block; min-height: 0; padding-block: 12px 28px; }
  .category-panel { margin-bottom: 13px; scroll-margin-top: 8px; }
  .category-panel h2 { display: none; }
  .category-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #category-list button[data-category=all] { display: none; }
  .category-list button { text-align: center; min-height: 36px; padding: 5px 3px; font-size: 12px; border-bottom: 0; }
  .category-list button::after { display: none; }
  .category-list button[aria-pressed=true] { box-shadow: inset 0 -2px var(--pine); }
  .catalog-title { margin-bottom: 9px; }
  .catalog-title h1, .dialog-page h1 { font-size: 21px; }
  #catalog-search-label { font-size: 12px; }
  .market-shortcuts { display: none; }
  .filters { padding: 7px; gap: 6px; grid-template-columns: auto minmax(0, 1fr); margin-bottom: 9px; }
  .filter-options, .filter-categories { display: none; }
  .mobile-format { display: block; max-width: 97px; }
  .filter-label, .filter-select { font-size: 12px; }
  .filter-row { gap: 4px; }
  .sort-control { margin-inline-start: auto; }
  .filter-tools { align-self: center; gap: 5px; }
  .filters select { font-size: 12px; max-width: 96px; padding-inline: 2px; }
  .layout-switch { display: none; }
  .product-card { padding: 6px; }
  .product-info { padding-inline: 1px; }
  .product-heading { font-size: 13px; }
  .product-thumb { aspect-ratio: 1.44; }
  .product-grid.exhibit-view:not(.list-view) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); }
  .product-price { font-size: 15px; }
  .product-price.is-preview { font-size: 12px; }
  .product-footer { flex-wrap: wrap; gap: 3px; }
  .product-actions { margin-left: auto; gap: 3px; }
  .product-save { min-width: 24px; }
  .product-action { padding-inline: 5px; }
  .product-formats { font-size: 11px; }
  .list-view .product-card { padding: 6px; grid-template-columns: minmax(91px, 31%) minmax(0, 1fr); }
  .list-view .product-info { padding-block: 0; }
  .list-view .product-heading { font-size: 14px; }
  .list-view .product-summary { font-size: 12px; }
  .site-footer { padding-bottom: calc(46px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 5; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); }
  .mobile-nav button { border: 0; position: relative; min-height: 44px; background: transparent; font-size: 12px; white-space: nowrap; }
  .mobile-nav button[aria-pressed=true] { color: var(--pine); font-weight: 750; }
  #mobile-cart-count:not(:empty) { margin-inline-start: 3px; color: var(--pine); font-weight: 700; }
  .toast { bottom: calc(51px + env(safe-area-inset-bottom)); }
  .page-top .frame { min-height: 52px; }
  .page-top .brand { font-size: 16px; }
  .page-top .brand img { width: 27px; height: 27px; }
  .back-link { font-size: 12px; }
  .dialog-page { padding-block: 12px 27px; }
  .detail-layout, .bag-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .detail-gallery, .detail-body, .detail-description, .commerce-panel { padding: 10px; }
  .detail-media { aspect-ratio: 1.65; }
  .drawing-tools > p { flex-basis: 100%; }
  .detail-dialog .dialog-page { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .detail-actions { position: fixed; inset: auto 0 0; background: var(--white); border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); z-index: 2; }
  #detail-primary, #detail-add { flex: 1; min-height: 39px; padding-inline: 6px; }
  .product-page-top #login-open, .product-page-top #orders-open { display: inline-flex; }
  .product-page-top .header-actions { gap: 6px; }
  .product-page-top .header-action { min-height: 44px; }
  .product-page .detail-actions { position: static; border: 0; padding: 0; }
  .product-page .detail-actions .button, .product-page .drawing-tools .button { min-height: 44px; }
  .product-page .drawing-thumbnails { flex-wrap: nowrap; overflow-x: auto; padding: 3px; }
  .product-page .drawing-thumbnails button { flex: 0 0 92px; max-width: none; }
  .product-page-footer { padding-bottom: 16px; }
  dialog.detail-dialog .toast { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .bag-thumb { flex-basis: 50px; width: 50px; }
  .bag-row { gap: 7px; }
  .order-center .button, .order-center .bag-download, .order-center .order-filters button { min-height: 44px; }
  .auth-panel { margin: 20px auto; padding: 18px; }
}
@media (max-width: 370px) {
  .filter-row:first-of-type + .filter-row .filter-label { position: absolute; clip-path: inset(50%); }
  .filter-select { gap: 2px; }
  .filters select { max-width: 82px; }
  .product-save { display: none; }
}
