:root {
  --bg-deep: #081320;
  --bg-panel: #0e1f33;
  --bg-card: #12273f;
  --line: #1d3a5c;
  --text: #e8eef5;
  --dim: #8fa3ba;
  --accent: #f5d742;
  --accent-2: #2ecc9f;
  --accent-3: #4da3ff;
  --warn: #ff7a45;
  --danger: #ff4d6d;
  --done: #2ecc9f;
  --purple: #c1a7f4;
  --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Consolas", "Cascadia Mono", "SFMono-Regular", monospace;
}

.delivery-tabs { display:flex; gap:8px; margin:12px 0; }
.delivery-tabs .selected { border-color:var(--accent-3); color:var(--accent-3); background:rgba(77,163,255,.12); }
.calendar-view #cards,.calendar-view #empty,.calendar-view .pagination,.calendar-view #screen-context { display:none; }
.calendar-view #sort { visibility:hidden; }
.screen-mode .delivery-tabs { display:flex; }
.delivery-calendar,.delivery-day-dialog { --cal-bg:var(--bg-panel); --cal-text:var(--text); --cal-dim:var(--dim); --cal-line:var(--line); --cal-tile:#243750; --cal-late:#ff6378; --cal-soon:#ffad54; --cal-normal:#65afff; color:var(--cal-text); background:var(--cal-bg); }
.delivery-calendar[data-theme="light"],.delivery-day-dialog[data-theme="light"] { --cal-bg:#f8fbff; --cal-text:#142338; --cal-dim:#566a82; --cal-line:#d4dfed; --cal-tile:#e8eef5; --cal-late:#bf2342; --cal-soon:#995000; --cal-normal:#1766bd; color-scheme:light; }
.delivery-calendar { border:1px solid var(--cal-line); border-radius:12px; padding:16px; margin:12px 0 24px; }
.calendar-toolbar,.calendar-navigation,.calendar-legend { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.calendar-toolbar { justify-content:space-between; }
.calendar-navigation h2 { margin:0; min-width:120px; text-align:center; font-size:20px; }
.delivery-calendar .button,.delivery-day-dialog .button { color:var(--cal-text); border-color:var(--cal-line); background:transparent; }
.calendar-context { color:var(--cal-dim); margin:10px 0; }
.calendar-legend .late { color:var(--cal-late); }.calendar-legend .soon { color:var(--cal-soon); }.calendar-legend .normal { color:var(--cal-normal); }
.calendar-scroll { overflow-x:auto; overscroll-behavior-x:contain; }
.calendar-weekdays,.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); min-width:910px; }
.calendar-weekdays { border:1px solid var(--cal-line); border-bottom:0; border-radius:8px 8px 0 0; text-align:center; padding:9px 0; font-weight:700; }
.calendar-grid { border-left:1px solid var(--cal-line); border-top:1px solid var(--cal-line); grid-auto-rows:190px; }
.calendar-cell { position:relative; display:flex; flex-direction:column; gap:4px; min-width:0; padding:6px; overflow:hidden; border-right:1px solid var(--cal-line); border-bottom:1px solid var(--cal-line); }
.calendar-cell:not(.has-orders) { align-items:center; justify-content:center; }
.calendar-cell.outside { opacity:.55; }
.calendar-cell.is-today { opacity:1; box-shadow:inset 0 0 0 2px #398bfa; }
.calendar-empty-date { display:grid; place-items:center; min-width:32px; height:32px; border-radius:7px; background:var(--cal-tile); color:var(--cal-dim); font-size:15px; }
.is-today .calendar-empty-date,.calendar-today-badge { background:#2378e5; color:#fff; }
.has-orders.late { background:color-mix(in srgb,var(--cal-late) 8%,var(--cal-bg)); }.has-orders.soon { background:color-mix(in srgb,var(--cal-soon) 8%,var(--cal-bg)); }.has-orders.normal { background:color-mix(in srgb,var(--cal-normal) 7%,var(--cal-bg)); }
.calendar-day-heading { display:flex; align-items:center; gap:5px; flex-shrink:0; width:100%; min-height:25px; padding:0 2px; border:0; background:transparent; color:var(--cal-text); }
.calendar-count { margin-left:auto; font-size:12px; color:var(--cal-dim); }
.calendar-today-badge { font-size:10px; padding:0 3px; border-radius:3px; }
.delivery-order { display:flex; flex-direction:column; gap:1px; width:100%; min-width:0; min-height:31px; flex-shrink:0; padding:2px 5px; border:1px solid var(--cal-line); border-radius:5px; background:var(--cal-bg); color:var(--cal-text); font:inherit; text-align:left; overflow:hidden; }
.delivery-order:hover { outline:1px solid var(--cal-normal); }.delivery-order:focus-visible,.calendar-day-heading:focus-visible,.calendar-more:focus-visible { outline:2px solid var(--cal-normal); outline-offset:-2px; }
.delivery-order-title { display:flex; gap:6px; min-width:0; font-size:12px; line-height:16px; }.delivery-order-title strong { max-width:55%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }.delivery-product { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.delivery-order-state { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; line-height:13px; }
.delivery-order.late .delivery-order-state { color:var(--cal-late); }.delivery-order.soon .delivery-order-state { color:var(--cal-soon); }.delivery-order.normal .delivery-order-state { color:var(--cal-normal); }
.calendar-more { border:0; padding:0; min-height:20px; background:transparent; color:var(--cal-text); font:inherit; font-size:12px; }
.delivery-day-dialog { width:min(650px,94vw); padding:20px; border:1px solid var(--cal-line); }
.delivery-day-dialog h2 { margin:0; font-size:19px; }.delivery-day-list { display:grid; gap:8px; margin:12px 0; }.delivery-day-list .delivery-order { padding:9px 12px; }.delivery-day-list .delivery-order-title { font-size:15px; line-height:22px; }.delivery-day-list .delivery-order-state { font-size:13px; line-height:20px; }.delivery-spec { font-size:12px; color:var(--cal-dim); overflow-wrap:anywhere; }
@media(max-width:700px) { .delivery-calendar { padding:10px; }.calendar-legend { gap:8px; font-size:11px; }.calendar-toolbar { gap:10px; } }

.timeline-scroll { width:100%; overflow-x:auto; overscroll-behavior-x:contain; cursor:grab; border:1px solid var(--cal-line); border-radius:8px; }
.timeline-scroll.dragging { cursor:grabbing; user-select:none; }
.timeline-stage { position:relative; min-height:620px; }
.timeline-lines { position:absolute; inset:0; pointer-events:none; overflow:visible; }
.timeline-axis { fill:color-mix(in srgb,var(--cal-tile) 80%,var(--cal-bg)); stroke:color-mix(in srgb,var(--cal-normal) 35%,var(--cal-line)); stroke-width:1; }
.timeline-tick-line { stroke:var(--cal-dim); stroke-width:1; }
.timeline-connector { stroke:var(--cal-normal); stroke-width:3; opacity:1; }
.timeline-connector.late { stroke:var(--cal-late); }.timeline-connector.soon { stroke:var(--cal-soon); }
.timeline-arrow { fill:var(--cal-normal); }.timeline-arrow.late { fill:var(--cal-late); }.timeline-arrow.soon { fill:var(--cal-soon); }
.timeline-today-band { fill:#398bfa; fill-opacity:.12; }
.timeline-today-line { stroke:#2378e5; stroke-width:3; stroke-dasharray:7 4; }
.timeline-today-label { position:absolute; z-index:2; top:8px; transform:translateX(-50%); background:#2378e5; color:white; padding:4px 10px; border-radius:6px; font-size:13px; font-weight:700; box-shadow:0 0 0 3px #398bfa35; pointer-events:none; }
.timeline-tick { position:absolute; transform:translateX(-50%); padding:5px 2px; width:46px; border:0; background:var(--cal-bg); color:var(--cal-dim); font-size:11px; text-align:center; cursor:pointer; }
.timeline-tick.has-deadline { color:var(--cal-text); font-weight:700; }
.timeline-tick.is-today { background:#2378e5; color:#fff; border-radius:6px; font-weight:700; }
.timeline-dot { position:absolute; width:14px; height:14px; transform:translate(-50%,-50%); border:2px solid var(--cal-bg); border-radius:50%; background:var(--cal-normal); pointer-events:none; }
.timeline-dot.late { background:var(--cal-late); }.timeline-dot.soon { background:var(--cal-soon); }
.timeline-today-ring { position:absolute; width:24px; height:24px; transform:translate(-50%,-50%); border:3px solid #52a8ff; border-radius:50%; box-shadow:0 0 0 3px #398bfa40; pointer-events:none; }
.timeline-today-ring.is-empty::after { content:''; position:absolute; inset:4px; border-radius:50%; background:#2378e5; }
.timeline-card.delivery-order { position:absolute; width:168px; height:112px; padding:7px 9px; gap:3px; border-color:var(--cal-normal); box-shadow:0 3px 14px #00000012; cursor:pointer; }
.timeline-card.late { border-color:var(--cal-late); }.timeline-card.soon { border-color:var(--cal-soon); }
.timeline-card .delivery-order-title { font-size:12px; }.timeline-card .delivery-order-state { font-size:12px; line-height:17px; }
.timeline-card .delivery-spec { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:10px; line-height:14px; }
.timeline-card-date { display:flex; align-items:center; gap:5px; font-size:10px; color:var(--cal-dim); line-height:14px; white-space:nowrap; }
.timeline-card-today { padding:0 4px; border-radius:4px; background:#2378e5; color:#fff; font-size:10px; font-weight:700; }
.timeline-empty { position:absolute; top:120px; left:40px; color:var(--cal-dim); }
.delivery-calendar[data-theme="light"] .button,.delivery-day-dialog[data-theme="light"] .button { color:var(--cal-text); }
.timeline-controls { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:10px 0 0; }
.timeline-controls label,.timeline-zoom-controls { display:flex; align-items:center; gap:9px; }
.timeline-controls select { padding:6px 10px; border:1px solid var(--cal-line); border-radius:6px; background:var(--cal-bg); color:var(--cal-text); }
.timeline-zoom-controls input { width:110px; accent-color:var(--cal-normal); }
.timeline-zoom-controls output { min-width:42px; text-align:center; font-size:12px; color:var(--cal-dim); }
.timeline-zoom-controls .button { min-width:36px; padding:5px 9px; }
.delivery-screen-hint { margin:6px 0; color:var(--cal-dim); font-size:12px; }
.delivery-order:disabled { opacity:1; cursor:default; }
.screen-mode.calendar-view .section-title { display:none; }
.screen-mode.calendar-view .delivery-tabs { display:flex; flex:none; margin:2px 0; }
.screen-mode.calendar-view .delivery-tabs .button { padding:4px 12px; min-height:30px; }
.screen-mode.calendar-view .delivery-calendar { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; padding:10px; margin:5px 0 0; }
.screen-mode.calendar-view .calendar-toolbar,.screen-mode.calendar-view .timeline-controls,.screen-mode.calendar-view .calendar-context,.screen-mode.calendar-view .delivery-screen-hint { flex:none; }
.screen-mode.calendar-view .calendar-context { margin:4px 0; }
.screen-mode.calendar-view .calendar-scroll { flex:1; min-height:0; overflow:auto; }
.screen-mode.calendar-view .calendar-weekdays { position:sticky; top:0; z-index:2; background:var(--cal-bg); }
.screen-mode.calendar-view .calendar-grid { height:calc(100% - 40px); min-height:672px; grid-template-rows:repeat(6,minmax(112px,1fr)); grid-auto-rows:auto; }
.screen-mode.calendar-view .calendar-day-heading { font-size:17px; }
.screen-mode.calendar-view .calendar-count { font-size:14px; }
.screen-mode.calendar-view .calendar-empty-date { font-size:17px; }
.screen-mode.calendar-view .calendar-cell .delivery-order-title { font-size:14px; line-height:20px; }
.screen-mode.calendar-view .calendar-cell .delivery-order-state { font-size:12px; line-height:16px; }
.screen-mode.calendar-view .calendar-more { font-size:14px; }
.screen-mode.calendar-view .timeline-scroll { flex:1; min-height:0; overflow:auto; }
.screen-mode.calendar-view .timeline-card { width:196px; height:132px; padding:9px 11px; gap:4px; }
.screen-mode.calendar-view .timeline-card .delivery-order-title { font-size:14px; line-height:20px; }
.screen-mode.calendar-view .timeline-card .delivery-order-state { font-size:14px; line-height:19px; }
.screen-mode.calendar-view .timeline-card .delivery-spec,.screen-mode.calendar-view .timeline-card-date { font-size:12px; line-height:16px; }
.screen-mode.calendar-view .timeline-tick { font-size:13px; }
.screen-mode.calendar-view #open-trash { display:none; }

/* Calendar view controls and dates remain readable in both themes and on screen. */
.calendar-modes { align-self:flex-start; display:inline-flex; gap:3px; padding:4px; margin-top:12px; border:1px solid var(--cal-line); border-radius:10px; background:color-mix(in srgb,var(--cal-tile) 55%,var(--cal-bg)); }
.calendar-modes button { border:0; border-radius:7px; padding:7px 14px; background:transparent; color:var(--cal-dim); font:inherit; font-weight:600; }
.calendar-modes button.selected { background:var(--cal-bg); color:var(--cal-normal); box-shadow:0 1px 5px #0002; }
.calendar-modes button:focus-visible { outline:2px solid var(--cal-normal); outline-offset:2px; }
.calendar-cell.is-weekend:not(.has-orders) { background:color-mix(in srgb,var(--cal-tile) 16%,var(--cal-bg)); }
.calendar-cell.is-past:not(.has-orders) .calendar-empty-date { opacity:.65; }
.calendar-cell.is-today .calendar-empty-date { opacity:1; }
.calendar-empty-date { min-width:48px; padding:0 7px; font-weight:600; letter-spacing:.01em; }
.calendar-cell.has-orders { padding:7px; }
.calendar-cell.has-orders.late .calendar-count { color:var(--cal-late); }
.calendar-cell.has-orders.soon .calendar-count { color:var(--cal-soon); }
.calendar-cell.has-orders.normal .calendar-count { color:var(--cal-normal); }
.calendar-count { padding:1px 5px; border-radius:5px; background:color-mix(in srgb,currentColor 10%,transparent); font-weight:700; }
.calendar-day-heading strong { font-size:15px; letter-spacing:.01em; }
.calendar-cell .delivery-order { border-color:color-mix(in srgb,var(--cal-line) 85%,var(--cal-normal)); }
.calendar-cell .delivery-order:hover { background:color-mix(in srgb,var(--cal-normal) 8%,var(--cal-bg)); }
.calendar-more { color:var(--cal-normal); font-weight:600; }
.screen-mode.calendar-view .calendar-modes { flex:none; margin-top:5px; padding:2px; }
.screen-mode.calendar-view .calendar-modes button { padding:4px 12px; }
@media(max-width:700px) { .calendar-navigation h2 { font-size:16px; } .calendar-modes { margin-top:9px; } }

/* On the timeline screen, reserve the available height for the timeline itself. */
.screen-mode.calendar-view .stats-bar,
.screen-mode.timeline-screen .delivery-screen-hint,
.screen-mode.calendar-view .data-status:not(.is-error) { display:none; }
.screen-mode.timeline-screen .delivery-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 14px; flex:none; }
.screen-mode.timeline-screen .calendar-toolbar { flex:1 1 610px; gap:6px 12px; }
.screen-mode.timeline-screen .calendar-navigation,.screen-mode.timeline-screen .calendar-legend { gap:6px; }
.screen-mode.timeline-screen .timeline-controls { flex:0 1 auto; justify-content:flex-end; padding:0; gap:10px; }
.screen-mode.timeline-screen .delivery-notices { display:flex; flex:none; align-items:center; flex-wrap:wrap; gap:4px 10px; margin:3px 0; }
.screen-mode.timeline-screen .delivery-notices p { margin:0; font-size:12px; }
.timeline-overflow-hint { font-size:12px; color:var(--cal-dim); }
.screen-mode.timeline-screen .delivery-notices p:empty,.screen-mode.timeline-screen .delivery-notices div:empty { display:none; }
.screen-mode.timeline-screen #calendar-overdue .button { padding:3px 8px; min-height:26px; font-size:12px; }
.screen-mode.timeline-screen .timeline-stage { min-height:0; }
.screen-mode.timeline-screen .timeline-card.is-compact { padding:5px 8px; gap:2px; }
.screen-mode.timeline-screen .timeline-card.is-compact > * { flex-shrink:0; }
.screen-mode.timeline-screen .timeline-card.is-compact > strong { line-height:17px; }
.screen-mode.timeline-screen .timeline-card.is-compact > .delivery-product { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; line-height:16px; }
.screen-mode.timeline-screen .timeline-card.is-compact .delivery-order-title { line-height:18px; }
.screen-mode.timeline-screen .timeline-card.is-compact .delivery-order-state { line-height:16px; }
.screen-mode.timeline-screen .timeline-card.is-compact .timeline-card-date,.screen-mode.timeline-screen .timeline-card.is-compact .delivery-spec { line-height:14px; }
.screen-mode.timeline-screen .timeline-card.is-compact .delivery-estimate,.screen-mode.timeline-screen .timeline-card.is-compact .timeline-day-hint { display:none; }

#timeline-stage .timeline-day-card { position:absolute; padding:0; gap:0; display:flex; flex-direction:column; overflow:hidden; border:1.5px solid var(--cal-normal); border-radius:9px; background:var(--cal-bg); color:var(--cal-text); box-shadow:inset 0 0 0 .5px var(--timeline-accent),0 4px 16px #0002; cursor:default; }
#timeline-stage .timeline-day-card.late { border-color:var(--cal-late); }
#timeline-stage .timeline-day-card.soon { border-color:var(--cal-soon); }
.timeline-day-header { display:flex; flex:none; flex-direction:column; justify-content:center; gap:1px; width:100%; height:32px; padding:3px 10px; border:0; background:color-mix(in srgb,var(--cal-normal) 8%,var(--cal-bg)); color:var(--cal-text); text-align:left; font:inherit; }
.timeline-day-card.late .timeline-day-header { background:color-mix(in srgb,var(--cal-late) 8%,var(--cal-bg)); }
.timeline-day-card.soon .timeline-day-header { background:color-mix(in srgb,var(--cal-soon) 8%,var(--cal-bg)); }
.timeline-day-summary { display:flex; align-items:center; justify-content:flex-start; gap:6px; width:100%; font-size:13px; line-height:18px; }
.timeline-day-date { display:flex; align-items:center; gap:6px; font-weight:700; }
.timeline-day-count { font-size:11px; color:var(--cal-dim); }
.timeline-day-status { color:var(--cal-normal); font-size:13px; line-height:18px; white-space:nowrap; font-weight:700; }
.timeline-day-count { margin-left:auto; white-space:nowrap; }
.timeline-day-card.late .timeline-day-status { color:var(--cal-late); }.timeline-day-card.soon .timeline-day-status { color:var(--cal-soon); }
.timeline-order-row { flex:none; width:100%; height:var(--timeline-row-height); padding:4px 10px; border:0; border-top:1px solid var(--cal-line); background:transparent; color:var(--cal-text); text-align:left; font:inherit; overflow:hidden; }
.timeline-row-main { display:flex; gap:7px; align-items:baseline; min-width:0; line-height:17px; font-size:12px; }
.timeline-row-main strong { flex:none; max-width:58%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.timeline-row-product,.timeline-row-info { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.timeline-row-product { min-width:0; }.timeline-row-info { display:flex; gap:7px; color:var(--cal-dim); font-size:11px; line-height:15px; }
.timeline-row-spec { min-width:0; overflow:hidden; text-overflow:ellipsis; color:var(--cal-text); }
.timeline-row-measures { flex:none; color:var(--cal-text); }
.timeline-measure-unit { color:var(--cal-dim); font-size:inherit; font-weight:400; }
.timeline-urgent-badge { flex:none; margin-left:auto; padding:0 4px; border:1px solid #ff9a36; border-radius:4px; background:#ff91242b; color:#ffac52; font-size:11px; line-height:16px; font-weight:800; }
.delivery-calendar[data-theme="light"] .timeline-urgent-badge { color:#a94700; background:#fff0dd; border-color:#dd790d; }
.timeline-paused-badge { flex:none; color:#78cce9; font-size:11px; }
.timeline-day-more { flex:none; width:100%; height:26px; padding:2px 8px; border:0; border-top:1px solid var(--cal-line); background:transparent; color:var(--cal-normal); font:inherit; font-size:12px; text-align:center; }
.timeline-order-row:hover,.timeline-day-header:hover,.timeline-day-more:hover { background:color-mix(in srgb,var(--cal-normal) 10%,var(--cal-bg)); }
.timeline-order-row:focus-visible,.timeline-day-header:focus-visible,.timeline-day-more:focus-visible { outline:2px solid var(--cal-normal); outline-offset:-2px; }
.screen-mode.timeline-screen .timeline-row-main { font-size:13px; }

/* Timeline colors connect a date to its frame; they do not encode urgency. */
.timeline-date-color-0 { --timeline-accent:#ee6258; }
.timeline-date-color-1 { --timeline-accent:#579fe0; }
.timeline-date-color-2 { --timeline-accent:#37b5a3; }
.timeline-date-color-3 { --timeline-accent:#8daac1; }
.timeline-date-color-4 { --timeline-accent:#78af58; }
.timeline-date-color-5 { --timeline-accent:#42b2cc; }
.timeline-date-color-6 { --timeline-accent:#ef9a39; }
.delivery-calendar[data-theme="light"] .timeline-date-color-0 { --timeline-accent:#c43e32; }
.delivery-calendar[data-theme="light"] .timeline-date-color-1 { --timeline-accent:#246eac; }
.delivery-calendar[data-theme="light"] .timeline-date-color-2 { --timeline-accent:#087e70; }
.delivery-calendar[data-theme="light"] .timeline-date-color-3 { --timeline-accent:#536e84; }
.delivery-calendar[data-theme="light"] .timeline-date-color-4 { --timeline-accent:#4d7b2d; }
.delivery-calendar[data-theme="light"] .timeline-date-color-5 { --timeline-accent:#107e98; }
.delivery-calendar[data-theme="light"] .timeline-date-color-6 { --timeline-accent:#b9610b; }
.timeline-stage .timeline-tick.timeline-date-color-0:not(.is-today),.timeline-stage .timeline-tick.timeline-date-color-6:not(.is-today) { color:var(--timeline-accent); font-weight:700; }
#timeline-stage .timeline-day-card { border-color:var(--timeline-accent); }
.timeline-day-card .timeline-day-header { background:color-mix(in srgb,var(--timeline-accent) 12%,var(--cal-bg)); }
.timeline-day-card .timeline-day-status { color:var(--timeline-accent); }
.timeline-day-card .timeline-day-date,.timeline-day-card .timeline-day-more { color:var(--timeline-accent); }
.timeline-connector { stroke:var(--timeline-accent); }
.timeline-branch { fill:none; stroke:var(--timeline-accent); stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.timeline-day-card.timeline-joins-bottom { mask-image:linear-gradient(to right,#000 0 calc(50% - 11px),transparent calc(50% - 11px) calc(50% + 11px),#000 calc(50% + 11px)),linear-gradient(to top,transparent 2px,#000 2px); mask-composite:add; }
.timeline-day-card.timeline-joins-top { mask-image:linear-gradient(to right,#000 0 calc(50% - 11px),transparent calc(50% - 11px) calc(50% + 11px),#000 calc(50% + 11px)),linear-gradient(to bottom,transparent 2px,#000 2px); mask-composite:add; }
.timeline-arrow { fill:var(--timeline-accent); }
.timeline-dot { background:var(--timeline-accent); }
.timeline-tick.has-deadline:not(.is-today) { color:var(--timeline-accent); }
.timeline-color-note { color:var(--cal-dim); font-size:12px; }
.timeline-tick { white-space:nowrap; }
.timeline-stage .timeline-tick { height:28px; padding:3px 0; border-radius:7px; background:transparent; line-height:20px; }
.timeline-stage .timeline-tick.has-deadline { background:color-mix(in srgb,var(--timeline-accent) 14%,var(--cal-bg)); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--timeline-accent) 45%,transparent); }
.timeline-stage .timeline-tick.is-today { background:#2378e5; color:#fff; box-shadow:0 0 0 2px #72baff,0 0 14px #398bfa70; }
.delivery-calendar[data-theme="light"] .timeline-tick.is-today { color:#fff; }
.timeline-stage .timeline-tick:hover { outline:1px solid var(--cal-normal); outline-offset:1px; }
.timeline-stage .timeline-today-ring { display:none; }
.timeline-stage .timeline-dot { width:10px; height:10px; border-width:2px; }
.timeline-weekend { margin-left:3px; font-size:.9em; }
.order-card.recently-created { outline:2px solid transparent; outline-offset:3px; animation:created-order-highlight var(--created-highlight-duration,6s) ease-out forwards; }
@keyframes created-order-highlight { 0%,70% { outline-color:#f5d742; } 100% { outline-color:transparent; } }
@media(prefers-reduced-motion:reduce) { .order-card.recently-created { animation-timing-function:steps(1,end); } }
.screen-mode.calendar-view .timeline-tick.timeline-tick-compact,.timeline-tick.timeline-tick-compact { font-size:11px; padding-left:0; padding-right:0; }

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 12% -12%, rgba(77, 163, 255, .1), transparent 60%),
    var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-optical-sizing: auto;
  font-kerning: normal;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .35;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.order-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: linear-gradient(180deg, #0d2036 0%, #0a1828 100%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--accent);
  color: #0b1a2e;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -1px;
  flex: none;
}

.brand-copy h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .04em;
  color: #fff;
}

.brand-copy p {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: .08em;
  white-space: nowrap;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-badge,
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}

.demo-badge {
  color: var(--accent);
  border: 1px solid rgba(245, 215, 66, .4);
  background: rgba(245, 215, 66, .08);
}

.role-badge {
  color: var(--accent-3);
  border: 1px solid rgba(77, 163, 255, .4);
  background: rgba(77, 163, 255, .1);
}

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 92px;
  margin: 0 2px;
}

.clock > span:first-child {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .06em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.clock .date-txt {
  margin-top: 1px;
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: .04em;
  white-space: nowrap;
}

.button {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1a2e;
  font-weight: 700;
}

.button.primary:hover {
  background: #ffe267;
  color: #0b1a2e;
}

.button.quiet {
  background: transparent;
  color: var(--dim);
}

.button.outline-yellow,
.button.outline-yellow:hover {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--text);
  box-shadow: none;
}
.button.outline-danger,.button.outline-danger:hover { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.deletion-content { padding: 16px 18px 20px; font-size: 13px; line-height: 1.6; }
.deletion-order { color: var(--accent); font-size: 17px; font-weight: 700; overflow-wrap: anywhere; margin-bottom: 12px; }
.trash-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trash-row > div { min-width: 0; overflow-wrap: anywhere; }
.trash-row p { margin: 2px 0; }
.trash-row .button { flex: none; }
.screen-mode #open-trash { display: none; }

.license-reminder {
  --license-tone:var(--accent-3);
  display:flex; align-items:center; justify-content:space-between; gap:8px 16px;
  margin:12px 24px 0; padding:10px 14px; border:1px solid var(--line);
  border-inline-start:3px solid var(--license-tone); border-radius:8px;
  background:var(--bg-panel);
  background:color-mix(in srgb,var(--bg-panel),var(--license-tone) 8%); color:var(--text);
}
.license-reminder[data-phase="urgent"] { --license-tone:var(--warn); }
.license-reminder[data-phase="expired"] { --license-tone:var(--danger); }
.license-reminder-copy { min-width:0; }
.license-reminder strong { color:var(--license-tone); }
.license-reminder p { margin:4px 0 0; }
.license-reminder .button { flex:none; }
.license-reminder[data-collapsed="true"] { width:fit-content; max-width:calc(100% - 48px); padding-block:4px; }
.screen-mode .license-reminder { display:none; }
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  .license-reminder { margin:0 0 8px; padding:4px 8px; gap:8px; }
  .license-reminder[data-collapsed="true"] { max-width:100%; }
  .license-reminder strong { display:block; font-size:13px; }
  .license-reminder p { margin:2px 0; font-size:12px; }
  .license-reminder .button { min-height:44px; padding-inline:8px; font-size:12px; }
  .license-reminder[data-phase="expired"] { padding-block:8px; }
}

/* Stats */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 24px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 11px 16px;
  overflow: hidden;
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.stat-card:hover {
  border-color: rgba(77, 163, 255, .55);
  background: #142b46;
  transform: translateY(-1px);
}

.stat-card.selected {
  border-color: rgba(245, 215, 66, .65);
  background: #162b43;
  box-shadow: inset 0 0 0 1px rgba(245, 215, 66, .18), 0 4px 18px rgba(0, 0, 0, .18);
}

.stat-card.selected .label {
  color: var(--accent);
}

.stat-card.selected::after {
  background: radial-gradient(circle, rgba(245, 215, 66, .14), transparent 70%);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -26px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 163, 255, .12), transparent 70%);
}

.stat-card .label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: .06em;
}

.stat-card .value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.1;
}

.stat-card .value strong {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.stat-card .value small {
  font-size: 10px;
  color: var(--dim);
}

.stat-card .value.danger strong {
  color: var(--danger);
}

.stat-card .value.urgent strong {
  color: var(--warn);
}

.stat-card .hint {
  overflow: hidden;
  font-size: 9.5px;
  color: var(--accent-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Main */

.main {
  width: min(2200px, 100%);
  margin: 0 auto;
  padding: 4px 24px 30px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 2px 0 8px;
}

.section-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
}

.accent-line {
  width: 4px;
  height: 17px;
  border-radius: 2px;
  background: var(--accent);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(77, 163, 255, .13);
  color: var(--accent-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
}

.section-note {
  font-size: 10px;
  color: var(--dim);
}

.section-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.layout-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .03);
}

.layout-switch button {
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.layout-switch button:hover {
  color: var(--text);
}

.layout-switch button.selected {
  color: #0b1a2e;
  background: var(--accent);
  border-color: var(--accent);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.filters button {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.filters button:hover {
  color: var(--text);
  border-color: #31577f;
}

.filters button.selected {
  color: var(--accent);
  border-color: rgba(245, 215, 66, .55);
  background: rgba(245, 215, 66, .1);
}

.search-sort {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search > span {
  position: absolute;
  left: 10px;
  color: var(--dim);
  font-size: 14px;
  pointer-events: none;
}

.search input {
  width: 230px;
  max-width: 100%;
  height: 30px;
  padding: 0 10px 0 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 11.5px;
  outline: none;
}

.search input::placeholder {
  color: #6f8499;
}

.search input:focus {
  border-color: var(--accent-3);
}

#sort {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 11.5px;
  outline: none;
}

.screen-context {
  display: none;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* Cards in a row share content tracks, including optional notes and wrapped dates. */
body:not(.screen-mode) .orders-grid > .order-card {
  display:grid;
  grid-template-rows:subgrid;
  grid-row:span 5;
  row-gap:7px;
}

/* Order card */

.order-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.order-card:hover {
  border-color: rgba(245, 215, 66, .5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  transform: translateY(-1px);
}

.order-card.late {
  border-left: 3px solid var(--danger);
}

.order-card.soon {
  border-left: 3px solid var(--accent);
}

.order-card.is-urgent {
  border-top-color: var(--warn);
  border-right-color: var(--warn);
  border-bottom-color: var(--warn);
}

.order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.order-id {
  min-width: 0;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .04em;
  color: var(--accent);
  white-space: nowrap;
}

.order-id .jobno {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--dim);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.order-head > .order-id { flex: 1; }
.order-title-line { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.order-number { flex: none; }
.order-card-notes {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted, #a8b9cc);
}

.status-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
  flex: none;
}

.follow-badge {
  flex: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 122, 69, .12);
  color: var(--warn);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.order-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.6fr) minmax(0, .8fr);
  gap: 6px;
  padding: 7px 0;
  border-top: 1px solid rgba(29, 58, 92, .75);
  border-bottom: 1px solid rgba(29, 58, 92, .75);
}

.order-meta .m {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.order-card .order-meta.has-both-measurements {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, .8fr);
}

/* Use part of the right padding, retaining at least 3px even in dense screens. */
.order-card .order-meta > .weight-cell:last-child { margin-right: -6px; }

.order-meta .k {
  overflow: hidden;
  font-size: 9px;
  color: var(--dim);
  letter-spacing: .03em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.order-meta .v .measurement-unit {
  font-size: 10px;
  font-weight: 700;
}

.screen-mode .order-meta .v .measurement-unit { font-size: 9.445px; }

.order-meta .v {
  display: -webkit-box;
  overflow: hidden;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.order-card .order-meta .v.value-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}

.current-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid rgba(245, 215, 66, .25);
  border-radius: 7px;
  background: rgba(245, 215, 66, .06);
}

.cp-label {
  flex: none;
  font-size: 9px;
  color: var(--dim);
  white-space: nowrap;
}

.cp-pass {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cp-process {
  flex: none;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--accent);
  color: #0b1a2e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

.cp-process.cp-empty {
  background: rgba(143, 163, 186, .12);
  color: var(--dim);
  font-weight: 500;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.progress-label {
  flex: none;
  color: var(--dim);
  font-size: 9.5px;
  letter-spacing: .05em;
}

.progress-time {
  overflow: hidden;
  color: var(--dim);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.progress-text {
  display: -webkit-box;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.progress-text.no-progress {
  color: var(--dim);
}

.countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid rgba(255, 122, 69, .3);
  border-radius: 6px;
  background: rgba(255, 122, 69, .08);
  color: var(--warn);
}

.countdown.normal {
  border-color: rgba(46, 204, 159, .3);
  background: rgba(46, 204, 159, .08);
  color: var(--done);
}

.countdown.warn {
  border-color: rgba(245, 215, 66, .5);
  background: rgba(245, 215, 66, .1);
  color: var(--accent);
}

.countdown.danger {
  border-color: rgba(255, 77, 109, .45);
  background: rgba(255, 77, 109, .1);
  color: var(--danger);
}

.cd-label {
  flex: none;
  font-size: 11px;
  line-height: 1;
}

.cd-estimate {
  margin-left: auto;
  color: #d9e3ef;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.cd-value {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.countdown.danger .cd-value {
  color: var(--danger);
}

.countdown.warn .cd-value {
  color: var(--accent);
}

.countdown.normal .cd-value {
  color: var(--done);
}

.order-actions {
  display: flex;
  gap: 6px;
  margin-top: 1px;
}

.order-actions .button {
  flex: 1;
  min-height: 26px;
  padding: 3px 8px;
  font-size: 10.5px;
}

/* Empty / pagination / footer */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 20px;
  color: var(--dim);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: rgba(77, 163, 255, .1);
  color: var(--accent-3);
  font-size: 20px;
}

.empty h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 14px;
}

.empty p {
  margin: 0 0 12px;
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(29, 58, 92, .7);
  color: var(--dim);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(77, 163, 255, .32);
  border-radius: 9px;
  background: rgba(77, 163, 255, .07);
}

.screen-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.screen-pager .button {
  min-height: 26px;
  padding: 2px 8px;
}

.screen-pager #screen-rotate {
  min-width: 56px;
  color: var(--accent);
  font-size: 10px;
}

.pagination .button {
  min-width: 42px;
  min-height: 36px;
  padding: 0 11px;
  border-color: rgba(77, 163, 255, .5);
  border-radius: 6px;
  background: rgba(77, 163, 255, .13);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.pagination .button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(245, 215, 66, .12);
  color: var(--accent);
}

.pagination .button:disabled {
  border-color: var(--line);
  background: rgba(255, 255, 255, .02);
  opacity: .3;
}

#page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
}

.rotation-meter {
  flex: none;
  width: 190px;
  min-width: 120px;
  padding: 3px 7px;
  border: 1px solid rgba(245, 215, 66, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
}

.rotation-segments {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.rotation-segment {
  position: relative;
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(143, 163, 186, .2);
}

.rotation-segment.is-current {
  height: 9px;
  background: rgba(245, 215, 66, .16);
  box-shadow: 0 0 0 1px rgba(245, 215, 66, .18);
}

.rotation-segment.is-past {
  background: rgba(245, 215, 66, .38);
}

.rotation-segment-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(245, 215, 66, .55), var(--accent));
}

.rotation-segment.is-past .rotation-segment-fill {
  width: 100%;
  opacity: .55;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(2200px, 100%);
  margin: 0 auto;
  padding: 0 24px 18px;
  color: #6f8499;
  font-size: 9.5px;
}

.page-footer .divider {
  margin: 0 5px;
  color: #3d5c7c;
}
.filing-link { color: inherit; font-size: 13px; text-align: center; }

/* Dialogs */

dialog {
  width: min(820px, 92vw);
  max-height: 86vh;
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

dialog::backdrop {
  background: rgba(2, 8, 15, .75);
  backdrop-filter: blur(3px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
}

.detail-heading-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#details .dialog-heading > div:first-child { flex: 1 1 10rem; min-width: min(10rem, 100%); }
#details .detail-heading-actions { flex-shrink: 1; min-width: 0; }
#detail-title { overflow-wrap: anywhere; }

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

#detail-content,
.help-content {
  padding: 14px 18px 18px;
}

.detail-note {
  margin: 0 0 10px;
  color: var(--dim);
  font-size: 10px;
}

.detail-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 12px;
}

.detail-grid > div {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
}

.detail-grid > .detail-followup-row { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 10px; align-items: center; }
.detail-followup-row dt, .detail-followup-row dd { grid-column: 1; }
#followup-control { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#toggle-followup[aria-pressed="true"] { border-color: var(--warn); color: var(--warn); background: transparent; }
.detail-heading-actions { flex-wrap: wrap; }
#lifecycle-control { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#toggle-completed[aria-pressed="true"] { border-color: var(--done); color: var(--done); }
#lifecycle-message { margin: 8px 18px; color: #ffd087; font-size: 12px; }
.completed-section { margin-top: 28px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-panel); }
.completed-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.completed-heading h2 { margin: 0; font-size: 17px; color: var(--done); }
#completed-message { color: var(--dim); font-size: 12px; margin: 10px 0; }
.completed-list { display: grid; gap: 6px; }
.completed-row { display: grid; grid-template-columns: minmax(175px,1.3fr) minmax(100px,1.25fr) minmax(90px,1fr) minmax(170px,1.6fr) minmax(85px,.9fr) minmax(125px,1.1fr) auto; align-items: start; gap: 10px 14px; width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text); text-align: left; font-size: 12px; cursor: pointer; }
.completed-row > * { min-width: 0; overflow-wrap: anywhere; }
.completed-field { display: grid; gap: 5px; }
.completed-measurements { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.completed-measurements > .completed-field { min-width: 0; }
.completed-label { color: var(--dim); font-size: 10px; font-weight: 400; }
.completed-value { white-space: pre-line; line-height: 1.5; overflow-wrap: anywhere; }
.completed-number .completed-value { color: var(--accent); font-size: 14px; font-weight: 700; }
.completed-state { display: grid; gap: 8px; align-self: center; font-size: 11px; }
.completed-number .completed-value { display: flex; align-items: baseline; gap: 8px; }
.completed-number-note { font-size: 11px; font-weight: 400; color: var(--dim); white-space: nowrap; }
.completed-badge { color: var(--done); white-space: nowrap; }
.completed-row:hover { border-color: var(--done); }
.completed-pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--dim); }
.screen-mode .completed-section { display: none; }
@media(min-width: 701px) and (max-width: 1100px) { .completed-row { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width: 700px) {
  .completed-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px 10px; }
  #details .dialog-heading { flex-wrap: wrap; }
  .detail-heading-actions { flex-shrink: 1; }
}
#followup-control .button { min-height: 30px; }
#followup-message { max-width: 260px; color: #ffd087; font-size: 11px; font-weight: 400; }
#detail-followup[data-urgent="false"] { color: var(--done); }
#detail-followup[data-urgent="true"] { color: var(--warn); }
.detail-grid [data-deadline-tone="normal"] { color: var(--done); }
.detail-grid [data-deadline-tone="warn"] { color: var(--accent); }
.detail-grid [data-deadline-tone="danger"] { color: var(--danger); }
.detail-due-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; }
.detail-due-remaining { white-space: nowrap; }
.detail-estimate-row, .detail-progress-section { position: relative; }
.detail-estimate-row > dt, .detail-estimate-row > dd { padding-right: 92px; }
#open-estimate, #open-log { position: absolute; right: 9px; top: 7px; min-height: 30px; }
.detail-progress-section > h3 { min-height: 27px; padding-right: 95px; display: flex; align-items: center; }
.inline-form { margin-top: 12px; display: grid; gap: 8px; }
.inline-form label { color: #cbd8eb; font-size: 12px; }
.inline-form input, .inline-form textarea, .inline-form select { width: 100%; min-width: 0; min-height: 38px; padding: 8px; border: 1px solid #435775; border-radius: 6px; color: #fff; background: #0e192b; font: inherit; font-size: 13px; color-scheme: dark; }
.inline-form input:focus, .inline-form textarea:focus, .inline-form select:focus { outline: 2px solid #ffd25e; outline-offset: 1px; }
.inline-form textarea { resize: vertical; }
.estimate-days-input { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12px; }
.estimate-days-input input { flex: 1; width: 0; }
.estimate-days-input span { white-space: nowrap; }
.estimate-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; }
.estimate-shortcuts .button { min-height: 30px; padding: 5px 12px; }
.estimate-shortcuts .button[aria-pressed="true"] { color: #0e192b; background: var(--accent); border-color: var(--accent); }
.inline-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.inline-actions .button { min-height: 34px; }
.inline-message, .detail-section .inline-message { color: #ffd087; font-size: 12px; white-space: pre-wrap; }
.inline-message:empty { display: none; }
.history-heading, .history-entry-heading, .history-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.history-section .history-heading h3 { margin: 0; }
.history-heading .button, .history-pager .button { min-height: 30px; }
.history-list { list-style: none; padding: 0; margin: 10px 0; }
.history-entry { padding: 10px 0; border-top: 1px solid var(--line); }
.history-entry-heading { margin-bottom: 5px; font-size: 11px; }
.history-entry-heading strong { color: var(--accent-3); }
.history-entry-heading time { color: var(--dim); font-variant-numeric: tabular-nums; }
.history-section .history-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.history-section .correction-hint { margin-top: 6px; overflow-wrap: anywhere; }
.history-pager { justify-content: flex-end; color: var(--dim); font-size: 11px; }
#history-message:empty { display: none; }
.history-older summary { cursor: pointer; padding: 8px 0; color: var(--accent-3); font-size: 12px; }
.history-older[open] summary { margin-bottom: 4px; }
.history-entry-body { display: flex; align-items: flex-end; align-items: last baseline; gap: 12px; }
.history-entry-text { flex: 1; min-width: 0; }
.history-correct { flex: none; margin: 0; min-height: 28px; font-size: 11px; white-space: nowrap; }
.correction-content { padding: 16px 18px 20px; }
#correction-original { white-space: pre-wrap; overflow-wrap: anywhere; color: #d9e3ef; font-size: 13px; }
.correction-content .detail-note { margin: 10px 0; }

.detail-grid dt {
  color: var(--dim);
  font-size: 9.5px;
}

.detail-grid dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.detail-section {
  margin-top: 12px;
  padding: 9px 11px;
  border-left: 3px solid var(--accent-3);
  border-radius: 6px;
  background: rgba(77, 163, 255, .06);
}

.detail-section h3 {
  margin: 0 0 4px;
  color: var(--accent-3);
  font-size: 10.5px;
  letter-spacing: .04em;
}

.detail-section p {
  margin: 0;
  color: #d9e3ef;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.detail-section .detail-note {
  margin-top: 4px;
}

.help-content p {
  margin: 0 0 9px;
  color: #c8d5e2;
  font-size: 11.5px;
  line-height: 1.65;
}

.help-content strong {
  color: var(--accent);
  font-weight: 600;
}

/* Toast */

#toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 100;
  max-width: min(90vw, 560px);
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1a2d;
  color: var(--text);
  font-size: 11.5px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  transform: translateX(-50%);
}

.pull-refresh-status {
  position:fixed;
  z-index:110;
  top:12px;
  top:max(12px, env(safe-area-inset-top));
  left:50%;
  transform:translateX(-50%);
  padding:7px 14px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--bg-panel);
  color:var(--text);
  font-size:13px;
  pointer-events:none;
}
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  html:has(body[data-mode="live"].authenticated:not(.screen-mode)) { overscroll-behavior-y:none; }
  body[data-mode="live"].authenticated:not(.screen-mode) > :is(.topbar,.stats-bar,.main,.page-footer) {
    transition:transform 180ms ease-out;
  }
  body[data-mode="live"].authenticated:not(.screen-mode).pull-refresh-dragging > :is(.topbar,.stats-bar,.main,.page-footer) {
    transform:translateY(var(--pull-refresh-offset));
    transition:none;
  }
  .pull-refresh-dragging .pull-refresh-status {
    top:calc(var(--pull-refresh-offset) - 5px);
    transform:translate(-50%,-100%);
  }
}
@media (prefers-reduced-motion:reduce) {
  body[data-mode="live"].authenticated:not(.screen-mode) > :is(.topbar,.stats-bar,.main,.page-footer) { transition:none; }
}

/* Screen mode */

body.screen-mode {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.screen-mode .topbar,
.screen-mode .stats-bar,
.screen-mode .section-title,
.screen-mode .pagination {
  flex: none;
}

.screen-mode .topbar {
  padding: 8px 20px;
}

.screen-mode .brand-copy p,
.screen-mode .page-footer,
.screen-mode .toolbar,
.screen-mode .section-note {
  display: none;
}

.screen-mode .brand-mark {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.screen-mode .brand-copy h1 {
  font-size: 17px;
}

.screen-mode .clock > span:first-child {
  font-size: 16px;
}

.screen-mode .stats-bar {
  gap: 8px;
  padding: 8px 20px;
}

.screen-mode .stat-card {
  padding: 6px 12px;
  border-radius: 8px;
}

.screen-mode .stat-card .value strong {
  font-size: 20px;
}

.screen-mode .stat-card .hint {
  display: none;
}

.screen-mode .main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 2px 20px 8px;
}

.screen-mode .section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 0 5px;
}

.screen-mode .section-heading {
  justify-self: start;
  font-size: 14px;
}

.screen-mode .screen-pager {
  grid-column: 2;
  justify-self: center;
}

.screen-mode .section-tools {
  grid-column: 3;
  justify-self: end;
  margin-left: 0;
}

.screen-mode .screen-context {
  display: none;
}

.screen-mode .layout-switch {
  display: flex;
}

.screen-mode .orders-grid {
  flex: 1;
  min-height: 0;
  gap: 9px;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.screen-mode .order-card {
  gap: 5px;
  min-height: 0;
  height: 100%;
  padding: 9px 11px;
  overflow: hidden;
}

.screen-mode[data-screen-layout="9"] .orders-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.screen-mode[data-screen-layout="12"] .orders-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.screen-mode .order-id {
  font-size: 18px;
}

.screen-mode .order-meta {
  gap: 5px;
  padding: 5px 0;
}

.screen-mode .order-meta .k {
  font-size: 8.5px;
}

.screen-mode .order-meta .v {
  font-size: 10.5px;
}

.screen-mode .current-progress {
  padding: 4px 7px;
}

.screen-mode .cp-pass {
  font-size: 12.5px;
}

.screen-mode .cp-process {
  padding: 1px 6px;
  font-size: 9px;
}

.screen-mode .progress-label,
.screen-mode .progress-time {
  font-size: 9px;
}

.screen-mode .progress-text {
  font-size: 11.5px;
  line-height: 1.45;
}

.screen-mode .countdown {
  padding: 4px 7px;
}

.screen-mode .cd-value {
  font-size: 10px;
}

.screen-mode .order-actions {
  display: none;
}

.screen-mode .pagination {
  display: none;
}

.screen-mode #toast {
  bottom: 52px;
}

.screen-mode .empty {
  padding: 24px 16px;
}

.screen-mode[data-screen-layout="9"] .order-card,
.screen-mode[data-screen-layout="12"] .order-card {
  justify-content: space-between;
}

.screen-mode[data-screen-layout="9"] .order-card {
  padding: 12px 13px;
}

.screen-mode[data-screen-layout="9"] .order-id {
  font-size: 21px;
}

.screen-mode[data-screen-layout="9"] .order-meta .v {
  font-size: 11.5px;
}

.screen-mode[data-screen-layout="9"] .cp-pass {
  font-size: 14px;
}

.screen-mode[data-screen-layout="9"] .progress-text {
  font-size: 13px;
}

.screen-mode[data-screen-layout="9"] .cd-value {
  font-size: 12.5px;
  line-height:1.4;
}
.screen-mode[data-screen-layout="9"] .countdown { min-height:32px; padding:5px 9px; gap:7px; border-color:color-mix(in srgb,currentColor 48%,transparent); box-shadow:inset 0 0 0 1px color-mix(in srgb,currentColor 8%,transparent); }
.screen-mode[data-screen-layout="9"] .countdown .cd-label { font-size:14px; }
.screen-mode[data-screen-layout="9"] .countdown .cd-estimate { font-size:12px; }
.screen-mode[data-screen-layout="9"] .order-card .countdown .card-days-number { font-size:17px; }
@media(max-height:850px) {
  .screen-mode[data-screen-layout="9"] .order-card { padding:9px 11px; gap:4px; }
  .screen-mode[data-screen-layout="9"] .order-meta { padding:4px 0; }
  .screen-mode[data-screen-layout="9"] .countdown { min-height:30px; padding:4px 8px; }
}

@media (min-width: 1600px) {
  .screen-mode[data-screen-layout="9"] .order-id {
    font-size: 23px;
  }

  .screen-mode[data-screen-layout="9"] .order-meta .v {
    font-size: 12px;
  }

  .screen-mode[data-screen-layout="9"] .progress-text {
    font-size: 13.5px;
  }
}

/* Responsive */

@media (max-width: 1499px) {
  .orders-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1199px) {
  .orders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 10px 16px;
  }

  .stats-bar {
    padding: 10px 16px;
  }

  .main {
    padding: 2px 16px 24px;
  }

  .page-footer {
    padding: 0 16px 16px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-sort {
    width: 100%;
  }

  .search {
    flex: 1;
  }

  .search input {
    width: 100%;
  }
}

@media (max-width: 819px) {
  .orders-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-copy p,
  .role-badge {
    display: none;
  }

  .clock {
    min-width: 0;
  }

  .section-note {
    display: none;
  }

  .page-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
}

@media (max-width: 600px) {
  .pagination {
    flex-wrap: wrap;
  }

  .pager-controls {
    margin-left: auto;
  }

  .order-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .order-id {
    font-size: 18px;
  }

  .topbar {
    gap: 9px;
  }

  .top-right {
    gap: 6px;
  }

  .demo-badge {
    display: none;
  }

  .clock > span:first-child {
    font-size: 16px;
  }

  .dialog-heading {
    padding: 12px 14px 10px;
  }

  #detail-content,
  .help-content {
    padding: 12px 14px 16px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Same-origin authenticated board; demo keeps the existing presentation. */
body.auth-required > :not(#auth-panel):not(#phone-appearance-dialog) { display: none !important; }
body[data-mode="live"]:not(.authenticated) > :not(#auth-panel):not(#phone-appearance-dialog) { display: none !important; }
.correction-hint { display: block; color: #ffd087; }
.editor-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 18px 0; }
.editor-fields label { display: grid; gap: 8px; color: #cbd8eb; font-size: 14px; }
.editor-fields input,.editor-fields textarea { width: 100%; min-height: 42px; padding: 10px; border: 1px solid #435775; border-radius: 6px; color: #fff; background: #0e192b; font: inherit; }
.editor-fields input:focus,.editor-fields textarea:focus { outline: 2px solid #ffd25e; outline-offset: 1px; }
.editor-fields input:read-only,.editor-fields textarea:read-only { opacity: .75; }
.editor-wide { grid-column: 1 / -1; }
.editor-optional summary { cursor: pointer; padding: 16px 0; color: #b8cbe6; }
.editor-message { color: #ffd087; white-space: pre-wrap; line-height: 1.7; min-height: 26px; margin: 18px 0; }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.editor-actions .button { min-height: 42px; }
#order-editor { max-height: 94vh; max-height: 94dvh; }
#order-editor .dialog-heading { padding: 12px 16px 10px; align-items: center; }
#order-editor .editor-fields { gap: 10px 14px; margin: 12px 16px; }
#order-editor .editor-fields label { gap: 4px; font-size: 13px; }
#order-editor .editor-fields input,
#order-editor .editor-fields textarea { min-height: 36px; padding: 7px 9px; font-size: 13px; }
#order-editor .editor-fields textarea { resize: vertical; }
#order-editor[data-creating="true"] .editor-fields input:required { border: 1px solid var(--accent); }
#order-editor .unit-combo { position: relative; display: flex; align-items: center; min-width: 0; height: 36px; }
#order-editor .unit-combo input { min-width: 0; flex: 1; height: 36px; margin: 0; border-radius: 6px 0 0 6px; }
#order-editor .unit-combo select { appearance: none; width: 34px; height: 36px; min-height: 36px; margin: 0; padding: 0; flex: none; border: 1px solid #435775; border-left: 0; border-radius: 0 6px 6px 0; background: #0e192b; color: #fff; color-scheme: dark; font-size: 0; cursor: pointer; }
#order-editor .unit-combo::after { content: ''; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
#order-editor .unit-combo option { font-size: 13px; }
#order-editor .unit-combo select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#order-editor .editor-optional summary { padding: 7px 16px; font-size: 13px; }
#order-editor .detail-note { margin: 6px 16px; }
#order-editor .editor-message { min-height: 0; margin: 8px 16px; line-height: 1.4; }
#order-editor .editor-message:empty { display: none; }
#order-editor .editor-actions { gap: 8px; padding: 10px 16px 14px; }
#order-editor .editor-actions .button { min-height: 36px; }
@media(min-width: 700px) {
  #order-editor .editor-optional .editor-fields { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
.screen-mode #new-order { display: none; }
@media(max-width: 600px) { .editor-fields { grid-template-columns: 1fr; } }
.auth-panel { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 390px); padding: 32px; border: 1px solid #344763; border-radius: 16px; background: #142138; }
.auth-card h1 { font-size: 25px; color: #ffd25e; margin-bottom: 14px; }
.auth-card p { color: #aebcd0; line-height: 1.7; margin: 12px 0; }
.auth-card label { display: grid; gap: 8px; margin: 18px 0; color: #d5deec; }
.auth-card input { width: 100%; min-height: 44px; padding: 10px; border: 1px solid #435775; border-radius: 6px; color: #fff; background: #0e192b; font: inherit; }
.auth-card .button { min-height: 42px; }
.auth-card .auth-demo-link { display: inline-flex; align-items: center; margin-left: 8px; text-decoration: none; }
.data-status { color: #b1c4df; margin: 0 0 12px; font-size: 13px; }
.data-status.is-error { color: #ffb399; }
.screen-mode .data-status { font-size: 12px; margin-bottom: 4px; }

/* Larger card values retain their previous line boxes and outer geometry. */
.order-card .order-meta .v { font-size: 14px; line-height: 14.375px; max-height: 28.75px; }
.order-card .progress-text { font-size: 15px; line-height: 19.375px; max-height: 38.75px; }
.order-card .card-days-number { font-size: 14px; line-height: 0; font-weight: 800; }
.screen-mode .order-card .order-meta .v { font-size: 12.5px; line-height: 13.125px; max-height: 26.25px; }
.screen-mode .order-card .progress-text { font-size: 13.5px; line-height: 16.675px; max-height: 33.35px; }
.screen-mode[data-screen-layout="9"] .order-card .order-meta .v { font-size: 14px; line-height: 14.375px; max-height: 28.75px; }
.screen-mode[data-screen-layout="9"] .order-card .progress-text { font-size: 15px; line-height: 18.85px; max-height: 37.7px; }
.card-progress-area { position: relative; min-height: 38.75px; }
.card-progress-area:has(.card-progress-button) .progress-text::before { content: ''; float: right; width: 80px; height: 2lh; shape-outside: inset(1lh 0 0 0); }
.card-progress-button {
  position: absolute; right: 0; bottom: 0; display: inline-flex;
  align-items: center; justify-content: center; gap: 4px;
  min-height: 19px; padding: 1px 7px; font-size: 10px; line-height: 15px;
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text); border-radius: 10px; font-weight: 500;
  transition: background .15s ease, border-color .15s ease;
}
.card-progress-icon { font-size: 13px; font-weight: 400; line-height: 13px; opacity: .8; }
.card-progress-button:hover { background: color-mix(in srgb, var(--text) 13%, transparent); border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.card-progress-button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.card-progress-button:active { background: color-mix(in srgb, var(--text) 20%, transparent); }
.manager-card .card-progress-button { border-color:transparent; background:transparent; color:var(--dim); padding-right:0; padding-left:4px; border-radius:3px; }
.manager-card .card-progress-button .card-progress-icon { display:none; }
.manager-card .card-progress-button:hover { color:var(--text); border-color:transparent; background:transparent; text-decoration:underline; text-underline-offset:3px; }
.manager-card .card-progress-button:focus-visible { color:var(--text); outline:2px solid var(--accent-3); outline-offset:3px; }
.manager-card .card-progress-area:has(.card-progress-button) .progress-text::before { width:62px; }
#quick-progress { width: min(460px, calc(100vw - 32px)); }
#quick-progress-message { font-size: 12px; color: var(--dim); }
/* Normal block flow lets only the second line wrap around the action. */
.card-progress-area:has(.card-progress-button) .progress-text { display: block; padding-right: 0; overflow-wrap: anywhere; }
.card-progress-area #quick-progress-form { padding: 0 !important; display: grid; grid-template-columns: 1fr auto auto; gap: 4px; }
.card-progress-area #quick-progress-form label { display: none; }
.card-progress-area #quick-progress-text { grid-column: 1 / -1; width: 100%; height: 39px; min-height: 39px; padding: 2px 4px; resize: none; font: inherit; font-size: 14px; color: var(--text); background: var(--bg-card); border: 1px solid var(--text); border-radius: 4px; }
.card-progress-area #quick-progress-message { margin: 0; font-size: 10px; }
.card-progress-area #quick-progress-form .button { min-height: 20px; padding: 1px 5px; font-size: 10px; color: var(--text); border-color: var(--text); background: transparent; }
.card-progress-area .progress-text[hidden], .card-progress-area .card-progress-button[hidden] { display: none; }
.screen-mode .card-progress-button { display: none; }
.screen-mode .card-progress-area:has(.card-progress-button) .progress-text::before { content: none; }
.attention-switch { flex: none; align-self: flex-start; padding: 3px 8px; border-radius: 6px; border: 1px solid currentColor; font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; }
.attention-normal { color: var(--done); background: rgba(46,204,159,.09); }
.attention-urgent { color: var(--warn); background: rgba(255,122,69,.1); }
.attention-paused { color: #9bdcf2; background: rgba(115,195,231,.13); }
.order-card.is-paused { border-color: rgba(135,207,236,.45); }
.attention-switch { transition: background .18s ease, box-shadow .18s ease, filter .18s ease; }
.attention-switch:hover:not(:disabled) {
  filter: brightness(1.15);
  background: color-mix(in srgb, currentColor 18%, var(--bg-card));
  box-shadow: 0 0 9px color-mix(in srgb, currentColor 32%, transparent), inset 0 0 5px color-mix(in srgb, currentColor 12%, transparent);
}
.attention-switch:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.screen-mode .attention-switch { opacity: 1; cursor: default; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-card); }
.stat-pair > .stat-card { border: 0; border-radius: 0; padding-left: 12px; padding-right: 8px; }
.stat-pair > .stat-card + .stat-card { border-left: 1px solid var(--line); }
.stat-pair .hint { font-size: 9px; }
.stat-card .value.frozen { color: #9bdcf2; }
.completed-stat .value { color: var(--done); }
.screen-mode .completed-stat { display: none; }
.screen-mode .stat-pair:has(.completed-stat) { grid-template-columns: 1fr; }
.completed-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.completed-filters label { display: grid; gap: 4px; font-size: 11px; color: var(--dim); }
.completed-filters label:first-child { flex: 1; min-width: 180px; }
.completed-filters input, .completed-filters select { min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-card); color: var(--text); font: inherit; font-size: 13px; }
#completed-year { width: 105px; }
.completed-filters .button { min-height: 34px; }

.completed-heading { flex-wrap: wrap; }
.completed-heading h2 { margin-right: auto; white-space: nowrap; }
.completed-heading .completed-filters { margin: 0; }
.completed-filters label:first-child { flex: none; width: 210px; max-width: 100%; min-width: 0; }
#completed-search { width: 100%; }

.editable-estimate { cursor: text; border-bottom: 1px dashed currentColor; }
.editable-estimate:focus-visible { outline: 1px solid var(--accent); }
.card-estimate-input { width: 48px; min-width: 0; padding: 0 2px; border: 1px solid #f5cf39; border-radius: 3px; background: var(--bg-card); color: inherit; font: inherit; font-weight: bold; text-align: center; }

.card-estimate-days { white-space: nowrap; }
.card-estimate-days.editable-estimate { padding: 3px 2px; margin: -3px -2px; }
/* Transparent hit areas enlarge controls without changing card layout. */
.attention-switch { position: relative; }
.attention-switch:not(:disabled)::after { content: ''; position: absolute; inset: -5px -6px; border-radius: 10px; }
.card-progress-button::after { content: ''; position: absolute; inset: -3px -5px -5px; border-radius: 13px; }
.card-progress-button:disabled::after { content: none; }
/* Slow orange breathing glow highlights urgent orders without shifting their contents. */
.order-card.is-urgent:not(.is-paused) { animation: urgent-border-breathe 2s ease-in-out infinite; }
@keyframes urgent-border-breathe {
  0%, 100% {
    border-top-color: rgba(255,122,69,.7);
    border-right-color: rgba(255,122,69,.7);
    border-bottom-color: rgba(255,122,69,.7);
    box-shadow: 0 0 3px rgba(255,122,69,.1), inset 0 0 3px rgba(255,122,69,.03);
  }
  50% {
    border-top-color: #ffb078;
    border-right-color: #ffb078;
    border-bottom-color: #ffb078;
    box-shadow: 0 0 18px rgba(255,122,69,.62), 0 0 5px rgba(255,154,92,.65), inset 0 0 10px rgba(255,122,69,.14);
  }
}
@media (prefers-reduced-motion: reduce) {
  .order-card.is-urgent:not(.is-paused) { animation: none; box-shadow: 0 0 5px rgba(255,122,69,.2); }
}

/* Keep the timeline visible with one workspace row and one chart-control row. */
.workspace-heading { flex:none; }
.workspace-heading { display:flex; align-items:center; flex-wrap:wrap; gap:6px 14px; margin-bottom:6px; }
.workspace-heading .filters { display:none; }
body:not(.screen-mode) .workspace-heading .section-title { display:none; }
.workspace-heading .delivery-tabs { order:0; flex:none; margin:0; }
.workspace-heading .toolbar { order:1; margin:0; }
.workspace-heading .data-status { order:2; margin:0 0 0 auto; font-size:11px; }
.workspace-heading .data-status.is-error { flex-basis:100%; margin:0; }
.workspace-heading .search input { width:200px; }
.timeline-view .delivery-heading { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; }
.timeline-view .calendar-toolbar { flex:1 1 520px; gap:6px 10px; }
.timeline-view .calendar-navigation,.timeline-view .calendar-legend { gap:6px; }
.timeline-view .calendar-navigation h2 { font-size:18px; }
.timeline-view .timeline-controls { flex:0 1 auto; padding:0; gap:10px; }
.timeline-view #timeline-color-note,.timeline-view .delivery-screen-hint { display:none; }
.timeline-view .delivery-calendar { padding:10px; margin-top:0; }
.timeline-view .delivery-notices { display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; margin:4px 0; }
.timeline-view .delivery-notices p { margin:0; font-size:11px; }
.timeline-view #calendar-context { font-size:11px; }
.timeline-view #calendar-overdue .button { padding:3px 8px; min-height:26px; font-size:11px; }
.timeline-view .delivery-notices p:empty,.timeline-view .delivery-notices div:empty { display:none; }
@media(max-width:700px) {
 .workspace-heading .data-status { margin-left:0; }
 .timeline-view .calendar-toolbar { flex-basis:100%; }
 .timeline-view .calendar-navigation h2 { font-size:14px; }
 .timeline-view .calendar-navigation .button { padding:6px 9px; }
 .timeline-view .timeline-controls { width:100%; justify-content:space-between; }
}

/* Shared compact workspace controls; preserve the board's screen paging row. */
.screen-mode:not(.calendar-view) .workspace-heading .section-title { flex:1 1 620px; order:1; margin:0; }
.screen-mode .workspace-heading .delivery-tabs .button { padding:4px 12px; min-height:30px; }
.workspace-heading .section-note { display:none; }
body:not(.screen-mode) .workspace-heading .search-sort { gap:8px; }
body:not(.screen-mode) .workspace-heading #sort { max-width:155px; }
.calendar-view:not(.timeline-view) .delivery-heading { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; }
.calendar-view:not(.timeline-view) .calendar-toolbar { flex:1 1 720px; gap:6px 10px; }
.calendar-view:not(.timeline-view) .calendar-navigation,.calendar-view:not(.timeline-view) .calendar-legend { gap:6px; }
.calendar-view:not(.timeline-view) .calendar-navigation h2 { font-size:18px; }
.calendar-view:not(.timeline-view) .calendar-modes { margin:0; align-self:center; }
.calendar-view:not(.timeline-view) .delivery-calendar { padding:10px; margin-top:0; }
.calendar-view:not(.timeline-view) .delivery-screen-hint { display:none; }
.calendar-view:not(.timeline-view) .delivery-notices { display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; margin:4px 0; }
.calendar-view:not(.timeline-view) .delivery-notices p { margin:0; font-size:11px; }
.calendar-view:not(.timeline-view) #calendar-overdue .button { padding:3px 8px; min-height:26px; font-size:11px; }
.calendar-view:not(.timeline-view) .delivery-notices p:empty,.calendar-view:not(.timeline-view) .delivery-notices div:empty { display:none; }
@media(max-width:700px) {
 .calendar-view:not(.timeline-view) .calendar-navigation h2 { font-size:14px; }
 .calendar-view:not(.timeline-view) .calendar-navigation .button { padding:6px 9px; }
 .calendar-view:not(.timeline-view) .calendar-legend { font-size:11px; }
}

.delivery-hover-tooltip { position:fixed; z-index:10000; width:320px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow:auto; padding:12px 14px; border:1px solid #426487; border-radius:10px; background:#10243a; color:#edf4fc; box-shadow:0 8px 26px #0005; pointer-events:none; font:12px/1.6 var(--font); }
.delivery-hover-tooltip[data-theme="light"] { background:#fff; color:#142338; border-color:#b5cadf; box-shadow:0 8px 26px #163b6028; }
.delivery-hover-field { display:flex; gap:10px; }
.delivery-hover-label { flex:none; width:48px; opacity:.7; }
.delivery-hover-value { flex:1; min-width:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.delivery-hover-long { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.delivery-hover-field:has(.delivery-hover-long) { margin-top:6px; padding-top:6px; border-top:1px solid #8298b333; }
.delivery-hover-more { margin-top:6px; font-size:11px; opacity:.7; }

/* Paused rows keep their date color while reducing only the production text. */
.timeline-order-row.is-paused-order .timeline-row-main > strong,
.timeline-order-row.is-paused-order .timeline-row-product,
.timeline-order-row.is-paused-order .timeline-row-info { opacity:.6; }
.delivery-order.is-paused-order .delivery-order-title,.delivery-order.is-paused-order .delivery-spec { opacity:.6; }
.timeline-paused-badge { margin-left:auto; padding:0 4px; border:1px solid currentColor; border-radius:4px; background:#78cce918; font-weight:700; line-height:16px; }
.delivery-calendar[data-theme="light"] .timeline-paused-badge { color:#216b89; }
.delivery-day-dialog.timeline-day-popover { position:fixed; inset:auto; margin:0; width:min(420px,calc(100vw - 24px)); max-height:min(480px,calc(100dvh - 24px)); padding:12px; border-radius:10px; box-shadow:0 10px 36px #0005; }
.delivery-day-dialog.timeline-day-popover::backdrop { background:#02080f12; backdrop-filter:none; }
.timeline-day-popover .dialog-heading { padding:0; gap:8px; margin-bottom:8px; }
.timeline-day-popover .dialog-heading h2 { font-size:15px; }
.timeline-day-popover .delivery-day-list { max-height:min(310px,calc(100dvh - 170px)); overflow:auto; margin:8px 0; gap:5px; }
.timeline-day-popover .delivery-order { padding:6px 8px; }
.timeline-day-popover .delivery-order-title { font-size:13px; line-height:18px; }
.timeline-day-popover .delivery-order-state { font-size:11px; line-height:16px; }
.timeline-day-popover .completed-pager { margin:0; gap:6px; font-size:11px; }
.timeline-day-popover #delivery-day-status:empty { display:none; }

/* Soft calendar tiles retain equal seven-column geometry. */
.calendar-weekdays { border:0; border-radius:9px; background:color-mix(in srgb,var(--cal-tile) 45%,var(--cal-bg)); padding:10px 6px; margin-bottom:6px; }
.calendar-weekdays > :nth-child(6) { color:var(--cal-soon); }
.calendar-weekdays > :nth-child(7) { color:var(--cal-late); }
.calendar-grid { gap:6px; padding:6px; border:0; border-radius:12px; background:color-mix(in srgb,var(--cal-tile) 20%,var(--cal-bg)); }
.calendar-grid .calendar-cell { border:1px solid color-mix(in srgb,var(--cal-line) 65%,transparent); border-radius:9px; background:color-mix(in srgb,var(--cal-normal) 4%,var(--cal-bg)); }
.calendar-grid .calendar-cell.alternate-week { background:color-mix(in srgb,#329d95 5%,var(--cal-bg)); }
.calendar-grid .calendar-cell.is-saturday { background:color-mix(in srgb,var(--cal-soon) 6%,var(--cal-bg)); }
.calendar-grid .calendar-cell.is-sunday { background:color-mix(in srgb,var(--cal-late) 5%,var(--cal-bg)); }
.calendar-grid .calendar-cell.has-orders.normal { background:color-mix(in srgb,var(--cal-normal) 11%,var(--cal-bg)); }
.calendar-grid .calendar-cell.has-orders.soon { background:color-mix(in srgb,var(--cal-soon) 11%,var(--cal-bg)); }
.calendar-grid .calendar-cell.has-orders.late { background:color-mix(in srgb,var(--cal-late) 10%,var(--cal-bg)); }
.calendar-grid .calendar-cell.is-today { border-color:#398bfa; box-shadow:inset 0 0 0 1px #398bfa,0 2px 10px #398bfa1a; }
.calendar-grid .calendar-empty-date { background:color-mix(in srgb,var(--cal-tile) 60%,var(--cal-bg)); border:1px solid color-mix(in srgb,var(--cal-line) 55%,transparent); }
.calendar-grid .is-today .calendar-empty-date { background:#2378e5; border-color:#2378e5; }
.calendar-grid .calendar-day-heading { padding-bottom:3px; }
.calendar-grid .calendar-cell .delivery-order { border-color:color-mix(in srgb,var(--cal-line) 65%,transparent); background:color-mix(in srgb,var(--cal-bg) 75%,transparent); border-radius:6px; }
.calendar-grid .calendar-cell .delivery-order:hover { background:color-mix(in srgb,var(--cal-normal) 13%,var(--cal-bg)); }
.screen-mode.calendar-view .calendar-grid { min-height:714px; }
@media(max-width:700px) { .calendar-grid { gap:4px; padding:4px; } }
.calendar-weekdays { column-gap:6px; }
@media(max-width:700px) { .calendar-weekdays { column-gap:4px; } }

.calendar-cell.calendar-sparse { container-type:size; }
.calendar-grid .calendar-sparse .calendar-rich-order { flex:1; min-height:0; overflow:hidden; padding:5px 6px; gap:2px; }
.calendar-grid .calendar-rich-order .delivery-order-title { font-size:12px; line-height:16px; }
.calendar-grid .calendar-rich-order .delivery-order-state { font-size:11px; line-height:14px; }
.calendar-rich-details,.calendar-rich-estimate { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; line-height:14px; color:var(--cal-dim); }
.calendar-rich-progress,.calendar-rich-notes { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; overflow-wrap:anywhere; font-size:11px; line-height:14px; }
.calendar-rich-progress { color:var(--cal-text); }.calendar-rich-notes { color:var(--cal-dim); }
.calendar-grid .two-orders .calendar-rich-order { padding:3px 5px; gap:0; }
.two-orders .calendar-rich-progress,.two-orders .calendar-rich-notes { -webkit-line-clamp:1; }
.two-orders .calendar-rich-estimate { display:none; }
@container(max-height:165px) {
 .two-orders .calendar-rich-details,.two-orders .calendar-rich-progress,.two-orders .calendar-rich-notes { display:none; }
 .calendar-rich-notes,.calendar-rich-progress { -webkit-line-clamp:1; }
 .calendar-rich-estimate { display:none; }
}
.calendar-grid .two-orders .calendar-rich-order .delivery-order-title { line-height:14px; }
.calendar-grid .two-orders .calendar-rich-order .delivery-order-state,
.two-orders .calendar-rich-details,.two-orders .calendar-rich-progress,.two-orders .calendar-rich-notes { font-size:10.5px; line-height:12px; }
.calendar-date-status { font-size:10.5px; line-height:15px; font-weight:600; white-space:nowrap; }
.calendar-date-status.late { color:var(--cal-late); }.calendar-date-status.soon { color:var(--cal-soon); }.calendar-date-status.normal { color:var(--cal-normal); }
.calendar-order-mark { flex:none; margin-left:auto; padding:0 3px; border-radius:3px; background:color-mix(in srgb,var(--cal-soon) 12%,transparent); color:var(--cal-soon); font-size:10px; }
.calendar-grid .calendar-day-heading { flex-wrap:wrap; column-gap:4px; }

#close-details { flex:none; min-width:64px; min-height:36px; padding:7px 14px; border:1px solid #86a6c9; border-radius:7px; background:#263d57; color:#f4f8ff; font-weight:700; }
#close-details:hover { background:#345472; border-color:#bdd8f5; box-shadow:0 0 0 2px #80b9f426; }
#close-details:focus-visible { outline:2px solid #f5d742; outline-offset:3px; }
.calendar-view #completed-section { display:none; }
.timeline-segment-caption { position:absolute; left:20px; font-size:11px; color:var(--cal-dim); pointer-events:none; }
.screen-mode.calendar-view .calendar-grid { grid-template-rows:repeat(var(--calendar-rows,6),minmax(112px,1fr)); min-height:calc(var(--calendar-rows,6) * 118px + 6px); }

.screen-mode .brand .delivery-tabs { display:flex; gap:6px; margin:0 0 0 14px; flex:none; }
.screen-mode .brand .delivery-tabs .button { padding:4px 10px; min-height:30px; font-size:12px; white-space:nowrap; }
.screen-mode.calendar-view .workspace-heading { margin:0; gap:0; }
@media(max-width:700px) { .screen-mode .brand { flex-wrap:wrap; }.screen-mode .brand .delivery-tabs { margin-left:0; }.screen-mode .brand .delivery-tabs .button { padding:4px 7px; } }

/* Month boundaries run through the gaps, leaving date tiles unchanged. */
.calendar-grid { position:relative; }
.calendar-month-boundaries { position:absolute; left:0; top:0; pointer-events:none; overflow:visible; z-index:2; }
.calendar-month-boundaries path { fill:none; stroke:#cfb963; stroke-width:1; stroke-dasharray:4 5; stroke-opacity:.6; stroke-linecap:round; stroke-linejoin:round; }
.delivery-calendar[data-theme="light"] .calendar-month-boundaries path { stroke:#bb8109; }


/* A quiet warm tint behind the first date of each month. */
.calendar-grid .is-month-first:not(.is-today) .calendar-day-heading strong { background:color-mix(in srgb,#d8b95b 14%,transparent); box-shadow:0 0 0 3px color-mix(in srgb,#d8b95b 14%,transparent); border-radius:3px; }
.calendar-grid .is-month-first:not(.is-today) .calendar-empty-date { background:color-mix(in srgb,#d8b95b 13%,var(--cal-bg)); border-color:color-mix(in srgb,#d8b95b 22%,var(--cal-line)); }

/* Give every occupied date tile more order space in calendar fullscreen. */
.screen-mode.calendar-view .calendar-grid .calendar-cell.has-orders { padding:3px; gap:2px; }
.screen-mode.calendar-view .calendar-cell.has-orders .calendar-day-heading { min-height:20px; padding:0 2px; gap:3px; font-size:13px; line-height:18px; flex-wrap:nowrap; }
.screen-mode.calendar-view .calendar-cell.has-orders .calendar-day-heading strong { font-size:13px; }
.screen-mode.calendar-view .calendar-cell.has-orders .delivery-order { flex:1; min-height:0; padding:3px 4px; gap:1px; border-radius:5px; }
.screen-mode.calendar-view .calendar-cell.has-orders .delivery-order-title { line-height:18px; }
.screen-mode.calendar-view .calendar-cell.two-orders .delivery-order-title { line-height:14px; }
.screen-mode.calendar-view .calendar-cell.has-orders .calendar-more { flex:none; min-height:18px; font-size:12px; line-height:18px; }

.screen-mode.calendar-view .calendar-cell.has-orders .calendar-date-status { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.screen-mode.calendar-view .calendar-cell.has-orders .calendar-day-heading > strong,
.screen-mode.calendar-view .calendar-cell.has-orders .calendar-today-badge,
.screen-mode.calendar-view .calendar-cell.has-orders .calendar-count { flex:none; }

.calendar-compact-details { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; line-height:14px; color:var(--cal-dim); }

/* Reserve space only in calendar weeks that contain multiple orders. */
.screen-mode.calendar-view .calendar-grid { grid-template-rows:var(--calendar-row-sizes,repeat(var(--calendar-rows,6),112px)); min-height:var(--calendar-min-height,714px); }
.screen-mode.calendar-view .two-orders .calendar-rich-details { display:block; }
.screen-mode.calendar-view .two-orders .calendar-rich-progress,
.screen-mode.calendar-view .two-orders .calendar-rich-notes,
.screen-mode.calendar-view .two-orders .calendar-rich-estimate { display:none; }
.screen-mode.calendar-view .many-orders .delivery-order { padding:2px 4px; gap:0; }
.screen-mode.calendar-view .many-orders .delivery-order-title { line-height:16px; }
.screen-mode.calendar-view .many-orders .calendar-compact-details { line-height:13px; }

/* Four-plus dates need room for three two-line rows and the more button. */
.screen-mode.calendar-view .calendar-cell.has-orders.overflow-orders .delivery-order-title { font-size:13px; line-height:16px; flex:none; }
.screen-mode.calendar-view .calendar-cell.has-orders.overflow-orders .calendar-compact-details { line-height:14px; flex:none; }
.screen-mode.calendar-view .calendar-cell.has-orders.overflow-orders .delivery-order { min-height:38px; padding:2px 4px; gap:1px; }
.screen-mode.calendar-view .two-orders .calendar-rich-progress,
.screen-mode.calendar-view .two-orders .calendar-rich-notes { display:-webkit-box; -webkit-line-clamp:1; flex:none; line-height:12px; }
.screen-mode.calendar-view .two-orders .calendar-rich-details { flex:none; line-height:12px; }

.calendar-month-nav { position:static; display:flex; align-items:center; gap:5px; flex-wrap:wrap; padding:0; margin:0; }
.calendar-month-nav[hidden] { display:none; }
.calendar-month-nav .button { padding:3px 8px; min-height:27px; font-size:12px; }
.calendar-month-nav .button.selected { color:var(--cal-text); border-color:var(--cal-normal); background:color-mix(in srgb,var(--cal-normal) 14%,var(--cal-bg)); }
.screen-mode.calendar-view .calendar-month-nav { flex:none; }

.stat-card[data-stat-filter="late"],.board-filter-feedback[data-filter="late"] { --filter-accent:#ff6378; }
.stat-card[data-stat-filter="follow"],.board-filter-feedback[data-filter="follow"] { --filter-accent:#ffad54; }
.stat-card[data-stat-filter="paused"],.board-filter-feedback[data-filter="paused"] { --filter-accent:#9bdcf2; }
.stat-card.selected:is([data-stat-filter="late"],[data-stat-filter="follow"],[data-stat-filter="paused"]) { border-color:var(--filter-accent); background:color-mix(in srgb,var(--filter-accent) 12%,var(--bg-panel)); box-shadow:inset 0 0 0 2px var(--filter-accent),0 0 15px color-mix(in srgb,var(--filter-accent) 15%,transparent); }
.stat-card.selected:is([data-stat-filter="late"],[data-stat-filter="follow"],[data-stat-filter="paused"]) :is(.label,.hint) { color:var(--filter-accent); font-weight:700; }
.board-filter-feedback { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:6px 0 10px; padding:7px 10px; border-left:3px solid var(--filter-accent); border-radius:5px; background:color-mix(in srgb,var(--filter-accent) 7%,var(--bg-panel)); color:var(--filter-accent); font-size:13px; font-weight:700; }
.board-filter-feedback[hidden],.calendar-view .board-filter-feedback { display:none; }
.board-filter-feedback .button { padding:3px 9px; min-height:26px; font-size:12px; }



.calendar-view .workspace-heading .search { display:none; }

.returned-order { animation:returned-order-flash 2.4s ease-out var(--return-highlight-delay,0ms); }
@keyframes returned-order-flash { 0%,40% { outline:2px solid #f5d742; outline-offset:-2px; box-shadow:inset 0 0 18px #f5d74222; } 100% { outline:2px solid transparent; outline-offset:-2px; box-shadow:inset 0 0 0 transparent; } }
@media(prefers-reduced-motion:reduce) { .returned-order { animation:none; outline:2px solid #f5d742; outline-offset:-2px; } }

.calendar-density { display:flex; gap:3px; padding:2px; border:1px solid var(--cal-line); border-radius:6px; }
.calendar-density[hidden] { display:none; }
.calendar-density .button { padding:3px 8px; min-height:26px; font-size:12px; }
.calendar-density .button.selected { border-color:var(--cal-normal); color:var(--cal-text); background:color-mix(in srgb,var(--cal-normal) 14%,var(--cal-bg)); }
.screen-mode [data-calendar-density="comfortable"] .two-orders .calendar-rich-progress,
.screen-mode [data-calendar-density="comfortable"] .two-orders .calendar-rich-notes { -webkit-line-clamp:2; line-height:14px; }
.screen-mode [data-calendar-density="comfortable"] .calendar-cell.has-orders.many-orders .delivery-order-title { font-size:13px; line-height:16px; flex:none; }
.screen-mode [data-calendar-density="comfortable"] .many-orders .calendar-rich-progress,
.screen-mode [data-calendar-density="comfortable"] .many-orders .calendar-rich-notes { display:-webkit-box; -webkit-line-clamp:1; line-height:12px; flex:none; }
.screen-mode [data-calendar-density="comfortable"] .many-orders .calendar-rich-details { display:block; font-size:11px; line-height:13px; flex:none; }
.screen-mode [data-calendar-density="comfortable"] .many-orders .calendar-rich-estimate { display:none; }

/* Timeline fullscreen tools scroll away with the chart, leaving the app header. */
.screen-mode.timeline-screen .timeline-scroll { position:relative; }
.screen-mode.timeline-screen .timeline-scroll > .delivery-heading { padding:4px 2px; margin-bottom:3px; }
.screen-mode.timeline-screen .timeline-scroll > .delivery-notices { padding:0 2px 4px; }

.progress-head { align-items:center; }
.progress-actions { display:flex; align-items:center; flex-wrap:wrap; gap:6px; min-width:0; }
.progress-actions .progress-label:empty { display:none; }
.progress-time { margin-left:auto; }
.nudge-action { flex:none; padding:4px 11px; min-height:28px; font:600 11px/1.3 var(--font); color:#b9ddff; border:1px solid #467eaf; background:#1b3e60; border-radius:8px; white-space:nowrap; cursor:pointer; transition:background .15s,border-color .15s; }
.nudge-action:hover:not(:disabled) { color:#e4f2ff; background:#28567e; border-color:#7cb9ed; }
.nudge-action:focus-visible { outline:2px solid #99ceff; outline-offset:3px; }
.nudge-action:disabled { opacity:.55; cursor:default; }
.order-card.nudge-feedback { animation:nudge-feedback 3.6s ease-out var(--nudge-feedback-delay,0ms); }
.order-card.nudge-feedback .nudge-action { animation:nudge-button-feedback 3.6s ease-out var(--nudge-feedback-delay,0ms); }
@keyframes nudge-button-feedback {
  0%,22%,100% { background:#1b3e60; color:#b9ddff; border-color:#467eaf; box-shadow:none; transform:scale(1); }
  12%,34% { background:#8dceff; color:#08263f; border-color:#d0edff; box-shadow:0 0 0 3px #74c2ff33,0 0 18px #74c2ff88; transform:scale(1.06); }
  46%,84% { background:#28567e; color:#e4f2ff; border-color:#8dceff; box-shadow:0 0 0 2px #74c2ff22; transform:scale(1); }
}
@keyframes nudge-feedback {
  12%,34% { outline:2px solid #a4d7ff; outline-offset:-2px; box-shadow:inset 0 0 34px #68b8ff55,0 0 16px #68b8ff55; }
  0%,22% { outline:2px solid #649bc5; outline-offset:-2px; box-shadow:inset 0 0 8px #68b8ff11; }
  46%,84% { outline:2px solid #a4d7ff; outline-offset:-2px; box-shadow:inset 0 0 18px #68b8ff22; }
  100% { outline:2px solid transparent; outline-offset:-2px; box-shadow:none; }
}
@media(prefers-reduced-motion:reduce) {
  .order-card.nudge-feedback { animation:none; outline:2px solid #a4d7ff; outline-offset:-2px; }
  .order-card.nudge-feedback .nudge-action { animation:none; background:#8dceff; color:#08263f; border-color:#d0edff; }
}
.order-card.nudge-pending { outline:2px solid #548ec1; outline-offset:-2px; animation:nudge-border-reminder 1.6s ease-in-out infinite; }
@keyframes nudge-border-reminder {
  0%,100% { outline-color:#b4e1ff; }
  50% { outline-color:#315575; }
}
/* Preserve immediate save feedback; pending borders keep pulsing after it ends. */
.order-card.nudge-pending.nudge-feedback { animation:nudge-feedback 3.6s ease-out var(--nudge-feedback-delay,0ms),nudge-border-reminder 1.6s ease-in-out infinite; }
.order-card.nudge-pending .progress-time { padding:3px 7px; border-radius:5px; color:#e0f2ff; background:#24567c; font-weight:700; animation:nudge-reminder 1.6s ease-in-out infinite; }
@keyframes nudge-reminder {
  0%,100% { background:#367eb0; color:#fff; box-shadow:0 0 8px #80c6ff66; }
  50% { background:#173b58; color:#8db6d5; box-shadow:none; }
}
#nudge-notice { width:440px; max-width:calc(100vw - 32px); padding:0; border:1px solid #446b90; border-radius:18px; background:#10243a; box-shadow:0 24px 90px #0009; }
.nudge-notice-hero { display:flex; align-items:center; gap:16px; padding:28px 28px 22px; background:radial-gradient(ellipse at top left,#307caa44,transparent 80%); border-bottom:1px solid #365372; }
.nudge-notice-icon { display:grid; place-items:center; flex:none; width:52px; height:52px; border:1px solid #609cc8; border-radius:16px; background:#285576; color:#c5e8ff; box-shadow:0 6px 22px #0002; }
.nudge-notice-icon svg { width:28px; height:28px; }
.nudge-notice-eyebrow { display:block; margin-bottom:7px; color:#8ac8f3; font-size:11px; letter-spacing:.14em; }
#nudge-notice-title { margin:0; color:#f0f7ff; font-size:22px; line-height:1.35; }
#nudge-notice-message { margin:22px 28px 10px; color:#e2edf8; font-size:14px; line-height:1.9; }
.nudge-notice-hint { margin:0 28px 24px; color:#91abc3; font-size:12px; line-height:1.7; }
#nudge-notice form { display:flex; margin:0; padding:0 28px 26px; }
#nudge-notice form .button { display:flex; justify-content:space-between; align-items:center; width:100%; min-height:44px; padding:10px 16px; border:1px solid #79b7e5; border-radius:9px; background:#85c9fa; color:#0b2941; font-size:14px; font-weight:700; }
#nudge-notice form .button:hover { background:#a4dcff; }
@media(prefers-reduced-motion:reduce) {
  .order-card.nudge-pending,.order-card.nudge-pending.nudge-feedback { animation:none; outline-color:#b4e1ff; }
  .order-card.nudge-pending .progress-time { animation:none; text-decoration:underline; text-underline-offset:3px; }
}
.order-card.nudge-updated:not(.nudge-pending) { outline:2px solid #69c9a1; outline-offset:-2px; animation:nudge-reply-reminder 1.8s ease-in-out infinite; }
@keyframes nudge-reply-reminder { 0%,100% { outline-color:#9af4c8; } 50% { outline-color:#33795b; } }
.has-nudge-reply { padding:7px 9px; border:1px solid #4b9c78; border-radius:7px; background:#174f3a; }
.has-nudge-reply .progress-label { color:#b9ffdc; font-size:12px; font-weight:800; letter-spacing:0; }
.has-nudge-reply .progress-time { color:#a0dfbc; }
.order-card.nudge-updated:not(.nudge-pending) .progress-text { padding:5px 8px; border-left:3px solid #63d9a1; border-radius:4px; background:#164432; color:#b6f6d1; }
.order-card.progress-feedback .progress-text { animation:progress-saved-feedback 3.6s ease-out var(--nudge-feedback-delay,0ms); border-radius:6px; }
@keyframes progress-saved-feedback {
  0%,22%,100% { background:transparent; color:var(--accent); box-shadow:none; }
  12%,34% { background:#a3f0cc; color:#103c2b; box-shadow:0 0 0 5px #75e2b329,0 0 18px #75e2b344; }
  46%,84% { background:#1c543f; color:#ceffe8; box-shadow:0 0 0 3px #75e2b322; }
}
@media(prefers-reduced-motion:reduce) {
  .order-card.nudge-updated:not(.nudge-pending) { animation:none; }
  .order-card.progress-feedback .progress-text { animation:none; background:#1c543f; color:#ceffe8; }
}
.nudge-replies { padding:10px 12px; margin-bottom:12px; border:1px solid #4c8b73; background:#16423544; border-radius:7px; color:#a1e3c4; }
.nudge-replies p { margin:7px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.management-menu{position:relative}.management-menu summary{list-style:none;cursor:pointer}.management-actions{position:absolute;right:0;top:calc(100% + 8px);z-index:20;display:flex;flex-direction:column;gap:8px;min-width:132px;padding:8px;background:var(--card,#142b40);border:1px solid #63819b66;border-radius:10px}.management-actions>.button{white-space:nowrap;width:100%}
#personnel-dialog{width:min(820px,94vw)}.personnel-filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:20px 0}.personnel-filters label{display:grid;gap:6px}.personnel-filters input,.personnel-filters select{padding:10px;border:1px solid #63819b;border-radius:8px;background:transparent;color:inherit}.personnel-filters select option{color:#142b40;background:#fff}
.personnel-table{width:100%;border-collapse:collapse;text-align:left}.personnel-table th{font-size:13px;opacity:.7}.personnel-table th,.personnel-table td{padding:14px 10px;border-bottom:1px solid #63819b44;overflow-wrap:anywhere}.personnel-pager{display:flex;justify-content:flex-end;align-items:center;gap:14px;margin-top:20px}.screen-mode #management-menu{display:none}
@media(max-width:600px){.personnel-table thead{display:none}.personnel-table tr{display:block;padding:10px 0;border-bottom:1px solid #63819b44}.personnel-table td{display:flex;justify-content:space-between;gap:12px;border:0;padding:6px}.personnel-table td::before{content:attr(data-label);opacity:.65;flex-shrink:0}.personnel-filters label{flex:1;min-width:120px}.personnel-filters input{min-width:0;width:100%;box-sizing:border-box}}
#personnel-dialog .personnel-filters{margin:20px 16px}#personnel-message,#personnel-list{margin:16px}#personnel-dialog .personnel-pager{margin:20px 16px}#personnel-dialog .dialog-heading p{font-size:13px;opacity:.65;margin-bottom:0}
@media(max-width:600px){#personnel-dialog .personnel-filters label:first-child{flex-basis:100%}#personnel-dialog .personnel-filters label:nth-child(2){flex:1}#personnel-dialog .personnel-filters button{min-height:42px}}
.personnel-confirm-content{padding:4px 20px 12px}.personnel-confirm-content>p{line-height:1.8}#personnel-disable{width:min(480px,92vw)}#personnel-disable-target{font-size:18px;font-weight:700}#personnel-disable-description{opacity:.8}#personnel-disable-admin{color:#edb778}#personnel-disable-submit,.personnel-disable-button{border-color:#c56d70;color:#f2a2a5}#personnel-disable-message{color:#edb778}
#personnel-disable.restoring #personnel-disable-submit,.personnel-restore-button{border-color:#4b9d97;color:#7ed2c4}
#personnel-create{width:min(520px,94vw)}.personnel-create-form{display:grid;gap:16px;padding:20px}.personnel-create-form>label{display:grid;gap:8px}.personnel-create-form input:not([type=checkbox]),.personnel-create-form select{width:100%;box-sizing:border-box;padding:11px;border:1px solid #63819b;border-radius:8px;background:transparent;color:inherit}.personnel-create-form select option{background:#fff;color:#142b40}.personnel-create-form .personnel-admin-confirm{display:flex;gap:10px;line-height:1.6;color:#edb778}.personnel-create-form [hidden]{display:none!important}#personnel-create-message{margin:0;line-height:1.7;color:#edb778}#open-personnel-create{margin:16px 16px 0}.personnel-create-form .hint{font-size:12px;opacity:.7;line-height:1.8;margin:0}
#personnel-reset{width:min(520px,94vw)}.personnel-reset-button{margin-left:8px}#personnel-reset-message{margin:0;line-height:1.7;color:#edb778}.personnel-table td[data-label="操作"]{min-width:150px}
@media(max-width:600px){.personnel-table td[data-label="操作"]{justify-content:flex-end;flex-wrap:wrap}.personnel-table td[data-label="操作"]::before{margin-right:auto}}
#own-password{width:min(520px,94vw)}#own-password-message{line-height:1.7;color:#edb778;margin:0}.screen-mode #my-account{display:none}
#personnel-role{width:min(520px,94vw)}.personnel-role-transition{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;border:1px solid #63819b66;border-radius:10px}.personnel-role-transition span{font-size:12px;opacity:.85}.personnel-role-transition strong{display:block;margin-top:8px;font-size:16px}#personnel-role-message{line-height:1.7;color:#edb778;margin:0}#personnel-role-impact{line-height:1.8;margin:0}.personnel-actions summary{cursor:pointer;list-style:none}.personnel-actions summary::-webkit-details-marker{display:none}.personnel-action-menu{display:flex;flex-direction:column;gap:8px;padding-top:8px}.personnel-action-menu .button{margin:0;width:100%}.personnel-table td[data-label="操作"]{min-width:100px}
.password-peek-wrap{position:relative;display:block;min-width:0}.password-peek-wrap>input[type=password]{width:100%;box-sizing:border-box;font-family:ui-monospace,Consolas,monospace;letter-spacing:normal}.password-peeking{color:transparent!important;-webkit-text-fill-color:transparent!important}.password-peek-viewport{position:absolute;top:0;bottom:0;overflow:hidden;display:flex;align-items:center;pointer-events:none;user-select:none}.password-peek-viewport[hidden]{display:none!important}.password-peek-line{white-space:pre;flex:none}.password-peek-wrap input::-ms-reveal{display:none}
/* Enterprise management workspace */
#personnel-dialog{width:min(1120px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 48px);overflow:hidden;border:1px solid #304154;border-radius:20px;background:#111e2e;color:#e9f0f7;box-shadow:0 32px 110px #0009;font-weight:400}
.management-shell{display:grid;grid-template-columns:190px minmax(0,1fr);height:min(720px,calc(100dvh - 48px))}
.management-sidebar{display:flex;flex-direction:column;padding:30px 16px 20px;background:#0b1726;border-right:1px solid #263549}
.management-brand{display:flex;align-items:center;gap:10px;margin:0 4px 38px}.management-mark{display:grid;place-items:center;width:38px;height:38px;border:1px solid #375374;border-radius:11px;color:#8ec7ff;background:#1a314d}.management-mark svg{width:23px;height:23px}.management-brand strong{display:block;font-size:17px;font-weight:650;letter-spacing:.5px}.management-brand small{display:block;margin-top:5px;font-size:11px;color:#748da9}
.management-nav{display:flex;flex-direction:column;gap:8px}.management-nav .button{width:100%;padding:13px 14px;border:1px solid transparent;border-radius:9px;background:transparent;color:#91a5bc;text-align:left;font-size:14px;font-weight:550}.management-nav .button:hover{background:#15263b;color:#f0f6ff}.management-nav .button.is-active{color:#a9d5ff;background:#1b3551;border-color:#294e73;box-shadow:inset 3px 0 #79b8ff}
.management-sidebar-note{display:flex;align-items:center;gap:7px;margin-top:auto;padding:16px 6px 0;border-top:1px solid #223246;color:#6f86a2;font-size:11px}.management-scope-dot{width:5px;height:5px;border-radius:50%;background:#588f88}
.management-main{min-width:0;min-height:0;overflow-y:auto;display:flex;flex-direction:column;scrollbar-gutter:stable}
.management-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding:30px 30px 26px;border-bottom:1px solid #29394b}.management-heading h2{margin:8px 0 10px;font-size:25px;font-weight:650;letter-spacing:.6px}.management-eyebrow{margin:0;color:#6a91ba;font-size:11px;letter-spacing:2px}.management-heading #management-subtitle{margin:0;color:#8ba0b8;font-size:12px;line-height:1.7}.management-heading-actions{display:flex;align-items:center;gap:12px;padding-top:8px;flex-shrink:0}
#personnel-dialog #open-personnel-create{margin:0;min-height:38px;border:1px solid #69b3ff;background:#86c0ff;color:#10243a;padding:9px 14px;border-radius:8px;font-weight:700;font-size:12px;box-shadow:0 3px 12px #0002}#personnel-dialog #open-personnel-create:hover{background:#b2d8ff}.management-close{display:grid;place-items:center;width:32px;height:32px;padding:0!important;border:1px solid transparent!important;background:transparent!important;color:#8a9eb5}.management-close:hover{color:#fff;background:#26384b!important}
.management-panel{display:flex;flex-direction:column;flex:1;min-width:0;padding:26px 30px 20px}.management-panel[hidden]{display:none!important}
#personnel-dialog .personnel-filters{display:flex;align-items:end;gap:12px;flex-wrap:nowrap;margin:0 0 22px;padding:0}.personnel-filters .management-search{flex:1;min-width:0}#personnel-dialog .personnel-filters label{display:grid;gap:8px;color:#8da4be;font-size:11px;flex:none;min-width:0}#personnel-dialog .personnel-filters .management-search{flex:1}#personnel-dialog .personnel-filters input,#personnel-dialog .personnel-filters select{min-height:41px;background:#0c1929;border:1px solid #30455b;border-radius:8px;font-size:13px;padding:10px 12px;color:#d9e5f1}#personnel-dialog .personnel-filters input{width:100%;box-sizing:border-box}#personnel-dialog .personnel-filters input::placeholder{color:#607c99}#personnel-dialog .personnel-filters select{min-width:125px}#personnel-dialog .management-query{height:41px;background:#1d3045;border:1px solid #3d5874;color:#b9cde3;border-radius:8px;padding:9px 17px;font-size:12px}
.management-results{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;color:#748ba5;font-size:11px}.management-results>span{white-space:nowrap;color:#627b96}#personnel-dialog #personnel-message{margin:0;min-height:18px;font-size:12px;line-height:1.6;color:#94abc3}#personnel-dialog #personnel-list{margin:0;min-height:80px}
#personnel-dialog .personnel-table{width:100%;table-layout:auto;border-collapse:separate;border-spacing:0;text-align:left}#personnel-dialog .personnel-table th{padding:12px 12px;color:#7690aa;background:#15263a;font-size:11px;font-weight:500;opacity:1;border-bottom:1px solid #304257;white-space:nowrap}#personnel-dialog .personnel-table th:first-child{border-radius:8px 0 0 0}#personnel-dialog .personnel-table th:last-child{border-radius:0 8px 0 0;text-align:right}#personnel-dialog .personnel-table td{padding:20px 12px;border-bottom:1px solid #26374a;vertical-align:middle;font-size:12px}#personnel-dialog .personnel-table tr:hover td{background:#172a402e}
.member-identity{display:flex;align-items:center;gap:11px;min-width:150px}.member-avatar{flex-shrink:0;display:grid;place-items:center;width:36px;height:36px;border:1px solid #3d5371;border-radius:11px;background:#253650;color:#b7cce6;font-size:14px;font-weight:600}.member-avatar.is-self{border-color:#3e6c78;background:#1c3b45;color:#a2d7d7}.member-copy{min-width:0}.member-copy strong{display:flex;align-items:center;flex-wrap:wrap;gap:7px;color:#e7eff8;font-size:13px;font-weight:600;line-height:1.7;overflow-wrap:anywhere}.member-copy small{display:block;margin-top:3px;color:#6f8aa6;font:11px var(--mono);overflow-wrap:anywhere}.member-self{padding:1px 5px;border-radius:4px;background:#26444a;color:#99c9c5;font-size:9px;font-weight:400;white-space:nowrap}.member-role{display:inline-block;white-space:nowrap;font-size:11px}.member-role.is-admin{color:#a7baf4}.member-role.is-recorder{color:#96adc5}.member-status{display:inline-flex;align-items:center;gap:6px;font-size:11px;white-space:nowrap}.member-status::before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor}.member-status.is-active{color:#71bda8}.member-status.is-disabled{color:#7b8797}
#personnel-dialog .personnel-table td.member-operations{min-width:0;white-space:nowrap;text-align:right}#personnel-dialog .member-action{appearance:none;border:0;background:transparent;padding:6px 7px;border-radius:5px;color:#83b7ef;font:inherit;font-size:11px;cursor:pointer;line-height:1.6}#personnel-dialog .member-action:hover{color:#c1e0ff;background:#294b6a55}#personnel-dialog .member-action.is-danger{color:#bb8790;margin-left:4px}#personnel-dialog .member-action.is-danger:hover{color:#ffb7bf;background:#75425244}#personnel-dialog .personnel-restore-button{color:#75c8b3}#personnel-dialog .member-current{font-size:11px;color:#596f86}#personnel-dialog .member-action:focus-visible{outline:2px solid #8abfff;outline-offset:1px}
#personnel-dialog .personnel-pager{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:24px 0 0;padding-top:18px;margin-top:auto;font-size:11px;color:#7d95af}#personnel-dialog .personnel-pager>div{display:flex;gap:8px}#personnel-dialog .personnel-pager .button{padding:7px 12px;background:#1a2c40;border:1px solid #324b66;border-radius:7px;color:#9fb9d5;font-size:11px}#personnel-dialog .personnel-pager .button:disabled{opacity:.3;cursor:default}
.management-security-intro{display:flex;gap:14px;align-items:center;margin:0 0 24px}.management-security-intro>span{display:grid;place-items:center;width:46px;height:46px;background:#1c354d;border:1px solid #335676;border-radius:13px;color:#91c2f4}.management-security-intro svg{width:24px;height:24px}.management-security-intro h3{font-size:17px;margin:0 0 7px;font-weight:600}.management-security-intro p{font-size:12px;color:#7b95b0;margin:0;line-height:1.7}.management-password-card{max-width:550px;border:1px solid #30455c;background:#0e1b2b;border-radius:13px}.management-password-card .personnel-create-form{padding:24px;gap:20px}.management-password-card .personnel-create-form>label{font-size:12px;color:#b5c8dc}.management-password-card .personnel-create-form input{background:#14263b;border-color:#34516e;min-height:43px}.management-password-card .personnel-create-form .hint{color:#91a9c2;opacity:1}.management-password-card .personnel-pager{margin:0!important;padding-top:4px!important;justify-content:flex-end!important}.management-password-card .personnel-pager .button.primary{background:#86c0ff!important;color:#10243a!important;border-color:#86c0ff!important}
@media(max-width:1050px) and (min-width:701px){.management-shell{grid-template-columns:165px minmax(0,1fr)}.management-heading{padding:24px 20px}.management-panel{padding:22px 20px 18px}.member-identity{min-width:125px}#personnel-dialog .personnel-table th,#personnel-dialog .personnel-table td{padding-left:8px;padding-right:8px}#personnel-dialog .member-action{padding:5px 4px}}
@media(max-width:700px){#personnel-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 24px);border-radius:16px}.management-shell{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);height:calc(100dvh - 24px)}.management-sidebar{padding:18px 16px 14px;border-right:0;border-bottom:1px solid #2a3b4f}.management-brand{margin:0 40px 17px 0;gap:9px}.management-mark{width:30px;height:30px;border-radius:9px}.management-mark svg{width:20px;height:20px}.management-brand strong{font-size:15px}.management-brand small{font-size:10px;margin-top:3px}.management-nav{flex-direction:row;gap:6px}.management-nav .button{flex:1;text-align:center;padding:10px 7px;font-size:12px;border-radius:7px}.management-nav .button.is-active{box-shadow:inset 0 -2px #79b8ff}.management-sidebar-note{display:none}.management-heading{display:block;padding:21px 18px 19px}.management-heading h2{font-size:22px;margin:5px 0 7px}.management-heading #management-subtitle{font-size:11px}.management-eyebrow{font-size:10px}.management-heading-actions{display:block;padding:0}#personnel-dialog #open-personnel-create{margin-top:14px;min-height:35px;padding:8px 12px;font-size:11px}.management-close{position:absolute;top:15px;right:14px;z-index:2}.management-panel{padding:18px 16px;min-height:0}.management-main{max-height:none;overflow-y:auto;scrollbar-gutter:auto}#personnel-dialog .personnel-filters{display:grid;grid-template-columns:1fr auto;gap:12px;margin-bottom:18px}#personnel-dialog .personnel-filters .management-search{grid-column:1/-1}#personnel-dialog .personnel-filters label{font-size:10px;gap:6px}#personnel-dialog .personnel-filters select{width:100%}.management-results{margin-bottom:8px;font-size:10px}.management-results>span{font-size:10px}#personnel-dialog #personnel-message{font-size:11px}#personnel-dialog .personnel-table thead{display:none}#personnel-dialog .personnel-table tbody{display:grid;gap:12px}#personnel-dialog .personnel-table tr{display:grid;grid-template-columns:1fr 1fr;padding:16px;border:1px solid #2b4056;border-radius:11px;background:#142538;gap:12px}#personnel-dialog .personnel-table td{padding:0;border:0;display:block;min-width:0}#personnel-dialog .personnel-table td::before{display:none}#personnel-dialog .personnel-table td.member-cell{grid-column:1/-1}.member-identity{min-width:0;gap:10px}.member-copy strong{font-size:13px}.member-copy small{font-size:10px}.member-role,.member-status{font-size:11px}#personnel-dialog .personnel-table td.member-operations{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-end;gap:10px;white-space:normal;border-top:1px solid #2b4056;padding-top:9px;margin-top:1px;flex-wrap:wrap}#personnel-dialog .member-action{font-size:11px;padding:6px 2px}#personnel-dialog .member-action.is-danger{margin-left:auto}#personnel-dialog .personnel-pager{padding-top:18px;margin-top:14px;flex-shrink:0}.management-security-intro{gap:10px;margin-bottom:18px}.management-security-intro h3{font-size:16px}.management-security-intro p{font-size:11px}.management-password-card .personnel-create-form{padding:18px;gap:18px}.management-password-card .personnel-pager{display:flex!important;flex-wrap:wrap!important;gap:8px!important}.management-password-card .personnel-create-form .hint{font-size:11px}.management-password-card .personnel-pager .button{font-size:11px!important}}

.auth-card label small{font-size:11px;line-height:1.7;color:#94a8c5;font-weight:400}.auth-card input::placeholder{font-size:12px;color:#7d92ae}

/* 手机订单首页：日常操作优先，低频按钮展开后仍沿用原权限。 */
.phone-control,.stat-short {display:none}
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body:not(.screen-mode) .topbar {padding:5px 12px;min-height:0}
  body:not(.screen-mode) .topbar :is(.brand,.clock) {display:none}
  body:not(.screen-mode) .top-right {display:flex;width:100%;flex-wrap:wrap;justify-content:flex-end;gap:4px}
  body:not(.screen-mode) .top-right .role-badge {display:inline-flex;margin-right:auto}
  body:not(.screen-mode) .phone-control {display:inline-flex;align-items:center;justify-content:center}
  body:not(.screen-mode) .top-right .button {min-height:44px}
  body:not(.screen-mode) #phone-more {order:1}
  body:not(.screen-mode) #phone-more[aria-expanded="false"] ~ button:not(#new-order) {display:none}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order) {order:2}
  body:not(.screen-mode) #screen span {font-size:0}
  body:not(.screen-mode) #screen span::after {content:'横屏查看';font-size:14px}
  body:not(.screen-mode) .stats-bar {grid-template-columns:repeat(6,minmax(0,1fr));gap:2px;padding:6px 8px}
  body:not(.screen-mode) .stat-pair {display:contents}
  body:not(.screen-mode) .stats-bar .stat-card {border:1px solid var(--line);border-radius:6px;align-items:center;justify-content:center;padding:5px 1px;min-height:48px;gap:3px}
  body:not(.screen-mode) .stat-card :is(.hint,.stat-full,small), body:not(.screen-mode) .stat-card::after {display:none}
  body:not(.screen-mode) .stat-short {display:inline}
  body:not(.screen-mode) .stat-card .label {font-size:12px;letter-spacing:0}
  body:not(.screen-mode) .stat-card .value strong {font-size:18px}
  body:not(.screen-mode) .workspace-heading {gap:4px;align-items:center}
  body:not(.screen-mode) .workspace-heading .delivery-tabs {gap:2px}
  body:not(.screen-mode) .workspace-heading :is(.delivery-tabs .button,#phone-search) {min-height:44px;padding:4px 6px;font-size:13px}
  body:not(.screen-mode) #phone-search {margin-left:auto}
  body:not(.screen-mode) #phone-search[aria-expanded="false"] ~ .toolbar, body:not(.screen-mode) .data-status[data-kind="ready"] {display:none}
  body:not(.screen-mode) .workspace-heading .toolbar {flex-basis:100%;min-width:0}
  body:not(.screen-mode) .workspace-heading .search-sort {width:100%;display:flex}
  body:not(.screen-mode) .workspace-heading .search {min-width:0;flex:1}
  body:not(.screen-mode) .workspace-heading .search input {min-width:0;width:100%;height:44px;font-size:16px}
  body:not(.screen-mode) .workspace-heading #sort {height:44px}
  body:not(.screen-mode).calendar-view #phone-search {display:none}

}
@media (max-width:700px) {
  body:not(.screen-mode) .order-card {min-width:0;grid-template-columns:minmax(0,1fr)}
  body:not(.screen-mode) .order-card .order-meta > .weight-cell:last-child {margin-right:0}
  body:not(.screen-mode) .order-id {min-width:0;overflow-wrap:anywhere}
}

/* 手机首页两行：统计 + 视图及常用操作；更多展开浮层。 */
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body:not(.screen-mode) .topbar {position:absolute;top:65px;right:12px;z-index:10;padding:0;border:0;background:none}
  body:not(.screen-mode) .top-right {width:auto;gap:4px;position:relative}
  body:not(.screen-mode) .top-right :is(.role-badge,.demo-badge,#help,#refresh) {display:none}
  body:not(.screen-mode) #new-order {font-size:0;width:52px;padding:0;background:#183c60;border:1px solid #4d83b3;color:#e3f0ff;box-shadow:none}
  body:not(.screen-mode) #new-order::after {content:'+新建';font-size:14px;font-weight:600}
  body:not(.screen-mode) #phone-more {width:44px;padding:0;font-size:13px}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order):not(#help):not(#refresh) {position:relative;width:100%;min-width:120px;justify-content:center}
  body:not(.screen-mode) .top-right:has(#phone-more[aria-expanded="true"]) {width:140px;display:grid;grid-template-columns:1fr 44px;padding:6px;background:var(--bg-panel);border:1px solid var(--line);border-radius:8px}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] {grid-column:2;grid-row:1}
  body:not(.screen-mode) .top-right:has(#phone-more[aria-expanded="true"]) #new-order {grid-column:1;grid-row:1;justify-self:end}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order) {grid-column:1/-1}
  body:not(.screen-mode) .workspace-heading {padding-right:104px;min-height:44px;flex-wrap:wrap}
  body:not(.screen-mode) .workspace-heading .delivery-tabs .button {padding:4px 7px}
  body:not(.screen-mode) #phone-search {font-size:0;width:44px;min-width:44px;padding:0}
  body:not(.screen-mode) #phone-search::after {content:'⌕';font-size:25px}
  body:not(.screen-mode) .workspace-heading:has(#phone-search[aria-expanded="true"]) .toolbar {flex-basis:calc(100% + 104px);margin-right:-104px}
  body:not(.screen-mode) .workspace-heading .data-status {flex-basis:100%}

}
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body:not(.screen-mode) .delivery-tabs .stat-full {display:none}
  body:not(.screen-mode) .delivery-tabs .stat-short {display:inline}
  body:not(.screen-mode) .workspace-heading #phone-search {font-size:0}
  body:not(.screen-mode) .workspace-heading .delivery-tabs {gap:2px}

}

/* 手机更多：独立列表浮层，顶部操作按钮保持原位。 */
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body:not(.screen-mode) .top-right:has(#phone-more[aria-expanded="true"]) {
    display:flex;flex-direction:column;align-items:stretch;gap:0;
    width:176px;margin-top:52px;padding:6px;
    background:#14263a;border:1px solid #34516e;border-radius:12px;
    box-shadow:0 12px 32px #0008;
  }
  body:not(.screen-mode) .top-right:has(#phone-more[aria-expanded="true"]) #new-order {
    position:absolute;top:-52px;right:48px;
  }
  body:not(.screen-mode) #phone-more[aria-expanded="true"] {
    position:absolute;top:-52px;right:0;border-color:#749cc3;background:#223c55;color:#fff;
  }
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order):not(#help):not(#refresh) {
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    min-height:46px;width:100%;padding:0 12px;
    background:transparent;border:0;border-radius:6px;box-shadow:none;
    font-size:14px;font-weight:500;color:#e1ebf7;text-align:left;
  }
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button[hidden] {display:none!important}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order)::after {content:'›';color:#89a2ba;font-size:20px}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order):hover {background:#203a53}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #screen {font-size:0}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #screen span::after {font-size:14px}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #logout {border-top:1px solid #34516e;border-radius:0;margin-top:5px;color:#e5a5ae}

}
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #screen {font-size:0!important}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #screen span {flex:1}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #logout {border-top:1px solid #34516e!important;border-radius:0!important;color:#e5a5ae!important}
}
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #screen .screen-icon {display:none}
  body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #screen span:not(.screen-icon) {text-align:left}
}

/* 手机管理中心：减少标题与筛选占用的空间。 */
@media(max-width:700px) {
  #personnel-dialog .management-sidebar {padding:10px 14px 8px}
  #personnel-dialog .management-brand {margin:0 40px 8px 0}
  #personnel-dialog .management-brand small {display:none}
  #personnel-dialog .management-nav .button {min-height:40px;padding:7px}
  #personnel-dialog .management-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px}
  #personnel-dialog .management-heading h2 {font-size:18px;margin:0}
  #personnel-dialog .management-eyebrow,
  #personnel-dialog #management-subtitle {display:none}
  #personnel-dialog .management-heading-actions {padding-right:0}
  #personnel-dialog #open-personnel-create {margin:0;min-height:40px;padding:7px 12px;font-size:12px}
  #personnel-dialog .management-panel {padding:12px 14px}
  #personnel-dialog .personnel-filters {grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-bottom:10px}
  #personnel-dialog .personnel-filters label {gap:4px}
  #personnel-dialog .personnel-filters input,
  #personnel-dialog .personnel-filters select,
  #personnel-dialog .management-query {min-height:42px}
  #personnel-dialog .personnel-table tbody {gap:8px}
  #personnel-dialog .personnel-table tr {padding:12px;gap:8px}
  #personnel-dialog .personnel-table td.member-operations {padding-top:7px}
  #personnel-dialog .personnel-pager {padding-top:12px}
}
@media(max-width:700px) {
  #personnel-dialog #personnel-list {flex:none}
}
/* 管理中心打开时固定背景，滑动只作用于管理内容。 */
@media(max-width:700px) {
  html:has(#personnel-dialog[open], #order-editor[open]),
  body:has(#personnel-dialog[open], #order-editor[open]) {overflow:hidden;overscroll-behavior:none}
  #personnel-dialog,
  #personnel-dialog .management-main {overscroll-behavior:contain}
}
.personnel-status-menu {display:none}
@media(max-width:700px) {
  #personnel-dialog .personnel-status {position:relative;display:flex;flex-direction:column;gap:4px;min-width:0;font-size:10px}
  #personnel-dialog .personnel-status > select {display:none}
  #personnel-dialog .personnel-status-menu {display:block;position:relative}
  #personnel-dialog .personnel-status-menu summary {list-style:none;display:flex;align-items:center;justify-content:space-between;min-height:42px;padding:0 12px;border:1px solid #34516e;border-radius:8px;background:#0e1b2b;color:#d9e5f1;font-size:13px;cursor:pointer}
  #personnel-dialog .personnel-status-menu summary::-webkit-details-marker {display:none}
  #personnel-dialog .personnel-status-options {position:absolute;z-index:5;top:calc(100% + 4px);left:0;right:0;padding:5px;border:1px solid #34516e;border-radius:9px;background:#14263a;box-shadow:0 8px 20px #0008}
  #personnel-dialog .personnel-status-options button {display:flex;align-items:center;justify-content:space-between;width:100%;min-height:42px;padding:0 10px;border:0;border-radius:6px;background:transparent;color:#d9e5f1;font:inherit;font-size:13px;text-align:left}
  #personnel-dialog .personnel-status-options button[aria-pressed="true"] {background:#203e5b;color:#a9d4ff}
  #personnel-dialog .personnel-status-options button[aria-pressed="true"]::after {content:'✓'}
  #personnel-dialog .personnel-status-menu :focus-visible {outline:2px solid #8abfff;outline-offset:2px}
}

/* 手机订单卡片保持紧凑，缺失的计量信息不占空间。 */
@media(max-width:700px) {
  body:not(.screen-mode) .orders-grid > .order-card {gap:4px;padding:9px 12px}
  body:not(.screen-mode) .order-id {white-space:normal;font-size:16px;line-height:1.2}
  body:not(.screen-mode) .order-number {overflow-wrap:anywhere;word-break:break-word}
  body:not(.screen-mode) .order-card .order-meta.has-both-measurements {gap:5px;padding:4px 0}
  body:not(.screen-mode) .order-card .order-meta.has-both-measurements:has(.measurement-empty) {grid-template-columns:minmax(0,1.5fr) minmax(0,1.5fr) minmax(0,.9fr)}
  body:not(.screen-mode) .order-card .order-meta.has-both-measurements:has(.measurement-empty:nth-child(3)):has(.measurement-empty:nth-child(4)) {grid-template-columns:repeat(2,minmax(0,1fr))}
  body:not(.screen-mode) .order-meta .measurement-empty {display:none}
  body:not(.screen-mode) .order-card .countdown {padding:4px 7px;gap:4px}
}
/* 手机卡片交期保持单行，内容较长时在该区域横向查看。 */
@media(max-width:700px) {
  body:not(.screen-mode) .order-card .countdown {flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain}
  body:not(.screen-mode) .order-card .countdown .cd-value {flex:none;overflow:visible}
  body:not(.screen-mode) .order-card .countdown .cd-estimate {flex:none}
}
@media(max-width:700px) {
  body:not(.screen-mode) .order-card .countdown .cd-label {display:none}
}
/* 手机列表使用内容自然宽度，避免每个字段单独占一列。 */
@media(max-width:700px) {
  body:not(.screen-mode) .orders-grid > .order-card {
    display:flex;gap:4px;padding:8px 10px;
  }
  body:not(.screen-mode) .order-card .order-title-line {flex-direction:row;align-items:baseline;gap:6px}
  body:not(.screen-mode) .order-card .order-number {max-width:100%}
  body:not(.screen-mode) .order-card .order-card-notes {display:block;flex:0 1 auto;max-width:10em}
  body:not(.screen-mode) .order-card .order-meta.has-both-measurements {
    display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 9px;
    border:0;padding:0;
  }
  body:not(.screen-mode) .order-card .order-meta .m:not(.measurement-empty) {
    display:inline-flex;flex-direction:row;align-items:baseline;gap:3px;max-width:100%;
  }
  body:not(.screen-mode) .order-card .order-meta .m:nth-child(-n+2) .k {display:none}
  body:not(.screen-mode) .order-card .order-meta .v {
    font-size:13px;line-height:17px;white-space:normal;overflow-wrap:anywhere;
    max-height:34px;
  }
  body:not(.screen-mode) .order-card .order-meta .m:first-child .v {font-weight:700;color:#eff5ff}
  body:not(.screen-mode) .order-card .order-meta .m:not(:first-child) .v {color:#bed0e2}
  body:not(.screen-mode) .order-card .countdown {padding:3px 6px}
  body:not(.screen-mode) .order-card .progress-head {min-height:0}
  body:not(.screen-mode) .order-card .card-progress-area {min-height:20px}
}

/* 手机卡片下半部先展示进展，操作和时间集中在底部。 */
@media(max-width:700px) {
  body:not(.screen-mode) .order-card .order-head {order:0}
  body:not(.screen-mode) .order-card .order-meta {order:1}
  body:not(.screen-mode) .order-card .countdown {order:2}
  body:not(.screen-mode) .order-card .card-progress-area {display:contents}
  body:not(.screen-mode) .order-card .progress-text {
    order:3;margin:2px 0 0;font-size:14px;line-height:19px;max-height:38px;
  }
  body:not(.screen-mode) .order-card .progress-text::before {content:none!important}
  body:not(.screen-mode) .order-card .progress-head {
    order:4;display:flex;align-items:center;gap:6px;min-height:24px;
    padding-right:66px;border-top:1px solid #344b604d;padding-top:3px;
  }
  body:not(.screen-mode) .order-card .progress-actions {gap:4px}
  body:not(.screen-mode) .order-card .nudge-action {
    padding:2px 7px;min-height:24px;border:1px solid #426b90;border-radius:5px;
    background:#1b354d;font-size:10px;font-weight:500;color:#b9d9f3;
  }
  body:not(.screen-mode) .order-card .nudge-action:hover:not(:disabled) {
    background:#274b69;border-color:#78a9d1;color:#edf7ff;
  }
  body:not(.screen-mode) .order-card .nudge-action:active:not(:disabled) {
    background:#35658a;border-color:#9ac9ec;box-shadow:inset 0 1px 3px #071b2c66;
  }
  body:not(.screen-mode) .order-card .progress-time {font-size:9px;white-space:normal;text-align:right}
  body:not(.screen-mode) .order-card .progress-label {font-size:10px}
  body:not(.screen-mode) .order-card .card-progress-button {bottom:8px;right:10px;min-height:24px}
  body:not(.screen-mode) .order-card #quick-progress-form {order:3}
  body:not(.screen-mode) .order-card:has(#quick-progress-form) .progress-head {padding-right:0}
}

/* 手机订单表单使用紧凑的行式录入。 */
@media(max-width:700px) {
  #order-editor {
    width:calc(100vw - 24px);max-width:480px;max-height:calc(100dvh - 24px);
    padding:0;border:1px solid #38516b;border-radius:16px;
    background:#102033;box-shadow:0 20px 60px #0008;overscroll-behavior:contain;
  }
  #order-editor .dialog-heading {
    padding:14px 16px 12px;border-bottom:1px solid #30465d;
    background:linear-gradient(120deg,#1b3550,#102033);
  }
  #order-editor .dialog-heading h2 {font-size:19px;letter-spacing:.02em}
  #order-editor #close-editor {min-height:36px;min-width:36px;border:0;background:transparent;color:#9fb8d1}
  #order-editor #order-form > .editor-fields {
    display:flex;flex-direction:column;gap:0;margin:8px 14px 0;
  }
  #order-editor #order-form > .editor-fields label {
    display:grid;grid-template-columns:82px minmax(0,1fr);align-items:center;
    gap:8px;padding:5px 0;border-bottom:1px solid #2c435866;font-size:12px;
  }
  #order-editor .editor-fields input,
  #order-editor .editor-fields textarea {
    min-width:0;min-height:42px;padding:8px 10px;font-size:16px;
    border:1px solid #334f69;border-radius:7px;background:#0c1a2a;color:#e4edf7;
  }
  #order-editor[data-creating="true"] .editor-fields input:required {border-color:#426585}
  #order-editor .editor-fields input::placeholder,
  #order-editor .editor-fields textarea::placeholder {font-size:11px;color:#7890aa}
  #order-editor .editor-fields input:focus,
  #order-editor .editor-fields textarea:focus {outline:2px solid #71afe6;outline-offset:1px}
  #order-editor .detail-note {margin:8px 14px;font-size:10px;line-height:1.5;color:#7e98b3}
  #order-editor .editor-optional {margin:10px 14px;border:1px solid #304960;border-radius:9px;background:#14273a}
  #order-editor .editor-optional summary {padding:11px 12px;font-size:12px;color:#b9d1e8}
  #order-editor .editor-optional .editor-fields {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 10px;margin:0 12px 12px}
  #order-editor .editor-fields label {font-size:12px}
  #order-editor .unit-combo,
  #order-editor .unit-combo input,
  #order-editor .unit-combo select {height:42px;min-height:42px}
  #order-editor .editor-fields textarea {min-height:58px}
  #order-editor .editor-actions {
    padding:12px 14px;gap:8px;border-top:1px solid #30465d;background:#112236;
  }
  #order-editor .editor-actions .button {min-height:42px;padding:8px 18px;font-size:13px;border-radius:8px}
  #order-editor #save-order {background:#85bdf0;border-color:#85bdf0;color:#10253b}
  #order-editor #cancel-editor {background:transparent;border-color:#3b5269;color:#adc2d7}
}

/* 手机首页导航使用轻量文字操作。 */
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body:not(.screen-mode) .workspace-heading .delivery-tabs .button,
  body:not(.screen-mode) .workspace-heading #phone-search,
  body:not(.screen-mode) .top-right #new-order,
  body:not(.screen-mode) .top-right #phone-more {
    border:0;background:transparent;box-shadow:none;border-radius:0;color:#b5c8dc;
  }
  body:not(.screen-mode) .workspace-heading .delivery-tabs .button.selected {
    color:#91caff;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:9px;
  }
  body:not(.screen-mode) .workspace-heading #phone-search[aria-expanded="true"],
  body:not(.screen-mode) .top-right #phone-more[aria-expanded="true"],
  body:not(.screen-mode) .top-right #new-order {color:#91caff}
}

/* Safari 手机布局保持在可用宽度内。 */
@media(max-width:700px) {
  html {-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body:not(.screen-mode) .main,
  body:not(.screen-mode) .workspace-heading,
  body:not(.screen-mode) .orders-grid {min-width:0;max-width:100%;box-sizing:border-box}
  body:not(.screen-mode) .order-card .order-title-line {width:100%}
  body:not(.screen-mode) .order-card .order-meta .v {min-width:0}
}

.order-card.nudge-reading {
  display:flex;flex-direction:column;border-color:#7dd5ac;
  box-shadow:0 0 0 2px #7dd5ac33;animation:none;
}
.nudge-card-replies {order:3;padding:5px 7px;border-left:2px solid #7dd5ac;background:#15392d;color:#d0f3df;border-radius:4px}
.nudge-card-replies strong {font-size:11px;font-weight:500;color:#99d8b7}
.nudge-card-replies p {margin:3px 0;font-size:13px;line-height:1.5;overflow-wrap:anywhere}

/* 手机输入使用可读字号，避免 Safari 聚焦小字号输入框时自动放大。 */
@media(max-width:700px) {
  body:not(.screen-mode) input:not([type="checkbox"]):not([type="radio"]),
  body:not(.screen-mode) textarea,
  body:not(.screen-mode) select {font-size:16px!important}
  #order-editor .unit-combo select {color:transparent}
  #order-editor .unit-combo option {color:#fff}
  body:not(.screen-mode) .order-card .progress-actions {flex-shrink:1}
  body:not(.screen-mode) .order-card .progress-label {flex-shrink:1;overflow-wrap:anywhere}
  body:not(.screen-mode) .order-card .progress-time {min-width:0;flex:1}
}

/* 手机滚动时使用静态提醒，交期区域不建立独立滚动层。 */
@media(max-width:700px) {
  body:not(.screen-mode) .order-card,
  body:not(.screen-mode) .order-card .progress-time,
  body:not(.screen-mode) .order-card .nudge-action,
  body:not(.screen-mode) .order-card .progress-text {animation:none}
  body:not(.screen-mode) .order-card {transition:border-color .15s}
  body:not(.screen-mode) .order-card:hover {transform:none}
  body:not(.screen-mode) .order-card .countdown {overflow:hidden;touch-action:pan-y pinch-zoom}
  body:not(.screen-mode) .order-card .countdown .cd-value {flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
  body:not(.screen-mode) .order-card .countdown .cd-estimate {flex-shrink:1;min-width:0;max-width:58%;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:700px) {
  body:not(.screen-mode) .order-card .card-estimate-date {display:none}
}

/* 手机订单详情：紧凑资料区和清晰的生产记录层级。 */
@media(max-width:700px) {
  html:has(#details[open]),body:has(#details[open]) {overflow:hidden;overscroll-behavior:none}
  #details {
    width:calc(100vw - 20px);max-height:calc(100dvh - 24px);padding:0;
    border:1px solid #36516b;border-radius:14px;background:#102033;overscroll-behavior:contain;
  }
  #details .dialog-heading {
    position:sticky;top:0;z-index:3;display:block;padding:14px 14px 9px;
    border-bottom:1px solid #30475e;background:#14283c;
  }
  #details .eyebrow {display:none}
  #details #detail-title {padding-right:44px;font-size:18px;line-height:1.35}
  #details .detail-heading-actions {display:flex;gap:5px;margin-top:10px;align-items:center}
  #details #followup-control:not([hidden]),#details #lifecycle-control:not([hidden]) {display:contents}
  #details .detail-heading-actions .button {
    min-height:36px;padding:5px 6px;border:1px solid #385570;border-radius:6px;
    background:transparent;color:#b9d1e6;font-size:12px;
  }
  #details #delete-detail-order {font-size:0;color:#d8a0a9}
  #details #delete-detail-order::after {content:'删除';font-size:12px}
  #details #edit-detail-order {font-size:0}
  #details #edit-detail-order::after {content:'编辑';font-size:12px}
  #details #close-details {
    position:absolute;top:10px;right:10px;width:36px;min-height:36px;padding:0;
    border:0;font-size:0;color:#b9d1e6;
  }
  #details #close-details::after {content:'×';font-size:24px}
  #details #detail-content {padding:10px 12px 14px}
  #details #detail-content > .detail-note {margin-bottom:8px;font-size:10px;color:#829bb4}
  #details .detail-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:0;margin-bottom:12px;padding:3px 10px;background:#14283c;border:1px solid #2d465e;border-radius:9px}
  #details .detail-grid > div {padding:8px 6px;background:transparent;border:0;border-radius:0;border-bottom:1px solid #2a435766}
  #details .detail-grid dt {font-size:10px;color:#8fa9c2}
  #details .detail-grid dd {font-size:13px;line-height:1.45;margin-top:4px}
  #details .detail-grid > .detail-empty-step {display:none}
  #details .detail-grid > .detail-estimate-row {grid-column:1/-1;border-bottom:0}
  #details .detail-estimate-row > dt,#details .detail-estimate-row > dd {padding-right:84px}
  #details .detail-section {margin-top:10px;padding:10px;border:1px solid #2d465e;border-radius:9px;background:#14283c}
  #details .detail-section h3 {font-size:12px;color:#9bc9ee;letter-spacing:0}
  #details .detail-section p {font-size:13px;line-height:1.6}
  #details .detail-section .detail-note {font-size:10px;color:#829bb4}
  #details .detail-progress-section {border-color:#3b5c78;background:#162e43}
  #details #open-log,#details #open-estimate {
    min-height:32px;padding:4px 8px;border:1px solid #426784;border-radius:6px;
    background:#1d3d58;color:#b9dfff;font-size:11px;
  }
  #details .history-entry {padding:10px 0}
  #details .history-heading .button,#details .history-pager .button {font-size:11px;padding:5px 8px}
  #details .history-entry-heading {font-size:11px;gap:4px}
  #details .history-entry-body {gap:6px}
  #details .inline-actions {gap:6px}
  #details .inline-actions .button {min-height:36px;font-size:12px;padding:6px 9px}
}
@media(max-width:700px) {
  #details .button:focus-visible {outline:2px solid #87bdf0;outline-offset:2px}
  #details #save-log,#details #save-estimate {background:#85bdf0;border-color:#85bdf0;color:#10253b}
  #details .history-correct {border:0;background:transparent;color:#91bde5;font-size:11px;min-height:32px;padding:4px}
}
/* 手机催更提示原位轻闪，使用透明度反馈避免卡片尺寸变化。 */
@keyframes phone-nudge-hint {
  0%,100% {opacity:1}
  50% {opacity:.62}
}
@media(max-width:700px) {
  body:not(.screen-mode) .order-card.nudge-pending .progress-actions .progress-label {display:none}
  body:not(.screen-mode) .order-card.nudge-pending .progress-time {
    flex:0 1 auto;min-width:0;margin-left:0;padding:3px 6px;
    color:#e0f2ff;background:#24567c;font-size:10px;line-height:16px;
    text-align:left;white-space:nowrap;
    animation:phone-nudge-hint 1.6s ease-in-out infinite;
  }
}
@media(max-width:700px) and (prefers-reduced-motion:reduce) {
  body:not(.screen-mode) .order-card.nudge-pending .progress-time {animation:none}
}
@media(max-width:700px) {
  body:not(.screen-mode) .order-card.nudge-pending .progress-head {justify-content:flex-start}
  body:not(.screen-mode) .order-card.nudge-pending .progress-actions:not(:has(.nudge-action)) {display:none}
}

/* 已更新仅通过颜色提示，不增加正文或底栏的尺寸。 */
.order-card.nudge-updated:not(.nudge-pending) .progress-text {
  padding:0;border:0;border-radius:0;background:transparent;color:#b6f6d1;
}
.nudge-card-replies {
  position:absolute;inset:6px;z-index:2;overflow:auto;
  padding:9px 10px;border:1px solid #508e70;border-radius:7px;background:#15392d;
}
@media(max-width:700px) {
  body:not(.screen-mode) .order-card .progress-head.has-nudge-reply {
    padding:3px 66px 0 0;border:0;border-top:1px solid #344b604d;border-radius:0;background:transparent;
  }
  body:not(.screen-mode) .order-card .has-nudge-reply .progress-label {white-space:nowrap;font-weight:600}
  body:not(.screen-mode) .order-card .has-nudge-reply .progress-time {white-space:nowrap}
}
.nudge-card-replies .nudge-card-text {margin:5px 0;color:#f0fff6;font-size:15px;font-weight:600;line-height:1.5}
.nudge-card-replies .nudge-card-meta {margin:4px 0 0;color:#9bbdaf;font-size:10px;font-weight:400}

/* 手机端已完成订单：压缩筛选区和订单信息间距 */
@media (max-width: 700px) {
  .completed-section { margin-top: 16px; padding: 10px; }
  .completed-heading { gap: 8px; }
  .completed-heading h2 { font-size: 15px; }
  .completed-heading .completed-filters { display: grid; grid-template-columns: minmax(0, 1fr) 76px 68px; width: 100%; gap: 6px; }
  .completed-filters label:first-child { width: auto; }
  .completed-filters input, .completed-filters select, #completed-year { width: 100%; min-width: 0; box-sizing: border-box; }
  .completed-filters .button { min-height: 30px; padding: 4px 8px; }
  #completed-message { margin: 6px 0; }
  #completed-message:empty { display: none; }
  .completed-row { padding: 9px 10px; gap: 5px 10px; }
  .completed-field { gap: 1px; }
  .completed-value { line-height: 1.3; }
  .completed-measurements { gap: 6px; }
  .completed-state { display: flex; gap: 10px; grid-column: 1 / -1; }
  .completed-pager { gap: 6px; margin-top: 8px; }
}

/* 手机端完成订单两行摘要，完整资料可进入详情查看 */
@media (max-width: 700px) {
  .completed-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; grid-template-rows: auto auto; gap: 5px 8px; align-items: center; }
  .completed-row > .completed-field:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .completed-row > .completed-field:nth-child(2) { grid-column: 1; grid-row: 2; }
  .completed-row > .completed-field:nth-child(3) { grid-column: 2; grid-row: 2; }
  .completed-row > .completed-field:nth-child(6) { grid-column: 3; grid-row: 2; text-align: right; }
  .completed-row > .completed-measurements, .completed-row > .completed-field:nth-child(5) { display: none; }
  .completed-row > .completed-state { grid-column: 3; grid-row: 1; }
  .completed-row .completed-state > span:last-child, .completed-row .completed-label { display: none; }
  .completed-row .completed-value { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .completed-row .completed-number .completed-value { display: flex; overflow: hidden; }
  .completed-row .completed-number-note { overflow: hidden; text-overflow: ellipsis; }
  .completed-row > .completed-field:nth-child(6) .completed-value { font-size: 10px; color: var(--dim); }
}

@media (max-width: 700px) {
  .completed-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto; }
  .completed-row > .completed-field:nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
  .completed-row > .completed-field:nth-child(2) { grid-column: 1; grid-row: 2; }
  .completed-row > .completed-field:nth-child(3) { grid-column: 2; grid-row: 2; }
  .completed-row > .completed-field:nth-child(6) { grid-column: 4; grid-row: 1; }
  .completed-row > .completed-state { display: none; }
  .completed-row > .completed-measurements { display: flex; grid-column: 3 / 5; grid-row: 2; justify-content: flex-end; gap: 8px; min-width: 0; }
  .completed-measurements > .completed-field { display: flex; min-width: 0; gap: 2px; }
  .completed-measurements .completed-label { display: inline; white-space: nowrap; }
  .completed-measurements .completed-value { min-width: 0; }
}

@media (max-width: 700px) { .completed-measurements .completed-label { display: none; } }
.completed-mobile-summary { display: none; }
@media (max-width: 700px) {
  .completed-row > .completed-field:nth-child(2), .completed-row > .completed-field:nth-child(3), .completed-row > .completed-measurements { display: none; }
  .completed-mobile-summary { display: flex; grid-column: 1 / -1; grid-row: 2; gap: 8px; min-width: 0; }
  .completed-mobile-item { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
}
@media (max-width: 700px) {
  .completed-mobile-item:nth-child(3) { margin-left: auto; }
  .completed-mobile-item:nth-child(n+3) { flex: none; overflow: visible; text-overflow: clip; }
}

@media (max-width: 700px) {
  #details .detail-heading-actions .button { border: 0; }
}
@media (max-width: 700px) {
  #details #toggle-followup[data-display-mode="normal"],
  #details #toggle-followup[data-display-mode="urgent"] { font-size: 0; }
  #details #toggle-followup[data-display-mode="normal"]::before,
  #details #toggle-followup[data-display-mode="urgent"]::before { content: '正常'; font-size: 12px; color: #b9d1e6; }
  #details #toggle-followup[data-display-mode="normal"]::after,
  #details #toggle-followup[data-display-mode="urgent"]::after { content: ' / 优先'; font-size: 12px; color: #b9d1e6; }
  #details #toggle-followup[data-display-mode="normal"]::before { color: var(--done); }
  #details #toggle-followup[data-display-mode="urgent"]::after { color: var(--warn); }
}

/* 手机大屏：按方向重新排列，页面自然滚动，不锁定设备方向。 */
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body.screen-mode { height:auto; min-height:100dvh; overflow-x:hidden; overflow-y:auto; }
  .screen-mode .topbar { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; gap:8px; }
  .screen-mode .brand { min-width:0; }
  .screen-mode .brand-mark, .screen-mode .brand-copy p, .screen-mode .clock,
  .screen-mode .top-right > :not(#screen) { display:none !important; }
  .screen-mode .brand-copy h1 { font-size:16px; }
  .screen-mode .top-right { width:auto; }
  .screen-mode #screen { min-height:36px; padding:5px 10px; font-size:13px; }
  .screen-mode .screen-icon { display:none; }
  .screen-mode .stats-bar { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; padding:7px 10px; }
  .screen-mode .stat-pair { display:block; min-width:0; }
  .screen-mode .stat-card { width:100%; min-width:0; padding:6px 4px; text-align:center; }
  .screen-mode .stat-card .label { font-size:10px; }
  .screen-mode .stat-card .value strong { font-size:17px; }
  .screen-mode .stat-full { display:none; }
  .screen-mode .stat-short { display:inline; }
  .screen-mode .main { display:block; min-width:0; padding:4px 10px 18px; }
  .screen-mode .workspace-heading { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
  .screen-mode .section-title { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin:0; }
  .screen-mode .section-heading { display:none; }
  .screen-mode .section-tools { margin:0; }
  .screen-mode .layout-switch { display:none; }
  .screen-mode .screen-pager { gap:5px; }
  .screen-mode .screen-pager .button { min-height:34px; padding:4px 8px; }
  .screen-mode .delivery-tabs { gap:2px; margin:0; }
  .screen-mode .delivery-tabs .button { min-height:34px; padding:4px 7px; font-size:12px; }
  .screen-mode #screen-context { display:none; }
  .screen-mode[data-screen-layout] .orders-grid { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:none; grid-auto-rows:auto; gap:8px; }
  .screen-mode[data-screen-layout] .order-card { height:auto; min-height:0; padding:10px 12px; gap:5px; overflow:hidden; justify-content:flex-start; }
  .screen-mode[data-screen-layout] .order-id { font-size:16px; overflow-wrap:anywhere; }
  .screen-mode[data-screen-layout] .order-meta { grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; padding:4px 0; }
  .screen-mode[data-screen-layout] .order-meta .v { font-size:12px; overflow-wrap:anywhere; }
  .screen-mode[data-screen-layout] .countdown { min-height:0; padding:4px 7px; gap:5px; flex-wrap:wrap; }
  .screen-mode[data-screen-layout] .countdown .cd-label, .screen-mode[data-screen-layout] .countdown .cd-value, .screen-mode[data-screen-layout] .countdown .cd-estimate { font-size:11px; }
  .screen-mode[data-screen-layout] .progress-text { font-size:12px; }
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:550px) {
  .screen-mode[data-screen-layout] .orders-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:700px) and (orientation:landscape), (pointer:coarse) and (orientation:landscape) and (max-height:550px) {
  .screen-mode[data-screen-layout] .orders-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.phone-calendar { display:none; }
.phone-calendar-active > :not(.phone-calendar):not(#calendar-retry) { display:none!important; }
.delivery-calendar.phone-calendar-active { min-width:0; padding:0; border:0; background:transparent; }
.phone-calendar-active > .phone-calendar { display:block; }
.phone-calendar-tools { position:sticky; top:0; z-index:4; background:var(--bg-deep); display:flex; align-items:center; gap:10px; padding:10px 2px; }
.phone-calendar-tools > strong { margin-right:auto; font-size:16px; }
.phone-calendar-action, .phone-calendar-all, .phone-calendar-more-months { min-height:36px; padding:5px 8px; border:0; background:transparent; color:#91caff; font:inherit; font-size:12px; cursor:pointer; }
.phone-calendar-completed { display:flex; align-items:center; gap:4px; font-size:12px; color:var(--dim); }
.phone-calendar-completed input { accent-color:#91caff; width:16px; height:16px; }
.phone-calendar-month { padding:12px 8px; margin:0 0 14px; border:1px solid var(--line); border-radius:12px; background:var(--bg-card); scroll-margin-top:56px; }
.phone-calendar-month h3 { margin:0 0 12px; padding:0 6px; font-size:17px; }
.phone-calendar-weekdays, .phone-calendar-week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.phone-calendar-weekdays span { text-align:center; font-size:11px; padding:3px 0 8px; color:var(--dim); }
.phone-calendar-weekdays span:nth-last-child(-n+2) { color:#82a2bf; }
.phone-calendar-date { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-width:0; min-height:49px; padding:2px 0; border:0; border-radius:9px; background:transparent; color:var(--text); font:inherit; cursor:pointer; }
.phone-calendar-number { display:grid; place-items:center; width:28px; height:28px; border:1px solid transparent; border-radius:50%; font-size:15px; }
.phone-calendar-date.is-today .phone-calendar-number { border-color:#91caff; color:#91caff; }
.phone-calendar-date.is-selected { background:#24415c; }
.phone-calendar-date.is-selected .phone-calendar-number { color:#fff; }
.phone-calendar-count { min-height:12px; font-size:9px; line-height:12px; color:#91caff; }
.phone-calendar-day { margin:5px 0 8px; padding:8px; border-radius:9px; border:1px solid #3b5870; background:#11283c; }
.phone-calendar-day-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; }
.phone-calendar-order { display:block; width:100%; min-width:0; padding:9px 0; border:0; border-top:1px solid #2c4357; background:transparent; color:var(--text); font:inherit; text-align:left; cursor:pointer; }
.phone-calendar-order-top { display:flex; align-items:baseline; justify-content:space-between; gap:8px; font-size:13px; }
.phone-calendar-order-top strong { min-width:0; overflow-wrap:anywhere; }
.phone-calendar-order-top > span { flex:none; font-size:10px; color:#9cbbd2; }
.phone-calendar-order-info, .phone-calendar-order-progress { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; margin-top:4px; color:#adc1d3; font-size:11px; }
.phone-calendar-order-progress { color:#d8e8f3; }
.phone-calendar-message { margin:8px 0; color:var(--dim); font-size:12px; }
.phone-calendar-more-months, .phone-calendar-all { width:100%; text-align:center; }
.phone-calendar button:focus-visible { outline:2px solid #91caff; outline-offset:1px; }
.phone-calendar-date.has-urgent .phone-calendar-count,
.phone-calendar-urgent { color:#ffad54; }

/* 手机纵向时间轴：日期在左、交期订单在右；专注查看沿用同一条轴。 */
.phone-timeline { display:none; }
.phone-timeline-active > :not(.phone-timeline) { display:none!important; }
.delivery-calendar.phone-timeline-active { display:block; min-width:0; overflow:visible; padding:0; border:0; background:transparent; }
.phone-timeline-active > .phone-timeline { display:block; }
.phone-timeline-tools { position:sticky; top:0; z-index:4; display:flex; align-items:center; gap:8px; padding:10px 0; background:var(--bg-deep); }
.phone-timeline-title { display:grid; gap:3px; margin-right:auto; }
.phone-timeline-title strong { font-size:16px; }
.phone-timeline-title small { font-size:10px; color:var(--dim); }
.phone-timeline-action,.phone-timeline-expand { min-height:36px; padding:4px 8px; border:0; border-radius:6px; background:transparent; color:#91caff; font:inherit; font-size:11px; cursor:pointer; }
.phone-timeline-range { width:auto; min-width:0; min-height:36px; padding:4px; border:1px solid var(--line); border-radius:6px; background:var(--bg-panel); color:var(--text); font:inherit; font-size:12px; }
.phone-timeline-navigation { display:flex; align-items:center; justify-content:space-between; gap:4px; padding-bottom:10px; }
.phone-timeline-navigation > span { font-size:10px; color:var(--dim); }
.phone-timeline-day { display:grid; grid-template-columns:52px minmax(0,1fr); gap:18px; position:relative; padding:0 0 14px; }
.phone-timeline-day::before { content:''; position:absolute; top:12px; bottom:-12px; left:60px; width:1px; background:#35516b; }
.phone-timeline-day::after { content:''; position:absolute; top:12px; left:57px; width:7px; height:7px; border:2px solid var(--bg-deep); border-radius:50%; background:#6c94b6; }
.phone-timeline-day.is-today::after { background:#8dceff; box-shadow:0 0 0 3px #8dceff30; }
.phone-timeline-day.has-priority::after { background:#ffad54; }
.phone-timeline-date { display:flex; flex-direction:column; align-items:flex-end; gap:3px; padding-top:3px; }
.phone-timeline-date small { font-size:9px; color:#68849d; }
.phone-timeline-date strong { font-size:17px; font-weight:650; white-space:nowrap; }
.phone-timeline-date > span { font-size:10px; color:var(--dim); }
.phone-timeline-day.is-today .phone-timeline-date { color:#91caff; }
.phone-timeline-day.is-today .phone-timeline-date > span { color:#91caff; }
.phone-timeline-body { min-width:0; padding:8px 10px 0; border:1px solid #2b425b; border-radius:10px; background:var(--bg-card); }
.phone-timeline-day.is-today .phone-timeline-body { border-color:#5688b1; }
.phone-timeline-day-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; font-size:10px; color:#99b2c9; }
.phone-timeline-day-heading .late { color:#ef929c; }
.phone-timeline-total { flex:none; }
.phone-timeline-day.has-priority .phone-timeline-total { color:#ffad54; }
.phone-timeline-order { display:block; width:100%; min-width:0; padding:8px 0; border:0; border-top:1px solid #2b425b; background:transparent; color:var(--text); font:inherit; text-align:left; cursor:pointer; }
.phone-timeline-order-heading { display:flex; align-items:baseline; gap:6px; min-width:0; font-size:12px; }
.phone-timeline-order-heading strong { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.phone-timeline-product { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#bdcfe0; font-size:11px; }
.phone-timeline-priority { flex:none; font-size:10px; color:#ffad54; }
.phone-timeline-paused { flex:none; font-size:10px; color:#a0b7d6; }
.phone-timeline-spec { display:block; margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; color:#8ea8c0; }
.phone-timeline-expand { width:100%; padding:4px; border-top:1px solid #2b425b; }
.phone-timeline-message { margin:8px 0 12px; font-size:11px; color:var(--dim); }
.phone-timeline-day-pager { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:3px; font-size:10px; color:var(--dim); }
.phone-timeline button:focus-visible,.phone-timeline select:focus-visible { outline:2px solid #91caff; outline-offset:1px; }
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  body.screen-mode.timeline-screen { height:auto; min-height:100dvh; overflow-y:auto; }
  .screen-mode.timeline-screen .delivery-calendar.phone-timeline-active { display:block; overflow:visible; }
}
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  .screen-mode.timeline-screen .topbar { position:sticky; top:0; z-index:5; background:var(--bg-deep); }
  .screen-mode.timeline-screen .phone-timeline-tools { top:var(--phone-timeline-header,0px); }
}
.phone-timeline-overdue { display:block; width:100%; padding:8px; margin-bottom:12px; border:1px solid #6a414a; border-radius:7px; background:#362531; color:#e4a0aa; font:inherit; font-size:11px; cursor:pointer; }
/* 日历和时间轴使用独立范围，看板筛选仅在看板中呈现。 */
.calendar-view #board-query { display:none; }

/* 无单日期仅占左轴一条细刻度，有单日期的卡片保持原有布局。 */
.phone-timeline-empty-date { position:relative; display:flex; align-items:center; height:20px; box-sizing:border-box; padding-right:0; color:#5d7891; font-size:10px; line-height:1; }
.phone-timeline-empty-date > span { width:52px; text-align:right; white-space:nowrap; }
.phone-timeline-empty-date::before { content:''; position:absolute; top:0; bottom:0; left:60px; width:1px; background:#2b4359; }
.phone-timeline-empty-date::after { content:''; position:absolute; top:10px; left:58px; width:5px; height:1px; background:#526d85; }
.phone-timeline-gap { position:relative; }
.phone-timeline-gap-label { position:absolute; left:80px; right:0; top:50%; transform:translateY(-50%); margin:0; color:#638099; font-size:10px; line-height:16px; }
.phone-calendar-month.is-current-month { border-color:#477397; box-shadow:inset 0 2px 0 #477397; }
.phone-calendar-month-heading { display:flex; align-items:center; gap:8px; }
.phone-calendar-month.is-current-month h3 { color:#c2e2ff; }
.phone-calendar-current-badge { padding:2px 6px; border-radius:5px; background:#203d55; color:#9dcef5; font-size:10px; font-weight:500; line-height:16px; }
.phone-timeline-entry { min-width:0; }
.phone-timeline-entry.is-expanded > .phone-timeline-order { color:#bdddff; }
.phone-timeline-inline { min-width:0; padding-bottom:8px; }
#delivery-calendar .timeline-inline-card { display:flex; flex-direction:column; min-width:0; padding:10px; gap:8px; border-color:#436787; cursor:default; }
#delivery-calendar .timeline-inline-card .order-title-line { display:block; }
#delivery-calendar .timeline-inline-card .order-card-notes { display:none; }
#delivery-calendar .timeline-inline-card .order-number { white-space:normal; overflow-wrap:anywhere; }
#delivery-calendar .timeline-inline-card .order-meta.has-both-measurements { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
#delivery-calendar .timeline-inline-card .order-meta .k { display:block; font-size:10px; color:var(--dim); }
#delivery-calendar .timeline-inline-card .order-meta .v { display:block; font-size:12px; line-height:1.5; white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
#delivery-calendar .timeline-inline-card .progress-text { display:block; max-height:none; -webkit-line-clamp:unset; white-space:pre-wrap; overflow:visible; overflow-wrap:anywhere; }
#delivery-calendar .timeline-inline-card .progress-head { padding-right:0; flex-wrap:wrap; }
#delivery-calendar .timeline-inline-card .countdown { flex-wrap:wrap; overflow:visible; }
#delivery-calendar .timeline-inline-card .countdown .cd-value,#delivery-calendar .timeline-inline-card .countdown .cd-estimate { max-width:none; white-space:normal; overflow:visible; flex-basis:100%; }
#delivery-calendar .timeline-inline-card .timeline-inline-info { order:5; display:grid; gap:7px; margin:0; padding-top:8px; border-top:1px solid #2d4861; font-size:11px; }
.timeline-inline-info > div { display:grid; grid-template-columns:56px minmax(0,1fr); gap:8px; }
.timeline-inline-info dt { color:var(--dim); }
.timeline-inline-info dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.5; }
.timeline-inline-note { order:6; font-size:11px; line-height:1.6; }
.timeline-inline-note p { margin:4px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.timeline-reply-read { order:7; min-height:36px; }

#delivery-calendar .timeline-inline-card > .order-head { display:none; }
#delivery-calendar .timeline-inline-card .order-meta .m { display:block; }
#delivery-calendar .timeline-inline-card .order-meta .k { width:auto; overflow:visible; text-overflow:clip; white-space:normal; margin-bottom:3px; }

/* 原地展开融入订单本身，标题及交期信息只出现一次。 */
.phone-timeline-entry.is-expanded > .phone-timeline-order > .phone-timeline-spec { display:none; }
.phone-timeline-entry.is-expanded > .phone-timeline-order .phone-timeline-order-heading { flex-wrap:wrap; }
.phone-timeline-entry.is-expanded > .phone-timeline-order .phone-timeline-order-heading strong { flex:1; white-space:normal; overflow-wrap:anywhere; }
.phone-timeline-entry.is-expanded > .phone-timeline-order .phone-timeline-product { order:1; flex-basis:100%; white-space:normal; overflow:visible; line-height:1.5; }
#delivery-calendar .timeline-inline-card { padding:0 0 8px; border:0; border-radius:0; background:transparent; box-shadow:none; gap:8px; }
#delivery-calendar .timeline-inline-card:hover { transform:none; box-shadow:none; }
#delivery-calendar .timeline-inline-card .order-meta.has-both-measurements { padding:0; border:0; }
#delivery-calendar .timeline-inline-card .order-meta > .m:first-child { display:none; }
#delivery-calendar .timeline-inline-card .order-meta > .m:nth-child(2) { grid-column:1 / -1; }
#delivery-calendar .timeline-inline-card .progress-head { order:2; margin-top:2px; padding-top:8px; border-top:1px solid #2b425b; }
#delivery-calendar .timeline-inline-card .progress-text { order:3; margin:0; font-size:12px; line-height:1.6; }
#delivery-calendar .timeline-inline-card .timeline-inline-info { grid-template-columns:repeat(2,minmax(0,1fr)); padding-top:8px; gap:9px 10px; }
.timeline-inline-info > div { display:block; min-width:0; }
.timeline-inline-info dt { margin-bottom:3px; font-size:10px; }
.timeline-inline-info .timeline-inline-notes { grid-column:1 / -1; }

/* 订单摘要的展开提示为装饰箭头，点击区域仍是原订单标题。 */
.phone-timeline-entry > .phone-timeline-order { position:relative; padding-right:16px; }
.phone-timeline-entry > .phone-timeline-order::after { content:''; position:absolute; right:2px; bottom:12px; width:6px; height:6px; border-right:1.5px solid #87a4bd; border-bottom:1.5px solid #87a4bd; transform:rotate(45deg); pointer-events:none; }
.phone-timeline-entry.is-expanded > .phone-timeline-order::after { transform:rotate(225deg); }

/* 复用看板交期倒计时，窄展开区分两行呈现，不重复列日期资料。 */
#delivery-calendar .timeline-inline-card .countdown { order:1; display:grid; grid-template-columns:minmax(0,1fr); gap:4px; padding:6px 8px; }
#delivery-calendar .timeline-inline-card .countdown .cd-label { display:none; }
#delivery-calendar .timeline-inline-card .countdown .cd-value,
#delivery-calendar .timeline-inline-card .countdown .cd-estimate { min-width:0; font-size:11px; line-height:1.5; overflow-wrap:anywhere; }
#delivery-calendar .timeline-inline-card .countdown .card-days-number { font-size:14px; }

/* 时间轴的展开区没有独立卡框：催更状态也只保留按钮和文字反馈。 */
#delivery-calendar .timeline-inline-card { outline:0; outline-offset:0; animation:none; box-shadow:none; }

/* 手机看板催更光晕单独呼吸，不改变卡片尺寸或重画整卡阴影。 */
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  .orders-grid > .order-card.nudge-pending { --nudge-glow:104,184,255; }
  .orders-grid > .order-card.nudge-updated:not(.nudge-pending) { --nudge-glow:105,224,170; }
  .orders-grid > .order-card:is(.nudge-pending,.nudge-updated)::after {
    content:''; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
    border:1px solid rgba(var(--nudge-glow),.8);
    box-shadow:inset 0 0 20px rgba(var(--nudge-glow),.32),0 0 16px rgba(var(--nudge-glow),.55);
    opacity:.3; animation:phone-nudge-glow 1.8s ease-in-out infinite;
  }
}
@keyframes phone-nudge-glow {
  0%,100% { opacity:.25; }
  50% { opacity:1; }
}
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  #details #toggle-completed { color:var(--done); }
  #details .detail-progress-section > h3 { min-height:0; padding-right:0; }
  #details #open-log { position:static; display:block; margin:8px 0 0 auto; }
  #details #refresh-history { display:none; }
  #details #history-control > summary { list-style:none; cursor:pointer; min-height:32px; flex-wrap:nowrap; }
  #details #history-control > summary::-webkit-details-marker { display:none; }
  #details #history-control > summary::after {
    content:''; flex:none; width:6px; height:6px; margin-right:3px;
    border-right:1.5px solid #87a4bd; border-bottom:1.5px solid #87a4bd;
    transform:rotate(45deg);
  }
  #details #history-control[open] > summary::after { transform:rotate(225deg); }
  #details .detail-grid > .detail-notes-row { grid-column:1 / -1; border-bottom:0; }
  #details .detail-notes-row dd { white-space:pre-wrap; overflow-wrap:anywhere; }
  #details #estimate-shortcuts {
    display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:2px;
  }
  #details #estimate-shortcuts .button {
    min-width:0; min-height:36px; padding:6px 2px; border:0; background:transparent;
    font-size:12px; white-space:nowrap;
    color:#9eb8d1; box-shadow:none; -webkit-tap-highlight-color:transparent;
    transition:color .12s,background-color .12s;
  }
  #details #estimate-shortcuts .button[aria-pressed="true"] {
    color:#a8d8ff; text-decoration:underline; text-underline-offset:5px;
    text-decoration-thickness:2px;
  }
  #details #estimate-shortcuts .button:active:not(:disabled) {
    color:#e5f4ff; background:#71afe61a;
  }
  #details #close-details,
  #details #close-details:hover,
  #details #close-details:focus,
  #details #close-details:focus-visible {
    border:0; outline:0; box-shadow:none; background:transparent;
    -webkit-tap-highlight-color:transparent;
  }
}
@media (prefers-reduced-motion:reduce) {
  .orders-grid > .order-card:is(.nudge-pending,.nudge-updated)::after { animation:none; opacity:.6; }
}

/* 新增人员：手机紧凑表单，保留原账号创建与授权流程。 */
.personnel-create-subtitle { margin:5px 0 0; color:var(--dim); font-size:12px; line-height:1.5; }
.personnel-field-hint { color:var(--dim); font-size:11px; font-weight:400; line-height:1.5; }
.account-history-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; color:#8fa9c2; font-size:12px; }
.account-history-list { list-style:none; margin:12px 0; padding:0; }
.account-history-entry { padding:16px 0; border-bottom:1px solid #2b4259; overflow-wrap:anywhere; }
.account-history-entry-heading { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.account-history-entry-heading strong { color:#a9d5fa; font-size:13px; }
.account-history-entry-heading time { flex:none; color:#819bb5; font-size:11px; }
.account-history-target { margin:8px 0 5px; color:#e0ecf7; font-size:14px; }
.account-history-actor,.account-history-change { margin:4px 0; color:#96aec5; font-size:12px; line-height:1.6; }
#account-history-message { color:#9bb3ca; font-size:12px; line-height:1.6; }
#account-history-message:empty { display:none; }
/* 手机普通网页及主屏幕应用均不提供业务大屏入口。 */
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  #screen { display:none!important; }
}
@media(max-width:700px) {
  #management-history-panel .personnel-pager { flex-wrap:wrap; gap:8px; }
  #management-history-panel .personnel-pager .button,#account-history-refresh { min-height:36px; padding:6px 9px; font-size:11px; }
  .account-history-entry { padding:13px 0; }
  .account-history-entry-heading { flex-wrap:wrap; gap:5px; }
  .account-history-entry-heading time { font-size:10px; }
  .account-history-target { font-size:13px; }
}
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  #personnel-create {
    width:calc(100vw - 24px); max-width:440px; max-height:calc(100dvh - 24px);
    padding:0; border:1px solid #36516c; border-radius:16px; background:#122337;
    overflow-y:auto; overscroll-behavior:contain; color:#e1edf8; color-scheme:dark;
  }
  #personnel-create .dialog-heading { padding:17px 18px 13px; border-bottom:1px solid #2b4259; }
  #personnel-create .dialog-heading h2 { margin:0; font-size:19px; line-height:1.4; letter-spacing:0; }
  #personnel-create .personnel-create-subtitle { margin:5px 0 0; font-size:11px; line-height:1.5; color:#8fa9c2; }
  #personnel-create .personnel-create-form { padding:16px 18px; gap:13px; }
  #personnel-create .personnel-create-form > label { gap:6px; font-size:12px; color:#b9cee2; }
  #personnel-create input:not([type=checkbox]),#personnel-create select {
    min-width:0; min-height:44px; padding:10px 12px; border:1px solid #344f69;
    border-radius:8px; background:#0c1b2b; color:#e1edf8; font-size:16px; line-height:1.4;
  }
  #personnel-create input::placeholder { color:#6f8aa3; font-size:12px; }
  #personnel-create input:focus,#personnel-create select:focus { outline:0; border-color:#83bdf0; box-shadow:0 0 0 2px #83bdf01a; }
  #personnel-create .personnel-field-hint { font-size:10px; line-height:1.5; color:#7f99b2; font-weight:400; }
  #personnel-create select option { background:#122337; color:#e1edf8; }
  #personnel-create .personnel-admin-confirm { align-items:flex-start; padding:10px; border-radius:8px; background:#e6ae5910; font-size:11px; }
  #personnel-create .personnel-admin-confirm input { flex:none; margin:3px 0 0; width:16px; height:16px; accent-color:#83bdf0; }
  #personnel-create .hint { font-size:10px; line-height:1.6; color:#829cb5; opacity:1; }
  #personnel-create-message:empty { display:none; }
  #personnel-create-message { font-size:12px; }
  #personnel-create .personnel-pager { display:grid; grid-template-columns:1fr 1.6fr; gap:10px; margin:0; padding-top:12px; border-top:1px solid #2b4259; }
  #personnel-create .personnel-pager .button { min-height:42px; padding:9px 12px; border-radius:8px; font-size:13px; }
  #personnel-create-cancel { background:transparent; border-color:#3a556e; color:#a9bfd4; }
  #personnel-create-submit { background:#86c0ff; border-color:#86c0ff; color:#10243a; font-weight:700; }
  body:has(#personnel-create[open]) { overflow:hidden; overscroll-behavior:none; }
}


/* 手机外观：独立于业务状态，桌面继续沿用原配色。 */
#phone-appearance,.appearance-login { display:none; }
.phone-appearance-dialog { width:min(380px,calc(100vw - 28px)); padding:20px; }
.appearance-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.appearance-heading h2 { margin:0; font-size:19px; }
#close-appearance { width:36px; height:36px; border:0; border-radius:50%; background:transparent; color:var(--dim); font-size:18px; }
.appearance-options { display:grid; gap:10px; }
.appearance-options > button { display:flex; align-items:center; gap:14px; width:100%; min-height:76px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--bg-card); color:var(--text); text-align:left; }
.appearance-options > button[aria-pressed="true"] { border-color:var(--accent-3); background:color-mix(in srgb,var(--accent-3) 9%,var(--bg-card)); }
.appearance-options strong { display:block; font-size:14px; font-weight:600; }
.appearance-options small { display:block; margin-top:4px; color:var(--dim); font-size:11px; }
.appearance-check { flex:none; width:18px; height:18px; margin-left:auto; border:1.5px solid var(--line); border-radius:50%; }
[aria-pressed="true"] > .appearance-check { border:5px solid var(--accent-3); background:var(--bg-card); }
.appearance-preview { position:relative; flex:none; width:37px; height:46px; border:1px solid #45607a; border-radius:8px; background:#0e1f33; overflow:hidden; }
.appearance-preview::before { content:''; position:absolute; inset:13px 5px 6px; border-radius:3px; background:#29445f; }
.appearance-preview::after { content:''; position:absolute; top:7px; left:6px; width:14px; height:2px; border-radius:2px; background:#6da9e6; }
.appearance-preview-light { background:#f3f6fa; border-color:#bdcad9; }
.appearance-preview-light::before { background:#fff; box-shadow:0 0 0 1px #d8e1ec; }
.appearance-preview-system { background:linear-gradient(90deg,#f3f6fa 50%,#0e1f33 50%); }
.appearance-preview-system::before { background:linear-gradient(90deg,#fff 50%,#29445f 50%); }
@media (max-width:700px), (pointer:coarse) and (max-height:550px) {
  #phone-appearance { display:block; }
  .auth-card .appearance-login { display:block; margin:12px auto 0; padding:4px 10px; border:0; background:transparent; color:var(--dim); font-size:12px; }
  #calendar-theme { display:none; }
  .phone-appearance-dialog { margin:auto auto max(18px,env(safe-area-inset-bottom)); border-radius:20px; box-shadow:0 16px 60px #08132030; }
  :root[data-phone-theme="dark"] { color-scheme:dark; }
  :root[data-phone-theme] :is(.delivery-calendar,.delivery-day-dialog) {
    --cal-bg:var(--bg-panel); --cal-text:var(--text); --cal-dim:var(--dim); --cal-line:var(--line);
    --cal-tile:var(--bg-card); --cal-late:var(--danger); --cal-soon:var(--warn); --cal-normal:var(--accent-3); color-scheme:inherit;
  }
}

/* 浅色以蓝灰文字、白卡和轻分隔线为主；状态色继续表达原业务含义。 */
:root[data-phone-theme="light"] {
  color-scheme:light;
  --bg-deep:#f3f6fa; --bg-panel:#fff; --bg-card:#fff; --line:#dce4ee;
  --text:#20324a; --dim:#60738b; --muted:#66768b;
  --accent:#835e0a; --accent-2:#08795e; --accent-3:#2169b5;
  --warn:#ac510e; --danger:#bf314f; --done:#08795e; --purple:#7053ad;
  --phone-soft:#f7f9fc; --phone-blue:#eaf2fc; --phone-green:#eaf6f0; --phone-orange:#fff3e6; --phone-red:#fff0f2;
}
:root[data-phone-theme="light"] body { background:var(--bg-deep); }
:root[data-phone-theme="light"] .topbar { background:var(--bg-deep); border-color:var(--line); }
:root[data-phone-theme="light"] :is(dialog,#personnel-dialog,#personnel-create,#nudge-notice,#order-editor,#details) { background:var(--bg-panel); color:var(--text); border-color:var(--line); box-shadow:0 18px 60px #20324a26; }
:root[data-phone-theme="light"] dialog::backdrop { background:#20324a55; backdrop-filter:blur(3px); }
:root[data-phone-theme="light"] :is(.dialog-heading,.editor-heading,#details .dialog-heading,#order-editor .editor-actions) { background:var(--phone-soft); border-color:var(--line); color:var(--text); }
:root[data-phone-theme="light"] .dialog-heading :is(h2,h3) { color:var(--text); }
:root[data-phone-theme="light"] :is(.button,.nudge-action) { color:var(--accent-3); border-color:#bacde1; background:transparent; }
:root[data-phone-theme="light"] .button.primary { color:#fff; background:var(--accent-3); border-color:var(--accent-3); }
:root[data-phone-theme="light"] :is(.auth-card,.inline-form,#order-editor,#personnel-dialog,#personnel-create,.personnel-create-form) :is(input:not([type="checkbox"]),textarea,select),
:root[data-phone-theme="light"] .toolbar :is(input,select) { color:var(--text); background:var(--phone-soft); border-color:#c7d5e4; color-scheme:light; }
:root[data-phone-theme="light"] :is(input,textarea)::placeholder { color:#77869a; }
:root[data-phone-theme="light"] :is(input,textarea,select) { accent-color:var(--accent-3); }
:root[data-phone-theme="light"] :is(.inline-form,.detail-section) :is(input,textarea,select) { color-scheme:light; }
:root[data-phone-theme="light"] :is(select option,#order-editor .unit-combo option,#personnel-create select option) { color:var(--text); background:#fff; }
:root[data-phone-theme="light"] #order-editor .unit-combo select { color:transparent; }
:root[data-phone-theme="light"] #order-editor .unit-combo::after { border-color:var(--dim); }
:root[data-phone-theme="light"] :is(.inline-message,.detail-section .inline-message,#lifecycle-message,#personnel-create-message,#personnel-reset-message,#personnel-role-message,#personnel-disable-message,#own-password-message) { color:var(--warn); }
:root[data-phone-theme="light"] :is(.auth-card,.management-password-card .personnel-create-form) label { color:var(--text); }
:root[data-phone-theme="light"] .auth-card { background:var(--bg-panel); border-color:var(--line); box-shadow:0 8px 30px #20324a0c; }
:root[data-phone-theme="light"] .auth-card h1 { color:var(--text); }
:root[data-phone-theme="light"] .auth-card :is(p,label small) { color:var(--dim); }
:root[data-phone-theme="light"] .top-right:has(#phone-more[aria-expanded="true"]) { background:#fff; border-color:var(--line); box-shadow:0 12px 35px #20324a24; }
:root[data-phone-theme="light"] body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order):not(#help):not(#refresh) { color:var(--text); background:transparent; }
:root[data-phone-theme="light"] body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order):hover { background:var(--phone-soft); }
:root[data-phone-theme="light"] body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ button:not(#new-order)::after { color:var(--dim); }
:root[data-phone-theme="light"] body:not(.screen-mode) #phone-more[aria-expanded="true"] ~ #logout { color:var(--danger)!important; border-top-color:var(--line)!important; }
:root[data-phone-theme="light"] body:not(.screen-mode) :is(.workspace-heading .delivery-tabs .button,.workspace-heading #phone-search,.top-right #new-order,.top-right #phone-more) { color:var(--dim); background:transparent; }
:root[data-phone-theme="light"] body:not(.screen-mode) :is(.workspace-heading .delivery-tabs .button.selected,.top-right #new-order,.top-right #phone-more[aria-expanded="true"]) { color:var(--accent-3); }
:root[data-phone-theme="light"] .stat-card :is(.value strong,.label) { color:var(--text); }
:root[data-phone-theme="light"] .stat-card.selected { background:var(--phone-blue); border-color:#aac8e8; box-shadow:none; }
:root[data-phone-theme="light"] .stat-card.selected .label { color:var(--accent-3); }
:root[data-phone-theme="light"] .stat-card .value.danger strong { color:var(--danger); }
:root[data-phone-theme="light"] .stat-card .value.urgent strong { color:var(--warn); }
:root[data-phone-theme="light"] .stat-card .value.frozen strong { color:#386c87; }
:root[data-phone-theme="light"] .stat-card:hover { background:var(--phone-soft); }
:root[data-phone-theme="light"] .order-card { box-shadow:0 2px 7px #20324a05; }
:root[data-phone-theme="light"] .order-card:hover { box-shadow:0 3px 12px #20324a10; border-color:#b6cbe0; }
:root[data-phone-theme="light"] .order-card :is(.order-id,.order-meta .v) { color:var(--text); }
:root[data-phone-theme="light"] .order-card :is(.order-meta,.progress-head) { border-color:var(--line); }
:root[data-phone-theme="light"] .order-card :is(.progress-label,.progress-time,.order-card-notes) { color:var(--dim); }
:root[data-phone-theme="light"] :is(.progress-text,.cp-pass) { color:var(--text); }
:root[data-phone-theme="light"] .progress-text.no-progress { color:var(--dim); }
:root[data-phone-theme="light"] .order-card.is-paused { border-color:#adc9d8; }
:root[data-phone-theme="light"] :is(.paused-badge,.frozen) { color:#386c87; }
:root[data-phone-theme="light"] .order-card .cd-estimate { color:#425b71; }
:root[data-phone-theme="light"] .countdown.normal { background:var(--phone-green); border-color:#c4e4d7; }
:root[data-phone-theme="light"] .countdown.warn { background:var(--phone-orange); border-color:#ecd4ad; color:var(--warn); }
:root[data-phone-theme="light"] .countdown.warn .cd-value { color:var(--warn); }
:root[data-phone-theme="light"] .countdown.danger { background:var(--phone-red); border-color:#edc9d1; }
:root[data-phone-theme="light"] .nudge-action { background:var(--phone-blue); color:var(--accent-3); border-color:#b4cee9; }
:root[data-phone-theme="light"] .nudge-action:hover:not(:disabled) { background:#dbeafb; color:#155b9f; }
:root[data-phone-theme="light"] .order-card.nudge-pending .progress-time { color:#18598f; background:#e2effc; }
:root[data-phone-theme="light"] .order-card.nudge-updated:not(.nudge-pending) .progress-text { color:var(--done); background:transparent; }
:root[data-phone-theme="light"] .order-card.progress-feedback .progress-text { color:var(--done); background:var(--phone-green); }
:root[data-phone-theme="light"] .nudge-card-replies { background:var(--phone-green); color:var(--text); border-color:#70ac90; }
:root[data-phone-theme="light"] .nudge-card-replies :is(strong,.nudge-card-meta) { color:#3a755a; }
:root[data-phone-theme="light"] .nudge-card-replies .nudge-card-text { color:#17563d; }
:root[data-phone-theme="light"] .orders-grid > .order-card.nudge-pending { --nudge-glow:37,117,193; }
:root[data-phone-theme="light"] .orders-grid > .order-card.nudge-updated:not(.nudge-pending) { --nudge-glow:25,148,100; }
:root[data-phone-theme="light"] #toast { color:var(--text); background:#fff; border-color:var(--line); box-shadow:0 6px 24px #20324a22; }
:root[data-phone-theme="light"] .completed-section { background:transparent; }
:root[data-phone-theme="light"] .completed-row { background:#fff; }
:root[data-phone-theme="light"] :is(.completed-number .completed-value,.completed-mobile-summary) { color:var(--text); }
:root[data-phone-theme="light"] .pager-controls { background:#fff; border-color:var(--line); }

/* 详情、录入与历史。 */
:root[data-phone-theme="light"] #details :is(.detail-grid,.detail-section) { background:var(--phone-soft); border-color:var(--line); }
:root[data-phone-theme="light"] #details .detail-grid > div { border-color:var(--line); }
:root[data-phone-theme="light"] #details .detail-progress-section { background:#eff6fd; border-color:#c5daee; }
:root[data-phone-theme="light"] #details :is(.detail-section p,.detail-grid dd,#detail-title) { color:var(--text); }
:root[data-phone-theme="light"] #details :is(.detail-grid dt,.detail-note,.detail-section .detail-note) { color:var(--dim); }
:root[data-phone-theme="light"] #details :is(.detail-section h3,.history-correct,#open-log) { color:var(--accent-3); }
:root[data-phone-theme="light"] #details #open-log { background:#e2effc; border-color:#b9d2eb; }
:root[data-phone-theme="light"] #details #toggle-followup[data-display-mode="normal"]::before,
:root[data-phone-theme="light"] #details #toggle-followup[data-display-mode="urgent"]::after { color:var(--warn); }
:root[data-phone-theme="light"] #details #toggle-followup[data-display-mode="normal"]::before { color:var(--done); }
:root[data-phone-theme="light"] #details #toggle-followup[data-display-mode="urgent"]::before,
:root[data-phone-theme="light"] #details #toggle-followup[data-display-mode="normal"]::after { color:var(--dim); }
:root[data-phone-theme="light"] #details :is(#toggle-paused,#close-details,#edit-detail-order,#delete-detail-order) { color:var(--accent-3); }
:root[data-phone-theme="light"] #details #delete-detail-order { color:var(--danger); }
:root[data-phone-theme="light"] #details #toggle-completed { color:var(--done); }
:root[data-phone-theme="light"] :is(#order-editor #save-order,#details #save-log,#details #save-estimate,#personnel-dialog #open-personnel-create,#personnel-create-submit) { background:var(--accent-3); color:#fff; border-color:var(--accent-3); }
:root[data-phone-theme="light"] #order-editor :is(.editor-fields,.editor-optional,.editor-actions) { background:var(--phone-soft); border-color:var(--line); }
:root[data-phone-theme="light"] #order-editor :is(.editor-fields label,.editor-fields input:required,.editor-optional summary) { border-color:#c7d5e4; color:var(--text); }
:root[data-phone-theme="light"] #order-editor :is(.detail-note,#cancel-editor) { color:var(--dim); }
:root[data-phone-theme="light"] #order-editor :is(input,textarea)::placeholder { color:#77869a; }
:root[data-phone-theme="light"] :is(#nudge-notice .nudge-notice-hero,.nudge-notice-actions) { background:var(--phone-blue); border-color:var(--line); }
:root[data-phone-theme="light"] :is(.nudge-notice-eyebrow,.nudge-notice-icon) { color:var(--accent-3); background:var(--phone-blue); border-color:#b4cee9; }

/* 月历、交期时间轴及原地展开，不改变排版或日期范围。 */
:root[data-phone-theme="light"] :is(.phone-calendar-action,.phone-calendar-all,.phone-calendar-more-months,.phone-calendar-count,.phone-timeline-action,.phone-timeline-expand) { color:var(--accent-3); }
:root[data-phone-theme="light"] .phone-calendar-weekdays span:nth-last-child(-n+2) { color:#7b6b80; }
:root[data-phone-theme="light"] .phone-calendar-date.is-today .phone-calendar-number { color:var(--accent-3); border-color:var(--accent-3); }
:root[data-phone-theme="light"] .phone-calendar-date.is-selected { background:var(--phone-blue); }
:root[data-phone-theme="light"] .phone-calendar-date.is-selected .phone-calendar-number { color:var(--accent-3); }
:root[data-phone-theme="light"] .phone-calendar-day { background:var(--phone-soft); border-color:#cbdced; }
:root[data-phone-theme="light"] .phone-calendar-month.is-current-month { border-color:#9ebfe2; box-shadow:inset 0 2px 0 #9ebfe2; }
:root[data-phone-theme="light"] .phone-calendar-month.is-current-month h3 { color:var(--accent-3); }
:root[data-phone-theme="light"] .phone-calendar-current-badge { background:var(--phone-blue); color:var(--accent-3); }
:root[data-phone-theme="light"] :is(.phone-timeline-body,.phone-timeline-order,.phone-timeline-expand,#delivery-calendar .timeline-inline-card .progress-head) { border-color:var(--line); }
:root[data-phone-theme="light"] .phone-timeline-entry.is-expanded > .phone-timeline-order { color:var(--accent-3); }
:root[data-phone-theme="light"] :is(.phone-timeline-product,.phone-timeline-day-heading) { color:#4a627a; }
:root[data-phone-theme="light"] :is(.phone-timeline-spec,.phone-timeline-paused,.phone-timeline-date small,.phone-timeline-empty-date,.phone-timeline-gap-label) { color:var(--dim); }
:root[data-phone-theme="light"] .phone-timeline-day::before,
:root[data-phone-theme="light"] .phone-timeline-empty-date::before { background:#c2d1e1; }
:root[data-phone-theme="light"] .phone-timeline-empty-date::after { background:#a0b4ca; }
:root[data-phone-theme="light"] .phone-timeline-day.is-today :is(.phone-timeline-date,.phone-timeline-date > span) { color:var(--accent-3); }
:root[data-phone-theme="light"] .phone-timeline-day.is-today .phone-timeline-body { border-color:#99bde2; }
:root[data-phone-theme="light"] .phone-timeline-day::after { background:#6c94b6; }
:root[data-phone-theme="light"] .phone-timeline-day.has-priority::after { background:var(--warn); }
:root[data-phone-theme="light"] :is(.phone-timeline-priority,.phone-timeline-day.has-priority .phone-timeline-total) { color:var(--warn); }
:root[data-phone-theme="light"] .phone-timeline-day-heading .late { color:var(--danger); }
:root[data-phone-theme="light"] .phone-timeline-overdue { background:var(--phone-red); border-color:#e5bdc7; color:var(--danger); }
:root[data-phone-theme="light"] .phone-timeline-entry > .phone-timeline-order::after { border-color:var(--dim); }

/* 管理中心及账号表单共用白色表面，操作与权限判定沿用。 */
:root[data-phone-theme="light"] #personnel-dialog :is(.management-sidebar,.management-password-card) { background:var(--phone-soft); border-color:var(--line); }
:root[data-phone-theme="light"] #personnel-dialog :is(.management-heading,.personnel-table tr,.personnel-table td.member-operations,.personnel-pager) { border-color:var(--line); }
:root[data-phone-theme="light"] #personnel-dialog .personnel-table tr { background:#fff; }
:root[data-phone-theme="light"] #personnel-dialog .personnel-table tr:hover td { background:transparent; }
:root[data-phone-theme="light"] #personnel-dialog .management-nav .button { color:var(--dim); }
:root[data-phone-theme="light"] #personnel-dialog .management-nav .button.is-active { color:var(--accent-3); background:var(--phone-blue); border-color:#c1d5ed; box-shadow:inset 0 -2px var(--accent-3); }
:root[data-phone-theme="light"] #personnel-dialog :is(.member-copy strong,.management-password-card .personnel-create-form > label) { color:var(--text); }
:root[data-phone-theme="light"] #personnel-dialog :is(.management-close,.personnel-filters label,.member-copy small,.management-results,.management-results > span,.member-role.is-recorder,.member-current,.personnel-pager,#personnel-message,.management-security-intro p,.management-password-card .hint) { color:var(--dim); }
:root[data-phone-theme="light"] #personnel-dialog :is(.management-mark,.management-security-intro > span,.member-avatar) { color:var(--accent-3); background:var(--phone-blue); border-color:#c1d5ed; }
:root[data-phone-theme="light"] #personnel-dialog :is(.member-avatar.is-self,.member-self) { color:var(--done); background:var(--phone-green); border-color:#c2dfd2; }
:root[data-phone-theme="light"] #personnel-dialog :is(.member-status.is-active,.personnel-restore-button) { color:var(--done); }
:root[data-phone-theme="light"] #personnel-dialog .member-status.is-disabled { color:var(--dim); }
:root[data-phone-theme="light"] #personnel-dialog .member-role.is-admin { color:var(--purple); }
:root[data-phone-theme="light"] #personnel-dialog :is(.member-action,.management-query,.personnel-pager .button) { color:var(--accent-3); background:transparent; border-color:#c1d5ed; }
:root[data-phone-theme="light"] #personnel-dialog .member-action.is-danger { color:var(--danger); }
:root[data-phone-theme="light"] #personnel-dialog :is(.personnel-status-menu summary,.personnel-status-options) { color:var(--text); background:#fff; border-color:#c7d5e4; box-shadow:none; }
:root[data-phone-theme="light"] #personnel-dialog .personnel-status-options button { color:var(--text); }
:root[data-phone-theme="light"] #personnel-dialog .personnel-status-options button[aria-pressed="true"] { color:var(--accent-3); background:var(--phone-blue); }
:root[data-phone-theme="light"] #personnel-dialog .management-password-card .personnel-pager .button.primary { background:var(--accent-3)!important; color:#fff!important; border-color:var(--accent-3)!important; }
:root[data-phone-theme="light"] :is(.account-history-heading,.account-history-entry-heading time,.account-history-actor,.account-history-change,#account-history-message) { color:var(--dim); }
:root[data-phone-theme="light"] .account-history-entry { border-color:var(--line); }
:root[data-phone-theme="light"] .account-history-entry-heading strong { color:var(--accent-3); }
:root[data-phone-theme="light"] .account-history-target { color:var(--text); }
:root[data-phone-theme="light"] #personnel-create :is(.dialog-heading,.personnel-pager) { border-color:var(--line); }
:root[data-phone-theme="light"] #personnel-create .personnel-create-form > label { color:var(--text); }
:root[data-phone-theme="light"] #personnel-create :is(.personnel-create-subtitle,.personnel-field-hint,.hint) { color:var(--dim); }
:root[data-phone-theme="light"] :is(#personnel-create-cancel,.personnel-admin-confirm,#personnel-disable-admin) { color:var(--warn); }
:root[data-phone-theme="light"] :is(#personnel-disable-submit,.personnel-disable-button) { color:var(--danger); }

/* 覆盖紧凑手机布局中更具体的旧色值。 */
:root[data-phone-theme="light"] body:not(.screen-mode) .order-card .order-meta .m:first-child .v { color:var(--text); }
:root[data-phone-theme="light"] body:not(.screen-mode) .order-card .order-meta .m:not(:first-child) .v { color:#526a82; }
:root[data-phone-theme="light"] #details #open-estimate { color:var(--accent-3); background:#e2effc; border-color:#b9d2eb; }
:root[data-phone-theme="light"] #order-editor #order-form > .editor-fields label { border-color:var(--line); }
:root[data-phone-theme="light"] :is(#editor-message,#order-editor-message,.inline-form label,#nudge-notice-title,#nudge-notice-message) { color:var(--text); }
:root[data-phone-theme="light"] .nudge-notice-hint { color:var(--dim); }
:root[data-phone-theme="light"] #nudge-notice form .button { color:#fff; background:var(--accent-3); border-color:var(--accent-3); }
:root[data-phone-theme="light"] .phone-calendar-order { border-color:var(--line); }
:root[data-phone-theme="light"] .phone-calendar-order-top > span { color:var(--dim); }
:root[data-phone-theme="light"] .phone-calendar-order-info { color:#526a82; }
:root[data-phone-theme="light"] .phone-calendar-order-progress { color:var(--text); }
:root[data-phone-theme="light"] .phone-calendar-date.has-urgent :is(.phone-calendar-number,.phone-calendar-count),
:root[data-phone-theme="light"] .phone-calendar-urgent { color:var(--warn); }

:root[data-phone-theme="light"] #details #detail-content > .detail-note { color:var(--dim); }
:root[data-phone-theme="light"] #details #toggle-pause,
:root[data-phone-theme="light"] #order-editor #close-editor { color:var(--accent-3); }
:root[data-phone-theme="light"] .page-footer { color:var(--dim); }

:root[data-phone-theme="light"] #details #estimate-shortcuts .button { color:var(--accent-3); }
:root[data-phone-theme="light"] #details #estimate-shortcuts .button[aria-pressed="true"] { color:var(--accent-3); background:var(--phone-blue); }
:root[data-phone-theme="light"] #details #estimate-shortcuts .button:active:not(:disabled) { background:#dbeafb; }
:root[data-phone-theme="light"] .timeline-inline-info { border-color:var(--line); }

:root[data-phone-theme="light"] .attention-paused { color:#386c87; background:#edf4f8; }
:root[data-phone-theme="light"] .attention-paused:disabled { opacity:.85; }
:root[data-phone-theme="light"] .has-nudge-reply :is(.progress-label,.progress-time) { color:var(--done); }

:root[data-phone-theme="light"] body:not(.screen-mode) .order-card .nudge-action { background:var(--phone-blue); color:var(--accent-3); border-color:#b4cee9; }
:root[data-phone-theme="light"] .pagination { border-color:var(--line); }
.screen-mode #open-handoff{display:none}
