/* ==========================================================================
   Dış Ticaret — design system
   One stylesheet, no build step. Tokens first, then primitives, then blocks.
   ========================================================================== */

:root {
  /* Near-neutral greys with the faintest cool bias. The chrome stays quiet so
     the product pictures carry the colour — which is why a page of photographs
     looks composed rather than busy. */
  --ink-900: #1d1d1f;
  --ink-800: #2b2b2e;
  --ink-700: #424245;
  /*
   * The two secondary greys, dark enough for the tinted panels and not only
   * for white.
   *
   * Both were set against `--surface` and both failed everywhere else: field
   * hints on the supplier's pricing panel measured 3.92:1 against the warning
   * tint, table headers 4.21:1 against the sunken surface. That is most of the
   * explanatory text on the page a supplier fills in a floor price on, and it
   * looked perfectly readable — the fault is invisible without measuring, which
   * is why `test/contrast.test.js` now measures it against every surface these
   * sit on rather than against white.
   */
  --ink-500: #5f5f64;
  --ink-400: #68686d;
  --ink-300: #a1a1a6;
  --ink-200: #d2d2d7;
  --ink-100: #e3e3e6;
  --ink-50: #f0f0f2;

  --surface: #ffffff;
  --surface-sunken: #f5f5f7;
  --surface-raised: #ffffff;
  --border: #e4e4e7;
  --border-strong: #d2d2d7;

  --brand-700: #0058b0;
  --brand-600: #0066cc;
  --brand-500: #0071e3;
  --brand-100: #e9f2fd;

  --accent-600: #8f5e19;
  --accent-500: #b8802a;
  --accent-100: #f7ecd8;

  /* Solid fills. The scales above invert between themes so they stay legible
     as TEXT on the current ground; these stay dark-on-light in both themes so
     anything using them as a BACKGROUND keeps its white ink readable. */
  --brand-solid: #0071e3;
  --brand-solid-hover: #0060c4;
  --brand-ink: #ffffff;
  /* The secondary call to action is a graphite pill rather than a second
     colour. Two saturated buttons beside each other make neither one the
     answer to "what do I press". */
  --accent-solid: #1d1d1f;
  --accent-solid-hover: #000000;
  --accent-ink: #ffffff;
  --danger-solid: #c0392f;
  --danger-solid-hover: #a32e26;
  --danger-ink: #ffffff;
  /* A light hero. The headline carries the page; a dark slab behind it is a
     way of adding weight that the type should be earning on its own. */
  --hero-from: #ffffff;
  --hero-mid: #f5f5f7;
  --hero-to: #ebebee;
  --hero-ink: #1d1d1f;

  /*
   * Status colours, darkened to clear 4.5:1 against their own tint.
   *
   * The `-600` and `-100` of each pair are used together — an alert, a badge, a
   * negative margin figure — so the pairing is the contrast that matters, not
   * either against the page. `#1a7f47` gave 4.31:1 on its tint and `#c0392f`
   * gave 4.47:1: both looked fine and both failed, which is the whole problem
   * with judging this by eye. `test/contrast.test.js` now measures it.
   */
  --ok-600: #146b39;
  --ok-100: #dff2e6;
  --warn-600: #8f5e19;
  --warn-100: #f7ecd8;
  --danger-600: #b5342b;
  --danger-100: #fbe4e2;
  --info-600: #0066cc;
  --info-100: #e9f2fd;

  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --text-faint: var(--ink-400);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 980px;
  /* Tinted rather than grey, and layered: a close contact shadow for the edge
     plus a wide soft one for the lift. Grey drop-shadows are what make an
     otherwise decent card look cheap. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.045);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 20px -10px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.05), 0 24px 56px -20px rgba(0, 0, 0, 0.22);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /*
   * No web font. The platform's promise is that it runs from a clone with no
   * supply chain, and a font request on every page would also send every
   * visitor's address to a third party — an odd thing to do underneath a KVKK
   * notice. `system-ui` first gets each platform's own optically-sized face,
   * which at display weights beats a generic downloaded fallback anyway.
   */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /*
   * A fluid type scale. Headings shrink with the viewport rather than at two
   * breakpoints, so a long Turkish compound never has to break mid-word on a
   * phone. Tracking tightens as size grows — at 3rem the default spacing reads
   * loose and cheap.
   */
  --text-display: clamp(2.5rem, 1.3rem + 4.4vw, 4.25rem);
  --text-h1: clamp(1.875rem, 1.4rem + 1.9vw, 2.75rem);
  --text-h2: clamp(1.3125rem, 1.12rem + 0.8vw, 1.75rem);
  --text-lead: clamp(1.125rem, 1.03rem + 0.42vw, 1.3125rem);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink-900: #f5f5f7;
    --ink-800: #e3e3e6;
    --ink-700: #c9c9ce;
    --ink-500: #a1a1a6;
    /* #8e8e93 was 4.16:1 against the warning tint, for the same hints. */
    --ink-400: #9a9aa1;
    --ink-300: #6e6e73;
    --ink-200: #48484c;
    --ink-100: #313135;
    --ink-50: #262629;

    --surface: #1d1d1f;
    --surface-sunken: #000000;
    --surface-raised: #262629;
    --border: #313135;
    --border-strong: #48484c;

    --brand-700: #7cc0ff;
    --brand-600: #57aeff;
    --brand-500: #2f9bff;
    --brand-100: #10243a;

    --accent-600: #e7b662;
    --accent-500: #d09a3e;
    --accent-100: #3a2c12;

    /* The brighter system blue measures 3.65:1 against white button text,
       which fails AA at button size. This is the lightest blue that clears
       4.5:1 and still reads as a live control on a near-black ground. */
    --brand-solid: #0071e3;
    --brand-solid-hover: #0a84ff;
    --brand-ink: #ffffff;
    --accent-solid: #f5f5f7;
    --accent-solid-hover: #ffffff;
    --accent-ink: #1d1d1f;
    /* White on #d9483c was 4.25:1 — a Delete button nobody should have to
       squint at. #cf4235 clears 4.5:1 with white and still stands 3.5:1 off
       the dark page, so the button reads as a button. */
    --danger-solid: #cf4235;
    --danger-solid-hover: #c0392f;
    --danger-ink: #ffffff;
    --hero-from: #262629;
    --hero-mid: #1d1d1f;
    --hero-to: #000000;
    --hero-ink: #f5f5f7;

    --ok-100: #102d1e;
    --ok-600: #5ed49a;
    --warn-100: #3a2c12;
    --warn-600: #e7b662;
    --danger-100: #3a1c1c;
    --danger-600: #ff8f85;
    --info-100: #10243a;
    --info-600: #7cc0ff;

    --text: var(--ink-900);
    --text-muted: var(--ink-500);
    --text-faint: var(--ink-400);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px -10px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.4), 0 22px 50px -18px rgba(0, 0, 0, 0.8);
    --ring: 0 0 0 3px color-mix(in srgb, var(--brand-500) 30%, transparent);
  }
}

