:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172a37;
  background: #f3f6f8;
  color-scheme: light;
  line-height: 1.5;
  --ink: #172a37;
  --muted: #566a77;
  --border: #dbe4e9;
  --accent: #126858;
  --accent-dark: #0c5144;
  --soft: #eef7f4;
  --surface: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #6bb8a9; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.topbar { background: #122b38; color: #fff; }
.topbar-inner { max-width: 1200px; margin: auto; padding: 14px 26px; display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 72px; }
.brand, .account, .workspace-actions { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 1.04rem; letter-spacing: .08em; }
.brand div span { color: #c0d4d8; display: block; font-size: .78rem; }
.brand-mark { width: 42px; height: 42px; padding: 8px; display: grid; place-items: center; background: #2a534f; border: 1px solid #527c74; border-radius: 11px; color: #d1f7e9; }
.brand-mark svg { width: 100%; }
.account { font-size: .9rem; min-width: 0; }
.account span { overflow-wrap: anywhere; text-align: right; }
.account .quiet { color: #e3f0ef; border-color: #50747b; }

.shell { max-width: 1200px; margin: auto; padding: 30px 26px 56px; }
.button { border: 1px solid transparent; border-radius: 9px; min-height: 41px; padding: 7px 14px; font-weight: 650; white-space: nowrap; }
.primary { color: #fff; background: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.secondary { color: var(--ink); background: var(--surface); border-color: var(--border); }
.secondary:hover:not(:disabled) { background: #eaf1f4; }
.quiet { color: var(--accent-dark); background: transparent; border-color: var(--border); }
.quiet:hover:not(:disabled) { background: #6f9f9d22; }
.notice { background: #e3f3ee; color: #144a40; border: 1px solid #b9ded3; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; }
.notice[data-error] { color: #842f2b; background: #fff1ef; border-color: #ebc7c3; }
.eyebrow { color: var(--accent-dark); font-size: .78rem; font-weight: 700; letter-spacing: .12em; }
.muted { color: var(--muted); font-size: .81rem; }

.login-card { max-width: 450px; margin: min(8vh, 65px) auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 17px; padding: 28px; box-shadow: 0 14px 50px #122b3810; }
.login-intro h1 { font-size: 1.75rem; margin: 6px 0; line-height: 1.25; }
.login-intro p, .privacy-line { color: var(--muted); font-size: .9rem; }
#login-form { display: grid; margin-top: 18px; gap: 6px; }
#login-form label { font-weight: 650; font-size: .9rem; margin-top: 7px; }
#login-submit { margin-top: 10px; }
input, select, textarea { border: 1px solid #bdccd3; border-radius: 8px; background: #fff; color: var(--ink); padding: 8px 10px; min-width: 0; min-height: 42px; }
input::placeholder, textarea::placeholder { color: #657985; }
.privacy-line { margin-top: 17px; font-size: .8rem; }

.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.workspace-heading h1 { font-size: clamp(1.55rem, 3.2vw, 2.1rem); line-height: 1.25; margin-top: 3px; }
.workspace-actions { flex-wrap: wrap; justify-content: flex-end; }
.workspace-grid { display: grid; grid-template-columns: minmax(280px, .83fr) minmax(0, 1.47fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.queue, .detail { min-width: 0; }
.queue { padding: 16px; }
.queue-header { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; margin-bottom: 11px; }
.queue-header h2, .detail h2 { font-size: 1.13rem; }
.filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; border: 1px solid var(--border); background: #f2f6f8; border-radius: 9px; padding: 3px; }
.filters button { min-height: 37px; background: transparent; color: #506573; border: 0; border-radius: 6px; font-size: .79rem; font-weight: 640; padding: 3px; white-space: nowrap; }
.filters button[aria-pressed=true] { background: #fff; color: var(--accent-dark); box-shadow: 0 1px 4px #173b4320; }
.filters [data-count] { color: #59747b; font-size: .72rem; font-variant-numeric: tabular-nums; margin-left: 1px; }
[data-automatic] .filters [data-filter=pending] { white-space: normal; }
#queue-search { width: 100%; min-height: 39px; margin: 10px 0 5px; font-size: .86rem; }
.queue-list { margin: 0 -5px; }
.order-row { display: block; text-align: left; width: 100%; border: 1px solid transparent; border-bottom-color: #e9eff2; background: #fff; padding: 12px 9px; color: var(--ink); border-radius: 8px; }
.order-row:hover { background: #f2f7f8; }
.order-row[aria-current=true] { border-color: #91c6b8; background: var(--soft); }
.row-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.row-top strong { min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.row-meta { display: block; margin-top: 4px; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.status { display: inline-block; border-radius: 99px; padding: 3px 8px; font-size: .75rem; font-weight: 680; white-space: nowrap; color: #485f69; background: #edf1f3; }
.status[data-status=PENDING] { color: #774c0a; background: #fff0d7; }
.status[data-status=PROCESSING] { color: #185376; background: #e7f3fb; }
.status[data-status=COMPLETED], .status[data-status=SUCCESS] { color: #185746; background: #e1f3eb; }
.status[data-status=PARTIAL] { color: #6c4b11; background: #faf0d5; }
.status[data-status=FAILED] { color: #832f2f; background: #fbe9e7; }
.empty-copy { padding: 18px 8px; color: var(--muted); font-size: .85rem; }

.detail { padding: 19px; scroll-margin-top: 12px; }
.empty-detail { text-align: center; padding: 45px 12px; color: var(--muted); font-size: .88rem; }
.empty-detail h2 { color: var(--ink); margin: 9px 0 4px; }
.empty-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; color: #577785; background: #edf3f5; border-radius: 9px; font-size: 1.4rem; }
.detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.detail-heading h2 { margin: 6px 0 3px; font-size: 1.24rem; overflow-wrap: anywhere; }
.detail-hint { margin-top: 12px; padding: 10px 12px; font-size: .85rem; color: var(--muted); background: #f2f6f8; border-radius: 8px; }
.workflow-note { margin: -5px 0 15px; background: #eaf3f6; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 13px 0; gap: 9px 14px; }
.info-grid div { border-bottom: 1px solid #e9eff2; padding: 3px 0 8px; min-width: 0; }
.info-grid dt { color: var(--muted); font-size: .76rem; }
.info-grid dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: .9rem; }
.passenger { margin: 13px 0 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.passenger h3 { font-size: .97rem; overflow-wrap: anywhere; }
.passenger .info-grid { margin: 8px 0 0; }
.passenger-result { margin-top: 8px; font-size: .86rem; overflow-wrap: anywhere; }
.result-fields { display: grid; grid-template-columns: minmax(105px, .75fr) minmax(0, 1.35fr); align-items: start; gap: 9px; margin-top: 10px; }
.result-fields label { display: grid; gap: 4px; font-size: .8rem; font-weight: 650; min-width: 0; }
.result-fields input, .result-fields select, .result-fields textarea { width: 100%; }
.result-fields textarea { min-height: 66px; resize: vertical; }
.result-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.result-title { margin-top: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .shell { padding: 20px 14px 40px; }
  .topbar-inner { padding: 11px 14px; min-height: 63px; }
  .workspace-actions { gap: 6px; }
  #last-updated { display: none; }
  .detail { padding: 15px; }
}

@media (max-width: 360px) {
  .workspace-heading { align-items: flex-start; }
  .login-card { padding: 19px; }
  .result-fields { grid-template-columns: 1fr; }
  .detail-heading { flex-wrap: wrap; }
}
