/* Design tokens and shared browser defaults. Application components live in design.css. */
:root {
  color-scheme: light;
  /* A vivid orange for brand recognition; deeper action orange supports readable white text. */
  --brand: #f37021;
  --brand-action: #c45100;
  --brand-hover: #ab4300;
  --brand-ink: #a74400;
  --brand-on: #ffffff;
  --brand-soft: #fff2e9;
  --brand-line: #f3bf9d;
  --ink: #26364a;
  --muted: #6b7788;
  --subtle: #94a3b8;
  --canvas: #fbf8f3;
  --surface: #ffffff;
  --surface-subtle: #eef4f7;
  --line: #dce4ea;
  --line-strong: #c7d2dc;
  --sidebar: #f1f5f7;
  --sidebar-text: #536276;
  --sidebar-active: var(--brand-action);
  --success: #15805b;
  --success-soft: #edf8f2;
  --warning: #946000;
  --warning-soft: #fff8e8;
  --danger: #b93838;
  --danger-soft: #fff1f1;
  --radius: 8px;
  --control-radius: 6px;
  --shadow-menu: 0 12px 32px #0f172a1a, 0 2px 6px #0f172a08;
  --focus-ring: 0 0 0 3px #f3702129;
  /* Application typography follows the product-cost workspace scale. */
  --font-caption: 12px;
  --font-body: 13px;
  --font-section: 14px;
  --font-dialog-title: 16px;
  --font-page-title: 20px;
  --font-auth-title: 24px;
  --font-metric: 24px;
  /* Compatibility aliases for existing business renderers. */
  --orange: var(--brand);
  --orange-soft: var(--brand-soft);
  --navy: var(--ink);
  --blue: #55748e;
  --blue-soft: var(--surface-subtle);
  --bg: var(--canvas);
  --green: var(--success);
}

* { box-sizing: border-box; }
html { min-width: 320px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: var(--font-body)/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--brand-action); outline-offset: 3px; }
h1:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--font-page-title); line-height: 1.4; font-weight: 600; letter-spacing: -.025em; }
h2 { font-size: var(--font-section); line-height: 1.5; font-weight: 600; }
h3 { font-size: var(--font-section); line-height: 1.6; font-weight: 600; }
p { color: var(--muted); }
small { font-size: var(--font-caption); }
a { color: var(--brand-ink); text-underline-offset: 3px; }
input::placeholder, textarea::placeholder { color: #8a97a8; opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-action); }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Neutral table defaults are shared with exported documents. */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { font-weight: 500; color: var(--muted); text-align: left; background: var(--blue-soft); padding: 12px 14px; white-space: nowrap; }
td { padding: 14px; border-top: 1px solid var(--line); color: var(--navy); vertical-align: top; }
td small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
td b { font-weight: 500; }

/* Document layout: deliberately independent of the application theme. */
.paper{position:relative;background:white;color:#253e3a;padding:32px;min-height:640px;width:740px;margin:auto;box-shadow:0 2px 9px #26364a14;font-size:11px;line-height:1.5;overflow:hidden}
.paper.landscape{width:970px;min-height:620px;padding:26px}
.paper .draft-label{color:#aa7963;border-bottom:1px solid #eedbd0;padding-bottom:8px;font-size:10px;text-align:center;letter-spacing:.06em}
.paper-top{display:flex;justify-content:space-between;gap:20px;align-items:start;margin-top:21px;padding-bottom:17px;border-bottom:2px solid #395c50}
.paper-top h2{font-size:21px;color:#355547;text-align:right}
.paper-top p{font-size:10px;text-align:right}
.paper-brand{font-size:15px;font-weight:600}
.paper-brand small{display:block;font-weight:400;font-size:10px;color:#647368;margin-top:5px}
.parties{display:grid;grid-template-columns:1fr 1fr;gap:22px;background:#f6f9f7;padding:13px;margin-top:16px}
.parties b{display:block;margin-top:4px}
.paper p{color:inherit}
.paper .trade-line{padding:13px 0;font-size:10px}
.paper table{font-size:10px;table-layout:fixed;word-wrap:break-word}
.paper th{background:#365b49;color:white;padding:9px 6px;font-size:9px;white-space:normal}
.paper td{padding:10px 6px;color:#263e32;border-color:#e0e8e1}
.paper td small{font-size:9px;line-height:1.5;color:#66776e}
.paper .total-row{background:#f1f6f2;font-weight:600}
.paper .paper-note{margin-top:18px;font-size:10px;line-height:1.8}
.signatures{display:grid;grid-template-columns:1fr 1fr;gap:50px;margin-top:35px;font-size:10px}
.signatures div{border-top:1px solid #9eafa5;padding-top:8px}
.page-foot{margin-top:28px;display:flex;justify-content:space-between;color:#7b867f;font-size:9px;border-top:1px solid #dce4de;padding-top:8px}
.customs-title{text-align:center;font-size:21px;letter-spacing:.06em;margin:16px 0}
.customs-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-left:1px solid #8b9792;border-top:1px solid #8b9792}
.customs-cell{border-bottom:1px solid #8b9792;border-right:1px solid #8b9792;padding:7px;min-height:48px;word-break:break-word}
.customs-cell span{display:block;color:#68766e;font-size:9px;margin-bottom:3px}
.missing{color:#a86a3d;background:#fff8ed;padding:0 3px}
.customs-body{margin-top:13px}
.customs-body th{background:#edf2ee;color:#394a40;border:1px solid #8b9792}
.customs-body td{border:1px solid #8b9792}
.customs-confirm{border:1px solid #8b9792;margin-top:13px;padding:10px;font-size:10px}
.customs-confirm p+p{margin-top:8px}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
