:root{color-scheme:light;--bg:#fbf7f9;--panel:#ffffff;--line:#e6d2dd;--text:#281b23;--muted:#74616d;--brand:#7c144d;--green:#2e8d65}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.5 system-ui,-apple-system,Segoe UI,sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid var(--line);border-radius:9px;background:#f4e8ee;color:var(--text);padding:9px 15px}button:hover{border-color:var(--brand)}button:disabled{opacity:.5;cursor:wait}.primary{background:var(--brand);color:#ffffff;border-color:var(--brand);font-weight:700;padding:12px 20px}a{color:var(--brand)}.topbar{min-height:70px;padding:12px max(20px,calc((100vw - 1250px)/2));display:flex;align-items:center;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:800;white-space:nowrap}.brand b{font-size:12px;color:var(--brand);vertical-align:super}.brand-mark{display:grid;place-items:center;background:var(--brand);color:#111;border-radius:10px;width:36px;height:36px;font-size:25px}.top-right{display:flex;align-items:center;gap:14px;font-size:13px;color:var(--muted)}.top-right form{margin:0}.badge{background:#f5e3ed;color:#7c144d;border-radius:99px;padding:4px 10px}.ghost{padding:5px 10px;background:transparent}.shell{max-width:1250px;margin:auto;display:grid;grid-template-columns:190px minmax(0,1fr);gap:28px;padding:28px 20px}.nav{display:flex;flex-direction:column;gap:6px}.navbtn{text-align:left;background:transparent;border-color:transparent}.navbtn.active{background:#f6e5ee;color:var(--brand);border-color:#dab5c8}.tab{display:none}.tab.active{display:block}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}h1{font-size:29px;margin:0 0 4px;letter-spacing:-.02em}h2{font-size:20px;margin:0 0 15px}.muted{color:var(--muted);margin:0}.tiny{font-size:13px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:20px;margin-bottom:18px}label{display:block;font-weight:600;margin:0 0 14px}label input,label select,label textarea{display:block;margin-top:7px}input:not([type=checkbox]):not([type=file]),select,textarea{width:100%;border:1px solid #cbb2c1;border-radius:8px;background:#ffffff;color:var(--text);padding:10px 12px}input[type=file]{font-weight:400;max-width:100%;font-size:13px;color:var(--muted)}textarea{min-height:125px;resize:vertical}.hints{display:flex;flex-wrap:wrap;gap:7px;margin:-2px 0 22px}.hints button{font-size:13px;padding:5px 9px;background:#f7edf2;color:#554450}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:18px}.model-info{background:#fcf5f8;border-left:3px solid var(--brand);padding:12px 15px;font-size:14px;border-radius:6px;color:#554450}.model-info strong{color:var(--text)}.model-info a{display:inline-block;margin-top:6px}.cards{display:grid;gap:13px}.job-card{display:grid;grid-template-columns:130px minmax(0,1fr);gap:16px;padding:14px;background:var(--panel);border:1px solid var(--line);border-radius:12px}.job-card img{width:130px;height:110px;object-fit:cover;background:#f8f3f6;border-radius:7px}.job-card p{margin:5px 0;overflow-wrap:anywhere}.job-card .actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.job-card .actions a,.job-card .actions button{font-size:13px;padding:5px 9px}.status{display:inline-block;padding:2px 8px;border-radius:99px;background:#eee2e9;font-size:12px}.status.done{background:#e8f4ed;color:#205f43}.status.error,.status.interrupted{background:#ffe7e8;color:#8a2833}.pagination{display:flex;align-items:center;gap:10px;justify-content:center;margin:20px 0}.legacy-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}.legacy-item{background:var(--panel);border:1px solid var(--line);border-radius:10px;overflow:hidden;padding-bottom:9px}.legacy-item img{display:block;width:100%;height:150px;object-fit:contain;background:#f8f3f6;cursor:pointer}.legacy-item span{display:block;font-size:12px;padding:7px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.legacy-item a{font-size:12px;padding:0 10px}.searchrow{display:flex;gap:10px;margin-bottom:18px}.searchrow input{max-width:400px}.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.filters label{font-size:13px;margin:auto 0}.tablewrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:14px}th,td{text-align:left;padding:9px;border-bottom:1px solid var(--line);white-space:nowrap}td input{max-width:105px}.alert{background:#fde8ec;padding:10px 12px;border-radius:8px}.hidden{display:none!important}.login-page{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(100%,430px);padding:28px;background:var(--panel);border:1px solid var(--line);border-radius:16px}.login-card .brand{margin-bottom:28px}.login-card h1{margin-bottom:5px}.login-card form{margin-top:24px}.login-card .primary{width:100%}.modal{position:fixed;inset:0;background:#000c;display:grid;place-items:center;padding:20px;z-index:10}.modal-content{position:relative;max-width:min(100%,1100px);max-height:100%;background:var(--panel);padding:18px;border-radius:12px;overflow:auto}.modal img{max-width:100%;max-height:75vh;display:block;margin:auto}.modal .close{position:absolute;right:8px;top:8px;font-size:26px}.modal #viewer-actions{display:flex;gap:10px;flex-wrap:wrap;padding-top:12px}#create-status,#admin-status{min-height:1.5em;color:var(--brand)}@media(max-width:850px){.shell{display:block;padding:16px}.nav{flex-direction:row;overflow-x:auto;margin-bottom:20px}.navbtn{white-space:nowrap}.topbar{padding:12px 16px}.top-right{flex-wrap:wrap;justify-content:flex-end}.form-grid,.admin-grid{grid-template-columns:1fr 1fr}.filters{grid-template-columns:1fr 1fr}}@media(max-width:560px){.topbar{align-items:flex-start}.top-right>span:not(.badge){display:none}.brand{font-size:17px}.badge{font-size:11px}.form-grid,.form-grid.two,.admin-grid,.filters{grid-template-columns:1fr}.job-card{grid-template-columns:90px minmax(0,1fr)}.job-card img{width:90px;height:90px}.panel{padding:15px}h1{font-size:25px}}

/* Фирменная палитра логотипа «Пробизнес»: #7c144d. */
.topbar{background:#fff}
.brand{gap:14px;color:var(--brand)}
.brand-logo{display:block;position:relative;width:38px;height:48px;overflow:hidden;flex:none}
.brand-logo img{display:block;position:absolute;top:0;right:0;width:180px;height:48px;max-width:none}
.brand-name{font-size:18px;line-height:1.2;letter-spacing:-.02em}
.login-page{background:radial-gradient(circle at 50% 0%,#f4e2eb 0,#fbf7f9 52%)}
.login-card{box-shadow:0 20px 60px #7c144d12}
.login-card .brand{flex-direction:column;align-items:flex-start;gap:12px}
.login-card .brand-logo{width:57px;height:72px}
.login-card .brand-logo img{width:270px;height:72px}
.login-card .brand-name{font-size:24px}
button:hover{background:#ebd5e1}
.primary:hover{background:#62103d;color:#fff;border-color:#62103d}
.ghost:hover,.navbtn:hover{background:#f4e8ee}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #b85886;outline-offset:2px}
.alert{color:#8a2833;border:1px solid #edc3cc}
@media(max-width:850px){.brand-name{font-size:17px}}
@media(max-width:560px){.topbar{flex-wrap:wrap}.top-right{width:100%;justify-content:space-between}.brand-logo{width:34px;height:43px}.brand-logo img{width:161px;height:43px}.brand-name{font-size:16px}.login-card .brand-name{font-size:22px}}
dialog#paid-confirm{width:min(94vw,540px);border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);padding:24px;box-shadow:0 20px 60px #281b2350}
dialog#paid-confirm::backdrop{background:#281b2388}
dialog#paid-confirm .actions,#admin .actions{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}
#api-key-form{max-width:650px}
#api-key-status{font-weight:700}
.provider-choice{display:flex;align-items:center;gap:18px;border:1px solid var(--line);border-radius:10px;padding:10px 14px;margin:0 0 9px}
.provider-choice legend{font-weight:700;padding:0 6px}
.provider-choice label{display:inline-flex;align-items:center;gap:6px;margin:0;cursor:pointer}
#provider-status{margin:0 0 16px}


/* Large generated image preview */
#current-result .job-card {
  display: flex;
  flex-direction: column;
}
#current-result .job-card > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  cursor: zoom-in;
  background: #f8f3f6;
}
#current-result .job-card .actions {
  margin-top: 15px;
}

/* Uploaded reference previews */
.reference-preview:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcf5f8;
}
.reference-preview img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 190px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
}
.reference-preview span {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 400;
}
.reference-preview .reference-remove {
  color: #a22144;
  background: #fff;
  border-color: #d7a3b6;
}

/* Download the untouched result from its card. */
.job-body{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center;min-width:0}
.job-details{min-width:0}
.result-download{display:inline-flex;align-items:center;justify-content:center;justify-self:end;min-width:132px;padding:12px 18px;border:1px solid var(--brand);border-radius:9px;background:var(--brand);color:#fff;text-decoration:none;font-weight:700;white-space:nowrap}
.result-download:hover{background:#65103f;color:#fff}
@media(max-width:700px){.job-body{grid-template-columns:1fr;gap:12px}.result-download{justify-self:start}}
