/* DIGI HAM LINK — radio controls, 2026-10-08.
   Presentation only. Existing radio handlers and state remain authoritative. */
:root {
  --dhl-radio-credits-height: 28px;
  --dhl-radio-dock-height: 70px;
  --dhl-radio-credits-gap: 16px;
}

/* The ID is intentional: it also overrides the older Android fullscreen rule. */
html:not(.digi-signed-out) #view-radio > .radioDock {
  bottom: calc(var(--dhl-radio-credits-height) + var(--dhl-radio-credits-gap) + env(safe-area-inset-bottom, 0px)) !important;
}

/* Keep the last scrollable content above the fixed controls and credits. */
html:not(.digi-signed-out) main:has(> #view-radio:not([hidden])) {
  padding-bottom: calc(var(--dhl-radio-dock-height) + var(--dhl-radio-credits-height) + var(--dhl-radio-credits-gap) + 16px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Net selectors retain the app's selected / aria-pressed state. */
#view-radio .roomPicker {
  border-color: #30465e;
  background: linear-gradient(145deg, #142338, #101e30);
}

#view-radio .roomPicker h2 {
  color: #dcecf7;
  font-size: 1rem;
  letter-spacing: .01em;
}

#view-radio .roomButtons {
  gap: 10px;
}

#view-radio .roomButtons button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #506b83;
  border-radius: 14px;
  background: linear-gradient(160deg, #223951, #192b40);
  box-shadow: inset 0 1px 0 #ffffff0a, 0 3px 8px #020a1426;
  color: #eaf4ff;
  font-size: 1.02rem;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: .025em;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

#view-radio .roomButtons button::before {
  content: "";
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border: 2px solid #9bb1c5;
  border-radius: 50%;
  background: transparent;
}

#view-radio .roomButtons button.selected,
#view-radio .roomButtons button[aria-pressed="true"] {
  border-color: #53dded;
  background: linear-gradient(140deg, #155367, #173b50);
  box-shadow: inset 0 0 0 1px #53dded40, 0 3px 12px #07182140;
  color: #effeff;
}

#view-radio .roomButtons button.selected::before,
#view-radio .roomButtons button[aria-pressed="true"]::before {
  border-color: #82eff7;
  background: #82eff7;
  box-shadow: 0 0 0 4px #67e8f91f;
}

#view-radio .roomPicker p {
  color: #b9cddd;
  font-size: .85rem;
  line-height: 1.45;
}

/* BrandMeister's launcher and connect action use the same primary treatment. */
#view-radio .personalDmrPanel {
  border-color: #30465e;
  background: linear-gradient(145deg, #142338, #101e30);
}

#brandmeisterOpen,
#brandmeisterDialog #personalDmrConnect {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 13px 16px;
  border: 1px solid #78e5f4;
  border-radius: 14px;
  background: linear-gradient(120deg, #24b6dc, #62e0e8);
  box-shadow: inset 0 1px 0 #ffffff50, 0 4px 12px #03172240;
  color: #06283a;
  font-weight: 750;
  font-size: 1rem;
  line-height: 1.35;
  white-space: normal;
  transition: border-color 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

#brandmeisterOpen {
  margin: 0;
}

#brandmeisterOpen::before {
  content: "";
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 12v8m-4 0h8M8.5 8.5a5 5 0 0 0 0 7m7-7a5 5 0 0 1 0 7M5.5 5.5a9.2 9.2 0 0 0 0 13m13-13a9.2 9.2 0 0 1 0 13'/%3E%3C/g%3E%3Ccircle cx='12' cy='10' r='2' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 12v8m-4 0h8M8.5 8.5a5 5 0 0 0 0 7m7-7a5 5 0 0 1 0 7M5.5 5.5a9.2 9.2 0 0 0 0 13m13-13a9.2 9.2 0 0 1 0 13'/%3E%3C/g%3E%3Ccircle cx='12' cy='10' r='2' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}

#brandmeisterDialog button:not(#personalDmrConnect) {
  min-height: 44px;
  border-radius: 12px;
  border-color: #4a667e;
  background: #1b3047;
  color: #e9f4ff;
}

#brandmeisterDialog button#personalDmrDisconnect {
  border-color: #9a5a6b;
  background: #3d2739;
  color: #ffd5df;
}

#brandmeisterDialog .bmHeader {
  align-items: center;
}

#brandmeisterDialog .bmHeader h2 {
  margin: 0;
}

#brandmeisterDialog #brandmeisterClose {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 9px 14px;
}

@media (hover: hover) {
  #view-radio .roomButtons button:not(:disabled):hover {
    border-color: #80eaf4;
    box-shadow: inset 0 0 0 1px #80eaf433, 0 4px 14px #020a1433;
  }

  #brandmeisterOpen:not(:disabled):hover,
  #brandmeisterDialog #personalDmrConnect:not(:disabled):hover {
    filter: brightness(1.08);
    box-shadow: inset 0 1px 0 #ffffff50, 0 4px 16px #23c7e02b;
  }

  #brandmeisterDialog button:not(#personalDmrConnect):not(:disabled):hover {
    border-color: #80eaf4;
  }
}

#view-radio .roomButtons button:focus-visible,
#brandmeisterOpen:focus-visible,
#brandmeisterDialog button:focus-visible {
  outline: 3px solid #f2fdff;
  outline-offset: 3px;
}

#view-radio .roomButtons button:disabled,
#brandmeisterOpen:disabled,
#brandmeisterDialog button:disabled {
  opacity: .48;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

@media (max-width: 350px) {
  #view-radio .roomButtons button {
    gap: 8px;
    padding-inline: 10px;
    font-size: .95rem;
  }

  #brandmeisterOpen {
    padding-inline: 10px;
    font-size: .95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-radio .roomButtons button,
  #brandmeisterOpen,
  #brandmeisterDialog button {
    transition: none;
  }
}
