:root {
  --bg: #0f1114;
  --bg2: #161a1f;
  --panel: #1c2128;
  --line: #2a313a;
  --text: #e8e6e1;
  --muted: #9aa1ab;
  --gold: #c9a24a;
  --gold-2: #e0bc68;
  --ok: #5fb37a;
  --err: #e0675f;
  --warn: #d9a43c;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h2 { font-size: 1.35rem; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 760px; }

/* header */
.top { background: #0a0b0d; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { font-weight: 800; letter-spacing: .12em; color: var(--text); font-size: 1.15rem; white-space: nowrap; }
.logo span { color: var(--gold); }
.logo:hover { text-decoration: none; }
.top-search { flex: 1; display: flex; max-width: 520px; }
.top-search input { flex: 1; min-width: 0; }
.top-search button { border-radius: 0 6px 6px 0; }
.top-search input { border-radius: 6px 0 0 6px; }
.top-nav { display: flex; gap: 18px; margin-left: auto; }
.top-nav a { color: var(--text); font-size: .95rem; white-space: nowrap; }
.top-nav a[aria-current] { color: var(--gold-2); }

/* controls */
input, select, textarea {
  width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
button { font: inherit; cursor: pointer; }
.top-search button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 6px; border: 1px solid transparent; font-weight: 600; white-space: nowrap;
}
.top-search button { background: var(--gold); color: #111; border: 0; }
.btn-gold { background: var(--gold); color: #111; }
.btn-gold:hover { background: var(--gold-2); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }

/* hero */
.hero { padding: 72px 0 56px; background: radial-gradient(1200px 400px at 20% 0%, #2a2414 0%, transparent 60%), var(--bg); border-bottom: 1px solid var(--line); }
.hero-search { display: grid; grid-template-columns: 1fr 220px auto; gap: 10px; margin-top: 24px; max-width: 880px; }
.hero-alt { margin-top: 14px; color: var(--muted); }

/* blocks & tiles */
.block { padding: 44px 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.tile:hover { border-color: var(--gold); text-decoration: none; }
.tile span { color: var(--muted); font-size: .9rem; }
.steps ol { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; counter-increment: s; display: flex; flex-direction: column; gap: 6px; }
.steps li::before { content: counter(s); color: var(--gold); font-weight: 800; font-size: 1.4rem; }
.steps li span { color: var(--muted); }
.cta-supplier, .rfq-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 24px; }
.cta-supplier { margin-bottom: 48px; }
.cta-supplier p, .rfq-banner p { margin: 0; color: var(--muted); }

/* page head */
.page-head { padding-top: 24px; padding-bottom: 8px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs .sep { color: var(--line); }

/* listing */
.listing { display: grid; grid-template-columns: 270px 1fr; gap: 24px; padding-bottom: 56px; align-items: start; }
.filters-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.filters-box summary { font-weight: 700; cursor: pointer; list-style: none; margin-bottom: 10px; }
.filters-box summary::-webkit-details-marker { display: none; }
.active-count { color: var(--gold); }
.kw { display: block; margin-bottom: 14px; }
.kw span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.fgroup { border: 0; border-top: 1px solid var(--line); padding: 12px 0 6px; margin: 0; }
.fgroup legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 6px; }
.fgroup.inline { border-top: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; font-size: .95rem; }
.opt input { width: auto; accent-color: var(--gold); }
.opt em { color: var(--muted); font-style: normal; font-size: .85rem; margin-left: auto; }
.opt.dim { opacity: .4; }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.results-bar p { margin: 0; }
.sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.sort select { width: auto; padding: 6px 10px; }
.cards { display: flex; flex-direction: column; gap: 12px; }
.card { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card:hover { border-color: #3a434e; }
.card-logo { width: 64px; height: 64px; border-radius: 8px; background: #2a2414; color: var(--gold-2); display: grid; place-items: center; font-weight: 800; letter-spacing: .05em; }
.card-logo.big { width: 84px; height: 84px; font-size: 1.4rem; }
.card-title { font-size: 1.15rem; margin: 0 0 4px; }
.card-title a { color: var(--text); }
.card-loc { margin: 0 0 8px; color: var(--muted); font-size: .95rem; }
.flag { display: inline-block; font-size: .72rem; font-weight: 700; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-right: 4px; color: var(--text); }
.facts { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .9rem; color: var(--muted); }
.facts b { color: var(--text); font-weight: 600; margin-right: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.badge { font-size: .72rem; vertical-align: middle; background: var(--gold); color: #111; border-radius: 4px; padding: 2px 6px; font-weight: 700; }
.card-desc { margin: 0 0 6px; }
.card-apps { margin: 0; font-size: .9rem; color: var(--muted); }
.card-apps b { color: var(--text); font-weight: 600; }
.card-actions { display: flex; flex-direction: column; gap: 8px; min-width: 170px; }
.empty { text-align: center; padding: 40px 20px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.rfq-banner { margin-top: 20px; }

/* profile */
.profile { display: grid; grid-template-columns: 1fr 320px; gap: 28px; padding-bottom: 24px; }
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 24px; }
.profile-head h1 { margin-bottom: 4px; }
.facts-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.facts-table th, .facts-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts-table th { width: 200px; color: var(--muted); font-weight: 500; }
.side-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.profile-side { position: sticky; top: 80px; align-self: start; }

/* forms */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 56px; }
.form label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.form label input, .form label select, .form label textarea { margin-top: 4px; color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.check { display: flex !important; gap: 10px; align-items: flex-start; }
.check input { width: auto; margin-top: 4px; accent-color: var(--gold); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.form-msg { min-height: 1.4em; margin: 10px 0 0; font-weight: 600; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--err); }
.form-msg.warn { color: var(--warn); }

/* modal */
.modal { width: min(760px, 94vw); max-height: 92vh; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.modal::backdrop { background: rgba(0, 0, 0, .7); }
.modal-close-form { position: absolute; right: 12px; top: 8px; margin: 0; }
.modal-x { background: none; border: 0; color: var(--muted); font-size: 1.8rem; line-height: 1; }
.modal h2 { padding-right: 30px; }

/* prose & footer */
.prose { padding-bottom: 56px; }
.prose h2 { margin-top: 1.6em; }
.foot { border-top: 1px solid var(--line); background: #0a0b0d; padding: 36px 0 20px; margin-top: 20px; }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.foot-in p { color: var(--muted); font-size: .9rem; max-width: 360px; }
.foot-in h4 { margin: 0 0 8px; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.foot-in a:not(.logo) { display: block; color: var(--text); font-size: .95rem; margin-bottom: 4px; }
.foot-meta { color: var(--muted); font-size: .8rem; margin-top: 24px; }

/* responsive */
@media (max-width: 960px) {
  .top-nav { gap: 12px; }
  .top-nav a { font-size: .85rem; }
  .listing, .profile { grid-template-columns: 1fr; }
  .filters-box { position: static; max-height: none; }
  .filters-box:not([open]) { padding-bottom: 6px; }
  .profile-side { position: static; }
  .steps ol { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .top-in { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; }
  .top-nav .nav-suppliers { display: none; }
  .hero { padding: 44px 0 36px; }
  .hero-search { grid-template-columns: 1fr; }
  .card { grid-template-columns: 48px 1fr; }
  .card-logo { width: 48px; height: 48px; font-size: .9rem; }
  .card-actions { grid-column: 1 / -1; flex-direction: row; min-width: 0; }
  .card-actions .btn { flex: 1; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .cta-supplier, .rfq-banner { flex-direction: column; align-items: flex-start; }
  .facts-table th { width: 120px; }
  .foot-in { grid-template-columns: 1fr; }
}
