.sidebar-account {border-top:1px solid var(--line);margin-top:18px;padding:17px 3px 0;display:grid;gap:9px;text-align:center}
.sidebar-account .signin-link {justify-self:center;padding:6px 12px;font-size:14px;color:var(--accent);text-decoration:underline;text-underline-offset:3px}
#sidebar nav a:last-child {margin-top:16px}
.screenreader {position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%)}
.work-head {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:6px 0 24px}
.work-head h1 {font-size:clamp(40px,3.4vw,62px)}
.demo-note {display:flex;align-items:center;gap:7px;border:1px solid var(--line);padding:5px 11px;border-radius:20px;color:#71575f;font-size:12px;white-space:nowrap}
.demo-note i {width:7px;height:7px;border-radius:50%;background:#b16a7f}
.workbench {display:grid;grid-template-columns:minmax(250px,330px) minmax(0,1fr);min-height:670px;border:1px solid var(--line);border-radius:19px;overflow:hidden;background:#fffdfb}
.work-controls {padding:clamp(16px,1.75vw,30px);border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:stretch;background:#fffdfa}
.work-controls fieldset {padding:0;margin:0;min-width:0;border:0}
.work-controls label,.work-controls legend {font-weight:550;font-size:14px}
.work-controls legend {margin:0 0 8px;float:none;padding:0}
.work-controls legend small {font-weight:400;color:var(--muted);font-size:12px;margin-left:5px}
.work-controls select {width:100%;background:#fcf8f6}
.work-controls .typechoice {display:flex;padding:4px;border-radius:12px;background:#f4edeb;margin:0 0 20px}
.typechoice label,.ratios label {cursor:pointer;position:relative}
.typechoice label {flex:1}
.typechoice input,.ratios input {position:absolute;opacity:0}
.typechoice span,.ratios span {display:block;text-align:center;padding:8px;border-radius:9px}
.typechoice input:checked+span {background:white;color:var(--accent);box-shadow:0 1px 5px #49243716}
.typechoice input:focus-visible+span,.ratios input:focus-visible+span {outline:2px solid var(--accent)}
.work-controls .references {margin:20px 0}
#slots {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.ref-slot {position:relative;min-width:0}
.ref-slot label {display:flex;position:relative;align-items:center;justify-content:center;flex-direction:column;background:#faf5f1;border:1px dashed #cdbab9;border-radius:10px;aspect-ratio:1/1;cursor:pointer;overflow:hidden;color:#8b6572}
.ref-slot input,.ref-slot img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ref-slot input {opacity:0;cursor:pointer;font-size:0}
.ref-slot label:focus-within {outline:2px solid var(--accent)}
.ref-slot b {font:300 23px/1 var(--sans)}
.ref-slot small {font-weight:400;font-size:11px;margin-top:4px}
.ref-remove {position:absolute;right:3px;top:3px;border-radius:50%;background:#fff8f3;width:24px;height:24px;line-height:1}
.field-hint,.fine-options label,#workstatus {color:var(--muted);font-size:12px;line-height:1.45}
.field-hint {margin-top:8px}
.prompt-title,.fine-options {display:flex;align-items:center;justify-content:space-between;gap:8px}
.prompt-title .textbtn {font-size:12px;text-decoration:none}
.work-controls textarea {min-height:98px;margin-top:3px;font-size:14px;background:#fffdfa}
.ratios label {display:inline-block;margin-right:3px}
.ratios span {font-size:12px;border:1px solid var(--line);padding:7px 13px}
.ratios input:checked+span,.variant-list [aria-pressed=true] {background:var(--tint);color:#784151;border-color:#e2becb}
.ratios input:disabled+span {opacity:.4}
.fine-options {margin:15px 0 0}
.fine-options label {flex:1}
.fine-options select {min-height:35px;padding:6px 10px;font-size:13px}
.image-options{display:grid;grid-template-columns:minmax(0,1fr) 82px;gap:10px;align-items:start;margin-top:12px}
.image-options .fine-options{margin:0}
.image-options .ratios legend{font-size:12px;font-weight:400;color:var(--muted);line-height:1.45;margin-bottom:0}
.image-options .ratios span{padding:7px 9px}
.image-options .ratios label{margin-right:1px}
.image-options .fine-options select{margin-top:0}
.generate {margin:20px 0 0}
.primary:disabled,.soft-btn:disabled {opacity:.55;cursor:wait}
.error {font-size:13px;color:#9b2649;margin-top:8px}
.work-output {background:#f8f4f1;padding:16px clamp(14px,1.9vw,30px);min-width:0}
.output-tabs {display:flex;gap:24px;border-bottom:1px solid #e3d6d4;margin-bottom:16px}
.output-tabs button {background:transparent;padding:8px 0 12px;color:var(--muted);font-size:14px;border-bottom:2px solid transparent;scroll-margin-top:75px}
.output-tabs button[aria-pressed=true] {color:var(--ink);border-color:var(--accent);font-weight:600}
#historycount {background:#ece3e1;padding:1px 6px;margin-left:3px;font-size:11px;border-radius:8px}
.stage {min-height:540px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:26px 8px;background-image:radial-gradient(#d9c8c543 .85px,transparent .85px);background-size:12px 12px}
.ghost-frame {aspect-ratio:9/16;width:clamp(82px,11vw,154px);border:1px dashed #cdb3b5;border-radius:13px;background:linear-gradient(155deg,#f8eeea,#efdede 50%,#e6c9cd);display:grid;place-items:center;transform:rotate(4deg);margin:0 0 30px;box-shadow:-9px 9px 0 -2px #f5e8e4,-9px 9px 0 -1px #d9c7c4}
.frame-corners span {font:300 36px/1 var(--display);color:#a66f7e}
.stage h2,.history-empty h3 {font:400 clamp(25px,2vw,36px)/1.1 var(--display);letter-spacing:-.035em}
.stage p,.history-empty p {margin-top:8px;color:var(--muted);font-size:14px}
.stage a,.subtle-link,.auth-body>a {color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.output-frame {min-height:290px;text-align:center;display:grid;place-items:center}
.output-frame img,.output-frame video {display:block;max-width:100%;max-height:52svh;object-fit:contain;border-radius:10px}
.result-details {border-top:1px solid var(--line);margin-top:15px;padding-top:14px}
.result-details small,.look-info dt {color:var(--accent);font-size:12px}
.result-details p {white-space:pre-wrap;overflow-wrap:anywhere;margin:5px 0 12px;font-size:14px}
.result-actions,.variant-list,.look-actions,.account-links {display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.variant-list {justify-content:center;margin-top:8px}
.soft-btn {border:1px solid var(--line);padding:9px 14px;border-radius:22px;background:#fffaf7;color:#684350;font-size:13px}
.result-actions .primary {font-size:13px}
.history-search input,.auth-body input,.account-card input,.catalog-search input {display:block;width:100%;background:#fffcfa;border:1px solid #d9caca;border-radius:10px;padding:11px;margin:5px 0 16px}
.history-search {font-size:13px}
.history-row,.draft-link {display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:#fffcf9;border:1px solid var(--line);border-radius:11px;padding:8px;margin-bottom:8px}
.history-row img {width:44px;height:55px;object-fit:cover;border-radius:6px}
.history-row>span:nth-child(2) {flex:1;min-width:0}
.history-row strong,.history-row small {display:block;font-size:13px}
.history-row strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.history-row small {color:var(--muted);font-weight:400}
.history-empty {text-align:center;padding:55px 12px}
.look-dialog,.library-dialog {border:0;border-radius:20px;background:var(--paper);color:var(--ink);padding:0;max-height:90svh;max-width:calc(100vw - 28px);width:min(840px,93vw);overflow:auto}
dialog::backdrop {background:#241a21a8;backdrop-filter:blur(4px)}
body:has(dialog[open]) {overflow:hidden}
.dialog-close {position:absolute;right:12px;top:12px;border-radius:50%;width:38px;height:38px;font-size:24px;background:#fff9f0f2;z-index:1;line-height:1}
.look-layout {display:grid;grid-template-columns:minmax(190px,.85fr) minmax(0,1fr)}
.look-visual {background:#eee3dd;display:grid;place-items:center;min-height:150px}
.look-visual img,.look-visual video {display:block;width:100%;height:auto;max-height:85svh;object-fit:contain}
.look-info {padding:40px 28px 24px;align-self:center}
.look-step {display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px;margin-bottom:20px}
.look-step button {width:34px;height:34px;border:1px solid var(--line);background:transparent;border-radius:50%}
.look-info h2 {font-size:clamp(33px,3vw,52px);margin:8px 0 18px}
.look-info dd {margin:3px 0 0}
.look-info dl {margin:0 0 19px}
.look-info h3 {font-size:14px}
#look-prompt {margin-top:5px;color:#69595d;font-size:14px;line-height:1.55}
.look-actions {margin:16px 0}
.look-actions .save {border:1px solid var(--line)}
.subtle-link {font-size:12px}
.library-dialog {padding:28px}
.library-dialog h2 {font-size:34px;padding-right:36px;margin-bottom:17px}
#library-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.library-item {text-align:left;background:transparent;padding:0}
.library-item img {width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:8px}
.library-item span {display:block;font-size:13px}
.auth-wrap {display:grid;grid-template-columns:.82fr 1fr;max-width:820px;margin:6vh auto;border:1px solid var(--line);border-radius:20px;overflow:hidden;background:white}
.auth-photo img {display:block;width:100%;height:100%;max-height:580px;object-fit:cover}
.auth-body {padding:clamp(24px,3vw,50px);align-self:center}
.auth-body h1 {font-size:clamp(40px,4vw,60px)}
.auth-body p,.account-card p {color:var(--muted);margin:12px 0}
.auth-body form {margin:24px 0 15px}
.auth-body select {width:100%;margin-bottom:16px}
.auth-body>a {font-size:14px}
.account-card,.account-links a {max-width:650px;background:#fffdfb;border:1px solid var(--line);padding:25px;border-radius:15px}
.identity {display:flex;gap:15px;align-items:center}
.identity>span {display:grid;place-items:center;width:55px;height:55px;background:var(--tint);color:var(--accent);border-radius:50%;font:32px var(--display)}
.identity h2,.account-card h2 {font-size:33px}
.identity small,.account-links span {font-size:13px;color:var(--muted)}
.account-card form {margin:22px 0 10px}
.account-links {margin:16px 0}
.account-links a {display:grid;gap:4px}
.catalog-search {max-width:430px;font-size:14px;margin-bottom:20px}
@media(max-width:1050px) and (min-width:761px){.workbench{grid-template-columns:minmax(240px,42%) minmax(0,1fr)}body[data-section=studio] main{padding-inline:16px}.output-tabs{gap:14px}}
@media(max-width:760px){.workbench{display:flex;flex-direction:column;min-height:0}.work-controls{border-right:0;border-bottom:1px solid var(--line);padding:18px}.work-head{margin:6px 0 16px}.work-head h1{font-size:37px}.ref-slot label{aspect-ratio:auto;height:78px}.work-output{padding:16px}.stage{min-height:310px}.ghost-frame{width:77px}.work-controls textarea{font-size:16px}.sidebar-account{padding-bottom:env(safe-area-inset-bottom)}}
@media(max-width:550px){.look-layout{display:block}.look-dialog{width:94vw}.look-visual img,.look-visual video{height:38svh;width:100%}.look-info{padding:18px}.look-step{margin:0 0 10px}.look-info h2{margin:5px 0 12px}.look-info dl{margin-bottom:12px}#library-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.auth-wrap{display:block;margin:14px 0}.auth-photo{height:135px}.auth-photo img{object-position:center 28%}.work-head h1{font-size:32px}.demo-note{font-size:11px;padding:4px 7px}}
@media(min-width:1051px){#sidebar nav a{gap:9px;padding-inline:12px;font-size:13.5px}}
@media(min-width:761px) and (max-height:900px){
  body[data-section=studio] main{padding-top:18px}.work-head{margin-bottom:15px}
  .work-controls{padding-block:16px}.work-controls .typechoice{margin-bottom:12px}
  .work-controls .references{margin:14px 0}.ref-slot label{height:65px;aspect-ratio:auto}
  .work-controls textarea{height:84px;min-height:84px;margin-bottom:10px}
  .fine-options{margin-top:10px}.generate{margin-top:12px}.workbench{min-height:600px}
}

.legal-footer{margin-top:clamp(38px,7vw,90px);border-top:1px solid var(--line);padding-top:20px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:10px clamp(12px,3vw,36px);color:#6f6063;font-size:14px;font-weight:400;line-height:1.5}
.legal-footer .footer-operator,.legal-footer nav{display:grid;align-content:start;gap:8px;max-width:100%;overflow-wrap:anywhere}
.legal-footer nav{justify-self:end;justify-items:start}
.legal-footer a{display:inline-block;padding:0;font:inherit;text-decoration:underline;text-underline-offset:3px;text-decoration-color:#c3adae}
.legal-footer a:hover,.legal-footer [aria-current]{color:var(--accent)}
.legal-doc{max-width:49rem;margin-inline:auto}
.legal-doc header{margin:1.75rem 0 2rem;border-bottom:1px solid var(--line);padding-bottom:1.5rem}
.legal-kicker{color:var(--accent);font-size:.8rem;font-weight:600;letter-spacing:.055em}
.legal-doc h1{font:normal clamp(2.2rem,4.4vw,4.2rem)/1.06 var(--display);letter-spacing:-.035em;overflow-wrap:anywhere;margin:.7rem 0}
.legal-doc header>p:not(.legal-kicker){font-size:1.1rem;color:var(--muted)}
.legal-doc header small{display:block;margin-top:1rem;color:var(--muted)}
.legal-doc section{margin-top:1.65rem}
.legal-doc h2{font:normal clamp(1.55rem,2.7vw,2rem)/1.15 var(--display);margin-bottom:.6rem}
.legal-doc section p{line-height:1.7;max-width:72ch}
.legal-doc section a{color:var(--accent);text-decoration:underline;text-underline-offset:.18em}
.legal-doc dl{margin:0;background:var(--side);border-radius:14px;padding:6px 18px}
.legal-doc dl div{padding:10px 0;display:grid;grid-template-columns:minmax(9rem,34%) 1fr;gap:8px;border-bottom:1px solid var(--line)}
.legal-doc dl div:last-child{border:0}
.legal-doc dt{color:var(--muted)}.legal-doc dd{margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
@media(max-width:540px){.legal-doc dl div{grid-template-columns:1fr;gap:2px}}

.tool-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.tool-filters button {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: #624f52;
  background: #faf5f2;
  font-size: 14px;
  min-height: 40px;
}
.tool-filters button:hover { border-color: #c8a2ad; }
.tool-filters button[aria-pressed=true] {
  background: #784052;
  border-color: #784052;
  color: #fff;
}
.tool-panel h3 { margin: 22px 0 12px; font-size: 17px; }
.tool-filters:not([hidden]) ~ .tool-panel h3 {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 18px 14px;
}
.tool-card { display: block; border-radius: 12px; }
.tool-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  background: var(--tint);
  border-radius: 12px;
}
.tool-card span {
  display: block;
  padding: 8px 1px 2px;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.3;
}
.tool-card:hover span { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.price-card {
  padding: clamp(18px,2.5vw,36px);
  background: #f3e9e0;
  border: 1px solid #e8dbd0;
  border-radius: 18px;
}
.price-card:nth-child(2) { background: #f4e3e7; border-color: #e7cdd6; }
.price-card:nth-child(3) { background: #eee6ed; border-color: #dfd4dd; }
.price-card:nth-child(4) { background: #f0e7d6; border-color: #c9ad80; }
.price-card h3 { font: italic 400 clamp(26px,2.4vw,38px)/1.1 var(--display); color: #764356; }
.price-card .price { margin: 24px 0 3px; font: 400 clamp(35px,3.5vw,58px)/1 var(--display); letter-spacing: -.04em; }
.price-card small { display: block; margin-top: 13px; color: #6b5a5e; }
.price-card .price { white-space: nowrap; }
.price-card .plan-tokens { margin-top: 12px; font-weight: 600; }
.plan-discount { display: inline-block; margin-top: 16px; padding: 6px 9px; border-radius: 9px; background: #ffffff8c; color: #704355; font-size: 12px; line-height: 1.4; }
.generation-balance [data-trial-balance] { margin-top: 5px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.plans-note { margin-top: 13px; color: var(--muted); font-size: 14px; }
.image-price-scroll { overflow-x: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fffcf9; }
.image-prices table { width: 100%; border-collapse: collapse; font-size: 14px; }
.image-prices th, .image-prices td { padding: 16px 18px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.image-prices th:first-child { text-align: left; }
.image-prices thead th { background: #f2e8e4; font-weight: 600; }
.image-prices tbody th { font-weight: 500; }
.image-prices tbody tr:last-child > * { border-bottom: 0; }
.image-prices tbody a:hover { color: var(--accent); text-decoration: underline; }
.compact-model-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.compact-model{display:flex;align-items:center;gap:12px;border:1px solid var(--line);background:#fffcf8;border-radius:13px;padding:12px;min-width:0}.compact-model>img{width:42px;height:54px;object-fit:cover;border-radius:8px}.compact-model>span{min-width:0;flex:1}.compact-model strong{display:block;font:500 13px/1.3 var(--sans)}.compact-model small{display:block;font-size:10px;color:var(--muted);margin-top:5px}.compact-model>.ic{width:14px;height:14px;flex:none}.compact-model:hover{border-color:#c59aab;background:#fff8f5}.section-actions{display:flex;align-items:center;gap:15px}.carousel-controls{display:flex;gap:7px}.carousel-controls button{border:1px solid #ddc7d0;background:#fffaf7;color:#82455c;width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:17px}.carousel-controls button:disabled{opacity:.35;cursor:default}.home-photo-gallery .grid,#tools .tool-grid{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;gap:16px;padding-bottom:5px}.home-photo-gallery .grid::-webkit-scrollbar,#tools .tool-grid::-webkit-scrollbar{display:none}.home-photo-gallery .grid>.card{flex:0 0 calc((100% - 48px)/4);min-width:0;scroll-snap-align:start}#tools .tool-grid>.tool-card{flex:0 0 calc((100% - 80px)/6);min-width:0;scroll-snap-align:start}
@media(max-width:1100px){.compact-model-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#tools .tool-grid>.tool-card{flex-basis:calc((100% - 48px)/4)}}
@media(max-width:760px){.section-actions{gap:8px}.section-actions>.more{font-size:11px}.carousel-controls button{width:32px;height:32px}.home-photo-gallery .grid>.card{flex-basis:calc((100% - 16px)/2.15)}#tools .tool-grid>.tool-card{flex-basis:calc((100% - 16px)/2.2)}.compact-model{padding:9px;gap:8px}.compact-model>img{width:34px;height:44px}.compact-model strong{font-size:11px}.compact-model small{font-size:9px}.compact-model>.ic{display:none}}
@media(max-width:1150px) { .tool-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } .price-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) {
  .tool-filters { flex-wrap: nowrap; overflow-x: auto; padding: 4px; margin-inline: -4px; }
  .tool-filters button { white-space: nowrap; min-height: 44px; }
}
@media(max-width:540px) {
  .tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 10px; }
  .price-grid { grid-template-columns: 1fr; gap: 10px; }
  .price-card { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
  .price-card .price { margin: 0; text-align: right; }
  .price-card small { margin: 0; text-align: right; }
  .price-card .plan-discount { grid-column: 1 / -1; justify-self: start; margin-top: 5px; }
}

.generation-balance {
  display: grid;
  gap: 2px;
  text-align: left;
}
.generation-balance span { color: var(--muted); font-size: 13px; }
.generation-balance strong { color: #783c52; font-size: 18px; font-variant-numeric: tabular-nums; }
.sidebar-account .generation-balance { background: #f0e4e5; border-radius: 12px; padding: 10px 14px; margin-bottom: 3px; }
.profile-wallet { max-width: 650px; margin-bottom: 16px; padding: 20px 25px; border-radius: 15px; background: #f4e8e9; }
.profile-wallet strong { font: 400 clamp(28px,3vw,38px)/1.2 var(--display); }
.profile-wallet p { font-size: 14px; color: #68565c; margin-top: 8px; }

.generation-price{font-weight:600;color:#774456}

.registration-consents{display:grid;gap:14px;margin:20px 0}.registration-consents label{display:flex;align-items:flex-start;gap:10px;font-size:13px;line-height:1.6}.registration-consents input{width:18px!important;min-height:18px;flex:0 0 auto;margin-top:3px;accent-color:#963c5c}.registration-consents a{text-decoration:underline}.auth-flow-page{max-width:650px;margin:40px auto}.auth-flow-page input{display:block;width:100%;margin:10px 0 20px}
