.customs-documents-dialog {
  width: min(1100px, calc(100vw - 32px)); height: calc(100vh - 48px); height: calc(100dvh - 48px); max-height: none;
  padding: 0; border: 1px solid #b9cbd8; border-radius: 8px; color: #233c50;
  background: #fff; box-shadow: 0 22px 70px #142c4540; font: inherit;
}
.customs-documents-dialog[open] { display: flex; flex-direction: column; }
.customs-documents-dialog::backdrop { background: #1d344758; backdrop-filter: blur(3px); }
.customs-documents-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; background: linear-gradient(90deg, #e8eff5, #f8fafc); border-bottom: 1px solid #b5c9da; border-top: 4px solid #365e80; box-shadow: inset 0 1px 0 white; }
.customs-documents-dialog h2 { margin: 5px 0 0; font-size: 21px; font-weight: 600; }
.customs-documents-dialog header small { color: #60778a; font-size: 12px; }
.customs-documents-dialog button { font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; letter-spacing: 0; color: #294e70; border: 1px solid #a9bfd3; border-radius: 6px; padding: 8px 14px; cursor: pointer; background: linear-gradient(#fff, #eaf1f6); box-shadow: 0 2px 0 #b5c5d3; transition: background .15s, box-shadow .15s; }
.customs-documents-dialog button:hover:not(:disabled) { background: #e4eef6; box-shadow: 0 3px 6px #294e7024; }
.customs-documents-dialog button:focus-visible { outline: 2px solid #3979b5; outline-offset: 3px; }
.customs-documents-dialog button:disabled { opacity: .55; cursor: default; }
.customs-documents-dialog header button { width: 34px; height: 34px; padding: 0; font-size: 22px; }
.customs-documents-summary { padding: 15px 26px; font-size: 13px; color: #5d7282; border-bottom: 1px solid #e2eaf0; }
.customs-documents-content { flex: 1 1 0; overflow-y: auto; min-height: 0; padding: 18px 22px; overscroll-behavior: contain; background: #f5f7f9; }
.customs-document-group { display: grid; grid-template-columns: minmax(0,1fr) 190px; border: 1px solid #d2dfe8; border-radius: 8px; margin-bottom: 14px; background: white; box-shadow: 0 3px 9px #27405a08; }
.customs-document-group:last-child { margin-bottom: 0; }
.customs-document-main { min-width: 0; padding: 16px; }
.customs-document-action { padding: 20px 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; border-left: 1px solid #e0e7ed; background: #f7fafc; border-radius: 0 8px 8px 0; }
.customs-document-action button { width: 166px; min-height: 38px; padding: 8px; }
.customs-document-group.is-aggregate .customs-document-action { justify-content: center; align-items: center; }
.customs-aggregate-description { margin: 12px 0 0; color: #617587; font-size: 12px; line-height: 1.7; }
.customs-document-group.is-aggregate ul { margin-left: 0; }
.customs-documents-dialog :is([data-customs-group], [data-customs-all]) { border-color: #d3b77d; border-top-color: #ead7ad; border-bottom-color: #ae8b4c; background: linear-gradient(180deg, #fffefa 0%, #faf2de 52%, #efddb6 100%); color: #60471d; box-shadow: inset 0 1px 0 #fff, 0 2px 0 #c3a263, 0 6px 12px #664c1f1c; transition: background .15s, box-shadow .15s, transform .15s; }
.customs-documents-dialog :is([data-customs-group], [data-customs-all]):hover:not(:disabled) { border-color: #c5a566; background: linear-gradient(180deg, #fff, #fcf6e9 50%, #f2e4c6); color: #503811; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #b89555, 0 9px 16px #664c1f26; transform: translateY(-1px); }
.customs-documents-dialog :is([data-customs-group], [data-customs-all]):active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 2px #60471d1a; }
.customs-document-count b { font-size: 22px; font-weight: 600; color: #294e70; margin-right: 3px; font-variant-numeric: tabular-nums; }
.customs-document-group.is-empty { box-shadow: none; background: #fafbfc; }
.customs-document-group-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.customs-document-group h3 { margin: 0; padding: 7px 10px; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; border: 1px solid #c4d4e1; border-radius: 5px; background: linear-gradient(#fbfdff, #eaf1f6); box-shadow: inset 0 1px 0 #fff, 0 2px 0 #cedbe5; color: #234563; }
.customs-document-index { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; border: 1px solid #cfdae3; background: #f0f5f8; margin-right: 10px; color: #526f87; font-size: 12px; font-variant-numeric: tabular-nums; }
.customs-document-group-head p { margin: 7px 0 0 38px; font-size: 12px; color: #698093; overflow-wrap: anywhere; }
.customs-document-count { flex-shrink: 0; color: #698093; font-size: 12px; }
.customs-document-group ul { list-style: none; padding: 0; margin: 14px 0 0 38px; }
.customs-document-group li { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid #edf1f4; }
.customs-document-group li small { flex-shrink: 0; }
.customs-document-group li > div { min-width: 0; }
.customs-document-group li strong { display: block; font-size: 14px; font-weight: 400; color: #273541; overflow-wrap: anywhere; }
.customs-document-group li small { display: block; font-size: 11px; margin-top: 5px; color: #788b99; }
.customs-document-empty { font-size: 12px; color: #82929e; margin: 12px 0 0 26px; }
.customs-documents-dialog footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 26px; border-top: 1px solid #dce5ec; background: #f8fafc; }
.customs-documents-dialog [data-customs-all] { min-height: 38px; }
.customs-documents-error { color: #9c3838; font-size: 13px; padding: 10px 26px; margin: 0; }
@media (prefers-reduced-motion: reduce) { .customs-documents-dialog button { transition: none; } .customs-documents-dialog :is([data-customs-group], [data-customs-all]):hover:not(:disabled) { transform: none; } }
@media (max-width: 520px) {
  .customs-documents-dialog { width: calc(100vw - 20px); height: calc(100vh - 24px); height: calc(100dvh - 24px); }
  .customs-documents-dialog > header, .customs-documents-summary, .customs-documents-dialog footer { padding: 14px 16px; }
  .customs-documents-content { padding: 12px; }
  .customs-document-group { grid-template-columns: minmax(0,1fr); }
  .customs-document-main { padding: 16px; }
  .customs-document-action { flex-direction: row; justify-content: space-between; border-left: 0; border-top: 1px solid #e0e7ed; border-radius: 0 0 8px 8px; padding: 12px 16px; }
  .customs-document-group ul { margin-left: 0; }
  .customs-documents-dialog footer { flex-wrap: wrap; }
  .customs-documents-dialog footer button { max-width: 100%; white-space: normal; }
}
.customs-tabs { display: flex; gap: 4px; padding: 0 24px; background: linear-gradient(90deg, #e8eff5, #f8fafc); border-bottom: 1px solid #b5c9da; }
.customs-tabs[hidden] { display: none; }
.customs-documents-dialog .customs-tabs button { position: relative; bottom: -1px; padding: 10px 22px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; box-shadow: none; color: #5d7282; font-size: 14px; font-weight: 600; }
.customs-documents-dialog .customs-tabs button.active { background: #fff; border-color: #b5c9da; color: #233c50; }
.customs-tabs em { margin-left: 8px; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
.customs-tabs em.todo { background: #f6d3bd; color: #7a3210; } .customs-tabs em.partial { background: #f3dfae; color: #5d3f08; }
.customs-tabs em.done { background: #cfe9d7; color: #235a33; } .customs-tabs em.none { background: #edf1f4; color: #8b9aa6; }
.customs-documents-pane { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; }
.customs-documents-pane[hidden] { display: none; }
.rcep-pane { overflow-y: auto; background: #f5f7f9; padding-bottom: 18px; overscroll-behavior: contain; }
.rcep-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 22px 4px; }
.rcep-stat { padding: 12px 16px; border: 1px solid #dbe5ec; border-radius: 10px; background: #fff; box-shadow: 0 3px 9px #27405a08; }
.rcep-stat span { display: block; color: #698093; font-size: 12px; }
.rcep-stat strong { display: block; margin-top: 4px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: #233c50; }
.rcep-stat.done strong { color: #2f7a46; } .rcep-stat.todo strong { color: #b4561d; }
.rcep-progress { height: 6px; margin: 12px 22px 4px; overflow: hidden; border-radius: 4px; background: #e6edf2; }
.rcep-progress i { display: block; height: 100%; background: linear-gradient(90deg, #4f9a66, #7cc28f); }
.rcep-change-notice { margin: 14px 22px; padding: 14px 16px; border: 1px solid #d7b978; border-radius: 8px; background: #fff8e8; color: #70501b; font-size: 13px; }
.rcep-change-notice p { margin: 8px 0; line-height: 1.7; }
.rcep-change-notice details { border-top: 1px solid #eadbb9; padding: 10px 0 0; margin-top: 10px; }
.rcep-change-notice summary { cursor: pointer; font-weight: 600; }
.rcep-change-notice h4 { margin: 12px 0 8px; font-size: 12px; }
.rcep-change-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.rcep-change-codes code { padding: 4px 8px; background: #fff; border-radius: 4px; }
.packing-delete-dialog { width: min(480px, calc(100vw - 32px)); box-sizing: border-box; padding: 0; border: 1px solid #b9cbd9; border-radius: 12px; color: #294356; background: #fff; box-shadow: 0 24px 80px #132d4b40; font-family: inherit; }
.packing-delete-dialog::backdrop { background: #17364d55; }
.packing-delete-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: #f0f5f9; border-bottom: 1px solid #dce5ec; color: #637b8f; font-size: 12px; }
.packing-delete-dialog button { font: inherit; cursor: pointer; border: 1px solid #c5d3df; border-radius: 7px; background: #fff; padding: 9px 16px; color: #365a76; }
.packing-delete-dialog header button { border: 0; background: none; padding: 0 4px; font-size: 24px; }
.packing-delete-body { padding: 18px 22px; }
.packing-delete-body h2 { font-size: 20px; margin: 0 0 16px; }
.packing-delete-body p { font-size: 13px; line-height: 1.8; margin: 10px 0; }
.packing-delete-body strong { display: block; padding: 12px; border-radius: 7px; background: #f5f7fa; overflow-wrap: anywhere; font-size: 14px; }
.packing-delete-dialog footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; background: #f8fafc; border-top: 1px solid #dce5ec; }
.packing-delete-dialog [data-delete-confirm] { background: #ad4747; border-color: #963d3d; color: #fff; }
.packing-delete-dialog button:focus-visible { outline: 2px solid #3979b5; outline-offset: 3px; }
.rcep-alert { margin: 12px 22px 0; padding: 10px 14px; border: 1px solid #e0a3a3; border-left: 5px solid #c43d3d; border-radius: 8px; background: #fdf1f1; color: #8a2c2c; font-size: 12px; }
.rcep-alert p { margin: 4px 0 0; } .rcep-alert ul { margin: 6px 0 0; padding: 0; list-style: none; }
.rcep-alert li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 2px 0; } .rcep-alert li span { color: #a35a5a; }
.rcep-note { margin: 12px 22px 0; padding: 10px 14px; border: 1px solid #c4d4e1; border-radius: 8px; background: #f4f8fb; color: #44627c; font-size: 13px; }
.rcep-note.ok { border-color: #b9d8c3; background: #f2faf4; color: #2d6a3e; }
.rcep-groups { display: grid; gap: 14px; padding: 14px 22px 0; }
.rcep-group { overflow: hidden; border: 1px solid #d2dfe8; border-radius: 10px; background: #fff; box-shadow: 0 3px 9px #27405a08; }
.rcep-group > header { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #e3ebf0; background: linear-gradient(#fbfdff, #f1f6f9); }
.rcep-group h3 { margin: 0; color: #234563; font-size: 15px; font-weight: 700; }
.rcep-count { color: #698093; font-size: 12px; }
.rcep-pill { margin-left: auto; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.rcep-pill.todo { border: 1px solid #efc4ab; background: #fdeee4; color: #8a3d14; }
.rcep-pill.done { border: 1px solid #b9d8c3; background: #e9f6ee; color: #2d6a3e; }
.rcep-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.rcep-items td { padding: 9px 14px; border-top: 1px solid #f0f3f6; vertical-align: middle; overflow-wrap: anywhere; }
.rcep-items tr:first-child td { border-top: 0; }
.rcep-items td.chk { width: 30px; } .rcep-items input { width: 16px; height: 16px; accent-color: #b4561d; }
.rcep-items td.code { width: 140px; color: #36516a; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.rcep-items td.hs { width: 150px; color: #6c8192; font-size: 12px; white-space: nowrap; }
.rcep-items td.st { width: 140px; color: #2d6a3e; font-size: 12px; text-align: right; white-space: nowrap; }
.rcep-items tr.sent td { color: #7a8c99; } .rcep-items tr.sent td.code { color: #8fa1ae; }
.rcep-others { margin: 14px 22px 0; color: #5d7282; font-size: 12px; }
.rcep-others summary { cursor: pointer; }
.rcep-others div { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.rcep-others span { padding: 3px 7px; border-radius: 4px; background: #eaf0f4; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.rcep-others em { margin-left: 4px; color: #9aabb8; font-style: normal; }
.rcep-foot { margin: 12px 22px 0; color: #8a9aa6; font-size: 11px; }
.customs-documents-dialog [data-rcep-request] { min-height: 38px; border-color: #d3b77d; background: linear-gradient(180deg, #fffefa 0%, #faf2de 52%, #efddb6 100%); color: #60471d; box-shadow: inset 0 1px 0 #fff, 0 2px 0 #c3a263; }
.customs-documents-dialog [data-rcep-request][hidden], .customs-documents-dialog [data-customs-all][hidden] { display: none; }
@media (max-width: 520px) {
  .rcep-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 12px 4px; }
  .rcep-stat strong { font-size: 20px; }
  .rcep-groups, .rcep-stats { padding-left: 12px; padding-right: 12px; }
  .rcep-items td.hs, .rcep-items td.st { display: none; }
}

/* Uploaded-without-match and missing-document factory cards use the existing neutral palette. */
.rcep-pill.none { border: 1px solid #d0d8df; background: #f3f6f8; color: #647585; }
.rcep-group-empty { margin: 0; padding: 14px 16px; color: #698093; font-size: 12px; line-height: 1.6; }

/* Shared packing documents: blue add action, quiet destructive action, existing gold download. */
.packing-upload { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:14px 0 0 38px; padding:12px 14px; border:1px dashed #aabfcf; border-radius:6px; background:#f8fbfd; }
.packing-upload > span { font-size:12px; color:#698093; }
.packing-upload small { display:block; margin-top:3px; font-size:11px; }
.customs-documents-dialog .packing-delete { padding:4px 10px; min-width:52px; box-shadow:none; border-color:#dfcaca; color:#925757; background:#fffafa; font-size:12px; }
.customs-documents-dialog [data-packing-retry][hidden] { display:none; }
.customs-documents-dialog .packing-delete:hover:not(:disabled) { background:#f8eaea; box-shadow:none; }
.customs-document-group li strong { flex:1; }
@media (max-width:520px) { .packing-upload { margin-left:0; flex-wrap:wrap; } .customs-document-group li { flex-wrap:wrap; gap:8px; } }

/* Quiet document list (2026-11): one row per factory, file type tags, inline actions. */
.customs-documents-dialog { width: min(920px, calc(100vw - 32px)); height: fit-content; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); border: 0; border-radius: 14px; box-shadow: 0 30px 80px #0f22352e, 0 0 0 1px #0f223514; color: #1c2b38; }
.customs-documents-dialog::backdrop { background: #1423334d; backdrop-filter: blur(4px); }
.customs-documents-pane, .customs-documents-content { flex: 1 1 auto; }
.customs-documents-dialog > header { align-items: flex-start; padding: 26px 32px 4px; background: #fff; border: 0; box-shadow: none; }
.customs-documents-dialog header small { display: block; color: #8a98a5; font: 500 11px ui-monospace, Menlo, monospace; letter-spacing: .14em; }
.customs-documents-dialog h2 { margin-top: 6px; font-size: 22px; font-weight: 600; letter-spacing: .02em; color: #142433; }
.customs-documents-dialog header button { width: 32px; height: 32px; border: 0; background: none; box-shadow: none; color: #9aa7b2; font-size: 20px; }
.customs-documents-dialog header button:hover:not(:disabled) { background: #f1f4f6; box-shadow: none; color: #1c2b38; }
.customs-documents-summary { padding: 0 32px 20px; border: 0; color: #7c8b97; font-size: 12.5px; }
.customs-documents-content { display: flex; flex-direction: column; padding: 0 32px; background: #fff; border-top: 1px solid #edf0f3; }
.customs-document-group { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 24px; margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid #edf0f3; border-radius: 0; background: none; box-shadow: none; }
.customs-document-group:last-child { border-bottom: 0; }
.customs-document-main { display: grid; grid-template-columns: 210px minmax(0,1fr); column-gap: 24px; padding: 0; }
.customs-document-group-head { grid-column: 1; grid-row: 1 / span 4; display: block; }
.customs-document-main > :not(.customs-document-group-head) { grid-column: 2; }
.customs-document-group h3 { display: flex; align-items: baseline; gap: 10px; padding: 0; border: 0; background: none; box-shadow: none; font-size: 14px; font-weight: 600; line-height: 1.5; color: #142433; }
.customs-document-index { flex: none; width: auto; height: auto; margin: 0; border: 0; background: none; color: #b0bbc4; font: 500 11px ui-monospace, Menlo, monospace; }
.customs-document-group-head p { margin: 4px 0 0 28px; color: #8a98a5; font-size: 11.5px; }
.customs-document-group ul { margin: 0; display: grid; gap: 2px; }
.customs-document-group li { justify-content: flex-start; gap: 12px; margin: 0 -8px; padding: 5px 8px; border: 0; border-radius: 6px; }
.customs-document-group li:hover { background: #f5f7f9; }
.customs-document-group li strong { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #2a3a48; }
.customs-document-group li strong[data-ext]::before { content: attr(data-ext); flex: none; width: 34px; padding: 2px 0; border-radius: 4px; text-align: center; font: 600 9.5px ui-monospace, Menlo, monospace; letter-spacing: .04em; background: #eef2f5; color: #5d7181; }
.customs-document-group li strong:is([data-ext=XLSX], [data-ext=XLS])::before { background: #e6f2ea; color: #2f6b44; }
.customs-document-group li strong[data-ext=PDF]::before { background: #f8e9e6; color: #9a3b2c; }
.customs-document-group li strong[data-ext=""]::before { display: none; }
.customs-document-group li small { margin: 0 0 0 4px; color: #a3afb9; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.customs-document-empty { margin: 2px 0 0; color: #a3afb9; font-size: 12.5px; }
.customs-document-action { position: static; min-width: 168px; flex-direction: row; justify-content: flex-end; align-items: center; gap: 8px; padding: 0; border: 0; background: none; border-radius: 0; }
.customs-document-count { display: none; }
.customs-documents-dialog .customs-document-action button, .customs-documents-dialog [data-customs-group] { width: auto; min-height: 30px; padding: 4px 12px; border: 1px solid #d9e0e6; border-radius: 7px; background: #fff; box-shadow: none; color: #1f3a55; font-size: 12px; font-weight: 500; transform: none; }
.customs-documents-dialog [data-customs-group]::before { content: "↓"; margin-right: 6px; font-weight: 700; }
.customs-documents-dialog .customs-document-action button:hover:not(:disabled), .customs-documents-dialog [data-customs-group]:hover:not(:disabled) { border-color: #1f3a55; background: #fff; box-shadow: none; color: #142433; transform: none; }
.customs-documents-dialog .packing-upload button { color: #5d7181; }
.customs-document-group.is-empty { background: none; }
.customs-document-group.is-empty h3 { color: #a3afb9; font-weight: 500; }
.customs-document-group.is-empty .customs-document-group-head p { color: #c2cbd2; }
.customs-document-group.is-aggregate { order: -1; margin: 14px -14px 4px; padding: 16px 14px; border: 0; border-radius: 10px; background: #f7f5ef; }
.customs-document-group.is-aggregate h3 { align-items: center; }
.customs-document-group.is-aggregate .customs-document-action { justify-content: flex-end; align-items: center; }
.customs-aggregate-tag { flex: none; padding: 1px 7px; border-radius: 4px; background: #1f3a55; color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; }
.customs-aggregate-description { display: none; }
.customs-document-group.is-aggregate li:hover { background: #efece3; }
.packing-upload { display: contents; }
.customs-documents-dialog .packing-delete { min-width: 0; margin-left: 2px; padding: 0 6px; border: 0; background: none; box-shadow: none; color: #c0a3a3; font-size: 11px; }
.customs-documents-dialog .packing-delete:hover:not(:disabled) { background: none; box-shadow: none; color: #b03a2e; }
.customs-documents-dialog footer { align-items: center; padding: 18px 32px 24px; background: #fff; border-top: 1px solid #edf0f3; }
.customs-documents-dialog footer [data-customs-close] { border: 0; background: none; box-shadow: none; color: #6f7f8c; }
.customs-documents-dialog footer [data-customs-close]:hover:not(:disabled) { background: #f1f4f6; box-shadow: none; }
.customs-documents-dialog [data-customs-all] { min-height: 40px; padding: 8px 22px; border: 0; border-radius: 8px; background: #1f3a55; color: #fff; box-shadow: 0 6px 16px #1f3a5533; font-weight: 600; }
.customs-documents-dialog [data-customs-all]:hover:not(:disabled) { border: 0; background: #142433; color: #fff; box-shadow: 0 8px 20px #1f3a5540; transform: none; }
@media (max-width: 620px) {
  .customs-documents-dialog > header, .customs-documents-summary, .customs-documents-content, .customs-documents-dialog footer { padding-left: 18px; padding-right: 18px; }
  .customs-document-group { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .customs-document-main { grid-template-columns: minmax(0,1fr); }
  .customs-document-group-head, .customs-document-main > :not(.customs-document-group-head) { grid-column: 1; grid-row: auto; }
  .customs-document-group ul { margin-top: 8px; }
  .customs-document-group li { flex-wrap: wrap; }
  .customs-document-action { min-width: 0; justify-content: flex-start; }
}
