/* Alpha 7.9.15 TEST35 — compact contextual editor toolbar + flag-size control + 5% corner zoom stepper. */

/* The editor no longer needs a second selection-info row. */
#editorApp .workspace{
  grid-template-rows:50px minmax(0,1fr)!important;
}
#editorApp .selectionBar{display:none!important}

#editorApp .top.editorToolbar.editorToolbarCompact{
  position:relative!important;
  z-index:30!important;
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  height:50px!important;
  min-height:50px!important;
  padding:6px 9px!important;
  overflow:visible!important;
  border-bottom:1px solid #252c36!important;
  background:#0d1015!important;
  box-shadow:0 5px 18px #0004!important;
  contain:none!important;
  isolation:isolate;
}
#editorApp .toolbarPrimary{
  display:flex;
  align-items:center;
  gap:5px;
  width:100%;
  min-width:0;
  height:38px;
  white-space:nowrap;
}
#editorApp .toolbarSpacer{flex:1 1 auto;min-width:12px}
#editorApp .toolCluster{
  display:flex;
  align-items:center;
  gap:3px;
  flex:0 0 auto;
  padding-right:6px;
  margin-right:1px;
  border-right:1px solid rgba(148,163,184,.16);
}
#editorApp .toolCluster[hidden]{display:none!important}
#editorApp .historyTools{padding-left:0}

#editorApp .top.editorToolbar .iconBtn,
#editorApp .top.editorToolbar .toolBtn,
#editorApp .toolbarMenuDetails>summary{
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
  min-height:34px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 34px!important;
  border-radius:9px!important;
  font-size:16px!important;
  line-height:1!important;
}
#editorApp .top.editorToolbar .toolBtn.active{
  color:var(--gold)!important;
  border-color:#80663a!important;
  background:#221c13!important;
}
#editorApp .dangerTool:not(:disabled){color:#ffb3b3!important}

/* Word-like global card font selector. */
#editorApp .cardFontToolbarControl{
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
  flex:0 0 auto!important;
  height:34px!important;
  min-height:34px!important;
  padding:0 5px 0 7px!important;
  border:1px solid #303744!important;
  border-radius:9px!important;
  background:#11161e!important;
  box-shadow:inset 0 1px rgba(255,255,255,.025)!important;
}
#editorApp .cardFontToolbarIcon{
  color:var(--gold);
  font:700 11px/1 system-ui,sans-serif;
  pointer-events:none;
}
#editorApp .toolbarFontSelect{
  appearance:auto;
  -webkit-appearance:menulist;
  width:132px!important;
  min-width:132px!important;
  height:30px!important;
  min-height:30px!important;
  margin:0!important;
  padding:0 20px 0 4px!important;
  border:0!important;
  background:transparent!important;
  color:var(--text)!important;
  font-size:12px!important;
  line-height:30px!important;
  outline:none!important;
  box-shadow:none!important;
  cursor:pointer;
}
#editorApp .cardFontToolbarControl:focus-within{
  border-color:#80663a!important;
  box-shadow:0 0 0 2px rgba(202,168,94,.12)!important;
}

/* TEST11 — no typing: compact down/value/up font-size stepper. */
#editorApp .toolbarFontSizeStepper{
  display:inline-flex;
  align-items:center;
  height:34px;
  min-height:34px;
  border:1px solid #303744;
  border-radius:9px;
  overflow:hidden;
  background:#11161e;
}
#editorApp .fontSizeStepBtn{
  width:30px!important;
  min-width:30px!important;
  height:32px!important;
  min-height:32px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:#cbd3df!important;
  font:700 11px/1 system-ui,sans-serif!important;
}
#editorApp .fontSizeStepBtn:hover:not(:disabled),
#editorApp .fontSizeStepBtn:focus-visible{
  background:#211b13!important;
  color:var(--gold)!important;
}
#editorApp .fontSizeStepBtn:disabled{opacity:.28!important;cursor:default!important}
#editorApp .toolbarFontSizeValue{
  display:grid;
  place-items:center;
  width:38px;
  min-width:38px;
  height:32px;
  border-left:1px solid #303744;
  border-right:1px solid #303744;
  color:var(--text);
  background:#0d1219;
  font:700 12px/1 system-ui,sans-serif;
  user-select:none;
}

