/* MRG Phase 7 Alpha 8 · retained in 0.6.19-rc2-pre31
   SSTV image-proximate studio + unified control geometry. */

:root{--sstv-p7-control-h:44px;--sstv-p7-rail-w:66px;--sstv-p7-rail-h:32px}

/* Shared digital action/status language. Other digital modules keep the CQ rule;
   SSTV no longer exposes a second CQ control in its keybar. */
.ft8-key.ft8-key-cq{display:grid;grid-template-rows:minmax(18px,1fr) auto;align-items:center;justify-items:center;gap:1px;min-width:64px;overflow:hidden}
.ft8-key.ft8-key-cq small,.ft8-key.ft8-key-cq em{position:static!important;inset:auto!important;margin:0!important;line-height:1.05;max-width:100%;white-space:nowrap}
.ft8-key.ft8-key-cq small{font-size:.76rem;font-weight:900}.ft8-key.ft8-key-cq em{font-size:.66rem;font-style:normal;font-weight:800;opacity:.96}
.ft8-key.ft8-key-cq.is-idle{background:color-mix(in srgb,var(--danger) 82%,#250909)!important;border-color:color-mix(in srgb,var(--danger) 88%,#fff 12%)!important;color:#fff!important}
.ft8-key.ft8-key-cq.is-waiting,.ft8-key.ft8-key-cq.is-transmitting{background:#d97706!important;border-color:#f59e0b!important;color:#fff!important}
.ft8-key.ft8-key-cq.is-waiting small,.ft8-key.ft8-key-cq.is-transmitting small{font-size:0;min-height:18px}
.ft8-key.ft8-key-cq .ft8-hero-cq-spinner{display:none!important;position:static!important;inset:auto!important;width:15px!important;height:15px!important;margin:auto!important;border-width:2px!important}
.ft8-key.ft8-key-cq.is-waiting .ft8-hero-cq-spinner,.ft8-key.ft8-key-cq.is-transmitting .ft8-hero-cq-spinner{display:block!important;grid-row:1;grid-column:1;align-self:center;justify-self:center}
.ft8-key.ft8-key-cq.is-waiting em,.ft8-key.ft8-key-cq.is-transmitting em{grid-row:2;grid-column:1}

.ft8-key.ft8-key-tx-status{display:grid;grid-template-rows:minmax(18px,1fr) auto;gap:1px;align-items:center;justify-items:center;min-width:64px;overflow:hidden;background:color-mix(in srgb,var(--surface2) 82%,#000 18%)!important;border-color:var(--border)!important}
.ft8-key.ft8-key-tx-status>strong{display:block!important;font-size:.76rem;line-height:1;font-weight:900;color:inherit}.ft8-key.ft8-key-tx-status>small{display:none!important}.ft8-key.ft8-key-tx-status>em{position:static!important;margin:0!important;font-size:.66rem!important;line-height:1.05;font-style:normal!important;font-weight:850!important;white-space:nowrap}
.ft8-key.ft8-key-tx-status.is-waiting,.ft8-key.ft8-key-tx-status.is-transmitting,.ft8-key.ft8-key-tx-status.sstv-phase7-tx-active{background:color-mix(in srgb,var(--danger) 88%,#260808)!important;border-color:var(--danger)!important;color:#fff!important}
.ft8-key.ft8-key-tx-status.is-waiting small::before,.ft8-key.ft8-key-tx-status.is-transmitting small::before{display:none!important;content:none!important}
/* SSTV keybar uses the TX tile as a pane selector too. Idle must nevertheless
   look neutral, not like an active transmission. */
.sstv-phase7-tx-quick:not(.sstv-phase7-tx-active){background:color-mix(in srgb,var(--surface2) 82%,#000 18%)!important;border-color:var(--border)!important;color:var(--muted)!important;box-shadow:none!important}
.sstv-phase7-tx-quick:not(.sstv-phase7-tx-active)::before,.sstv-phase7-tx-quick:not(.sstv-phase7-tx-active)::after{display:none!important}

/* Phase 7 SSTV studio */
.sstv-phase7-card{padding-top:.5rem!important}.sstv-phase7-legacy-hidden,.sstv-phase7-legacy-storage{display:none!important}.sstv-phase7-workbench{display:grid;gap:.46rem;min-width:0}
.sstv-phase7-meta-row{display:flex;align-items:center;justify-content:flex-end;min-height:34px;padding:0 .1rem}
.sstv-phase7-free-move{margin:0!important;min-height:32px;padding:.16rem .42rem!important;border:0!important;border-radius:9px;background:transparent!important}.sstv-phase7-free-move span strong{font-size:.68rem}

.sstv-phase7-toolbar{min-width:0;border:1px solid var(--border);border-radius:12px;background:color-mix(in srgb,var(--surface2) 76%,transparent)}
.sstv-phase7-toolbar-top{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.36rem;padding:.36rem}
.sstv-phase7-source-row{display:flex!important;align-items:stretch;gap:.32rem!important;flex:1 1 330px;min-width:260px;margin:0!important}
.sstv-phase7-source-row>*{height:var(--sstv-p7-control-h)!important;min-height:var(--sstv-p7-control-h)!important;max-height:var(--sstv-p7-control-h)!important;margin:0!important;box-sizing:border-box!important}
.sstv-phase7-source-row label,.sstv-phase7-source-row button{display:flex!important;align-items:center!important;justify-content:center!important;gap:.2rem!important;padding:.26rem .38rem!important}
.sstv-phase7-source-row .sstv-ui-subtext{line-height:1!important}
.sstv-phase7-compact-field,.sstv-phase7-bottom-field{display:grid;gap:.14rem;margin:0!important;min-width:0}.sstv-phase7-compact-field>span,.sstv-phase7-bottom-field>span{font-size:.64rem;font-weight:850;letter-spacing:.03em;opacity:.82;line-height:1}
.sstv-phase7-compact-field select,.sstv-phase7-bottom-field select,.sstv-phase7-bottom-field input{height:var(--sstv-p7-control-h)!important;min-height:var(--sstv-p7-control-h)!important;max-height:var(--sstv-p7-control-h)!important;margin:0!important;box-sizing:border-box!important}
.sstv-phase7-fit{flex:0 1 170px}.sstv-phase7-tool-button,.sstv-phase7-history-button,.sstv-phase7-save-template{height:var(--sstv-p7-control-h)!important;min-height:var(--sstv-p7-control-h)!important;max-height:var(--sstv-p7-control-h)!important;margin:0!important;box-sizing:border-box!important}
.sstv-phase7-tool-button{min-width:76px!important;padding:.25rem .6rem!important;font-weight:900!important}.sstv-phase7-history-button{width:44px!important;min-width:44px!important;padding:.2rem!important}

.sstv-phase7-center{display:grid;grid-template-columns:minmax(0,1fr) var(--sstv-p7-rail-w);gap:.42rem;align-items:start;min-width:0}.sstv-phase7-center.has-text-panel{grid-template-columns:minmax(0,1fr) minmax(238px,280px) var(--sstv-p7-rail-w)}
.sstv-phase7-canvas-column{min-width:0;display:grid;align-content:start}.sstv-phase7-canvas-column .sstv-composer-preview{width:100%;margin:0!important}.sstv-phase7-canvas-column .sstv-composer-canvas-stage{margin:0 auto;max-width:100%}

/* Inline/non-modal text editor. It consumes its own column instead of covering
   the picture and therefore leaves the edited result visible. */
.sstv-phase7-text-panel{min-width:0;border:1px solid var(--border);border-radius:12px;background:color-mix(in srgb,var(--surface2) 82%,var(--surface));overflow:hidden;align-self:start}.sstv-phase7-text-panel[hidden]{display:none!important}
.sstv-phase7-text-panel-head{display:flex;align-items:center;justify-content:space-between;gap:.4rem;padding:.36rem .42rem;border-bottom:1px solid var(--border)}.sstv-phase7-text-panel-head strong{font-size:.68rem;letter-spacing:.04em}.sstv-phase7-text-close{width:30px!important;min-width:30px!important;height:30px!important;min-height:30px!important;padding:0!important}
.sstv-phase7-text-editor-inline{margin:0!important;padding:.4rem!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;gap:.35rem!important}.sstv-phase7-text-editor-inline .sstv-alpha221-section-switch{min-height:30px!important;margin:0!important;padding:0!important}.sstv-phase7-text-editor-inline .sstv-alpha221-text-editor-body{gap:.34rem!important;padding:0!important}.sstv-phase7-text-editor-inline .sstv-text-add{display:none!important}.sstv-phase7-text-editor-inline .sstv-text-overlay-cards{gap:.34rem!important}.sstv-phase7-text-editor-inline .sstv-text-overlay-card{gap:.32rem!important;padding:.4rem!important;border-radius:10px!important}.sstv-phase7-text-editor-inline .sstv-text-card-head strong{font-size:.62rem}.sstv-phase7-text-editor-inline .sstv-text-remove{width:28px!important;min-width:28px!important;height:28px!important;min-height:28px!important}.sstv-phase7-text-editor-inline .sstv-text-card-options{grid-template-columns:58px 1fr 1fr!important;gap:.28rem!important}.sstv-phase7-text-editor-inline .sstv-text-overlay-card input,.sstv-phase7-text-editor-inline .sstv-text-overlay-card select{min-height:34px!important;height:34px!important;padding:.25rem .35rem!important}.sstv-phase7-text-editor-inline .sstv-text-overlay-card label>span{font-size:.52rem!important}

/* Narrow right rail */
.sstv-phase7-side-tools{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:.34rem;width:var(--sstv-p7-rail-w);padding:.3rem;border:1px solid var(--border);border-radius:12px;background:color-mix(in srgb,var(--surface2) 76%,transparent);min-width:0;box-sizing:border-box}
.sstv-phase7-adjust-pane{display:grid;gap:.34rem;order:0}.sstv-phase7-nudge-cross{order:1}
.sstv-phase7-primary-tools,.sstv-phase7-nudge-stack,.sstv-phase7-effect-buttons{display:grid;grid-template-columns:1fr;gap:.18rem}.sstv-phase7-primary-tools{padding-bottom:.28rem;border-bottom:1px solid var(--border)}.sstv-phase7-nudge-stack{padding-bottom:.28rem;border-bottom:1px solid var(--border)}
.sstv-phase7-side-tools button,.sstv-phase7-rail-button{width:100%!important;min-width:0!important;height:var(--sstv-p7-rail-h)!important;min-height:var(--sstv-p7-rail-h)!important;max-height:var(--sstv-p7-rail-h)!important;padding:.1rem .16rem!important;font-size:.66rem!important;line-height:1!important;box-sizing:border-box!important}
.sstv-phase7-zoom-value{display:block!important;text-align:center;font-size:.57rem!important;line-height:1.1!important;color:var(--muted);padding:.12rem 0 .02rem}
.sstv-phase7-effect-box{display:grid;gap:.25rem;position:relative}.sstv-phase7-effect-button.is-active{outline:2px solid var(--accent)}
.sstv-phase7-effect-popover{position:absolute;right:calc(100% + .42rem);bottom:0;z-index:35;width:min(290px,65vw);padding:.5rem;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:0 12px 34px rgba(0,0,0,.28)}.sstv-phase7-effect-popover[hidden]{display:none!important}.sstv-phase7-effect-popover label{display:grid;gap:.25rem;margin:0}.sstv-phase7-effect-popover input{width:100%}

/* Bottom controls share exactly the same control height. */
.sstv-phase7-toolbar-bottom{display:grid;grid-template-columns:minmax(215px,1.65fr) minmax(125px,.85fr) 76px 72px 96px 70px;gap:.28rem;align-items:center;padding:.32rem}.sstv-phase7-mode,.sstv-phase7-recipient{min-width:0}.sstv-phase7-toolbar-bottom .sstv-phase7-bottom-field>span{display:none!important}
.sstv-phase7-extras-button,.sstv-phase7-auto-cq-button,.sstv-phase7-tx-button,.sstv-phase7-stop-button{height:var(--sstv-p7-control-h)!important;min-height:var(--sstv-p7-control-h)!important;max-height:var(--sstv-p7-control-h)!important;margin:0!important;white-space:nowrap;box-sizing:border-box!important}
.sstv-phase7-auto-cq-button{display:grid;gap:1px;align-content:center;min-width:0;padding:.18rem .28rem!important;background:color-mix(in srgb,var(--danger) 84%,#260808)!important;border-color:var(--danger)!important;color:#fff!important}.sstv-phase7-auto-cq-button strong{font-size:.64rem}.sstv-phase7-auto-cq-button small{font-size:.58rem;line-height:1}.sstv-phase7-auto-cq-button.is-active{background:#d97706!important;border-color:#f59e0b!important;color:#fff!important}.sstv-phase7-tx-button{background:color-mix(in srgb,var(--danger) 88%,#260808)!important;color:#fff!important;border-color:var(--danger)!important;min-width:0;padding:.18rem .32rem!important;font-size:.69rem!important}.sstv-phase7-tx-button:disabled{background:color-mix(in srgb,var(--surface2) 82%,#000 18%)!important;border-color:var(--border)!important;color:var(--muted)!important;opacity:1!important}.sstv-phase7-stop-button{min-width:0;padding:.18rem .28rem!important}.sstv-phase7-stop-button:not(:disabled){background:color-mix(in srgb,var(--danger) 88%,#260808)!important;border-color:var(--danger)!important;color:#fff!important}.sstv-phase7-stop-button:disabled{background:color-mix(in srgb,var(--surface2) 82%,#000 18%)!important;border-color:var(--border)!important;color:var(--muted)!important;opacity:1!important}.sstv-phase7-notices:empty{display:none}.sstv-phase7-notices>*{margin:.05rem 0!important}.sstv-composer-card.is-module-off .sstv-phase7-workbench{opacity:1!important;pointer-events:auto!important}

.sstv-phase7-dialog{width:min(760px,calc(100vw - 24px));max-height:min(82vh,860px);padding:0;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text);box-shadow:0 20px 70px rgba(0,0,0,.45)}.sstv-phase7-dialog::backdrop{background:rgba(0,0,0,.58)}.sstv-phase7-dialog-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.62rem .75rem;border-bottom:1px solid var(--border);background:var(--surface)}.sstv-phase7-dialog-head strong{font-size:.92rem}.sstv-phase7-dialog-close{min-width:38px;min-height:36px;padding:.2rem .55rem!important;font-size:1.2rem!important}.sstv-phase7-dialog-body{padding:.7rem;overflow:auto;max-height:calc(82vh - 58px)}.sstv-phase7-dialog-body .sstv-studio-tab-panel{display:grid!important;gap:.55rem!important}.sstv-phase7-dialog-body .sstv-studio-block{margin:0!important}

/* MRG option switch styling for Auto Seq / Auto-TX */
.ft8-option-grid .mrg-option-switch{min-height:58px;margin:0;padding:.55rem .62rem;border:1px solid var(--border);border-radius:12px;background:color-mix(in srgb,var(--surface2) 70%,transparent)}


/* Alpha 3 field polish: stable source labels, compact red/orange source language,
   header action in Extras and clearer spacing between automation blocks. */
.sstv-phase7-source-row .sstv-ui-subtext{display:none!important}
.sstv-phase7-source-row .sstv-source-image,.sstv-phase7-source-row .sstv-camera-button{background:color-mix(in srgb,var(--danger) 84%,#260808)!important;border-color:var(--danger)!important;color:#fff!important}
.sstv-phase7-source-row .sstv-testcard-button,.sstv-phase7-source-row .sstv-template-source-button{background:#d97706!important;border-color:#f59e0b!important;color:#fff!important}
.sstv-phase7-fit>span{display:none!important}.sstv-phase7-toolbar-top{align-items:center}.sstv-phase7-fit{align-self:center}
.sstv-phase7-dialog-actions{display:flex;align-items:center;gap:.42rem;margin-left:auto}.sstv-phase7-save-template{width:auto!important;min-width:132px!important;padding:.2rem .65rem!important;background:#d97706!important;border-color:#f59e0b!important;color:#fff!important;font-size:.68rem!important;font-weight:950!important}
.sstv-phase7-dialog-body{padding-bottom:1.2rem}.sstv-phase7-extras-panel{gap:.85rem!important;padding-bottom:.75rem!important}.sstv-phase7-extras-panel>.sstv-studio-block{margin:0!important}.sstv-phase7-extras-panel>.sstv-studio-block+.sstv-studio-block{margin-top:.32rem!important}
.sstv-phase7-extras-panel .sstv-auto-cq-grid{grid-template-columns:minmax(100px,.75fr) minmax(105px,.75fr) minmax(130px,1fr);align-items:end;gap:.5rem}.sstv-phase7-extras-panel .sstv-auto-cq-grid>label[hidden]{display:none!important}.sstv-phase7-extras-panel .sstv-automation-confirm-toggle{grid-column:1/-1!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.7rem!important;min-height:42px!important;padding:.34rem .5rem!important;border-radius:10px!important}.sstv-phase7-extras-panel .sstv-automation-confirm-toggle>span{display:grid!important;gap:.06rem!important}.sstv-phase7-extras-panel .sstv-automation-confirm-toggle strong{font-size:.61rem!important}.sstv-phase7-extras-panel .sstv-automation-confirm-toggle small{font-size:.52rem!important;line-height:1.2!important;max-width:520px}.sstv-phase7-extras-panel .sstv-frame-cw-card,.sstv-phase7-extras-panel .sstv-frame-pretone-card{margin-top:.55rem!important}
@media (max-width:760px){.sstv-phase7-toolbar-bottom{grid-template-columns:1fr 1fr 74px}.sstv-phase7-mode{grid-column:1}.sstv-phase7-recipient{grid-column:2}.sstv-phase7-extras-button{grid-column:3}.sstv-phase7-auto-cq-button{grid-column:1}.sstv-phase7-tx-button{grid-column:2}.sstv-phase7-stop-button{grid-column:3}}
@media (max-width:900px){
  .sstv-phase7-center,.sstv-phase7-center.has-text-panel{grid-template-columns:minmax(0,1fr)}
  .sstv-phase7-text-panel{grid-row:2;width:100%}.sstv-phase7-side-tools{grid-row:3;width:100%;flex-direction:row;align-items:flex-start;justify-content:center}
  .sstv-phase7-primary-tools,.sstv-phase7-nudge-stack,.sstv-phase7-effect-buttons{grid-template-columns:repeat(4,minmax(34px,48px));align-items:center}.sstv-phase7-primary-tools,.sstv-phase7-nudge-stack{padding:0 .28rem 0 0;border-bottom:0;border-right:1px solid var(--border)}.sstv-phase7-effect-buttons{grid-template-columns:repeat(3,minmax(34px,48px))}.sstv-phase7-zoom-value{grid-column:1/-1}.sstv-phase7-effect-popover{right:0;bottom:calc(100% + .35rem)}
}
@media (max-width:620px){
  .sstv-phase7-toolbar-top{gap:.28rem;padding:.3rem}.sstv-phase7-source-row{min-width:100%;display:grid!important;grid-template-columns:repeat(4,1fr)}.sstv-phase7-source-row>*{min-width:0!important;padding:.22rem .16rem!important}.sstv-phase7-source-row .sstv-ui-subtext{display:none}.sstv-phase7-fit{flex:1 1 132px}.sstv-phase7-tool-button{min-width:68px!important}
  .sstv-phase7-toolbar-bottom{grid-template-columns:1fr 1fr}.sstv-phase7-mode,.sstv-phase7-recipient,.sstv-phase7-extras-button{grid-column:auto}.sstv-phase7-extras-button,.sstv-phase7-auto-cq-button,.sstv-phase7-tx-button,.sstv-phase7-stop-button{width:100%}.sstv-phase7-stop-button{grid-column:1/-1}
  .sstv-phase7-side-tools{flex-wrap:wrap}.sstv-phase7-primary-tools,.sstv-phase7-nudge-stack{border-right:0;padding-right:0}.sstv-phase7-effect-box{width:100%}.sstv-phase7-effect-buttons{justify-content:center}
  .sstv-phase7-text-editor-inline .sstv-text-card-options{grid-template-columns:54px 1fr 1fr!important}
}

/* ===== Phase 7 Alpha 6 · Mobile-first SSTV cockpit polish ===== */
/* Global MRG action language for SSTV: green=ready, orange=preparing/waiting,
   danger red=actual RF TX. STOP remains a danger action when available. */
.sstv-phase7-tx-button.is-phase7-ready:not(:disabled){background:color-mix(in srgb,#16a34a 88%,#06240f)!important;border-color:#22c55e!important;color:#fff!important}
.sstv-phase7-tx-button.is-phase7-preparing{background:#d97706!important;border-color:#f59e0b!important;color:#fff!important;opacity:1!important}
.sstv-phase7-tx-button.is-phase7-transmitting{background:color-mix(in srgb,var(--danger) 90%,#260808)!important;border-color:var(--danger)!important;color:#fff!important;opacity:1!important}
.sstv-phase7-tx-button:disabled:not(.is-phase7-preparing):not(.is-phase7-transmitting){background:color-mix(in srgb,var(--surface2) 82%,#000 18%)!important;border-color:var(--border)!important;color:var(--muted)!important;opacity:1!important}
.sstv-phase7-auto-cq-button{background:color-mix(in srgb,var(--surface2) 82%,#000 18%)!important;border-color:var(--border)!important;color:var(--muted)!important;opacity:1!important}
.sstv-phase7-auto-cq-button.is-ready:not(:disabled){background:color-mix(in srgb,#16a34a 88%,#06240f)!important;border-color:#22c55e!important;color:#fff!important}
.sstv-phase7-auto-cq-button.is-preparing,.sstv-phase7-auto-cq-button.is-running{background:#d97706!important;border-color:#f59e0b!important;color:#fff!important;opacity:1!important}
.sstv-phase7-auto-cq-button.is-rf-tx{background:#d97706!important;border-color:#f59e0b!important;color:#fff!important;opacity:1!important}
.sstv-phase7-auto-cq-button:disabled{opacity:1!important;cursor:default}
.sstv-phase7-tx-quick.sstv-phase7-tx-preparing{background:#d97706!important;border-color:#f59e0b!important;color:#fff!important}
.sstv-phase7-tx-quick.sstv-phase7-tx-active{background:color-mix(in srgb,var(--danger) 90%,#260808)!important;border-color:var(--danger)!important;color:#fff!important}

/* Dedicated Auto-CQ settings dialog: settings + one explicit START action.
   The old enable switch/status/start-stop console is intentionally hidden. */
.sstv-phase7-auto-cq-dialog-card{margin:0!important;border:0!important;background:transparent!important;padding:.05rem!important;box-shadow:none!important}
.sstv-phase7-auto-cq-dialog-card .sstv-auto-cq-head{padding:.12rem 0 .55rem!important;border-bottom:1px solid var(--border)}
.sstv-phase7-auto-cq-dialog-card .sstv-auto-cq-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:.55rem!important;padding-top:.62rem}
.sstv-phase7-auto-cq-dialog-card .sstv-automation-confirm-toggle{grid-column:1/-1!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.7rem!important;min-height:44px!important;padding:.42rem .55rem!important;border-radius:10px!important}
.sstv-phase7-auto-cq-modal-actions{display:grid;grid-template-columns:minmax(96px,.55fr) minmax(180px,1fr);gap:.5rem;margin-top:.7rem;padding-top:.65rem;border-top:1px solid var(--border)}
.sstv-phase7-auto-cq-modal-actions button{min-height:44px!important}
.sstv-phase7-auto-cq-start{background:color-mix(in srgb,#16a34a 88%,#06240f)!important;border-color:#22c55e!important;color:#fff!important;font-weight:950!important}
.sstv-phase7-auto-cq-start:disabled{background:color-mix(in srgb,var(--surface2) 82%,#000 18%)!important;border-color:var(--border)!important;color:var(--muted)!important;opacity:1!important}

/* Generic Extras is now deliberately quiet: Auto-CQ moved to its own dialog. */
.sstv-phase7-extras-panel{gap:1rem!important;padding-bottom:1rem!important}
.sstv-phase7-extras-panel>.sstv-studio-block+.sstv-studio-block{margin-top:.5rem!important}

/* Bottom cockpit: mode/target first, then TX · compact Extras · Auto-CQ,
   followed by a full-width STOP. Desktop may collapse into one row. */
.sstv-phase7-toolbar-bottom{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,.9fr) minmax(250px,1.15fr) 82px;gap:.32rem;align-items:center;padding:.34rem}
.sstv-phase7-action-row{display:grid;grid-template-columns:minmax(92px,1fr) 44px minmax(92px,1fr);gap:.3rem;align-items:stretch;min-width:0}
.sstv-phase7-action-row .sstv-phase7-tx-button,.sstv-phase7-action-row .sstv-phase7-auto-cq-button{width:100%!important;min-width:0!important}
.sstv-phase7-extras-button{width:44px!important;min-width:44px!important;max-width:44px!important;padding:0!important;font-size:1.05rem!important;background:color-mix(in srgb,var(--surface2) 82%,#000 18%)!important;border-color:var(--border)!important;color:var(--text)!important;position:relative}
.sstv-phase7-extras-button.has-active-extra::after{content:"";position:absolute;right:4px;top:4px;width:7px;height:7px;border-radius:50%;background:#f59e0b;box-shadow:0 0 0 2px color-mix(in srgb,var(--surface) 80%,transparent)}
.sstv-phase7-stop-button{width:100%!important}.sstv-phase7-stop-button:not(:disabled){background:color-mix(in srgb,var(--danger) 90%,#260808)!important;border-color:var(--danger)!important;color:#fff!important;font-weight:950!important}

/* Mobile toolbar second row is deterministic: fit + TEXT + Undo + Redo + Clear
   share one row whenever a normal phone width permits it. */
@media (max-width:620px){
  .sstv-phase7-toolbar-top{display:grid!important;grid-template-columns:minmax(0,1fr) 44px 44px 44px 44px 44px;align-items:center!important;gap:.28rem!important;padding:.3rem!important}
  .sstv-phase7-source-row{grid-column:1/-1;min-width:0!important;width:100%!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .sstv-phase7-fit{grid-column:1;min-width:0!important;width:100%!important}
  .sstv-phase7-tool-button{grid-column:2;min-width:44px!important;width:44px!important}
  #sstvStudioUndo{grid-column:3}#sstvStudioRedo{grid-column:4}#sstvStudioClear{grid-column:5}#sstvStudioSaveTemplate{grid-column:6}
  .sstv-phase7-history-button{width:44px!important;min-width:44px!important}
}
@media (max-width:360px){
  .sstv-phase7-toolbar-top{grid-template-columns:minmax(0,1fr) 40px 40px 40px 40px 40px}
  .sstv-phase7-tool-button{width:40px!important;min-width:40px!important;font-size:.88rem!important}.sstv-phase7-history-button{width:40px!important;min-width:40px!important}.sstv-phase7-save-toolbar{width:40px!important;min-width:40px!important;max-width:40px!important}
}

/* On mobile/tablet the image-tool container becomes two equal halves.
   Left: real directional cross. Right: rotate/zoom/effects. */
@media (max-width:900px){
  .sstv-phase7-side-tools{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:.6rem!important;width:100%!important;align-items:stretch!important;padding:.55rem!important}
  .sstv-phase7-nudge-cross{order:0!important;display:grid!important;grid-template-columns:44px 44px 44px!important;grid-template-rows:44px 44px 44px!important;gap:.28rem!important;place-content:center!important;border:0!important;padding:0!important}
  .sstv-phase7-nudge-cross [data-cross="up"]{grid-column:2;grid-row:1}.sstv-phase7-nudge-cross [data-cross="left"]{grid-column:1;grid-row:2}.sstv-phase7-nudge-cross [data-cross="right"]{grid-column:3;grid-row:2}.sstv-phase7-nudge-cross [data-cross="down"]{grid-column:2;grid-row:3}
  .sstv-phase7-nudge-cross button{width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;max-height:44px!important;font-size:.86rem!important}
  .sstv-phase7-adjust-pane{display:grid!important;order:1!important;align-content:center!important;gap:.34rem!important;min-width:0;padding-left:.55rem;border-left:1px solid var(--border)}
  .sstv-phase7-primary-tools{display:grid!important;grid-template-columns:repeat(4,minmax(30px,1fr))!important;gap:.22rem!important;border:0!important;padding:0!important}
  .sstv-phase7-primary-tools button{height:34px!important;min-height:34px!important;max-height:34px!important}
  .sstv-phase7-zoom-value{grid-column:1/-1!important;padding:.02rem 0!important}
  .sstv-phase7-effect-box{width:100%!important}.sstv-phase7-effect-buttons{display:grid!important;grid-template-columns:1fr!important;gap:.22rem!important}
  .sstv-phase7-effect-buttons button{height:34px!important;min-height:34px!important;max-height:34px!important}
  .sstv-phase7-effect-popover{right:0!important;bottom:calc(100% + .35rem)!important;width:min(300px,78vw)!important}
}

@media (max-width:760px){
  .sstv-phase7-toolbar-bottom{grid-template-columns:minmax(0,1.15fr) minmax(0,.95fr)!important}
  .sstv-phase7-mode{grid-column:1!important}.sstv-phase7-recipient{grid-column:2!important}
  .sstv-phase7-action-row{grid-column:1/-1!important}.sstv-phase7-stop-button{grid-column:1/-1!important}
}
@media (max-width:420px){
  .sstv-phase7-action-row{grid-template-columns:minmax(88px,1fr) 44px minmax(88px,1fr)!important}
  .sstv-phase7-auto-cq-button strong,.sstv-phase7-tx-button{font-size:.64rem!important}
  .sstv-phase7-auto-cq-button small{font-size:.55rem!important}
}

/* ===== Phase 7 Alpha 6 · mobile field polish ===== */
/* Studio save belongs to the image surface, not to TX Extras. */
.sstv-phase7-canvas-column{position:relative}
.sstv-phase7-save-toolbar{
  display:grid!important;place-items:center!important;
  background:color-mix(in srgb,#d97706 90%,#5f2e02)!important;border-color:#f59e0b!important;color:#fff!important;
}
.sstv-phase7-save-toolbar svg{width:19px;height:19px;display:block}
.sstv-phase7-text-button{width:44px!important;min-width:44px!important;max-width:44px!important;padding:0!important;font-size:1rem!important;line-height:1!important}
.sstv-phase7-text-editor-modal .sstv-text-switch-only{display:none!important}

/* Bildtext is edited in a focused modal. The canvas itself remains the place
   for positioning; tapping an existing text opens the editor again. */
.sstv-phase7-center,.sstv-phase7-center.has-text-panel{grid-template-columns:minmax(0,1fr) var(--sstv-p7-rail-w)!important}
.sstv-phase7-text-panel{display:none!important}
.sstv-phase7-text-editor-modal{margin:0!important;padding:.1rem!important;border:0!important;background:transparent!important;box-shadow:none!important}
.sstv-phase7-text-editor-modal .sstv-alpha221-section-switch{margin:0 0 .45rem!important}
.sstv-phase7-text-editor-modal .sstv-text-add{display:none!important}
.sstv-phase7-text-editor-modal .sstv-text-overlay-cards{display:grid;gap:.5rem}
.sstv-phase7-text-done{width:100%;min-height:44px;margin-top:.65rem;background:color-mix(in srgb,#16a34a 88%,#06240f)!important;border-color:#22c55e!important;color:#fff!important;font-weight:950!important}

/* Mobile image tools: 50/50. Left is a true cross with center action; right is
   a compact 2x2 rotate/zoom group plus one 3-icon effects row. */
@media (max-width:900px){
  .sstv-phase7-nudge-cross [data-cross="center"]{grid-column:2;grid-row:2}
  .sstv-phase7-cross-reset{width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;max-height:44px!important;padding:0!important;font-size:1rem!important}
  .sstv-phase7-primary-tools{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.28rem!important}
  .sstv-phase7-primary-tools button{height:40px!important;min-height:40px!important;max-height:40px!important}
  .sstv-phase7-zoom-value{grid-column:1/-1!important;min-height:20px;display:grid!important;place-items:center!important}
  .sstv-phase7-effect-buttons{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:.28rem!important}
  .sstv-phase7-effect-buttons button{height:40px!important;min-height:40px!important;max-height:40px!important}
}

/* Fix Alpha-4 inherited grid-column rules: TX · Extras · AUTO-CQ always stay
   in the compact action row; STOP remains full-width below. */
.sstv-phase7-action-row{width:100%;grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr)!important}
.sstv-phase7-action-row>.sstv-phase7-tx-button,
.sstv-phase7-action-row>.sstv-phase7-extras-button,
.sstv-phase7-action-row>.sstv-phase7-auto-cq-button{grid-column:auto!important;grid-row:auto!important;align-self:stretch!important}
@media(max-width:760px){
  .sstv-phase7-toolbar-bottom{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
  .sstv-phase7-mode{grid-column:1!important}.sstv-phase7-recipient{grid-column:2!important}
  .sstv-phase7-action-row{grid-column:1/-1!important}.sstv-phase7-stop-button{grid-column:1/-1!important}
}

/* Gallery filters: search + both selects are visually identifiable and the two
   selects remain side-by-side on phone widths. */
.sstv-gallery-toolbar-compact{background:color-mix(in srgb,#f59e0b 5%,var(--surface2))!important;border-color:color-mix(in srgb,#f59e0b 24%,var(--border))!important}
.sstv-gallery-toolbar-compact input,
.sstv-gallery-toolbar-compact select{background:color-mix(in srgb,#f59e0b 8%,var(--surface))!important;border-color:color-mix(in srgb,#f59e0b 42%,var(--border))!important}
.sstv-gallery-toolbar-compact input:focus,
.sstv-gallery-toolbar-compact select:focus{border-color:#f59e0b!important;box-shadow:0 0 0 2px color-mix(in srgb,#f59e0b 18%,transparent)!important}
.sstv-gallery-filter-row-single{grid-template-columns:repeat(2,minmax(0,1fr))!important}
@media(max-width:380px){.sstv-gallery-filter-row-single{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.32rem!important}}

/* Live RX image: "TX" is an available action, not an already active TX. */
.sstv-live-compose-actions .sstv-live-tx-ready:not(:disabled){background:color-mix(in srgb,#16a34a 88%,#06240f)!important;border-color:#22c55e!important;color:#fff!important}
.sstv-live-extra-details{margin-top:.45rem;border:1px solid color-mix(in srgb,var(--border) 82%,transparent);border-radius:12px;background:color-mix(in srgb,var(--surface2) 76%,transparent);overflow:hidden}
.sstv-live-extra-details>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:42px;padding:.48rem .58rem;cursor:pointer;font-weight:850}
.sstv-live-extra-details>summary::-webkit-details-marker{display:none}
.sstv-live-extra-details>summary::after{content:"⌄";font-size:.78rem;color:var(--muted);margin-left:auto}
.sstv-live-extra-details[open]>summary::after{transform:rotate(180deg)}
.sstv-live-extra-details>summary .status-pill{margin-left:.2rem}
.sstv-live-extra-body{display:grid;gap:.45rem;padding:.1rem .58rem .58rem;border-top:1px solid color-mix(in srgb,var(--border) 72%,transparent)}
.sstv-live-extra-body .sstv-meta-tags{padding-top:.45rem}
.sstv-live-extra-line{font-size:.67rem;color:var(--muted);font-weight:750}


/* ===== Phase 7 Alpha 6 · field hot-polish ===== */
/* Alpha5 reintroduced the desktop two-column center after the earlier mobile
   rule. On phones/tablets the canvas and the 50/50 tool block must use the
   entire SSTV workbench width. */
@media (max-width:900px){
  .sstv-phase7-center,.sstv-phase7-center.has-text-panel{grid-template-columns:minmax(0,1fr)!important;width:100%!important}
  .sstv-phase7-canvas-column,.sstv-phase7-side-tools{width:100%!important;max-width:none!important}
}


/* ===== Phase 7 Alpha 7 · phase-close polish ===== */
/* Two explicit movement modes: text left, image right. */
.sstv-phase7-meta-row{justify-content:space-between!important;gap:.55rem!important;width:100%!important;box-sizing:border-box!important}
.sstv-phase7-meta-row .sstv-phase7-free-move{flex:0 1 auto!important}
.sstv-phase7-text-move{margin-right:auto!important}.sstv-phase7-image-move{margin-left:auto!important}
.sstv-phase7-text-move strong,.sstv-phase7-image-move strong{white-space:nowrap}

/* Editing actions use the neutral/white MRG action language; image sources
   remain red/orange. The compact T is always a 44px action. */
.sstv-phase7-fit select,.sstv-phase7-text-button{
  background:var(--surface)!important;border-color:var(--border)!important;color:var(--text)!important;
}
.sstv-phase7-text-button{font-size:1.12rem!important;font-weight:950!important;text-align:center!important;line-height:1!important}

/* SSTV TX tile is both a navigation entry and a live TX indicator. Orange is
   the idle/preparation navigation state; actual RF TX alone is danger red. */
.sstv-phase7-tx-quick{color:#fff!important;box-shadow:none!important}
.sstv-phase7-tx-quick:not(.sstv-phase7-tx-active),
.sstv-phase7-tx-quick.is-idle,
.sstv-phase7-tx-quick.is-waiting:not(.is-transmitting){
  background:color-mix(in srgb,#d97706 92%,#6b3200)!important;border-color:#f59e0b!important;color:#fff!important;
}
.sstv-phase7-tx-quick.sstv-phase7-tx-active,.sstv-phase7-tx-quick.is-transmitting{
  background:color-mix(in srgb,var(--danger) 90%,#260808)!important;border-color:var(--danger)!important;color:#fff!important;
}
.sstv-phase7-tx-quick>strong{font-size:.94rem!important;line-height:1!important;font-weight:950!important;letter-spacing:.02em!important}
.sstv-phase7-tx-quick #sstvTxQuickState{display:none!important}
.sstv-phase7-tx-quick.is-idle #sstvTxQuickMeta{display:none!important}

@media(max-width:420px){
  .sstv-phase7-meta-row{padding:0!important;gap:.25rem!important}
  .sstv-phase7-free-move{padding:.12rem .2rem!important}
  .sstv-phase7-free-move span strong{font-size:.61rem!important}
}

/* ===== Phase 7 Alpha 8 · final text/modal + Auto-CQ spinner polish ===== */
/* Text bewegen uses the same MRG pill switch as Bild bewegen. The text-mode
   switch is deliberately placed on the far left with its label to the right. */
.sstv-phase7-text-move{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:.5rem!important;
}
.sstv-phase7-text-move>i{order:1!important;flex:0 0 auto!important}
.sstv-phase7-text-move>span{order:2!important;flex:0 1 auto!important;margin:0!important}
.sstv-phase7-text-move>input{order:0!important}

/* Opening Bildtext must not force the mobile keyboard. The dialog owns its
   scroll surface and stays compact even with many text objects. */
#sstvPhase7TextDialog{max-height:min(88dvh,900px)!important}
#sstvPhase7TextDialog .sstv-phase7-dialog-body{
  max-height:calc(88dvh - 58px)!important;overflow-y:auto!important;overflow-x:hidden!important;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
}
.sstv-phase7-text-editor-modal .sstv-text-overlay-cards{gap:.38rem!important}
.sstv-phase7-text-editor-modal .sstv-text-overlay-card{padding:.42rem!important;gap:.34rem!important;border-radius:11px!important}
.sstv-phase7-text-editor-modal .sstv-text-card-options{gap:.3rem!important}
.sstv-phase7-text-editor-modal .sstv-text-overlay-card input,
.sstv-phase7-text-editor-modal .sstv-text-overlay-card select{min-height:36px!important;height:36px!important;padding:.28rem .38rem!important}
.sstv-phase7-text-add-more{
  width:100%!important;min-height:40px!important;margin-top:.55rem!important;
  background:var(--surface2)!important;border-color:var(--border)!important;color:var(--text)!important;font-weight:900!important;
}
.sstv-phase7-text-done{margin-top:.42rem!important}
@media(max-width:520px){
  #sstvPhase7TextDialog{width:calc(100vw - 16px)!important;max-height:90dvh!important}
  #sstvPhase7TextDialog .sstv-phase7-dialog-body{max-height:calc(90dvh - 56px)!important;padding:.5rem!important}
  .sstv-phase7-text-editor-modal .sstv-text-card-options{grid-template-columns:58px minmax(0,1fr) minmax(0,1fr)!important}
}

/* AUTO-CQ preparation: the TX label sits *inside* the running spinner circle.
   The compact AUTO-CQ status remains below it. */
.sstv-phase7-tx-quick.is-waiting>strong{
  position:relative!important;z-index:2!important;display:grid!important;place-items:center!important;
  width:31px!important;height:31px!important;margin:0 auto!important;padding:0!important;
  font-size:.62rem!important;line-height:1!important;letter-spacing:.03em!important;
}
.sstv-phase7-tx-quick.is-waiting>strong::before{
  content:""!important;position:absolute!important;inset:0!important;border:2px solid rgba(255,255,255,.34)!important;
  border-top-color:#fff!important;border-radius:50%!important;animation:alpha210TxSpinner .78s linear infinite!important;
  opacity:1!important;z-index:-1!important;
}
.sstv-phase7-tx-quick.is-auto-cq.is-waiting>strong::before{animation:alpha210TxSpinner .78s linear infinite!important;opacity:1!important}
.sstv-phase7-tx-quick.is-auto-cq.is-waiting #sstvTxQuickState{
  display:block!important;margin-top:.05rem!important;font-size:.32rem!important;line-height:1!important;font-weight:900!important;
}
.sstv-phase7-tx-quick.is-auto-cq.is-waiting #sstvTxQuickMeta{
  display:block!important;margin-top:.02rem!important;font-size:.43rem!important;line-height:1!important;font-weight:950!important;
}
/* Phase 8 carry-over: an active text/image move mode owns every touch inside
   the canvas, including a miss between objects. With both modes off, normal
   document scrolling is explicitly restored. */
.sstv-composer-canvas-stage.is-text-move,
.sstv-composer-canvas-stage.is-free-move{touch-action:none;overscroll-behavior:contain}
.sstv-composer-canvas-stage:not(.is-text-move):not(.is-free-move){touch-action:pan-y}

/* pre46 field polish: source actions remain equal-width, but are deliberately
   visible as one calm orange button group, matching the save action. */
.sstv-phase7-source-row{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;flex:1 1 auto!important;min-width:0!important}
.sstv-phase7-source-row .sstv-source-image,
.sstv-phase7-source-row .sstv-camera-button,
.sstv-phase7-source-row .sstv-testcard-button,
.sstv-phase7-source-row .sstv-template-source-button{
  min-width:0!important;width:100%!important;
  background:linear-gradient(180deg,#e98a08,#c96f00)!important;
  border-color:#f4a52d!important;color:#fff!important;font-weight:900!important;
}
.sstv-phase7-source-row .sstv-source-image strong,.sstv-phase7-source-row .sstv-source-image span,.sstv-phase7-source-row .sstv-source-image small,
.sstv-phase7-source-row .sstv-camera-button strong,.sstv-phase7-source-row .sstv-camera-button span,
.sstv-phase7-source-row .sstv-testcard-button strong,.sstv-phase7-source-row .sstv-testcard-button span,
.sstv-phase7-source-row .sstv-template-source-button strong,.sstv-phase7-source-row .sstv-template-source-button span{color:#fff!important}

/* Desktop keeps source, fit and all five compact tools on one line. */
@media(min-width:721px){
  .sstv-phase7-toolbar-top{display:grid!important;grid-template-columns:minmax(292px,1.7fr) minmax(118px,.72fr) repeat(5,44px)!important;align-items:center!important;gap:.28rem!important}
  .sstv-phase7-source-row{grid-column:1!important;width:100%!important}
  .sstv-phase7-fit{grid-column:2!important;width:100%!important;min-width:0!important}
  .sstv-phase7-tool-button{width:44px!important;min-width:44px!important;max-width:44px!important;padding:0!important}
  #sstvPhase7TextButton{grid-column:3!important}#sstvStudioUndo{grid-column:4!important}#sstvStudioRedo{grid-column:5!important}#sstvStudioClear{grid-column:6!important}#sstvStudioSaveTemplate{grid-column:7!important}
}

/* Extras read as two sections instead of nested cards. */
.sstv-phase7-extras-panel .sstv-frame-cw-card,
.sstv-phase7-extras-panel .sstv-frame-pretone-card{
  margin:0!important;padding:.12rem 0!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;
}
.sstv-phase7-extras-panel .sstv-frame-pretone-card{
  margin-top:.7rem!important;padding-top:.82rem!important;border-top:1px solid var(--border)!important;
}
