.customs-workspace { max-width: 1300px; margin: 0 auto; padding-bottom: 64px; }
.customs-heading, .customs-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.customs-heading { margin-bottom: 22px; }
.customs-heading h1 { margin: 3px 0 4px; }
.customs-heading p, .customs-section-head p { color: var(--color-text-secondary); margin: 4px 0 0; }.customs-rules { color: var(--color-text-secondary); font-size: var(--text-caption); white-space: nowrap; }
.customs-tabs, .customs-subtabs { flex-wrap: wrap; }.customs-section-head { }.customs-list { border: 1px solid var(--color-line); border-radius: var(--radius-lg); background: var(--color-surface); overflow: hidden; }
.customs-list-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 0; border-bottom: 1px solid var(--color-line); border-radius: 0; background: var(--color-surface); padding: 18px 22px; text-align: left; }
.customs-list-row:last-child { border-bottom: 0; }
.customs-list-row strong, .customs-files strong { display: block; }
.customs-list-row small, .customs-files small { color: var(--color-text-secondary); display: block; margin-top: 3px; overflow-wrap: anywhere; }
.customs-empty { padding: 35px; color: var(--color-text-secondary); text-align: center; }
.customs-back { margin-bottom: 18px; }
.customs-back button { border: 0; background: transparent; padding-left: 0; color: var(--color-accent); }.customs-panel h3 { margin: 0 0 8px; }
.customs-panel h4 { margin: 18px 0 8px; }
.customs-panel > p { margin-top: 0; }
.customs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.customs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--color-text-label); font-size: var(--text-small); font-weight: 600; }
.customs-field input, .customs-field select, .customs-field textarea, .customs-review input, .customs-allocation input, .customs-workspace textarea { width: 100%; min-width: 0; color: var(--color-text); font-weight: 400; }
.customs-field textarea { resize: vertical; }
.customs-field input[type=file] { padding: 6px; }
.customs-check, .customs-check-grid label { display: flex; align-items: center; gap: 8px; font-size: var(--text-small); color: var(--color-text-strong); }
.customs-check input, .customs-check-grid input { width: 17px; height: 17px; accent-color: var(--color-accent); }
.customs-check-grid { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 12px 0; }
.customs-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: end; }
.customs-picker select { grid-column: 1 / -1; width: 100%; }
.customs-subcard { margin: 14px 0; min-width: 0; }
.customs-subcard legend { font-weight: 700; color: var(--color-text); padding: 0 6px; }
.customs-subcard > .muted, .customs-panel .customs-details dd, .customs-panel > .muted { overflow-wrap: anywhere; }
.customs-remove { float: right; color: var(--color-danger); }
.customs-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.customs-allocation { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; border-radius: var(--radius-md); background: var(--color-canvas); }
.customs-allocation strong { flex-basis: 100%; font-size: var(--text-small); }
.customs-allocation label { display: flex; flex-direction: column; gap: 4px; width: 160px; font-size: var(--text-caption); }
.customs-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.customs-summary > div { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: 16px; }
.customs-summary small { display: block; color: var(--color-text-secondary); }
.customs-summary strong { display: block; margin-top: 5px; font-size: var(--text-h2); }
.customs-issues { display: grid; gap: 8px; margin: 15px 0; }
.customs-issue { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: baseline; }
.customs-issue strong { min-width: 52px; }
.customs-issue code { color: var(--color-text-secondary); font-size: var(--text-caption); overflow-wrap: anywhere; }
.customs-message { margin: 12px 0; }
.customs-revision { margin-top: 22px; border-top: 1px solid var(--color-line); padding-top: 20px; }
.customs-files > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--color-line); }
.customs-print-warning { margin: 7px 0 0; }
.customs-import-source { padding: 12px; border-bottom: 1px solid var(--color-line); }
.customs-import-source pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; padding: 12px; background: var(--color-canvas); }
.customs-review { margin-top: 24px; padding: 20px; border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface-subtle); }
.customs-review .customs-check { margin: 8px 0; }
.customs-review form > .customs-field { margin-top: 18px; }
.customs-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.customs-details div { padding: 8px 0; border-bottom: 1px solid var(--color-line); }
.customs-details dt { color: var(--color-text-secondary); font-size: var(--text-caption); }
.customs-details dd { margin: 2px 0; overflow-wrap: anywhere; }
.customs-details dd small { display: block; margin-top: 3px; color: var(--color-text-secondary); font-size: var(--text-caption); }
.customs-declaration-readback { background: var(--color-surface); }
.customs-filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 18px; }
.customs-filters .customs-field { min-width: 170px; }
.customs-workspace details { margin-top: 15px; }
.customs-workspace summary { cursor: pointer; color: var(--color-accent); font-weight: 600; }
.customs-workspace details[open] > .customs-field, .customs-workspace details[open] > textarea { margin-top: 12px; }
.customs-workspace details textarea { width: 100%; }
.customs-workspace { min-width: 0; color: var(--color-text); }.customs-workspace button { transition: background-color 160ms ease-out; }
.customs-workspace button:active { filter: brightness(.95); }
.customs-workspace [hidden] { display: none !important; }
.customs-workspace [aria-invalid=true] { border-color: var(--color-danger); }
.customs-workspace main { min-width: 0; animation: customs-enter 120ms ease-out; }.customs-row-actions, .customs-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.customs-pagination { margin: 16px 0; }
.customs-pagination span { font-size: var(--text-caption); color: var(--color-text-secondary); }
.customs-table-wrap { overflow-x: auto; max-width: 100%; }
.customs-data-table { width: 100%; border-collapse: collapse; text-align: left; }.customs-data-table td { overflow-wrap: anywhere; }
.customs-data-table small { display: block; color: var(--color-text-secondary); margin-top: 4px; }
.customs-list-row > span, .customs-files > div > span { min-width: 0; }
.customs-list-row strong, .customs-files strong { overflow-wrap: anywhere; }
.customs-permission-refresh { margin: 0 0 12px; }
.customs-conflict { border-color: var(--color-danger); }
.customs-conflict-rows { display: grid; gap: 12px; }
.customs-conflict-row { border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: 12px; }
.customs-conflict-row h4 { margin: 0; }
.customs-conflict-row dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.customs-conflict-row dt { color: var(--color-text-secondary); font-size: var(--text-caption); }
.customs-conflict-row dd { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.customs-frozen-snapshot pre { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.customs-template-mapping { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-caption); }
.customs-leave { border-color: var(--color-warning); }
.customs-generation-error { margin: 16px 0; }
.customs-workspace form > .customs-panel:last-child > .customs-actions { position: sticky; bottom: var(--customs-keyboard-inset,0px); background: var(--color-surface); padding: 12px 0 max(12px,env(safe-area-inset-bottom)); z-index: 1; }
@keyframes customs-enter { from { opacity: .6; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .customs-workspace main { animation: none; } .customs-workspace button { transition: none; } }
@media (max-width: 1050px) { .customs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .customs-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) {
  .customs-grid, .customs-summary, .customs-details, .customs-conflict-row dl { grid-template-columns: 1fr; }
  .customs-heading, .customs-section-head { align-items: stretch; flex-direction: column; }  .customs-list-row { padding: 14px; flex-wrap: wrap; gap: 12px; }
  .customs-files > div { flex-direction: column; align-items: stretch; }  .customs-workspace input, .customs-workspace select, .customs-workspace textarea, .customs-field { font-size: var(--text-h3); }
  .customs-actions, .customs-row-actions { gap: 8px; }
  .customs-actions > button { flex: 1 1 auto; }  .customs-allocation label { width: 100%; }
  .customs-check span { overflow-wrap: anywhere; }
  .customs-filters .customs-field { min-width: 0; width: 100%; }
  .customs-data-table, .customs-data-table tbody, .customs-data-table tr, .customs-data-table td { display: block; }
  .customs-data-table thead { display: none; }
  .customs-data-table tr { border-bottom: 1px solid var(--color-line); padding: 12px 0; }
  .customs-data-table td { border: 0; padding: 6px 0; }
  .customs-data-table td::before { content: attr(data-label); display: block; color: var(--color-text-secondary); font-size: var(--text-caption); margin-bottom: 3px; }
}