#editorApp .saveToolbarBtn{color:#f4e6c9!important}
#editorApp .saveToolbarBtn .librarySaveIcon{width:20px!important;height:20px!important;margin:0!important}

/* Native details popover for infrequent view controls. */
#editorApp .toolbarMenuDetails{position:relative;flex:0 0 auto}
#editorApp .toolbarMenuDetails>summary{list-style:none;cursor:pointer}
#editorApp .toolbarMenuDetails>summary::-webkit-details-marker{display:none}
#editorApp .toolbarMenuDetails[open]>summary{color:var(--gold);border-color:#80663a;background:#221c13}
#editorApp .toolbarPopover{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  z-index:150;
  width:235px;
  padding:10px;
  display:grid;
  gap:7px;
  border:1px solid #333b48;
  border-radius:12px;
  background:#111720;
  box-shadow:0 18px 48px #000b;
}
#editorApp .toolbarPopover>b{padding:2px 4px 5px;color:#f0e7d5;font-size:12px}
#editorApp .toolbarPopover label{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:34px;
  margin:0!important;
  padding:5px 7px;
  border-radius:8px;
  color:#c8ced8;
  font-size:12px;
  cursor:pointer;
}
#editorApp .toolbarPopover label:hover{background:#ffffff08}
#editorApp .toolbarPopover input{accent-color:var(--gold)}
#editorApp .toolbarPopover .btn{margin-top:2px;min-height:34px}

/* TEST27 — zoom stepper stays in the same upper-right canvas corner.
   No range input: +/- changes zoom in strict 5% increments. */
#editorApp .workspace{position:relative!important}
#editorApp .cornerZoomControl{
  position:absolute;
  top:68px;
  right:14px;
  z-index:34;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  width:44px;
  padding:6px 4px;
  border:1px solid #303744;
  border-radius:13px;
  background:rgba(17,22,30,.94);
  box-shadow:0 10px 28px #0008,inset 0 1px rgba(255,255,255,.03);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  user-select:none;
  -webkit-user-select:none;
}
#editorApp .cornerZoomButton{
  width:34px;
  height:34px;
  min-width:34px;
  min-height:34px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid #374151;
  border-radius:9px;
  background:#161c25;
  color:#e5e7eb;
  box-shadow:inset 0 1px rgba(255,255,255,.025);
  font:800 20px/1 system-ui,sans-serif;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
#editorApp .cornerZoomButton:hover,#editorApp .cornerZoomButton:focus-visible{
  color:var(--gold);
  border-color:#80663a;
  background:#211b13;
  outline:none;
}
#editorApp .cornerZoomButton:active{transform:translateY(1px)}
#editorApp .cornerZoomButton:disabled{opacity:.32;cursor:default;transform:none}
#editorApp .cornerZoomValue{
  display:grid;
  place-items:center;
  width:36px;
  min-width:36px;
  height:22px;
  color:#d5aa60;
  font:700 10.5px/1 system-ui,sans-serif;
}
#editorApp.editorModalOpen .cornerZoomControl{display:none!important}
@media(max-width:900px) and (min-width:721px){
  #editorApp .cornerZoomControl{top:62px;right:9px;width:40px;padding-inline:3px}
  #editorApp .cornerZoomButton{width:32px;height:32px;min-width:32px;min-height:32px}
  #editorApp .cornerZoomValue{width:32px;min-width:32px;font-size:10px}
}
@media(max-width:720px), (max-height:520px) and (pointer:coarse){#editorApp .cornerZoomControl{display:none!important}}

#editorApp .drawerSection{display:grid;gap:8px;margin-top:14px;padding-top:14px;border-top:1px solid #29313c}
#editorApp .drawerSection:first-of-type{margin-top:0;padding-top:0;border-top:0}
#editorApp .drawerSectionTitle{color:#9fa9b9;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
#editorApp .drawerSection>.btn{text-align:left;padding:11px 12px}

/* Frame colour controls stay collapsed under one window from TEST9. */
#editorApp .frameAdjustmentsDetails{
  margin:10px 0 4px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#0c1118;
  overflow:hidden;
}
#editorApp .frameAdjustmentsDetails>summary{
  list-style:none;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:8px 10px;
  cursor:pointer;
  user-select:none;
}
#editorApp .frameAdjustmentsDetails>summary::-webkit-details-marker{display:none}
#editorApp .frameAdjustmentsDetails>summary::after{
  content:'▾';grid-column:2;grid-row:1 / span 2;color:var(--gold);font-size:13px;transition:transform .16s ease;
}
#editorApp .frameAdjustmentsDetails[open]>summary::after{transform:rotate(180deg)}
#editorApp .frameAdjustmentsTitle{color:var(--text);font-size:12px;font-weight:700}
#editorApp .frameAdjustmentsMeta{grid-column:1;color:var(--muted);font-size:10px;line-height:1.2}
#editorApp .frameAdjustmentsDetails .frameToneGrid{margin:0!important;padding:2px 10px 10px;border-top:1px solid rgba(148,163,184,.12)}