/* --- reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.53;
  color: var(--text);
  background: var(--surface-sunken);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0 0 var(--space-3); line-height: 1.2; font-weight: 600; letter-spacing: -0.021em; text-wrap: balance; }
h1 { font-size: var(--text-h1); line-height: 1.08; letter-spacing: -0.035em; font-weight: 650; }
h2 { font-size: var(--text-h2); letter-spacing: -0.028em; font-weight: 650; }

/* Figures line up column-wise wherever they are compared. */
table, .stat__value, .num, .mono, time { font-variant-numeric: tabular-nums; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 var(--space-4); }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-5) 0; }
code, kbd { font-family: var(--mono); font-size: 0.875em; }
small { font-size: 0.8125rem; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

/* --- layout --------------------------------------------------------------- */

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-5); }
.container-narrow { max-width: 760px; }
.page { padding: var(--space-7) 0 var(--space-8); min-height: 60vh; }
.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-6); }
.row { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.row-tight { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: var(--space-4); }
/*
 * Exact column counts, not auto-fit.
 *
 * auto-fit reads as "two columns" and behaves as "as many as fit", so a form
 * laid out in pairs quietly became three across on a wide screen and the
 * fields stopped lining up with their labels' intent. A grid named grid-2
 * should be two columns.
 */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.sidebar-layout { display: grid; grid-template-columns: 268px 1fr; gap: var(--space-6); align-items: start; }
.sidebar-layout > aside { font-size: 0.9375rem; }
.sidebar-layout > aside h2 { font-size: 1rem; letter-spacing: -0.012em; }
.sidebar-layout > aside p { line-height: 1.5; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--space-6); align-items: start; }
/*
 * Grid and flex items default to `min-width: auto`, which refuses to shrink
 * below the item's own content. A wide table inside one therefore widens its
 * track instead of scrolling, and the whole page scrolls sideways — the
 * scroll container it sits in never gets narrower than the table, so its
 * `overflow-x: auto` never has anything to do.
 *
 * The users console was doing exactly that at phone width: 1228px of document
 * inside a 390px screen. Every other console table happened to be narrow
 * enough to fit, so the fault was latent rather than absent.
 */
.split > *, .sidebar-layout > * { min-width: 0; }
@media (max-width: 900px) {
  .sidebar-layout, .split { grid-template-columns: 1fr; }
}
.spacer { flex: 1; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-danger { color: var(--danger-600); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.875em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- header / footer ------------------------------------------------------ */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .container { display: flex; align-items: center; gap: var(--space-5); min-height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: 1.0625rem; color: var(--text); letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--brand-solid), var(--brand-solid-hover));
  color: var(--brand-ink); display: grid; place-items: center; font-size: 0.8125rem; font-weight: 700;
}
.site-nav { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--text-muted); font-size: 0.9375rem; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { font-weight: 600; }

