/* Stitch V3 presentation layer. Business, print and export styles remain in styles.css. */
@media screen {
  body.stitch-ui {
    --stitch-surface: #f6faff;
    --stitch-low: #ecf5fe;
    --stitch-container: #e6eff8;
    --stitch-primary: #493ee5;
    --stitch-primary-container: #635bff;
    --stitch-ink: #141d23;
    --stitch-muted: #706e80;
    --stitch-line: #e0e9f2;
    --stitch-shadow: 0 4px 20px rgba(130,142,158,.08);
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    background: var(--stitch-surface) !important;
    background-image: none !important;
    color: var(--stitch-ink);
    font: 400 13px/1.46 "Plus Jakarta Sans", "Microsoft YaHei", "PingFang SC", sans-serif !important;
  }
  body.stitch-ui::before, body.stitch-ui::after { content: none !important; }
  body.stitch-ui *, body.stitch-ui *::before, body.stitch-ui *::after { box-sizing: border-box; }
  body.stitch-ui :is(button,input,select,textarea) { font-family: inherit !important; }
  body.stitch-ui :is(button,a,summary,input,select,textarea):focus-visible {
    outline: 2px solid var(--stitch-primary) !important;
    outline-offset: 3px;
  }
  body.stitch-ui .material-symbols-outlined { font-size: 18px; flex-shrink: 0; font-weight: 400; }
  body.stitch-ui .material-symbols-outlined[data-stitch-glyph]::before { content: attr(data-stitch-glyph); }
  body.stitch-ui:not(.auth-locked) main.app-shell {
    display: block !important;
    width: 100% !important;
    max-width: 1920px !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    margin: 0 auto !important;
    padding: 0 20px 24px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--stitch-surface) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  body.stitch-ui:not(.auth-locked) main.app-shell::before,
  body.stitch-ui:not(.auth-locked) main.app-shell::after { content: none !important; }
  body.stitch-ui .topbar.compact {
    position: sticky !important;
    top: 0 !important;
    right: auto !important; bottom: auto !important; left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    min-height: 56px !important;
    width: calc(100% + 40px) !important;
    margin: 0 -20px !important;
    padding: 10px 20px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--stitch-line) !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: var(--stitch-shadow) !important;
    z-index: 45 !important;
  }
  body.stitch-ui .topbar.compact::before,
  body.stitch-ui .topbar.compact::after,
  body.stitch-ui .top-actions::before,
  body.stitch-ui .top-actions::after { content: none !important; }
  .stitch-ui .stitch-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .stitch-ui .stitch-brand strong { font-size: 18px; line-height: 26px; letter-spacing: -.01em; font-weight: 700; }
  .stitch-ui .stitch-brand-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--stitch-primary-container); box-shadow: 0 2px 8px rgba(99,91,255,.25); }
  body.stitch-ui .top-actions { display: flex !important; flex-wrap: wrap !important; justify-content: flex-end !important; align-items: center !important; width: auto !important; gap: 8px !important; margin: 0 !important; padding: 0 !important; min-width: 0; }
  body.stitch-ui #cloudAuth { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
  body.stitch-ui #cloudAccount { font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 999px; background: var(--stitch-low); overflow-wrap: anywhere; }
  body.stitch-ui #cloudStatus { padding: 4px 9px !important; border-radius: 999px !important; font-size: 10px !important; line-height: 16px; white-space: normal; max-width: 280px; }
  body.stitch-ui .cloud-auth :is(button,a,summary) { min-height: 28px !important; padding: 5px 9px !important; font-size: 11px !important; border: 0 !important; border-radius: 999px !important; background: var(--stitch-low) !important; box-shadow: none !important; color: #464555 !important; }
  body.stitch-ui .cloud-more-menu { position: relative; margin: 0 !important; }
  body.stitch-ui :is(.cloud-more-popover,.toolbox-more-popover) { z-index: 80 !important; max-height: min(560px,75vh); overflow-y: auto; background: #fff !important; border: 1px solid var(--stitch-line) !important; border-radius: 16px !important; box-shadow: 0 12px 28px rgba(130,142,158,.18) !important; }
  body.stitch-ui .tabs.stitch-main-nav {
    position: sticky !important;
    top: var(--stitch-header-height,56px) !important;
    right: auto !important; bottom: auto !important; left: auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: calc(100% + 40px) !important;
    max-width: none !important;
    min-height: 42px !important;
    margin: 0 -20px 20px !important;
    padding: 7px 20px !important;
    gap: 6px !important;
    overflow-x: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--stitch-low) !important;
    box-shadow: none !important;
    scrollbar-width: thin;
    z-index: 40 !important;
  }
  body.stitch-ui .tabs.stitch-main-nav::before, body.stitch-ui .tabs.stitch-main-nav::after { content: none !important; display: none !important; }
  body.stitch-ui .tabs.stitch-main-nav .tab { flex: 0 0 auto !important; width: auto !important; min-height: 28px !important; padding: 5px 14px !important; border: 0 !important; border-radius: 999px !important; background: transparent !important; color: #464555 !important; box-shadow: none !important; font-size: 11px !important; font-weight: 600 !important; white-space: nowrap !important; }
  body.stitch-ui .tabs.stitch-main-nav .tab.active { background: var(--stitch-primary-container) !important; color: #fff !important; box-shadow: 0 2px 6px rgba(99,91,255,.25) !important; }
  body.stitch-ui .tabs.stitch-main-nav .tab:hover:not(.active) { background: var(--stitch-container) !important; }
  body.stitch-ui :is(#taxPanel,#markupPanel,#discountPanel,#rfcPage,#lookupPage,#sealRecognitionPage,#remarkDbPage):not(.active) { display: none !important; }
  body.stitch-ui :is(#taxPanel,#markupPanel,#discountPanel,#rfcPage,#lookupPage,#sealRecognitionPage,#remarkDbPage).active {
    display: block !important; position: relative !important; width: 100% !important; max-width: none !important; min-width: 0 !important;
    margin: 0 0 16px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; backdrop-filter: none !important;
  }
  body.stitch-ui .app-shell :is(h1,h2,h3,h4,h5) { color: var(--stitch-ink); letter-spacing: -.01em; }
  body.stitch-ui .app-shell :is(h2,h3) { font-weight: 700 !important; }
  body.stitch-ui :is(.panel-head,.lookup-head,.seal-recognition-head,.remark-db-head,.rfc-head) { display: flex !important; flex-wrap: wrap; align-items: center !important; justify-content: space-between !important; min-height: 68px !important; gap: 12px !important; margin: 0 0 16px !important; padding: 16px !important; border: 0 !important; border-radius: 32px !important; background: #fff !important; box-shadow: var(--stitch-shadow) !important; }
  body.stitch-ui .rfc-head > div:first-child { display: block !important; }
  body.stitch-ui :is(.panel-head,.lookup-head,.seal-recognition-head,.remark-db-head,.rfc-head) h2 { display: flex; align-items: center; gap: 10px; margin: 0 !important; font-size: 18px !important; line-height: 26px !important; }
  body.stitch-ui :is(.panel-head,.lookup-head,.seal-recognition-head,.remark-db-head,.rfc-head) p { max-width: 850px; margin: 4px 0 0 !important; color: var(--stitch-muted) !important; font-size: 11px !important; line-height: 17px !important; font-weight: 400 !important; }
  .stitch-ui .stitch-title-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: var(--stitch-primary-container); box-shadow: 0 3px 8px rgba(99,91,255,.22); font-size: 24px !important; }
  body.stitch-ui .app-shell :is(button,summary) { cursor: pointer; }
  body.stitch-ui .app-shell button:not(.tab):not(.fill-handle) { min-height: 32px !important; padding: 6px 12px !important; border: 1px solid transparent !important; border-radius: 999px !important; background: var(--stitch-low) !important; color: #464555 !important; font-size: 12px !important; font-weight: 600 !important; box-shadow: none !important; }
  body.stitch-ui .app-shell button:not(.tab):not(:disabled):hover { background: var(--stitch-container) !important; }
  body.stitch-ui .app-shell :is(button.primary,button.primary-action,button[data-action^="add-"]):not(.tab):not(.fill-handle) { background: var(--stitch-primary-container) !important; color: #fff !important; box-shadow: 0 2px 6px rgba(99,91,255,.22) !important; }
  body.stitch-ui .app-shell :is(button.primary,button.primary-action,button[data-action^="add-"]):not(.tab):not(.fill-handle):not(:disabled):hover { background: var(--stitch-primary) !important; }
  body.stitch-ui :is(button,input,select,textarea):disabled { cursor: not-allowed !important; opacity: .48; }
  body.stitch-ui .app-shell :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not([type="file"]) { min-width: 0; min-height: 32px !important; border: 1px solid var(--stitch-line) !important; border-radius: 10px !important; color: var(--stitch-ink) !important; background: var(--stitch-low) !important; box-shadow: none !important; font-size: 12px !important; font-weight: 400 !important; }
  body.stitch-ui .app-shell :is(input,textarea)::placeholder { color: #8c93a5 !important; font-weight: 400 !important; }
  body.stitch-ui :is(.panel-head-actions,.lookup-actions,.seal-recognition-actions) { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 6px !important; min-width: 0; }
  body.stitch-ui :is(.markup-rate-control,.discount-rate-control) { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 6px !important; padding: 8px 10px !important; border: 0 !important; border-radius: 16px !important; background: var(--stitch-low) !important; box-shadow: none !important; }
  body.stitch-ui :is(.markup-rate-buttons,.discount-rate-buttons) { display: flex !important; flex-wrap: wrap !important; gap: 4px !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; }
  body.stitch-ui :is(.markup-rate-buttons,.discount-rate-buttons) button { min-height: 26px !important; padding: 4px 8px !important; font-size: 11px !important; }
  body.stitch-ui :is(.markup-rate-buttons,.discount-rate-buttons) button.active { background: var(--stitch-primary-container) !important; color: #fff !important; }
  body.stitch-ui :is(.markup-rate-input-wrap,.discount-rate-input-wrap) { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11px; }
  body.stitch-ui :is(#markupRateInput,#discountRateInput) { width: 80px !important; }
  body.stitch-ui #stitchToolbarHome { display: none !important; }
  body.stitch-ui #stitchQuoteToolbar { display: flex !important; flex-wrap: wrap; align-items: flex-start; gap: 8px; min-width: 0; padding: 12px 14px; margin: 0 0 12px; border-radius: 24px; background: #fff; box-shadow: var(--stitch-shadow); }
  body.stitch-ui #stitchQuoteToolbar .toolbox-panel { display: block !important; flex: 1 1 620px; width: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; z-index: 35 !important; }
  body.stitch-ui #stitchQuoteToolbar .toolbox-head { display: block !important; padding: 0 !important; }
  body.stitch-ui #stitchQuoteToolbar .toolbox-head > div:first-child { display: none !important; }
  body.stitch-ui #stitchQuoteToolbar .toolbox-actions { display: flex !important; flex-wrap: wrap !important; justify-content: flex-start !important; gap: 6px !important; z-index: 35 !important; }
  body.stitch-ui #stitchQuoteToolbar .toolbox-actions > button,
  body.stitch-ui #stitchQuoteToolbar .toolbox-actions > .toolbox-more-menu > summary { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px !important; padding: 6px 11px !important; border-radius: 999px !important; font-size: 11px !important; font-weight: 600 !important; }
  body.stitch-ui #stitchQuoteToolbar .toolbox-summary { display: flex !important; flex-wrap: wrap; gap: 5px 12px; margin: 8px 0 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: var(--stitch-muted); font-size: 10px !important; }
  body.stitch-ui .view-mode-strip { display: flex !important; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end !important; align-items: center !important; min-height: 32px !important; gap: 6px !important; margin: 0 !important; padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
  body.stitch-ui #stitchQuoteToolbar .view-mode-strip { order: 2; }
  body.stitch-ui .print-group { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; background: transparent !important; padding: 0 !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; font-size: 11px; }
  body.stitch-ui #printTabSelect { max-width: 170px; min-height: 30px !important; }
  body.stitch-ui .print-group-label { font-size: 10px; color: var(--stitch-muted); }
  body.stitch-ui #clientViewBtn { border: 1px solid #c7c4d8 !important; color: var(--stitch-primary) !important; }
  body.stitch-ui #clientViewBtn.active { background: var(--stitch-primary-container) !important; color: #fff !important; }
  body.stitch-ui:is([data-active-tab="rfc"],[data-active-tab="lookup"],[data-active-tab="seal-recognition"],[data-active-tab="remark-db"]) #stitchQuoteToolbar { display: none !important; }
  body.stitch-ui .table-wrap,
  body.stitch-ui :is(.rfc-order-wrap,.rfc-price-table-wrap,.lookup-table-wrap,.toolbox-table-wrap,.remark-db-table-wrap,.remark-candidate-table-wrap) { width: 100% !important; max-width: 100% !important; min-width: 0 !important; overflow-x: auto !important; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border: 0 !important; border-radius: 16px !important; box-shadow: none !important; background: #fff !important; }
  body.stitch-ui .stitch-calculator > .table-wrap { padding: 8px 14px; border-radius: 24px 24px 0 0 !important; }
  body.stitch-ui .stitch-empty-hint { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; padding: 20px; background: #fff; color: var(--stitch-muted); text-align: center; font-size: 11px; }
  body.stitch-ui .stitch-empty-hint strong { color: #464555; font-weight: 600; font-size: 13px; }
  body.stitch-ui .stitch-empty-hint[hidden] { display: none; }
  body.stitch-ui :is(.data-table,.rfc-order-table,.rfc-price-table,.toolbox-table,.lookup-table) { width: 100% !important; border-collapse: collapse !important; border: 0 !important; background: #fff !important; }
  body.stitch-ui :is(.data-table,.rfc-order-table,.rfc-price-table,.toolbox-table,.lookup-table) th { min-height: 32px !important; padding: 9px 8px !important; border: 0 !important; background: var(--stitch-low) !important; color: #464555 !important; font-size: 11px !important; font-weight: 600 !important; white-space: nowrap; }
  body.stitch-ui :is(.data-table,.rfc-order-table,.rfc-price-table,.toolbox-table,.lookup-table) td { height: 40px; padding: 7px 8px !important; border: 0 !important; border-bottom: 1px solid #edf3f9 !important; color: var(--stitch-ink); font-size: 12px !important; line-height: 18px; }
  body.stitch-ui .data-table input { width: 100%; min-height: 28px !important; padding: 4px 7px; }
  body.stitch-ui .data-table td.num { text-align: right !important; font-variant-numeric: tabular-nums; }
  body.stitch-ui :is(.quote-total,.summary-strip) { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 16px !important; margin: 0 0 16px !important; padding: 12px 14px !important; border-radius: 0 0 24px 24px !important; background: var(--stitch-low) !important; border: 0 !important; box-shadow: none !important; }
  body.stitch-ui :is(.quote-total,.summary-strip) :is(div,.metric) { flex: 1 1 145px; min-height: 0 !important; padding: 4px 6px !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; }
  body.stitch-ui :is(.quote-total,.summary-strip) strong { font-size: 16px !important; color: var(--stitch-primary); }
  body.stitch-ui details.stitch-detail { display: block !important; margin: 0 0 10px !important; padding: 0 !important; overflow: hidden !important; border: 0 !important; border-radius: 24px !important; background: #fff !important; box-shadow: var(--stitch-shadow) !important; }
  body.stitch-ui details.stitch-detail > summary { display: list-item !important; padding: 14px 18px !important; font-size: 13px !important; font-weight: 600 !important; color: var(--stitch-ink) !important; background: transparent !important; border: 0 !important; }
  body.stitch-ui details.stitch-detail:not([open]) > :not(summary) { display: none !important; }
  body.stitch-ui details.stitch-detail .detail-stack { display: block !important; padding: 0 14px 14px; }
  body.stitch-ui details.stitch-detail .detail-pane { min-width: 0; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: #fff !important; box-shadow: none !important; }
  body.stitch-ui details.stitch-detail .detail-pane-head { padding: 8px 0 !important; background: transparent !important; }
  body.stitch-ui details.stitch-detail .formula-doc { padding: 0 16px 16px; }
  body.stitch-ui .formula-table { display: block; max-width: 100%; overflow-x: auto; font-size: 12px; }
  body.stitch-ui #stitchImportPanel { display: block !important; min-width: 0 !important; margin: 0 0 16px !important; padding: 0 !important; border: 0 !important; border-radius: 24px !important; background: #fff !important; box-shadow: var(--stitch-shadow) !important; }
  body.stitch-ui #stitchImportPanel::before, body.stitch-ui #stitchImportPanel::after { content: none !important; }
  body.stitch-ui:is([data-active-tab="rfc"],[data-active-tab="lookup"],[data-active-tab="seal-recognition"],[data-active-tab="remark-db"]) #stitchImportPanel { display: none !important; }
  body.stitch-ui .stitch-import-summary { display: flex; align-items: center; gap: 7px; padding: 12px 16px; color: var(--stitch-primary); font-weight: 600; }
  body.stitch-ui #stitchImportPanel:not([open]) > :not(summary) { display: none !important; }
  body.stitch-ui .stitch-import-body { padding: 0 16px 16px; min-width: 0; }
  body.stitch-ui .ocr-head { margin: 0 0 12px !important; }
  body.stitch-ui .ocr-head h2 { font-size: 15px !important; }
  body.stitch-ui .drop-zone { min-height: 90px !important; border-radius: 16px !important; background: var(--stitch-low) !important; border: 1px dashed #c7c4d8 !important; }
  body.stitch-ui .ocr-review { display: grid !important; grid-template-columns: minmax(140px,.3fr) minmax(0,.7fr) !important; gap: 14px !important; margin-top: 12px !important; }
  body.stitch-ui .ocr-review-main { min-width: 0; }
  body.stitch-ui .rfc-layout { display: grid !important; grid-template-columns: minmax(0,25fr) minmax(0,65fr) minmax(86px,10fr) !important; gap: 16px !important; align-items: start !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
  body.stitch-ui #rfcPage .rfc-head { padding-right: 16px !important; }
  body.stitch-ui #rfcPage .rfc-head::before, body.stitch-ui #rfcPage .rfc-head::after { content: none !important; }
  body.stitch-ui #rfcPage .rfc-catalog-card > .rfc-head { min-height: 0 !important; margin: 0 0 12px !important; padding: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
  body.stitch-ui #rfcPage .rfc-catalog-card > .rfc-head h2 { font-size: 15px !important; line-height: 22px !important; }
  body.stitch-ui #rfcPage .rfc-catalog-card > .rfc-head p { display: none !important; }
  body.stitch-ui #rfcPage .rfc-head .stitch-title-icon { width: 24px; height: 24px; font-size: 17px !important; box-shadow: none; }
  body.stitch-ui :is(.rfc-catalog-card,.rfc-order-card,.rfc-price-panel) { min-width: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 16px !important; border: 0 !important; border-radius: 32px !important; background: #fff !important; box-shadow: var(--stitch-shadow) !important; backdrop-filter: none !important; }
  body.stitch-ui .rfc-order-card::before { content: none !important; }
  body.stitch-ui .rfc-catalog { max-height: 620px; overflow-y: auto; scrollbar-width: thin; }
  body.stitch-ui .rfc-catalog :is(.rfc-spec-grid,.rfc-spec-list) { min-width: 0; }
  body.stitch-ui .rfc-category-filters { margin: 0 0 10px !important; }
  body.stitch-ui .rfc-segment-group { gap: 5px !important; }
  body.stitch-ui .rfc-segment-group button { min-height: 30px !important; padding: 4px 8px !important; font-size: 11px !important; }
  body.stitch-ui .rfc-segment-group button.active { background: var(--stitch-primary-container) !important; color: #fff !important; }
  body.stitch-ui .rfc-fast-add { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; gap: 6px !important; padding: 10px !important; margin: 8px 0 !important; border: 0 !important; border-radius: 16px !important; background: var(--stitch-low) !important; }
  body.stitch-ui .rfc-fast-add > :is(#rfcCatalogSearch,#rfcQuickAdd,button) { grid-column: 1 / -1; width: 100% !important; }
  body.stitch-ui .rfc-print-title { margin: 0 0 12px !important; padding: 0 !important; border: 0 !important; color: var(--stitch-ink) !important; }
  body.stitch-ui .rfc-print-title strong { font-size: 18px !important; }
  body.stitch-ui .rfc-order-meta { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)) !important; gap: 8px !important; margin: 0 0 12px !important; padding: 10px !important; background: var(--stitch-low) !important; border: 0 !important; border-radius: 16px !important; }
  body.stitch-ui .rfc-order-meta label { display: grid; gap: 4px; color: var(--stitch-muted); font-size: 10px !important; min-width: 0; }
  body.stitch-ui .rfc-order-meta input { width: 100% !important; background: #fff !important; font-size: 11px !important; }
  body.stitch-ui .rfc-bulk-fill { display: flex !important; flex-wrap: wrap !important; gap: 7px !important; margin: 0 0 12px !important; padding: 10px !important; border: 0 !important; border-radius: 16px !important; background: var(--stitch-low) !important; }
  body.stitch-ui .rfc-bulk-fill label { flex: 1 1 105px; min-width: 0; font-size: 10px !important; }
  body.stitch-ui .rfc-bulk-fill :is(input,select) { width: 100% !important; min-height: 28px !important; }
  body.stitch-ui .rfc-order-table { min-width: 660px; }
  body.stitch-ui .rfc-order-table :is(input,select) { width: 100%; min-height: 28px !important; font-size: 11px !important; }
  body.stitch-ui .rfc-total { display: flex !important; flex-wrap: wrap !important; justify-content: space-between; gap: 10px !important; padding: 12px 10px !important; margin: 8px 0 !important; border: 0 !important; border-radius: 16px !important; background: var(--stitch-low) !important; font-size: 11px !important; }
  body.stitch-ui #rfcTotalNumber { color: var(--stitch-primary) !important; font-size: 20px !important; }
  body.stitch-ui .rfc-order-extra { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 8px !important; border: 0 !important; }
  body.stitch-ui .rfc-order-extra label { min-width: 0; font-size: 10px !important; }
  body.stitch-ui .rfc-order-extra input { width: 100%; }
  body.stitch-ui .stitch-rfc-action-rail { min-width: 0; position: sticky; top: 12px; }
  body.stitch-ui #rfcPage .rfc-actions { position: static !important; inset: auto !important; width: 100% !important; display: flex !important; flex-direction: column !important; grid-column: auto !important; grid-row: auto !important; align-items: stretch !important; gap: 6px !important; margin: 0 !important; padding: 8px !important; border: 0 !important; border-radius: 24px !important; background: #fff !important; box-shadow: var(--stitch-shadow) !important; backdrop-filter: none !important; }
  body.stitch-ui #rfcPage .rfc-actions::before, body.stitch-ui #rfcPage .rfc-actions::after { content: none !important; display: none !important; }
  body.stitch-ui #rfcPage .rfc-actions button { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100% !important; min-height: 55px !important; padding: 8px 3px !important; border-radius: 16px !important; font-size: 10px !important; line-height: 15px; }
  body.stitch-ui #rfcPage .rfc-actions button.primary { color: #fff !important; background: var(--stitch-primary-container) !important; }
  body.stitch-ui #rfcPage .rfc-actions [data-rfc-action="clear-order"] { color: #ba1a1a !important; background: #ffdad633 !important; }
  body.stitch-ui .rfc-price-panel { margin-top: 16px !important; }
  body.stitch-ui .rfc-price-workbench { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; gap: 16px !important; }
  body.stitch-ui .rfc-price-workbench > * { min-width: 0 !important; }
  body.stitch-ui :is(.lookup-search-bar,.lookup-quick-add,.lookup-results,.supplier-report-scope,.supplier-report-current-status,.supplier-report-results,.supplier-report-manual,.remark-db-advanced,.remark-db-daily-actions,.remark-db-management-status) { min-width: 0; margin-bottom: 14px; border-radius: 24px !important; box-shadow: var(--stitch-shadow); }
  body.stitch-ui :is(.lookup-search-bar,.supplier-report-scope,.supplier-report-results,.supplier-report-manual,.remark-db-advanced,.remark-db-management-status) { background: #fff !important; border: 0 !important; }
  body.stitch-ui :is(.supplier-report-results,.remark-db-advanced,.remark-db-management-status,.lookup-results)::before,
  body.stitch-ui :is(.supplier-report-results,.remark-db-advanced,.remark-db-management-status,.lookup-results)::after { content: none !important; }
  body.stitch-ui :is(.lookup-table-wrap,.remark-candidate-table-wrap,.supplier-report-stores,.remark-candidate-stores) { max-width: 100%; overflow-x: auto !important; min-width: 0; }
  body.stitch-ui :is(.supplier-report-stats,.remark-db-stats,.remark-candidate-stats) { gap: 10px !important; }
  body.stitch-ui :is(.supplier-report-stats,.remark-db-stats,.remark-candidate-stats) > * { min-width: 0 !important; background: #fff !important; border-radius: 16px !important; box-shadow: var(--stitch-shadow) !important; }
  body.stitch-ui :is(.order-flow-ribbon,.remark-db-flow) { max-width: 100%; min-width: 0; border-radius: 20px !important; background: var(--stitch-low) !important; box-shadow: none !important; }
  body.stitch-ui .order-flow-ribbon { display: flex !important; flex-wrap: wrap !important; align-items: center !important; justify-content: space-between !important; gap: 8px 12px !important; padding: 10px 14px !important; margin: 0 0 14px !important; border: 0 !important; }
  body.stitch-ui .order-flow-ribbon-main { min-width: 0; flex: 1 1 350px; }
  body.stitch-ui .order-flow-ribbon-main strong { font-size: 12px !important; }
  body.stitch-ui .order-flow-ribbon-main small { font-size: 11px !important; line-height: 17px; }
  body.stitch-ui .order-flow-ribbon-actions { display: flex !important; flex-wrap: wrap !important; align-items: center; gap: 6px !important; min-width: 0; }
  body.stitch-ui .stitch-report-flow { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; list-style: none; margin: 0 0 14px; padding: 12px 14px; border-radius: 24px; background: #fff; box-shadow: var(--stitch-shadow); }
  body.stitch-ui .stitch-report-flow li { display: flex; align-items: center; gap: 7px; color: #464555; font-size: 11px; font-weight: 600; }
  body.stitch-ui .stitch-report-flow li span { display: inline-flex; flex: 0 0 24px; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: var(--stitch-low); color: var(--stitch-primary); }
  body.stitch-ui .remark-db-head { margin-top: 12px !important; }
  body.stitch-ui .remark-db-daily-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  body.stitch-ui .remark-db-daily-actions button { min-height: 40px !important; border-radius: 24px !important; background: #fff !important; box-shadow: var(--stitch-shadow) !important; }
  body.stitch-ui .remark-db-subnav { display: flex !important; flex-wrap: wrap !important; gap: 5px !important; padding: 10px !important; border: 0 !important; background: var(--stitch-low) !important; border-radius: 16px !important; }
  body.stitch-ui .remark-db-subnav button.active { color: #fff !important; background: var(--stitch-primary-container) !important; }
  body.stitch-ui .remark-db-view { min-width: 0 !important; max-width: 100%; }
  body.stitch-ui #remarkDbReviewList.has-list { min-width: 0; max-width: 100%; }
  body.stitch-ui #remarkDbReviewList .remark-db-review-list { width: 100%; max-width: 100%; min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.stitch-ui #remarkDbReviewList :is(.remark-db-review-card,.remark-db-review-rule,.stitch-detail,.detail-stack) { min-width: 0; max-width: 100%; }
  body.stitch-ui #remarkDbReviewList :is(strong,span,small,p,summary) { overflow-wrap: anywhere; }
  @media (max-width: 680px) {
    body.stitch-ui #remarkDbReviewList .remark-db-review-list { grid-template-columns: minmax(0,1fr); }
  }
  body.stitch-ui :is(.remark-db-toolbar,.remark-candidate-toolbar,.remark-db-import-mapping,.remark-db-data-audit-grid,.remark-assistant-card) { min-width: 0; border-radius: 20px !important; }
  body.stitch-ui :is(.remark-candidate-batchbar,.remark-candidate-pagination,.remark-candidate-row-actions) { flex-wrap: wrap; }
  body.stitch-ui :is(.remark-candidate-item-title,.remark-candidate-item-title-row,.remark-candidate-row-summary,.remark-db-status) { overflow-wrap: anywhere; min-width: 0; }
  body.stitch-ui #toolboxModal:not([hidden]) { display: grid !important; place-items: center !important; padding: 20px !important; z-index: 400 !important; background: rgba(41,49,56,.28) !important; backdrop-filter: blur(4px); }
  body.stitch-ui #toolboxModal .toolbox-dialog { width: min(1120px,calc(100vw - 40px)) !important; max-height: calc(100dvh - 40px) !important; display: grid !important; grid-template-rows: auto minmax(0,1fr) auto !important; min-width: 0 !important; overflow: hidden !important; border: 0 !important; border-radius: 32px !important; background: #fff !important; box-shadow: 0 20px 60px rgba(41,49,56,.2) !important; }
  body.stitch-ui .toolbox-dialog-head { padding: 16px 20px !important; border-bottom: 1px solid var(--stitch-line) !important; background: #fff !important; }
  body.stitch-ui #toolboxModalTitle { font-size: 20px !important; line-height: 28px; font-weight: 700 !important; margin: 0 !important; }
  body.stitch-ui .toolbox-dialog-body { min-width: 0 !important; overflow: auto !important; padding: 16px 20px !important; }
  body.stitch-ui .toolbox-dialog-footer { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; padding: 12px 20px !important; border-top: 1px solid var(--stitch-line) !important; background: var(--stitch-surface) !important; }
  body.stitch-ui .toolbox-dialog :is(button,input,select,textarea) { font-family: inherit !important; font-size: 12px !important; border-radius: 10px; }
  body.stitch-ui .toolbox-dialog button { min-height: 32px; padding: 6px 12px; border-radius: 999px !important; font-weight: 600; }
  body.stitch-ui #toolboxModal button { border: 1px solid transparent !important; background: var(--stitch-low) !important; color: #464555 !important; font-weight: 600 !important; box-shadow: none !important; }
  body.stitch-ui #toolboxModal :is(button[data-toolbox-row-action^="save-"],button[data-cloud-user-action="create"],button.primary-action) { background: var(--stitch-primary-container) !important; color: #fff !important; }
  body.stitch-ui #toolboxModal :is(button[data-toolbox-row-action^="delete-"],button[data-cloud-user-action="delete"],button.danger) { background: #ffdad633 !important; color: #ba1a1a !important; }
  body.stitch-ui #toolboxModal :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not([type="file"]) { min-width: 0; min-height: 34px !important; border: 1px solid var(--stitch-line) !important; border-radius: 10px !important; background: var(--stitch-low) !important; color: var(--stitch-ink) !important; box-shadow: none !important; }
  body.stitch-ui .toolbox-dialog :is(.toolbox-note,.toolbox-form,.toolbox-card,.toolbox-settings,.toolbox-customer-card) { border-radius: 16px !important; background: var(--stitch-low) !important; box-shadow: none !important; }
  body.stitch-ui .toolbox-dialog .toolbox-form { gap: 12px !important; }
  body.stitch-ui :is(.account-admin-hero,.account-create-form,.account-admin-page,.rfc-history-toolbar) { min-width: 0; background: #fff !important; border-color: var(--stitch-line) !important; box-shadow: none !important; }
  body.stitch-ui .account-create-form { border-radius: 20px !important; padding: 14px !important; gap: 10px !important; background: var(--stitch-low) !important; }
  body.stitch-ui .account-table-wrap { max-width: 100%; overflow-x: auto; }
  body.stitch-ui .account-table { min-width: 850px; }
  body.stitch-ui :is(.rfc-history-list,.rfc-history-detail) { min-width: 0; border-radius: 20px !important; border-color: var(--stitch-line) !important; background: var(--stitch-low) !important; }
  body.stitch-ui .rfc-history-layout { min-width: 0; gap: 14px !important; }
  body.stitch-ui :is(#supplierReportArchiveDialog,.lookup-editor-dialog,#remarkSimpleEditor .remark-simple-editor-dialog) { max-width: calc(100vw - 32px) !important; max-height: calc(100dvh - 32px) !important; border: 0 !important; border-radius: 24px !important; background: #fff !important; box-shadow: 0 20px 60px rgba(41,49,56,.2) !important; }
  body.stitch-ui #supplierReportArchiveDialog::backdrop { background: rgba(41,49,56,.28); backdrop-filter: blur(4px); }
  body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor):not([hidden]) { background: rgba(41,49,56,.28) !important; backdrop-filter: blur(4px); }
  body.stitch-ui :is(#remarkSimpleEditor .simple-card,#remarkBatchEditor .batch-card) { width: min(1120px,100%) !important; max-height: calc(100dvh - 40px) !important; border: 0 !important; border-radius: 32px !important; background: #fff !important; box-shadow: 0 20px 60px rgba(41,49,56,.2) !important; color: var(--stitch-ink) !important; }
  body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor) :is(header,footer) { padding: 16px 20px !important; border-color: var(--stitch-line) !important; background: #fff !important; }
  body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor) :is(h3,h4) { font-size: 20px !important; line-height: 28px !important; font-weight: 700 !important; }
  body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor) p { font-size: 12px !important; color: var(--stitch-muted) !important; }
  body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor) button { min-height: 32px !important; padding: 6px 12px !important; border: 0 !important; border-radius: 999px !important; font-size: 12px !important; background: var(--stitch-low) !important; color: #464555 !important; box-shadow: none !important; }
  body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor) button.primary { background: var(--stitch-primary-container) !important; color: #fff !important; }
  body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor) :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]) { min-width: 0; min-height: 34px !important; border: 1px solid var(--stitch-line) !important; border-radius: 10px !important; background: var(--stitch-low) !important; font-size: 13px !important; }
  body.stitch-ui #remarkSimpleEditor .simple-content { padding: 16px 20px !important; gap: 14px !important; }
  body.stitch-ui #remarkSimpleEditor :is(.simple-product,.simple-preview) { border: 0 !important; border-radius: 20px !important; background: var(--stitch-low) !important; }
  body.stitch-ui #remarkSimpleEditor :is(.simple-label,.simple-product strong,.simple-mode b) { font-size: 14px !important; }
  body.stitch-ui #remarkSimpleEditor textarea { font-size: 14px !important; }
  body.stitch-ui #remarkSimpleEditor .simple-mode { border-color: var(--stitch-line) !important; border-radius: 16px !important; }
  body.stitch-ui #remarkSimpleEditor .simple-mode:has(input:checked) { border-color: #b6b0ff !important; background: var(--stitch-low) !important; }
  body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor) :is(input[type="checkbox"],input[type="radio"]) { accent-color: var(--stitch-primary-container) !important; }
  body.stitch-ui .login-screen { background: var(--stitch-surface) !important; background-image: none !important; }
  body.stitch-ui .login-screen::before, body.stitch-ui .login-screen::after { content: none !important; }
  body.stitch-ui .login-card { width: min(420px,calc(100vw - 32px)); padding: 32px; border: 0 !important; border-radius: 32px !important; background: #fff !important; box-shadow: 0 12px 40px rgba(130,142,158,.12) !important; }
  body.stitch-ui .login-card :is(h1,h2) { color: var(--stitch-ink); font-size: 22px !important; font-weight: 700 !important; }
  body.stitch-ui .login-card input { min-height: 40px; border: 1px solid var(--stitch-line) !important; border-radius: 12px !important; background: var(--stitch-low) !important; }
  body.stitch-ui #loginSubmitBtn { background: var(--stitch-primary-container) !important; border: 0 !important; border-radius: 999px !important; box-shadow: 0 3px 10px rgba(99,91,255,.2) !important; }
  /* Screen presentation of the existing editable sales sheet; no output fields are replaced. */
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet { margin: 24px auto !important; padding: 24px 32px !important; border: 0 !important; border-radius: 32px !important; background: #fff !important; box-shadow: var(--stitch-shadow) !important; font-family: inherit !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet::before, body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet::after { content: none !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .quote-toolbar { display: flex !important; flex-wrap: wrap !important; align-items: center; gap: 6px !important; margin: -8px -16px 20px !important; padding: 8px !important; border: 0 !important; border-radius: 24px !important; background: var(--stitch-low) !important; }
  body.stitch-ui :is(#printSheet,.view-mode-strip) button { min-height: 32px !important; padding: 6px 12px !important; border: 0 !important; border-radius: 999px !important; background: var(--stitch-low) !important; color: #464555 !important; font-size: 12px !important; font-weight: 600 !important; box-shadow: none !important; }
  body.stitch-ui :is(#copyQuoteImgBtn,#saveQuoteImgBtn,#printBtn,#clientViewBtn) { background: var(--stitch-primary-container) !important; color: #fff !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet :is(#copyQuoteImgBtn,#saveQuoteImgBtn),
  body.stitch-ui.client-view .view-mode-strip :is(#printBtn,#clientViewBtn) { background: var(--stitch-primary-container) !important; color: #fff !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet #clearQuoteBtn { color: #ba1a1a !important; background: #ffdad633 !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-head { min-height: 56px; margin: 0 0 14px !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-company { font-size: 22px !important; font-weight: 700 !important; color: var(--stitch-ink) !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-title { font-size: 22px !important; font-weight: 700 !important; color: var(--stitch-primary) !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-head::after { content: none !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet :is(.print-sheet-meta,.print-sheet-info,.print-sheet-extra,.print-sheet-sign) { min-width: 0; gap: 10px !important; margin: 0 0 14px !important; padding: 12px !important; border: 0 !important; border-radius: 20px !important; background: var(--stitch-low) !important; font-size: 11px !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet :is(.print-sheet-meta label,.row,.print-sheet-sign > *) { min-width: 0; padding: 0 !important; border: 0 !important; background: transparent !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet :is(input,textarea) { min-width: 0; min-height: 30px !important; border: 1px solid var(--stitch-line) !important; border-radius: 10px !important; background: #fff !important; color: var(--stitch-ink) !important; font-family: inherit !important; font-size: 12px !important; font-weight: 400 !important; box-shadow: none !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-table { width: 100%; border-collapse: collapse !important; border: 0 !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-table th { padding: 9px 7px !important; border: 0 !important; background: var(--stitch-low) !important; font-size: 11px !important; font-weight: 600; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-table td { padding: 7px !important; border: 0 !important; border-bottom: 1px solid #edf3f9 !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .quote-add-row-bar { padding: 8px !important; margin: 0 0 14px !important; border: 0 !important; background: #fff !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-total { display: grid !important; grid-template-columns: auto 1fr auto !important; gap: 16px !important; padding: 16px !important; margin: 0 0 14px !important; border: 0 !important; border-radius: 24px !important; background: var(--stitch-low) !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-total > * { padding: 0 !important; border: 0 !important; background: transparent !important; font-size: 11px !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet [data-print="chinese"] { color: var(--stitch-ink) !important; font-size: 18px !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet [data-print="numeric"] { color: var(--stitch-primary) !important; font-size: 24px !important; font-weight: 700 !important; }
  /* Preserve the customer's output sheet and the exit/print controls, while hiding the account shell. */
  body.stitch-ui.client-view:not(.auth-locked) main.app-shell { min-height: 0 !important; padding: 12px 20px !important; background: transparent !important; }
  body.stitch-ui.client-view main.app-shell > :not(.view-mode-strip) { display: none !important; }
  body.stitch-ui.client-view main.app-shell > .view-mode-strip { display: flex !important; justify-content: flex-end !important; }
  body.stitch-ui.client-view .internal-only { display: none !important; }
  body.stitch-ui.client-view #printSheet { width: min(1080px,calc(100% - 40px)) !important; max-width: calc(100% - 40px) !important; }
  body.stitch-ui.client-view .quote-toolbar button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
  @media (max-width: 1199px) {
    body.stitch-ui .rfc-layout { grid-template-columns: minmax(0,25fr) minmax(0,65fr) minmax(75px,10fr) !important; gap: 10px !important; }
    body.stitch-ui :is(.rfc-catalog-card,.rfc-order-card) { padding: 12px !important; border-radius: 24px !important; }
    body.stitch-ui .rfc-order-meta { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    body.stitch-ui .rfc-order-extra { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    body.stitch-ui .rfc-order-extra label:last-child { grid-column: 1/-1; }
  }
  @media (max-width: 760px) {
    body.stitch-ui:not(.auth-locked) main.app-shell { padding: 0 12px 16px !important; }
    body.stitch-ui .topbar.compact { width: calc(100% + 24px) !important; margin: 0 -12px !important; padding: 10px 12px !important; gap: 8px !important; }
    body.stitch-ui .stitch-brand strong { font-size: 16px; }
    body.stitch-ui .top-actions { width: 100% !important; justify-content: flex-start !important; }
    body.stitch-ui #cloudAuth { justify-content: flex-start; }
    body.stitch-ui .tabs.stitch-main-nav { width: calc(100% + 24px) !important; margin: 0 -12px 12px !important; padding: 7px 12px !important; }
    body.stitch-ui :is(.panel-head,.lookup-head,.seal-recognition-head,.remark-db-head,.rfc-head) { border-radius: 24px !important; padding: 14px !important; margin-bottom: 12px !important; }
    body.stitch-ui :is(.panel-head-actions,.markup-rate-control,.discount-rate-control) { width: 100%; justify-content: flex-start !important; }
    body.stitch-ui #stitchQuoteToolbar { padding: 10px; border-radius: 20px; gap: 8px; }
    body.stitch-ui #stitchQuoteToolbar :is(.toolbox-panel,.view-mode-strip) { flex: 1 1 100%; }
    body.stitch-ui #stitchQuoteToolbar .view-mode-strip { justify-content: flex-start !important; }
    body.stitch-ui #stitchQuoteToolbar .toolbox-summary { font-size: 9px !important; }
    body.stitch-ui .stitch-calculator > .table-wrap > table { min-width: 600px; }
    body.stitch-ui .detail-table { min-width: 950px; }
    body.stitch-ui .detail-table-by-qty { min-width: 650px; }
    body.stitch-ui .stitch-calculator > .table-wrap { padding: 6px; }
    body.stitch-ui :is(.quote-total,.summary-strip) { gap: 4px 8px !important; padding: 10px !important; }
    body.stitch-ui :is(.quote-total,.summary-strip) :is(div,.metric) { flex: 1 1 120px; }
    body.stitch-ui details.stitch-detail > summary { padding: 13px 14px !important; }
    body.stitch-ui .ocr-review { grid-template-columns: minmax(0,1fr) !important; }
    body.stitch-ui .ocr-review .image-preview { min-height: 100px !important; max-height: 200px; }
    body.stitch-ui .rfc-layout { grid-template-columns: minmax(0,1fr) !important; }
    body.stitch-ui .stitch-rfc-action-rail { position: static; grid-row: 2; }
    body.stitch-ui #rfcPage .rfc-actions { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
    body.stitch-ui #rfcPage .rfc-actions button { min-height: 52px !important; }
    body.stitch-ui .rfc-order-card { grid-row: 3; }
    body.stitch-ui .rfc-catalog { max-height: 280px; }
    body.stitch-ui .rfc-fast-add { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    body.stitch-ui .rfc-price-workbench { grid-template-columns: minmax(0,1fr) !important; }
    body.stitch-ui :is(.lookup-table,.rfc-price-table,.toolbox-table) { min-width: 620px; }
    body.stitch-ui .remark-db-daily-actions { grid-template-columns: minmax(0,1fr); }
    body.stitch-ui .remark-db-daily-actions button { min-height: 40px !important; }
    body.stitch-ui .stitch-report-flow { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 10px; }
    body.stitch-ui :is(.remark-db-stats,.remark-candidate-stats,.supplier-report-stats) { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    body.stitch-ui :is(.remark-db-toolbar,.remark-candidate-toolbar,.remark-db-import-mapping,.remark-db-data-audit-grid) { grid-template-columns: minmax(0,1fr) !important; }
    body.stitch-ui .remark-db-flow { overflow-x: auto; }
    body.stitch-ui #toolboxModal:not([hidden]) { padding: 8px !important; }
    body.stitch-ui #toolboxModal .toolbox-dialog { width: calc(100vw - 16px) !important; max-height: calc(100dvh - 16px) !important; border-radius: 24px !important; }
    body.stitch-ui :is(.toolbox-dialog-head,.toolbox-dialog-body,.toolbox-dialog-footer) { padding: 12px !important; }
    body.stitch-ui .toolbox-dialog :is(.toolbox-form,.toolbox-grid,.toolbox-two-col,.toolbox-settings) { grid-template-columns: minmax(0,1fr) !important; min-width: 0; }
    body.stitch-ui :is(.account-create-form,.rfc-history-layout,.rfc-history-toolbar) { grid-template-columns: minmax(0,1fr) !important; }
    body.stitch-ui :is(#remarkSimpleEditor,#remarkBatchEditor) { padding: 8px !important; }
    body.stitch-ui :is(#remarkSimpleEditor .simple-card,#remarkBatchEditor .batch-card) { max-height: calc(100dvh - 16px) !important; border-radius: 24px !important; }
    body.stitch-ui #remarkSimpleEditor .simple-grid { grid-template-columns: minmax(0,1fr) !important; }
    body.stitch-ui .account-create-form > *, body.stitch-ui .toolbox-form > * { min-width: 0; grid-column: auto !important; }
    body.stitch-ui.client-view #printSheet { width: calc(100% - 24px) !important; max-width: calc(100% - 24px) !important; }
    body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet { padding: 16px !important; border-radius: 24px !important; }
    body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-head { flex-wrap: wrap !important; gap: 8px; }
    body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet :is(.print-sheet-meta,.print-sheet-info,.print-sheet-extra,.print-sheet-sign) { grid-template-columns: minmax(0,1fr) !important; }
    body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .print-sheet-total { grid-template-columns: minmax(0,1fr) !important; gap: 7px !important; }
    body.stitch-ui.client-view #printSheet .print-sheet-table { min-width: 580px; }
    body.stitch-ui.client-view #printSheet .print-sheet-table-wrap { overflow-x: auto; max-width: 100%; }
  }
}
/* Role sizes are measured from the selected 1280×1024 Stitch exports. Different
   screens deliberately retain their own 12/16/32/48px component corners. */
@media screen {
  body.stitch-ui #taxPanel { --stitch-card-radius: 12px; --stitch-card-padding: 10px; }
  body.stitch-ui #markupPanel { --stitch-card-radius: 16px; --stitch-card-padding: 16px; }
  body.stitch-ui #discountPanel { --stitch-card-radius: 32px; --stitch-card-padding: 16px; }
  body.stitch-ui .stitch-calculator > .panel-head {
    min-height: 0 !important; padding: var(--stitch-card-padding) !important;
    margin-bottom: 12px !important; border-radius: var(--stitch-card-radius) !important;
    gap: 8px !important;
  }
  body.stitch-ui #taxPanel > .panel-head { min-height: 52px !important; }
  body.stitch-ui #markupPanel > .panel-head { min-height: 60px !important; }
  body.stitch-ui #discountPanel > .panel-head { min-height: 80px !important; }
  body.stitch-ui #taxPanel .panel-head h2 { font-size: 18px !important; line-height: 27px !important; }
  body.stitch-ui #markupPanel .panel-head h2 { font-size: 20px !important; line-height: 28px !important; }
  body.stitch-ui #discountPanel .panel-head h2 { font-size: 22px !important; line-height: 30px !important; }
  body.stitch-ui .stitch-calculator .stitch-title-icon { width: 24px; height: 24px; font-size: 18px !important; box-shadow: none; }
  body.stitch-ui #taxPanel .stitch-title-icon { width: 10px; font-size: 0 !important; border-radius: 999px; }
  body.stitch-ui #markupPanel .stitch-title-icon { background: transparent; color: var(--stitch-primary); }
  body.stitch-ui #discountPanel .stitch-title-icon { width: 32px; height: 32px; font-size: 20px !important; }
  body.stitch-ui .stitch-page-help { position: relative; flex: 0 0 auto; margin-left: auto; color: var(--stitch-muted); font-size: 11px; }
  body.stitch-ui .stitch-page-help summary { white-space: nowrap; padding: 4px; }
  body.stitch-ui .stitch-page-help[open] > p {
    position: absolute; right: 0; top: 100%; width: min(480px,calc(100vw - 64px));
    max-width: none !important; margin: 8px 0 0 !important; padding: 14px !important;
    border: 1px solid var(--stitch-line); border-radius: 12px; background: #fff;
    box-shadow: 0 8px 24px rgba(130,142,158,.16); z-index: 38;
  }
  body.stitch-ui .stitch-parameter-bar {
    width: 100%; justify-content: flex-start !important; min-height: 64px;
    padding: 16px !important; margin: 0 0 12px !important;
    border-radius: var(--stitch-card-radius) !important; background: #fff !important;
    box-shadow: var(--stitch-shadow) !important;
  }
  body.stitch-ui .stitch-parameter-bar :is(.markup-rate-label,.discount-rate-label) { font-size: 12px; font-weight: 600; margin-right: auto; }
  body.stitch-ui .stitch-parameter-hint { flex: 1 1 360px; color: var(--stitch-muted); font-size: 11px; line-height: 17px; }
  body.stitch-ui :is(#markupRateButtons,#discountRateButtons) button.active { background: var(--stitch-primary-container) !important; color: #fff !important; }
  body.stitch-ui #stitchQuoteToolbar .toolbox-actions [data-toolbox-action="save-quote"] { color: #464555 !important; background: var(--stitch-low) !important; box-shadow: none !important; }
  body.stitch-ui[data-active-tab="tax"] #clientViewBtn { background: #006c47 !important; color: #fff !important; border-color: transparent !important; }
  body.stitch-ui[data-active-tab="markup"] #clientViewBtn { background: #5ffdb7 !important; color: #005235 !important; border-color: transparent !important; }
  body.stitch-ui[data-active-tab="discount"] #clientViewBtn { background: var(--stitch-low) !important; color: var(--stitch-primary) !important; border-color: #493ee54d !important; }
  body.stitch-ui[data-active-tab] #clientViewBtn.active { background: #fff !important; color: var(--stitch-primary) !important; border-color: #493ee54d !important; }
  body.stitch-ui .stitch-calculator #stitchQuoteToolbar {
    padding: 10px 16px; border-radius: var(--stitch-card-radius);
  }
  body.stitch-ui #stitchQuoteToolbar .toolbox-actions > button.stitch-quote-add[hidden] { display: none !important; }
  body.stitch-ui #taxPanel #stitchQuoteToolbar { padding: 10px; }
  body.stitch-ui .stitch-calculator > .table-wrap {
    padding: 0; border-radius: var(--stitch-card-radius) var(--stitch-card-radius) 0 0 !important;
    box-shadow: 0 2px 12px rgba(130,142,158,.06) !important;
  }
  body.stitch-ui .stitch-calculator > .table-wrap .data-table th {
    padding: 10px 12px !important; font-size: 11px !important; line-height: 16.5px;
  }
  body.stitch-ui .stitch-calculator > .table-wrap .data-table td { padding: 7px 12px !important; }
  body.stitch-ui .data-table td:has(.quote-qty-unit) { white-space: nowrap; }
  body.stitch-ui .data-table td:has(.quote-qty-unit) input { display: inline-block; width: calc(100% - 24px) !important; max-width: calc(100% - 24px) !important; vertical-align: middle; }
  body.stitch-ui .quote-qty-unit { display: inline; margin-left: 4px; font-size: 12px; line-height: 18px; white-space: nowrap; color: var(--stitch-muted); }
  body.stitch-ui .stitch-calculator > .quote-total {
    padding: 12px 16px !important; border-radius: 0 0 var(--stitch-card-radius) var(--stitch-card-radius) !important;
  }
  body.stitch-ui .stitch-calculator details.stitch-detail,
  body.stitch-ui .stitch-calculator #stitchImportPanel { border-radius: var(--stitch-card-radius) !important; }
  body.stitch-ui .stitch-calculator details.stitch-detail > summary { padding: 12px 16px !important; font-size: 12px !important; line-height: 20px; }
  body.stitch-ui #taxPanel details.stitch-detail > summary { padding: 10px !important; }
  body.stitch-ui .stitch-calculator details.stitch-detail .detail-stack { padding: 0 10px 10px; }
  body.stitch-ui .stitch-calculator details.stitch-detail .detail-table th { padding: 8px !important; font-size: 11px !important; }
  body.stitch-ui #rfcPage :is(.rfc-catalog-card,.rfc-order-card) { border-radius: 48px !important; padding: 16px !important; }
  body.stitch-ui #rfcPage .rfc-order-card { display: grid !important; gap: 16px !important; padding: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
  body.stitch-ui #rfcPage :is(.stitch-rfc-meta-card,.stitch-rfc-line-card) { min-width: 0; padding: 16px; border-radius: 48px; background: #fff; box-shadow: var(--stitch-shadow); }
  body.stitch-ui #rfcPage .stitch-rfc-line-heading { display: block; font-size: 18px; line-height: 26px; margin-bottom: 12px; }
  body.stitch-ui #rfcPage .stitch-rfc-line-card .rfc-order-wrap { margin: 0 !important; border-radius: 0 !important; }
  body.stitch-ui #rfcPage .rfc-print-title :is(strong,span) { font-size: 18px !important; line-height: 26px !important; font-weight: 700 !important; color: var(--stitch-ink) !important; }
  body.stitch-ui #rfcPage .rfc-order-meta { padding: 0 !important; border-radius: 0 !important; background: transparent !important; }
  body.stitch-ui #rfcPage .rfc-catalog-card > .rfc-head h2 { font-size: 18px !important; line-height: 26px !important; }
  body.stitch-ui #rfcPage :is(.rfc-fast-add,.rfc-category-filters,.rfc-bulk-fill) { border-radius: 32px !important; padding: 10px !important; }
  body.stitch-ui #rfcPage .rfc-category-filters { background: var(--stitch-low); }
  body.stitch-ui #rfcPage .rfc-order-meta { border-radius: 0 !important; padding: 0 !important; }
  body.stitch-ui #rfcPage .rfc-order-meta label { min-height: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
  body.stitch-ui #rfcPage .rfc-order-extra { margin: 0 !important; padding: 0 !important; }
  body.stitch-ui #rfcPage .rfc-total { border-radius: 32px !important; padding: 12px !important; }
  body.stitch-ui #rfcPage .rfc-total > span { min-height: 0 !important; border: 0 !important; border-radius: 0 !important; padding: 0 !important; background: transparent !important; }
  body.stitch-ui #rfcPage .rfc-total strong { font-size: 20px !important; line-height: 24px !important; }
  body.stitch-ui #rfcPage .rfc-actions { border-radius: 48px !important; padding: 8px !important; }
  body.stitch-ui #rfcPage .rfc-actions button { border-radius: 32px !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet { padding: 32px !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet .quote-toolbar { border-radius: 32px !important; padding: 10px !important; }
  body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet :is(.print-sheet-meta,.print-sheet-info,.print-sheet-extra,.print-sheet-sign) { border-radius: 32px !important; padding: 16px !important; }
  body.stitch-ui #lookupPage :is(.lookup-head,.lookup-search-bar,.lookup-quick-add,.lookup-results) { border-radius: 32px !important; padding: 16px !important; }
  body.stitch-ui #lookupPage .lookup-table-wrap { border-radius: 0 !important; }
  body.stitch-ui #sealRecognitionPage :is(.seal-recognition-head,.supplier-report-scope,.supplier-report-current-status,.supplier-report-results,.supplier-report-manual,.order-flow-ribbon,.stitch-report-flow) { border-radius: 0 !important; box-shadow: none !important; }
  body.stitch-ui #sealRecognitionPage .seal-recognition-head { padding: 8px 20px !important; min-height: 58px !important; margin-bottom: 12px !important; }
  body.stitch-ui #sealRecognitionPage .seal-recognition-head > div:first-child { flex: 0 1 190px; min-width: 0; }
  body.stitch-ui #sealRecognitionPage .seal-recognition-actions { flex: 1 1 740px; justify-content: flex-end !important; }
  body.stitch-ui #sealRecognitionPage .stitch-page-help { font-size: 10px; }
  body.stitch-ui #sealRecognitionPage .stitch-page-help[open] > p { right: auto; left: 0; }
  body.stitch-ui #sealRecognitionPage .seal-recognition-head .stitch-title-icon { width: 24px; height: 24px; font-size: 18px !important; box-shadow: none; }
  body.stitch-ui #sealRecognitionPage .stitch-report-flow { padding: 12px 16px; }
  body.stitch-ui #sealRecognitionPage .supplier-report-scope { padding: 8px !important; }
  body.stitch-ui #sealRecognitionPage .supplier-report-stats { display: grid !important; grid-template-columns: repeat(6,minmax(0,1fr)) !important; gap: 0 !important; margin: 0 0 12px !important; padding: 8px 4px !important; border: 0 !important; border-radius: 0 !important; background: var(--stitch-low) !important; box-shadow: none !important; }
  body.stitch-ui #sealRecognitionPage .supplier-report-stats > * { display: flex !important; flex-direction: column !important; min-height: 0 !important; padding: 4px 12px !important; border: 0 !important; border-right: 1px solid var(--stitch-line) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
  body.stitch-ui #sealRecognitionPage .supplier-report-stats > :last-child { border-right: 0 !important; }
  body.stitch-ui #sealRecognitionPage .supplier-report-stats :is(span,small) { font-size: 10px !important; line-height: 14px !important; margin: 0 !important; }
  body.stitch-ui #sealRecognitionPage .supplier-report-stats strong { font-size: 16px !important; line-height: 22px !important; margin: 2px 0 !important; }
  body.stitch-ui #sealRecognitionPage .supplier-report-manual { padding: 16px !important; }
  body.stitch-ui #supplierReportArchiveDialog { border-radius: 0 !important; }
  body.stitch-ui #supplierReportArchiveDialog[open] { padding: 16px !important; border-radius: 0 !important; }
  body.stitch-ui #supplierReportArchiveDialog table td[colspan] { height: 240px; padding: 24px 16px !important; text-align: center !important; vertical-align: middle !important; color: var(--stitch-muted); background: #fff; }
  body.stitch-ui #remarkDbPage :is(.remark-db-head,.order-flow-ribbon,.remark-db-management-status,.remark-db-advanced,.remark-db-toolbar,.remark-candidate-toolbar,.remark-db-daily-actions,.remark-db-table-wrap,.remark-candidate-table-wrap) { border-radius: 16px !important; }
  body.stitch-ui #remarkDbPage .remark-db-head { padding: 16px !important; }
  body.stitch-ui #remarkDbPage .remark-db-head h2 { font-size: 22px !important; line-height: 30px !important; }
  body.stitch-ui #remarkDbPage .remark-db-daily-actions button { border-radius: 16px !important; }
  body.stitch-ui #remarkDbPage.remark-db-page > .remark-db-daily-actions { display: flex !important; flex-wrap: wrap !important; align-items: center !important; min-height: 0 !important; height: auto !important; gap: 4px !important; width: fit-content; max-width: 100%; padding: 4px !important; margin-bottom: 14px !important; border-radius: 999px !important; background: var(--stitch-low) !important; }
  body.stitch-ui #remarkDbPage.remark-db-page > .remark-db-daily-actions button { min-width: 0 !important; min-height: 32px !important; padding: 6px 14px !important; border-radius: 999px !important; color: #464555 !important; background: transparent !important; box-shadow: none !important; }
  body.stitch-ui #remarkDbPage.remark-db-page > .remark-db-daily-actions button strong { font-size: 12px !important; line-height: 18px !important; }
  body.stitch-ui #remarkDbPage.remark-db-page > .remark-db-daily-actions button.active { color: var(--stitch-primary) !important; background: #fff !important; box-shadow: 0 1px 3px rgba(130,142,158,.12) !important; }
  body.stitch-ui #remarkDbPage.remark-db-page > .remark-db-daily-actions button.active strong { color: inherit !important; }
  body.stitch-ui #remarkDbPage.remark-db-page > .remark-db-daily-actions button.active::after { content: none !important; }
  body.stitch-ui #remarkDbPage [data-batch-entry] { padding: 12px 16px !important; margin: 0 0 14px !important; border: 0 !important; border-radius: 16px !important; background: #fff !important; box-shadow: var(--stitch-shadow); }
  body.stitch-ui #remarkSimpleEditor .simple-card { border-radius: 8px !important; }
  body.stitch-ui #remarkSimpleEditor :is(h3,h4) { font-size: 14px !important; line-height: 20px !important; }
  body.stitch-ui #remarkSimpleEditor :is(.simple-content,header,footer) { padding: 20px !important; }
  body.stitch-ui #remarkSimpleEditor :is(.simple-product,.simple-preview,.simple-mode) { border-radius: 8px !important; }
  body.stitch-ui #remarkBatchEditor .batch-card { border-radius: 16px !important; }
  body.stitch-ui #remarkBatchEditor :is(header,.batch-content,footer) { padding: 20px !important; }
  body.stitch-ui #toolboxModal .toolbox-dialog { border-radius: 16px !important; }
  body.stitch-ui #toolboxModalTitle { font-size: 16px !important; line-height: 20px; }
  body.stitch-ui .account-create-form { border-radius: 16px !important; padding: 24px !important; }
  body.stitch-ui .account-create-form { align-items: start !important; }
  body.stitch-ui .account-create-form > * { align-self: start !important; }
  body.stitch-ui .account-create-form > button { margin-top: 22px !important; }
  body.stitch-ui .login-card { padding: 24px; border-radius: 16px !important; }
  @media (min-width: 761px) {
    /* The source reserves a white work area; real rows can still grow naturally. */
    body.stitch-ui #taxPanel > .table-wrap { min-height: 320px; }
    body.stitch-ui #markupPanel > .table-wrap { min-height: 312px; }
    body.stitch-ui #discountPanel > .table-wrap { min-height: 368px; }
    body.stitch-ui #rfcPage .stitch-rfc-line-card .rfc-order-wrap { min-height: 220px; }
  }
  @media (max-width: 760px) {
    body.stitch-ui .stitch-calculator > .panel-head { padding: 10px !important; gap: 8px; }
    body.stitch-ui .stitch-calculator #stitchQuoteToolbar { padding: 10px; }
    body.stitch-ui .stitch-parameter-bar { padding: 12px !important; gap: 8px !important; }
    body.stitch-ui #rfcPage :is(.rfc-catalog-card,.rfc-order-card) { padding: 14px !important; border-radius: 32px !important; }
    body.stitch-ui #rfcPage .rfc-order-card { padding: 0 !important; border-radius: 0 !important; }
    body.stitch-ui #rfcPage :is(.stitch-rfc-meta-card,.stitch-rfc-line-card) { padding: 14px; border-radius: 32px; }
    body.stitch-ui #sealRecognitionPage .seal-recognition-head > div:first-child { flex-basis: 100%; }
    body.stitch-ui #sealRecognitionPage .seal-recognition-actions { flex-basis: 100%; justify-content: flex-start !important; }
    body.stitch-ui #sealRecognitionPage .supplier-report-stats { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
    body.stitch-ui #sealRecognitionPage .supplier-report-stats > * { padding: 4px 8px !important; }
    body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet { padding: 16px !important; }
    body.stitch-ui:is(.client-view,[data-active-tab]) #printSheet.print-sheet :is(.print-sheet-meta,.print-sheet-info,.print-sheet-extra,.print-sheet-sign) { padding: 12px !important; }
    body.stitch-ui #toolboxModal .toolbox-dialog { border-radius: 16px !important; }
  }
}
