/* Knightfall Profile Studio 2: accessible, mobile-first profile editor.
   Loaded after legacy profile/theme styles so orange-era components do not bleed through. */
body:has(#studio-appearance){color-scheme:dark;background:radial-gradient(ellipse at 65% -15%,#45225b75,transparent 53%),radial-gradient(ellipse at 7% 82%,#10392b45,transparent 55%),#080a14}
body:has(#studio-appearance) .profile-shell{max-width:1220px;width:min(96%,1220px);margin-inline:auto;padding:clamp(10px,2.3vw,24px) 0 100px}
body:has(#studio-appearance) .profile-shell>.card{border:1px solid #684780;background:radial-gradient(ellipse at 5% 0,#b25b680d,transparent 50%),linear-gradient(155deg,#1c142b,#101322 65%,#0d1020);box-shadow:0 23px 70px #0009,inset 0 1px #ffffff12;padding:clamp(13px,2.5vw,28px);border-radius:22px;min-width:0;overflow:clip}
body:has(#studio-appearance) .profile-shell h1,body:has(#studio-appearance) .profile-shell h2,body:has(#studio-appearance) .profile-shell h3{color:#f7efff}
.studio-page-lead{display:flex;gap:18px;align-items:end;justify-content:space-between;flex-wrap:wrap;padding:9px 3px 19px;border-bottom:1px solid #79528c5c}
.studio-page-lead>div{flex:1 1 420px;min-width:0}
.studio-overline{font-size:.7rem;letter-spacing:.19em;color:#92a18a;text-transform:uppercase;font-weight:950;margin:0 0 7px}
.studio-page-lead h1{font-size:clamp(2.9rem,7vw,6rem);line-height:.93;letter-spacing:-.075em;margin:0}
.studio-page-lead h1 span{color:#b25b68;text-shadow:0 0 38px #b25b6841}
.studio-page-lead .handle{max-width:610px;color:#c4b4d4;font-size:.91rem;line-height:1.6;margin:12px 0 0}
.studio-top-links{display:flex;flex:1 1 340px;gap:8px;align-content:center;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.studio-top-links a{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 12px;border:1px solid #75538d;border-radius:11px;background:#1b162b;color:#dfcef1;text-decoration:none;font-size:.77rem;font-weight:850;white-space:nowrap}
.studio-top-links a:hover{border-color:#c7a77c;color:#c7a77c}
.studio-intro{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;border:1px solid #85569a65;border-radius:16px;padding:16px 18px;background:radial-gradient(ellipse at 100% 0,#c7a77c14,transparent 55%),#181326}
.studio-intro>div:first-child{flex:1 1 250px}
.studio-intro h2{font-size:clamp(1.2rem,2.8vw,1.7rem);line-height:1.1;letter-spacing:-.04em;margin:3px 0 6px}
.studio-intro .eyebrow{color:#92a18a;font-size:.65rem;letter-spacing:.14em;font-weight:950;margin:0}
.studio-intro .muted{color:#bdb0cb;margin:0;max-width:500px;line-height:1.55;font-size:.81rem}
.studio-progress-shell{flex:0 1 205px;display:grid;grid-template-columns:1fr auto;gap:6px;align-items:center;font-size:.72rem;font-weight:900;color:#c7a77c;min-width:170px}
.studio-progress-shell strong{color:#eafed7;font-size:.85rem}
.studio-completion-track{grid-column:1/-1;height:10px;border:1px solid #547561;border-radius:999px;background:#101d19;overflow:hidden}
.studio-completion-track i{display:block;width:0;height:100%;border-radius:999px;background:linear-gradient(90deg,#b25b68,#92a18a,#c7a77c);box-shadow:0 0 18px #92a18a8c;transition:width .22s ease}
.studio-jump{position:sticky;top:8px;z-index:10;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:7px;margin:12px 0 7px;padding:7px;border:1px solid #795391a1;border-radius:14px;background:#120f20f2;backdrop-filter:blur(14px);box-shadow:0 8px 24px #0006}
.studio-jump a{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 12px;border:1px solid transparent;border-radius:10px;color:#c7b9d5!important;font-size:.78rem;font-weight:850;text-decoration:none;white-space:nowrap}
.studio-jump a:hover,.studio-jump a.active{color:#c7a77c!important;border-color:#c7a77c99;background:#26322b}
.studio-jump a:focus-visible,.studio-top-links a:focus-visible{outline:3px solid #c7a77c;outline-offset:2px}
.studio-feedback{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;min-height:30px;margin:6px 2px 10px;font-size:.77rem;color:#bfb0d0}
#studio-save-indicator{font-weight:950;color:#92a18a}
#studio-save-indicator[data-state="dirty"]{color:#ffe49a}
#studio-save-indicator[data-state="saving"]{color:#b5d5ff}
#studio-save-indicator[data-state="error"]{color:#ff9dd1}
#studio-save-indicator[data-state="saved"]{color:#c7a77c}
.studio-live-preview{border-color:#a65bcaa1!important;border-radius:18px!important;padding:clamp(11px,2vw,18px)!important;box-shadow:0 15px 42px #0006,0 0 26px #b25b6810}
.studio-live-preview .studio-preview-heading{gap:12px;align-items:center}
.studio-live-preview .studio-preview-heading h2{font-size:clamp(1.05rem,2.4vw,1.35rem)}
.studio-live-preview .studio-preview-chip{border-color:#c7a77c!important;color:#c7a77c!important;background:#172a22!important}
.studio-live-preview .studio-preview-card{border-color:var(--preview-accent,#b25b68)!important;min-width:0;max-width:100%}
.studio-live-preview .studio-preview-person{min-width:0}
.studio-preview-cover{position:relative;overflow:hidden}
.studio-preview-cover img{width:100%;height:100%;object-fit:cover}
.studio-preview-avatar{overflow:hidden}
.studio-preview-avatar img{width:100%;height:100%;object-fit:cover}
.studio-preview-person h3,.studio-preview-bio,.studio-preview-quote,.studio-preview-favorites{overflow-wrap:anywhere}
.profile-studio-form .studio-section{border:1px solid #76518d6d;border-radius:17px;padding:clamp(13px,2.1vw,22px);margin:18px 0;background:linear-gradient(160deg,#191526,#101423);scroll-margin-top:91px;min-width:0;box-shadow:0 7px 24px #0002}
.profile-studio-form .studio-section h2{font-size:clamp(1.1rem,2.8vw,1.5rem);letter-spacing:-.04em;margin:0}
.studio-section-head{display:flex;align-items:center;gap:12px;margin:0 0 13px;padding-bottom:12px;border-bottom:1px solid #704a8161}
.studio-section-head>div{min-width:0}
.studio-section-head .muted{font-size:.79rem;color:#b8a9c9;margin:5px 0 0}
.studio-step{color:#c7a77c;font-weight:950;font-size:.71rem;letter-spacing:.09em;white-space:nowrap;background:#c7a77c0d;padding:6px;border:1px solid #c7a77c3b;border-radius:7px}
.profile-studio-form :is(input[type="text"],input[type="url"],input[type="color"],input:not([type]),textarea,select){background:#0f1020;color:#f8eeff;border:1px solid #73508a;border-radius:11px;min-height:44px;font:inherit}
.profile-studio-form input:focus-visible,.profile-studio-form textarea:focus-visible,.profile-studio-form select:focus-visible{outline:2px solid #92a18a;outline-offset:1px;border-color:#92a18a}
.profile-studio-form label{color:#f0e1ff;line-height:1.5}
.profile-studio-form label small,.profile-studio-form .muted{color:#bdb0ca}
.profile-studio-form textarea{resize:vertical}
.profile-studio-form .studio-toggle{padding:11px 12px;border:1px solid #71528b7e;border-radius:11px;background:#161326;gap:12px}
.profile-studio-form .studio-toggle input{accent-color:#c7a77c;width:21px;height:21px;min-height:21px;flex-shrink:0}
.profile-studio-form .studio-toggle small{color:#c0b0cd}
.studio-privacy-guide{padding:12px 14px;border:1px solid #6bcbae6e;border-left:4px solid #92a18a;border-radius:12px;background:#0d282a5c;color:#bdf9e6;font-size:.84rem;line-height:1.6}
.studio-crop-control{display:flex!important;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 12px}
.studio-crop-control select{width:auto!important;max-width:200px;min-width:145px;min-height:40px!important;padding:7px!important;background:#121323!important;color:#eaffdf!important}
.studio-theme-presets{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-start}
.studio-theme-presets button,.studio-layout-presets button{min-height:42px;border-radius:10px!important;border:1px solid #6b5082!important;background:linear-gradient(135deg,#261a35,#161729)!important;color:#f1dff6!important;box-shadow:none!important}
.studio-theme-presets button[aria-pressed="true"],.studio-layout-presets button[aria-pressed="true"]{border-color:#c7a77c!important;color:#c7a77c!important;background:linear-gradient(120deg,#28342a,#171b23)!important;box-shadow:0 0 0 1px #c7a77c40!important}
.profile-studio-form .avatar-editor,.profile-studio-form .cover-editor{border:1px solid #625181!important;border-radius:12px;padding:13px;background:#141326}
.profile-studio-form :is(.avatar-preview-wrap,.cover-preview-wrap){border-color:#8b539d!important}
.profile-studio-form :is(.avatar-preview,.cover-preview-wrap img){object-fit:cover}
.profile-studio-form input[type="file"]{padding:10px;max-width:100%;background:#111225;border:1px dashed #7f5896;border-radius:10px}
.profile-studio-form input[type="file"]::file-selector-button{background:#2f1d40;color:#def;min-height:37px;border:1px solid #826494;border-radius:8px;margin-right:10px;padding:7px 9px;cursor:pointer}
.studio-layout-row{display:flex;gap:9px;align-items:center;flex-wrap:wrap;min-width:0;padding:9px;border:1px solid #5e4d70;border-radius:10px;background:#171424}
.studio-layout-row span{flex:1 1 150px}
.studio-layout-row button{min-width:42px;min-height:42px}
.studio-layout-row input[type="checkbox"]{width:20px;min-height:20px;height:20px;accent-color:#c7a77c}
#layout-studio,#birth-chart-studio{border:1px solid #76518d6d;border-radius:17px;padding:clamp(13px,2.1vw,22px);margin:19px 0;background:linear-gradient(160deg,#191526,#101423);scroll-margin-top:91px}
#layout-studio .muted,#birth-chart-studio .muted{color:#bdb0ca}
#layout-studio .studio-layout-actions{display:flex;flex-wrap:wrap;gap:8px}
#layout-studio :is(button,.action),#birth-chart-studio :is(button,.action){min-height:42px;border:1px solid #79548c;border-radius:10px;background:#291936;color:#f1e5ff}
#layout-studio :is(button,.action):hover,#birth-chart-studio :is(button,.action):hover{border-color:#c7a77c;color:#c7a77c}
.studio-save-bar{position:sticky;bottom:max(7px,env(safe-area-inset-bottom));z-index:11;display:flex;gap:10px;justify-content:space-between;align-items:center;padding:12px 15px;border:1px solid #c7a77c9c;border-radius:14px;background:linear-gradient(125deg,#1b1a27f5,#152128f5);backdrop-filter:blur(18px);box-shadow:0 14px 30px #000b,0 0 18px #c7a77c14}
#studio-save-summary{font-weight:800;color:#d5ebdd;font-size:.83rem}
.studio-save-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.studio-save-actions button{min-height:45px;border-radius:10px;padding:10px 16px;font-weight:900;cursor:pointer}
.studio-save-actions button[type="submit"]{background:linear-gradient(110deg,#c7a77c,#92a18a);color:#122018;border:1px solid #c7a77c;box-shadow:0 5px 19px #c7a77c3d}
.studio-save-actions .studio-secondary-action{background:#1a1728;color:#edcceb;border:1px solid #815b97}
.studio-save-actions button:disabled{opacity:.48;cursor:not-allowed}
#status{font-size:.83rem;min-height:20px;color:#92a18a;font-weight:800}
#studio-privacy :is(select,input){accent-color:#c7a77c}
@media(max-width:800px){
 .studio-top-links{justify-content:flex-start;flex:1 1 100%}
 .studio-top-links a{flex:1 1 auto}
 .studio-progress-shell{flex-basis:100%}
 .studio-jump{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;scroll-snap-type:x proximity}
 .studio-jump a{flex:0 0 auto;scroll-snap-align:start}
 .studio-feedback{font-size:.73rem}
}
@media(max-width:540px){
 body:has(#studio-appearance) .profile-shell{width:calc(100% - 12px);padding:6px 0 90px}
 body:has(#studio-appearance) .profile-shell>.card{padding:11px;border-radius:15px}
 .studio-page-lead h1{font-size:clamp(2.5rem,10.8vw,3.6rem)}
 .studio-page-lead .handle{font-size:.83rem}
 .studio-top-links{gap:6px}
 .studio-top-links a{font-size:.71rem;padding:7px 8px}
 .studio-intro{padding:12px}
 .studio-jump{top:4px;padding:5px;gap:5px}
 .studio-jump a{min-height:37px;padding:7px 10px;font-size:.73rem}
 .studio-live-preview{padding:10px!important}
 .profile-studio-form .studio-section,#layout-studio,#birth-chart-studio{padding:12px;border-radius:12px;margin:13px 0}
 .studio-step{font-size:.61rem;padding:5px}
 .studio-save-bar{padding:9px;gap:8px}
 #studio-save-summary{font-size:.73rem;flex:1 1 100%;line-height:1.4}
 .studio-save-actions{width:100%;display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)}
 .studio-save-actions button{min-width:0!important;width:100%;font-size:.81rem;padding:8px 9px}
}
@media(prefers-reduced-motion:reduce){.studio-completion-track i{transition:none}*{scroll-behavior:auto!important}}


/* Profile Studio photo-wall manager and cover selection. */
#photo-studio{min-width:0;border:1px solid #76518d6d;border-radius:17px;padding:clamp(13px,2.1vw,22px);margin:19px 0;background:linear-gradient(160deg,#191526,#101423);scroll-margin-top:91px}
#photo-studio .studio-photo-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;padding:9px 1px}
#studio-photo-count{font-size:.86rem;font-weight:950;color:#c7a77c}
#studio-photo-refresh{min-height:40px;border-radius:9px;border:1px solid #815c95;color:#def6e7;background:#211a30;font-weight:800}
#studio-photo-upload{display:grid;grid-template-columns:minmax(160px,1fr) minmax(180px,1fr) auto;align-items:end;gap:10px;padding:13px;border:1px solid #77518a;border-radius:12px;background:#161728}
#studio-photo-upload label{font-size:.79rem;min-width:0;line-height:1.55}
#studio-photo-upload label small{display:block;color:#bdaecb;font-size:.72rem}
#studio-photo-file,#studio-photo-caption{display:block;width:100%;min-height:43px;background:#0c1221;color:#eef3fc;border:1px solid #84649d;border-radius:9px;padding:9px}
#studio-photo-file::file-selector-button{padding:8px 9px;min-height:30px;margin-right:9px;border:1px solid #896ba5;background:#261938;color:#eedaff;border-radius:8px}
#studio-photo-upload button{align-self:end;min-height:43px;border:1px solid #c7a77c;border-radius:10px;background:#293527;color:#dfffb7;font-weight:900;cursor:pointer;padding:10px}
#studio-photo-upload button:disabled{opacity:.55;cursor:not-allowed}
.studio-photo-status{font-size:.79rem;color:#92a18a;min-height:21px;margin:9px 0}
.studio-photo-status[data-error="true"]{color:#ff9ad4}
.studio-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px;min-width:0}
.studio-photo-card{display:flex;flex-direction:column;min-width:0;overflow:hidden;border:1px solid #675282;border-radius:12px;background:linear-gradient(155deg,#20172d,#101521)}
.studio-photo-image{aspect-ratio:4/3;background:linear-gradient(135deg,#2e1a37,#132c36);overflow:hidden;display:grid;place-items:center}
.studio-photo-image img{width:100%;height:100%;object-fit:cover}
.studio-photo-details{padding:10px;display:grid;gap:4px;min-width:0}
.studio-photo-details strong{font-size:.78rem;color:#eaddf2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.studio-photo-details small{font-size:.69rem;color:#b6a5c9}
.studio-photo-controls{margin-top:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:9px;border-top:1px solid #614d796b}
.studio-photo-button{min-height:38px;min-width:0;padding:7px;border:1px solid #795394;background:#261b34;color:#eee2ff;border-radius:8px;font:850 .73rem/1.3 system-ui;cursor:pointer}
.studio-photo-button.primary{border-color:#c7a77c7f;color:#dfffbd;background:#243027}
.studio-photo-button.danger{border-color:#b25b6875;color:#ffb5de;background:#342036}
.studio-photo-button:hover:not(:disabled){filter:brightness(1.2)}
.studio-photo-button:focus-visible{outline:3px solid #92a18a;outline-offset:2px}
.studio-photo-empty{grid-column:1/-1;margin:0;padding:26px 18px;border:1px dashed #79608d;border-radius:12px;text-align:center;color:#baadc9;font-size:.83rem}
.studio-photo-note{font-size:.73rem;line-height:1.5;margin:10px 0 0}
@media(max-width:900px){#studio-photo-upload{grid-template-columns:repeat(2,minmax(0,1fr))}#studio-photo-upload button{grid-column:1/-1}}
@media(max-width:580px){#studio-photo-upload{grid-template-columns:1fr}#studio-photo-upload button{grid-column:auto}#studio-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.studio-photo-button{min-height:37px}.studio-photo-card{border-radius:9px}}

/* In-place gallery caption editing, visually separate from permanent delete. */
.studio-photo-caption-edit{display:grid;gap:8px;padding:10px;margin:0 9px 9px;border:1px solid #9b64a385;border-radius:10px;background:#151523}
.studio-photo-caption-edit label{font-size:.72rem;color:#d9cbe8;font-weight:850;display:grid;gap:5px}
.studio-photo-caption-input{width:100%;min-height:39px;min-width:0;padding:8px 9px;border:1px solid #806298;border-radius:8px;color:#f6edff;background:#090c19;font:inherit;font-size:.8rem}
.studio-photo-caption-input:focus-visible{outline:2px solid #92a18a;outline-offset:2px}
.studio-photo-caption-actions{display:flex;gap:7px;flex-wrap:wrap}
.studio-photo-caption-actions .studio-photo-button{flex:1 1 95px}
@media(max-width:580px){.studio-photo-controls{grid-template-columns:1fr}.studio-photo-caption-edit{padding:7px;margin:0 6px 6px}.studio-photo-caption-actions{display:grid;grid-template-columns:1fr}}

/* Native full-size studio photo viewer. Works as a top-layer modal on mobile. */
.studio-photo-view-button{display:block;width:100%;height:100%;padding:0;border:0;background:transparent;cursor:zoom-in}
.studio-photo-view-button img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .16s ease}
.studio-photo-view-button:hover img{transform:scale(1.035)}
.studio-photo-view-button:focus-visible{outline:3px solid #c7a77c;outline-offset:-3px}
.studio-photo-viewer{position:fixed;margin:auto;inset:0;width:min(92vw,970px);max-width:970px;max-height:92dvh;overflow:auto;padding:0;background:#100f1d;color:#f9efff;border:1px solid #9b6cb3;border-radius:14px;box-shadow:0 22px 80px #000b}
.studio-photo-viewer::backdrop{background:#040610e8;backdrop-filter:blur(8px)}
.studio-photo-viewer-inner{display:grid;gap:0}
.studio-photo-viewer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid #71558d}
.studio-photo-viewer-title{font-size:.9rem;line-height:1.5;color:#c7a77c;overflow-wrap:anywhere}
.studio-photo-viewer-close{width:42px;height:42px;flex:0 0 42px;border-radius:10px;border:1px solid #866096;background:#23182e;color:#fff;font:900 1.5rem system-ui;cursor:pointer}
.studio-photo-viewer-close:focus-visible{outline:2px solid #92a18a;outline-offset:2px}
.studio-photo-viewer-image{display:block;width:100%;height:auto;max-height:calc(92dvh - 67px);object-fit:contain;background:#090b12}
@media(max-width:570px){.studio-photo-viewer{width:calc(100vw - 14px);max-height:90dvh;border-radius:10px}.studio-photo-viewer-image{max-height:calc(90dvh - 67px)}}
@media(prefers-reduced-motion:reduce){.studio-photo-view-button img{transition:none}}