.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.lang-switch a { padding: 3px 9px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); background: var(--surface); }
.lang-switch a[aria-current="true"] { background: var(--brand-solid); color: var(--brand-ink); }
.lang-switch a:hover { text-decoration: none; }

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.site-footer h2 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
.site-footer a { color: var(--text-muted); }
.footer-note {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 10px 20px; border-radius: var(--radius-pill); border: 1px solid transparent;
  font: inherit; font-size: 0.9375rem; font-weight: 500; line-height: 1.25;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--brand-solid); color: var(--brand-ink);
  /* A hairline of light along the top edge. One pixel, and it is most of the
     difference between a filled rectangle and a button. */
  box-shadow: none;
  transition: background-color .18s ease, border-color .18s ease, opacity .18s ease, transform .12s ease;
}
.btn:hover { background: var(--brand-solid-hover); text-decoration: none; color: var(--brand-ink); }
.btn:active { transform: scale(0.975); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-secondary { background: transparent; color: var(--brand-600); border-color: var(--border-strong); box-shadow: none; }
.btn-secondary:hover { background: var(--ink-50); color: var(--brand-700); border-color: var(--ink-300); box-shadow: none; }
.btn-accent { background: var(--accent-solid); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-solid-hover); color: var(--accent-ink); }
.btn-danger { background: var(--danger-solid); color: var(--danger-ink); }
.btn-danger:hover { background: var(--danger-solid-hover); color: var(--danger-ink); }
.btn-ghost { background: transparent; color: var(--brand-600); box-shadow: none; }
.btn-ghost:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-sm { padding: 5px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 13px 28px; font-size: 1.0625rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------------------
   Federated sign-in
   -------------------------------------------------------------------------*/

/*
 * The provider button deliberately does not use the brand colours. Google's
 * brand terms ask that its button stay neutral with the mark unaltered, and a
 * sign-in button that looks like the site's primary action tends to get
 * pressed by people who meant to submit the password form beneath it.
 */
.btn-provider {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  gap: 10px;
  font-weight: 600;
}
.btn-provider:hover { background: var(--surface-sunken); color: var(--text); border-color: var(--ink-300); }

/*
 * A padlock, drawn rather than set as an emoji, for the same reason the
 * password method's icon is: a glyph the font does not carry becomes a box,
 * and these two marks sit on the security and confidentiality screens where a
 * box is read as a fault rather than a missing font.
 */
.lock-mark {
  /*
   * Sized to occupy its whole footprint, shackle included, so it lays out
   * correctly in the flex row it sits in rather than overhanging the line.
   */
  display: inline-block; position: relative; flex: none;
  width: 10px; height: 13px; vertical-align: -2px;
}
.lock-mark::after {
  content: ''; position: absolute; inset: auto 0 0 0;
  height: 8px; border-radius: 2px; background: currentColor;
}
.lock-mark::before {
  content: ''; position: absolute; left: 50%; top: 0;
  width: 7px; height: 6px; box-sizing: border-box;
  border: 1.5px solid currentColor; border-bottom: 0;
  border-radius: 4px 4px 0 0; transform: translateX(-50%);
}

/* The mark keeps its own colours in both themes — it is a logo, not an icon. */
.provider-mark { flex: none; display: block; }

/* A rule with the word set into it, for "or". */
.auth-divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--text-faint); font-size: 0.8125rem;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/*
 * The setup key, and the recovery codes.
 *
 * Both are read off the screen and typed or copied somewhere else, so they are
 * set in a monospace face with generous spacing: the failure mode is somebody
 * transcribing one character wrong and concluding the feature is broken.
 */
.secret-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.0625rem; letter-spacing: .12em; font-weight: 600;
  margin: var(--space-2) 0; padding: var(--space-3);
  background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); user-select: all;
  /*
   * Wrap between the groups of four, never inside one. `break-all` split
   * "QHKB X5LK" across a line, which is exactly the transcription error the
   * grouping exists to prevent.
   */
  word-break: normal; overflow-wrap: normal;
}

.recovery-codes {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375rem; letter-spacing: .04em;
}
.recovery-codes li { padding: var(--space-2); background: var(--surface-sunken); border-radius: var(--radius-sm); user-select: all; }
@media (max-width: 520px) { .recovery-codes { grid-template-columns: 1fr; } }

.identity-chip {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-sunken);
}
.identity-chip__label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.identity-chip__value { font-weight: 600; word-break: break-all; }

.method {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}
.method:first-of-type { border-top: 0; }
.method__head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.method__name { font-weight: 600; }
.method form { margin: 0; }

/*
 * The password method's icon: the same padlock as `.lock-mark`, scaled to sit
 * level with the provider marks beside it. Drawn rather than set as a glyph
 * for the reason given above — a character the font lacks becomes a box, and a
 * box on the security page reads as a fault.
 */
.provider-mark--key {
  width: 18px; height: 18px; position: relative; color: var(--text-muted);
}
.provider-mark--key::after {
  content: ''; position: absolute; left: 2px; right: 2px; bottom: 1px;
  height: 9px; border-radius: 2px; background: currentColor;
}
.provider-mark--key::before {
  content: ''; position: absolute; left: 50%; top: 1px;
  width: 10px; height: 8px; box-sizing: border-box;
  border: 2px solid currentColor; border-bottom: 0;
  border-radius: 5px 5px 0 0; transform: translateX(-50%);
}

@media (max-width: 520px) {
  .method { flex-wrap: wrap; }
}

/* --- forms ---------------------------------------------------------------- */

.field { margin-bottom: var(--space-4); }
.field > label, .label {
  display: block; margin-bottom: 5px;
  font-size: 0.8125rem; font-weight: 600; color: var(--text);
}
.field-hint { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--text-faint); }
.field-error { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--danger-600); font-weight: 500; }
/* Three fields on the product form are required and twenty-seven are not, so
   the required ones carry the mark. A dot beside every optional label was
   noise standing in for information. */
