/* The observatory is the only editing surface. Panels occupy the keyboard slot. */
.entry-tools .btn[aria-expanded=true],.entry-tools .btn[aria-pressed=true],.studio-panel .btn[aria-pressed=true]{border-color:var(--gold,var(--accent));background:#bdd6fa22}
.studio-panel{grid-column:1/-1;min-width:0;display:grid;gap:6px}
.studio-panel[hidden]{display:none!important}
.studio-options{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;max-height:150px;overflow:auto}
.studio-choice.btn{min-width:0;min-height:54px;padding:3px;display:flex;flex-direction:column;font-size:11px;gap:0}
.studio-choice canvas{width:100%;height:30px;display:block}
.studio-footer{display:flex;gap:4px;flex-wrap:wrap}
.studio-footer>.btn{min-height:40px;padding:5px 8px;font-size:12px;flex:1}
.entry .entry-tools>#studio-actions{font-size:0}
.entry .entry-console,.entry.keyboard-collapsed .entry-console{grid-template-columns:minmax(0,1fr);max-width:100%;min-width:0}
.entry #entry-keyboard,.entry .keyboard-shelf{grid-column:1;min-width:0}
.entry .observatory{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(80px,1fr) auto auto}
.entry .observatory>.entry-sky{grid-column:1;grid-row:1;min-height:0}
.entry .observatory>.entry-caption{grid-column:1;grid-row:2}
.entry .observatory>.entry-console{grid-column:1;grid-row:3}
.entry .observatory.controls-top{grid-template-rows:auto minmax(80px,1fr) auto}
.entry .controls-top>.entry-console{grid-row:1}.entry .controls-top>.entry-sky{grid-row:2}.entry .controls-top>.entry-caption{grid-row:3}
@media(max-width:600px){.studio-options{grid-template-columns:repeat(4,minmax(0,1fr));max-height:132px}.studio-choice canvas{height:22px}.studio-choice.btn{min-height:48px}.entry .entry-console{padding:6px 10px;gap:5px}.studio-footer>.btn{font-size:11px;padding:4px}}
@media(orientation:landscape) and (max-height:600px){
 .entry .observatory,.entry .observatory.controls-top{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
 .entry .observatory>.entry-sky,.entry .controls-top>.entry-sky{grid-column:1;grid-row:1}
 .entry .observatory>.entry-caption,.entry .controls-top>.entry-caption{grid-column:1;grid-row:2}
 .entry .observatory>.entry-console,.entry .controls-top>.entry-console{grid-column:2;grid-row:1/3;align-content:center;padding:4px 8px;gap:4px;overflow:auto}
 .entry .keyboard-shelf{position:static;width:100%;max-width:100%}
 .entry #entry-keyboard{position:static;width:auto;padding:0}
 .studio-options{max-height:102px}.studio-choice canvas{display:none}.studio-choice.btn{min-height:40px}
 .studio-footer>.btn{min-height:36px}
 .entry .entry-tools{flex-wrap:nowrap;gap:3px}.entry .entry-tools>.btn{min-width:32px;flex:1;width:32px}
}

.entry.studio-editing .keyboard-shelf{display:none}
@media(orientation:landscape) and (max-height:600px){.entry .observatory>.entry-console{align-content:start}.studio-options{max-height:88px}}

.studio-toolbar #studio-style{gap:5px}.studio-toolbar #studio-style img{width:24px;height:24px}

/* Wrap touch targets on narrow screens instead of shrinking the new controls. */
.entry .entry-tools{flex-wrap:wrap}
.entry .entry-tools>.studio-tool{width:44px;min-width:44px;min-height:44px;height:44px;flex:0 0 44px;padding:6px;font-size:0}

/* The desktop keyboard is a sibling of the form. Keep its explicit column
   paired with two real tracks; an implicit column squeezed the input to zero. */
@media(min-width:900px){
 .entry .entry-console{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 /* The canonical keys keep their touch height; let the shelf contain every row. */
 #new-view .keyboard-shelf{max-height:none}
}
@media(orientation:landscape) and (max-height:600px){
 .entry .observatory>.entry-console{grid-template-columns:minmax(0,1fr);overflow:hidden}
 .entry .entry-console>#entry-keyboard{grid-column:1;grid-row:auto;padding:4px}
}
/* The accessible label is already visually hidden. Its empty heading must
   not consume a 32px row and clip the actions inside short embedded windows. */
.entry .entry-field-heading{min-height:0}

/* All seven existing actions share one row after Save moves into the input. */
@media(max-width:500px){
 #new-view .entry-tools{display:grid;grid-template-columns:repeat(7,minmax(0,48px));gap:2px;justify-content:space-between}
 #new-view .entry-tools>.btn{width:100%;max-width:48px;min-width:40px;height:48px;min-height:48px;margin:0;flex:none}
}
