/* MilkyOverflow — modern flat theme. Colours come from CSS variables set by the live editor. */
:root {
  --bg: #0d0e13; --surface: #161821; --surface2: #1e2130; --text: #eef0f7; --muted: #8d93a8;
  --accent: #8b93ff; --accent2: #f4efe6; --on-accent: #0d0e13; --radius: 14px;
  --line: color-mix(in srgb, var(--text) 9%, transparent);
  --line2: color-mix(in srgb, var(--text) 16%, transparent);
  --ok: #22c55e; --warn: #f59e0b; --bad: #f43f5e;
  --font-head: var(--font);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; font-family: var(--font-head); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }
.grad { background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent2))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prose h3 { margin-top: 1.4em; } .prose a { color: var(--accent); text-decoration: underline; } .prose img { border-radius: var(--radius); margin: 1em 0; }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li { margin: .3em 0; }

/* announcement + header */
.announce { background: var(--accent); color: var(--on-accent); text-align: center; font-size: .875rem; font-weight: 600; padding: 8px 16px; }
header.site { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; gap: 28px; height: 80px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo img { height: 58px; width: auto; transition: transform .2s; }
.logo:hover img { transform: rotate(-3deg) scale(1.04); }
nav.main { display: flex; gap: 4px; flex: 1; }
nav.main a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 550; font-size: .95rem; transition: .15s; }
nav.main a:hover, nav.main a.active { color: var(--text); background: var(--surface); }
.hdr-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--line2); }
.icon-btn svg { width: 19px; height: 19px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.menu-btn { display: none; }
@media (max-width: 820px) {
  nav.main { display: none; position: absolute; top: 80px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; }
  nav.main.open { display: flex; }
  .menu-btn { display: inline-flex; }
  header.site .wrap { justify-content: space-between; }
}

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 650; font-size: .95rem; border: 1px solid transparent; cursor: pointer; transition: transform .12s, background .15s, border-color .15s; background: var(--accent); color: var(--on-accent); white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line2); }
.btn.ghost:hover { background: var(--surface); }
.btn.soft { background: var(--surface2); color: var(--text); }
.btn.danger { background: var(--bad); color: #1a0606; }
.btn.sm { padding: 7px 14px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line2); border-radius: calc(var(--radius) - 4px); padding: 11px 14px; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
.error { color: var(--bad); font-size: .9rem; }

/* layout bits */
main { min-height: 60vh; }
section.block { padding: 84px 0; }
section.block + section.block { border-top: 1px solid var(--line); }
.page-head { padding: 64px 0 28px; }
.page-head p { color: var(--muted); max-width: 640px; font-size: 1.08rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 60%, var(--text)); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface2); color: var(--muted); text-transform: capitalize; }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: color-mix(in srgb, var(--ok) 65%, var(--text)); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: color-mix(in srgb, var(--warn) 65%, var(--text)); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: color-mix(in srgb, var(--bad) 70%, var(--text)); }
.pill.acc { background: color-mix(in srgb, var(--accent) 18%, transparent); color: color-mix(in srgb, var(--accent) 60%, var(--text)); }

/* hero */
.hero { padding: 90px 0 80px; }
.hero h1 { margin-bottom: 20px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 560px; }
.hero-art { aspect-ratio: 1 / 1; border-radius: calc(var(--radius) * 2); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }

/* product cards */
.p-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, transform .15s; }
.p-card:hover { border-color: var(--line2); transform: translateY(-2px); }
.p-card .thumb { aspect-ratio: 4 / 3; background: var(--surface2); overflow: hidden; }
.p-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.p-card .body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.p-card .body h3 { margin: 0; }
.p-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { font-weight: 800; font-size: 1.1rem; }
.filters { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.filters button { background: var(--surface); border: 1px solid var(--line); color: var(--muted); padding: 8px 16px; border-radius: 999px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.filters button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 56px 0 90px; }
.product-page .thumb { border-radius: calc(var(--radius) * 1.5); overflow: hidden; background: var(--surface); border: 1px solid var(--line); aspect-ratio: 1; }
.product-page .thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .product-page { grid-template-columns: 1fr; } }

/* tiers */
.tiers { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tier { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.3); padding: 30px 26px; }
.tier .bar { position: absolute; top: 0; left: 26px; right: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--tc, var(--accent)); }
.tier .amount { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.tier ul { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 10px; }
.tier li { display: flex; gap: 10px; color: var(--muted); }
.tier li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 99px; background: var(--tc, var(--accent)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/11px no-repeat; }
.tier .btn { margin-top: auto; }
.tier.current { border-color: var(--tc, var(--accent)); }

/* commissions */
.types { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 26px 0 40px; }
.steps { display: flex; gap: 0; margin: 26px 0; }
.steps .st { flex: 1; text-align: center; position: relative; font-size: .82rem; color: var(--muted); font-weight: 600; }
.steps .st .dot { width: 30px; height: 30px; margin: 0 auto 8px; border-radius: 99px; background: var(--surface2); border: 2px solid var(--line2); display: grid; place-items: center; font-size: .8rem; position: relative; z-index: 1; }
.steps .st::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--line2); }
.steps .st:first-child::before { display: none; }
.steps .st.done .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps .st.done::before { background: var(--accent); }
.steps .st.done { color: var(--text); }

/* posts */
.post-card { display: block; }
.post-card .lock { float: right; }
.post-body { max-width: 760px; margin: 0 auto; padding: 56px 0 90px; }
.locked-box { text-align: center; padding: 48px 24px; }

/* tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: .93rem; }
table.list th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }

/* cart */
.cart-line { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--surface2); }
.qty { width: 74px; }
.summary { position: sticky; top: 90px; }
.sum-row { display: flex; justify-content: space-between; margin: 8px 0; }
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; padding-bottom: 90px; align-items: start; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } }
.paylist { display: grid; gap: 10px; }
.payopt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line2); border-radius: calc(var(--radius) - 4px); cursor: pointer; background: var(--surface); }
.payopt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.payopt input { margin: 0; }
.note-box { background: var(--surface2); border-radius: calc(var(--radius) - 4px); padding: 14px 16px; white-space: pre-wrap; font-size: .92rem; }

/* auth */
.auth { max-width: 420px; margin: 64px auto 100px; }

/* footer */
footer.site { border-top: 1px solid var(--line); padding: 48px 0 40px; margin-top: 40px; color: var(--muted); font-size: .92rem; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
footer.site .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer.site a:hover { color: var(--text); }

/* modal, toast, age gate */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(5, 6, 10, .72); backdrop-filter: blur(10px); display: grid; place-items: center; padding: 20px; animation: fade .18s; }
.modal { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line2); border-radius: calc(var(--radius) * 1.4); padding: 30px; animation: pop .2s; max-height: 90vh; overflow: auto; }
.modal h2 { font-size: 1.5rem; }
.age-gate { z-index: 200; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(22px); }
.age-gate .modal { text-align: center; width: min(480px, 100%); padding: 40px 34px; }
.age-gate .badge18 { width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 99px; display: grid; place-items: center; font-weight: 900; font-size: 1.5rem; color: var(--on-accent); background: var(--accent); }
.age-gate .actions { justify-content: center; }
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: grid; gap: 10px; }
.toast { background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem; box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: pop .2s; max-width: 360px; }
.toast.bad { background: var(--bad); color: #1a0606; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line2); border-top-color: var(--accent); border-radius: 99px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- live editor ---------- */
.mo-editing [data-edit], .mo-editing [data-edit-entity] { outline: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; border-radius: 4px; cursor: text; min-width: 20px; }
.mo-editing [data-edit]:hover, .mo-editing [data-edit-entity]:hover { outline-color: var(--accent); }
.mo-editing [data-edit]:focus, .mo-editing [data-edit-entity]:focus { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.mo-editing [data-edit-img] { outline: 2px dashed var(--accent); outline-offset: -2px; cursor: pointer; }
.mo-editing [data-edit-img]:hover { filter: brightness(.8); }
.mo-editing { padding-top: 58px; }
.mo-fab { position: fixed; left: 20px; bottom: 20px; z-index: 150; display: flex; gap: 8px; }
.mo-fab .btn { box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.mo-bar { position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 160; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #0a0b0f; border-bottom: 1px solid #262938; color: #eef0f7; font: 600 13px/1 var(--font); overflow-x: auto; }
.mo-bar button, .mo-bar a { flex: none; height: 34px; min-width: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid #262938; background: #161821; color: #eef0f7; font: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mo-bar button:hover { background: #222536; }
.mo-bar .sep { width: 1px; height: 24px; background: #262938; margin: 0 4px; flex: none; }
.mo-bar .grow { flex: 1; }
.mo-bar .save { background: #8b93ff; color: #0d0e13; border-color: #8b93ff; padding: 0 16px; }
.mo-bar .save.dirty::after { content: " •"; }
.mo-panel { position: fixed; top: 52px; right: 0; bottom: 0; width: 330px; z-index: 155; background: #0f1016; border-left: 1px solid #262938; color: #eef0f7; overflow-y: auto; padding: 18px; font-size: 14px; transform: translateX(100%); transition: transform .2s; }
.mo-panel.open { transform: none; }
.mo-panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #8d93a8; margin: 22px 0 10px; }
.mo-panel h4:first-child { margin-top: 0; }
.mo-panel .prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.mo-panel input[type=color] { width: 44px; height: 30px; padding: 2px; border-radius: 6px; background: #161821; border: 1px solid #262938; }
.mo-panel input:not([type=color]):not([type=checkbox]), .mo-panel select { background: #161821; border-color: #262938; color: #eef0f7; padding: 7px 10px; font-size: 13px; }
.mo-panel .sec { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #161821; border: 1px solid #262938; border-radius: 8px; margin-bottom: 6px; }
.mo-panel .sec span { flex: 1; text-transform: capitalize; }
.mo-panel .sec button { background: none; border: 0; color: #8d93a8; cursor: pointer; font-size: 14px; padding: 2px 5px; }
.mo-panel .hint { color: #8d93a8; font-size: 12.5px; line-height: 1.5; }
.mo-panel .btn { font-size: 13px; padding: 8px 14px; }
.p-card .body .pill { align-self: flex-start; }

/* light themes: soft "sticker" look that matches the logo outline */
.light .card, .light .p-card, .light .tier, .light .stat, .light .tbl { border: 2px solid color-mix(in srgb, var(--text) 14%, transparent); box-shadow: 0 3px 0 color-mix(in srgb, var(--text) 10%, transparent); }
.light .p-card:hover, .light .tier:hover { border-color: var(--accent); }
.light .btn { box-shadow: 0 3px 0 color-mix(in srgb, var(--text) 85%, transparent); border: 2px solid var(--text); }
.light .btn:active { box-shadow: none; transform: translateY(3px); }
.light .btn.ghost { background: var(--surface); }
.light .hero-art { border: 2px solid var(--text); box-shadow: 0 6px 0 var(--text); }
.light header.site { border-bottom: 2px solid color-mix(in srgb, var(--text) 10%, transparent); }
.light .announce { border-bottom: 2px solid var(--text); }
.light input, .light select, .light textarea { border-width: 2px; }
.light .toast { box-shadow: 0 4px 0 color-mix(in srgb, var(--text) 30%, transparent); }
