:root {
  --canvas: #00215a; --panel: #0b2b63; --component: #173a73;
  --text: #f7f3ea; --muted: #b8c3d6; --soft: #8fb2ea; --line: #335079;
  --gold: #c9aa75; --negative: #d95c5c;
  --heading: 'Adobe Caslon Pro', 'Segoe UI', sans-serif;
  --body: 'Gill Sans MT', 'Segoe UI', sans-serif;
  color-scheme: dark; font-family: var(--body); background: var(--canvas); color: var(--text); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; border-radius: 0; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { max-width: 1440px; margin: 0 auto; padding: 0 48px; }

/* Reuse the clocking header's established styling exactly, scoped to this header. */
.masthead {
  --header-ink: #f3f0e8; --header-muted: #aabbd7; --header-line: #405887;
  height: 102px; padding: 0 48px; display: flex; align-items: center;
  border-bottom: 1px solid var(--header-line); gap: 26px; background: #0b2458;
  color: var(--header-ink); font: 15px Arial, sans-serif;
}
.masthead .brand { font: 25px Georgia, serif; letter-spacing: 4px; color: var(--header-ink); text-decoration: none; text-align: center; }
.masthead .brand small { display: block; font: 9px Arial, sans-serif; letter-spacing: 4px; margin-top: 5px; }
.masthead .divider { height: 34px; border-left: 1px solid var(--header-line); }
.masthead .product { letter-spacing: 3px; font-size: 13px; }
.masthead .product small { display: block; color: var(--header-muted); letter-spacing: .5px; font-size: 11px; margin-top: 7px; }
.masthead nav { margin-left: auto; display: flex; gap: 12px; }
.masthead .nav-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 21px; border: 1px solid var(--header-line); border-radius: 5px; text-decoration: none; font: inherit; font-weight: 600; line-height: 20px; }
.masthead .nav-button.active { border-color: #d7b56d; color: #d7b56d; background: #17356f; }
.masthead .nav-button:hover { filter: brightness(1.08); }

.page-heading { display: flex; justify-content: space-between; align-items: center; padding: 28px 0 24px; gap: 24px; }
.eyebrow, .section-number { font-size: 11px; letter-spacing: 1.8px; font-weight: 600; color: var(--gold); margin: 0 0 12px; }
h1, h2, p { margin-top: 0; }
h1 { font-family: var(--heading); font-weight: 400; font-size: 44px; line-height: 1.1; margin-bottom: 10px; letter-spacing: -1px; }
h2 { font-size: 23px; font-weight: 400; line-height: 1.35; margin-bottom: 10px; }
.intro { color: var(--muted); font-size: 16px; line-height: 1.5; margin-bottom: 0; }
.demo-banner { display: flex; align-items: center; gap: 14px; padding: 11px 16px; margin-bottom: 20px; background: var(--panel); border-left: 2px solid var(--gold); color: var(--muted); font-size: 12px; line-height: 1.5; }
.demo-mark { font-size: 10px; letter-spacing: 1.5px; font-weight: 700; color: var(--gold); }
.workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; gap: 24px; }
.search-column, .result-area { min-width: 0; }
.search-panel { padding: 26px 24px; background: var(--component); border: 1px solid var(--line); }
.search-panel h2 { font-size: 22px; }
.supporting { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.search-panel label { display: block; font-size: 13px; margin-bottom: 9px; }
.input-row { display: flex; flex-direction: column; gap: 10px; }
input { min-width: 0; width: 100%; background: var(--canvas); border: 1px solid #6680a5; padding: 13px 14px; color: var(--text); font-size: 17px; height: 51px; }
input::placeholder { color: var(--muted); font-size: 15px; }
input[aria-invalid=true] { border-color: var(--negative); }
.input-row button { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 12px 16px; border: 1px solid var(--gold); background: var(--gold); color: var(--canvas); font-weight: 600; min-height: 48px; }
.input-row button:hover { background: #dbc299; }
.hint { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 10px 0 0; }
.examples { border-top: 1px solid #42608b; margin-top: 22px; padding-top: 17px; font-size: 12px; color: var(--muted); }
#example-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sample-button { background: transparent; border: 1px solid #6680a5; color: var(--text); padding: 7px 8px; font-size: 11px; }
.sample-button:hover { border-color: var(--gold); color: var(--gold); }
.guide-panel { padding: 29px 30px; min-height: 340px; background: var(--panel); display: flex; flex-direction: column; border: 1px solid var(--line); }
.order-icon { color: var(--gold); margin-bottom: 20px; }
.guide-panel h2 { font-family: var(--heading); font-size: 29px; line-height: 1.25; margin-bottom: 15px; }
.guide-panel p { font-size: 14px; color: var(--muted); line-height: 1.7; max-width: 430px; }
.guide-foot { margin-top: auto; padding-top: 19px; border-top: 1px solid var(--line); font-size: 12px; color: var(--soft); }
.announcement { color: var(--muted); line-height: 1.6; font-size: 13px; margin: 16px 0 0; }
.announcement:empty { margin: 0; }
.announcement.error { padding: 13px 15px; background: var(--panel); border-left: 2px solid var(--negative); color: var(--text); }
.results-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 3px 0 17px; }
.results-heading .section-number { margin-bottom: 9px; }
.results-heading h2 { font-size: 26px; margin-bottom: 7px; overflow-wrap: anywhere; }
.results-heading .supporting { margin-bottom: 0; font-size: 13px; }
.text-button { background: transparent; border: 0; padding: 8px 0 8px 8px; color: var(--muted); font-size: 12px; display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.text-button:hover { color: var(--gold); }
.text-button span { font-size: 21px; }
.results { background: var(--panel); border: 1px solid var(--line); padding: 26px; }
.result-rows { border: 1px solid var(--line); }
.table-header, .order-row { display: grid; grid-template-columns: 1fr 1.15fr 1.15fr 1.1fr; gap: 16px; padding: 15px 20px; }
.table-header { background: var(--component); font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.order-row { background: var(--panel); align-items: center; min-height: 84px; font-size: 14px; cursor: pointer; list-style: none; }
.order-row::-webkit-details-marker { display: none; }
.order-row:hover { background: var(--component); }
.order-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.suborder { border-top: 1px solid var(--line); }
.suborder[open] > .order-row { background: var(--component); }
.suborder-identity { display: grid; gap: 7px; }
.history-toggle { color: var(--gold); font-size: 10px; line-height: 1.4; }
.history-toggle::before { content: '+ '; font-weight: 700; }
.suborder[open] .history-toggle::before { content: '− '; }
.suborder-body { padding: 20px; border-top: 1px solid var(--line); }
.detail-heading { margin: 0; font-size: 12px; font-weight: 600; color: var(--text); }
.order-metadata { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 18px; margin: 14px 0 22px; }
.order-metadata > div { min-width: 0; }
.order-metadata dt { font-size: 10px; letter-spacing: .6px; color: var(--muted); margin-bottom: 5px; }
.order-metadata dd { font-size: 12px; margin: 0; overflow-wrap: anywhere; }
.history-heading { display: flex; justify-content: space-between; gap: 12px; padding: 15px 0 12px; border-top: 1px solid var(--line); }
.history-heading > span { color: var(--muted); font-size: 11px; }
.status-history { list-style: none; margin: 0; padding: 0 12px 0 0; max-height: 370px; overflow-y: auto; scrollbar-color: var(--line) var(--panel); }
.status-history:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.history-entry { position: relative; padding: 0 0 18px 19px; border-left: 1px solid var(--line); margin-left: 3px; }
.history-entry::before { content: ''; position: absolute; left: -3px; top: 7px; width: 5px; height: 5px; background: var(--gold); }
.history-entry:last-child { padding-bottom: 0; }
.event-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.event-statuses { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 11px; font-size: 13px; }
.event-statuses .cell-label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.latest-tag { border: 1px solid var(--line); color: var(--gold); padding: 3px 6px; font-size: 10px; }
.order-row > div { min-width: 0; overflow-wrap: anywhere; }
.sub-order-number { font-weight: 600; }
.customer-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 5px; height: 5px; flex-shrink: 0; background: var(--soft); }
.cell-label { display: none; }
.record-time { display: flex; flex-wrap: wrap; column-gap: 6px; font-size: 12px; line-height: 1.6; color: var(--muted); font-variant-numeric: tabular-nums; }
.record-time .time { color: var(--text); }
.results-note { display: flex; gap: 9px; align-items: flex-start; padding: 13px 0 0; }
.note-dot { width: 4px; height: 4px; background: var(--gold); margin-top: 7px; flex-shrink: 0; }
.results-note p { font-size: 11px; color: var(--muted); line-height: 1.6; margin-bottom: 0; }
.empty-state, .loading-state { background: var(--panel); border: 1px solid var(--line); padding: 30px; min-height: 220px; }
.empty-state h2, .loading-state h2 { font-family: var(--heading); font-size: 28px; }
.empty-state > p:last-child { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 0; max-width: 600px; }
footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); margin-top: 32px; padding: 19px 0 24px; color: var(--muted); font-size: 11px; }
footer > span:last-child { letter-spacing: 1.6px; font-size: 10px; }
.footer-dot { color: var(--gold); padding: 0 9px; }
.skip-link { position: absolute; top: -70px; left: 20px; padding: 12px; background: var(--gold); color: var(--canvas); z-index: 2; }
.skip-link:focus { top: 10px; }
@media (max-width: 1100px) {
  .shell { padding: 0 30px; }
  .workspace { grid-template-columns: 290px minmax(0, 1fr); gap: 18px; }
  .search-panel { padding: 24px 20px; }
  .table-header, .order-row { padding-left: 14px; padding-right: 14px; gap: 10px; }
  .table-header { font-size: 9px; letter-spacing: .4px; }
  .order-row { font-size: 13px; }
  .results { padding: 20px; }
}
@media (max-width: 900px) {
  .masthead { padding: 0 20px; height: 88px; gap: 15px; }
  .masthead .brand { font-size: 19px; }
  .masthead .product { display: none; }
  .masthead .nav-button { padding: 8px 12px; font-size: 12px; min-height: 40px; }
}
@media (min-width: 650px) and (max-height: 900px) { .masthead { height: 72px; } }
@media (max-width: 820px) {
  .shell { padding: 0 20px; }
  .workspace { grid-template-columns: 1fr; gap: 22px; }
  .input-row { flex-direction: row; }
  .input-row input { flex: 1; }
  .input-row button { min-width: 145px; }
  .examples { display: flex; align-items: center; gap: 12px; }
  #example-buttons { margin-top: 0; }
  .guide-panel { min-height: 0; padding: 24px; }
  .guide-panel h2 br { display: none; }
  .order-icon { display: none; }
  .guide-foot { padding-top: 13px; }
  .page-heading { padding: 25px 0 21px; }
  .table-header { font-size: 10px; }
}
@media (max-width: 520px) {
  h1 { font-size: 36px; }
  .intro { font-size: 14px; }
  .page-heading { align-items: flex-start; gap: 12px; }
  .eyebrow { font-size: 10px; }
  .input-row { flex-direction: column; }
  .demo-banner { align-items: flex-start; padding: 10px 12px; gap: 10px; }
  .demo-mark { padding-top: 2px; }
  .examples { display: block; }
  #example-buttons { margin-top: 10px; }
  .results-heading { align-items: flex-start; }
  .results-heading h2 { font-size: 23px; }
  .table-header { display: none; }
  .order-row { grid-template-columns: 1fr; gap: 15px; padding: 21px 20px; font-size: 14px; }
  .order-row:first-child { border-top: 0; }
  .results { padding: 20px 14px; }
  .suborder-body { padding: 18px 14px; }
  .order-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell-label { display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
  .sub-order-number { font-size: 18px; }
  .order-row > div:first-child { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .empty-state, .loading-state { padding: 24px 20px; }
  footer { flex-wrap: wrap; font-size: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background .15s, border-color .15s; }
  .results, .empty-state { animation: appear .2s ease-out; }
  @keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
}