@media(max-width:1100px) and (min-width:721px){
  #editorApp .toolbarFontSelect{width:104px!important;min-width:104px!important}
  #editorApp .cardFontToolbarIcon{display:none}
  #editorApp .cardFontToolbarControl{padding-left:4px!important}
}
@media(max-width:860px) and (min-width:721px){
  #editorApp .toolbarFontSelect{width:90px!important;min-width:90px!important}
  #editorApp .top.editorToolbar .iconBtn,#editorApp .top.editorToolbar .toolBtn{width:32px!important;min-width:32px!important;flex-basis:32px!important}
  #editorApp .fontSizeStepBtn{width:28px!important;min-width:28px!important}#editorApp .toolbarFontSizeValue{width:34px;min-width:34px}
}

/* Phone mode is read-only encyclopedia, but keep fallback layout sane. */
@media(max-width:720px){
  #editorApp .workspace{grid-template-rows:50px minmax(0,1fr)!important}
  #editorApp .top.editorToolbar.editorToolbarCompact{padding-inline:6px!important}
  #editorApp .toolbarFontSelect{width:88px!important;min-width:88px!important}
  #editorApp .cardFontToolbarIcon{display:none}
  #editorApp .cardFontToolbarControl{padding-left:3px!important}
}


/* TEST12 — flavor icon size is contextual: shown only when a flavor block is selected. */
#editorApp .flavorTools{gap:6px;padding-left:1px}
#editorApp .toolbarFlavorLabel{color:#aeb7c4;font:700 10px/1 system-ui,sans-serif;letter-spacing:.02em;user-select:none}
#editorApp .toolbarFlavorRange{appearance:auto;width:118px;min-width:88px;height:28px;margin:0;padding:0;accent-color:var(--gold);cursor:pointer}
#editorApp .toolbarFlavorValue{display:grid;place-items:center;min-width:43px;height:28px;padding:0 5px;border:1px solid #303744;border-radius:8px;background:#0d1219;color:var(--gold);font:700 11px/1 system-ui,sans-serif;user-select:none}
/* TEST35 — country flag size lives in the contextual top toolbar. */
#editorApp .toolbarFlagLabel{color:#aeb7c4;font:700 10px/1 system-ui,sans-serif;letter-spacing:.02em;user-select:none}
#editorApp .toolbarFlagRange{appearance:auto;width:118px;min-width:88px;height:28px;margin:0;padding:0;accent-color:var(--gold);cursor:pointer}
#editorApp .toolbarFlagValue{display:grid;place-items:center;min-width:43px;height:28px;padding:0 5px;border:1px solid #303744;border-radius:8px;background:#0d1219;color:var(--gold);font:700 11px/1 system-ui,sans-serif;user-select:none}
@media(max-width:1050px) and (min-width:721px){#editorApp .toolbarFlavorLabel,#editorApp .toolbarFlagLabel{display:none}#editorApp .toolbarFlavorRange,#editorApp .toolbarFlagRange{width:92px}#editorApp .toolbarFlavorValue,#editorApp .toolbarFlagValue{min-width:39px}}
