/* ===== Platform components (same palette/typography as aimixmedia.site/info) ===== */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px 40px; position: relative; z-index: 1; width: 100%; }
.topbar .nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topbar .nav a.link { color: var(--text-dim); font-weight: 700; font-size: .93em; padding: 8px 12px; border-radius: 10px; transition: color .2s, background .2s; }
.topbar .nav a.link:hover, .topbar .nav a.link.active { color: var(--text); background: var(--surface-2); }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.balance-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 30px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 800; font-size: .9em; }
.balance-pill b { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85em; }
.menu-toggle { display: none; }
.page-head { padding: 38px 0 22px; }
.page-head h1 { font-size: clamp(1.6em, 5vw, 2.4em); margin-bottom: 8px; }
.page-head p { color: var(--text-dim); max-width: 720px; }
.muted { color: var(--text-dim); }
.small { font-size: .88em; }
.mono, code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .88em; }
pre { background: #f6f6f7; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; overflow-x: auto; font-size: .85em; line-height: 1.55; color: #1f1f23; position: relative; }
pre code { background: none; border: 0; padding: 0; font-size: 1em; }
.copy-btn { position: absolute; top: 8px; right: 8px; font-size: .75em; padding: 5px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border); cursor: pointer; font-family: inherit; font-weight: 700; }
.copy-btn:hover { color: var(--text); border-color: var(--violet); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.model-card { position: relative; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, var(--surface-2) 0%, #fafafa 100%); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s; }
.model-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--rainbow); transform: scaleX(0); transform-origin: left; transition: transform .35s; }
.model-card:hover { transform: translateY(-5px); border-color: rgba(17,17,17,0.24); box-shadow: 0 20px 46px rgba(17,17,17,0.064); }
.model-card:hover::before { transform: scaleX(1); }
.model-card h3 { font-size: 1.2em; font-weight: 800; }
.model-card p { color: var(--text-dim); font-size: .94em; flex: 1; }
.model-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag { display: inline-block; font-size: .72em; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-dim); }
.tag.hot { background: #111111; color: #fff; border-color: transparent; }
.tag.cat-image { color: var(--cyan); } .tag.cat-text { color: var(--mint); }
.price { font-weight: 800; background: #111111; color: #fff; padding: 4px 13px; border-radius: 20px; font-size: .85em; white-space: nowrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
/* forms */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 700; font-size: .9em; margin-bottom: 7px; }
label.field > small { display: block; color: var(--text-dim); font-size: .8em; margin-top: 5px; }
input[type=text], input[type=number], input[type=email], input[type=search], select, textarea {
  width: 100%; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: .95em; outline: none; transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(17,17,17,0.072); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-danger { color: #fff; background: #b42318; }
.btn-xs { padding: 6px 12px; font-size: .8em; border-radius: 9px; }
.dropzone { border: 1.5px dashed var(--border); border-radius: 14px; padding: 16px; text-align: center; color: var(--text-dim); cursor: pointer; transition: border-color .2s, background .2s; font-size: .9em; }
.dropzone.drag, .dropzone:hover { border-color: var(--violet); background: rgba(17,17,17,0.03); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: 12px; line-height: 20px; }
.thumb.loading { opacity: .5; }
/* playground */
.play { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 22px; align-items: start; }
.play .panel { padding: 26px; margin: 0; }
.output { min-height: 420px; display: flex; flex-direction: column; }
.output-body { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); min-height: 360px; padding: 14px; position: relative; overflow: hidden; }
.output-body img { max-width: 100%; max-height: 70vh; border-radius: 12px; display: block; }
.output-body .text-result { white-space: pre-wrap; width: 100%; align-self: stretch; font-size: .95em; line-height: 1.6; max-height: 70vh; overflow: auto; }
.results-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); width: 100%; }
.spinner { width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(from 0deg, #d4d4d8, #111111); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); animation: spin 1.1s linear infinite; margin: 0 auto 14px; }
.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .78em; padding: 4px 11px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--border); white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.state.success::before { background: var(--mint); } .state.success { color: var(--mint); }
.state.fail::before { background: var(--pink); } .state.fail { color: #b42318; }
.state.generating::before { background: var(--orange); animation: pulse 1s infinite; } .state.generating { color: var(--orange); }
.state.waiting::before, .state.queuing::before { background: var(--blue); animation: pulse 1.4s infinite; }
.state.pending::before { background: var(--yellow); } .state.succeeded { color: var(--mint); } .state.succeeded::before { background: var(--mint); }
.state.canceled::before, .state.failed::before, .state.expired::before { background: var(--pink); }
@keyframes pulse { 50% { opacity: .3; } }
.subtabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.subtab { padding: 9px 18px; border-radius: 30px; background: var(--surface); border: 1px solid var(--border); font-size: .9em; font-weight: 700; color: var(--text-dim); cursor: pointer; font-family: inherit; }
.subtab.active { color: #fff; background: #111111; border-color: transparent; box-shadow: 0 8px 22px rgba(17,17,17,0.128); }
.tabpane { display: none; } .tabpane.active { display: block; }
/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: .9em; }
table.t th { text-align: left; font-weight: 700; color: var(--text-dim); font-size: .82em; text-transform: uppercase; letter-spacing: .6px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: rgba(0,0,0,.015); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos { color: var(--mint); } .neg { color: #b42318; }
.ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* cabinet */
.cab { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding-top: 28px; align-items: start; }
.side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px; }
.side a { padding: 10px 14px; border-radius: 11px; font-weight: 700; font-size: .93em; color: var(--text-dim); }
.side a:hover { color: var(--text); background: var(--surface-2); }
.side a.active { color: #fff; background: #111111; }
.side .sep { height: 1px; background: var(--border); margin: 8px 4px; }
.stat { background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.stat .k { color: var(--text-dim); font-size: .82em; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.stat .v { font-size: 1.7em; font-weight: 800; margin-top: 4px; }
.stat .v.grad { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; margin-bottom: 22px; }
.box h2 { font-size: 1.25em; font-weight: 800; margin-bottom: 14px; }
.box h3 { font-size: 1.05em; font-weight: 800; margin: 18px 0 10px; }
.flash { padding: 13px 16px; border-radius: 13px; margin: 16px 0; font-weight: 600; border: 1px solid; }
.flash.ok { background: rgba(16,217,154,.08); border-color: rgba(16,217,154,.4); color: var(--mint); }
.flash.err { background: rgba(255,55,95,.08); border-color: rgba(255,55,95,.4); color: #b42318; }
.flash.info { background: rgba(17,17,17,0.032); border-color: rgba(17,17,17,0.16); color: #27272a; }
.keybox { font-family: ui-monospace, monospace; background: #f6f6f7; border: 1px dashed var(--mint); padding: 14px; border-radius: 12px; word-break: break-all; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: .92em; }
.kv > div:nth-child(odd) { color: var(--text-dim); }
.login-card { max-width: 460px; margin: 60px auto; text-align: center; }
.login-card .btn { width: 100%; margin-bottom: 12px; }
.tg-wrap { display: flex; justify-content: center; min-height: 48px; margin: 8px 0 14px; }
.inline-form { display: inline; }
.hero.compact { padding: 56px 0 30px; }
.feature-list { list-style: none; }
.feature-list li { display: flex; gap: 10px; padding: 6px 0; color: var(--text-dim); }
.feature-list li::before { content: '✓'; color: var(--mint); font-weight: 800; }
.docs h2 { font-size: 1.4em; font-weight: 800; margin: 30px 0 12px; scroll-margin-top: 80px; }
.docs h3 { font-size: 1.1em; font-weight: 800; margin: 22px 0 10px; }
.docs p, .docs li { color: var(--text-dim); margin-bottom: 10px; }
.docs ul { padding-left: 20px; }
.docs strong { color: var(--text); }
.toc { position: sticky; top: 80px; }
.toc a { display: block; padding: 6px 10px; color: var(--text-dim); font-weight: 600; font-size: .9em; border-radius: 8px; }
.toc a:hover { color: var(--text); background: var(--surface-2); }
.history-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .88em; }
.history-item:last-child { border-bottom: 0; }
.history-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.history-item .grow { flex: 1; min-width: 0; }
@media (max-width: 980px) {
  .play { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .cab { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; overflow-x: auto; }
  .side .sep { display: none; }
  .side a { white-space: nowrap; }
}
@media (max-width: 760px) {
  .topbar .nav { display: none; width: 100%; order: 3; flex-direction: column; align-items: stretch; }
  .topbar.open .nav { display: flex; }
  .topbar { flex-wrap: wrap; }
  .menu-toggle { display: inline-flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .wrap { padding: 0 14px 40px; }
  .balance-pill span.lbl { display: none; }
}

/* ===== UX pass: icons, big login buttons, playground, tooltips, mobile ===== */
.ico.big { width: 34px; height: 34px; stroke-width: 1.5; }
.topbar .nav a.link { display: inline-flex; align-items: center; gap: 7px; }
.balance-pill .ico { color: var(--mint); }
.topup-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; }
.menu-toggle .ico { width: 20px; height: 20px; }
/* login */
.btn-login { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 58px; padding: 14px 20px; margin-bottom: 14px; border-radius: 14px; font-size: 1.08em; font-weight: 800; color: #fff; transition: transform .15s, box-shadow .2s, filter .2s; text-decoration: none; }
.btn-login:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-login:active { transform: translateY(0); }
.btn-login .brand-logo { width: 28px; height: 28px; flex-shrink: 0; }
.btn-login.tg { background: #229ED9; box-shadow: 0 10px 26px rgba(0,0,0,.08); }
.btn-login.gh { background: #24292f; border: 1px solid #3d444d; box-shadow: 0 10px 26px rgba(0,0,0,.08); }
.small-ring { width: 84px !important; height: 84px !important; margin: 0 auto 18px !important; }
.tg-fallback { margin-top: 6px; text-align: center; }
.tg-fallback summary { cursor: pointer; list-style: none; }
.tg-fallback summary::-webkit-details-marker { display: none; }
/* how-to */
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.howto-step { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-3); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; text-align: left; }
.howto-step b { display: block; margin-bottom: 2px; }
.howto-step span:not(.flow-num) { color: var(--text-dim); font-size: .88em; }
.empty-state { text-align: center; padding: 30px 10px; }
.empty-state h3 { font-size: 1.2em; margin: 10px 0 4px; }
.empty-state .howto { margin: 18px 0; }
.empty-state > .ico { color: var(--violet); }
/* model cards with preview */
.model-card { padding: 0; gap: 0; }
.mc-preview { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-3); border-bottom: 1px solid var(--border); }
.mc-preview img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.model-card:hover .mc-preview img { transform: scale(1.04); }
.mc-art { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; text-align: center; }
.mc-art small { font-weight: 800; opacity: .9; }
.mc-art .ico.big { width: 54px; height: 54px; }
.art-image { background: radial-gradient(circle at 25% 20%, rgba(0,0,0,0), transparent 45%), radial-gradient(circle at 80% 30%, rgba(0,0,0,0), transparent 50%), radial-gradient(circle at 50% 90%, rgba(0,0,0,0), transparent 55%), #f1f1f3; }
.art-text { background: radial-gradient(circle at 20% 20%, rgba(0,0,0,0), transparent 50%), radial-gradient(circle at 85% 80%, rgba(17,17,17,0.22), transparent 55%), #f1f1f3; }
.mc-art-text { font-size: 3em; font-weight: 800; line-height: 1; }
.mc-art-text small { font-size: .3em; display: block; margin-top: 10px; }
.mc-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tag .ico { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
/* model switcher */
.switcher { display: flex; gap: 10px; overflow-x: auto; padding: 22px 2px 6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.sw { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; padding: 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-size: .74em; font-weight: 700; text-align: center; line-height: 1.2; }
.sw img, .sw-art { width: 82px; height: 58px; border-radius: 10px; object-fit: cover; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.sw.active { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--rainbow) border-box; border: 2px solid transparent; color: var(--text); }
.model-head { padding: 14px 0 16px; }
.model-head h1 { font-size: clamp(1.5em, 5vw, 2.2em); margin: 8px 0 4px; }
.mh-tags { display: flex; gap: 8px; flex-wrap: wrap; }
/* playground form */
.field { display: block; margin-bottom: 18px; }
.field-title { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .95em; margin-bottom: 9px; }
#playground textarea { min-height: 150px; font-size: 1.02em; }
.examples { display: flex; flex-wrap: wrap; gap: 7px; margin: -8px 0 18px; align-items: center; }
.ex-chip { font-family: inherit; font-size: .8em; font-weight: 600; color: var(--text); background: var(--surface-3); border: 1px solid var(--border); border-radius: 20px; padding: 7px 12px; cursor: pointer; text-align: left; max-width: 100%; transition: border-color .2s, background .2s; }
.ex-chip:hover { border-color: var(--violet); background: rgba(17,17,17,0.04); }
.ratio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 7px; }
.ratio input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.ratio > span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 64px; padding: 7px 4px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); cursor: pointer; font-size: .76em; font-weight: 700; color: var(--text-dim); transition: border-color .15s, background .15s; }
.rbox { display: block; border: 2px solid currentColor; border-radius: 3px; margin: auto 0 0; }
.rbox.rauto { width: 22px; height: 22px; border-style: dashed; font-size: 11px; line-height: 18px; text-align: center; font-weight: 800; }
.ratio input:checked + span { border-color: var(--violet); background: rgba(17,17,17,0.056); color: var(--text); box-shadow: 0 0 0 2px rgba(17,17,17,0.1); }
.ratio input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--violet); }
.seg { display: flex; gap: 7px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 80px; position: relative; }
.seg label > span { display: flex; flex-direction: column; align-items: center; padding: 10px 8px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); cursor: pointer; font-weight: 800; font-size: .9em; }
.seg label > span small { font-weight: 600; color: var(--text-dim); font-size: .78em; }
.seg input:checked + span { border-color: var(--violet); background: rgba(17,17,17,0.056); box-shadow: 0 0 0 2px rgba(17,17,17,0.1); }
.dropzone { display: flex; align-items: center; gap: 14px; text-align: left; padding: 18px; min-height: 84px; }
.dropzone .ico.big { color: var(--violet); }
.dropzone b { color: var(--text); }
.thumb { width: 84px; height: 84px; }
.thumb button { width: 26px; height: 26px; font-size: 16px; line-height: 26px; top: 4px; right: 4px; }
.thumb-spin { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.thumb.loading .thumb-spin { display: flex; }
.spinner-sm { width: 22px !important; height: 22px !important; margin: 0 !important; display: inline-block; vertical-align: middle; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)) !important; mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)) !important; }
.gen-btn { font-size: 1.15em; min-height: 60px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.center { text-align: center; }
/* output */
.out-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.out-head h3 { font-size: 1.15em; }
.output-body .empty { text-align: center; }
.empty-prev { width: 220px; max-width: 70%; margin: 0 auto 12px; border-radius: 14px; opacity: .55; border: 1px solid var(--border); }
.about-prev { max-width: 420px; border-radius: 16px; margin-bottom: 18px; border: 1px solid var(--border); }
.progress-box { text-align: center; width: 100%; max-width: 380px; }
.progress-box .stage { font-weight: 800; font-size: 1.05em; margin-bottom: 12px; }
.bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; border: 1px solid var(--border); }
.bar i { display: block; height: 100%; width: 0; background: var(--rainbow); transition: width 1s linear; }
.fail-box { text-align: center; max-width: 380px; }
.fail-box .fail-ico { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 50%; background: rgba(255,55,95,.15); color: #b42318; font-weight: 800; font-size: 1.6em; display: flex; align-items: center; justify-content: center; }
.fail-box p { color: var(--text-dim); margin: 6px 0 10px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.result-actions .btn { flex: 1; min-width: 140px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; }
.big-actions { margin: 0 0 14px; }
.btn.copied { border-color: var(--mint) !important; color: var(--mint) !important; }
.results-grid a img { width: 100%; }
.hi-ph { width: 44px; height: 44px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-weight: 800; flex-shrink: 0; }
.prompt-cell { display: flex; gap: 10px; align-items: center; }
.thumb-sm { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); display: block; }
/* tooltips */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-dim); font-size: 11px; font-weight: 800; cursor: help; flex-shrink: 0; vertical-align: middle; font-style: normal; text-transform: none; letter-spacing: 0; }
.tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: min(280px, 80vw); padding: 10px 12px; border-radius: 10px; background: #ffffff; border: 1px solid var(--border); color: var(--text); font-size: 12.5px; font-weight: 500; line-height: 1.45; text-align: left; box-shadow: 0 12px 30px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 50; white-space: normal; }
.tip:hover::after, .tip:focus::after, .tip.open::after { opacity: 1; }
.tip:hover, .tip:focus, .tip.open { color: var(--text); border-color: var(--violet); outline: none; }
/* cabinet */
.side a { display: flex; align-items: center; gap: 10px; }
.side-logout { display: block; margin-top: 6px; }
.side-logout .btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 18px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, transform .2s; }
.quick-item:hover { border-color: var(--violet); transform: translateY(-2px); }
.quick-item .ico.big { color: var(--orange); width: 30px; height: 30px; }
.quick-item span { color: var(--text-dim); font-size: .82em; }
.amount-pill { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 16px; cursor: pointer; font-family: inherit; color: var(--text); }
.amount-pill small { color: var(--text-dim); font-size: .75em; font-weight: 600; }
.amount-pill.active { border-color: var(--violet); background: rgba(17,17,17,0.056); }
.flash .ico { vertical-align: -0.2em; margin-right: 4px; }
.flash .btn { margin-left: 8px; vertical-align: middle; display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 980px) {
  .howto { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .side a span { white-space: nowrap; }
  .side-logout { display: none; }
}
@media (max-width: 760px) {
  .topbar .nav a.link { padding: 12px; font-size: 1em; }
  .topbar .right { gap: 6px; }
  .brand-name .muted { display: none; }
  .topup-btn { padding: 8px 10px; }
  .balance-pill { padding: 7px 10px; }
  .play .panel { padding: 16px; }
  .output { min-height: 0; }
  .output-body { min-height: 260px; }
  .result-actions .btn { min-width: 0; flex: 1 1 45%; }
  .ex-chip { font-size: .78em; }
  /* stacked tables -> cards */
  table.t.stack thead { display: none; }
  table.t.stack, table.t.stack tbody, table.t.stack tr, table.t.stack td { display: block; width: 100%; }
  table.t.stack tr { border-bottom: 1px solid var(--border); padding: 10px 12px; }
  table.t.stack tr:last-child { border-bottom: 0; }
  table.t.stack td { border: 0; padding: 4px 0; text-align: left; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
  table.t.stack td[data-l]::before { content: attr(data-l); color: var(--text-dim); font-size: .8em; font-weight: 700; flex-shrink: 0; }
  table.t.stack td.cell-act { justify-content: flex-end; }
  table.t.stack .ellipsis { max-width: 55vw; }
  .dropzone { padding: 14px; }
}
@media (max-width: 420px) {
  .topup-btn span { display: none; }
  .brand-name { font-size: .92em; }
  .ratio-grid { grid-template-columns: repeat(5, 1fr); }
  .ratio > span { height: 58px; font-size: .7em; }
}
.play > * { min-width: 0; }
.ex-chip { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 980px) { .play { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .topbar { flex-wrap: wrap; } .topbar .right { margin-left: auto; } }
@media (max-width: 440px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar .right .avatar { display: none; }
  .menu-toggle { padding: 8px 10px; }
  .brand-name { font-size: .85em; }
  .brand-mark { width: 30px; height: 30px; }
}
.grid > *, .cab > *, .model-grid > *, .howto > *, .quick > * { min-width: 0; }
.cab { grid-template-columns: 220px minmax(0, 1fr); }
@media (max-width: 980px) { .cab { grid-template-columns: minmax(0, 1fr); } }
pre { max-width: 100%; }
.tip::after { display: none; }
.tip:hover::after, .tip:focus::after, .tip.open::after { display: block; }
@media (max-width: 760px) {
  .tip::after { position: fixed; left: 12px; right: 12px; bottom: 16px; top: auto; transform: none; width: auto; max-width: none; font-size: 14px; padding: 14px 16px; z-index: 1000; }
}
#output { scroll-margin-top: 84px; }
.newkey { border-color: rgba(16,217,154,.55); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.newkey h2 .ico { color: var(--mint); }
tr.revoked td { opacity: .55; }
.key-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; }
details.rename summary, details.secret summary { list-style: none; display: inline-flex; }
details.rename summary::-webkit-details-marker, details.secret summary::-webkit-details-marker { display: none; }
details.rename input { min-width: 140px; padding: 7px 10px; }
.steps-ol { padding-left: 20px; margin-bottom: 12px; color: var(--text-dim); }
.steps-ol li { margin-bottom: 6px; }

/* ===== v11: i18n switcher, market, model page, usage ===== */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 30px; overflow: hidden; background: var(--surface); flex: 0 0 auto; }
.lang-switch a { padding: 5px 10px; font-size: .74em; font-weight: 800; color: var(--text-dim); letter-spacing: .5px; }
.lang-switch a.active { background: #111111; color: #fff; }
.brand-api { font-weight: 800; }
.row-between { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.vlogo { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; flex: 0 0 auto; }
.mc-media { position: relative; }
.model-card .mc-preview { aspect-ratio: 16 / 9; }
.mc-vendor { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 20px; background: rgba(255,255,255,.72); backdrop-filter: blur(6px); font-size: .72em; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #fff; border: 1px solid rgba(0,0,0,.12); }
.mc-badge { position: absolute; right: 10px; top: 10px; padding: 4px 10px; border-radius: 20px; font-size: .72em; font-weight: 800; background: #111111; color: #fff; }
.model-card .meta { flex-wrap: wrap; justify-content: flex-start; }
.model-card .mc-foot { justify-content: space-between; margin-top: auto; }
.price small { font-weight: 600; font-size: .7em; }
.tag.task-t2i { color: var(--cyan); } .tag.task-i2i { color: var(--orange); } .tag.task-chat { color: var(--mint); }
.market-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.market-filters .search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 14px; }
.market-filters .search input { border: 0; background: transparent; outline: none; box-shadow: none; padding: 10px 0; flex: 1; color: var(--text); font: inherit; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-label { font-size: .72em; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); min-width: 84px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-size: .86em; font-weight: 700; }
.fchip:hover { color: var(--text); border-color: rgba(17,17,17,0.2); }
.fchip.active { color: #fff; background: rgba(17,17,17,0.072); border-color: var(--violet); }
.model-card[hidden] { display: none; }
.pmodel { display: inline-flex; gap: 8px; align-items: center; }
/* model page */
.switcher { padding-top: 18px; }
.sw { flex-direction: row; width: auto; padding: 7px 12px; font-size: .82em; gap: 8px; border-radius: 30px; }
.sw-logo { width: 18px !important; height: 18px !important; border-radius: 0 !important; object-fit: contain; }
.model-head2 { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; padding: 22px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.mh-main { flex: 1 1 520px; min-width: 0; }
.mh-title { display: flex; gap: 14px; align-items: center; }
.mh-title h1 { font-size: clamp(1.6em, 4vw, 2.2em); line-height: 1.15; }
.mh-logo { width: 54px; height: 54px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mh-id { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.mh-id code { font-size: .85em; }
.mh-desc { color: var(--text-dim); margin: 12px 0 8px; max-width: 760px; }
.mh-price { font-size: .9em; color: var(--text-dim); }
.mh-price .ico { vertical-align: -3px; }
.mh-actions { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.panel-head h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.seg-sm { display: inline-flex; gap: 0; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex-wrap: nowrap; }
.seg-sm button { border: 0; background: transparent; color: var(--text-dim); font: inherit; font-size: .82em; font-weight: 700; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.seg-sm button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.pname { font-size: .85em; color: var(--cyan); background: transparent; padding: 0; }
.req { color: var(--pink); }
.play-actions { display: flex; gap: 10px; align-items: stretch; margin-top: 8px; }
.play-actions .grow { flex: 1; }
.code-tabs { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 8px 0 12px; background: #f6f6f7; }
.ct-bar { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface); }
.ct { border: 0; background: transparent; color: var(--text-dim); font: inherit; font-size: .82em; font-weight: 700; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.ct.active { background: var(--surface-3); color: var(--text); }
.ct-pane { display: none; margin: 0 !important; border: 0 !important; border-radius: 0 !important; }
.ct-pane.active { display: block; }
.api-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 26px; }
.method { font-size: .72em; font-weight: 800; padding: 2px 7px; border-radius: 6px; }
.method.post { background: rgba(16,217,154,.15); color: var(--mint); } .method.get { background: rgba(17,17,17,0.06); color: #27272a; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ex-card { margin: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.ex-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ex-card figcaption { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ex-quote { padding: 18px 16px 4px; font-size: 1.02em; font-weight: 600; flex: 1; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 26px; }
.about-grid .mc-preview { aspect-ratio: 16 / 9; border-radius: 16px; border: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--text-dim); font-weight: 800; }
.faq details[open] summary::after { content: '−'; }
.faq p { color: var(--text-dim); margin-top: 8px; }
.big-steps { display: flex; flex-direction: column; gap: 14px; }
.big-steps li b { display: block; }
.big-steps li span { color: var(--text-dim); font-size: .92em; }
.checklist { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.checklist .ck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.checklist li.done .ck { background: var(--mint); border-color: var(--mint); color: #000; }
.checklist li.done a { color: var(--text-dim); text-decoration: line-through; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 6px 0 0; overflow-x: auto; }
.bar-col { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-v { width: 100%; max-width: 34px; background: #111111; border-radius: 6px 6px 2px 2px; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.bar-v i { display: block; width: 100%; background: rgba(255,55,95,.85); }
.bar-col small { font-size: .62em; color: var(--text-dim); white-space: nowrap; }
.grow { flex: 1; }
@media (max-width: 900px) {
  .api-grid, .about-grid { grid-template-columns: 1fr; }
  .mh-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; width: 100%; }
  .mh-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .topbar .right .btn-primary span { display: none; }
  .chip-label { min-width: 0; width: 100%; }
  .lang-switch a { padding: 4px 8px; }
  .panel-head { flex-wrap: wrap; }
}
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip-row > .fchip { flex: 0 0 auto !important; width: auto !important; min-width: 0 !important; }
.chip-row > .grow { flex: 1 1 0; min-width: 8px; }
small.row-between { display: flex !important; width: 100%; margin-top: 4px; }
small.row-between > [data-count] { flex: none; font-variant-numeric: tabular-nums; }
/* v13: task chips, model families, mode switch */
.market-filters .task-chips { margin-bottom: 12px; }
.fchip.big { padding: 9px 18px; font-size: .95em; }
.filters-2 { display: flex; gap: 12px 18px; align-items: center; flex-wrap: wrap; }
.filters-2 .search { flex: 1 1 320px; }
.filters-2 .chip-row { margin-bottom: 0; }
.mode-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.mode-switch { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.mode-switch a { padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: .92em; color: var(--text-dim); white-space: nowrap; }
.mode-switch a:hover { color: var(--text); text-decoration: none; }
.mode-switch a.active { color: #fff; background: #111111; }
.mode-bar > .muted code { font-size: .92em; }
@media (max-width: 600px) { .mode-switch { width: 100%; } .mode-switch a { flex: 1; text-align: center; padding: 9px 8px; } }
/* v13: Telegram deep-link login */
.tg-wait { display: flex; gap: 16px; align-items: flex-start; text-align: left; margin: 14px 0 6px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.tg-wait[hidden] { display: none; }
.tg-qr { flex: 0 0 132px; width: 132px; height: 132px; background: #fff; border-radius: 10px; padding: 4px; }
.tg-qr svg { width: 100%; height: 100%; display: block; }
.tg-wait p { margin: 6px 0; }
.spinner-sm { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--violet); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; margin-right: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 600px), (pointer: coarse) { .tg-qr, .tg-qr-hint { display: none; } }

/* Lava.top packages (radio pills) */
label.amount-pill { position: relative; }
.amount-pill:has(input:checked) { border-color: var(--violet); background: rgba(17,17,17,0.056); }
/* Support tickets */
.state.open::before { background: var(--yellow); } .state.open { color: var(--yellow); }
.state.answered::before { background: var(--mint); } .state.answered { color: var(--mint); }
.state.closed::before { background: var(--text-dim); } .state.closed { color: var(--text-dim); }
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.msg { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 12px 15px; max-width: 86%; align-self: flex-end; }
.msg.admin { align-self: flex-start; border-color: rgba(17,17,17,0.18); background: rgba(17,17,17,0.032); }
.msg .meta { font-size: .8em; color: var(--text-dim); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg .body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.msg .shot-link img { display: block; max-width: 100%; max-height: 360px; border-radius: 10px; margin-top: 10px; border: 1px solid var(--border); }
#reply { scroll-margin-top: 88px; }
.ticket-form textarea { min-height: 140px; background: #fff; }
.ticket-form input[type=file] { color: var(--text-dim); max-width: 100%; }
@media (max-width: 640px) { .msg { max-width: 100%; } }

/* ===== Generation page v2 (simple step-by-step form + result panel) ===== */
.ghead { display: flex; align-items: center; gap: 14px; padding: 18px 0 16px; flex-wrap: wrap; }
.ghead-main { flex: 1 1 300px; min-width: 0; }
.ghead h1 { font-size: clamp(1.45em, 4.4vw, 2.1em); line-height: 1.15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ghead-main p { color: var(--text-dim); margin-top: 4px; max-width: 720px; }
.ghead-price { display: flex; flex-direction: column; align-items: flex-end; padding: 10px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.ghead-price b { font-size: 1.35em; background: #111111; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ghead-price span { font-size: .8em; color: var(--text-dim); }
.gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.gen-form, .gen-out { min-width: 0; }
.gen-out { position: sticky; top: 86px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.gstep { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.gs-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.gs-num { flex: 0 0 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: #111111; box-shadow: 0 6px 18px rgba(17,17,17,0.14); }
.gs-head h2 { font-size: 1.15em; line-height: 32px; margin: 0; }
.gs-head p { color: var(--text-dim); font-size: .86em; margin-top: -2px; }
/* mode tabs */
.gmodes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.gmode { position: relative; display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--border); color: var(--text-dim); transition: border-color .2s, background .2s; }
.gmode:hover { text-decoration: none; border-color: rgba(17,17,17,0.22); color: var(--text); }
.gmode b { display: block; color: var(--text); font-size: 1.05em; }
.gmode small { display: block; font-size: .8em; line-height: 1.35; margin-top: 2px; }
.gmode-ico { flex: 0 0 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface-3); border: 1px solid var(--border); }
.gmode.active { border-color: var(--violet); background: #f4f4f5; color: var(--text); box-shadow: 0 0 0 3px rgba(17,17,17,0.072); }
.gmode.active .gmode-ico { background: #111111; border-color: transparent; color: #fff; }
/* checkmark badge used on all selectable options */
.ck { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--violet); display: none; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(17,17,17,0.2); }
.ck svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gmode.active .ck { display: flex; top: 10px; right: 10px; }
/* upload zone */
.gdrop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 170px; padding: 22px 16px; border: 2px dashed #d4d4d8; border-radius: 18px; background: repeating-linear-gradient(135deg, rgba(0,0,0,.012) 0 12px, transparent 12px 24px), var(--surface-2); cursor: pointer; text-align: center; transition: border-color .2s, background-color .2s, transform .15s; }
.gdrop:hover, .gdrop.drag, .gdrop:focus-visible { border-color: var(--violet); background-color: rgba(17,17,17,0.03); outline: none; }
.gdrop.drag { transform: scale(1.01); }
.gdrop-ico { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(17,17,17,0.056); color: var(--violet); margin-bottom: 4px; }
.gdrop-title { font-size: 1.02em; }
.gdrop-sub { color: var(--text-dim); font-size: .82em; }
.gdrop.has { min-height: 84px; flex-direction: row; gap: 12px; padding: 14px; }
.gdrop.has .gdrop-ico { width: 40px; height: 40px; margin: 0; }
.gdrop.has .gdrop-sub { display: none; }
.gdrop.has .only-desk, .gdrop.has .only-mob { display: none; }
.gdrop.has .gdrop-title::after { content: attr(data-more); }
.gdrop.full { display: none; }
.gthumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.gthumbs:not(:empty) { margin-top: 12px; }
.gthumbs .thumb { width: 120px; height: 120px; border-radius: 14px; }
.gthumbs .thumb button { width: 28px; height: 28px; top: 6px; right: 6px; font-size: 16px; line-height: 28px; }
.thumb-ok { position: absolute; left: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.thumb.loading .thumb-ok { display: none; }
.only-mob { display: none; }
@media (pointer: coarse), (max-width: 760px) { .only-desk { display: none; } .only-mob { display: inline; } }
/* prompt */
.gprompt { position: relative; display: block; }
.gprompt textarea { min-height: 120px; font-size: 1em; padding: 14px 14px 26px; border-radius: 14px; }
.gcount { position: absolute; right: 12px; bottom: 8px; font-size: .75em; color: var(--text-dim); pointer-events: none; }
.gideas { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; align-items: center; }
/* settings */
.gset + .gset { margin-top: 16px; }
.gset-title { font-weight: 800; font-size: .92em; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.rt-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.rt-grid-sm { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); margin-top: 8px; }
.rt, .gseg label { position: relative; }
.rt input, .gseg input { position: absolute; opacity: 0; pointer-events: none; }
.rt > span { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 92px; padding: 8px 4px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--border); cursor: pointer; color: var(--text-dim); transition: border-color .15s, background .15s; }
.rt-grid-sm .rt > span { height: 70px; }
.rt-shape { flex: 1; display: flex; align-items: center; justify-content: center; }
.rt b { font-size: .86em; color: var(--text); }
.rt small { font-size: .68em; line-height: 1.1; }
.rt > span:hover, .gseg label > span:hover { border-color: rgba(17,17,17,0.22); }
.rt input:checked + span, .gseg input:checked + span { border-color: var(--violet); background: rgba(17,17,17,0.056); color: var(--text); box-shadow: 0 0 0 3px rgba(17,17,17,0.072); }
.rt input:checked + span .ck, .gseg input:checked + span .ck { display: flex; }
.rt input:focus-visible + span, .gseg input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.rt input:checked + span .rbox { background: rgba(17,17,17,0.14); border-color: var(--violet); }
.rt-more { margin-top: 8px; }
.rt-more summary { cursor: pointer; color: var(--text-dim); font-size: .86em; font-weight: 700; list-style: none; display: inline-flex; gap: 6px; align-items: center; padding: 4px 0; }
.rt-more summary::-webkit-details-marker { display: none; }
.rt-more summary::before { content: '+'; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.rt-more[open] summary::before { content: '−'; }
.gseg { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.gseg label > span { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; padding: 9px 8px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--border); cursor: pointer; transition: border-color .15s, background .15s; }
.gseg b { font-size: .98em; }
.gseg small { color: var(--text-dim); font-size: .74em; }
/* submit */
.gsubmit { padding: 4px 0 6px; }
.gen-btn { width: 100%; min-height: 60px; font-size: 1.12em; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 18px; }
.gen-price { padding: 3px 12px; border-radius: 20px; background: rgba(0,0,0,.25); font-size: .88em; }
.gen-btn.pulse { animation: genpulse 0.8s ease 2; }
@keyframes genpulse { 50% { box-shadow: 0 0 0 8px rgba(17,17,17,0.14); } }
.gsub-note { text-align: center; color: var(--text-dim); font-size: .82em; margin-top: 8px; }
.gsub-note .ico { width: 15px; height: 15px; vertical-align: -3px; }
.gsubmit .flash { margin-top: 10px; }
/* result panel */
.gout-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.gout-head h2 { font-size: 1.15em; margin: 0; }
.gout-body { min-height: 380px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); padding: 14px; position: relative; overflow: hidden; }
.gout-body img { max-width: 100%; max-height: 68vh; border-radius: 12px; display: block; margin: 0 auto; }
.gout-body .results-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.gout-body .text-result { white-space: pre-wrap; width: 100%; align-self: stretch; line-height: 1.6; max-height: 68vh; overflow: auto; }
.gempty { text-align: center; max-width: 340px; }
.gempty-art { width: 170px; height: 170px; margin: 0 auto 14px; border-radius: 22px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--text-dim); position: relative; }
.gempty-art img { width: 100%; height: 100%; object-fit: cover; opacity: .55; filter: saturate(.8); border-radius: 0; max-height: none; }
.gempty b { display: block; font-size: 1.05em; margin-bottom: 4px; }
.gen-out .result-actions { margin-top: 12px; }
.gen-out .result-actions .btn { min-height: 54px; font-size: 1.02em; }
.gen-out [data-meta] { margin-top: 10px; }
.gen-out [data-meta]:empty { display: none; }
.grecent { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.grecent-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.grecent-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.grecent-item { flex: 0 0 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); transition: border-color .2s, transform .2s; }
.grecent-item:hover { border-color: var(--violet); transform: translateY(-2px); }
.grecent-item img { width: 100%; height: 100%; object-fit: cover; }
/* about */
.gabout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; margin-top: 30px; }
.gabout-main, .gabout-ex { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.gabout h2 { font-size: 1.2em; margin-bottom: 10px; }
.gabout h3 { font-size: 1.05em; margin-bottom: 10px; }
.gabout-main > p { color: var(--text-dim); margin-bottom: 10px; line-height: 1.6; }
.gprices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 14px 0 10px; }
.gprices div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: .9em; }
.gabout-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.gtry { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font: inherit; font-size: .9em; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; cursor: pointer; margin-bottom: 8px; transition: border-color .2s; }
.gtry:hover { border-color: var(--violet); }
.gtry .ico { color: var(--violet); flex: 0 0 auto; margin-top: 2px; }
@media (max-width: 980px) {
  .gen { grid-template-columns: minmax(0, 1fr); }
  .gen-out { position: static; }
  .gabout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ghead { gap: 10px; padding: 12px 0; }
  .ghead .mh-logo { width: 44px; height: 44px; }
  .ghead-main { flex-basis: calc(100% - 60px); }
  .ghead-main p { font-size: .9em; }
  .ghead-price { flex-direction: row; align-items: baseline; gap: 8px; width: 100%; padding: 8px 14px; }
  .gstep, .gen-out, .gabout-main, .gabout-ex { padding: 16px; border-radius: 18px; }
  .gmodes { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gmode { flex-direction: column; text-align: center; padding: 12px 8px; gap: 6px; }
  .gmode-ico { flex: 0 0 auto; width: 40px; height: 40px; }
  .gmode small { display: none; }
  .rt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rt > span { height: 84px; }
  .gdrop { min-height: 150px; }
  .gthumbs .thumb { width: 96px; height: 96px; }
  .gout-body { min-height: 260px; }
  .gempty-art { width: 120px; height: 120px; }
  .gen-out .result-actions .btn { flex: 1 1 45%; min-width: 0; }
}
.balance-pill { white-space: nowrap; }
.gen-out .result-actions .btn { white-space: nowrap; }
@media (max-width: 400px) { .gen-out .result-actions .btn { font-size: .95em; padding-left: 10px; padding-right: 10px; } }
/* model page: price + API docs button; admin link on the right of the top bar */
.ghead-side { display: flex; align-items: stretch; gap: 10px; }
.ghead-api { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 700; transition: border-color .2s, background .2s; }
.ghead-api:hover { border-color: var(--violet); background: var(--surface-3); }
.ghead-api .ico { width: 20px; height: 20px; color: var(--violet); }
.ghead-api span { display: flex; flex-direction: column; line-height: 1.2; }
.ghead-api b { font-size: 1.05em; }
.ghead-api small { font-size: .75em; color: var(--text-dim); font-weight: 600; }
.topbar .right .admin-link { padding: 8px 12px; gap: 6px; }
.topbar .right .admin-link.active { border-color: var(--violet); }
@media (max-width: 760px) {
  .ghead-side { width: 100%; }
  .ghead-side .ghead-price { flex: 1; width: auto; }
  .ghead-api { padding: 8px 14px; }
}
@media (max-width: 560px) { .topbar .right .admin-link span { display: none; } .topbar .right .admin-link { padding: 8px 10px; } }
/* ===== Header v2: one row, profile menu, admin stacked above top-up ===== */
.topbar { flex-wrap: nowrap; }
.topbar .brand { flex: 0 0 auto; }
.topbar .nav { flex-wrap: nowrap; gap: 2px; min-width: 0; }
.topbar .nav a.link { padding: 8px 10px; white-space: nowrap; }
.topbar .nav a.only-burger { display: none; }
.topbar .right { flex: 0 0 auto; gap: 8px; }
.hstack { display: flex; flex-direction: column; gap: 3px; }
.hstack .btn { white-space: nowrap; }
.hstack.two .btn { padding: 3px 10px; font-size: .74em; border-radius: 8px; min-height: 0; line-height: 1.25; gap: 5px; justify-content: flex-start; }
.hstack.two .btn .ico { width: 13px; height: 13px; }
.topbar .right .hstack .admin-link { padding: 3px 10px; }
.pmenu { position: relative; }
.pmenu summary { list-style: none; cursor: pointer; display: flex; border-radius: 50%; }
.pmenu summary::-webkit-details-marker { display: none; }
.pmenu[open] summary .avatar, .pmenu summary:hover .avatar { border-color: var(--violet); }
.pmenu-list { position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; padding: 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow-soft); z-index: 100; display: flex; flex-direction: column; }
.pmenu-name { padding: 8px 10px 6px; font-weight: 800; font-size: .9em; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmenu-list a, .pmenu-list button { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; color: var(--text); font: inherit; font-weight: 700; font-size: .92em; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.pmenu-list a:hover, .pmenu-list button:hover { background: var(--surface-3); }
.pmenu-list .ico { width: 17px; height: 17px; color: var(--text-dim); }
.pmenu-list form { margin: 0; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
@media (max-width: 1180px) { .topbar .nav a.link .ico { display: none; } }
@media (max-width: 1060px) { .topbar { padding-left: 14px; padding-right: 14px; gap: 8px; } .topbar .nav a.link { padding: 8px 8px; font-size: .9em; } }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .topbar .nav a.only-burger { display: inline-flex; }
  .topbar .nav a.link .ico { display: inline-block; }
  .pmenu { display: none; }
}
@media (max-width: 420px) { .hstack.two .btn span { display: none; } .hstack.two .btn { padding: 4px 8px; } .topbar .brand-name { font-size: .95em; } }
.gseg-inline { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.gseg-inline a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: .92em; color: var(--text-dim); }
.gseg-inline a.on { background: #111111; color: #fff; }
.gseg-inline .ico { width: 16px; height: 16px; }
/* billing: one top-up block */
.bal-stat { max-width: 360px; margin-bottom: 18px; }
.topup { display: flex; flex-direction: column; gap: 14px; }
.topup > h2 { margin-bottom: 0; }
.topup .gs-head { margin: 4px 0 0; }
.amt { display: flex; flex-direction: column; gap: 12px; }
.amt[hidden] { display: none; }
.amt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.amt-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.amt-tile input { position: absolute; opacity: 0; pointer-events: none; }
.amt-tile span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.amt-tile b { font-size: 1.2em; font-weight: 800; }
.amt-tile small { font-size: .78em; color: var(--text-dim); }
.amt-tile:hover { border-color: var(--violet); }
.amt-tile.active { border-color: var(--violet); background: #f4f4f5; }
.amt-custom { max-width: 260px; margin: 0; }
.pay-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pay-tile { cursor: pointer; }
.pay-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pay-tile > span { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--border); }
.pay-tile .ico { grid-row: span 2; width: 22px; height: 22px; color: var(--violet); }
.pay-tile small { color: var(--text-dim); font-size: .8em; }
.pay-tile:hover > span { border-color: var(--violet); }
.pay-tile.active > span, .pay-tile input:checked + span { border-color: var(--violet); background: #f4f4f5; }
.topup-email { max-width: 360px; margin: 0; }
.topup-pay { align-self: flex-start; }
@media (max-width: 600px) { .amt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pay-tiles { grid-template-columns: minmax(0, 1fr); } .topup-pay { align-self: stretch; } .amt-custom, .topup-email { max-width: none; } }

/* brand: two lines (МиксМедиа / API), same markup on the site and in the docs */
.brand-name { display: inline-flex; flex-direction: column; line-height: 1.05; }
.brand-name .brand-api { display: block; font-size: .92em; }

/* expired pictures (kept 24 h) */
.thumb-gone { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--dim); flex-shrink: 0; }
.thumb-gone .ico { width: 18px; height: 18px; opacity: .7; }
.img-gone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px; padding: 24px; border-radius: 14px; border: 1px dashed var(--border); background: var(--surface-2); color: var(--dim); text-align: center; margin-bottom: 12px; }
.img-gone .ico.big { width: 40px; height: 40px; opacity: .6; }

/* ===== light theme (black & white) ===== */
.btn-primary, .btn-primary:hover { background: var(--ink); color: #fff; box-shadow: none; }
.btn-primary:hover { background: #2a2a2e; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.fchip.active { color: var(--text); background: var(--surface-3); border-color: var(--ink); }
.mc-art, .sw img, .sw-art { color: var(--text); }
.art-image, .art-text { background: var(--surface-3); }
.sw.active { background: var(--surface); border: 2px solid var(--ink); }
.checklist li.done .ck { color: #fff; }
.tip::after { color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.gen-price { background: rgba(255,255,255,.16); }
.ghead-price b, .mhead-price b { background: none; -webkit-text-fill-color: currentColor; color: var(--text); }
.gdrop { background: var(--surface-2); border-color: #d4d4d8; }
.gdrop-ico { background: var(--surface-3); color: var(--text); }
.rt input:checked + span .rbox { background: var(--ink); border-color: var(--ink); }
.rt input:checked + span, .gseg input:checked + span, .ratio input:checked + span, .seg input:checked + span,
.amt-tile.active, .pay-tile.active > span, .pay-tile input:checked + span, .amount-pill.active, .amount-pill:has(input:checked) { border-color: var(--ink); background: var(--surface-2); box-shadow: 0 0 0 1px var(--ink); }
.gmode.active { border-color: var(--ink); background: var(--surface-2); box-shadow: 0 0 0 1px var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.spinner { background: conic-gradient(from 0deg, rgba(17,17,17,.08), #111111); }
.state.ok, .pos { color: var(--mint); }
.bar-v { background: #3f3f46; }
.bar-v i { background: #a1a1aa; }
.flash.info { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.method.post { background: rgba(26,127,75,.1); } .method.get { background: var(--surface-3); color: var(--text); }
.topbar, .site-header { background: rgba(255,255,255,.92); }
.brand-mark { background: #e4e4e7 !important; }
.brand-name .brand-api { color: #6b6b73; -webkit-text-fill-color: #6b6b73; background: none; }
.thumb-sm { border-color: var(--border); }
.img-gone, .thumb-gone { background: var(--surface-2); }
.balance-pill, .bal { background: var(--surface-2); color: var(--text); }
.tag.hot, .mc-badge { background: var(--ink); color: #fff; }
.price { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.model-card:hover { border-color: #a1a1aa; box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.mc-vendor { color: var(--text); border-color: var(--border); }
.gempty-icon { display: flex; align-items: center; justify-content: center; background: var(--surface-3); border: 1px solid var(--border); }
.gempty-icon .ico.big { width: 44px; height: 44px; color: #a1a1aa; }

/* ---- Model page, apimart-like layout (29.09.2026) ---- */
.mp-top { display: flex; align-items: center; gap: 14px; padding-top: 14px; flex-wrap: wrap; }
.mp-top .switcher { flex: 1 1 auto; min-width: 0; margin: 0; }
.mp-back { font-size: .8em; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.mp-back:hover { color: var(--text); }
.mp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.mp-hero { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 16px; margin-top: 16px; }
.mp-kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-logo { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #fff; }
.mp-cat { font-size: .72em; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--border); border-radius: 4px; padding: 5px 9px; color: var(--text-dim); }
.mp-intro h1 { font-size: clamp(1.8em, 4.6vw, 2.6em); line-height: 1.1; margin: 18px 0 12px; font-weight: 500; letter-spacing: -.01em; }
.mp-desc { color: var(--text-dim); max-width: 640px; line-height: 1.6; }
.mp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.mp-tags span { font-size: .8em; border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px; color: var(--text-dim); background: var(--surface-2); }
.mp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mp-side h2 { font-size: .95em; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }
.mp-checks { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; font-size: .9em; }
.mp-checks li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.mp-checks .ck { flex: none; width: 18px; height: 18px; border: 1px solid #16a34a; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; position: static; background: none; }
.mp-checks .ck svg { width: 11px; height: 11px; stroke: #16a34a; fill: none; stroke-width: 3; }
.mp-price { display: flex; align-items: baseline; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; margin-bottom: 12px; }
.mp-price b { font-size: 1.6em; font-weight: 600; }
.mp-price span { color: var(--text-dim); font-size: .85em; }
.btn-block { width: 100%; justify-content: center; }
.mp-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin: 26px 0 16px; overflow-x: auto; }
.mp-tabs a { padding: 10px 0; font-size: .92em; color: var(--text-dim); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.mp-tabs a.active { color: var(--text); border-bottom-color: var(--ink); font-weight: 500; }
.mp-tabs-gap { height: 22px; }
.gen.mp-play { grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); gap: 16px; }
.mp-panel { padding: 18px; }
.gen-out.mp-panel { position: sticky; top: 86px; border-radius: 12px; }
.mp-ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.mp-ph h2 { font-size: 1em; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; margin: 0; }
.mp-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.mp-toggle button { border: 0; background: none; padding: 5px 12px; font: inherit; font-size: .78em; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; color: var(--text-dim); }
.mp-toggle button.active { background: var(--ink); color: #fff; }
.mp-field { display: block; margin-bottom: 14px; }
.mp-label { display: flex; align-items: center; gap: 6px; font-size: .86em; font-weight: 500; margin-bottom: 6px; }
.mp-label small { margin-left: auto; font-weight: 400; }
.mp-select { position: relative; display: block; }
.mp-select select { width: 100%; appearance: none; -webkit-appearance: none; font: inherit; font-size: .9em; padding: 9px 34px 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; }
.mp-select::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid #71717a; border-bottom: 1.5px solid #71717a; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.mp-select select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.mp-static { font-size: .9em; padding: 9px 12px; border: 1px dashed var(--border); border-radius: 6px; color: var(--text-dim); background: var(--surface-2); }
.mp .gprompt textarea { border-radius: 6px; }
.mp-drop { padding: 16px 12px; min-height: 0; border-radius: 6px; }
.mp-drop .gdrop-ico { width: 34px; height: 34px; }
.mp .gideas { margin-top: 8px; }
.mp .gsubmit { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.mp .gen-btn { width: 100%; justify-content: center; border-radius: 6px; }
.mp-json { background: #0f0f10; color: #e4e4e7; border-radius: 6px; padding: 12px; font-size: .78em; line-height: 1.5; overflow: auto; max-height: 420px; white-space: pre; margin: 8px 0; }
[data-copy-json].done::after { content: " ✓"; }
.mp .gout-body { min-height: 440px; border-radius: 8px; }
.mp-keep { margin-top: 10px; display: flex; gap: 6px; align-items: center; }
.mp-prices { margin-top: 22px; }
.mp-prices h2, .mp-similar h2 { font-size: 1.15em; font-weight: 500; margin: 0 0 14px; }
.mp-table { width: 100%; border-collapse: collapse; font-size: .9em; }
.mp-table th, .mp-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.mp-table th { font-weight: 500; color: var(--text-dim); font-size: .85em; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
.mp-table td:nth-child(3) { color: var(--text-dim); font-size: .92em; max-width: 380px; }
.mp-prices > p { margin-top: 10px; }
.mp .gabout { margin-top: 22px; }
.mp-similar { margin: 26px 0 10px; }
.mp-sim-head { display: flex; justify-content: space-between; align-items: baseline; }
@media (max-width: 980px) {
  .mp-hero { grid-template-columns: minmax(0, 1fr); }
  .gen.mp-play { grid-template-columns: minmax(0, 1fr); }
  .gen-out.mp-panel { position: static; }
}
@media (max-width: 640px) {
  .mp-card { padding: 16px; }
  .mp-intro h1 { margin: 14px 0 8px; }
  .mp-actions .btn { flex: 1 1 100%; justify-content: center; }
  .mp .gout-body { min-height: 300px; }
  .mp-table th:nth-child(3), .mp-table td:nth-child(3) { display: none; }
  .mp-top { gap: 8px; }
  .mp-top .switcher { flex-basis: 100%; }
}
.mp-hero { grid-template-columns: minmax(0, 1fr); }
.mp-actions { align-items: center; }
.mp-actions .mp-price { border: 0; padding: 0 0 0 8px; margin: 0; }
.mp .gset { margin-bottom: 14px; }
.mp .rt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mp .gseg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
/* ratio dropdown */
.rdd { position: relative; }
.rdd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; font: inherit; text-align: left; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; }
.rdd-btn:focus-visible, .rdd.open .rdd-btn { outline: 2px solid var(--ink); outline-offset: 1px; }
.rdd-cur, .rdd-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rdd-cur b, .rdd-list li b { font-weight: 600; font-size: .9em; min-width: 38px; }
.rdd-cur small, .rdd-list li small { color: var(--text-dim); font-size: .82em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdd-shape { flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.rdd-shape .rbox { border: 1.5px solid #3f3f46; border-radius: 3px; background: none; transform: scale(.85); }
.rdd-shape .rauto { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border-style: dashed; }
.rdd-caret { flex: none; width: 7px; height: 7px; border-right: 1.5px solid #71717a; border-bottom: 1.5px solid #71717a; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.rdd.open .rdd-caret { transform: translateY(2px) rotate(225deg); }
.rdd-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.rdd-list li { padding: 3px 8px; border-radius: 5px; cursor: pointer; position: relative; }
.rdd-list li:hover, .rdd-list li:focus { background: var(--surface-2); outline: none; }
.rdd-list li[aria-selected=true] { background: #f4f4f5; }
.rdd-list li .ck { position: static; margin-left: auto; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); display: none; align-items: center; justify-content: center; }
.rdd-list li .ck svg { width: 11px; height: 11px; stroke: #fff; fill: none; stroke-width: 3; }
.rdd-list li[aria-selected=true] .ck { display: inline-flex; }
.rdd-shape .rbox { display: block; flex: none; margin: 0; }
/* result keeps its real aspect ratio (was stretched by width:100% + max-height) */
.gout-body .results-grid a { display: flex; justify-content: center; align-items: center; }
.gout-body .results-grid a img, .gout-body img { width: auto; height: auto; max-width: 100%; max-height: 68vh; object-fit: contain; }
@media (max-width: 640px) { .gout-body .results-grid a img, .gout-body img { max-height: 75vh; } }
/* many options (GPT quality): 3 per row, 2 on narrow phones */
.mp .gseg.gseg-many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gseg.gseg-many label > span { min-height: 52px; text-align: center; }
.gseg.gseg-many b { line-height: 1.15; }
@media (max-width: 360px) { .mp .gseg.gseg-many { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .mp .gseg label > span { padding: 8px 3px; } .mp .gseg b { font-size: .86em; } .mp .gseg small { font-size: .7em; } }
/* phones: checkmark sits on the tile corner so it never covers the label */
@media (max-width: 480px) { .mp .gseg label > span { overflow: visible; } .mp .gseg .ck { top: -7px; right: -7px; width: 18px; height: 18px; box-shadow: 0 0 0 2px #fff; } .mp .gseg { padding-top: 4px; } }
