body.sstv-page {
  margin: 0 !important;
  padding-top: 132px !important;
  overflow-x: hidden;
  color: #f5f5f5;
  background:
    linear-gradient(rgba(4, 7, 9, 0.62), rgba(4, 7, 9, 0.9)),
    url('/images/sstv-jungle-monitor.png') center / cover fixed !important;
}

body.sstv-page .live-tool-page,
body.sstv-page main,
body.sstv-page .container {
  max-width: none !important;
}

body.sstv-page .live-tool-shell.sstv-shell,
body.sstv-page .sstv-shell {
  display: block !important;
  width: 100vw !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 0 0 20px !important;
  box-sizing: border-box;
}

body.sstv-page .sstv-shell > section {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
}

.sstv-control-panel,
.sstv-source-panel,
.sstv-tv,
.sstv-gallery-panel,
.sstv-debug-panel {
  border: 1px solid rgba(255, 208, 0, 0.22);
  background: linear-gradient(180deg, rgba(7, 10, 8, 0.86), rgba(0, 0, 0, 0.72));
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.36), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(7px);
}

.sstv-panel-heading span,
.sstv-controls span,
.sstv-source-controls span,
.sstv-tx-grid span {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sstv-panel-heading h2 {
  margin: 0;
  color: #ffd000;
  letter-spacing: 0;
}

.sstv-panel-heading {
  margin-bottom: 14px;
}

.sstv-panel-heading h2 {
  font-size: 1.08rem;
}

.sstv-controls,
.sstv-source-controls,
.sstv-tx-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.sstv-controls select,
.sstv-controls input,
.sstv-source-controls select,
.sstv-tx-grid select,
.sstv-tx-grid input {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #0b1117;
  color: #fff;
  padding: 0 10px;
  font-weight: 800;
}

.sstv-range-field input {
  accent-color: #9cff00;
  padding: 0;
}

.sstv-advanced-controls {
  padding: 9px 10px;
  border: 1px solid rgba(255, 208, 0, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.sstv-advanced-controls summary {
  color: #ffd000;
  font-weight: 900;
  cursor: pointer;
}

.sstv-advanced-controls label {
  display: block;
  margin-top: 10px;
}

.sstv-input-device-field.is-hidden {
  display: none;
}

.sstv-controls button,
.sstv-source-controls button,
.sstv-tx-grid button,
.sstv-gallery-head button {
  min-height: 40px;
  border: 1px solid rgba(255, 208, 0, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffd000;
  font-weight: 900;
  cursor: pointer;
}

.sstv-button-row button:first-child,
.sstv-controls #sstvOpenWebsdr,
#sstvAccountCard,
.sstv-tx-send,
.sstv-gallery-head button {
  background: #9cff00;
  border-color: #9cff00;
  color: #102009;
}

.sstv-controls button:disabled,
.sstv-source-controls button:disabled,
.sstv-gallery-head button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.sstv-workbench {
  display: grid;
  grid-template-columns: clamp(280px, 22vw, 340px) minmax(560px, 900px) clamp(280px, 22vw, 340px);
  gap: 12px;
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
  align-items: start;
  justify-content: center;
}

.sstv-tv-panel,
.sstv-control-panel,
.sstv-source-panel {
  min-width: 0;
}

.sstv-control-panel,
.sstv-source-panel {
  padding: 16px;
  border-radius: 12px;
  box-sizing: border-box;
}

.sstv-tv {
  position: relative;
  width: 100%;
  padding: 20px 20px 16px;
  border-radius: 12px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 25%, rgba(156, 255, 0, 0.1), transparent 34%),
    linear-gradient(145deg, rgba(13, 19, 16, 0.96), rgba(0, 0, 0, 0.92));
}

.sstv-tv__screen-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  border: 10px solid #111915;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(9, 255, 90, 0.08), rgba(0, 0, 0, 0.12)),
    #050807;
  box-shadow:
    inset 0 0 42px rgba(0, 0, 0, 0.92),
    0 0 0 1px rgba(255, 208, 0, 0.18),
    0 26px 70px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

#sstvImageCanvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  image-rendering: auto;
  background: #020403 url('/images/sstv-jungle-monitor.png') center / cover no-repeat;
}

.sstv-monitor-intro {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 4%;
  z-index: 2;
  max-height: 33%;
  overflow: auto;
  padding: clamp(10px, 1.6vw, 18px);
  border: 1px solid rgba(62, 37, 11, 0.34);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 235, 184, 0.92), rgba(218, 164, 86, 0.88));
  color: #1b1207;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.38), 0 18px 34px rgba(0, 0, 0, 0.28);
}

.sstv-monitor-intro.is-hidden {
  display: none;
}

