/* yourmockup.cc hub — one page: the chat on top, the product cards below. Light and dark (system, or the toggle). */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --ink: #16151a;
  --muted: #6b6873;
  --rule: #e2ded5;
  --accent: #ff5a36;
  --accent-ink: #ffffff;
  --accent-soft: #ffe7df;
  --user: #1f1d24;
  --user-ink: #f6f4ef;
  --ok: #1e7f4f;
  --warn: #9a5b00;
  --err: #b42318;
  --focus: #2563eb;
  --check-a: #e9e6df;
  --check-b: #ffffff;
  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(22, 21, 26, .05), 0 8px 24px rgba(22, 21, 26, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131217; --surface: #1c1b21; --surface-2: #24222a; --ink: #f2f0ec; --muted: #a19dab; --rule: #2e2c35;
    --accent: #ff6a49; --accent-ink: #16151a; --accent-soft: #3a211b; --user: #f2f0ec; --user-ink: #16151a;
    --ok: #5fd39a; --warn: #f0b45a; --err: #ff8b80; --focus: #7aa7ff; --check-a: #2a2830; --check-b: #34323b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131217; --surface: #1c1b21; --surface-2: #24222a; --ink: #f2f0ec; --muted: #a19dab; --rule: #2e2c35;
  --accent: #ff6a49; --accent-ink: #16151a; --accent-soft: #3a211b; --user: #f2f0ec; --user-ink: #16151a;
  --ok: #5fd39a; --warn: #f0b45a; --err: #ff8b80; --focus: #7aa7ff; --check-a: #2a2830; --check-b: #34323b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-s); z-index: 20; }
.skip:focus { left: 8px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------ bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px max(16px, calc((100vw - 1040px) / 2)); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.01em; font-size: 18px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 6px 5px 5px; background: var(--accent); clip-path: polygon(0 18%, 30% 0, 70% 0, 100% 18%, 88% 46%, 76% 40%, 76% 100%, 24% 100%, 24% 40%, 12% 46%); }
.tld { color: var(--accent); }
.bar-right { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang button { border: 0; background: none; padding: 5px 11px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); cursor: pointer; padding: 0; }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#theme .i-moon { display: none; }
:root[data-theme="dark"] #theme .i-sun { display: none; }
:root[data-theme="dark"] #theme .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme .i-sun { display: none; }
  :root:not([data-theme="light"]) #theme .i-moon { display: block; }
}

/* ------------------------------------------------------------ layout */
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; display: flex; flex-direction: column; gap: 28px; }
.hero { padding: 18px 0 0; }
.hero h1 { margin: 0 0 8px; font-size: clamp(28px, 6vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; max-width: 18ch; }
.lead { margin: 0; color: var(--muted); font-size: 17px; max-width: 56ch; }

/* ------------------------------------------------------------ chat */
.chat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-l); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.chat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.quota { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.quota .dots { display: inline-flex; gap: 4px; }
.quota .dot { width: 9px; height: 9px; border-radius: 99px; background: var(--accent); }
.quota .dot.used { background: var(--rule); }
.quota.paused { color: var(--warn); }
.link-btn { border: 0; background: none; padding: 4px 2px; font-size: 14px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.messages { display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; min-height: 260px; max-height: min(64vh, 720px); overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.msg { max-width: 86%; display: flex; flex-direction: column; gap: 8px; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.model { align-self: flex-start; }
.bubble { padding: 10px 14px; border-radius: 18px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--user); color: var(--user-ink); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg.model .bubble { background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--surface); padding: 1px 5px; border-radius: 6px; }
.bubble.typing::after { content: "▍"; animation: blink 1s steps(2) infinite; margin-left: 2px; color: var(--muted); }
@keyframes blink { 50% { opacity: 0; } }
.msg .err { color: var(--err); font-size: 14px; }
.welcome { display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 14px; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--ink); }

/* image cards in the chat */
.img-card { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; width: min(380px, 78vw); }
.img-card:has(.img-frame.portrait) { width: min(300px, 70vw); }
.img-frame { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; background: var(--surface-2); }
.img-frame.portrait { aspect-ratio: 3 / 4; }
.img-frame.landscape { aspect-ratio: 4 / 3; }
.img-frame.checker { background-color: var(--check-b); background-image: linear-gradient(45deg, var(--check-a) 25%, transparent 25%), linear-gradient(-45deg, var(--check-a) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--check-a) 75%), linear-gradient(-45deg, transparent 75%, var(--check-a) 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.img-frame.on-dark { background: #1b1a1f; }
.img-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.img-frame .shade { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; gap: 8px; align-content: center; color: var(--muted); font-size: 14px; }
.img-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 0; font-size: 13px; }
.img-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); white-space: nowrap; }
.img-actions { display: flex; gap: 8px; padding: 10px 12px 12px; flex-wrap: wrap; align-items: center; }
.bg-toggle { margin-left: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.put-on { position: relative; }
.menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 10; min-width: 220px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.menu button { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 10px; border-radius: 10px; text-align: left; cursor: pointer; font-size: 14px; font-weight: 600; }
.menu button:hover:not([disabled]), .menu button:focus-visible { background: var(--surface-2); }
.menu button[disabled] { color: var(--muted); cursor: default; font-weight: 500; }
.menu .soon { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.sent-note { font-size: 13px; color: var(--muted); padding: 0 12px 12px; margin: -4px 0 0; }
.sent-note a { color: var(--ink); font-weight: 700; }

.progress { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* composer */
.ts-box { padding: 0 16px 8px; display: flex; flex-direction: column; gap: 4px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--rule); background: var(--surface); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--rule); border-radius: 18px; background: var(--bg); padding: 10px 14px; min-height: 44px; max-height: 180px; line-height: 1.4; font-size: 16px; }
.composer textarea:focus { outline: none; border-color: var(--ink); }
.send { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.send[disabled] { opacity: .5; cursor: not-allowed; }
.send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.attach { width: 44px; height: 44px; flex: none; }
.composer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 0 12px 12px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.drop-over .messages { outline: 3px dashed var(--accent); outline-offset: -8px; }

/* ------------------------------------------------------------ products */
.products-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.products h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 1 / 1; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img svg { width: 56%; height: 56%; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.card-body { padding: 12px 14px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-name { font-weight: 800; font-size: 16px; }
.card-go { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.card.soon { opacity: .78; }
.card.soon .card-go { color: var(--muted); }

/* ------------------------------------------------------------ footer, toast */
.foot { border-top: 1px solid var(--rule); padding: 18px max(16px, calc((100vw - 1040px) / 2)) 28px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--ink); font-weight: 600; }
.foot-note { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 30; max-width: min(92vw, 520px); box-shadow: var(--shadow); }
.toast.error { background: var(--err); color: #fff; }
.noscript { padding: 16px; text-align: center; }

@media (max-width: 560px) {
  .bar { padding: 12px 16px; }
  .brand-name { font-size: 17px; }
  .hero { padding-top: 6px; }
  .lead { font-size: 16px; }
  .messages { padding: 14px 12px; max-height: 62vh; }
  .msg { max-width: 94%; }
  .img-card { width: min(320px, 82vw); }
  .composer { padding: 10px; }
  .composer-tools { padding: 0 10px 10px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 10px 12px 12px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .card-name { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
