:root {
  --bg: #000;
  --panel: #0c0c0c;
  --panel-2: #141414;
  --line: #222;
  --line-2: #333;
  --ink: #fff;
  --ink-2: #a8a8a8;
  --ink-3: #6b6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1400px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.muted { color: var(--ink-2); }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 14px max(20px, calc((100vw - var(--wrap)) / 2));
  background: rgba(0, 0, 0, .85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.logo b { font-weight: 800; }
.logo-mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--ink); color: var(--bg); border-radius: 9px; font-weight: 800; font-size: 18px; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 500; font-size: 16px; color: var(--ink-2); border: 1px solid transparent; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); background: var(--panel-2); border-color: var(--line-2); box-shadow: inset 0 -2px 0 var(--ink); }
.top-right { margin-left: auto; }

.account { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink-2); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: #dcdcdc; }
.btn-outline { background: var(--panel); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--ink); }
.btn-danger { background: var(--panel); border-color: var(--ink); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn-xs { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.label { margin: 22px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pill { min-width: 26px; padding: 3px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; text-align: center; color: var(--ink-2); }

/* inputs */
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .15s;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
select { padding-right: 8px; }
select option { background: var(--panel-2); }

/* shop layout */
.layout {
  max-width: var(--wrap); margin: 0 auto; padding: 22px 20px 40px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr) 300px; gap: 22px; align-items: start;
}
.filters, .cart { position: sticky; top: 86px; }
.filters .label:first-of-type { margin-top: 0; }

.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm); text-align: left;
  background: transparent; border: 1px solid transparent; color: var(--ink-2); font-weight: 500;
}
.cat:hover { color: var(--ink); background: var(--panel-2); }
.cat[aria-pressed="true"] { color: var(--ink); background: var(--panel-2); border-color: var(--ink); font-weight: 700; }
.cat small { font-size: 12px; color: var(--ink-3); }
.range { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; }
.range label { flex: 1; min-width: 0; }
.range input { padding: 0 10px; }

/* hero */
.hero {
  padding: 34px 32px 32px;
  background:
    radial-gradient(120% 140% at 0% 0%, #262626 0%, transparent 55%),
    var(--panel);
  border-color: var(--line-2);
}
.hero h1 { font-size: clamp(32px, 4vw, 46px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.hero p { margin-top: 14px; max-width: 48ch; font-size: 17px; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-actions .btn { min-width: 190px; padding: 14px 22px; font-size: 16px; }

/* toolbar + grid */
.toolbar { display: flex; gap: 10px; margin-top: 18px; }
.toolbar .grow { flex: 1; }
.toolbar select { width: auto; min-width: 160px; }
.count { margin: 14px 2px; font-size: 14px; color: var(--ink-3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }

.card { display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.card-img { position: relative; aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 60%, #242424, #0e0e0e 75%); display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .initial { font-size: 56px; font-weight: 800; color: #3a3a3a; }
.tag { position: absolute; top: 10px; left: 10px; padding: 4px 8px; border-radius: 7px; background: rgba(0, 0, 0, .7); border: 1px solid var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px; flex: 1; }
.card-body h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.card-desc { font-size: 14px; color: var(--ink-2); flex: 1; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { margin: 8px 0 10px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.card .btn.in { background: var(--panel); color: var(--ink); border-color: var(--ink); }

.empty, .cart-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 44px 16px; text-align: center; color: var(--ink-3); }
.empty strong, .cart-empty strong { color: var(--ink-2); font-size: 16px; font-weight: 600; }

/* cart */
.cart-items li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-items .name { font-weight: 600; overflow-wrap: anywhere; }
.cart-items .price { font-weight: 700; }
.link { padding: 0; background: none; border: 0; font-size: 13px; color: var(--ink-3); text-decoration: underline; justify-self: start; }
.link:hover { color: var(--ink); }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 700; }
.cart-total strong { font-size: 22px; font-weight: 800; }

/* below the fold */
.below { max-width: var(--wrap); margin: 0 auto; padding: 30px 20px; }
.below > h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps h3 { margin: 16px 0 4px; font-size: 19px; font-weight: 700; }
.steps p { color: var(--ink-2); }
.num { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 800; }
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { padding: 0; }
.faq summary { padding: 16px 18px; font-size: 17px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--ink-2); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 18px 18px; color: var(--ink-2); }
.foot { max-width: var(--wrap); margin: 30px auto 0; padding: 24px 20px 36px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; }

.cart-note { margin-top: 10px; font-size: 13px; text-align: center; color: var(--ink-3); }
.foot { display: flex; justify-content: space-between; gap: 16px; }
.foot a:hover { color: var(--ink); }

/* login + owner auth */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.seg-btn { padding: 9px 10px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; }
.seg-btn[aria-selected="true"] { background: var(--ink); color: var(--bg); }

.auth { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); padding: 28px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { padding: 10px 12px; border: 1px solid var(--ink); border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; }
.error::before { content: "! "; font-weight: 800; }

/* owner: dashboard */
.dash { max-width: 1200px; margin: 0 auto; padding: 22px 20px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; align-items: start; }
.rows li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.rows .thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 20px; color: var(--ink-3); }
.rows .thumb img { width: 100%; height: 100%; object-fit: cover; }
.rows .name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.rows .meta { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.rows .actions { display: flex; gap: 6px; }
.status { padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.status.live { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.editor { position: sticky; top: 86px; display: grid; gap: 14px; }
.editor .panel-head { margin-bottom: 0; }
.upload { display: flex; gap: 14px; align-items: center; }
.upload-preview { width: 84px; height: 84px; flex: none; border-radius: var(--radius-sm); border: 1px dashed var(--line-2); background: var(--panel-2); display: grid; place-items: center; overflow: hidden; color: var(--ink-3); font-size: 12px; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upload-actions small { flex-basis: 100%; font-size: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #fff; }
.editor-actions { display: flex; gap: 10px; }
.editor-actions .btn-solid { flex: 1; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translate(-50%, 16px); padding: 12px 18px; border-radius: var(--radius-sm); background: var(--ink); color: var(--bg); font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* responsive */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .cart { grid-column: 1 / -1; position: static; }
}
@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .editor { position: static; order: -1; }
}
@media (max-width: 760px) {
  .top { gap: 12px; padding: 12px 16px; }
  .tabs { display: none; }
  .account-email { display: none; }
  .layout { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .center { order: -1; }
  .filters { position: static; }
  .cat-list { flex-direction: row; flex-wrap: wrap; }
  .cat { border-color: var(--line-2); }
  .hero { padding: 26px 20px; }
  .hero-actions .btn { flex: 1; min-width: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .steps { grid-template-columns: 1fr; }
  .below { padding: 24px 16px; }
  .rows li { grid-template-columns: 56px minmax(0, 1fr); }
  .rows .actions { grid-column: 1 / -1; }
  .rows .actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
}
