/* Prestige Entries brand palette (assets/logo/Updated Color Palette.png)
   brown 52392F · terracotta D8735E · gold D7A947 · tan DAC18C · cream F9F0E7 · near-black 1C1C1D
   Brand fonts are Saudagar (display serif) and Gilroy Light (sans); neither is web-licensed,
   so Cormorant Garamond and Jost stand in with system fallbacks. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Jost:wght@300;400;500;600&display=swap');

:root {
  --brown: #52392f;
  --brown-2: #6b4c3f;
  --terracotta: #d8735e;
  --gold: #d7a947;
  --tan: #dac18c;
  --cream: #f9f0e7;
  --black: #1c1c1d;

  --ink: var(--black);
  --ink-2: #4a423e;
  --muted: #8a7f79;
  --line: #e6dcd2;
  --bg: var(--cream);
  --card: #ffffff;
  --brand: var(--brown);
  --brand-2: var(--brown-2);
  --accent: var(--terracotta);

  --ok: #2f6b45;   --ok-bg: #e4f0e7;
  --warn: #8a5a00; --warn-bg: #f7e9c6;
  --info: #52392f; --info-bg: #efe5db;
  --bad: #a83a2c;  --bad-bg: #f8dfd8;
  --mutedp: #6b625d; --mutedp-bg: #eee7e0;

  --serif: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --sans: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 15px/1.5 var(--sans); color: var(--ink); background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--brown); text-decoration: none; }
a:hover { color: var(--terracotta); text-decoration: underline; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--mutedp-bg); padding: 1px 5px; border-radius: 4px; }
h1 { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin: 0 0 4px; font-weight: 600; color: var(--brown); letter-spacing: .2px; }
h2 { font-family: var(--serif); font-size: 21px; margin: 0 0 12px; font-weight: 600; color: var(--brown); display: flex; align-items: baseline; justify-content: space-between; }
h2 .more { font-family: var(--sans); font-size: 13px; font-weight: 500; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; width: 100%; }
main.wrap { flex: 1; padding-top: 26px; padding-bottom: 44px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sub { font-size: 12.5px; color: var(--muted); }
.sub.bad, .bad { color: var(--bad); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* top bar: light, logo-led, terracotta rule underneath like the arch in the mark */
.topbar { background: #fff; border-bottom: 3px solid var(--terracotta); }
.topbar-inner { display: flex; align-items: center; gap: 32px; min-height: 84px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--brown); }
.brand:hover { text-decoration: none; }
.brand img { height: 60px; width: auto; display: block; }
.brand-text { font-family: var(--sans); font-weight: 300; font-size: 13px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ink-2); padding-left: 14px; border-left: 1px solid var(--line); line-height: 1.2; }
.nav { display: flex; gap: 2px; flex: 1 1 0; min-width: 0; flex-wrap: wrap; padding: 6px 0; }
.nav a { color: var(--ink-2); padding: 9px 14px; border-radius: 6px; font-weight: 500; letter-spacing: .3px; }
.nav a:hover { background: var(--cream); text-decoration: none; color: var(--brown); }
.nav a.active { background: var(--brown); color: #fff; }
.account { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; }
.account-name { color: var(--ink-2); }
.switcher select { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-size: 13px; font-family: var(--sans); }
.linklike { background: none; border: 0; color: var(--ink-2); cursor: pointer; font-size: 14px; padding: 0; font-family: var(--sans); }
.linklike:hover { color: var(--terracotta); text-decoration: underline; }
form.inline { display: inline; }
.banner-demo { background: var(--gold); color: var(--black); font-size: 13px; padding: 6px 0; font-weight: 500; }
.banner-shipto { background: #fff; border-bottom: 1px solid var(--line); font-size: 13.5px; padding: 7px 0; }
.banner-shipto .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.banner-shipto label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: var(--brown); }
.banner-shipto select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px; font-family: var(--sans); background: #fff; color: var(--ink); max-width: 70vw; }
.banner-staff { background: var(--brown); color: #fff; font-size: 13.5px; padding: 8px 0; }
.banner-staff .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.banner-staff .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.banner-staff .btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.banner-asuser { background: #b4503b; }   /* terracotta, darkened so white text reads */
.btn.small { padding: 4px 10px; font-size: 13px; }
.nav a.staff { color: var(--terracotta); }
.nav a.staff.active { background: var(--terracotta); color: #fff; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.picker { display: flex; align-items: center; gap: 8px; }
.picker label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.picker select { min-width: 340px; max-width: 100%; padding: 9px 10px; border: 1px solid var(--brown); border-radius: 6px; background: #fff; color: var(--ink); font-family: var(--sans); font-size: 14px; }
.picker select:focus { outline: 2px solid var(--tan); }
.empty-pick { text-align: center; color: var(--ink-2); padding: 36px 20px; }
.empty-pick p { margin: 0; }

/* staff dealers page */
.dealer h2 { margin-bottom: 2px; display: block; }
.dealer h3 { font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 500; margin: 0 0 8px; }
.dealer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.dealer-stats { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.stat { text-align: center; min-width: 54px; }
.stat strong { display: block; font-family: var(--serif); font-size: 24px; line-height: 1.1; color: var(--brown); }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat-warn strong { color: var(--terracotta); }
.rep-strip { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--cream); border: 1px solid var(--tan); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.rep-strip.rep-none { background: #fdf5f1; border-color: var(--terracotta); }
.rep-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--brown); font-weight: 600; min-width: 80px; }
.rep { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rep strong { font-family: var(--serif); font-size: 18px; color: var(--brown); }
.dealer-body { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; }
@media screen and (max-width: 860px) { .dealer-body { grid-template-columns: 1fr; } }
.shiptos li { padding: 5px 0; }
.shiptos .seq { display: inline-block; min-width: 22px; text-align: center; font-size: 12px; background: var(--mutedp-bg); border-radius: 4px; margin-right: 6px; }

/* layout bits */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.head-total { text-align: right; }
.head-total span { display: block; font-size: 12px; }
.head-total strong { font-family: var(--serif); font-size: 28px; color: var(--brown); }
.crumbs { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-bottom: 18px; }
.card-warn { border-color: var(--tan); background: #fdf7ec; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media screen and (max-width: 860px) { .two-col { grid-template-columns: 1fr; } .topbar-inner { gap: 14px; } .brand-text { display: none; } }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media screen and (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
@media screen and (max-width: 860px) { .tiles-3 { grid-template-columns: repeat(3, 1fr); } }
@media screen and (max-width: 720px) { .tiles-3 { grid-template-columns: 1fr; } }
.tile { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--brown); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.tile:hover { text-decoration: none; border-color: var(--terracotta); color: var(--ink); }
.tile-num { font-family: var(--serif); font-size: 32px; line-height: 1.1; font-weight: 600; color: var(--brown); font-variant-numeric: tabular-nums; }
.tile-label { font-size: 13px; color: var(--muted); letter-spacing: .2px; }
.tile-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.stat .stat-sub { display: block; text-transform: none; letter-spacing: 0; color: var(--ink-2); margin-top: 2px; }
.tile-warn { border-top-color: var(--terracotta); background: #fdf5f1; }
.tile-warn .tile-num { color: var(--terracotta); }
.facts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
@media screen and (max-width: 860px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.fact span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 3px; }
.fact.addr div { font-size: 13px; }
.callout { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.callout.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid #efc4bb; }

/* tables */
.table-scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 500; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list th.num { text-align: right; }
table.list th.wrap { white-space: normal; }
/* Sortable column headings (the Open orders list): the heading is a link; the current one shows its arrow. */
table.list th a.sort { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line); }
table.list th a.sort:hover { color: var(--brown); border-bottom-color: var(--brown); }
table.list th a.sort.on { color: var(--brown); font-weight: 600; border-bottom-color: var(--brown); }
table.list th a.sort .arrow { font-size: 9px; letter-spacing: 0; }
table.list td.nowrap { white-space: nowrap; }  /* a PO number must not break at its hyphen */   /* a long heading in a narrow card (the dashboard) may take two lines */
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list td.date { white-space: nowrap; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #fbf7f2; }
table.list tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 4px; color: var(--ink-2); }
table.list tfoot tr.total td { font-weight: 600; color: var(--brown); font-size: 15px; }
table.wide { min-width: 860px; }

.phrase { font-size: 13px; color: var(--ink-2); margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--tan); line-height: 1.45; max-width: 560px; }
/* pills */
.pill { display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: .3px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pill.big { font-size: 13px; vertical-align: middle; margin-left: 8px; font-family: var(--sans); }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.info { color: var(--info); background: var(--info-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.muted { color: var(--mutedp); background: var(--mutedp-bg); }

/* tabs, search, buttons */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { text-decoration: none; color: var(--brown); }
.tabs a.active { color: var(--brown); border-color: var(--terracotta); font-weight: 600; }
.search { display: flex; gap: 8px; align-items: center; }
.search input[type=search] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 280px; font-size: 14px; font-family: var(--sans); background: #fff; }
.search { flex-wrap: wrap; }
.search select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: var(--sans); background: #fff; color: var(--ink); max-width: 240px; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--brown); background: #fff; color: var(--brown); font-size: 14px; font-weight: 500; letter-spacing: .3px; cursor: pointer; font-family: var(--sans); }
.btn:hover { background: var(--cream); text-decoration: none; color: var(--brown); }
.btn.primary { background: var(--brown); border-color: var(--brown); color: #fff; }
.btn.primary:hover { background: var(--brown-2); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; }
.messages li.success { background: var(--ok-bg); color: var(--ok); }
.messages li.error { background: var(--bad-bg); color: var(--bad); }

/* login */
.login-card { max-width: 440px; margin: 36px auto; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--terracotta); border-radius: 12px; padding: 30px 32px 26px; }
.login-logo { display: block; width: 220px; max-width: 100%; margin: 0 auto 22px; }
.login-card h1 { text-align: center; }
.login-card > p.muted:first-of-type { text-align: center; }
.login-card label { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 4px; }
.login-card input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 15px; font-family: var(--sans); }
.login-card input:focus { outline: 2px solid var(--tan); border-color: var(--brown); }
.login-card .btn { width: 100%; margin-top: 18px; padding: 11px; }
.login-card .forgot { text-align: center; margin: 14px 0 0; }
.login-card .error { color: var(--bad); background: var(--bad-bg); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.demo-hint { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 13px; }
.demo-hint table { margin: 8px 0; border-collapse: collapse; }
.demo-hint td { padding: 3px 10px 3px 0; }
.error-detail { background: var(--mutedp-bg); padding: 10px; border-radius: 6px; white-space: pre-wrap; font-size: 12px; }

/* footer */
.footer { border-top: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--muted); padding: 16px 0; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* emailed documents */
.docs-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; }
.doc { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--cream); }
.doc:hover { border-color: var(--terracotta); text-decoration: none; color: var(--ink); }
.doc strong { display: block; font-size: 14px; color: var(--brown); }
.doc .sub { display: block; }
.doc-icon { background: var(--terracotta); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 6px 5px; border-radius: 5px; }
.doc-link { font-size: 12.5px; }
.badge { display: inline-block; min-width: 20px; text-align: center; background: var(--terracotta); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 6px; margin-left: 4px; }
.linkform { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.linkform input[type=text] { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--sans); font-size: 13px; width: 130px; }
.linkform select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--sans); font-size: 13px; background: #fff; }
.linklike.danger { color: var(--bad); }

.callout.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--tan); }

h3.minor { font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 500; margin: 14px 0 6px; }
td .pill { margin-left: 6px; }

/* sales rep portal */
table.accounts td.acct { border-right: 1px solid var(--line); min-width: 240px; }
table.accounts tr.first td { border-top: 2px solid var(--line); }
table.accounts tbody tr:first-child td { border-top: 0; }
table.accounts .seq { display: inline-block; min-width: 22px; text-align: center; font-size: 12px; background: var(--mutedp-bg); border-radius: 4px; margin-right: 6px; }
.btn.small.ghost { border-color: var(--line); }

.nav a { white-space: nowrap; }
.account { white-space: nowrap; }

/* staff forms */
.card.narrow { max-width: 620px; }
form.stack label, .inline-form label { display: block; font-size: 13px; font-weight: 500; margin: 12px 0 4px; color: var(--ink-2); }
form.stack input[type=text], form.stack input[type=email], form.stack select, .inline-form input[type=text], .inline-form select, input.copybox {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: var(--sans); background: #fff; color: var(--ink); }
form.stack input:focus, .inline-form input:focus, .inline-form select:focus { outline: 2px solid var(--tan); border-color: var(--brown); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; color: var(--ink) !important; font-size: 14px !important; cursor: pointer; }
label.check input { margin-top: 3px; width: auto; }
label.check .sub { display: block; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }
.inline-form { display: grid; grid-template-columns: 2fr 1.4fr auto; gap: 12px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.inline-form label { margin: 0; }
.inline-form.four { grid-template-columns: 2fr 1.4fr 1fr auto; }
table.list td select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px; font-family: var(--sans); background: #fff; color: var(--ink); }
@media screen and (max-width: 860px) { .inline-form, .inline-form.four, .row2 { grid-template-columns: 1fr; } }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 16px; margin: 6px 0; }
label.code { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
label.code:has(input:checked) { border-color: var(--brown); background: var(--cream); }
fieldset.types { border: 0; padding: 0; margin: 14px 0 4px; min-width: 0; }
fieldset.types legend { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 2px; }
fieldset.types label.code { margin-top: 6px; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--bad); font-size: 13px; }
.callout.info { background: var(--info-bg); color: var(--brown); border: 1px solid var(--tan); }
.notice { background: var(--ok-bg); color: var(--ok); padding: 8px 12px; border-radius: 6px; font-size: 14px; text-align: center; }
input.copybox { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.danger-zone { border-color: #efc4bb; }
.danger-zone h2 { color: var(--bad); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.messages li.info { background: var(--info-bg); color: var(--brown); }

/* ---------- phones and tablets ----------
   Two steps, for screens only: a printed page keeps the full layout whatever the paper's
   width. Under 1100px the menu drops beneath the logo. Under 720px the page is
   laid out for a phone: one column, bigger touch targets, and every table.list turns
   into a stack of cards, each cell showing its column name from data-label. A cell
   with no data-label is the card's title or its action; .m-hide drops a cell on a
   phone and .m-only shows a word only there. */
.m-only { display: none; }
img, input, select { max-width: 100%; }

@media screen and (max-width: 1100px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 6px 14px; }
  .brand img { height: 52px; }
  .nav { order: 3; flex: 0 0 100%; flex-wrap: wrap; padding-bottom: 8px; }
  .account { min-width: 0; }
  .topbar-inner:not(:has(.nav)) { padding-bottom: 10px; }
}

@media screen and (max-width: 720px) {
  .wrap { padding: 0 14px; }
  main.wrap { padding-top: 18px; padding-bottom: 32px; }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; }
  .card { padding: 14px; border-radius: 8px; margin-bottom: 14px; }
  .m-hide { display: none !important; }
  .m-only { display: inline; }
  code { overflow-wrap: anywhere; }

  /* top bar */
  .brand img { height: 44px; }
  .account { font-size: 13px; gap: 12px; }
  .account-name { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
  .switcher select { max-width: 46vw; }
  .nav a { padding: 10px 12px; }
  .linklike { padding: 8px 0; }

  /* fields under 16px make iOS zoom the page on focus */
  input, select, textarea { font-size: 16px !important; }
  .btn { padding: 10px 16px; }
  .btn.small { padding: 7px 12px; }

  /* page heads, search, tabs */
  .page-head { margin-bottom: 14px; gap: 10px; }
  .page-head > * { min-width: 0; }
  .head-actions, .search, .picker { width: 100%; }
  .search { flex-wrap: wrap; }
  .search input[type=search] { min-width: 0; flex: 1; }
  .search select { flex: 1 0 100%; max-width: none; }
  .picker { flex-wrap: wrap; }
  .picker select { min-width: 0; width: 100%; }
  .head-total { text-align: left; }
  .pill.big { margin-left: 0; }
  .tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 10px 12px; }

  /* dashboard, order facts, dealer card */
  .tiles { gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile-num { font-size: 25px; }
  .fact.addr { grid-column: 1 / -1; }
  .dealer-stats { gap: 14px; }
  .rep-strip { gap: 8px 14px; }
  .form-actions { flex-wrap: wrap; }
  .linkform input[type=text], .linkform select { width: 100%; }
  .login-card { margin: 12px auto; padding: 22px 18px 18px; }
  .footer .wrap { flex-direction: column; gap: 4px; }
  .two-col { gap: 0; }
  .doc-link { display: inline-block; font-size: 14px; padding: 4px 0; }

  /* tables as cards */
  .table-scroll { overflow-x: visible; }
  table.wide { min-width: 0; }
  table.list, table.list tbody, table.list tfoot, table.list tr, table.list td { display: block; }
  table.list thead { display: none; }
  table.list tbody tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.list tbody tr:first-child { padding-top: 0; }
  table.list tbody tr:last-child { border-bottom: 0; padding-bottom: 0; }
  table.list tbody tr:hover td { background: none; }
  table.list td { border: 0; padding: 3px 0; }
  table.list td::after { content: ""; display: block; clear: both; }
  table.list td[data-label] { text-align: right; }
  table.list td[data-label]::before { content: attr(data-label); float: left; margin-right: 14px; font-size: 11px; line-height: 22px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
  table.list td:not([data-label]) { font-size: 15px; }
  table.list td.date { white-space: normal; }
  table.list tfoot { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
  table.list tfoot tr { display: flex; justify-content: space-between; }
  table.list tfoot td { padding: 2px 0; }

  /* rep accounts: one block per account, its ship-tos listed beneath */
  table.accounts td.acct { border-right: 0; min-width: 0; }
  table.accounts tr.first td { border-top: 0; }
  table.accounts tbody tr { border-bottom: 0; padding: 4px 0; }
  table.accounts tbody tr.first { border-top: 2px solid var(--line); margin-top: 8px; padding-top: 12px; }
  table.accounts tbody tr:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
}

/* ---- Build plan page (staff) ---- */
.plan-toc a { font-size: 13.5px; }
.plan-text { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.plan-text p { margin: 0; }
.plan-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 30px; }
.plan-cols h3, .plan-group { font-family: var(--serif); font-size: 18px; color: var(--brown); margin: 0 0 4px; font-weight: 600; }
.plan-cols ul, .plan-points { margin: 0; padding-left: 18px; color: var(--ink-2); }
.plan-cols li, .plan-points li { margin: 3px 0; }
.plan-points { margin-top: 14px; max-width: 760px; }
.plan-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; grid-template-rows: auto auto; gap: 10px 12px; align-items: center; margin: 16px 0; }
.plan-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.plan-box strong { display: block; color: var(--brown); }
.plan-box span { font-size: 13px; color: var(--ink-2); }
.plan-flow .plan-box:nth-child(1) { grid-column: 1; grid-row: 1; }
.plan-flow .plan-box:nth-child(2) { grid-column: 1; grid-row: 2; }
.plan-flow .plan-arrow:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
.plan-flow .plan-mid { grid-column: 3; grid-row: 1 / span 2; border-color: var(--terracotta); background: var(--card); }
.plan-flow .plan-arrow:nth-child(5) { grid-column: 4; grid-row: 1 / span 2; }
.plan-flow .plan-box:nth-child(6) { grid-column: 5; grid-row: 1; }
.plan-flow .plan-box:nth-child(7) { grid-column: 5; grid-row: 2; }
.plan-arrow { font-size: 22px; color: var(--terracotta); text-align: center; }
.plan-group { margin: 18px 0 2px; }
.plan-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
.plan-item { padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.plan-item strong { display: block; }
.plan-item span { color: var(--ink-2); font-size: 14px; }
.plan-item em { display: block; font-style: normal; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.plan-day { display: grid; grid-template-columns: 110px 1fr; gap: 6px 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.plan-date { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--brown); font-variant-numeric: tabular-nums; }
.plan-entries { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.plan-entry { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; align-items: baseline; }
.plan-entry .pill { justify-self: start; }
.plan-entry strong { display: block; }
.plan-entry div span { color: var(--ink-2); font-size: 14px; }
@media screen and (max-width: 720px) {
  .plan-flow { grid-template-columns: 1fr; }
  .plan-flow > * { grid-column: 1 !important; grid-row: auto !important; }
  .plan-arrow { transform: rotate(90deg); }
  .plan-day, .plan-entry { grid-template-columns: 1fr; }
}

/* ---- "Admin" menu in the staff header ---- */
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; color: var(--terracotta); padding: 9px 14px; border-radius: 6px; font-weight: 500; letter-spacing: .3px; white-space: nowrap; user-select: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: "\25BE"; font-size: 11px; margin-left: 6px; }
.nav-menu summary:hover, .nav-menu[open] summary { background: var(--cream); color: var(--brown); }
.nav-menu.active summary { background: var(--terracotta); color: #fff; }
/* A menu whose link is the page lights up the same way: the modules' own menu files need nothing in base.html. */
.nav-menu:has(> .nav-menu-list > a.active) summary { background: var(--terracotta); color: #fff; }
.nav-menu summary:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.nav-menu-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 190px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(28, 28, 29, .12); }
.nav-menu-list a { display: block; }
@media screen and (max-width: 720px) {
  /* On a phone the list hangs from the whole menu row, so it can never run off the screen. */
  .nav { position: relative; }
  .nav-menu { position: static; }
  .nav-menu-list { top: 100%; left: 0; right: 0; }
  .nav-menu summary { padding: 10px 12px; }
}

/* ---- Contact page ---- */
.contact-line { font-size: 18px; font-weight: 500; margin: 10px 0 6px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 40px; }
.contact-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.contact-grid address { font-style: normal; font-size: 16px; line-height: 1.5; }

/* The Resources menu on the dealer site takes the dealer menu's colours, not the staff terracotta. */
.nav-menu.plain summary { color: var(--ink-2); }
.nav-menu.plain summary:hover, .nav-menu.plain[open] summary { color: var(--brown); }
.nav-menu-list .ext { font-size: 12px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Shared: the wide menu list, the plain menu's highlight, stacked form boxes (first made for Warranty Service) ---- */
.nav-menu-list.wide { min-width: 290px; }
.nav-menu.plain.active summary { background: var(--brown); color: #fff; }
.nav-menu.plain:has(> .nav-menu-list > a.active) summary { background: var(--brown); color: #fff; }
form.stack input[type=tel], form.stack input[type=date], form.stack textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: var(--sans); background: #fff; color: var(--ink); }
form.stack textarea { resize: vertical; line-height: 1.5; }
form.stack textarea:focus, form.stack select:focus { outline: 2px solid var(--tan); border-color: var(--brown); }
/* The box to drop files on, shared: Warranty Service pictures and videos, Custom Wood Quotes drawings */
.ws-drop { border: 2px dashed var(--line); border-radius: 10px; padding: 18px 16px; text-align: center; background: var(--bg); margin: 8px 0; transition: border-color .15s, background .15s; }
.ws-drop.over { border-color: var(--terracotta); background: #fdf5f1; }
.ws-drop-text { margin: 0; color: var(--ink-2); }
.ws-drop .ws-browse { display: inline !important; margin: 0 !important; font-size: inherit !important; font-weight: 600 !important; color: var(--terracotta) !important; text-decoration: underline; cursor: pointer; }
.ws-drop.ready input[type=file] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.ws-drop.ready:focus-within { border-color: var(--brown); }
.ws-drop:not(.ready) .ws-drop-text strong, .ws-drop:not(.ready) .ws-browse { display: none !important; }
.ws-chosen li { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); }
.ws-chosen li.sub { border-bottom: 0; }
.ws-chosen li span { overflow-wrap: anywhere; }

/* ---- Type-to-find drop-down (static/js/combo.js): replaces the browser's own suggestion box ---- */
.combo { position: relative; }
.combo input { padding-right: 34px !important; }
.combo-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 32px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; }
.combo-toggle::before { content: "\25BE"; }
.combo-toggle:hover { color: var(--brown); }
.combo-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; margin: 0; padding: 4px; list-style: none;
  width: max(100%, 560px); max-width: calc(100vw - 28px); max-height: 360px; overflow-y: auto;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(28, 28, 29, .16); text-align: left; }
.combo-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 400; line-height: 1.35; }
.combo-item:hover, .combo-item.active { background: var(--cream); }
.combo-item.active { outline: 2px solid var(--tan); outline-offset: -2px; }
.combo-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.combo-top strong { color: var(--brown); font-weight: 600; overflow-wrap: anywhere; }
/* Staff reports */
.report-period { display: flex; align-items: center; gap: 8px; }
.report-period label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.report-period select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: var(--sans); background: #fff; color: var(--ink); }
table.report-summary { max-width: 560px; }
table.report-summary a { font-weight: 600; }
table.report-summary a.current { text-decoration: underline; }
.report-notes li { color: var(--ink-2); font-size: 14px; }
.combo-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.combo-sub { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.combo-none, .combo-count { padding: 8px 10px; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.combo-count { border-top: 1px solid var(--line); margin-top: 4px; position: sticky; bottom: -4px; background: #fff; }
@media screen and (max-width: 720px) { .combo-list { width: 100%; max-height: 50vh; } }
/* Pricing pages: Steel prices (quoting_steel/prices.html) and Custom Wood Pricing (quoting_wood/pricing.html) */
.prices-form .card h3 { margin: 18px 0 8px; font-size: 13px; }
.prices-form .price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 20px; }
.prices-form .price-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.prices-form .price-field span { color: var(--muted); }
.prices-form .price-field input { max-width: 180px; }
.prices-form .price-field .price-pct { display: flex; align-items: center; gap: 6px; color: var(--ink, inherit); }
.prices-form input[type="number"], .prices-form .price-col input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.prices-form .prices-rows input { width: 110px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; text-align: right; }
.prices-form .prices-rows td.num input { text-align: right; }
.prices-form .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.prices-form .price-col { display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
.prices-form .price-col input { text-align: left; }
.prices-form .price-actions { display: flex; gap: 10px; margin: 6px 0 24px; }
.callout.bad ul, .callout.info ul { margin: 6px 0 0 18px; }
/* Orders page: the "Sort by" menu, shown only on a phone, where the column headings that sort are hidden. */
.search select.phone-sort { display: none; }
@media (max-width: 720px) { .search select.phone-sort { display: block; } }