.req { color: var(--danger-600); font-weight: 400; margin-left: 2px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], input[type="url"],
select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.9375rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger-600); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-400) 50%), linear-gradient(135deg, var(--ink-400) 50%, transparent 50%); background-position: right 14px center, right 9px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input[type="file"] { font-size: 0.875rem; }
.checkbox { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 0.9375rem; }
.checkbox input { margin-top: 4px; flex: none; width: 16px; height: 16px; accent-color: var(--brand-600); }
.checkbox label { font-weight: 400; margin: 0; }
fieldset {
  border: 0; border-top: 1px solid var(--border);
  padding: var(--space-5) 0 var(--space-2); margin: 0;
}
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend {
  padding: 0; float: left; width: 100%;
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .11em;
  color: var(--text-faint); margin-bottom: var(--space-4);
}
/* `float` above takes the legend out of flow, which is the only reliable way
   to make it behave as an ordinary heading; this puts the fields back below it. */
legend + * { clear: both; }
.input-group { display: flex; gap: var(--space-2); }
.input-group > :first-child { flex: 1; }
.input-group select { width: auto; min-width: 92px; flex: none; }

/* --- cards / panels ------------------------------------------------------- */

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
/* A card sitting directly on the sunken ground needs its own light source or
   it reads as a hole rather than a sheet. */
.card, .panel, .table-wrap { box-shadow: var(--shadow-sm); }
.card-tight { padding: var(--space-4); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.125rem; }
.panel { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); background: var(--surface-sunken); font-weight: 650; font-size: 0.9375rem; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.panel-body { padding: var(--space-4); }
.panel-footer { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); background: var(--surface-sunken); }

/* --- badges / pills ------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 650; line-height: 1.5;
  background: var(--ink-50); color: var(--ink-700); white-space: nowrap;
}
.badge-ok { background: var(--ok-100); color: var(--ok-600); }
.badge-warn { background: var(--warn-100); color: var(--warn-600); }
.badge-danger { background: var(--danger-100); color: var(--danger-600); }
.badge-info { background: var(--info-100); color: var(--info-600); }
.badge-brand { background: var(--brand-100); color: var(--brand-700); }
.badge-lg { font-size: 0.8125rem; padding: 4px 11px; }
.badge { border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 0.8125rem; color: var(--text-muted); background: var(--surface); }
.chip-active { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--brand-ink); }
.chip:hover { text-decoration: none; }

/* Talk-to-a-person block on a product page. Both routes reach the operator,
   never the supplier — the note under the buttons says so, because a buyer
   who expects the factory and gets us would rightly feel misled. */
.direct-contact { border-top: 1px solid var(--border); margin-top: var(--space-3); padding-top: var(--space-3); }
.direct-contact__label {
  display: block; font-size: 0.75rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: var(--space-2);
}
.direct-contact__row { display: flex; gap: var(--space-2); }
.direct-contact__row > .btn { flex: 1; justify-content: center; }
.direct-contact__note { margin: var(--space-2) 0 0; font-size: 0.75rem; color: var(--text-faint); line-height: 1.45; }
.btn-wa { background: #1fa855; border-color: #1fa855; color: #fff; gap: 7px; }
.btn-wa:hover { background: #17904a; border-color: #17904a; color: #fff; }
.btn-wa svg { flex: none; }

/* Active-filter chips. The × is decorative — the label already says what the
   chip removes, and the accessible name is carried by the .sr-only span. */
.filter-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.filter-chips .chip span[aria-hidden] { margin-left: 6px; opacity: .7; }

/* Secondary facets, folded away until the buyer wants them. Kept open by the
   server whenever one of them is set, so a filter is never hidden behind a
   closed disclosure. */
.filter-group { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.filter-group > summary {
  cursor: pointer; font-weight: 600; font-size: 0.9375rem;
  list-style: none; display: flex; align-items: center; gap: var(--space-2);
}
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary::before {
  content: ""; width: 0; height: 0; flex: none;
  border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .15s ease;
}
.filter-group[open] > summary::before { transform: rotate(90deg); }
.filter-group > summary:focus-visible { outline: 2px solid var(--brand-solid); outline-offset: 3px; border-radius: 3px; }
.filter-group > .stack-sm { margin-top: var(--space-3); }
@media (prefers-reduced-motion: reduce) { .filter-group > summary::before { transition: none; } }

/* --- alerts --------------------------------------------------------------- */

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  margin-bottom: var(--space-4);
}
.alert-info { background: var(--info-100); border-color: color-mix(in srgb, var(--info-600) 25%, transparent); color: var(--info-600); }
.alert-ok { background: var(--ok-100); border-color: color-mix(in srgb, var(--ok-600) 25%, transparent); color: var(--ok-600); }
.alert-warn { background: var(--warn-100); border-color: color-mix(in srgb, var(--warn-600) 30%, transparent); color: var(--warn-600); }
.alert-danger { background: var(--danger-100); border-color: color-mix(in srgb, var(--danger-600) 25%, transparent); color: var(--danger-600); }
.alert strong { font-weight: 700; }
.alert p:last-child { margin-bottom: 0; }
.alert ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }

/* --- tables --------------------------------------------------------------- */

/*
 * `position: relative` is load-bearing, not decoration.
 *
 * Overflow does not clip an absolutely positioned descendant whose containing
 * block sits outside the scroller. `.sr-only` is `position: absolute`, so
 * every visually-hidden label inside a wide table was laid out against the
 * document at its static position — out at x=1228 on the users console — and
 * dragged the whole page sideways with it. The table scrolled correctly; the
 * label it contained did not, and a phone showed 838px of empty space beside
 * every screen.
 *
 * Making the wrapper a containing block puts those descendants back inside the
 * box that clips them.
 */
.table-wrap {
  position: relative;
  overflow-x: auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }

/*
 * On a phone, `width: 100%` makes a five-column table squeeze rather than
 * scroll: a product name broke to one word per line and a single row grew to
 * roughly 500px tall. .table-wrap already scrolls, so the fix is to stop the
 * table shrinking into it and let it keep a legible width.
 */
@media (max-width: 720px) {
  /*
   * `max-content` rather than a magic pixel width: the table takes whatever its
   * longest cell needs and the wrapper scrolls, so a long product title stays on
   * one or two lines instead of breaking to one word per line. `min-width: 100%`
   * keeps a short table filling the screen rather than shrinking to its content.
   */
  .table-wrap table { width: max-content; min-width: 100%; }
}
thead th {
  text-align: left; padding: var(--space-3) var(--space-4);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); background: var(--surface-sunken);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-sunken); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- catalogue ------------------------------------------------------------ */

