/* ===== 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: #09090d; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; overflow-x: auto; font-size: .85em; line-height: 1.55; color: #d9d7e3; 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%, #0b0b0f 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(139,92,246,.6); box-shadow: 0 20px 46px rgba(139,92,246,.16); }
.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: linear-gradient(120deg, var(--orange), var(--pink)); color: #fff; border-color: transparent; }
.tag.cat-image { color: var(--cyan); } .tag.cat-text { color: var(--mint); }
.price { font-weight: 800; background: linear-gradient(120deg, var(--orange), var(--pink)); 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(139,92,246,.18); }
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: linear-gradient(120deg, #ff375f, #d946ef); }
.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(139,92,246,.06); }
.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, #ffd60a, #ff9500, #ff375f, #d946ef, #8b5cf6, #3b82f6, #06b6d4, #10d99a, #ffd60a); -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: #ff6b8b; }
.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: linear-gradient(120deg, var(--violet), var(--blue)); border-color: transparent; box-shadow: 0 8px 22px rgba(139,92,246,.32); }
.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(255,255,255,.015); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos { color: var(--mint); } .neg { color: #ff6b8b; }
.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: linear-gradient(120deg, var(--violet), var(--blue)); }
.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: #ff8aa3; }
.flash.info { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.4); color: #9cc0ff; }
.keybox { font-family: ui-monospace, monospace; background: #09090d; 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(34,158,217,.35); }
.btn-login.gh { background: #24292f; border: 1px solid #3d444d; box-shadow: 0 10px 26px rgba(0,0,0,.35); }
.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(255,214,10,.55), transparent 45%), radial-gradient(circle at 80% 30%, rgba(217,70,239,.6), transparent 50%), radial-gradient(circle at 50% 90%, rgba(6,182,212,.55), transparent 55%), #15121f; }
.art-text { background: radial-gradient(circle at 20% 20%, rgba(16,217,154,.45), transparent 50%), radial-gradient(circle at 85% 80%, rgba(59,130,246,.55), transparent 55%), #0f1418; }
.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(139,92,246,.1); }
.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(139,92,246,.14); color: var(--text); box-shadow: 0 0 0 2px rgba(139,92,246,.25); }
.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(139,92,246,.14); box-shadow: 0 0 0 2px rgba(139,92,246,.25); }
.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: #ff6b8b; 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: #1f1f28; 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(139,92,246,.14); }
.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(16,217,154,.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: linear-gradient(120deg, var(--violet), var(--blue)); 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(5,5,7,.72); backdrop-filter: blur(6px); font-size: .72em; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #fff; border: 1px solid rgba(255,255,255,.12); }
.mc-badge { position: absolute; right: 10px; top: 10px; padding: 4px 10px; border-radius: 20px; font-size: .72em; font-weight: 800; background: linear-gradient(120deg, var(--orange), var(--pink)); 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(139,92,246,.5); }
.fchip.active { color: #fff; background: rgba(139,92,246,.18); 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,.4); }
.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: #08080c; }
.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(59,130,246,.15); color: #7fb0ff; }
.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: linear-gradient(180deg, var(--violet), var(--blue)); 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: linear-gradient(120deg, var(--violet), var(--blue)); }
.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; } }