.sstv-monitor-intro h2 {
  margin: 0 0 5px;
  color: #134d1d;
  font-size: clamp(1rem, 1.8vw, 1.38rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.sstv-monitor-intro p {
  margin: 0 0 8px;
  font-weight: 800;
  line-height: 1.32;
}

.sstv-monitor-intro ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-weight: 800;
  line-height: 1.25;
}


.sstv-scanline {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 50%, rgba(0, 0, 0, 0.08) 50%),
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.4));
  background-size: 100% 4px, 100% 100%;
  mix-blend-mode: screen;
}

.sstv-tv__idle {
  position: absolute;
  z-index: 4;
  inset: auto 22px 22px auto;
  padding: 8px 11px;
  border: 1px solid rgba(255, 208, 0, 0.26);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #ffd000;
  font-weight: 900;
}

.sstv-tv__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.sstv-tv__controls span,
.sstv-tx-panel p {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.84);
  padding: 8px 11px;
  font-weight: 800;
}

.sstv-audio-monitor h3,
.sstv-tx-panel h2,
.sstv-gallery-head h2 {
  margin: 0 0 10px;
  color: #ffd000;
  font-size: 1.05rem;
}

.sstv-audio-monitor,
.sstv-tx-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sstv-control-panel > .sstv-audio-monitor,
.sstv-tx-panel--primary {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.sstv-control-panel > .sstv-audio-monitor {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sstv-audio-debug {
  margin-bottom: 0;
  padding: 10px;
  border: 1px solid rgba(255, 208, 0, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.sstv-audio-debug summary {
  color: #ffd000;
  font-weight: 900;
  cursor: pointer;
}

.sstv-audio-debug-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.sstv-audio-debug-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sstv-audio-debug-grid span,
.sstv-audio-debug-grid small,
.sstv-audio-debug pre {
  color: rgba(255, 255, 255, 0.62);
}

.sstv-audio-debug-grid span,
.sstv-audio-debug-grid strong,
.sstv-audio-debug-grid small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sstv-audio-debug-grid strong {
  color: #9cff00;
  font-size: 0.82rem;
}

.sstv-audio-debug-grid small {
  margin-top: 3px;
  font-size: 0.72rem;
}

.sstv-audio-debug pre {
  max-height: 190px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 9px;
  border-radius: 8px;
  background: #050807;
  font-size: 0.72rem;
  line-height: 1.38;
  white-space: pre-wrap;
}


.sstv-audio-monitor h3 {
  font-size: 0.95rem;
}



#sstvTxPreview {
  width: 100%;
  aspect-ratio: 5 / 4;
  height: auto;
  display: block;
  border: 1px solid rgba(255, 208, 0, 0.22);
  border-radius: 10px;
  background: #020403;
}

#sstvAccountCard.is-login-required {
  background: rgba(255, 208, 0, 0.08);
  color: #ffd000;
}

#sstvAccountCard.is-hidden {
  display: none;
}

.sstv-tx-send {
  position: relative;
}

.sstv-tx-send:hover::after,
.sstv-tx-send:focus-visible::after {
  content: attr(title);
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 8px);
  z-index: 5;
  width: min(280px, 78vw);
  padding: 8px 10px;
  border: 1px solid rgba(255, 208, 0, 0.38);
  border-radius: 8px;
  background: rgba(4, 7, 9, 0.96);
  color: #ffd000;
  font-size: 0.76rem;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}

.sstv-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

#sstvScope,
#sstvSpectrum {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #071019;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#sstvSpectrum {
  margin-top: 8px;
}

.sstv-meter {
  position: relative;
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.sstv-meter b {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #9cff00, #ffd000, #ff5c5c);
  transition: width 120ms linear;
}

.sstv-websdr-hint {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  line-height: 1.45;
}

.sstv-gallery-panel,
.sstv-debug-panel {
  margin: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.sstv-gallery-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.sstv-gallery-actions {
  display: flex;
  gap: 8px;
}

.sstv-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.sstv-thumb {
  border: 1px solid rgba(255, 208, 0, 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.42);
}

.sstv-thumb img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #020403;
  cursor: zoom-in;
}

.sstv-thumb__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 9px;
}

.sstv-thumb__meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
}

.sstv-thumb__meta button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255, 92, 92, 0.35);
  border-radius: 6px;
  background: rgba(255, 92, 92, 0.08);
  color: #ff8b8b;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.sstv-thumb__meta button:hover,
.sstv-thumb__meta button:focus-visible {
  background: rgba(255, 92, 92, 0.18);
  border-color: rgba(255, 92, 92, 0.62);
}

