.study-edit-page { width:min(1440px,calc(100% - 48px)); }
.study-edit-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:32px; }
.study-edit-header h1 { margin:0 0 8px; font-size:30px; letter-spacing:-.035em; }
.study-edit-header p { margin:0; font-size:14px; color:var(--muted); line-height:1.6; }
.study-editor-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:48px; align-items:start; }
.study-editor-form,.study-editor-preview { min-width:0; }
.editor-section { margin-bottom:32px; padding-bottom:28px; border-bottom:1px solid var(--line); }
.editor-section h2 { font-size:21px; margin:0 0 18px; letter-spacing:-.03em; }
.editor-section h2 small { color:var(--muted); margin-left:8px; font-size:13px; font-weight:400; }
.study-editor-form label { display:grid; gap:8px; font-size:13px; font-weight:650; margin:16px 0; }
.study-editor-form input:not([type=checkbox]),.study-editor-form textarea,.study-editor-form select { width:100%; min-width:0; font:inherit; font-size:15px; line-height:1.6; padding:11px 13px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--ink); box-sizing:border-box; }
.study-editor-form textarea { resize:vertical; min-height:100px; }
.study-editor-form [name=additional] { min-height:220px; }
.study-editor-form input:focus-visible,.study-editor-form textarea:focus-visible,.study-editor-form select:focus-visible { outline:2px solid var(--red); outline-offset:2px; }
.study-editor-form input[readonly] { background:#efefec; }
.editor-help { color:var(--muted); font-size:13px; line-height:1.7; margin:0 0 18px; }
.host-editor,.session-editor { min-width:0; margin:20px 0; padding:16px; border:1px solid var(--line); border-radius:12px; background:#fafaf8; }
.host-editor legend,.session-editor legend { padding:0 8px; font-size:15px; font-weight:700; }
.repeat-actions { display:flex; flex-wrap:wrap; gap:8px; }
.editor-fields { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.badge-editor { border:0; padding:0; margin:20px 0; display:flex; flex-wrap:wrap; gap:20px; }
.badge-editor legend { font-size:13px; font-weight:650; margin-bottom:8px; }
.badge-editor label,.study-editor-form .editor-check { display:flex; align-items:center; gap:8px; margin:0; }
.badge-editor input,.editor-check input { width:18px; height:18px; accent-color:var(--red); }
.editor-savebar { position:sticky; bottom:0; z-index:10; background:var(--paper); border-top:1px solid var(--line); padding:16px 0; }
.editor-savebar p { margin:0 0 12px; color:var(--red); font-size:13px; line-height:1.6; }
.editor-savebar [data-editor-message]:empty { display:none; }
.editor-save-actions { display:flex; flex-wrap:wrap; gap:16px; justify-content:space-between; align-items:center; }
.editor-recruitment { display:grid; gap:2px; }
.editor-savebar .editor-recruitment p { margin:0; color:var(--muted); font-size:12px; }
.editor-page-actions { display:flex; gap:8px; align-items:center; margin-left:auto; }
.editor-page-actions button { font-size:13px; }
.study-edit-page .editor-intake-toggle { display:flex; align-items:center; gap:10px; min-height:44px; padding:0; border:0; border-radius:6px; background:transparent; color:var(--ink); font-size:14px; font-weight:650; cursor:pointer; }
.editor-intake-track { position:relative; width:44px; height:26px; flex-shrink:0; border-radius:20px; background:#77777e; transition:background .18s ease; }
.editor-intake-thumb { position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #0002; transition:transform .18s ease; }
.editor-intake-toggle[aria-checked=true] .editor-intake-track { background:var(--red); }
.editor-intake-toggle[aria-checked=true] .editor-intake-thumb { transform:translateX(18px); }
.editor-intake-toggle:hover:not(:disabled) .editor-intake-track { filter:brightness(.9); }
.editor-intake-toggle:focus-visible { outline:2px solid var(--red); outline-offset:4px; }
.editor-intake-toggle:disabled { cursor:wait; opacity:.65; }
.editor-intake-toggle[aria-busy=true] .editor-intake-thumb { animation:intake-saving .8s ease-in-out infinite alternate; }
@keyframes intake-saving { to { opacity:.35; } }
@media(prefers-reduced-motion:reduce) { .editor-intake-track,.editor-intake-thumb { transition:none; animation:none !important; } }
.study-edit-page .editor-publish { background:var(--red); border-color:var(--red); color:white; }
.study-editor-preview { position:sticky; top:90px; border:1px solid var(--line); border-radius:16px; overflow:hidden; background:var(--paper); }
.editor-preview-toolbar { display:flex; align-items:center; gap:8px; padding:12px 16px; background:#fff; border-bottom:1px solid var(--line); font-size:12px; }
.editor-preview-toolbar>span { margin-right:auto; color:var(--muted); }
.editor-preview-toolbar button { font-size:12px; min-height:38px; padding:7px 12px; }
.editor-preview-toolbar button[aria-pressed=true] { background:var(--ink); color:#fff; border-color:var(--ink); }
.study-editor-preview-content { max-height:calc(100vh - 170px); overflow:auto; padding:24px; }
.study-editor-preview-content .detail-layout { display:block; }
.study-editor-preview-content .detail-main,.study-editor-preview-content .detail-aside { display:block; }
.study-editor-preview-content .detail-intro h1 { font-size:29px; }
.study-editor-preview-content .detail-intro>p { font-size:15px; }
.study-editor-preview-content .host { grid-template-columns:80px minmax(0,1fr); gap:8px 16px; }
.study-editor-preview-content .host img,.study-editor-preview-content .host-fallback { width:80px; height:80px; }
.study-editor-preview-content .host h3 { font-size:16px; }
.study-editor-preview-content .host-intro { font-size:13px; }
.study-editor-preview-content .section-heading h2 { font-size:20px; }
.study-editor-preview-content .detail-aside { margin-top:30px; }
.study-editor-preview-content .join-panel { position:static; margin-top:24px; }
.study-editor-preview-content .outcome-lead { font-size:26px; }
.study-editor-preview-content .section-nav { gap:20px; }
.editor-card-preview { width:min(360px,100%); margin:0 auto; }
.editor-card-preview .study-share,.editor-card-preview .study-interest { display:none; }
.editor-mobile-switch { display:none; }
.study-edit-page.show-editor-preview .study-editor-preview { display:block; }
@media(max-width:1020px) { .study-editor-layout { gap:24px; } }
@media(max-width:820px) {
 .study-edit-page { width:calc(100% - 32px); }
 .study-edit-header h1 { font-size:26px; }
 .study-edit-header { align-items:start; }
 .study-edit-header p { font-size:13px; }
 .study-edit-header>button { flex-shrink:0; }
 .study-editor-layout { display:block; }
 .editor-mobile-switch { display:flex; gap:8px; margin-bottom:24px; }
 .editor-mobile-switch button[aria-pressed=true] { color:#fff; background:var(--ink); }
 .study-editor-preview { display:none; position:static; }
 .study-edit-page.show-editor-preview .study-editor-form { display:none; }
 .study-editor-preview-content { max-height:none; overflow:visible; padding:18px; }
 .editor-fields { grid-template-columns:1fr; gap:0; }
 .editor-savebar { padding-bottom:calc(14px + env(safe-area-inset-bottom)); }
}

.study-editor-preview-content .host .host-portrait { width:80px; height:80px; }

body:has(.study-edit-page) #knet-fab { display:none; }
