:root {
  color-scheme: light;
  --paper: #f7f6f3; --card: #fffefa; --ink: #212d39; --muted: #556574;
  --navy: #193854; --rule: #dfdfd8; --accent: #eaf1f5; --danger: #992f32;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none; font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); color: var(--ink); background: var(--paper); line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, .button {
  min-height: 44px; border: 1px solid transparent; padding: 8px 14px; border-radius: 9px;
  color: var(--navy); background: transparent; cursor: pointer; font-weight: 550;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
button:hover:not(:disabled), .button:hover { background: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid #245d89; outline-offset: 3px; }
.primary { background: var(--navy); color: #fff; }
.primary:hover:not(:disabled), .primary.button:hover { background: #275575; }
.secondary { border-color: var(--rule); background: var(--card); }
.danger { color: var(--danger); }
.frame { width: min(100% - 40px, 920px); margin-inline: auto; }
.top { border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); }
.bar { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.brand { gap: 9px; padding-inline: 0 6px; font-size: 1.25rem; color: var(--navy); font-weight: 740; white-space: nowrap; }
.brand img { border-radius: 8px; }
nav { display: flex; gap: 4px; }
nav button { font-size: .875rem; padding-inline: 10px; }
main.frame { padding-block: 28px calc(56px + env(safe-area-inset-bottom)); }
h1,h2,h3,p { margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -.025em; line-height: 1.3; }
h2 { font-size: 1.2rem; line-height: 1.35; }
h3 { font-size: 1rem; }
.quiet, .meta { color: var(--muted); }
.meta { font-size: .875rem; }
.section-head, .list-head, .row, .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head { margin-bottom: 15px; }
.panel, .order {
  border: 1px solid var(--rule); border-radius: 15px; background: var(--card); min-width: 0;
}
.overview { display: grid; grid-template-columns: 1.15fr 1fr; }
.overview > div { padding: 19px 22px; }
.overview > div + div { border-left: 1px solid var(--rule); }
.figure { color: var(--navy); font-size: 2.7rem; font-weight: 710; line-height: 1.16; letter-spacing: -.06em; }
.figure small { font-size: .9rem; letter-spacing: 0; font-weight: 620; }
.summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.tone-summary { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.tone-summary b { color: var(--navy); font-size: 1.25rem; }
.flow { display: grid; align-content: center; gap: 9px; }
.flow .row + .row { border-top: 1px solid var(--rule); padding-top: 9px; }
.flow .row b { color: var(--navy); white-space: nowrap; }
.sync-row { margin-block: 14px 22px; }
.list-head { margin-bottom: 12px; align-items: center; }
.filters { display: flex; align-items: center; gap: 3px; padding: 3px; background: #ecece6; border-radius: 11px; }
.filters button { min-height: 38px; font-size: .875rem; padding: 6px 12px; }
.filters [aria-pressed="true"] { background: var(--card); border-color: #d9ddd9; color: var(--navy); }
.orders { display: grid; gap: 12px; }
.order { padding: 15px 19px; position: relative; }
.card-head { margin-bottom: 6px; }
.card-title { padding: 0; min-height: 44px; text-align: left; justify-content: flex-start; font-size: 1.26rem; color: var(--navy); font-weight: 710; }
.card-title:hover { background: transparent !important; text-decoration: underline; text-underline-offset: 4px; }
.status { flex: none; border-radius: 5px; padding: 2px 7px; color: #4c4938; background: #f2eee0; font-size: .8125rem; }
.status.ship { color: #1c4b70; background: #e8f0f6; }
.status.done { color: #285844; background: #eaf2e9; }
.facts, .actions, .shortcuts { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.actions { margin-top: 10px; gap: 6px; }
.tracking-line { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tracking-line code { overflow-wrap: anywhere; font-size: .9rem; }
.latest { padding-top: 11px; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.latest p + p { margin-top: 4px; }
.empty { padding: 26px 20px; }
.empty p { margin-top: 6px; }
.back { margin: -6px 0 9px; padding-left: 0; }
.block { padding: 18px; margin-top: 14px; }
.block p + p { margin-top: 5px; }
.timeline { list-style: none; margin: 12px 0 0 6px; padding-left: 17px; border-left: 1px solid #cbd4dc; }
.timeline li { position: relative; padding-bottom: 18px; overflow-wrap: anywhere; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; top: 8px; left: -21px; width: 7px; height: 7px; border-radius: 100%; background: #587389; }
.timeline li:first-child::before { background: var(--navy); }
.timeline details { font-size: .875rem; color: var(--muted); margin-top: 5px; }
details summary { cursor: pointer; min-height: 30px; }
dialog {
  background: var(--card); color: var(--ink); width: min(100% - 28px, 560px);
  inset-block: var(--visible-top, 0px) var(--keyboard-height, 0px);
  max-height: min(88dvh, calc(var(--visible-height, 100dvh) - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  overscroll-behavior: contain; padding: 18px; border: 1px solid var(--rule); border-radius: 16px;
}
dialog::backdrop { background: rgb(20 33 42 / 45%); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
form, .stack { display: grid; gap: 13px; }
label { display: grid; gap: 5px; min-width: 0; font-weight: 550; }
input, textarea, select {
  border: 1px solid #bfc8ca; border-radius: 8px; padding: 8px 10px; min-height: 44px; width: 100%;
  min-width: 0; color: var(--ink); background: #fff; font-size: max(16px, 1rem);
}
textarea { min-height: 112px; resize: vertical; }
.quantities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shortcuts { gap: 6px; }
.import-results { list-style: none; padding: 0; margin: 0; }
.import-results li { padding: 8px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.error { color: var(--danger); margin-top: 9px; }
#notice { position: fixed; inset: auto 16px max(14px, env(safe-area-inset-bottom)); margin: auto; max-width: 660px; background: var(--navy); color: white; border-radius: 10px; padding: 9px 14px; z-index: 1; }
@media (max-width: 620px) {
  .frame { width: calc(100% - 32px); }
  .bar { min-height: 56px; }
  .brand { font-size: 1.125rem; }
  .brand img { width: 27px; height: 27px; }
  main.frame { padding-top: 18px; }
  .overview { grid-template-columns: 1fr; }
  .overview > div { padding: 12px 14px; }
  .overview > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .flow { grid-template-columns: 1fr 1fr; gap: 10px; }
  .flow .row { align-items: flex-start; flex-direction: column; gap: 0; }
  .flow .row + .row { border-top: 0; padding-top: 0; border-left: 1px solid var(--rule); padding-left: 12px; }
  .figure { font-size: 2.35rem; }
  .tones { margin-top: 6px; }
  .sync-row { margin-block: 9px 14px; }
  .sync-row .meta { font-size: .8125rem; }
  .list-head { flex-wrap: wrap; gap: 6px; }
  .order { padding: 11px 13px; }
}
@media (max-width: 355px) {
  .frame { width: calc(100% - 24px); }
  .filters button { padding-inline: 8px; }
  .sync-row { gap: 5px; }
}
.order .card-title::after { content: ''; position: absolute; inset: 0; border-radius: 15px; }
.order button { position: relative; z-index: 1; }

@media (pointer: coarse) {
  .filters button { min-height: 44px; }
  button, .button { touch-action: manipulation; }
}
