/* Admin tracker. Tokens copied from the public style.css :root, not linked:
   the admin origin's CSP is 'self' only, so the site's Google Fonts link
   can't load here. Instrument Sans is self-hosted under fonts/ instead
   (SIL OFL, fonts/OFL.txt). Keep the colours in step with style.css. */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url(fonts/instrument-sans-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url(fonts/instrument-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Same metric overrides as style.css, so the swap doesn't shift layout. */
@font-face {
  font-family: 'Instrument Sans Fallback';
  src: local('Helvetica Neue'), local('Helvetica'), local('Arial');
  size-adjust: 96%;
  ascent-override: 97%;
  descent-override: 25%;
  line-gap-override: 0%;
}

:root {
  --paper: #faf9f7;
  --paper-2: #f3f1ec;
  --paper-3: #ece9e2;
  --ink: #191817;
  --ink-soft: #3c3a36;
  --muted: #6f6b63;
  --rule: #e4e1db;
  --rule-strong: #c9c5bc;
  --accent: #0b6e62;
  --accent-tint: #e2f0ee;
  --danger: #b3261e;

  /* Chinese has no glyphs in Instrument Sans; the browser falls through to
     the system CJK face per character. */
  --sans: 'Instrument Sans', 'Instrument Sans Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --gutter: clamp(16px, 3vw, 40px);
  --radius: 5px;
  --radius-lg: 12px;
  --pill: 999px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0; color: var(--ink); font-synthesis-weight: none; text-wrap: balance; }
h1 { font-size: clamp(30px, 3.6vw, 42px); font-weight: 500; line-height: 1.05; letter-spacing: -0.021em; }
h2 { font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 14px; }
h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
p { margin: 0 0 12px; max-width: 66ch; }
button, input, select, textarea { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- Header: the site's, on paper with a hairline ---------- */

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  /* Inner edges line up with main's 1280px column, as the site's header does. */
  padding: 14px max(var(--gutter), calc((100% - 1280px) / 2 + var(--gutter)));
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 14px; margin-right: auto; text-decoration: none; color: var(--ink); }
.brand img { display: block; height: 24px; width: auto; }
.brand-tag { font-size: 13.5px; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--rule-strong); line-height: 1.1; }
.top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.who { display: inline-flex; align-items: baseline; gap: 8px; font-size: 14px; }
.who-name { font-weight: 500; }
.who-role { color: var(--muted); font-size: 13px; }
.toplink { font-size: 14px; color: var(--ink); text-decoration: none; }
.toplink:hover { text-decoration: underline; text-underline-offset: 3px; }
.lang { display: inline-flex; padding: 2px; border: 1px solid var(--rule-strong); border-radius: var(--pill); }
.lang button { border: 0; background: none; border-radius: var(--pill); padding: 3px 11px; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.lang button.on { background: var(--ink); color: var(--paper); }

main { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 96px; }

/* ---------- Buttons: the site's pills. Solid ink is the main action. ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.002em; line-height: 1.2;
  color: var(--paper); background: var(--ink);
  border: 1px solid var(--ink); border-radius: var(--pill);
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.secondary:hover { background: var(--paper-2); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #fbeceb; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--ink); }
.btn.secondary:disabled:hover, .btn.danger:disabled:hover { background: transparent; }

/* ---------- Fields: the /quote form's ---------- */

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 9px 10px;
  font-size: 14.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--rule-strong); border-radius: 3px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
/* Our own chevron, inset from the edge, instead of the browser's arrow
   (which sits against a pill's curve). A data: image: the CSP allows it. */
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23191817' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
label {
  display: block; margin: 16px 0 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .085em; text-transform: uppercase; color: var(--muted);
}
label.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); }
label.check input { width: auto; margin: 0; accent-color: var(--ink); }
input[type=file] { max-width: 100%; font-size: 14px; }
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 6px 14px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: var(--pill); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--paper-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline select, .inline input[type=text] { flex: 1 1 12rem; width: auto; }
.msg { margin-top: 10px; font-size: 14px; }
.msg:empty { display: none; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--accent); }
summary { margin-top: 20px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

/* ---------- Stage: colour says whose move it is ----------
   Filled teal: it's on you. Hollow ring: waiting on someone else.
   Grey: finished. That is the only job colour has on this page. */

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 11px 3px 9px;
  font-size: 13px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  border-radius: var(--pill); border: 1px solid var(--rule-strong);
  background: #fff; color: var(--ink-soft);
}
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.5px var(--muted); }
.chip-new, .chip-waiting_us, .chip-won, .chip-needs_quote, .chip-details_updated {
  background: var(--accent-tint); border-color: transparent; color: var(--accent);
}
.chip-new::before, .chip-waiting_us::before, .chip-won::before, .chip-needs_quote::before, .chip-details_updated::before {
  background: var(--accent); box-shadow: none;
}
.chip-shipped, .chip-closed, .chip-lost { background: var(--paper-2); border-color: transparent; color: var(--muted); }
.chip-shipped::before, .chip-closed::before { background: var(--rule-strong); box-shadow: none; }
.chip-lost::before { background: var(--danger); box-shadow: none; }

.badge {
  display: inline-block; padding: 1px 8px;
  font-size: 12px; font-weight: 500; line-height: 1.6;
  border-radius: var(--pill); background: var(--paper-2); color: var(--ink-soft);
}
.badge.current { background: var(--ink); color: var(--paper); }
.badge.old { color: var(--muted); }
.badge.requote { background: var(--accent-tint); color: var(--accent); }

/* ---------- Inbox ---------- */

