/* Shared presentation layer. Screen-only: printed documents keep their existing layout. */
@media screen {
  :root {
    --font-sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
    --font-serif: var(--font-sans);
    --bg: #f3f4f6;
    --surface-subtle: #f8f9fa;
    --surface-soft: #f8f9fa;
    --surface-muted: #edf0f2;
    --line: #dfe3e7;
    --line-soft: #eaedf0;
    --line-strong: #c4cbd2;
    --text: #303842;
    --text-strong: #202832;
    --muted: #65717d;
    --muted-strong: #46525e;
    --primary: #a9533c;
    --primary-strong: #8f442f;
    --brand: #a9533c;
    --brand-strong: #8f442f;
    --brand-700: #8f442f;
    --radius: 10px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgb(30 40 50 / 4%);
  }
  body { background: var(--bg); font-family: var(--font-sans); line-height: 1.55; }
  h1, h2, h3 { font-family: var(--font-sans); font-weight: 650; letter-spacing: 0; }
  h1 { font-size: 24px; }
  h2 { font-size: 18px; }
  button, input, select, textarea { font-family: inherit; }
  button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
  :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #a9533c; outline-offset: 3px; }
  .shell, .edit-shell { width: min(100%, 1440px); max-width: 1440px; padding: 0 40px 40px; margin: 0 auto; }
  .app-nav, .top-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    min-height: 66px;
    position: sticky;
    top: 0;
    margin: 0 0 24px;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
    backdrop-filter: none;
  }
  .app-nav .brand, .top-nav .brand {
    gap: 9px; margin: 0; padding: 0; border: 0;
    font-family: var(--font-sans); font-size: 15px; font-weight: 700; white-space: nowrap;
  }
  .app-nav .brand::before, .top-nav .brand::before {
    width: 24px; height: 24px; border-radius: 7px; box-shadow: none;
    background: #a9533c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6'%3E%3Cpath d='M5 18V9l5 3V8l5 3V5h4v13zM8 15h1m3 0h1m3 0h1'/%3E%3C/svg%3E") center/19px no-repeat;
  }
  .nav-links { position: relative; display: flex; min-width: 0; align-items: center; gap: 3px; overflow-x: auto; scrollbar-width: thin; padding: 3px; }
  .app-nav .nav-links a, .top-nav .nav-links a { flex: 0 0 auto; padding: 8px 10px; min-height: 38px; border: 0; background: transparent; white-space: nowrap; font-size: 13px; }
  .app-nav .nav-links a:hover, .top-nav .nav-links a:hover { background: #e8ecef; }
  .app-nav .nav-links a.current, .top-nav .nav-links a.current { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 700; }
  .nav-account { display: flex; gap: 8px; align-items: center; }
  .nav-account .user-pill:empty { display: none; }
  .nav-account .user-pill { max-width: 160px; overflow-wrap: anywhere; }
  .app-nav #logout-button, .top-nav #logout-button { min-height: 36px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
  .page-header, .edit-header { padding: 20px 22px; margin: 0 0 20px; border-radius: 12px; gap: 18px; box-shadow: none; }
  .topbar { gap: 14px; }
  .topbar h1, .edit-header h1 { font-family: var(--font-sans); font-size: 24px; font-weight: 700; letter-spacing: 0; line-height: 1.4; margin: 0; }
  .user-line { font-size: 12px; gap: 6px; }
  .user-line span { border-radius: 6px; background: #f0f2f4; color: var(--muted-strong); font-weight: 500; }
  #role-switch-buttons, .filter-segment { border-radius: 8px; background: #f0f2f4; }
  .filter-segment { display: inline-flex; flex-wrap: wrap; }
  #role-switch-buttons button, .filter-segment button { border-radius: 6px; min-height: 32px; }
  .summary, body[data-role="ADMIN"] .summary, body[data-role="CLERK"] .summary {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px;
    padding-top: 16px; border-top: 1px solid var(--line-soft);
  }
  .summary > div:first-child { min-height: 40px; background: var(--surface-subtle); border: 0; padding: 8px 12px; }
  .summary > div:first-child::before { display: none; }
  .summary strong { margin-left: 8px; color: var(--text-strong); font-size: 21px; }
  .summary > .summary-actions { margin-left: auto; }
  .search-control { flex: 1 1 280px; max-width: 370px; grid-template-columns: minmax(0, 1fr) 40px 40px; gap: 6px; }
  .search-box { min-height: 40px; border-radius: 8px; background: #fff; }
  .search-action { width: 40px; min-width: 40px; min-height: 40px; }
  .primary-button, .secondary-button, .row-button, .action-link { min-height: 38px; border-radius: 8px; box-shadow: none; }
  .primary-button:hover, .secondary-button:hover, .row-button:hover, .action-link:hover { transform: none; box-shadow: none; }
  :is(.primary-button, .secondary-button, .row-button):disabled { opacity: 1; background: #eef0f2; border-color: #e2e5e9; color: #7c8691; box-shadow: none; cursor: not-allowed; }
  .summary-actions { gap: 8px; }
  .panel-title-row { margin-bottom: 12px; gap: 12px; }
  .panel-title-row h2, .gift-card-main h2 { font-weight: 650; }
  .panel-title-row p { margin-top: 4px; font-size: 12px; }
  .table-panel, .form-panel, .admin-panel, .image-side-panel { border-radius: 12px; box-shadow: none; }
  .pending-shipping-panel, .pending-procurement-panel, .recent-task-panel { padding: 16px; margin-bottom: 16px; background: #fff; border-color: var(--line); }
  .pending-shipping-panel::before, .pending-procurement-panel::before, .recent-task-panel::before { width: 3px; }
  .mold-summary-card { background: var(--surface-subtle); padding: 12px 14px; }
  .mold-summary-header > div { grid-template-columns: auto auto; gap: 4px 16px; align-items: baseline; }
  .mold-summary-updated { grid-column: 1 / -1; }
  .mold-summary-details { margin-top: 6px; }
  .pending-shipment[data-shipment-id] { grid-template-columns: minmax(170px, 0.65fr) minmax(0, 1.6fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px 20px; }
  .pending-shipment[data-shipment-id] > div { grid-column: 1; grid-row: 1 / span 3; }
  .pending-shipment[data-shipment-id] > ul { grid-column: 2; grid-row: 1 / span 2; padding-left: 0; }
  .pending-shipment[data-shipment-id] > p { grid-column: 2; grid-row: 3; margin: 0; }
  .pending-shipment[data-shipment-id] > .action-link, .pending-shipment[data-shipment-id] > .pending-shipment-status { grid-column: 3; grid-row: 1; }
  .pending-shipment[data-shipment-id] > .cancel-button { grid-column: 3; grid-row: 2; }
  .pending-shipment:hover { transform: none; box-shadow: none; }
  .pending-shipment, .console-draft-card, .history-shipment-card, .push-status-card { box-shadow: none; }
  .product-grid { gap: 14px; }
  .product-card { border-radius: 10px; box-shadow: none; }
  .product-card:hover, .gift-card:hover, .mold-list-row:hover, .shipping-item:hover { box-shadow: none; border-color: var(--line-strong); }
  .product-card-name { font-size: 16px; font-weight: 650; line-height: 1.5; letter-spacing: 0; }
  .product-card-body { gap: 14px; padding: 16px; }
  .product-card-stats { background: #f8f9fa; }
  .product-card-stat, .product-card-stats > .product-card-actions { min-height: 48px; height: auto; }
  .product-card-actions .btn-ghost, .product-card-actions .btn-edit { height: 30px; }
  .product-card-field .v.muted, .muted-text { color: var(--muted); }
  .mold-list-toolbar { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
  .mold-total-card { min-width: 180px; background: var(--surface-subtle); }
  .mold-total-card strong, .mold-total-display strong { font-family: var(--font-sans); font-weight: 700; }
  .mold-list { gap: 12px; }
  .mold-list-row { border-radius: 10px; gap: 8px 14px; }
  .mold-list-main h2 { font-family: var(--font-sans); font-size: 16px; font-weight: 650; line-height: 1.5; letter-spacing: 0; }
  .mold-list-row .mold-total-display { min-width: 0; }
  .shipping-item { padding: 16px; gap: 16px; }
  .shipping-item-main h2 { font-size: 16px; font-weight: 650; line-height: 1.5; }
  .shipping-field { border: 0; border-radius: 6px; padding: 8px 10px; background: #f3f5f7; }
  .shipping-status { border-radius: 8px; }
  #console-page .operation-panel { padding: 16px; }
  #console-page .operation-request-summary { border-left: 4px solid var(--primary); font-size: 20px; }
  #console-page .operation-product-row { box-shadow: none; border-radius: 10px; }
  #console-page .operation-reference-item { background: #f4f6f8; }
  #console-page .operation-item { border-left-color: var(--primary); }
  .operation-actions { background: #fff; border-color: var(--line-strong); box-shadow: 0 4px 20px rgb(30 40 50 / 10%); }
  th { color: var(--muted-strong); background: #f2f4f6; font-weight: 650; }
  td, th { font-variant-numeric: tabular-nums; }
  tbody tr:hover { background: #f8f9fa; }
  .history-table { min-width: 680px; }
  .history-table.admin-account-table { min-width: 1040px; }
  .history-table :is(th, td):nth-child(2) { width: 240px; }
  .admin-account-table :is(th, td):nth-child(8) { width: 160px; }
  .history-shipment-head .history-record-actions { display: flex; }
  .users-table-wrap, .history-table-wrap { max-width: 100%; overflow-x: auto; }
  .gift-card { border-radius: 10px; box-shadow: none; }
  .gift-card-main h2 { font-size: 16px; }
  .user-form, .field-grid, .gift-edit-grid { gap: 16px; }
  .field-section { padding-top: 20px; }
  .field-section h2 { font-size: 16px; font-weight: 650; }
  .edit-layout { gap: 20px; }
  .image-side-panel, .preview-panel { background: #fff; }
  .image-meta-grid > div { border-bottom-style: solid; }
  .empty-row, .product-empty, .mold-request-empty { padding: 32px 20px; color: var(--muted); }
  .login-panel h1 { font-weight: 700; }
  .page-jump-nav { right: 3px; width: 34px; padding: 2px; border-radius: 9px; box-shadow: var(--shadow-sm); }

  .page-jump-nav button { width: 28px; }

  /* Execution checklist: identify product, compare quantities, then mark completion. */
  .mold-request-page { gap: 0; }
  .mold-request-header { margin-bottom: 16px; }
  .mold-request-header .topbar { align-items: center; }
  .mold-process-steps { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; margin-top: 0; padding-top: 16px; border-top: 1px solid var(--line-soft); }
  .mold-process-row { grid-template-columns: 28px minmax(0, 1fr); gap: 6px 10px; padding: 0; }
  .mold-process-row::before { content: "1"; grid-row: 1 / span 2; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 6px; border-radius: 50%; background: #f1e4dd; color: #8f442f; font-size: 12px; font-weight: 700; }
  .mold-process-row + .mold-process-row::before { content: "2"; background: #edf0f3; color: var(--muted-strong); }
  .mold-process-row > div, .mold-process-row p { grid-column: 2; }
  .mold-process-row p { font-size: 12px; font-weight: 400; line-height: 1.6; color: var(--muted); }
  .mold-process-row button { min-height: 38px; padding: 6px 14px; }
  .mold-request-list { gap: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .mold-request-card {
    grid-template-columns: 64px minmax(0, 1fr) 100px; gap: 16px; padding: 16px 20px;
    border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; background: transparent;
  }
  .mold-request-card.is-waiting { background: transparent; }
  .mold-request-card:has(input:checked) { background: #f1f7f2; }
  .mold-request-image-wrap { grid-column: 1; grid-row: 1; }
  .mold-request-image-wrap, .mold-request-image { width: 64px; height: 64px; }
  .mold-request-main { grid-column: 2; grid-row: 1; grid-template-columns: minmax(0, 1fr) 244px; gap: 4px 24px; align-items: center; }
  .mold-request-title { grid-column: 1; grid-row: 1; justify-content: flex-start; gap: 8px; }
  .mold-request-title strong { font-size: 15px; font-weight: 650; line-height: 1.5; }
  .mold-request-title span { order: -1; font-size: 11px; }
  .mold-request-number { grid-column: 1; grid-row: 2; margin: 0; font-size: 12px; }
  .mold-request-desc { grid-column: 1; grid-row: 3; font-size: 12px; color: var(--muted); }
  .mold-request-values { grid-column: 2; grid-row: 1 / span 3; gap: 12px; }
  .mold-request-values span { padding: 8px 12px; border: 0; border-radius: 8px; background: #f3f5f7; gap: 8px; }
  .mold-request-values .target { background: #fbede7; }
  .mold-request-values b { font-family: var(--font-sans); font-size: 24px; font-weight: 700; }
  .mold-request-values em { color: var(--muted-strong); font-size: 12px; white-space: nowrap; }
  .mold-request-check { grid-column: 3; grid-row: 1; justify-self: end; min-height: 44px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
  .mold-request-check:has(:disabled) { background: #f8f9fa; color: var(--muted); cursor: default; }
  .mold-request-check:has(:checked) { background: #e4f0e7; color: #365e40; border-color: #b8d0bf; }
  .mold-request-check input { width: 18px; height: 18px; accent-color: #477653; }
  .mold-request-total { border: 0; padding: 14px 20px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
}

@media screen and (max-width: 1100px) {
  .shell, .edit-shell { padding-left: 24px; padding-right: 24px; }
  .app-nav, .top-nav { gap: 10px; }
  .app-nav .brand, .top-nav .brand { font-size: 14px; }
  .mold-request-main { grid-template-columns: minmax(0, 1fr) 210px; gap: 4px 14px; }
  .mold-process-steps { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .mold-process-row button { padding-left: 10px; padding-right: 10px; }
  .page-jump-nav { right: 1px; }
}
@media screen and (max-width: 760px) {
  .shell, .edit-shell { padding: 0 16px 32px; }
  .app-nav, .top-nav { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 16px; padding: 10px 0 6px; }
  .nav-links { grid-column: 1 / -1; grid-row: 2; margin: 0 -3px; }
  .nav-account { grid-column: 2; grid-row: 1; }
  .nav-account .user-pill { display: none; }
  .page-header, .edit-header { padding: 16px; margin-bottom: 16px; gap: 14px; }
  .topbar h1, .edit-header h1 { font-size: 22px; }
  .topbar > div:first-child { gap: 8px; }
  .summary, body[data-role="ADMIN"] .summary, body[data-role="CLERK"] .summary { gap: 10px; padding-top: 12px; }
  .summary > div:first-child { width: 100%; justify-content: space-between; }
  .summary > .summary-actions { margin-left: 0; }
  .search-control { max-width: none; width: 100%; flex-basis: 100%; }
  .summary-actions { width: 100%; }
  .summary-actions > :is(.primary-button, .secondary-button, .action-link) { flex: 1 1 auto; }
  .primary-button, .secondary-button, .row-button, .search-action { min-height: 40px; }
  .search-box { min-height: 42px; }
  .pending-shipping-panel, .pending-procurement-panel, .recent-task-panel { padding: 14px; }
  .pending-shipment[data-shipment-id] { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pending-shipment[data-shipment-id] > :is(div, ul, p) { grid-column: 1 / -1; grid-row: auto; }
  .pending-shipment[data-shipment-id] > .action-link, .pending-shipment[data-shipment-id] > .pending-shipment-status { grid-column: 1; grid-row: auto; justify-self: stretch; }
  .pending-shipment[data-shipment-id] > .cancel-button { grid-column: 2; grid-row: auto; }
  .history-shipment-head .history-record-actions { width: 100%; margin: 0; justify-content: flex-start; text-align: left; }
  .history-record-actions > span { width: 100%; }
  .history-record-actions > button { flex: 1; }
  .mold-summary-header > div { display: grid; grid-template-columns: 1fr; gap: 4px; }
  .mold-summary-card { padding: 12px; }
  .product-card-body { grid-template-columns: 72px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .product-card-image, .product-card-image :is(.product-image, .no-image, .image-link, .image-link img) { width: 72px; height: 72px; }
  .product-card-name { font-size: 15px; }
  .product-card-info { min-height: 72px; }
  .product-card-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card-stats--single, .product-card-stats--clerk { grid-template-columns: 1fr; }
  .product-card-stat { padding: 10px; flex-wrap: wrap; align-content: center; gap: 4px 6px; border-top: 0; }
  .product-card-stat + .product-card-stat { border-top: 0; border-left: 1px solid var(--line); }
  .product-card-stats > .product-card-actions { grid-column: 1 / -1; justify-content: flex-end; min-height: 44px; padding: 6px 10px; border-left: 0; border-top: 1px solid var(--line); }
  .product-card-actions .btn-ghost, .product-card-actions .btn-edit { height: 34px; }
  .product-card-stat .quantity-editor { max-width: calc(100vw - 52px); }
  .mold-list-toolbar { gap: 12px; padding-top: 12px; }
  .mold-total-card { width: 100%; }
  .mold-list-row { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 8px 10px; }
  .mold-list-image { width: 56px; }
  .mold-list-main h2 { font-size: 15px; }
  .gift-card-list { grid-template-columns: 1fr; }
  .gift-edit-grid, .user-form { grid-template-columns: 1fr; }
  .image-workspace, .pdf-workspace { grid-template-columns: minmax(0, 1fr); }
  .image-stage { padding: 12px; }
  .mold-process-steps { grid-template-columns: 1fr; gap: 14px; padding-top: 12px; }
  .mold-process-row { gap: 6px 10px; }
  .mold-process-row > div { gap: 6px; }
  .mold-process-row button { min-height: 40px; padding: 6px 10px; }
  .mold-request-card { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 14px; }
  .mold-request-image-wrap, .mold-request-image { width: 52px; height: 52px; }
  .mold-request-main { display: contents; }
  .mold-request-title { grid-column: 2; grid-row: 1; align-items: flex-start; }
  .mold-request-title strong { font-size: 14px; }
  .mold-request-title span { display: none; }
  .mold-request-number { grid-column: 1 / -1; grid-row: 2; font-size: 11px; }
  .mold-request-desc { grid-column: 1 / -1; grid-row: 3; font-size: 12px; margin-top: -7px; }
  .mold-request-values { grid-column: 1 / -1; grid-row: 4; gap: 10px; }
  .mold-request-values span { padding: 10px 12px; }
  .mold-request-values b { font-size: 22px; }
  .mold-request-check { grid-column: 1 / -1; grid-row: 5; justify-self: stretch; justify-content: center; min-height: 40px; }
  .mold-request-total { padding: 14px; }
  #console-page .operation-panel { padding: 12px; }
  #console-page .operation-request-summary { font-size: 17px; padding: 12px; }
  .page-jump-nav { top: auto; bottom: 12px; right: 12px; transform: none; display: flex; flex-direction: row; width: auto; padding: 3px; border-radius: 8px; }
  .shell:has(.page-jump-nav) { padding-bottom: 80px; }
  .page-jump-nav button { width: 30px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* History uses the same neutral surfaces and clear action hierarchy as other pages. */
@media screen {
  #admin-notification-panel, #super-admin-alert-panel, #my-push-status-panel,
  #mold-request-status-panel { background: #fff; border-color: var(--line); }
  .row-button.secondary-button { background: #fff; border: 1px solid var(--line-strong); color: var(--text); }
  .row-button.secondary-button:hover { background: var(--surface-subtle); border-color: var(--muted); }
  :is(#admin-history-page, #clerk-history-page) > .shipping-panel { background: transparent; border: 0; box-shadow: none; padding: 0; }
  .history-record-section > summary, .history-record-section.is-active > summary, .history-record-section.is-archived > summary {
    padding: 12px 16px; background: #fff; border-color: var(--line); border-radius: 10px; font-weight: 650;
  }
  .history-record-section > summary::after { border: 0; background: var(--surface-subtle); border-radius: 6px; }
  :is(#admin-history-list, #clerk-history-list) { padding: 0; }
  .history-section-list { gap: 16px; margin-top: 12px; }
  .history-record-section + .history-record-section { margin-top: 20px; }
  .history-shipment-card { padding: 20px; gap: 16px; border-radius: 12px; }
  .history-shipment-card:hover { border-color: var(--line-strong); box-shadow: none; }
  .history-shipment-head { gap: 12px 24px; align-items: flex-start; }
  .history-shipment-head .history-shipment-identity { gap: 6px; }
  .history-shipment-identity > strong { font-size: 16px; color: var(--text-strong); font-weight: 650; }
  .history-shipment-identity > span { font-size: 12px; font-weight: 400; }
  .history-status-tag { background: #f2f4f6; color: var(--muted-strong); border: 0; border-radius: 5px; }
  .history-shipment-totals { display: flex; flex-wrap: wrap; gap: 16px 40px; padding: 14px 16px; background: var(--surface-subtle); border-radius: 8px; }
  .history-shipment-totals > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
  .history-shipment-totals > div > span { font-size: 12px; color: var(--muted); }
  .history-shipment-totals strong { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
  .history-shipment-totals small { font-size: 12px; font-weight: 400; color: var(--muted); }
  .history-total-divider { margin: 0 10px; font-weight: 400; color: var(--line-strong); }
  .history-table-wrap { border-radius: 8px; margin-top: 0; }
  .history-table :is(th, td) { padding: 12px 10px; }
  .history-shipment-card.is-archived { background: #fff; opacity: 1; filter: none; padding-bottom: 42px; }
  .history-shipment-card.is-archived :is(strong, span, th, td) { color: var(--text); }
  .history-shipment-card.is-archived::after { background: #f2f4f6; border: 0; border-radius: 5px; }
  #admin-notice-section.history-notices { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-top: 24px; overflow: hidden; }
  .history-notices > summary { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 650; }
  .history-notices > summary::-webkit-details-marker { display: none; }
  #admin-notice-count { font-size: 12px; font-weight: 400; color: var(--muted); }
  .history-notices-hint { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--primary); }
  .history-notices-hint::after { content: "展开查看"; }
  .history-notices[open] .history-notices-hint::after { content: "收起"; }
  #admin-notice-list { padding: 0 20px 4px; gap: 0; }
  .history-notice.pending-shipment { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; padding: 16px 0; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; }
  .history-notice > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
  .history-notice > div span { font-size: 12px; }
  .history-notice > p { grid-column: 1; grid-row: 2; margin: 0; line-height: 1.75; }
  .history-notice > button { grid-column: 2; grid-row: 1 / 3; align-self: center; }
}
@media screen and (max-width: 760px) {
  .history-shipment-card { padding: 14px; gap: 14px; }
  .history-shipment-head .history-record-actions { width: auto; margin: 0; }
  .history-shipment-totals { gap: 12px; padding: 12px; }
  .history-shipment-totals > div { width: 100%; }
  .history-shipment-totals strong { font-size: 18px; }
  .history-notices > summary { gap: 8px; padding: 14px; font-size: 14px; }
  #admin-notice-list { padding: 0 14px 2px; }
  .history-notice.pending-shipment { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .history-notice > p { grid-row: auto; }
  .history-notice > button { grid-column: 1; grid-row: 3; justify-self: start; }
}

/* Completed work is a compact index; full records remain available on demand. */
@media screen {
  #recent-task-panel { background: #fff; }
  #recent-task-panel::before { display: none; }
  #recent-task-list { gap: 0; margin-top: 12px; }
  #recent-task-list > article {
    position: relative; display: block; padding: 16px 0; border: 0;
    border-top: 1px solid var(--line-soft); border-radius: 0; box-shadow: none;
    background: #fff; color: var(--text); filter: none; opacity: 1;
  }
  #recent-task-list details { display: block; }
  #recent-task-list summary { justify-content: flex-start; gap: 0; font-weight: 500; }
  #recent-task-list summary::after { display: none; }
  #recent-task-list .recent-record-heading {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    margin-right: 116px; min-height: 24px;
  }
  #recent-task-list .recent-record-heading strong { color: var(--text-strong); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
  #recent-task-list .recent-task-state { padding: 2px 8px; font-size: 11px; font-weight: 500; }
  #recent-task-list .recent-record-time {
    display: block; margin: 4px 116px 0 0; color: var(--muted);
    font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
  }
  #recent-task-list .recent-record-link,
  #recent-task-list .recent-record-details > summary,
  #recent-task-list .mold-summary-details > summary {
    position: absolute; right: 0; top: 18px; display: flex; align-items: center;
    min-height: 32px; padding: 4px 8px; margin: 0; border: 0; border-radius: 6px;
    background: transparent; color: var(--primary); font-size: 13px; text-decoration: none;
  }
  #recent-task-list :is(.recent-record-link, .recent-record-details > summary, .mold-summary-details > summary):hover { background: var(--surface-subtle); }
  #recent-task-list :is(.recent-record-link, .recent-record-details > summary, .mold-summary-details > summary):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
  .recent-record-open, .recent-record-details[open] .recent-record-closed { display: none; }
  .recent-record-details[open] .recent-record-open { display: inline; }
  #recent-task-list .recent-record-content { margin-top: 12px; padding: 14px 16px; background: var(--surface-subtle); border-radius: 8px; overflow-wrap: anywhere; }
  #recent-task-list .recent-record-content p { margin: 0 0 8px; color: var(--text); font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
  #recent-task-list .recent-record-content > span { font-size: 12px; color: var(--muted); }
  #recent-task-list .procurement-order-editor { margin-top: 14px; max-width: 540px; }
  #recent-task-list .mold-summary-header { display: block; margin-right: 116px; }
  #recent-task-list .mold-summary-header > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
  #recent-task-list .mold-summary-header strong { font-size: 14px; font-weight: 650; color: var(--text-strong); }
  #recent-task-list .mold-summary-header p { margin: 0; font-size: 12px; color: var(--muted-strong); }
  #recent-task-list .mold-summary-updated { flex-basis: 100%; margin-top: 0; font-size: 12px; color: var(--muted); }
  #recent-task-list .mold-summary-details { margin: 0; }
  #recent-task-list .mold-summary-table-wrap { margin-top: 14px; }
  .history-shipment-card[id] { scroll-margin-top: 16px; }
}
@media screen and (max-width: 480px) {
  #recent-task-list :is(.recent-record-heading, .mold-summary-header) { margin-right: 90px; }
  #recent-task-list .recent-record-time { margin-right: 90px; font-size: 11px; }
  #recent-task-list :is(.recent-record-link, .recent-record-details > summary, .mold-summary-details > summary) { padding: 4px 2px; font-size: 12px; }
  #recent-task-list .mold-summary-closed { max-width: 86px; text-align: right; }
  #recent-task-list .recent-record-content { padding: 12px; }
}
