/* Homepage studio: create card + Examples / My videos. Tokens follow styles.css (#ff4d00, #070707, Inter, 1280/32, buttons 10/40).
   Selectors carry at least one class so they win over the scoped reset in reference-layout.css. */
.studio{--k4-accent:#ff4d00;--k4-fg:#f4f1ec;--k4-muted:#9b958f;--k4-line:#292929;--k4-card:#111;display:grid;grid-template-columns:minmax(0,1fr);gap:20px;max-width:1232px;margin:40px auto 0;padding:0;text-align:left;color:var(--k4-fg);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px}
@media (min-width:1024px){.studio{grid-template-columns:minmax(0,520px) minmax(0,1fr);gap:24px;align-items:start;padding:0 8px}}
.studio .k4-panel{display:block;border:1px solid var(--k4-line);border-radius:14px;background:var(--k4-card);padding:24px;min-width:0;margin:0}
.studio .k4-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0 0 22px}
.studio .k4-head h2{font-size:18px;line-height:1.3;letter-spacing:-.4px;font-weight:600;margin:0;text-wrap:initial}
.studio .k4-model{border:1px solid #333;border-radius:6px;padding:6px 8px;font-size:10px;color:#bcb3ad;white-space:nowrap}
.studio .k4-notice{display:block;margin:0 0 18px;padding:10px 12px;border:1px solid #304636;background:#17231d;color:#a3c9ad;border-radius:8px;font-size:12px;line-height:1.6}
.studio .k4-tabs{display:flex;gap:4px;border:1px solid #292629;border-radius:30px;padding:4px;background:#1b191b;margin:0 0 22px;width:max-content;max-width:100%}
.studio .k4-tabs button{display:inline-flex;align-items:center;gap:6px;border:1px solid transparent;border-radius:30px;padding:9px 20px;background:transparent;color:#bcb3ad;font:inherit;font-size:12px;cursor:pointer;white-space:nowrap}
.studio .k4-tabs button[aria-selected=true]{background:#3a2418;border-color:#5a3420;color:#fff}
.studio .k4-badge{display:inline;font-size:10px;color:#ffb68d}
.studio .k4-overline{display:block;color:var(--k4-muted);font-size:9px;text-transform:uppercase;letter-spacing:1.5px;margin:0 0 18px}
.studio .k4-label{display:flex;justify-content:space-between;font-size:12px;font-weight:500;margin:0 0 10px;color:var(--k4-fg)}
.studio .k4-label small{font-size:10px;color:#928b86;font-weight:400}
.studio .k4-image{display:block;margin:0 0 18px}
.studio .k4-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:#0b0b0b;border:1px dashed #5b4436;border-radius:10px;height:122px;cursor:pointer;margin:0}
.studio .k4-drop b{font-size:23px;color:#ff9c69;font-weight:400}
.studio .k4-drop span{font-size:12px}
.studio .k4-drop small{font-size:10px;color:#a39b95}
.studio .k4-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip:rect(0 0 0 0);margin:0;padding:0;border:0}
.studio .k4-file:focus-visible+.k4-image-box,.studio .k4-drop:focus-within{outline:2px solid var(--k4-accent)}
.studio .k4-image-box{display:flex;align-items:center;gap:14px;height:122px;padding:12px;background:#0b0b0b;border:1px solid #36302d;border-radius:10px}
.studio .k4-image-box img{display:block;width:96px;height:96px;object-fit:cover;border-radius:8px;background:#1b1b1b}
.studio .k4-image-box div{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:0}
.studio .k4-note{display:block;color:#ffaf86;font-size:11px;line-height:1.6;margin:9px 0 0}
.studio .k4-field-prompt{display:block;margin:0}
.studio .k4-prompt{display:block;background:#0b0b0b;border:1px solid #36302d;border-radius:10px;overflow:hidden}
.studio .k4-prompt:focus-within{border-color:var(--k4-accent)}
.studio .k4-prompt textarea{display:block;width:100%;min-height:144px;resize:vertical;background:transparent;border:0;padding:14px;margin:0;color:var(--k4-fg);font:inherit;font-size:13px;line-height:1.8;outline:none;box-sizing:border-box}
.studio .k4-prompt textarea::placeholder{color:#88827d}
.studio .k4-counter{display:block;font-size:10px;color:#a39b95;text-align:right;padding:0 14px 12px;font-variant-numeric:tabular-nums}
.studio .k4-counter.over{color:#ff8a5c}
.studio .k4-help{display:block;font-size:11px;color:var(--k4-muted);line-height:1.7;margin:9px 0 0}
.studio .k4-field{display:block;margin:22px 0 0;padding:0;border:0;min-width:0}
.studio .k4-field legend{display:block;font-size:12px;font-weight:500;padding:0;margin:0 0 10px;color:var(--k4-fg)}
.studio .k4-segments{display:flex;border:1px solid var(--k4-line);border-radius:8px;padding:3px;gap:3px;background:#0b0b0b}
.studio .k4-choice,.studio .k4-ratio{position:relative;flex:1;text-align:center;cursor:pointer;display:block;margin:0}
.studio .k4-choice[hidden]{display:none}
.studio .k4-choice input,.studio .k4-ratio input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.studio .k4-choice span{display:grid;place-items:center;height:32px;border:1px solid transparent;border-radius:5px;font-size:12px;color:#aaa39d}
.studio .k4-choice input:checked+span{border-color:#514137;background:#282323;color:#ffe5d6}
.studio .k4-choice input:focus-visible+span,.studio .k4-ratio input:focus-visible+span{outline:2px solid var(--k4-accent)}
.studio .k4-ratios{display:flex;gap:10px}
.studio .k4-ratio>span{height:78px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#0b0b0b;border:1px solid var(--k4-line);border-radius:10px;color:#a9a39e;font-size:11px}
.studio .k4-ratio input:checked+span{color:#ffb58f;background:#271a13;border-color:#875033}
.studio .k4-ratio input:disabled+span{opacity:.38;cursor:not-allowed}
.studio .k4-shape{display:block;background:currentColor;border-radius:3px;width:32px;height:18px}
.studio .k4-portrait{width:15px;height:27px}
.studio .k4-square{width:23px;height:23px}
.studio .k4-sound{display:flex;justify-content:space-between;align-items:center;margin:22px 0;padding:0 0 22px;border-bottom:1px solid var(--k4-line)}
.studio .k4-sound strong{font-size:12px;font-weight:500}
.studio .k4-sound label{cursor:pointer}
.studio .k4-sound p{font-size:11px;color:var(--k4-muted);margin:5px 0 0}
.studio .k4-switch{appearance:none;-webkit-appearance:none;width:34px;height:20px;background:#383533;border-radius:20px;position:relative;margin:0;cursor:pointer;flex-shrink:0;border:0}
.studio .k4-switch::before{content:'';position:absolute;left:3px;top:3px;width:14px;height:14px;background:#b6b0a9;border-radius:50%}
.studio .k4-switch:checked{background:var(--k4-accent)}
.studio .k4-switch:checked::before{left:17px;background:#100a05}
.studio .k4-switch:disabled{opacity:.7;cursor:not-allowed}
.studio .k4-switch:focus-visible{outline:2px solid var(--k4-accent);outline-offset:3px}
.studio .k4-action{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:40px}
.studio .k4-cost{font-size:13px;font-weight:500;min-width:0}
.studio .k4-cost small{display:block;font-size:10px;font-weight:400;color:var(--k4-muted);margin-top:6px}
.studio .k4-generate{min-width:178px;height:40px;padding:0 20px;font-size:13px;border-radius:10px;white-space:nowrap}
.studio .k4-generate.k4-signin{min-width:0}
.studio .k4-generate:disabled{opacity:.38;cursor:not-allowed}
.studio .k4-error{display:block;color:#ffad88;font-size:11px;line-height:1.6;margin:12px 0 0}
.studio .k4-action-note{color:var(--k4-muted);font-size:10px;line-height:1.7;margin:12px 0 0}
.studio .k4-action-note.warn{color:#ffb58f}
.studio .btn.k4-ghost{border:1px solid #383838;background:transparent;color:var(--k4-fg);height:34px;padding:0 12px;font-size:11px;border-radius:10px;font-weight:600;min-width:0}
.studio .k4-text-btn{background:transparent;border:0;color:#dfc8b9;font:inherit;font-size:11px;padding:0;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.studio .k4-meta{display:block;font-size:10px;color:#a39b95;line-height:1.6}
/* library */
.studio .k4-player{display:block;aspect-ratio:16/9;position:relative;border-radius:10px;overflow:hidden;background:linear-gradient(160deg,#312c40,#c27854 49%,#344e56 50%,#101f25)}
.studio .k4-player img,.studio .k4-player video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;background:#0b0b0b}
.studio .k4-frame{position:absolute;top:14px;left:14px;color:#fff;background:#0007;padding:5px 7px;border:1px solid #ffffff26;border-radius:5px;font-size:9px;letter-spacing:1.4px;z-index:1}
.studio .k4-player-foot{position:absolute;bottom:14px;left:14px;right:14px;display:flex;justify-content:space-between;z-index:1;font-size:11px;color:#fff;text-shadow:0 1px 3px #000a;pointer-events:none}
.studio .k4-thumbs{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px;min-height:40px}
.studio .k4-thumb{display:block;aspect-ratio:16/9;position:relative;overflow:hidden;border-radius:6px;border:1px solid #ffffff12;padding:0;cursor:pointer;background:linear-gradient(145deg,#563c3a,#e0a779 46%,#24454d 48%,#12252d)}
.studio .k4-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.studio .k4-thumb[aria-pressed=true]{outline:2px solid var(--k4-accent);outline-offset:2px}
.studio .k4-thumb.g1{background:linear-gradient(150deg,#16243d,#625995 58%,#ca7f7f)}
.studio .k4-thumb.g2{background:linear-gradient(145deg,#0f2521,#33735b 60%,#d2b78a)}
.studio .k4-thumb.g3{background:radial-gradient(ellipse at 60% 40%,#d2b9e9,transparent 30%),linear-gradient(150deg,#141731,#5e4373)}
.studio .k4-example-copy{display:block;padding-top:20px;min-height:150px}
.studio .k4-example-copy p{font-size:13px;line-height:1.8;margin:9px 0 11px;min-height:70px}
.studio .k4-example-bottom{display:flex;justify-content:space-between;gap:12px;align-items:center}
.studio .k4-library-note{margin:20px 0 0;padding-top:16px;border-top:1px solid var(--k4-line);font-size:10px;color:var(--k4-muted);line-height:1.8}
.studio .k4-empty{padding:28px;border:1px dashed #39312c;border-radius:10px;text-align:center;font-size:12px;color:#aaa;margin:0}
.studio .k4-jobs{display:block}
.studio .k4-job{display:grid;grid-template-columns:128px minmax(0,1fr);gap:16px;padding:20px 0;border-top:1px solid #282522}
.studio .k4-job:first-child{border-top:0;padding-top:0}
.studio .k4-job.playing{grid-template-columns:minmax(0,1fr)}
.studio .k4-job-art{display:grid;place-items:center;aspect-ratio:16/10;border-radius:6px;overflow:hidden;position:relative;color:#988b81;background:linear-gradient(150deg,#16243d,#625995 58%,#ca7f7f)}
.studio .k4-job.done .k4-job-art{background:linear-gradient(145deg,#563c3a,#e0a779 46%,#24454d 48%,#12252d)}
.studio .k4-job.bad .k4-job-art{background:linear-gradient(135deg,#272321,#141414)}
.studio .k4-job.playing .k4-job-art{aspect-ratio:auto;background:#000}
.studio .k4-job-art video{display:block;width:100%;max-height:420px;background:#000}
.studio .k4-job h3{font-size:12px;font-weight:500;line-height:1.7;margin:8px 0 6px;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.studio .k4-status{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border:1px solid #513821;border-radius:5px;background:#251a13;color:#ffb68d;font-size:9px;line-height:1.4}
.studio .k4-status.complete{border-color:#304636;background:#17231d;color:#a3c9ad}
.studio .k4-status.failed{border-color:#40342e;background:#26211f;color:#d6b8a7}
.studio .k4-status-note{color:#ffaf86;font-size:10px;margin-top:8px;line-height:1.7}
.studio .k4-progress{height:2px;background:#30231e;margin-top:10px;overflow:hidden}
.studio .k4-progress::before{content:'';display:block;width:40%;height:2px;background:var(--k4-accent);animation:k4-slide 1.6s ease-in-out infinite}
@keyframes k4-slide{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
@media (prefers-reduced-motion:reduce){.studio .k4-progress::before{animation:none}}
.studio .k4-job-actions{display:flex;gap:16px;margin-top:9px}
.studio .k4-load{width:100%;height:36px;margin-top:4px}
@media (max-width:640px){
 .studio{margin-top:28px;gap:20px}
 .studio .k4-panel{padding:18px}
 .studio .k4-head{flex-direction:column;align-items:flex-start;gap:10px;margin-bottom:18px}
 .studio .k4-head h2{font-size:17px}
 .studio .k4-tabs{width:100%}
 .studio .k4-tabs button{flex:1;justify-content:center;padding:9px 10px;font-size:11px}
 .studio .k4-generate{min-width:146px}
 .studio .k4-action{flex-wrap:wrap}
 .studio .k4-generate.k4-signin{width:100%}
 .studio .k4-example-bottom{flex-direction:column;align-items:stretch}
 .studio .btn.k4-ghost{height:36px}
 .studio .k4-job{grid-template-columns:90px minmax(0,1fr);gap:12px}
 .studio .k4-thumbs{gap:7px}
}
/* Buy credits dialog */
.buy-panel{max-width:960px}
.buy-panel .buy-lead{color:#bcb3ad;font-size:14px;margin:10px 0 0}
.buy-panel .buy-plans{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:24px}
.buy-panel .buy-plan{display:flex;flex-direction:column;gap:10px;border:1px solid #303034;border-radius:14px;padding:22px;background:#111;min-height:0}
.buy-panel .buy-plan.selected{border-color:#ff4d00;box-shadow:0 0 0 1px #ff4d00 inset}
.buy-panel .buy-plan h3{font-size:20px;font-weight:600;margin:0}
.buy-panel .buy-plan .price{font-size:28px;font-weight:600}
.buy-panel .buy-plan .price small{font-size:12px;color:#adaaa5;font-weight:400;margin-left:6px}
.buy-panel .buy-plan .btn{margin-top:8px;width:100%;height:40px}
.buy-panel .k4-error{color:#ffad88;font-size:13px;margin:16px 0 0}
.buy-panel .buy-foot{margin:18px 0 0;font-size:12px;color:#adaaa5}
.buy-panel .buy-foot a{text-decoration:underline;text-underline-offset:3px}
@media (max-width:640px){.buy-panel .buy-plans{grid-template-columns:minmax(0,1fr)}}
/* Homepage header: opaque so scrolled hero text never shows through the (taller) two-row header,
   and extra room above the H1 where the account row sits below 960px. Static CSS: no layout shift. */
.header:has(.hdr-tool){background:#070707}
@media (max-width:960px){
 .account{background:#070707}
 #create>.hero-content{padding-top:24px}
}
/* Additional Kling 4.0 assets and editors. */
.studio [hidden]{display:none!important}
.studio .k4-assets{margin:16px 0;display:grid;gap:10px;min-width:0}
.studio .k4-assets label{font-size:12px;line-height:1.6}
.studio .k4-assets input:not([type=checkbox]),.studio .k4-assets select,.studio .k4-assets textarea{width:100%;box-sizing:border-box;min-width:0;background:#0b0b0b;color:var(--k4-fg);border:1px solid #49413b;border-radius:6px;padding:9px;font:inherit;font-size:12px}
.studio .k4-assets input[type=file]{white-space:normal}
.studio .k4-assets input:focus-visible,.studio .k4-assets select:focus-visible,.studio .k4-assets textarea:focus-visible,.studio button:focus-visible{outline:2px solid var(--k4-accent);outline-offset:3px}
.studio .k4-assets div>div:has(> .k4-text-btn){display:flex;justify-content:space-between;gap:12px;margin:8px 0;overflow-wrap:anywhere;font-size:11px}
.studio .k4-editor{display:grid;gap:9px;min-width:0;margin:14px 0;padding:12px;border:1px solid var(--k4-line);border-radius:8px}
.studio .k4-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.studio .k4-chips button{background:#281e18;color:#ffd2b8;border:1px solid #5a3420;border-radius:20px;padding:6px 9px;cursor:pointer;font:inherit;font-size:11px}
.studio .k4-ratios{gap:6px;flex-wrap:wrap}
.studio .k4-ratio{min-width:55px}
.studio .k4-tabs button{padding-left:12px;padding-right:12px}
.studio #image-field:focus-within .k4-drop{outline:2px solid var(--k4-accent);outline-offset:3px}

/* Edit vs regenerate explainer under the Generate button; numbers are build tokens from lib/pricing.mjs. */
.studio .k4-edit-cost{display:block;margin:20px 0 0;padding:16px 0 0;border-top:1px solid var(--k4-line)}
.studio .k4-edit-cost .k4-overline{margin:0 0 10px}
.studio .k4-edit-cost-scroll{display:block;overflow-x:auto;max-width:100%}
.studio .k4-edit-cost-table{display:table;width:100%;min-width:0;border-collapse:collapse;font-size:11px;font-variant-numeric:tabular-nums;color:var(--k4-fg)}
.studio .k4-edit-cost-table caption{display:table-caption;caption-side:top;text-align:left;color:var(--k4-muted);font-size:10px;line-height:1.6;padding:0 0 6px}
.studio .k4-edit-cost-table th,.studio .k4-edit-cost-table td{display:table-cell;padding:6px 8px;border:1px solid var(--k4-line);text-align:left;font-weight:400;white-space:nowrap}
.studio .k4-edit-cost-table thead th{color:#bcb3ad;background:#0b0b0b}
.studio .k4-edit-cost-table tbody th{color:#dba180}
.studio .k4-edit-cost .k4-help a{color:#ffaf86;text-decoration:underline;text-underline-offset:3px}
.studio .k4-edit-cost .k4-edit-tip{color:#a3c9ad}

/* Shared checkout recovery on the studio landing page. */
.checkout-pending{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:12px;padding:16px;margin:16px 0;border:1px solid #a78bfa;border-radius:12px;background:#141414;color:#fff}.checkout-pending p{margin:0}.checkout-pending .button{cursor:pointer}
#checkout-pending .button{display:inline-flex;padding:10px 18px;border-radius:8px;font:inherit;text-decoration:none;color:#fff;border:1px solid #626262;background:transparent}#checkout-pending .primary{background:#f97316;color:#100a05}
