/* Supplier Finder. Graphite control rail on the left, concrete sheet with supplier cards on the right.
   Single deliberate light theme carried over from the approved mockup. */
:root {
  --concrete: #e7e5e1; --sheet: #ffffff; --sheet-dim: #f3f2ef;
  --graphite: #24282d; --graphite-2: #31363d; --rule: #3d434a;
  --steel: #6f7a82; --steel-light: #cfd4d8; --hair: #d9dcdf;
  --oxide: #9a3a1f; --oxide-wash: #f7ece8; --oxide-light: #f0b7a6;
  --pine: #2f6b4a; --pine-wash: #e6f0ea;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Barlow', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--concrete); }
body { color: var(--graphite); font: 15px/1.5 var(--text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--oxide); outline-offset: 2px; }
.muted { color: var(--steel); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.btn { font-family: var(--cond); font-weight: 700; font-size: 20px; background: var(--oxide); color: #fff; border: 0; padding: 10px 24px; cursor: pointer; }
.btn:hover { background: #7f2f18; }

/* Top bar */
.topbar { background: var(--graphite); color: #fff; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--rule); }
.brand { font-family: var(--cond); font-weight: 700; font-size: 24px; text-decoration: none; }
.brand span { font-family: var(--text); font-weight: 400; font-size: 13px; color: var(--steel-light); margin-left: 10px; }
.topnav { display: flex; align-items: center; gap: 18px; font-size: 14px; color: var(--steel-light); }
.topnav a, .topnav .link-btn { color: var(--steel-light); }
.topnav a:hover, .topnav .link-btn:hover { color: #fff; }
.topnav form { display: inline; }

.messages { list-style: none; padding: 0; }
.message { padding: 10px 24px; background: var(--pine-wash); color: var(--pine); font-weight: 500; border-bottom: 1px solid #c9ddd0; }
.message-error { background: var(--oxide-wash); color: var(--oxide); }

/* Layout */
.app { flex: 1; display: grid; grid-template-columns: 360px minmax(0, 1fr); }
.rail { background: var(--graphite); color: #fff; padding: 28px 24px 32px; display: flex; flex-direction: column; gap: 28px; }
.rail h2 { font-family: var(--cond); font-weight: 600; font-size: 20px; }
.rail .hint { color: var(--steel-light); font-size: 13px; }
.step, .rail-form { display: flex; flex-direction: column; gap: 10px; }
.rail-form { gap: 28px; }
.rail-error { color: var(--oxide-light); font-size: 13px; }

.search { position: relative; }
.search input { width: 100%; background: var(--graphite-2); border: 1px solid var(--rule); color: #fff; padding: 12px 14px; font-size: 16px; }
.search input::placeholder { color: #8d969d; }
.search input:focus { outline: none; border-color: var(--oxide); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--sheet); color: var(--graphite); z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.35); list-style: none; padding: 0; }
.suggest button { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--hair); padding: 10px 14px; cursor: pointer; }
.suggest button:hover, .suggest button.is-active { background: var(--oxide-wash); }
.suggest b { font-weight: 600; }
.suggest .code { font-weight: 600; color: var(--oxide); }
.suggest small { grid-column: 1 / -1; color: var(--steel); font-size: 12.5px; }
.suggest .none { padding: 12px 14px; color: var(--steel); font-size: 14px; }

.saved { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.saved li { display: flex; align-items: stretch; border: 1px solid var(--rule); }
.saved a { color: var(--steel-light); padding: 4px 10px; font-size: 13px; text-decoration: none; }
.saved a:hover { color: #fff; }
.saved button { background: none; border: 0; border-left: 1px solid var(--rule); color: #8d969d; padding: 0 8px; cursor: pointer; }
.saved button:hover { color: #fff; }
.saved li.is-on { background: #fff; border-color: #fff; }
.saved li.is-on a { color: var(--graphite); font-weight: 600; }
.saved li.is-on button { color: var(--steel); border-color: var(--hair); }

.lines { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.lines label { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); cursor: pointer; font-size: 14px; }
.lines input { accent-color: var(--oxide); margin-top: 3px; }
.lines .c { font-weight: 600; display: block; }
.lines .d { color: var(--steel-light); font-size: 13px; }
.lines .r { font-family: var(--cond); font-weight: 700; font-size: 18px; color: var(--oxide-light); }

.field { display: grid; gap: 4px; font-size: 13px; color: var(--steel-light); }
.field .box { display: flex; align-items: center; background: var(--graphite-2); border: 1px solid var(--rule); }
.field .box:focus-within { border-color: var(--oxide); }
.field input { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; padding: 10px 12px; font-size: 16px; }
.field input::placeholder { color: #6c757c; }
.field input:focus { outline: none; }
.field .unit { padding: 0 12px; color: #8d969d; font-size: 13px; white-space: nowrap; }
.btn-rail { align-self: flex-start; font-size: 18px; padding: 8px 20px; }
.calc { border-top: 1px solid var(--rule); font-size: 14px; }
.calc div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.calc dt { color: var(--steel-light); }
.calc dd { font-weight: 600; }
.calc .total dd { color: var(--oxide-light); }
.src { margin-top: auto; font-size: 12px; color: #8d969d; }
.src a { color: var(--steel-light); }

/* Main */
.main { padding: 32px 40px 56px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: end; }
.head h1 { font-family: var(--cond); font-weight: 700; font-size: 46px; line-height: 1; text-wrap: balance; }
.head .sub { color: var(--steel); margin-top: 6px; }
.head form { margin-top: 6px; }
.saved-note { font-size: 14px; }
.tariff-tag { text-align: right; max-width: 280px; }
.tariff-tag .t-rate { display: block; font-family: var(--cond); font-weight: 700; font-size: 28px; line-height: 1.1; color: var(--oxide); }
.tariff-tag .t-none { display: block; font-family: var(--cond); font-weight: 600; font-size: 22px; color: var(--steel); }
.tariff-tag .t-pick { display: block; font-size: 14px; color: var(--steel); }
.tariff-tag small { color: var(--steel); font-size: 13px; }

.toolbar { border-bottom: 2px solid var(--graphite); padding-bottom: 10px; }
.toolbar h2 { font-family: var(--cond); font-weight: 600; font-size: 24px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.sup { background: var(--sheet); display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.sup-main { padding: 18px 22px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.sup-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.sup h3 { font-family: var(--cond); font-weight: 600; font-size: 26px; line-height: 1.1; }
.where { color: var(--steel); font-size: 14px; }
.origin { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.origin::before { content: ''; width: 8px; height: 8px; background: var(--pine); flex-shrink: 0; }
.origin.warn { color: var(--oxide); font-weight: 600; }
.origin.warn::before { background: var(--oxide); }
.makes { font-size: 15px; font-weight: 500; }
.makes span { color: var(--steel); font-weight: 400; margin-left: 6px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; border-top: 1px solid var(--hair); padding-top: 10px; }
.facts dt { font-size: 12px; color: var(--steel); }
.facts dd { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.na { color: var(--steel); font-weight: 400; }
.note { font-size: 13px; color: var(--steel); }
.sup-cost { background: var(--sheet-dim); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.sup-cost .price { font-size: 13px; color: var(--steel); }
.sup-cost .price b { color: var(--graphite); font-size: 15px; font-weight: 600; }
.delta { font-family: var(--cond); font-weight: 700; font-size: 32px; line-height: 1; }
.delta.save { color: var(--pine); }
.delta.more { color: var(--oxide); }
.delta.even, .delta.na-big { color: var(--steel); font-size: 22px; line-height: 1.15; }
.delta-sub { font-size: 13px; color: var(--steel); }
.delta-sub b { color: var(--graphite); font-weight: 600; }
.dated { font-size: 12px; color: var(--steel); border-top: 1px solid var(--hair); padding-top: 8px; }
.ask { margin-top: auto; display: block; text-align: center; font-weight: 600; font-size: 14px; background: var(--graphite); color: #fff; padding: 9px 12px; text-decoration: none; }
.ask:hover { background: var(--graphite-2); }
.contact { font-size: 12px; color: var(--steel); overflow-wrap: anywhere; }
.contact .sel { user-select: all; }
.empty { background: var(--sheet); padding: 28px; color: var(--steel); }

.empty-state { background: var(--sheet); padding: 32px; display: grid; gap: 14px; max-width: 760px; }
.empty-state h1 { font-family: var(--cond); font-weight: 700; font-size: 42px; line-height: 1; }
.empty-state p { max-width: 62ch; }
.empty-state h2 { font-family: var(--cond); font-weight: 600; font-size: 22px; margin-top: 10px; }
.catalog { list-style: none; padding: 0; border-top: 1px solid var(--hair); }
.catalog a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); text-decoration: none; }
.catalog a:hover b { color: var(--oxide); }
.catalog span { color: var(--steel); }

/* Login and upload */
.narrow { flex: 1; padding: 48px 16px; display: flex; justify-content: center; align-items: flex-start; }
.sheet { background: var(--sheet); padding: 32px; width: min(560px, 100%); display: grid; gap: 14px; }
.sheet h1 { font-family: var(--cond); font-weight: 700; font-size: 38px; line-height: 1; }
.stack { display: grid; gap: 8px; }
.stack label { font-size: 14px; font-weight: 500; }
.stack input[type=text], .stack input[type=password] { border: 1px solid var(--hair); padding: 10px 12px; font-size: 16px; }
.stack input[type=file] { padding: 10px 0; }
.stack .btn { justify-self: start; margin-top: 8px; }
.error { color: var(--oxide); }
.problems { background: var(--oxide-wash); color: var(--oxide); padding: 14px 16px; }
.problems ul { margin-top: 8px; padding-left: 20px; display: grid; gap: 4px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { padding: 24px 16px; }
  .main { padding: 24px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .head { grid-template-columns: 1fr; }
  .head h1 { font-size: 36px; }
  .tariff-tag { text-align: left; }
  .sup { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