.hero {
  /*
   * A flat two-stop gradient read as a coloured rectangle. The off-centre
   * radial highlight gives the surface somewhere to come from, and keeps the
   * panel on the right from looking pasted onto flat ground.
   */
  position: relative; isolation: isolate;
  /*
   * Every colour here is derived from --hero-ink, so the same rules work with
   * dark type on a light ground and light type on a dark one. Hardcoded white
   * alphas were invisible the moment the hero went light.
   */
  background:
    radial-gradient(80% 60% at 82% 0%, color-mix(in srgb, var(--brand-500) 12%, transparent) 0%, transparent 66%),
    linear-gradient(180deg, var(--hero-from) 0%, var(--hero-mid) 55%, var(--hero-to) 100%);
  color: var(--hero-ink);
  padding: calc(var(--space-8) + var(--space-6)) 0 var(--space-8);
  border-bottom: 1px solid color-mix(in srgb, var(--hero-ink) 8%, transparent);
}
/* A barely-there dot grid, so the ground is a surface rather than a fill. */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--hero-ink) 12%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(110% 90% at 86% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(110% 90% at 86% 0%, #000 0%, transparent 62%);
  opacity: .35;
}
.hero > * { position: relative; }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--space-8);
  align-items: center;
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--space-6); }
}
.hero h1 {
  font-size: var(--text-display); color: var(--hero-ink); max-width: 16ch;
  font-weight: 650; letter-spacing: -0.042em; line-height: 1.03;
}
.hero p { font-size: var(--text-lead); max-width: 50ch; color: color-mix(in srgb, var(--hero-ink) 72%, transparent); line-height: 1.45; }

/* The "how it works" panel filling what used to be empty ground. */
.hero__flow {
  background: var(--surface-raised);
  border: 1px solid color-mix(in srgb, var(--hero-ink) 10%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.hero .hero__flow-title {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.11em; font-weight: 700;
  color: var(--text-faint); max-width: none;
  margin: 0 0 var(--space-4);
}
.hero__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.hero__steps li { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 0.9375rem; line-height: 1.5; }
.hero__steps strong { color: var(--text); font-weight: 600; }
.hero__steps li > span:last-child { color: var(--text-muted); }
.hero__step-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-solid); border: 0;
  font-size: 0.75rem; font-weight: 650; color: var(--brand-ink);
}
.hero__flow-foot {
  margin: var(--space-5) 0 0 !important; padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: 0.8125rem !important;
  color: var(--text-faint) !important;
}
.hero .btn-secondary {
  background: transparent;
  border-color: color-mix(in srgb, var(--hero-ink) 22%, transparent);
  color: var(--hero-ink);
}
.hero .btn-secondary:hover { background: color-mix(in srgb, var(--hero-ink) 7%, transparent); color: var(--hero-ink); }

/* A ring plus the border, rather than a border colour change alone: on a pale
   field the colour swap alone is easy to miss. */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}

.search-bar { display: flex; gap: var(--space-2); }
.search-bar input { flex: 1; }
.hero .search-bar { margin-top: var(--space-5); max-width: 560px; }
.hero .search-bar input {
  border-color: var(--border-strong); border-radius: var(--radius-pill);
  padding: 14px 22px; font-size: 1.0625rem;
  background: var(--surface-raised); box-shadow: var(--shadow-sm);
}

/* --- the three entry points ------------------------------------------------ */

