/* CYP - shared styles. Light by default, html.dark flips it. */
:root {
  --bg: #ffffff;
  --panel: #f6f6f7;
  --panel-2: #ededef;
  --line: #e4e4e7;
  --text: #111113;
  --muted: #6b6b73;
  --faint: #a1a1aa;
  --accent: #111113;
  --accent-text: #ffffff;
  --green: #2f9e5f;  --green-bg: rgba(47,158,95,.10);
  --amber: #d98a1a;  --amber-bg: rgba(217,138,26,.12);
  --red: #d64545;    --red-bg: rgba(214,69,69,.10);
  --grey: #b4b4bb;
  --shadow: 0 10px 40px rgba(0,0,0,.10);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --font: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --hdr: 60px;
}
html.dark {
  --bg: #0f0f11;
  --panel: #18181b;
  --panel-2: #222226;
  --line: #2a2a30;
  --text: #f2f2f4;
  --muted: #9a9aa4;
  --faint: #5d5d66;
  --accent: #f2f2f4;
  --accent-text: #0f0f11;
  --shadow: 0 10px 40px rgba(0,0,0,.5);
  --green: #4caf72;  --green-bg: rgba(76,175,114,.10);
  --amber: #e8a15c;  --amber-bg: rgba(232,161,92,.12);
  --red: #e35b5b;    --red-bg: rgba(227,91,91,.10);
  --grey: #4a4a52;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---- header ---- */
.hdr {
  position: sticky; top: 0; z-index: 50; height: var(--hdr);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; letter-spacing: .02em; }
.brand .name { font-weight: 600; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.brand .logo { height: 30px; width: auto; display: block; }
.brand .logo.dk { display: none; }
html.dark .brand .logo.lt { display: none; }
html.dark .brand .logo.dk { display: block; }
.brand .sub { font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.hdr-right { display: flex; align-items: center; gap: 8px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--red); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn.icon { width: 36px; padding: 0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- toolbar ---- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 18px 24px 6px;
}
.search {
  flex: 1 1 260px; max-width: 420px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); outline: none;
}
.search:focus { border-color: var(--faint); background: var(--bg); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
}
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.count { color: var(--muted); font-size: 12px; margin-left: auto; }
select.sel {
  height: 30px; padding: 0 28px 0 12px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
  appearance: none; -webkit-appearance: none;
}

/* ---- grid ---- */
.grid {
  display: grid; gap: 22px 18px; padding: 14px 24px 60px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card { cursor: pointer; }
.card .ph {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
}
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .ph img { transform: scale(1.02); }
.card .ph .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.card .meta { padding: 10px 2px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card .t { font-weight: 600; font-size: 14px; }
.card .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dots { display: flex; gap: 5px; align-items: center; padding-top: 4px; flex-shrink: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grey); }
.dot.green { background: var(--green); } .dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }   .dot.none { background: var(--grey); }
.dot.live { background: var(--green); }
.dot.off { background: var(--red); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.tag.off { background: var(--panel-2); color: var(--muted); }
.tag.live { background: var(--green-bg); color: var(--green); }
.tag.feat { background: var(--amber-bg); color: var(--amber); }

.empty { padding: 80px 24px; text-align: center; color: var(--muted); }

/* ---- modal ---- */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(1040px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.modal .m-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.modal .m-hd h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal .m-bd { padding: 20px; }
.qv { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.qv .photo { border-radius: var(--r-md); overflow: hidden; background: var(--panel); border: 1px solid var(--line); align-self: start; }
.qv .photo img { width: 100%; height: auto; }
.qv h3 { margin: 0 0 2px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.qv .sub { color: var(--muted); margin-bottom: 14px; }
.qv .narr { white-space: pre-wrap; color: var(--text); font-size: 13.5px; line-height: 1.6; margin: 14px 0; }
.qv .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.qv .tags span { font-size: 11px; color: var(--muted); background: var(--panel); border-radius: 999px; padding: 3px 9px; }
.sizes { display: grid; gap: 10px; }
.size {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; background: var(--panel);
}
.size .lbl { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.size .row { display: contents; }
.size .k { color: var(--muted); font-size: 12.5px; }
.size .v { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.size .price { font-weight: 600; font-size: 15px; }
.avail { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* ---- forms ---- */
.form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }
.f { display: flex; flex-direction: column; gap: 5px; grid-column: span 6; }
.f.c3 { grid-column: span 3; } .f.c4 { grid-column: span 4; } .f.c12 { grid-column: span 12; }
.f label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.f input, .f select, .f textarea {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); outline: none; font-size: 14px;
}
.f textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--faint); }
.f .hint { font-size: 11.5px; color: var(--faint); }
.fs { grid-column: span 12; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; background: var(--panel); }
.fs .fs-t { grid-column: span 12; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.fs .f input { background: var(--bg); }
.toggle { display: inline-flex; align-items: center; gap: 8px; height: 38px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; }
.toggle .tk { width: 36px; height: 20px; border-radius: 999px; background: var(--panel-2); position: relative; transition: background .15s; border: 1px solid var(--line); }
.toggle .tk::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .tk { background: var(--green); border-color: var(--green); }
.toggle input:checked + .tk::after { transform: translateX(16px); }
.drop {
  grid-column: span 12; border: 1.5px dashed var(--line); border-radius: var(--r-md); padding: 18px;
  display: flex; align-items: center; gap: 16px; background: var(--panel); cursor: pointer;
}
.drop.over { border-color: var(--text); }
.drop img { width: 120px; height: 90px; object-fit: cover; border-radius: var(--r-sm); background: var(--panel-2); }
.drop .dtxt { font-size: 13px; color: var(--muted); }
.drop .dtxt b { color: var(--text); font-weight: 600; }
.m-ft { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg); }
.m-ft .right { display: flex; gap: 8px; }

/* ---- gate ---- */
.gate { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; }
.gate form { width: min(340px, 90vw); display: grid; gap: 12px; }
.gate .name { text-align: center; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.gate .glogo { height: 56px; width: auto; margin: 0 auto 18px; display: block; }
.gate .glogo.dk { display: none; }
html.dark .gate .glogo.lt { display: none; }
html.dark .gate .glogo.dk { display: block; }
.gate input { height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); outline: none; text-align: center; font-size: 15px; }
.gate input:focus { border-color: var(--faint); }
.gate .err { color: var(--red); font-size: 12.5px; text-align: center; min-height: 18px; }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: var(--accent-text); padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; transition: all .2s; z-index: 300; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- mobile ---- */
@media (max-width: 720px) {
  .hdr { padding: 0 16px; }
  .hide-m, .brand .sub { display: none; }
  .brand .name { font-size: 13px; }
  .brand .logo { height: 24px; }
  .btn.sm.icon { width: 30px; }
  .toolbar, .grid { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .overlay { padding: 0; align-items: stretch; }
  .modal { width: 100%; max-height: 100vh; border-radius: 0; border: 0; }
  .qv { grid-template-columns: 1fr; }
  .f, .f.c3, .f.c4 { grid-column: span 12; }
  .fs .f.c3, .fs .f.c4 { grid-column: span 6; }
  .f input, .f select { font-size: 16px; } /* stops iOS zooming on focus */
  .count { display: none; }
}