.page-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 44px 0 22px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; }
.bar .search { flex: 1 1 280px; max-width: 480px; padding: 10px 18px; border-radius: var(--pill); }
.bar .sort { width: auto; padding: 10px 42px 10px 18px; border-radius: var(--pill); background-position: right 18px center; }

.tabs { display: flex; flex-wrap: wrap; gap: 0 26px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.tab {
  padding: 10px 0 11px; border: 0; background: none; cursor: pointer;
  font-size: 15px; color: var(--muted);
}
.tab:hover { color: var(--ink); }
.tab .n { margin-left: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tab[aria-selected=true] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }
.tab[aria-selected=true] .n { color: var(--ink); }

.row {
  display: grid;
  grid-template-columns: 9.5rem minmax(9rem, 1.1fr) minmax(10rem, 1.8fr) minmax(13rem, 1.5fr) 10rem;
  gap: 6px 22px; align-items: start;
  padding: 16px 12px; margin: 0 -12px;
  border-top: 1px solid var(--rule);
  color: inherit; text-decoration: none;
}
.rows .row:nth-child(2) { border-top: 0; }
a.row:hover { background: var(--paper-2); }
.row.head { padding-top: 14px; padding-bottom: 8px; border-top: 0; font-size: 12.5px; color: var(--muted); }
.row .rfq { font-family: var(--mono); font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.row .sub { font-size: 13px; color: var(--muted); }
.row .summary { font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.row .next { margin-top: 7px; font-size: 14px; font-weight: 600; color: var(--ink); }
.row .cell { min-width: 0; overflow-wrap: anywhere; }
.empty { padding: 56px 0; text-align: center; color: var(--muted); }

/* ---------- Request page ---------- */

.back { display: inline-block; margin: 26px 0 6px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }

/* The headline is the next move, in the site's display voice. */
.req-head { padding: 10px 0 30px; }
.req-id { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.req-id .rfq { font-family: var(--mono); font-size: 14.5px; font-weight: 600; letter-spacing: .02em; }
.nextline { margin-top: 16px; font-size: clamp(30px, 3.8vw, 48px); font-weight: 500; line-height: 1.04; letter-spacing: -0.022em; max-width: 22ch; }
dl.times { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 20px 0 0; }
dl.times dt { font-size: 12.5px; color: var(--muted); }
dl.times dd { margin: 0; font-size: 14px; }
.banner { margin: 0 0 26px; padding: 13px 16px; border-radius: var(--radius); background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.banner.deleted { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; background: var(--paper-2); color: var(--ink); }

.req-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: start; }
.req-single { max-width: 860px; }

/* Sections are separated by hairlines, as on the site; no boxes. */
.card { padding: 28px 0; border-top: 1px solid var(--rule); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; border-top: 1px solid var(--rule); }
.cols .card { border-top: 0; }
.card form { margin-top: 14px; }

/* The staff's moves sit together in one panel. */
.req-aside { margin-top: 10px; padding: 4px 26px; border-radius: var(--radius-lg); background: var(--paper-2); }
.req-aside .card { padding: 22px 0; border-top-color: var(--rule-strong); }
.req-aside .card:first-child { border-top: 0; }
.req-aside h2 { font-size: 16px; }
.req-aside .btn.secondary:hover { background: var(--paper-3); }
/* Per-supplier stages in the panel are always the supplier's move or done,
   never the reader's, so they never take the "on you" teal. */
.req-aside .chip { background: #fff; border-color: var(--rule-strong); color: var(--ink-soft); }
.req-aside .chip::before { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); }
.req-aside ul.plain li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; }
.req-aside ul.plain li > .muted { flex-basis: 100%; font-size: 13px; }

dl.kv { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 8px 16px; margin: 0; }
dl.kv dt { font-size: 13.5px; color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.entry { padding: 14px 0; border-top: 1px solid var(--rule); }
.entry:first-child { border-top: 0; padding-top: 2px; }
.entry .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.entry .meta strong { color: var(--ink); font-weight: 600; }
.entry .body { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry.superseded .body { color: var(--muted); }

.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.subtabs .tab { padding: 6px 15px; border: 1px solid var(--rule-strong); border-radius: var(--pill); font-size: 14px; color: var(--ink-soft); box-shadow: none; }
.subtabs .tab[aria-selected=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 3px 0; }
ul.plain li.msg { margin-top: 0; }
ul.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--rule); }
ul.files li:first-child { border-top: 0; }
ul.files li a { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
ul.files li .muted { margin-right: auto; font-size: 13.5px; }
hr.sep { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }

/* ---------- Narrow pages: sign in, new request, password ---------- */

.card.narrow { max-width: 600px; margin: 56px auto 0; padding: 0; border-top: 0; }
.card.narrow h1 { margin-bottom: 18px; }
.narrow .banner { margin: 18px 0; }
.narrow .actions { margin-top: 24px; }

/* ---------- Narrower screens ---------- */

@media (max-width: 1000px) {
  .req-layout { grid-template-columns: 1fr; gap: 8px; }
  .req-aside { margin-top: 0; }
}
@media (max-width: 760px) {
  /* Three lines of header would sit on every screen if it stayed pinned. */
  .top { position: static; gap: 10px 16px; }
  .who-role { display: none; }
  .brand img { height: 20px; }
  .page-title { margin-top: 28px; }
  .row { grid-template-columns: 1fr; gap: 3px; padding: 14px 12px; }
  .row.head { display: none; }
  .cols, .form-grid { grid-template-columns: 1fr; gap: 0; }
  .cols .card + .card { border-top: 1px solid var(--rule); }
  dl.kv { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tab { white-space: nowrap; }
  .req-aside { padding: 4px 18px; }
}