.sstv-credit {
  margin: 8px 14px 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.72rem;
  text-align: right;
}

.sstv-image-viewer {
  width: min(94vw, 1180px);
  max-height: 94vh;
  padding: 10px;
  margin: auto;
  border: 1px solid rgba(255, 208, 0, 0.42);
  border-radius: 8px;
  background: #050807;
  color: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
}

.sstv-image-viewer::backdrop {
  background: rgba(0, 0, 0, 0.86);
}

.sstv-image-viewer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
}

.sstv-image-viewer__head span,
.sstv-image-viewer__head small {
  display: block;
}

.sstv-image-viewer__head span {
  color: #9cff00;
  font-weight: 900;
}

.sstv-image-viewer__head small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.52);
}

.sstv-image-viewer__head button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 208, 0, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #ffd000;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.sstv-image-viewer__body {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
}

.sstv-image-viewer__nav {
  width: 44px;
  height: 64px;
  border: 1px solid rgba(255, 208, 0, 0.26);
  border-radius: 8px;
  background: rgba(255, 208, 0, 0.08);
  color: #ffd000;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

.sstv-image-viewer__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sstv-image-viewer img {
  display: block;
  width: 100%;
  max-height: calc(94vh - 132px);
  object-fit: contain;
  image-rendering: auto;
  background: #020403;
}

.sstv-image-viewer__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.sstv-image-viewer__actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 92, 92, 0.45);
  border-radius: 7px;
  background: rgba(255, 92, 92, 0.1);
  color: #ff8b8b;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .sstv-workbench {
    grid-template-columns: minmax(250px, 0.72fr) minmax(460px, 1.28fr);
  }

  .sstv-source-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .sstv-workbench {
    grid-template-columns: 1fr;
  }

  .sstv-source-panel { grid-column: auto; }
}

@media (max-width: 620px) {
  body.sstv-page {
    padding-top: 104px !important;
  }

  .sstv-workbench,
  .sstv-gallery-panel,
  .sstv-debug-panel {
    padding: 8px;
    margin: 0;
  }

  .sstv-tv {
    padding: 12px;
  }
}


.sstv-thumb__meta b,
.sstv-thumb__meta small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sstv-thumb__meta b {
  color: #9cff00;
  font-size: 0.78rem;
}

.sstv-thumb__meta small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.68rem;
}

.sstv-image-viewer__redecode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 800;
}

.sstv-image-viewer__redecode select {
  min-height: 38px;
  border: 1px solid rgba(255, 208, 0, 0.28);
  border-radius: 7px;
  background: #11170f;
  color: #ffd000;
  font-weight: 900;
}

.sstv-image-viewer__decode-status {
  min-width: 92px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  font-weight: 800;
}

@media (max-width: 760px) {
  .sstv-monitor-intro {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-height: none;
    border-radius: 0;
  }
}

.sstv-transport {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 208, 0, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(12, 16, 13, 0.9), rgba(0, 0, 0, 0.72));
}

.sstv-transport button {
  min-height: 48px;
  border: 1px solid rgba(255, 208, 0, 0.2);
  border-radius: 8px;
  background: #121615;
  color: #ffd000;
  font-weight: 950;
  cursor: pointer;
  text-transform: uppercase;
}

.sstv-transport button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.sstv-transport__rx.is-active {
  border-color: #9cff00;
  background: #9cff00;
  color: #102009;
  box-shadow: 0 0 22px rgba(156, 255, 0, 0.38);
}

.sstv-transport__tx.is-ready {
  border-color: rgba(255, 208, 0, 0.48);
  background: #ffd000;
  color: #181005;
}

.sstv-transport__tx.is-active,
.sstv-transport__stop.is-active {
  border-color: #ff3030;
  background: #ff3030;
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 48, 48, 0.42);
}

body.sstv-page.is-sstv-tx-active .sstv-source-panel,
body.sstv-page.is-sstv-tx-active .sstv-tx-panel--primary {
  border-color: rgba(255, 48, 48, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 48, 48, 0.28), 0 20px 54px rgba(255, 0, 0, 0.18), inset 0 1px rgba(255, 255, 255, 0.04);
}

.sstv-tx-overlay-field textarea {
  width: 100%;
  min-height: 78px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 48, 48, 0.3);
  border-radius: 10px;
  background: #120908;
  color: #ff4242;
  padding: 10px;
  resize: vertical;
  font: 900 0.88rem ui-monospace, SFMono-Regular, Consolas, monospace;
}

.sstv-tx-overlay-field textarea::placeholder {
  color: rgba(255, 88, 88, 0.56);
}

@media (max-width: 620px) {
  .sstv-transport {
    grid-template-columns: 1fr;
  }
}
