/* KADRIVA: product-first canvas, quiet controls, original image proportions. */
:root { --muted:#657368; --display:Georgia,'Times New Roman',serif; }
html { scrollbar-gutter:stable; scroll-padding-top:24px; }
body { font-size:14px; line-height:1.5; }
body.modal-open { overflow:hidden; }
img { max-width:100%; }
figure { margin:0; }
button:disabled { cursor:not-allowed; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible { outline:3px solid #639f7a; outline-offset:3px; }
.wrap { max-width:1440px; padding:32px clamp(20px,4vw,56px) 80px; }
.wrap > *, .panel > *, .row > *, .split > *, .studio-form > *, .setup-grid > *, .plan-layout > *, .account-grid > *, .route-grid > *, .credit-columns > *, .pagehead > *, .section-head > * { min-width:0; }
.panel { border-radius:16px; padding:clamp(20px,2.3vw,32px); }
h1,h2,h3,p,figcaption,.notice,.jobrow { overflow-wrap:anywhere; }
h1 { font-size:clamp(34px,4vw,58px); letter-spacing:-.045em; line-height:1.09; }
h2 { font-size:clamp(22px,2.2vw,28px); line-height:1.2; }
.btn { min-height:44px; white-space:normal; text-align:center; line-height:1.4; transition:background .15s; }
.btn:hover { background:#34634e; }
.btn.ghost:hover,.btn.light:hover { background:#e6ecdf; }
.btn.small { min-height:40px; }
.linkbtn { min-height:40px; text-align:left; }
input,select,textarea { min-width:0; max-width:100%; }
input:not([type=checkbox]),select { min-height:46px; }
.field { margin-bottom:20px; }
.field label { line-height:1.45; }
.field .tiny { font-size:12px; }
.split,.studio-form,.setup-grid,.account-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; min-height:84px; height:auto; gap:20px; padding:14px clamp(20px,4vw,56px); }
.brand { gap:10px; font-size:19px; letter-spacing:2px; flex-shrink:0; }
.brand-mark { width:36px; height:36px; flex:none; }
.brand small { font-size:8px; letter-spacing:1.5px; }
.nav { justify-content:center; gap:6px 18px; min-width:0; flex-wrap:wrap; }
.nav a { min-height:40px; display:flex; align-items:center; padding:8px 0; line-height:1.35; }
.account { min-width:0; gap:10px; justify-content:flex-end; }
.account .tag { font-variant-numeric:tabular-nums; white-space:nowrap; background:#eaf0e3; min-height:40px; display:flex; align-items:center; }
.username { max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.avatar { width:40px; height:40px; flex:none; }
.menu-toggle { display:none; }
.mobile-logout { display:none; }
.hero { grid-template-columns:1.1fr minmax(0,1fr); min-height:0; gap:clamp(24px,4vw,56px); margin:8px 0 36px; }
.hero p { margin-top:18px; font-size:14px; max-width:480px; }
.hero .eyebrow { margin-bottom:14px; }
.hero .intro-tags { margin-top:18px; gap:8px; }
.intro-tags .tag { background:transparent; padding:5px 9px; font-size:10px; }
.studio-visual { position:relative; border-radius:18px; border:1px solid #d9ded3; background:#e2e7df; overflow:hidden; }
.studio-visual picture,.studio-visual img { display:block; width:100%; }
.studio-visual img { height:auto; aspect-ratio:3/2; object-fit:contain; }
.studio-visual figcaption { display:flex; justify-content:space-between; gap:8px; padding:10px 16px; font-size:10px; color:#4c6054; background:#edf0e7; }
.studio-form { align-items:start; gap:24px; margin-top:0; }
.step-label { font-weight:600; margin-bottom:22px; }
.step-no { border:0; background:#e7eee2; color:var(--green); width:28px; height:28px; flex:none; }
.uploadbox { position:relative; min-height:156px; padding:24px 16px; transition:border-color .15s; }
.uploadbox:hover,.uploadbox:focus-within { border-color:var(--green); outline:2px solid #c9d9bf; }
.uploadbox input { display:block; position:absolute; width:1px; height:1px; min-height:0; overflow:hidden; opacity:0; }
.uploadicon { line-height:1; }
.uploads { padding:4px 2px 10px; overscroll-behavior-x:contain; }
.uploaditem { width:112px; }
.uploaditem img { width:112px; height:112px; object-fit:contain; background:#f2f3ed; }
.uploaditem select { font-size:12px; padding:7px 3px; min-height:40px; }
.stylegrid { grid-template-columns:repeat(3,minmax(0,1fr)); margin:0 0 18px; gap:12px; }
.style { display:flex; flex-direction:column; min-width:0; border-radius:10px; }
.style img,.style-art { display:block; width:100%; height:auto; aspect-ratio:3/4; object-fit:contain; object-position:center; background:#f3f4ef; }
.style-art { display:flex; justify-content:flex-end; font:clamp(17px,2vw,25px)/1.12 var(--display); padding:14px; overflow-wrap:anywhere; }
.style-art .number { margin-bottom:auto; padding-bottom:16px; font:10px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; letter-spacing:.04em; }
.style .caption { display:flex; align-items:center; min-height:48px; padding:10px; font-size:11px; }
.style.selected { outline-color:var(--green); }
.style .selected-dot { color:white; background:var(--green); width:23px; height:23px; display:grid; place-items:center; padding:0; }
.pagehead,.section-head { gap:20px; align-items:flex-start; flex-wrap:wrap; }
.pagehead > div:first-child { flex:1 1 280px; }
.pagehead h1 { font-size:clamp(30px,3.4vw,42px); letter-spacing:-.035em; }
.pagehead .toolbar { max-width:100%; }
.pagehead .eyebrow { margin-bottom:10px; }
.form-bottom { align-items:center; padding-top:24px; gap:20px; }
.form-bottom .btn { min-height:50px; }
.projectgrid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.project { display:flex; flex-direction:column; min-width:0; }
.project .details { flex-wrap:wrap; }
.project > .tiny:last-child { margin-top:auto; }
.plan-layout { grid-template-columns:minmax(220px,300px) minmax(0,1fr); }
.direction-panel img { height:auto; max-height:320px; object-fit:contain; }
.plan-card > div { min-width:0; }
.plan-card small { white-space:normal; }
.artframe img { width:100%; height:auto; object-fit:contain; background:#edf0e7; }
.artframe:has(.image-error) { aspect-ratio:3/4; }
.artmeta { align-items:flex-start; flex-wrap:wrap; }
.artmeta strong { flex:1 1 140px; overflow-wrap:anywhere; }
.artactions .btn { min-height:40px; font-size:12px; }
.editbar { align-items:center; }
.editbar textarea { flex:1; min-width:0; resize:vertical; }
.editbar .btn { flex-shrink:0; }
.status { white-space:normal; text-align:center; line-height:1.35; }
.row.between,.jobrow { flex-wrap:wrap; }
.table-responsive { width:100%; overflow:auto; overscroll-behavior:contain; }
.table th,.table td { vertical-align:top; }
.table td { overflow-wrap:anywhere; }
.table-responsive .table th,.table-responsive .table td { display:table-cell!important; }
.table-responsive .table { min-width:540px; }
.admin-table { padding:20px; }
.credit-amount { font-family:inherit; font-size:clamp(40px,5vw,58px); font-weight:500; letter-spacing:-.055em; overflow-wrap:anywhere; }
.credit-balance { align-items:center; flex-wrap:wrap; }
.credit-balance dl { gap:20px 32px; flex-wrap:wrap; }
.credit-balance dd { font-size:24px; }
.credit-spending-note { padding:20px; background:#edf2e7; border-radius:12px; align-self:start; }
.credit-spending-note p { margin:12px 0 0; }
.credit-ledger td:last-child { min-width:0; }
.credit-pager .toolbar { flex-wrap:nowrap; }
.credit-request .toolbar .btn { flex:0 1 auto; }
.modal-bg { padding:24px; }
.modal-box { max-height:calc(100dvh - 48px); overflow:auto; overscroll-behavior:contain; }
.modal-box .actions { flex-wrap:wrap; gap:10px; }
.dialog-close { position:sticky; top:0; float:right; margin:-8px -4px 4px 10px; z-index:2; width:44px; height:44px; flex:none; border:1px solid var(--line); border-radius:50%; background:var(--paper); color:var(--ink); font-size:24px; line-height:1; }
.modal-box.viewer .dialog-close { display:none; }
.modal-box .actions .btn { flex:0 1 auto; }
.modal-box.viewer { max-width:100%; overflow:visible; }
.modal-box.viewer img { width:auto; height:auto; max-height:calc(100dvh - 100px); max-width:100%; object-fit:contain; }
.closeview { top:max(16px,env(safe-area-inset-top)); right:16px; width:44px; height:44px; background:#14291ee6; font-size:25px; }
.auth { grid-template-columns:1fr 1fr; }
.auth-content { padding:clamp(32px,6vw,96px); gap:32px; max-width:640px; width:100%; margin:auto; }
.auth-content h1 { font-size:clamp(36px,4vw,54px); }
.auth-content .eyebrow { margin-bottom:16px; }
.auth-content form { max-width:420px; width:100%; }
.auth-content .brand { margin-bottom:8px; }
.auth-preview { padding:clamp(28px,5vw,80px); background:#e9ede4; }
.auth-preview h2 { font:clamp(30px,3vw,44px)/1.12 var(--display); letter-spacing:-.025em; margin:28px 0 16px; }
.auth-preview .studio-visual { border-radius:14px; }
.auth-preview .studio-visual figcaption { flex-direction:column; }
#toast { width:max-content; max-width:min(440px,calc(100vw - 32px)); right:16px; bottom:max(16px,env(safe-area-inset-bottom)); overflow-wrap:anywhere; line-height:1.55; }
.image-error { min-height:120px; color:var(--muted); font-size:13px; padding:18px; }
.footer { max-width:760px; padding-top:20px; border-top:1px solid var(--line); }
.footer a { text-decoration:underline; text-underline-offset:3px; }
@media (max-width:1200px) and (min-width:721px) {
  .header { grid-template-columns:1fr auto; }
  .nav { grid-row:2; grid-column:1/-1; justify-content:flex-start; gap:6px 24px; border-top:1px solid var(--line); padding-top:6px; }
  .account .username { display:none; }
}
@media (max-width:1000px) {
  .hero { grid-template-columns:1fr 1fr; }
  .hero h1 { font-size:42px; }
  .studio-form { grid-template-columns:1fr; }
  .stylegrid { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .setup-grid { grid-template-columns:1fr; }
  .cardgrid,.projectgrid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .credit-columns { grid-template-columns:1fr; }
}
@media (max-width:720px) {
  html { scrollbar-gutter:auto; }
  body { font-size:14px; }
  .header { grid-template-columns:1fr auto; padding:14px 16px; gap:10px 12px; }
  .brand { font-size:17px; letter-spacing:1.6px; }
  .brand small { display:none; }
  .brand-mark { width:30px; height:30px; }
  .header .account { grid-column:1; grid-row:2; justify-content:flex-start; margin:0; }
  .account .tag { min-height:32px; padding:5px 9px; font-size:12px; }
  .account .avatar { display:none; }
  .menu-toggle { display:flex; align-items:center; gap:8px; grid-column:2; grid-row:1 / span 2; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; color:var(--ink); background:white; font-size:12px; }
  .menu-toggle > span:first-child { font-size:20px; }
  .header .nav { display:none; grid-column:1/-1; order:initial; width:100%; }
  .header.menu-open .nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding-top:10px; border-top:1px solid var(--line); }
  .nav a { min-height:46px; padding:10px 12px; border-radius:8px; color:var(--ink); background:#eff2e9; box-shadow:none; }
  .nav a.active { background:var(--green); color:white; }
  .menu-open .mobile-logout { display:block; min-height:46px; padding:10px 12px; border-radius:8px; color:var(--ink); background:#eff2e9; text-align:left; font-size:13px; }
  .wrap { padding:24px 16px calc(40px + env(safe-area-inset-bottom)); }
  .hero { grid-template-columns:1fr; margin:0 0 28px; gap:22px; }
  .hero h1 { font-size:34px; }
  .hero > div:nth-child(2) { display:none; }
  .hero .studio-visual { max-width:440px; }
  .hero .studio-visual img { max-height:240px; }
  .hero p { font-size:14px; margin-top:16px; }
  .hero .intro-tags { display:none; }
  .studio-visual figcaption { padding:9px 12px; flex-wrap:wrap; font-size:10px; }
  .eyebrow { font-size:10px; letter-spacing:1.4px; }
  .panel { padding:20px; border-radius:14px; }
  .section-head { gap:12px; }
  .pagehead { margin:4px 0 22px; flex-direction:column; gap:16px; }
  .pagehead > div:first-child { flex:auto; width:100%; }
  .pagehead h1 { font-size:32px; }
  .pagehead > .btn { align-self:flex-start; }
  .plan-layout,.account-grid { grid-template-columns:1fr; }
  .direction-panel { position:static; }
  .direction-panel img { display:block; max-height:240px; }
  .direction-panel .eyebrow { margin-bottom:12px; }
  .stylegrid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
  .style-art { font-size:18px; padding:10px; }
  .style-art .number { font-size:9px; }
  .style .caption { font-size:10px; padding:9px 7px; }
  .split { grid-template-columns:1fr; gap:0; }
  input:not([type=checkbox]),select,textarea { font-size:16px; }
  .uploaditem select { font-size:16px; }
  .check { font-size:13px; }
  input[type=checkbox] { width:20px; height:20px; }
  .btn,.btn.small { min-height:44px; font-size:13px; }
  .form-bottom { align-items:stretch; }
  .form-bottom .btn { min-height:52px; }
  .editbar { position:static; gap:12px; padding:16px; }
  .editbar small { min-width:0; }
  .editbar textarea { flex:auto; min-height:90px; height:90px; font-size:16px; }
  .editbar .btn { width:100%; }
  .quick-prompts .btn { flex:1 1 130px; }
  .modal-bg { padding:12px; align-items:center; }
  .modal-box { padding:22px 18px; max-height:calc(100dvh - 24px); border-radius:16px; }
  .modal-box .actions .btn { flex:1 1 150px; }
  .modal-box .credit-columns { grid-template-columns:1fr; }
  .modal-box .credit-balance { padding:16px; }
  .credit-balance { gap:22px; align-items:flex-start; }
  .credit-balance .eyebrow { letter-spacing:1px; }
  .credit-balance dd { font-size:22px; }
  .credit-amount { font-size:44px; }
  .credit-amount span { display:block; margin-top:6px; }
  .credit-pager { align-items:flex-start; }
  .credit-pager > span { width:100%; }
  .admin-table { padding:14px; }
  .table-responsive { overflow:visible; }
  .table-responsive .table { display:block; min-width:0; }
  .table-responsive .table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .table-responsive .table tbody { display:grid; gap:14px; }
  .table-responsive .table tr { display:grid; width:100%; border:1px solid var(--line); padding:14px; border-radius:10px; background:white; }
  .table-responsive .table td { display:block!important; min-width:0; width:auto; border:0; padding:7px 0; }
  .table-responsive td[data-label]:before { content:attr(data-label); display:block; color:var(--muted); font-size:10px; letter-spacing:.025em; margin-bottom:4px; }
  .table-responsive .table td[colspan] { padding:12px 0; }
  .credit-ledger td:last-child { min-width:0; }
  .credit-value { white-space:normal; }
  .auth { display:block; min-height:100dvh; }
  .auth-content { padding:40px 24px; max-width:480px; gap:30px; }
  .auth-content .brand { margin-bottom:0; }
  .auth-content h1 { font-size:40px; }
  .auth-preview { display:none; }
  .compare-versions { grid-template-columns:1fr; gap:18px; }
  .source-compare { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .cardgrid,.cardgrid.covers,.projectgrid { grid-template-columns:1fr; gap:24px; }
  .artactions .btn { flex:1 1 auto; }
  .artmeta strong { font-size:15px; }
  .jobrow > div { max-width:100%; }
  .style-art { font-size:16px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*:before,*:after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
