/* Site styles. Colors come from /theme.css (built from site.config.json). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent-2); }
img { max-width: 100%; display: block; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -0.02em; }
h2 { font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.site-header .bar { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 900; font-size: 20px; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); }

/* hero */
.hero { padding: 28px 0 20px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.pill.live { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.pill.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .pill.live::before { animation: none; } }

/* tabs and buttons */
.tabs { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.tab, .btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
}
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.gold { background: var(--accent-2); color: #111; border-color: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* lot grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); object-fit: cover; width: 100%; }
.card .body { padding: 14px; display: grid; gap: 6px; }
.card .title { font-weight: 800; font-size: 17px; }
.price { font-size: 22px; font-weight: 900; color: var(--accent-2); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty { padding: 40px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }

/* lot page */
.lot { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .lot { grid-template-columns: 1fr; } }
.gallery .main { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--line); }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs button { padding: 0; border: 2px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.thumbs img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; }
.big-price { font-size: 40px; font-weight: 900; color: var(--accent-2); line-height: 1; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; }
.status { padding: 10px 12px; border-radius: 10px; font-weight: 700; background: var(--surface-2); }
.status.good { color: var(--good); }
.status.bad { color: var(--bad); }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.history li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 14px; }

/* forms */
form.stack, .stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.money-input { display: flex; align-items: center; gap: 8px; }
.money-input span { font-weight: 900; font-size: 20px; }
.form-box { max-width: 460px; margin: 20px auto; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--accent-2); }
.notice.error { border-left-color: var(--bad); }
.notice.ok { border-left-color: var(--good); }
.not-working { border: 1px dashed var(--bad); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-weight: 700; }

/* account and admin */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.done { color: var(--good); font-weight: 800; }
.todo { color: var(--accent-2); font-weight: 800; }
.paybar { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 32px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 24px; font-weight: 900; }
.admin-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
@media (max-width: 820px) { .admin-layout { grid-template-columns: 1fr; } }
.side { display: grid; gap: 4px; align-content: start; }
.side button { text-align: left; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.problems { color: var(--bad); margin: 6px 0 0; padding-left: 18px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer .bar { max-width: 1180px; margin: 0 auto; padding: 18px 16px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
