:root {
  color-scheme: light;
  --desktop: #008080;
  --face: #c6c6c6;
  --light: #fff;
  --shine: #dfdfdf;
  --shadow: #808080;
  --dark: #0c0c0c;
  --navy: #000080;
  --screen: #14201f;
  --green: #6ace94;
  font-family: Tahoma, "MS Sans Serif", Verdana, sans-serif;
  font-size: 14px;
  font-synthesis: none;
  line-height: 1.4;
  color: #111;
  background: var(--desktop);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100svh; display: grid; align-items: center; padding: 34px 26px 42px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, input[type="range"], input[type="checkbox"] { cursor: pointer; }
button { border-radius: 0; }
button:focus-visible, a:focus-visible { outline: 1px dotted currentColor; outline-offset: -5px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
button:disabled { cursor: default; color: #797979; text-shadow: 1px 1px #fff; }
button:disabled .icon { opacity: .36; filter: grayscale(1); }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: 0 0 16px; width: 16px; height: 16px; shape-rendering: crispEdges; }
.application { width: min(100%, 990px); margin: 0 auto; background: var(--face); padding: 3px; border: 1px solid; border-color: #fff #111 #111 #fff; box-shadow: 1px 1px 0 #111, inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf, 12px 14px 0 #006b6b; }
.title-bar { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 7px 3px 5px; color: #fff; background: linear-gradient(90deg, #000080 0%, #082786 66%, #377fa5 100%); }
.title-bar h1 { font-size: 13px; font-weight: 700; margin: 0; line-height: 20px; letter-spacing: .1px; }
.app-icon { filter: drop-shadow(1px 1px 0 #000); }
.title-mode { margin-left: auto; font-size: 12px; font-weight: 400; letter-spacing: 1px; }
.app-body { padding: 12px 6px 0; }
.mode-tabs { display: flex; padding-left: 4px; height: 36px; align-items: end; position: relative; z-index: 2; }
.mode-tab { min-width: 94px; height: 32px; border: 1px solid; border-color: #fff #111 transparent #fff; background: var(--face); box-shadow: inset -1px 0 0 #808080; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 5px 18px 6px; position: relative; margin-right: 2px; border-top-left-radius: 3px; border-top-right-radius: 3px; }
.mode-tab[aria-selected="true"] { height: 36px; padding-bottom: 8px; margin-bottom: -1px; font-weight: 700; z-index: 3; }
.mode-tab[aria-selected="true"]::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 2px; height: 2px; background: var(--face); }
.workspace { border: 1px solid; border-color: #fff #111 #111 #fff; box-shadow: inset -1px -1px 0 #808080; padding: 12px; min-width: 0; }
.workspace-toolbar { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding-bottom: 12px; margin-bottom: 13px; border-bottom: 1px solid #808080; box-shadow: 0 1px #fff; min-height: 42px; }
.direction { display: flex; gap: 0; }
.direction-button { border: 1px solid; border-color: #fff #808080 #808080 #fff; min-height: 29px; min-width: 78px; padding: 4px 15px; background: var(--face); box-shadow: inset -1px -1px 0 #a0a0a0; }
.direction-button[aria-selected="true"] { border-color: #111 #fff #fff #111; box-shadow: inset 1px 1px 0 #808080; background-color: #d3d3d3; background-image: repeating-conic-gradient(#d3d3d3 0% 25%, #ddd 0% 50%); background-size: 2px 2px; padding: 5px 14px 3px 16px; }
.app-link { color: #000080; text-underline-offset: 2px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; text-align: right; }
.app-link .icon { width: 12px; height: 12px; flex-basis: 12px; }
.app-link:hover { color: #0000cd; }
.button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 31px; padding: 5px 12px; border: 1px solid; border-color: #fff #111 #111 #fff; box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf; background: var(--face); white-space: nowrap; }
.button:not(:disabled):active { border-color: #111 #fff #fff #111; box-shadow: inset 1px 1px 0 #808080; padding: 6px 11px 4px 13px; }
.button.primary { outline: 1px solid #111; outline-offset: 1px; margin: 2px; }
.button.primary:focus-visible { outline: 1px solid #111; }
.button.primary:focus-visible::after { position: absolute; inset: 4px; content: ""; border: 1px dotted #111; }
.button.small { min-height: 24px; padding: 2px 12px; font-size: 12px; }
.button.small:not(:disabled):active { padding: 3px 11px 1px 13px; }
.sstv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 194px; gap: 17px; }
.picture-column { min-width: 0; }
.display-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; min-height: 17px; }
.display-detail { color: #4e4e4e; font-size: 12px; white-space: nowrap; }
.image-well { position: relative; aspect-ratio: 4 / 3; border: 2px solid; border-color: #808080 #fff #fff #808080; box-shadow: inset 1px 1px 0 #111; background: var(--screen); display: grid; place-items: center; overflow: hidden; }
.image-well canvas { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.empty-display { position: absolute; display: flex; flex-direction: column; gap: 10px; align-items: center; color: #718b83; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.empty-icon { width: 32px; height: 32px; shape-rendering: crispEdges; }
.image-drop.drag-over { outline: 2px dashed #fff; outline-offset: -8px; }
.image-bottom { display: flex; align-items: center; gap: 9px; min-height: 25px; padding-top: 6px; font-size: 12px; color: #333; }
.image-bottom > :first-child { flex: 1; }
.image-bottom > :last-child { min-width: 28px; text-align: right; }
progress { appearance: none; display: block; height: 15px; padding: 2px; border: 1px solid; border-color: #808080 #fff #fff #808080; background: #c6c6c6; min-width: 0; }
progress::-webkit-progress-bar { background: #c6c6c6; }
progress::-webkit-progress-value { background: repeating-linear-gradient(to right, #000080 0 7px, transparent 7px 9px); }
progress::-moz-progress-bar { background: repeating-linear-gradient(to right, #000080 0 7px, transparent 7px 9px); }
.control-column { display: flex; flex-direction: column; gap: 15px; }
fieldset { min-width: 0; margin: 0; border: 1px solid #808080; box-shadow: 1px 1px 0 #fff, inset 1px 1px 0 #fff; padding: 11px 12px 12px; }
legend { padding: 0 5px; margin-left: -3px; }
.control-column fieldset { display: flex; flex-direction: column; gap: 9px; }
.control-column fieldset .button { width: 100%; }
.control-column fieldset .button.primary { width: calc(100% - 4px); }
.field { display: flex; flex-direction: column; gap: 5px; }
select, input[type="text"], input[type="number"], textarea { border: 2px solid; border-color: #808080 #fff #fff #808080; box-shadow: inset 1px 1px 0 #111; background: #fff; border-radius: 0; min-width: 0; }
select { width: 100%; padding: 4px 23px 4px 6px; min-height: 29px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='24'%3E%3Cpath fill='%23c6c6c6' d='M0 0h19v24H0z'/%3E%3Cpath fill='%23fff' d='M0 0h19v1H1v22H0z'/%3E%3Cpath fill='%23808080' d='M18 0h1v24H0v-1h18z'/%3E%3Cpath d='M5 10h9l-4.5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; }
input[type="text"], input[type="number"] { padding: 6px 8px; min-height: 30px; }
.range-field { display: flex; flex-direction: column; gap: 6px; margin-top: 1px; }
.range-field > span { display: flex; justify-content: space-between; }
.range-field output { font-size: 12px; color: #444; }
input[type="range"] { width: 100%; appearance: none; height: 22px; margin: 0; background: transparent; min-width: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border: 1px solid; border-color: #808080 #fff #fff #808080; background: #a0a0a0; }
input[type="range"]::-moz-range-track { height: 2px; border: 1px solid; border-color: #808080 #fff #fff #808080; background: #a0a0a0; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 20px; margin-top: -9px; border: 1px solid; border-color: #fff #111 #111 #fff; background: #c6c6c6; box-shadow: inset -1px -1px #808080; border-radius: 0; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 18px; border: 1px solid; border-color: #fff #111 #111 #fff; background: #c6c6c6; box-shadow: inset -1px -1px #808080; border-radius: 0; }
.action-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 2px 17px; }
.action-toolbar .button { min-width: 100px; }
.action-toolbar .button.primary { margin: 0 2px 0 0; }
.waterfall-well, .signal-well { border: 2px solid; border-color: #808080 #fff #fff #808080; background: #111f27; box-shadow: inset 1px 1px #111; overflow: hidden; }
.waterfall-well canvas { width: 100%; height: 145px; display: block; }
.frequency-scale { display: flex; justify-content: space-between; color: #9bacac; font: 12px/22px "Lucida Console", Monaco, monospace; padding: 0 8px; border-bottom: 1px solid #3b5054; }
.table-heading { display: flex; justify-content: space-between; align-items: center; padding: 13px 0 6px; min-height: 43px; }
.count { display: inline-block; margin-left: 6px; color: #666; font-size: 12px; }
.message-table-well { position: relative; min-height: 203px; max-height: 350px; overflow: auto; border: 2px solid; border-color: #808080 #fff #fff #808080; box-shadow: inset 1px 1px #111; background: #fff; }
.message-table { border-collapse: collapse; width: 100%; text-align: left; font: 12px/1.6 "Lucida Console", Monaco, monospace; }
.message-table thead { position: sticky; top: 0; z-index: 1; }
.message-table th { padding: 5px 9px; font: 12px/1.4 Tahoma, Verdana, sans-serif; white-space: nowrap; background: #c6c6c6; border: 1px solid; border-color: #fff #808080 #808080 #fff; }
.message-table th:last-child { width: 100%; }
.message-table th small { font-size: 12px; color: #555; }
.message-table td { padding: 3px 9px; white-space: nowrap; border-bottom: 1px solid #ebebeb; }
.message-table tr.cq td { background: #d4ecd4; }
.message-table tr.selected td { color: #fff; background: #000080; }
.empty-table { position: absolute; color: #888; left: 0; right: 0; top: 51%; text-align: center; margin: 0; font-size: 12px; }
.receive-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 9px; color: #444; font-size: 12px; }
.receive-bottom progress { width: 150px; height: 13px; }
.send-layout { display: grid; grid-template-columns: minmax(0, 1fr) 194px; gap: 17px; margin-bottom: 18px; }
.message-editor { padding: 13px 14px 16px; }
.message-input { font: 18px/1.5 "Lucida Console", Monaco, monospace; text-transform: uppercase; width: 100%; }
.field-help { color: #555; font-size: 12px; margin: 7px 0 16px; }
.inline-fields { display: flex; gap: 15px; }
.input-unit { display: flex; align-items: center; gap: 7px; }
.input-unit input { width: 85px; }
.input-unit > span { font-size: 12px; color: #444; }
.send-actions { display: flex; flex-direction: column; gap: 10px; }
.signal-well { position: relative; height: 192px; }
.signal-well canvas { display: block; width: 100%; height: 100%; }
.signal-empty { color: #718b83; position: absolute; inset: 0; display: grid; place-items: center; }
.input-error { color: #a00000; margin: 12px 0 0; }
.cw-receive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 17px; margin-bottom: 13px; }
.cw-main { min-width: 0; }
.received-text, .send-text { display: block; width: 100%; resize: vertical; padding: 13px 15px; min-height: 196px; font: 19px/1.55 "Lucida Console", Monaco, monospace; letter-spacing: .2px; }
.received-text { background: #ffffef; color: #152514; }
.received-text::placeholder { font: 12px/1.5 Tahoma, Verdana, sans-serif; letter-spacing: 0; color: #888; }
.text-actions { display: flex; justify-content: flex-end; gap: 7px; padding-top: 6px; }
.cw-tuning { align-self: start; display: flex; flex-direction: column; gap: 13px; margin-top: 17px; padding-bottom: 15px; }
.checkbox-field { display: flex; align-items: center; gap: 7px; }
input[type="checkbox"] { appearance: none; width: 14px; height: 14px; border: 2px solid; border-color: #808080 #fff #fff #808080; box-shadow: inset 1px 1px #111; background: #fff; margin: 0; }
input[type="checkbox"]:checked { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M2 5v2l2 2 5-6V1L4 7z'/%3E%3C/svg%3E") center / 10px 10px no-repeat; }
.cw-waterfall canvas { height: 113px; }
.send-text { min-height: 176px; text-transform: uppercase; }
.cw-send-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 194px; gap: 17px; padding: 15px 0; }
.cw-send-settings { display: flex; gap: 24px; align-items: start; padding-top: 14px; }
.cw-send-settings .input-unit { align-items: start; flex-direction: column; gap: 4px; }
.cw-send-settings .input-unit input { width: 86px; }
.morse-preview { overflow-wrap: anywhere; min-height: 66px; padding: 10px 13px; font: 17px/1.9 "Lucida Console", Monaco, monospace; letter-spacing: 1px; border: 2px solid; border-color: #808080 #fff #fff #808080; background: #efefef; color: #444; }
.audio-strip { display: flex; align-items: center; gap: 9px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #808080; box-shadow: inset 0 1px #fff; min-height: 35px; }
.audio-label { font-size: 12px; }
.level-meter { width: 100px; height: 15px; background: #263d33; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 1px; flex: 0 0 100px; }
.level-meter span { display: block; width: 0; height: 100%; background: repeating-linear-gradient(90deg, #5fb970 0px 4px, transparent 4px 6px); }
.audio-file { font-size: 12px; color: #555; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; margin-left: 3px; }
.volume-control { display: flex; align-items: center; gap: 7px; margin-left: auto; width: 112px; min-width: 80px; }
.volume-control input { width: 84px; }
.status-bar { display: flex; align-items: stretch; gap: 3px; margin: 7px -2px 0; min-height: 25px; padding-bottom: 2px; font-size: 12px; }
.status-main, .status-mode { border: 1px solid; border-color: #808080 #fff #fff #808080; padding: 2px 6px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.status-main { flex: 1; }
#status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-mode { min-width: 73px; }
.status-light { width: 7px; height: 7px; background: #6d7a6d; box-shadow: inset 1px 1px #424b42, 1px 1px #fff; flex: 0 0 7px; }
.status-light.active { background: #24b35b; box-shadow: inset 1px 1px #0f632e, 1px 1px #fff; }
.status-light.error { background: #c42b2b; box-shadow: inset 1px 1px #782020, 1px 1px #fff; }
.resize-grip { width: 15px; align-self: flex-end; height: 15px; background: repeating-linear-gradient(135deg, transparent 0 2px, #808080 2px 3px, #fff 3px 4px); clip-path: polygon(100% 0,100% 100%,0 100%); margin: 0 0 1px 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 1100px) and (min-height: 820px) { body { padding-top: 45px; padding-bottom: 65px; } }
@media (max-width: 700px) {
  body { padding: 15px 10px 22px; align-items: start; }
  .application { box-shadow: 1px 1px 0 #111, inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf, 5px 6px 0 #006b6b; }
  .app-body { padding: 9px 3px 0; }
  .workspace { padding: 10px; }
  .workspace-toolbar { gap: 9px; align-items: center; }
  .app-link { max-width: 174px; font-size: 12px; line-height: 1.5; }
  .sstv-layout { grid-template-columns: minmax(0, 1fr) 164px; gap: 12px; }
  fieldset { padding: 9px 9px 10px; }
  .control-column { gap: 10px; }
  .control-column fieldset { gap: 8px; }
  .button { min-height: 34px; padding-left: 9px; padding-right: 9px; }
  .button:not(:disabled):active { padding-left: 10px; padding-right: 8px; }
  .cw-send-settings { gap: 12px; }
  .send-layout, .cw-send-bottom { grid-template-columns: minmax(0, 1fr) 164px; gap: 12px; }
  .cw-send-settings .input-unit input { width: 70px; }
  .cw-receive-layout { grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; }
  .message-table { font-size: 12px; }
  .message-table th, .message-table td { padding-left: 7px; padding-right: 7px; }
}
@media (max-width: 540px) {
  :root { font-size: 14px; }
  body { padding: 7px 5px 12px; }
  .application { box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf; }
  .title-bar { min-height: 29px; }
  .workspace { padding: 10px 8px; }
  .workspace-toolbar { flex-wrap: wrap; gap: 10px; margin-bottom: 11px; padding-bottom: 11px; }
  .direction-button { min-height: 36px; min-width: 78px; }
  .app-link { margin-left: auto; max-width: 165px; }
  .mode-tabs { height: 42px; padding-left: 2px; }
  .mode-tab { flex: 1; max-width: 115px; min-width: 80px; height: 37px; }
  .mode-tab[aria-selected="true"] { height: 41px; }
  .sstv-layout, .send-layout, .cw-send-bottom { display: flex; flex-direction: column; gap: 12px; }
  .image-well { aspect-ratio: 4 / 3; }
  .control-column { flex-direction: row; gap: 11px; align-items: stretch; }
  .control-column fieldset { flex: 1; min-width: 0; padding: 9px 8px 10px; }
  .control-column fieldset .button { min-width: 0; gap: 7px; }
  .button, .button.small { min-height: 36px; }
  .field select, .field input { min-height: 34px; }
  .action-toolbar { gap: 9px; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 15px; }
  .action-toolbar .button { min-width: 0; }
  .action-toolbar .button.primary { margin: 0 2px 0 0; }
  .cw-receive-layout { display: flex; flex-direction: column; gap: 8px; }
  .cw-tuning { display: flex; flex-direction: row; align-items: end; margin-top: 0; padding: 8px 10px 11px; gap: 11px; flex-wrap: wrap; align-self: stretch; }
  .cw-tuning .field { flex: 1; }
  .cw-tuning .input-unit input { width: 68px; }
  .cw-tuning .checkbox-field { min-height: 34px; gap: 5px; font-size: 12px; }
  .received-text { min-height: 169px; }
  .send-text { min-height: 161px; }
  .cw-send-bottom { padding: 12px 0; }
  .cw-send-settings { display: flex; gap: 15px; justify-content: space-between; }
  .cw-send-settings .field { flex: 1; }
  .cw-send-settings .input-unit input { width: 100%; }
  .send-actions { flex-direction: row; flex-wrap: wrap; gap: 9px; }
  .send-actions .button { flex: 1; }
  .send-actions .button.primary { margin-top: 0; margin-bottom: 0; }
  .message-input { font-size: 15px; }
  .message-table-well { min-height: 210px; }
  .message-table th, .message-table td { padding-left: 5px; padding-right: 5px; font-size: 12px; }
  .message-table th small { font-size: 12px; }
  .waterfall-well canvas { height: 113px; }
  .frequency-scale { font-size: 12px; padding-left: 4px; padding-right: 4px; }
  .audio-strip { flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; }
  .level-meter { width: 78px; flex-basis: 78px; }
  .audio-file { order: 4; flex: 0 0 100%; margin: 0; }
  .volume-control { width: 114px; }
  .status-bar { margin-top: 5px; }
  .display-detail { font-size: 12px; }
}
@media (prefers-reduced-motion: no-preference) { .level-meter span { transition: width 60ms linear; } }
@media (forced-colors: active) {
  .application, .workspace, .button, .mode-tab, .direction-button, fieldset { border: 1px solid ButtonText; box-shadow: none; }
  .mode-tab[aria-selected="true"], .direction-button[aria-selected="true"] { border-bottom: 3px solid Highlight; }
  .status-light { background: CanvasText; }
}

@media (max-width: 540px) { .control-column { flex-wrap: wrap; } .control-column fieldset { min-width: 140px; } .field input, .field select, textarea { font-size: 16px; } }

.credits-link { color: #333; font-size: 12px; align-self: center; padding: 0 6px; }

@media (min-width: 701px) and (max-height: 850px) {
  body { padding-top: 14px; padding-bottom: 20px; }
  .sstv-layout .image-well { aspect-ratio: auto; height: clamp(260px, calc(100svh - 335px), 480px); }
  .sstv-layout .image-well canvas { min-height: 0; max-height: 100%; }
  .message-table-well { min-height: 130px; max-height: 190px; }
  .waterfall-well canvas { height: 110px; }
  .received-text { min-height: 170px; }
}