.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 860px) { .doors { grid-template-columns: 1fr; } }
.door {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-6);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.door { box-shadow: var(--shadow-sm); }
.door:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--brand-500) 55%, var(--border));
  box-shadow: var(--shadow-lg); transform: translateY(-3px);
}
.door__kicker { color: var(--brand-600); }
.door__kicker { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--text-faint); }
.door__title { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.015em; }
.door__body { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.55; }
.door__cta { margin-top: auto; padding-top: var(--space-3); font-weight: 650; color: var(--brand-600); font-size: 0.9375rem; }
/* The staff entrance is a door, not an invitation: same shape, less pull. */
.door--staff { background: var(--surface-sunken); }
.door--staff .door__title { font-size: 1rem; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-4); }
.product-card {
  display: flex; flex-direction: column;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.product-card { box-shadow: var(--shadow-sm); }
.product-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--brand-500) 40%, var(--border));
  transform: translateY(-3px); text-decoration: none;
}
.product-card__media {
  aspect-ratio: 16 / 10; position: relative; overflow: hidden;
  /*
   * Most listings have no photograph yet, so this panel is what a buyer
   * actually sees five times down the page. A near-white gradient made the
   * catalogue look broken rather than young; committing to the brand tint
   * makes the grid look designed. Drawn in CSS — no request, and it survives
   * inside the offline bundle. A real photograph covers all of it.
   */
  background:
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--brand-700) 9%, transparent) 0 1px,
      transparent 1px 10px
    ),
    linear-gradient(145deg,
      color-mix(in srgb, var(--brand-500) 26%, var(--surface)) 0%,
      color-mix(in srgb, var(--brand-500) 13%, var(--surface)) 52%,
      color-mix(in srgb, var(--brand-500) 6%, var(--surface)) 100%);
}
.product-card__media::after {
  /* Only the hairline where the image meets the card body. An inner glow here
     was fine over a placeholder and tinted every real photograph. */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 -1px 0 var(--border);
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
/*
 * --text-faint, not --ink-300: the raw ink scale inverts between themes, so in
 * dark mode --ink-300 is the darker end and these initials sat at 2.89:1 on the
 * card. The semantic token stays a readable foreground in both.
 */
.product-card__placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center; align-content: center; gap: var(--space-2);
  color: color-mix(in srgb, var(--brand-700) 78%, transparent);
  font-size: 1.25rem; font-weight: 700; letter-spacing: .2em;
}
/* A faint rule under the initials so the tile reads as a deliberate placeholder. */
.product-card__placeholder::after {
  content: ''; width: 26px; height: 2px; border-radius: 1px;
  background: color-mix(in srgb, var(--brand-700) 55%, transparent);
}
.product-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.product-card__title { font-weight: 600; color: var(--text); font-size: 0.9375rem; line-height: 1.35; letter-spacing: -0.012em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__meta { font-size: 0.8125rem; color: var(--text-faint); display: flex; gap: var(--space-2); flex-wrap: wrap; }
.product-card__price {
  margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border);
  font-weight: 700; color: var(--brand-600); font-size: 0.9375rem;
}
.product-card__price .rfq { color: var(--text-muted); font-weight: 600; font-size: 0.875rem; }

.gallery { display: grid; gap: var(--space-3); }
.gallery__main {
  aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  /* Same tinted weave as the card placeholders — a plain grey box here made the
     product page look like the image had failed to load. */
  background:
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--brand-700) 9%, transparent) 0 1px,
      transparent 1px 10px
    ),
    linear-gradient(145deg,
      color-mix(in srgb, var(--brand-500) 22%, var(--surface)) 0%,
      color-mix(in srgb, var(--brand-500) 8%, var(--surface)) 100%);
}
/*
 * With no photograph there is nothing to show at 4:3, and half a screen of
 * empty grey above the description made the page look broken rather than
 * merely incomplete. The placeholder keeps its place in the layout at a
 * fraction of the height.
 */
.gallery__main.product-card__placeholder { aspect-ratio: 16 / 5; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--space-2); }
.gallery__thumbs img { aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.spec-table { width: 100%; font-size: 0.9375rem; border-collapse: collapse; }
.spec-table th { text-align: left; padding: 7px 0; color: var(--text-muted); font-weight: 500; width: 45%; vertical-align: top; text-transform: none; letter-spacing: 0; font-size: 0.9375rem; background: none; border: 0; }
.spec-table td { padding: 7px 0; border-bottom: 1px solid var(--border); font-weight: 500; }
.spec-table tr:last-child td, .spec-table tr:last-child th { border-bottom: 0; }

.sticky-aside { position: sticky; top: 84px; }

/* --- steps / marketing ---------------------------------------------------- */

.steps { counter-reset: step; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.step { position: relative; padding-top: var(--space-5); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-100); color: var(--brand-700);
  display: grid; place-items: center; font-weight: 700; font-size: 0.8125rem;
}
.step h2, .step h3 { font-size: 1rem; margin-bottom: var(--space-1); }
.step p { font-size: 0.9375rem; color: var(--text-muted); margin: 0; }

/* The figure is the content, so it gets the weight and the brand colour; the
   label above it is a caption and reads like one. The rule on the left ties
   the four together as one instrument rather than four boxes. */
.stat {
  position: relative; overflow: hidden;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.stat::before { content: none; }
.stat__label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); font-weight: 700; }
.stat__value { font-size: 2rem; font-weight: 650; line-height: 1.1; margin-top: 6px; letter-spacing: -0.035em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__hint { font-size: 0.8125rem; color: var(--text-muted); }

/* --- console (seller / operator) ------------------------------------------ */

.console { display: grid; grid-template-columns: 216px 1fr; min-height: calc(100vh - 64px); }
@media (max-width: 860px) {
  /*
   * `auto 1fr`, not just one column: the grid still carries a min-height, and
   * without explicit rows it shares the leftover space between the nav and the
   * page — which stretched a one-line nav strip to fill half the screen.
   */
  .console { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
}
/*
 * Narrow screens: the sidebar becomes a scrolling strip.
 *
 * Collapsing the grid to one column alone stacks the whole menu above the
 * page, which on a phone meant scrolling past eleven links and four section
 * headings — roughly 1150px — to reach the content, on every single page. As a
 * single scrolling row it costs about 48px and keeps the current page visible.
 * The section headings are the casualty; they are orientation for a sidebar and
 * noise in a strip.
 */
@media (max-width: 860px) {
  .console-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: var(--space-2) var(--space-3);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
    scrollbar-width: thin;
  }
  .console-nav__section { display: none; }
  .console-nav a { flex: none; white-space: nowrap; padding: 8px var(--space-3); }
  /* The count sat to the far right of a full-width row; inline it here. */
  .console-nav .count { margin-left: var(--space-1); }
}

/*
 * Narrow screens: the public header wraps to two rows.
 *
 * The three-column flex (brand · nav · actions) had nowhere to go at 390px and
 * squeezed the four nav links into a tall column between the brand and the
 * sign-in buttons — about 280px of an 844px screen before any content. Brand and
 * account actions keep the first row; the nav drops to its own scrolling row.
 */
@media (max-width: 720px) {
  .site-header .container {
    flex-wrap: wrap;
    gap: var(--space-3);
    min-height: 0;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
  }
  .site-header .spacer { display: none; }
  .site-header .brand { margin-right: auto; }
  .site-nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    gap: var(--space-4);
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
}

.console-nav {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: var(--space-5) var(--space-3);
}
.console-nav__section { font-size: 0.6875rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); margin: var(--space-4) var(--space-3) var(--space-2); }
.console-nav__section:first-child { margin-top: 0; }
.console-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 7px var(--space-3); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.9375rem; font-weight: 500;
}
.console-nav a:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }
.console-nav a[aria-current="page"] { background: var(--brand-100); color: var(--brand-700); font-weight: 650; }
.console-nav .count { font-size: 0.75rem; font-weight: 700; color: var(--text-faint); }
.console-main { padding: var(--space-6); min-width: 0; background: var(--surface-sunken); }
@media (max-width: 860px) { .console-main { padding: var(--space-4); } }
.console-main > .page-head { margin-bottom: var(--space-5); }
.page-head h1 { font-size: 1.5rem; margin-bottom: var(--space-1); }
.page-head p { color: var(--text-muted); margin: 0; }

