/* Shared touch controls and the compact mobile workspace. */
:root { --mobile-nav-height: 70px; --mobile-safe-bottom: env(safe-area-inset-bottom, 0px); }
::selection { background: #dcebe4; color: #163f37; }
input, textarea { caret-color: var(--green); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mobile-nav, .mobile-cart, .mobile-new, .mobile-browse { display: none; }
.quantity-stepper { display: flex; align-items: center; border: 1px solid #dce2d8; border-radius: 7px; overflow: hidden; background: white; margin-top: 5px; }
.quantity-stepper button { border: 0; background: #f1f5ef; color: var(--green); align-self: stretch; min-width: 25px; font-size: 18px; }
.quantity-stepper input { border: 0; text-align: center; border-radius: 0; margin: 0; min-width: 0; appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button { appearance: none; }
.quantity-stepper button:disabled { cursor: default; opacity: .4; }
.line-fields { grid-template-columns: 1.1fr 1.2fr .8fr; }
.add-product.in-quote { background: var(--green); color: white; border-color: var(--green); }
#catalog-notice summary { cursor: pointer; font-weight: 600; }
#catalog-error { margin: 12px 0 0; }
.product-price, .grand-total, .mobile-cart strong { font-variant-numeric: tabular-nums; }
@media (min-width: 901px) {
  .quantity-stepper { min-height: 34px; }
  .quantity-stepper button { min-width: 24px; }
}
@media (max-width: 900px) {
  :root { --muted: #637165; --mobile-nav-height: 70px; }
  body { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); }
  .sidebar { display: none; }
  main { margin: 0; max-width: none; padding-bottom: calc(185px + var(--mobile-safe-bottom)); }
  .topbar { position: sticky; top: 0; z-index: 10; height: 60px; padding: 0 18px; background: #fbfcf9; }
  .breadcrumb { color: var(--green); font-size: 14px; letter-spacing: 1.6px; font-weight: 750; }
  .breadcrumb > span:first-child { margin: 0 10px; color: #9ca79d; }
  .breadcrumb > span:last-child { color: #657167; font-size: 12px; font-weight: 500; }
  .local-tag { display: none; }
  .mobile-new { display: inline-flex; border-color: transparent; background: var(--green-light); }
  #editor-view, #archive-view, #settings-view { padding: 20px 16px 0; }
  #editor-view > .page-heading { display: none; }
  .page-heading { gap: 12px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 24px; letter-spacing: -.5px; max-width: none; }
  .page-heading > div > p:last-child { font-size: 13px; line-height: 1.6; max-width: none; }
  .page-heading > .button { margin-top: 0; font-size: 12px; padding: 10px; }
  .workspace { display: block; }
  body[data-editor-pane="catalog"] .quote-panel { display: none; }
  body[data-editor-pane="quote"] .catalog-panel { display: none; }
  .section-heading { margin: 0 0 16px; }
  .section-heading h2 { font-size: 20px; letter-spacing: -.4px; }
  .section-heading p { font-size: 11px; color: #657167; line-height: 1.5; margin-top: 6px; }
  .count-pill { font-size: 11px; padding: 4px 7px; color: #54634f; }
  button, .button, .icon-button { min-height: 44px; }
  .button { font-size: 14px; border-radius: 9px; padding: 11px 15px; }
  .icon-button { min-width: 44px; }
  input, select, textarea, .field input, .field select, .field textarea, .search-field input, .catalog-filters > select, .bundle-tools select, .line-fields input, .share-url { font-size: 16px !important; min-height: 46px; }
  input::placeholder, textarea::placeholder { color: #6c786c; opacity: 1; }
  .catalog-filters { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .search-field { width: 100%; }
  .search-field input { padding: 12px; min-width: 0; }
  .catalog-filters > select { width: 100%; max-width: none; padding: 10px 12px; }
  .collection-tools { flex-wrap: nowrap; gap: 8px; margin-top: 10px; }
  .chip { min-height: 44px; padding: 9px 12px; font-size: 12px; border-radius: 8px; white-space: normal; color: #52634c; }
  .chip span { font-size: 11px; }
  .notice { font-size: 12px; padding: 12px; margin: 10px 0 0; line-height: 1.6; }
  .catalog-meta { margin: 16px 0 12px; font-size: 11px; color: #657167; }
  .catalog-meta > span:last-child { max-width: none; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-card { border-radius: 12px; box-shadow: none; }
  .product-card:hover { box-shadow: none; }
  .product-image { aspect-ratio: 1.2; }
  .product-image img { mix-blend-mode: normal; }
  .product-card:hover .product-image img { transform: none; }
  .product-category { top: auto; bottom: 8px; left: 8px; font-size: 10px; color: #465440; max-width: calc(100% - 16px); }
  .favorite-star { min-width: 44px; height: 44px; top: 5px; right: 5px; font-size: 28px; border: 0; background: #fff; }
  .product-content { padding: 12px; }
  .product-content h3 { font-size: 14px; line-height: 1.4; min-height: 39px; font-weight: 650; }
  .product-sku { font-size: 11px; color: #657167; margin: 7px 0 12px; }
  .product-bottom { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .product-price { font-size: 16px; letter-spacing: -.2px; }
  .product-price small { font-size: 10px; color: #657167; margin-top: 4px; line-height: 1.4; }
  .add-product { width: 100%; min-height: 44px; font-size: 13px; padding: 10px 6px; border-radius: 8px; }
  .load-more { min-height: 48px; }
  .workspace > .quote-panel { position: static; display: block; max-height: none; min-height: 0; width: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  body[data-editor-pane="catalog"] .workspace > .quote-panel { display: none; }
  .quote-panel > .quote-body { overflow: visible; padding: 20px 0 0; }
  .quote-header { padding: 0 0 18px; background: transparent; border-bottom: 1px solid #dce2d8; }
  .quote-header h2 { font-size: 22px; }
  .draft-badge { font-size: 12px; padding: 7px 11px; }
  .subheading { margin-bottom: 14px; }
  .subheading h3 { font-size: 15px; }
  .required-hint { font-size: 11px; color: #657167; }
  .field { font-size: 13px; color: #4f6051; gap: 8px; margin-bottom: 16px; }
  .customer-details summary { font-size: 13px; min-height: 44px; padding: 10px 0; }
  .customer-details summary span { font-size: 11px; color: #657167; }
  .mobile-browse { display: flex; width: 100%; background: #eaf2ee; border-color: #cdded4; color: var(--green); margin: 12px 0 0; }
  .lines-heading { padding-top: 20px; margin-top: 24px; }
  .text-button { min-height: 44px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 5px; }
  .bundle-tools { gap: 8px; margin-bottom: 20px; }
  .bundle-tools select { min-width: 140px; }
  .bundle-tools .button { min-height: 46px; }
  .bundle-tools .text-button { flex-basis: 100%; justify-content: flex-end; }
  .empty-quote { padding: 26px 14px; }
  .empty-quote h3 { font-size: 15px; }
  .empty-quote p { font-size: 13px; color: #657167; }
  .quote-item { padding: 20px 0; }
  .line-image { width: 62px; height: 62px; border-radius: 8px; }
  .line-title h4 { font-size: 14px; line-height: 1.5; }
  .line-title p { font-size: 11px; color: #657167; }
  .remove-line { min-width: 44px; min-height: 44px; color: #80584d; font-size: 23px; }
  .line-fields { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
  .line-fields label { font-size: 12px; color: #53614f; min-width: 0; }
  .line-fields .quantity-field { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .quantity-stepper { margin: 0; width: 160px; }
  .quantity-stepper button { min-width: 44px; min-height: 44px; }
  .line-fields input { margin-top: 7px; padding: 10px; }
  .line-fields .quantity-stepper input { margin: 0; padding: 8px 2px; }
  .line-description { font-size: 14px !important; margin-top: 12px; background: transparent; }
  .line-bottom { font-size: 11px; line-height: 1.6; color: #657167; gap: 10px; }
  .line-bottom strong { font-size: 14px; white-space: nowrap; }
  .totals { margin-top: 24px; }
  .totals > div { font-size: 14px; color: #657167; }
  .totals > div > strong { font-size: 15px; }
  .totals small { font-size: 11px; }
  .totals .grand-total { font-size: 16px; }
  .totals .grand-total > strong { font-size: 28px; }
  .calculation-state { font-size: 12px; min-height: 17px; }
  .terms { margin-top: 20px; padding-top: 0; }
  .terms summary { font-size: 14px; padding: 16px 0; min-height: 48px; }
  .quote-actions { position: fixed; z-index: 15; left: 0; right: 0; bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom)); padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; background: #fff; border-top: 1px solid #dce2d8; }
  .quote-actions > p { grid-column: 1/-1; font-size: 11px; color: #657167; margin: 0; line-height: 1.4; }
  .quote-actions > div { display: contents; }
  .quote-actions .button, .quote-actions .share-launch { min-height: 46px; height: auto; font-size: 12px; padding: 10px 5px; margin: 0; }
  .quote-actions #download-pdf { background: #eaf2ee; color: var(--green); }
  .quote-actions .share-launch { background: var(--green); color: white; border-radius: 9px; text-decoration: none; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; height: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom)); padding: 4px 8px var(--mobile-safe-bottom); border-top: 1px solid #e3e8e0; background: #fff; }
  .mobile-tab { border: 0; background: transparent; color: #667264; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 550; min-width: 0; }
  .tab-icon { position: relative; display: flex; justify-content: center; align-items: center; width: 50px; height: 29px; border-radius: 9px; }
  .mobile-tab svg { width: 22px; height: 22px; }
  .mobile-tab[aria-current="page"] { color: var(--green); font-weight: 750; }
  .mobile-tab[aria-current="page"] .tab-icon { background: #e7f0e9; }
  .tab-badge { position: absolute; top: -3px; right: 0; min-width: 17px; padding: 1px 4px; border-radius: 6px; background: var(--green); color: white; font-size: 10px; line-height: 15px; }
  .mobile-cart { display: flex; position: fixed; bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom)); left: 0; right: 0; z-index: 15; padding: 13px 16px; gap: 16px; align-items: center; justify-content: space-between; border-top: 1px solid #dce2d8; background: #fff; }
  .mobile-cart > div { min-width: 0; }
  .mobile-cart span { display: block; font-size: 11px; color: #657167; margin-bottom: 5px; }
  .mobile-cart strong { font-size: 21px; color: var(--green); letter-spacing: -.4px; }
  .mobile-cart .button { font-size: 13px; min-height: 48px; }
  .mobile-cart .button svg { width: 18px; }
  .toast { bottom: calc(176px + var(--mobile-safe-bottom)); width: max-content; max-width: calc(100% - 32px); font-size: 13px; padding: 11px 15px; pointer-events: none; }
  .keyboard-open .mobile-nav, .keyboard-open .mobile-cart, .keyboard-open .quote-actions { display: none; }
  .keyboard-open .toast { bottom: 16px; }
  .archive-panel { border: 0; background: transparent; padding: 0; }
  .archive-toolbar { gap: 8px; }
  .archive-toolbar .button { font-size: 12px; }
  .archive-table-wrap { overflow: visible; }
  .archive-table, .archive-table tbody { display: block; }
  .archive-table thead { display: none; }
  .archive-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #fff; border: 1px solid #e1e5dc; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
  .archive-table td { padding: 0; border: 0; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
  .archive-table td small { font-size: 11px; color: #657167; }
  .archive-table td:nth-child(2) { grid-row: 1; grid-column: 1/-1; font-size: 17px; font-weight: 650; }
  .archive-table td:nth-child(3) { text-align: right; font-size: 12px; color: #657167; }
  .archive-table td:nth-child(5) { text-align: right; font-size: 18px; color: var(--green); }
  .archive-table td:last-child { grid-column: 1/-1; padding-top: 10px; border-top: 1px solid #e6e8e1; }
  .row-actions { gap: 8px; flex-wrap: wrap; }
  .archive-table .row-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
  .row-actions .text-button { font-size: 12px; }
  .status-label { font-size: 11px; }
  .settings-panel { grid-template-columns: 1fr; padding: 20px 16px; gap: 28px; }
  .settings-section h2 { font-size: 18px; }
  .settings-section > p { font-size: 13px; }
  .settings-footer { flex-direction: column; gap: 12px; align-items: stretch; }
  .settings-footer span { font-size: 12px; }
  dialog, #share-dialog { width: 100%; max-width: 100%; max-height: 88dvh; margin: auto 0 0; padding: 24px 20px calc(24px + var(--mobile-safe-bottom)); border: 0; border-radius: 18px 18px 0 0; overflow-y: auto; }
  dialog::backdrop { background: #1a2e2870; backdrop-filter: none; }
  .dialog-heading { margin-bottom: 22px; gap: 16px; }
  .dialog-heading h2 { font-size: 20px; }
  .dialog-copy, .checkbox-field { font-size: 13px; }
  .checkbox-field input { min-height: 20px; }
  .dialog-actions { margin-top: 20px; }
  .dialog-actions .button { flex: 1; }
  .custom-numbers { grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
  .share-card { padding: 14px; }
  .share-card-heading { flex-direction: column; gap: 6px; font-size: 14px; }
  .share-card-heading > span, .share-expiry { font-size: 12px; }
  .share-card .row-actions { gap: 7px 16px; }
  .share-url { text-overflow: ellipsis; }
  .saved-item { align-items: stretch; flex-direction: column; }
  .saved-item h3 { font-size: 14px; }
  .saved-item p { font-size: 12px; }
  .response-note { font-size: 13px; border-left-width: 1px; }
  .page-footer { display: none; }
}
@media (min-width: 600px) and (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-filters { grid-template-columns: 1fr 220px; }
  #editor-view, #archive-view, #settings-view { max-width: 760px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
  .settings-panel { grid-template-columns: 1fr 1fr; }
  dialog, #share-dialog { max-width: 600px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 359px) {
  #editor-view, #archive-view, #settings-view { padding-left: 12px; padding-right: 12px; }
  .product-grid { gap: 8px; }
  .product-content { padding: 10px; }
  .product-price { font-size: 14px; }
  .mobile-cart { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .mobile-cart strong { font-size: 18px; }
  .mobile-cart .button { padding: 10px; }
  .breadcrumb > span:last-child { font-size: 11px; }
}
.bundle-options > summary { display: none; }
@media (max-width: 900px) {
  .bundle-options { margin-bottom: 18px; border-bottom: 1px solid #dce2d8; }
  .bundle-options > summary { display: list-item; font-size: 13px; min-height: 44px; padding: 10px 0 14px; color: #53614f; cursor: pointer; }
  .bundle-options .bundle-tools { margin-top: 8px; }
  .quote-panel > .quote-body { padding-top: 18px; }
  .lines-heading { margin-top: 18px; padding-top: 16px; margin-bottom: 4px; }
}
