:root {
  color-scheme: light;
  --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font: 400 14px/1.5 var(--font-ui);
  color: #141922;
  background: #f2f4f7;
  --accent: #2747c9;
  --border: #d9dee6;
  --muted: #586172;
}
* { box-sizing: border-box; }
body { margin: 0; }
.workspace { display: grid; grid-template-columns: minmax(285px, 325px) minmax(0, 1fr); height: 100dvh; }
.sidebar { min-width: 0; padding: 16px; overflow: auto; border-right: 1px solid var(--border); background: #fff; }
.sidebar h2 { margin: 0 0 12px; font-size: 18px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
#create-panel { margin-top: 14px; }
.main-view { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.main-view > [hidden] { display: none; }
.view-switch { display: flex; gap: 4px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.view-switch button { background: transparent; color: var(--muted); padding: 6px 11px; }
.view-switch button[aria-pressed="true"] { color: var(--accent); background: #eef2ff; border-color: #ccd5fc; }
#back-from-map { display: none; color: var(--accent); font-size: 13px; font-weight: 500; text-decoration: none; align-items: center; min-height: 44px; padding: 6px 9px; }
#back-from-map:hover { text-decoration: underline; }
.map-page { grid-template-columns: minmax(0, 1fr); }
.map-page .main-view { grid-template-rows: auto auto minmax(0, 1fr); }
.map-page .sidebar, .map-page .view-switch button { display: none; }
.map-page #back-from-map { display: inline-flex; }
.map-page .view-switch { align-items: center; justify-content: space-between; }
.map-page .view-switch .account-field span { display: none; }
.map-page .view-switch select { max-width: 170px; min-height: 36px; font-size: 16px; }
.map-overview { background: #fff; border-bottom: 1px solid var(--border); }
.map-overview summary { padding: 12px 16px; }
.map-overview #shipment-details { max-height: 40dvh; overflow: auto; margin: 0; padding: 0 16px 12px; }
.process-map { width: 100%; height: 100%; min-width: 0; border: 0; }
.funnel { min-width: 0; overflow: auto; padding: 20px 16px; }
.funnel-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.funnel-header h1 { font-size: 22px; font-weight: 650; margin: 0; }
.funnel-tools { display: flex; align-items: center; gap: 6px; max-width: 100%; margin-left: auto; }
.funnel-tools .account-field { position: relative; }
.funnel-tools .account-field span { display: none; }
.funnel-tools .account-field::after { content: ""; position: absolute; top: 50%; right: 7px; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-75%) rotate(45deg); pointer-events: none; }
.funnel-tools select { appearance: none; max-width: 176px; min-height: 36px; padding: 4px 22px 4px 4px; border: 0; background: transparent; color: inherit; cursor: pointer; }
#refresh-funnel { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; }
.funnel > #mine-control { width: fit-content; margin: 0 0 12px auto; }
#mine-control[hidden] { display: none; }
.funnel .message { margin-bottom: 12px; }
.funnel #new-shipment { width: 100%; min-height: 44px; margin-bottom: 12px; }
.funnel #create-panel { max-width: 560px; margin: 0 0 16px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.funnel-board { display: flex; align-items: flex-start; gap: 10px; overflow-x: auto; padding: 4px 4px 12px; }
.funnel-column { display: grid; gap: 8px; flex: 0 0 222px; min-height: 106px; align-content: start; padding: 8px; border-radius: 10px; background: #e7ebf1; }
.funnel-column-title { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 2px 4px; font-size: 13px; font-weight: 650; }
.funnel-count { color: var(--muted); font: 500 12px/1.6 var(--font-mono); }
.funnel-card { padding: 10px; }
.funnel-card:hover { border-color: var(--accent); }
.funnel-card .shipment-object { margin-top: 3px; }
.funnel-progress { display: flex; gap: 2px; margin: 8px 0 6px; }
.funnel-progress-display { display: block; }
.funnel-progress-caption { display: none; }
.funnel-segment { flex: 1; min-width: 0; height: 5px; border-radius: 2px; background: #d9dee6; }
.funnel-segment.closed { background: #237b56; }
.funnel-segment.current { background: var(--accent); }
.funnel-status { display: block; margin: 5px 0; color: var(--accent); font-size: 12px; font-weight: 600; }
form { display: grid; gap: 14px; }
form[hidden] { display: none; }
fieldset { margin: 0; min-width: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
input, button, select { font: inherit; }
.account-panel { display: grid; gap: 10px; margin-bottom: 18px; }
.account-panel:not(:has(.account-field)) { display: none; }
.account-panel [hidden] { display: none; }
.account-panel select { min-height: 38px; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 6px; }
input[name=request_number], input[name=order_number], input[name=invoice_number] {
  font-family: var(--font-mono);
  font-size: 12px;
}
input { width: 100%; min-height: 42px; padding: 7px 9px; border: 1px solid #adb8c8; border-radius: 6px; }
input[type=checkbox] { width: 18px; min-height: 18px; margin: 0; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.order-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; margin-bottom: 10px; }
.remove-order { grid-column: 2; }
button { justify-self: start; border: 1px solid transparent; border-radius: 7px; padding: 9px 12px; background: var(--accent); color: white; cursor: pointer; font-size: 13px; font-weight: 500; }
.secondary { color: var(--accent); background: #f0f3ff; border-color: #ccd5fc; }
.text-button { padding-inline: 0; border: 0; background: transparent; color: var(--accent); }
.text-button:hover:not(:disabled) { text-decoration: underline; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.message { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.message:empty { display: none; }
.message.error { color: #9d2721; }
.shipments { display: grid; gap: 8px; margin-top: 14px; }
#registry-message { margin-top: 12px; }
.shipment { width: 100%; text-align: left; color: inherit; background: #fff; border-color: var(--border); overflow-wrap: anywhere; }
.shipment[aria-current="true"] { background: #eef2ff; border-color: var(--accent); }
.shipment-number { font: 500 13px/1.5 var(--font-mono); }
.shipment-stage { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 3px; }
.shipment-object { display: block; font-weight: 600; margin-bottom: 2px; }
.shipment-progress { display: block; width: 100%; height: 6px; margin-top: 8px; accent-color: var(--accent); }
.shipment-body h3 { margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.shipment-body h3.shipment-number { font-size: 13px; font-weight: 500; }
summary { cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.shipment-body { margin-top: 10px; }
.shipment-body p { margin: 0 0 8px; overflow-wrap: anywhere; }
.shipment-next-action { padding: 10px 12px; margin-bottom: 12px; border: 1px solid #ccd5fc; border-radius: 7px; background: #f0f3ff; }
.shipment-next-action h3 { margin-top: 0; }
.shipment-next-action p:last-child { margin-bottom: 0; }
.orders { margin: 0 0 14px; padding-left: 23px; overflow-wrap: anywhere; }
.trip { padding-top: 12px; border-top: 1px solid var(--border); }
.document { margin-top: 8px; padding: 8px; border-radius: 6px; background: #f2f4f7; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 12.5px/1.5 var(--font-mono); }
#load-more { margin-top: 12px; }
@media (max-width: 720px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .view-switch { display: none; }
  .main-view { grid-template-rows: minmax(0, 1fr); }
  .map-page .view-switch { display: flex; padding: 4px 8px; }
  .map-overview button, .map-overview input:not([type=checkbox]) { min-height: 44px; }
  .map-overview input:not([type=checkbox]) { font-size: 16px; }
  .funnel { padding: 14px 12px 24px; }
  .funnel-header { margin-bottom: 12px; }
  .funnel-header h1 { font-size: 20px; }
  .funnel-tools select { max-width: 136px; min-height: 44px; font-size: 16px; }
  #refresh-funnel { width: 44px; height: 44px; }
  .funnel #shipment-create button { min-height: 44px; }
  .funnel #shipment-create input:not([type=checkbox]) { font-size: 16px; min-height: 44px; }
  .funnel-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; overflow: visible; padding: 2px; }
  .funnel-column { min-height: 0; }
  .funnel-column.is-empty { order: 1; min-height: 48px; align-content: center; }
  .funnel-column-title { font-size: 14px; }
  .funnel-card { min-height: 44px; padding: 12px; }
  .funnel-progress-caption { display: block; color: var(--muted); font-size: 12px; }
}