/* --- message threads ------------------------------------------------------ */

.thread { display: flex; flex-direction: column; gap: var(--space-3); max-height: 460px; overflow-y: auto; padding: var(--space-1); }
.message { display: flex; flex-direction: column; gap: 3px; max-width: 76%; }
.message__bubble { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); border: 1px solid var(--border); font-size: 0.9375rem; white-space: pre-wrap; word-break: break-word; }
.message__meta { font-size: 0.75rem; color: var(--text-faint); }
.message--mine { align-self: flex-end; align-items: flex-end; }
.message--mine .message__bubble { background: var(--brand-100); border-color: color-mix(in srgb, var(--brand-500) 25%, transparent); }
.message--system { align-self: center; max-width: 100%; }
.message--system .message__bubble { background: transparent; border: 0; border-top: 1px dashed var(--border-strong); border-bottom: 1px dashed var(--border-strong); border-radius: 0; color: var(--text-faint); font-size: 0.8125rem; text-align: center; }
.channel-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); }
.channel-tabs a { padding: var(--space-2) var(--space-4); font-size: 0.875rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.channel-tabs a[aria-current="page"] { color: var(--brand-600); border-bottom-color: var(--brand-600); }
.channel-tabs a:hover { text-decoration: none; color: var(--text); }

/* --- confidential blocks -------------------------------------------------- */

/* Anything visually marked confidential is operator-only in the templates too. */
.confidential {
  border: 1px solid color-mix(in srgb, var(--accent-600) 40%, transparent);
  background: var(--accent-100);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.confidential__label {
  font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-600); display: flex; align-items: center; gap: 5px; margin-bottom: var(--space-2);
}
.margin-figure { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.margin-figure div { min-width: 92px; }
.margin-figure dt { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 650; }
.margin-figure dd { margin: 0; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.margin-figure .is-negative { color: var(--danger-600); }
.margin-figure .is-positive { color: var(--ok-600); }

/* --- misc ----------------------------------------------------------------- */

.empty-state { text-align: center; padding: var(--space-7) var(--space-4); color: var(--text-muted); }
.empty-state h2, .empty-state h3 { color: var(--text); }
.pagination { display: flex; gap: var(--space-2); align-items: center; justify-content: center; margin-top: var(--space-6); }
.pagination .current { font-size: 0.875rem; color: var(--text-muted); }
.breadcrumb { font-size: 0.875rem; color: var(--text-faint); margin-bottom: var(--space-3); display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.legal-doc { max-width: 76ch; }
.legal-doc h2 { margin-top: var(--space-6); font-size: 1.15rem; }
.legal-doc h3 { margin-top: var(--space-5); font-size: 1rem; }
.legal-doc table { margin-bottom: var(--space-4); }
.legal-doc td, .legal-doc th { border: 1px solid var(--border); padding: var(--space-2) var(--space-3); }
.legal-doc ul, .legal-doc ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.legal-doc li { margin-bottom: var(--space-1); }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.doc-list li:last-child { border-bottom: 0; }
.doc-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--ink-50); color: var(--text-muted); display: grid; place-items: center; font-size: 0.6875rem; font-weight: 800; flex: none; }
/*
 * Available to a screen reader, absent for everyone else. Used where the visual
 * design carries meaning that markup otherwise loses — a search box whose
 * purpose is obvious from its position and placeholder, but which a screen
 * reader would announce as an unnamed edit field.
 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--space-4); top: var(--space-2); z-index: 100; background: var(--surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); box-shadow: var(--shadow); }

@media print {
  .site-header, .site-footer, .btn, .console-nav { display: none !important; }
  body { background: #fff; }
}

/* --- demo mode ------------------------------------------------------------- */

/* Present on a review copy only. It says who you are and lets you change which
   console you are standing in, which is the whole point of the guest door. */
.demo-bar {
  background: var(--surface-raised); color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem; position: relative; z-index: 50;
}
.demo-bar__inner { display: flex; align-items: center; gap: var(--space-4); min-height: 38px; flex-wrap: wrap; }
.demo-bar__label { display: flex; align-items: baseline; gap: var(--space-2); }
.demo-bar__label strong { font-weight: 600; color: var(--text); }
.demo-bar__hint { color: var(--text-faint); }
.demo-bar__roles { display: flex; gap: 4px; margin-left: auto; }
.demo-bar__role {
  font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  padding: 3px 12px; border-radius: var(--radius-pill);
  background: transparent; border: 1px solid transparent; color: var(--text-muted);
}
.demo-bar__role:hover { background: var(--ink-50); color: var(--text); }
.demo-bar__role.is-current {
  background: var(--ink-900); color: var(--surface); border-color: var(--ink-900); font-weight: 600;
}
.demo-bar__role:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.guest-card { border-color: color-mix(in srgb, var(--brand-500) 40%, var(--border)); }
.guest-card__tag {
  display: inline-block; font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--brand-600); background: var(--brand-100);
  border-radius: 999px; padding: 3px 10px;
}

input[type="file"] {
  width: 100%; font: inherit; font-size: 0.9375rem; color: var(--text-muted);
  padding: 7px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-sunken); cursor: pointer;
}
input[type="file"]:hover { border-color: var(--brand-500); color: var(--text); }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer;
  margin-right: var(--space-3); padding: 6px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text);
}
input[type="file"]::file-selector-button:hover { border-color: var(--ink-300); }

