/* Tec & Technical – shared styles (stage 1: public pages) */
:root {
  --bg: #0B1730; --surface: #0F1C33; --surface-2: #16284A; --line: #243A61;
  --text: #EEF2F8; --muted: #AEB8CA; --accent: #0A66E8; --accent-hover: #2F80FF;
  --link: #8DB8FF; --check: #3DD6A3; --warn: #F2B544;
  --r-s: 6px; --r-m: 12px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 84px); }
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--font); font-stretch: 100%; }
img, video { max-width: 100%; display: block; }
a { color: var(--link); }
a:hover { color: #B9D3FF; }
h1, h2, h3 { font-stretch: 115%; font-weight: 750; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 2.3vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--check); outline-offset: 2px; }
.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 72ch; }
.small { font-size: .875rem; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: var(--r-s); border: 1px solid transparent; font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer; background: none; color: var(--text); white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-quiet { border-color: var(--line); }
.btn-quiet:hover { border-color: var(--muted); color: var(--text); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: rgba(11,23,48,.96); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 68px; flex-wrap: wrap; padding-block: .5rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 800; font-stretch: 120%; font-size: 1.05rem; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-s); background: var(--accent); color: #fff; font-size: .78rem; font-stretch: 100%; }
.nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.search { margin-left: auto; display: flex; min-width: min(320px, 100%); }
.search input { flex: 1; min-width: 0; padding: .55rem .8rem; border: 1px solid var(--line); border-right: 0; border-radius: var(--r-s) 0 0 var(--r-s); background: var(--surface); color: var(--text); font: inherit; }
.search input::placeholder { color: var(--muted); }
.search button { border-radius: 0 var(--r-s) var(--r-s) 0; }
@media (max-width: 860px) {
  .nav { order: 3; width: 100%; gap: .9rem; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; }
  .nav a { flex: 0 0 auto; }
  .search { margin-left: 0; order: 2; width: 100%; }
}

main { padding-block: 1.75rem 3rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head p { color: var(--muted); max-width: 70ch; }

/* notices */
.notice { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--surface); border-radius: var(--r-s); padding: .8rem 1rem; font-size: .92rem; color: var(--muted); }
.notice strong { color: var(--text); }
.notice-ok { border-left-color: var(--check); }

/* home: video stage + side list */
.vhero { background: #06101F; border-bottom: 1px solid var(--line); padding-block: 1.25rem; }
.vhero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; }
.stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.stage video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.stage-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1rem .9rem; background: linear-gradient(transparent, rgba(3,9,20,.92)); display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.stage-caption h2 { margin: 0; font-size: 1.15rem; }
.stage-empty { display: grid; place-items: center; height: 100%; text-align: center; padding: 1.5rem; color: var(--muted); }
.vlist { display: flex; flex-direction: column; gap: .4rem; max-height: 100%; overflow-y: auto; }
.vlist h2 { font-size: .95rem; font-stretch: 100%; color: var(--muted); margin: 0 0 .2rem; }
.vlist button { display: flex; gap: .6rem; align-items: center; text-align: left; width: 100%; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.vlist button[aria-current="true"] { border-color: var(--accent); background: var(--surface-2); }
.vlist .len { margin-left: auto; color: var(--muted); font-size: .8rem; }
@media (max-width: 860px) { .vhero-inner { grid-template-columns: 1fr; } .vlist { max-height: 260px; } }

/* home: 8 positions */
.slots-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: pos; }
@media (max-width: 1000px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .slots { grid-template-columns: 1fr; } }
.slot { position: relative; display: flex; flex-direction: column; min-height: 300px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); overflow: hidden; counter-increment: pos; }
.slot::before { content: counter(pos); position: absolute; top: .6rem; left: .6rem; z-index: 2; min-width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 99px; background: rgba(6,16,31,.85); color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.slot-empty { border: 2px dashed var(--line); background: transparent; justify-content: center; align-items: center; text-align: center; padding: 1.5rem 1rem; gap: .9rem; }
.slot-empty h3 { font-stretch: 120%; font-size: 1.25rem; margin: 0; }
.slot-empty .choices { display: flex; flex-direction: column; gap: .4rem; width: 100%; max-width: 220px; }

/* cards */
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.card .media { aspect-ratio: 16 / 10; background: var(--surface-2); }
.card .media img, .card .media video { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card h3 { margin: 0; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }
.card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-top: .4rem; }
.tag { display: inline-block; padding: .12rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.tag-ad { border-color: var(--warn); color: var(--warn); }
.tag-aff { border-color: var(--check); color: var(--check); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.filters button { padding: .4rem .85rem; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* list rows (adverts, jobs) */
.rows { display: flex; flex-direction: column; gap: .75rem; }
.row { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.row .thumb { aspect-ratio: 16 / 10; border-radius: var(--r-s); overflow: hidden; background: var(--surface-2); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row h3 { margin: 0 0 .2rem; }
.row h3 a { color: var(--text); text-decoration: none; }
.row .meta { font-size: .85rem; color: var(--muted); }
.row-nothumb { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 640px) { .row, .row-nothumb { grid-template-columns: 1fr; } }

/* empty states */
.empty { border: 2px dashed var(--line); border-radius: var(--r-m); padding: 2rem 1.25rem; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 1.2rem; }

/* detail pages */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.gallery { display: grid; gap: .6rem; }
.gallery .main { aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; background: #000; border: 1px solid var(--line); }
.gallery .main img, .gallery .main video { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .2rem; }
.thumbs button { flex: 0 0 96px; aspect-ratio: 16 / 10; padding: 0; border: 2px solid transparent; border-radius: var(--r-s); overflow: hidden; background: var(--surface-2); cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.article { max-width: 70ch; }
.article p { color: #DCE3EE; }
.aside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: .9rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.aside dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; font-size: .9rem; }
.aside dt { color: var(--muted); }
.aside dd { margin: 0; }
.slides { position: relative; }
.slides figcaption { padding: .6rem .2rem; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; }

/* prose pages */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.8em; }
.prose li { margin-bottom: .35em; }
.fill { color: var(--warn); }

/* footer */
.foot-site { border-top: 1px solid var(--line); padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: .88rem; }
.foot-site .cols { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; }
.foot-site nav { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.foot-site a { color: var(--muted); }
.foot-site .disclaimer { max-width: 75ch; margin-top: 1.25rem; }

/* report dialog */
dialog { max-width: min(480px, 92vw); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--text); padding: 1.25rem; }
dialog::backdrop { background: rgba(3,9,20,.7); }
dialog label { display: block; margin: .8rem 0 .3rem; font-weight: 600; }
dialog select, dialog textarea { width: 100%; padding: .55rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); color: var(--text); font: inherit; }
dialog .actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* filled home slot holds a card */
.slot > .card { flex: 1; border: 0; border-radius: 0; }

@media (max-width: 520px) {
  .stage-caption { padding: 1.5rem .7rem .6rem; }
  .stage-caption h2 { font-size: .95rem; }
  .stage-caption .btn { padding: .45rem .8rem; }
}

/* ---------- builder (stage 2) */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } }
.builder fieldset { border: 1px solid var(--line); border-radius: var(--r-m); padding: 1.1rem 1.1rem 1.25rem; margin: 0 0 1.25rem; background: var(--surface); }
.builder legend { font-weight: 700; font-stretch: 115%; padding: 0 .4rem; }
.field { display: grid; gap: .3rem; margin-bottom: .9rem; }
.field label { font-weight: 600; }
.field input, .field select, .field textarea, .media-item input { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); color: var(--text); font: inherit; }
.field textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
.hint { font-size: .85rem; color: var(--muted); }
.drop { display: grid; place-items: center; text-align: center; gap: .3rem; padding: 1.4rem 1rem; border: 2px dashed var(--line); border-radius: var(--r-m); color: var(--muted); cursor: pointer; }
.drop.over, .drop:focus-within { border-color: var(--accent); color: var(--text); }
.drop strong { color: var(--text); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.media-list { display: grid; gap: .6rem; margin-top: .75rem; }
.media-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .5rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); }
.media-item img, .media-item video { width: 120px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; background: #000; }
@media (max-width: 520px) { .media-item { grid-template-columns: 90px minmax(0, 1fr); } .media-item img, .media-item video { width: 90px; } .media-item .btn { grid-column: 1 / -1; } }
.price-panel { position: sticky; top: 96px; display: grid; gap: .8rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.price-panel table td { padding: .35rem 0; }
.price-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.4rem; font-weight: 750; font-stretch: 115%; border-top: 1px solid var(--line); padding-top: .6rem; }
.item-status { font-weight: 600; }
.status-live { color: var(--check); } .status-wait { color: var(--warn); } .status-off { color: var(--muted); }

/* ---------- conversations (stage 4) */
.chat { display: grid; gap: .6rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.chat-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; }
.chat-note { margin: 0; }
.chat-log { display: flex; flex-direction: column; gap: .5rem; height: min(55vh, 460px); overflow-y: auto; padding: .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); }
.msg { max-width: 80%; padding: .5rem .75rem; border-radius: 12px 12px 12px 4px; background: var(--surface-2); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--accent); border-radius: 12px 12px 4px 12px; }
.msg.mine .small { color: #DCE8FF; }
.msg p { margin: 0 0 .15rem; overflow-wrap: anywhere; }
.chat-send { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.chat-send textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.code-field { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.code-field input { flex: 1 1 220px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); color: var(--text); font: inherit; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.bid-form { display: grid; gap: .5rem; margin-top: .6rem; }
.bid-form input, .bid-form textarea { width: 100%; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); color: var(--text); font: inherit; }
