/* F/47 studio workspace */
:root{color-scheme:dark}body{background:#111411;color:#f6f6f1}header{height:66px;padding:0 22px;background:#111411;border-color:#303a31;position:relative;z-index:3}header img{width:65px}header span{font-size:12px;letter-spacing:.16em;font-weight:700}header small{font-size:12px;color:#9ba69c}.layout{height:calc(100dvh - 66px);min-height:0;grid-template-columns:280px minmax(300px,1fr) 330px;overflow:hidden}.panel{padding:24px 20px;min-height:0;overflow:auto;background:#191d19}.left{border-right:1px solid #303a31}.right{border-left:1px solid #303a31}.left h1{font:25px f47;margin-top:5px}.left h2{margin-top:24px}.left .intro{font-size:14px}.template{border:1px solid #3b453c;background:#222822;padding:14px;margin:8px 0}.template strong{font-size:14px}.template small{font-size:13px}.template.selected{border-color:#d7ff00;background:#293324}.center{padding:22px 28px 26px;background:#262c27;overflow:auto;gap:14px;justify-content:flex-start}.top{max-width:760px;font-size:12px;font-weight:bold;letter-spacing:.1em}.preview{width:auto;max-width:min(100%,680px);height:min(66vh,780px);max-height:none;display:flex;justify-content:center;box-shadow:none;line-height:0}.preview svg{width:auto;height:100%;max-width:100%;filter:drop-shadow(0 18px 25px #0006)}.center .buttons{justify-content:center}.center .buttons button{flex:initial}.footer-note{font-size:13px}.advanced{margin:0}.advanced>summary{display:none}.advanced>div{display:block}.right h3{font-size:15px}.right .group{margin-top:20px}.field{font-size:14px}.tabs button,.action{min-height:40px}.studio-label{font-size:11px;font-weight:bold;color:#d7ff00;letter-spacing:.15em;text-transform:uppercase}.studio-section-title{font:24px f47;margin:7px 0}.panel-toggle{border:1px solid #485348;background:#252c25;color:white;border-radius:7px;cursor:pointer;padding:8px 10px;min-height:38px}.workspace-actions{display:flex;gap:8px;align-items:center}.workspace-actions button{white-space:nowrap}.mobile-controls,.sheet-close{display:none}.float-shell{display:none}.panel-collapsed-left{grid-template-columns:0 minmax(300px,1fr) 330px}.panel-collapsed-right{grid-template-columns:280px minmax(300px,1fr) 0}.panel-collapsed-left.panel-collapsed-right{grid-template-columns:0 minmax(300px,1fr) 0}.panel-collapsed-left .left,.panel-collapsed-right .right{visibility:hidden;padding:0;border:0}.studio-notice{padding:11px 12px;border:1px solid #465147;border-radius:8px;background:#222a22;margin-top:12px;color:#c2cec0;font-size:13px;line-height:1.5}.preset-row{display:flex;gap:8px;flex-wrap:wrap}.preset-row button{flex:1}.export-options{margin:0 0 18px;padding:15px;border:1px solid #424e42;border-radius:10px;background:#212821}.export-options h3{margin-bottom:6px}.export-options p{font-size:13px}.export-options .field{margin:10px 0}.left a{color:#d7ff00}@media(max-width:1050px) and (min-width:701px){.layout{grid-template-columns:230px minmax(270px,1fr) 280px}.panel-collapsed-left{grid-template-columns:0 minmax(270px,1fr) 280px}.panel-collapsed-right{grid-template-columns:230px minmax(270px,1fr) 0}.panel-collapsed-left.panel-collapsed-right{grid-template-columns:0 minmax(270px,1fr) 0}.right{display:block;grid-column:auto}.right .group{margin-top:20px}.panel{padding:18px 15px}}
@media(max-width:700px){header{height:60px;padding:0 16px}header small{display:none}.layout{height:calc(100dvh - 60px);display:flex;overflow:hidden;padding:0}.center{order:0;flex:1;width:100%;padding:18px 14px 90px;overflow:auto}.top{gap:10px}.desktop-toggle{display:none}.preview{height:min(62vh,660px);max-width:100%;width:auto}.preview svg{height:100%;width:auto;max-width:100%}.center .buttons{flex-wrap:wrap}.center .buttons button{flex:initial}.left,.right{position:fixed;z-index:20;left:0;right:0;bottom:0;max-height:82dvh;overflow:auto;border:1px solid #4a564a;border-radius:22px 22px 0 0;padding:20px 20px 40px;display:none;background:#191f19;box-shadow:0 -12px 35px #0008}.left.sheet-open,.right.sheet-open{display:block}.right .group{margin-top:20px}.sheet-close{display:block;float:right;background:#2c352c;color:#fff;border:0;border-radius:8px;padding:8px 12px}.mobile-controls{position:fixed;z-index:15;display:flex;bottom:10px;left:50%;transform:translateX(-50%);width:min(440px,calc(100% - 24px));gap:6px;padding:7px;border:1px solid #4b5c4b;background:#111912;border-radius:16px;box-shadow:0 10px 24px #0009}.mobile-controls button{flex:1;padding:12px 4px;border:0;border-radius:10px;color:white;background:#293329;font-weight:bold}.mobile-controls button:last-child{background:#d7ff00;color:#111}.sheet-scrim{display:none;position:fixed;z-index:19;inset:60px 0 0;background:#0009}.sheet-scrim.open{display:block}}
.archive-card{border:1px solid #3b453c;border-radius:8px;background:#222822;margin:8px 0;padding:10px}.archive-title{border:0;background:none;color:#fff;font-weight:bold;text-align:left;padding:4px 0;width:100%;cursor:pointer}.archive-card small{display:block;color:#aeb7ac;margin:4px 0 8px}.archive-actions{display:flex;flex-wrap:wrap;gap:5px}.archive-actions .action{font-size:12px;min-height:32px;padding:5px 8px}
.journal-dialog{width:min(920px,95vw);max-height:90dvh;border:1px solid #4c594d;border-radius:16px;background:#1b211b;color:#f6f6f1;padding:24px}.journal-dialog::backdrop{background:#000b}.journal-heading{display:flex;justify-content:space-between;align-items:start;gap:20px}.journal-heading h2{color:#fff;font:28px f47;margin:8px 0 24px;text-transform:none;letter-spacing:0}.journal-grid{display:grid;grid-template-columns:minmax(180px,1fr) minmax(280px,2fr);gap:24px}.journal-grid section{max-height:60vh;overflow:auto}.journal-dialog textarea{min-height:190px}@media(max-width:700px){.journal-grid{grid-template-columns:1fr}.journal-grid section{max-height:180px}.journal-dialog{padding:18px}}
.template-search{width:100%;padding:12px 14px;margin:0 0 12px;border:1px solid #53615c;border-radius:8px;background:#101815;color:white;font:1rem instrument,sans-serif}
#templates{display:block}
#templates details,.custom-menu{display:block;margin:0;border:0;border-bottom:1px solid #39443e;background:transparent;padding:0}
#templates summary,.custom-menu summary{cursor:pointer;min-height:48px;align-content:center;padding:8px 4px;font:600 .95rem instrument,sans-serif;color:#eff2ed}
#templates .template{display:flex;width:100%;align-items:center;text-align:left;gap:12px;margin:3px 0 7px;padding:6px 10px;border-radius:7px}
#templates .template strong{font:600 .95rem instrument,sans-serif}
.template-thumb{display:grid;place-items:center;width:44px;height:55px;flex:none;background:#263530;border-radius:3px;overflow:hidden}
.template-thumb svg{display:block;width:100%;height:100%}
.custom-menu[open]{padding-bottom:16px}.custom-menu>summary:focus-visible,#templates summary:focus-visible{outline:2px solid #d7ff00}

#studioBack{display:inline-flex;align-items:center;min-height:44px;color:#d7ff00;font:600 1rem instrument,sans-serif;text-decoration:none}
.export-list{display:grid;gap:8px}.history-action{padding:5px 10px;min-height:44px}.export-desktop{margin:8px auto}
@media(max-width:700px){.export-desktop{display:none}.top .workspace-actions{gap:5px}.center .top{flex-wrap:wrap}}

.custom-color[hidden]{display:none}

/* Workspace chrome follows Training Plan appearance. */
.studio-shell{background:var(--f47-page);color:var(--f47-text)}
.studio-shell .studio-header{background:#111;border-bottom-color:#394b48;color:#fff}
.studio-header #studioBack{padding-inline:10px}
.studio-header > span{border-inline-start:1px solid #647a74;padding-inline-start:13px}
.studio-shell :is(.panel,.journal-dialog,.export-options,.archive-card,.float-panel){background:var(--f47-surface);color:var(--f47-text);border-color:var(--f47-border)}
.studio-shell .center{background:var(--f47-page)}
.studio-shell :is(.top,.intro,.sub,.footer-note,.field,.archive-card small,.float-hint){color:var(--f47-muted)}
.studio-shell :is(h1,h2,h3,.studio-section-title,.archive-title,#templates summary,.custom-menu summary){color:var(--f47-text)}
.studio-shell :is(.studio-label,.left a){color:var(--f47-selection)}
.studio-shell :is(.template,.layer-item){background:var(--f47-surface);color:var(--f47-text);border-color:var(--f47-border);border-radius:var(--f47-control-radius)}
.studio-shell :is(.template.selected,.layer-item.selected,.float-toolbar button[aria-expanded=true]){background:var(--f47-highlight);color:var(--f47-text);border-color:var(--f47-selection)}
.studio-shell :is(.custom-menu,#templates details){border-bottom-color:var(--f47-border)}
.studio-shell .mobile-controls{background:var(--f47-page);border-color:var(--f47-border)}
.studio-shell .mobile-controls button{padding-inline:4px}
.studio-shell .template-search{border-color:var(--f47-control-border)}
.studio-shell .studio-header small{color:#afc0ba}
.studio-shell .preview svg{overflow:hidden}
@media(max-width:700px){
  .studio-shell .mobile-controls{bottom:max(10px,env(safe-area-inset-bottom))}
  .studio-shell .sheet-open{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
}
.studio-shell{--studio-header-height:66px}
.studio-shell .studio-header{
  height:calc(var(--studio-header-height) + env(safe-area-inset-top));
  padding-top:env(safe-area-inset-top);
}
.studio-shell .layout{height:calc(100dvh - var(--studio-header-height) - env(safe-area-inset-top))}
@media(max-width:700px){
  .studio-shell{--studio-header-height:60px}
  .studio-shell .sheet-scrim{top:calc(var(--studio-header-height) + env(safe-area-inset-top))}
}

@media(max-width:700px) {
  .studio-shell .center { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .studio-shell .preview { height: min(60dvh, 660px); }
  .studio-shell .sheet-open { overscroll-behavior: contain; }
  .studio-shell .sheet-close { position: sticky; top: 0; z-index: 1; }
  .studio-shell .journal-dialog { width: min(100% - 24px, 560px); max-height: 86dvh; }
  .studio-shell .field :is(input,select,textarea), .studio-shell .template-search { font-size: 16px; }
}