/*
 * Card meta on one line, and the minimum order is the part that gives way.
 *
 * Clipping the whole row cut words in half — "870 kutu" became "870 kutı" —
 * which reads as a rendering fault rather than as a shortened line. The
 * reference, the verified mark and the origin are short and fixed, so the
 * quantity is the only thing that can be long: it gets the ellipsis, and the
 * full figure is on the product page a click away.
 */
.product-card__meta {
  min-height: 1.35rem;
  flex-wrap: nowrap; white-space: nowrap; overflow: hidden;
}
.product-card__meta > * { flex: none; }
.product-card__meta > :last-child { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }

/* The "fill this in from your own document" panel, above the product form. */
.import-card {
  border-color: var(--border);
  background: var(--surface-sunken);
  box-shadow: none;
  margin-bottom: var(--space-5);
}
.import-card textarea { min-height: 0; font-family: var(--mono); font-size: 0.8125rem; }

/* ---------------------------------------------------------------------------
   The commission statement document
   -------------------------------------------------------------------------*/

/*
 * Built to be printed or saved as PDF, so it is laid out in absolute units and
 * carries its own print rules. An operator will send this to a supplier, and a
 * document that reflows differently on their machine than on the screen it was
 * checked on is a document that gets sent wrong once.
 */
.doc-body { background: var(--surface-sunken); padding: var(--space-6) 0; }

.doc {
  max-width: 780px; margin: 0 auto; padding: 48px;
  background: #ffffff; color: #111113;
  border: 1px solid var(--border); border-radius: var(--radius);
  position: relative;
}
.doc h1 { font-size: 1.5rem; margin: 0 0 4px; color: #111113; }
.doc__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-5); margin-bottom: 40px; }
.doc__ref { font-size: 1rem; color: #55555c; }
.doc__dates { text-align: right; font-size: 0.875rem; line-height: 1.7; }
.doc__label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .06em; color: #6b6b73; }
.doc__parties { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); margin-bottom: 40px; }
.doc__party { margin-top: 6px; line-height: 1.6; font-size: 0.9375rem; }

.doc__lines { width: 100%; border-collapse: collapse; margin-bottom: var(--space-5); }
.doc__lines th, .doc__lines td { padding: 12px 0; border-bottom: 1px solid #e6e6ea; text-align: left; color: #111113; }
.doc__lines .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc__lines tfoot th { border-bottom: 0; border-top: 2px solid #111113; font-size: 1.0625rem; }

.doc__notes { font-size: 0.9375rem; color: #3f3f46; }
.doc__disclaimer {
  margin-top: 40px; padding-top: var(--space-4); border-top: 1px solid #e6e6ea;
  font-size: 0.8125rem; color: #55555c; line-height: 1.6;
}

/* Stamped across the page, and deliberately not clickable or selectable. */
.doc__stamp {
  position: absolute; top: 40%; left: 50%;
  transform: translate(-50%, -50%) rotate(-14deg);
  font-size: 4rem; font-weight: 800; letter-spacing: .1em;
  color: rgba(22, 130, 74, .16); pointer-events: none; user-select: none;
}
.doc__stamp--void { color: rgba(190, 40, 40, .16); }

@media print {
  .doc-body { background: #ffffff; padding: 0; }
  .doc { border: 0; border-radius: 0; max-width: none; padding: 0; }
  @page { margin: 18mm; }
}

@media (max-width: 640px) {
  .doc { padding: var(--space-5); }
  .doc__head, .doc__parties { grid-template-columns: 1fr; flex-direction: column; }
  .doc__dates { text-align: left; }
}
