:root {
  color-scheme: dark;
  font-family: "Lexend", ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  background: #000;
  color: #fff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: #fff;
}
.shell {
  width: min(1040px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0;
}
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.hero-statuses {
  display: grid;
  gap: 10px;
  justify-items: end;
}
.user-counts { font-size: 13px; opacity: 0.92; }
.eyebrow {
  margin: 0 0 8px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-size: 12px;
  font-weight: 700;
}
h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.065em;
  font-weight: 800;
}
h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -0.04em;
}
p, li { color: #d7d7d7; line-height: 1.55; }
p { margin: 8px 0 0; }
b { color: #fff; font-weight: 800; }
.lead { max-width: 680px; font-size: 18px; }
.status {
  border: 1px solid #fff;
  background: #000;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
  font-weight: 700;
}
.status.ok { color: #000; border-color: #fff; background: #fff; }
.panel {
  border: 1px solid #fff;
  background: #040404;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 16px;
}
.start-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
label {
  display: grid;
  gap: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
label span, .small { color: #cfcfcf; font-weight: 400; font-size: 13px; }
.big-field input { font-size: clamp(22px, 4vw, 34px); font-weight: 800; letter-spacing: -0.04em; }
input, select, textarea {
  width: 100%;
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  padding: 13px 12px;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  outline: none;
}
select { min-height: 52px; }
textarea { resize: vertical; min-height: 96px; }
select option { background: #000; color: #fff; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; }
.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 600;
}
.checkline input { width: auto; accent-color: #fff; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px #ffffff25; }
input[type="range"] { padding: 8px 0; accent-color: #fff; }
input[type="number"] { appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { appearance: none; margin: 0; }
.tip-box {
  border: 1px dashed #fff;
  border-radius: 18px;
  padding: 14px;
  background: #000;
}
.tx-panel { display: grid; gap: 18px; }
.ptt {
  border: 1px solid #fff;
  border-radius: 22px;
  padding: 28px;
  font: inherit;
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 900;
  letter-spacing: -0.045em;
  color: #000;
  background: #fff;
  cursor: pointer;
}
.ptt:active { transform: translateY(1px); }
.ptt:disabled { opacity: 0.65; cursor: wait; }
.ptt.live { color: #fff; background: #000; outline: 5px solid #fff; outline-offset: -10px; }
.meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.meters div {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
}
meter { width: 100%; height: 20px; accent-color: #fff; }
ol { margin-bottom: 0; padding-left: 22px; }
@media (max-width: 840px) {
  .hero, .start-card, .grid, .meters { grid-template-columns: 1fr; }
  .hero-statuses { justify-items: start; }
  .status { justify-self: start; }
}
.two-main { grid-template-columns: 1fr 1fr; }
.fixed-box {
  border: 1px solid #fff;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 6px;
  align-content: center;
  background: #000;
}
.fixed-box strong {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.fixed-box span { color: #cfcfcf; font-size: 13px; line-height: 1.4; }
.section-head { margin-bottom: 16px; }
.section-head p { max-width: 720px; }
.sound-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 840px) {
  .two-main, .sound-grid { grid-template-columns: 1fr; }
}
.range-status {
  display: block;
  border: 1px dashed #fff;
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  background: #000;
  font-weight: 600;
}
.range-status.bad {
  background: #fff;
  color: #000;
}

.mini-button {
  justify-self: start;
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
  color: #000;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.mini-button:disabled { opacity: 0.55; cursor: not-allowed; }


a { color: #fff; font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; }
code { border: 1px solid #fff; border-radius: 8px; padding: 2px 6px; background: #000; color: #fff; }
.connect-panel ol { margin-top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #000;
}
.nav-link {
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 11px 16px;
  background: #000;
  color: #fff;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.nav-link.active, .nav-link:hover {
  background: #fff;
  color: #000;
}
.page[hidden] { display: none !important; }
.stations-list {
  display: grid;
  gap: 12px;
}
.stations-list.empty {
  border: 1px dashed #fff;
  border-radius: 16px;
  padding: 18px;
  color: #cfcfcf;
}
.station-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #fff;
  border-radius: 16px;
  padding: 14px;
  background: #000;
}
.station-row strong { font-size: 18px; }
.station-row span { color: #d7d7d7; font-size: 14px; }
@media (max-width: 840px) {
  .topbar { border-radius: 20px; flex-wrap: wrap; }
  .station-row { grid-template-columns: 1fr; }
}

.preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset-actions .mini-button { padding: 9px 12px; }
.queue-status {
  border: 1px dashed #fff;
  border-radius: 16px;
  padding: 12px 14px;
  color: #fff;
  background: #000;
  font-weight: 800;
}
.stations-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
@media (max-width: 840px) {
  .stations-head { align-items: flex-start; flex-direction: column; }
}
.required, .optional {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid #fff;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.optional { opacity: 0.75; }
.bad-inline { color: #fff; font-weight: 800; }
.station-filters {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 12px;
  margin-bottom: 12px;
}
.stations-count {
  color: #cfcfcf;
  font-size: 13px;
  margin: 0 0 12px;
}
.station-row p {
  margin: 4px 0 0;
  color: #cfcfcf;
  font-size: 13px;
  line-height: 1.35;
}
@media (max-width: 840px) {
  .station-filters { grid-template-columns: 1fr; }
}

#discordAuth { margin-left: auto; }
.station-logo-small {
  width: 54px;
  height: 54px;
  border: 1px solid #fff;
  border-radius: 14px;
  object-fit: cover;
  background: #000;
}
.station-row {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.station-row:hover { box-shadow: 0 0 0 3px #ffffff25; }
.station-detail-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: start;
}
.station-logo-large {
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid #fff;
  border-radius: 24px;
  background: #000;
}
.station-detail-body { display: grid; gap: 14px; }
.station-meta {
  color: #cfcfcf;
  font-weight: 800;
}
.station-owner {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d7d7d7;
}
.discord-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #fff;
}
@media (max-width: 840px) {
  #discordAuth { margin-left: 0; }
  .station-detail-card { grid-template-columns: 1fr; }
  .station-logo-large { width: 160px; }
}
.station-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.station-gallery-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid #fff;
  border-radius: 16px;
  background: #000;
}
.station-comments {
  display: grid;
  gap: 12px;
}
.station-comments h2 {
  margin: 0;
}
.comments-hint {
  color: #cfcfcf;
  font-size: 13px;
}
.comments-list {
  display: grid;
  gap: 10px;
}
.comment-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid #ffffff55;
  border-radius: 16px;
  background: #111;
}
.comment-card span {
  display: block;
  color: #aaa;
  font-size: 12px;
  margin-top: 2px;
}
.comment-card p {
  margin: 8px 0 0;
  line-height: 1.45;
}
.comment-remove {
  margin-top: 8px;
}
.comment-form {
  display: grid;
  gap: 8px;
}

.discord-community {
  border: 1px solid #fff;
  border-radius: 18px;
  padding: 12px 14px;
  margin: -6px 0 18px;
  background: #111;
  color: #fff;
}
.discord-community a { margin-left: 8px; }
.station-rating {
  display: grid;
  gap: 8px;
  align-items: start;
}
.star-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.star-button {
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 8px 11px;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.star-button.active,
.star-button:hover {
  background: #fff;
  color: #000;
}

.page-editor {
  margin-top: 20px;
  border: 1px solid #ffffff66;
  border-radius: 22px;
  padding: 18px;
  background: #070707;
}
.page-editor.locked { opacity: 0.72; }
.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  gap: 16px;
  align-items: start;
}
.editor-canvas,
.station-custom-layout {
  position: relative;
  width: 100%;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 22px;
  background: #050505;
}
.editor-canvas { touch-action: none; user-select: none; }
.editor-inspector {
  display: grid;
  gap: 12px;
  border: 1px solid #ffffff66;
  border-radius: 20px;
  padding: 14px;
  background: #000;
}
.editor-position-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.layout-block {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  border-radius: 18px;
  color: #fff;
  line-height: 1.12;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.layout-text {
  padding: 14px;
  background: #111;
  border: 1px solid #ffffff38;
}
.layout-image {
  border: 1px solid #fff;
  background: #000;
  justify-content: center;
  padding: 0;
}
.layout-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.layout-separator {
  align-items: center;
  padding: 0 12px;
}
.layout-separator span {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 18px #ffffff66;
}
.editor-block {
  cursor: grab;
  outline: 1px dashed #ffffff88;
  outline-offset: -5px;
}
.editor-block:active { cursor: grabbing; }
.editor-block.selected {
  outline: 3px solid #fff;
  box-shadow: 0 0 0 5px #ffffff24, 0 18px 40px #000;
}
.empty-block {
  color: #aaa;
  font-weight: 800;
  text-align: center;
  padding: 12px;
}
.station-custom-layout {
  margin: 8px 0 2px;
  box-shadow: inset 0 0 0 1px #ffffff12;
}
.station-custom-layout .layout-block { pointer-events: none; }
@media (max-width: 900px) {
  .editor-head { flex-direction: column; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-position-grid { grid-template-columns: 1fr 1fr; }
}

/* Clean dedicated station editor + centered public station pages */
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed #ffffff80;
  border-radius: 18px;
  background: #000;
}
.editor-hero {
  text-align: center;
  justify-items: center;
  grid-template-columns: 1fr;
}
.editor-hero .lead,
.editor-hero .eyebrow {
  margin-left: auto;
  margin-right: auto;
}
.editor-start-panel {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.editor-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.editor-step-card {
  border: 1px solid #ffffff66;
  border-radius: 18px;
  padding: 16px;
  background: #0b0b0b;
  text-align: center;
}
.editor-step-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}
.editor-step-card span {
  color: #cfcfcf;
  font-size: 13px;
  line-height: 1.4;
}
.page-editor {
  max-width: 1120px;
  margin: 0 auto 16px;
}
.editor-toolbar {
  justify-content: flex-end;
}
.primary-save {
  outline: 3px solid #ffffff30;
}
.editor-preview-wrap {
  display: grid;
  gap: 10px;
}
.editor-canvas,
.station-custom-layout {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.editor-tip,
.editor-help {
  text-align: center;
}
.editor-inspector h2 {
  margin-bottom: 0;
}
.advanced-editor-box {
  border: 1px dashed #ffffff70;
  border-radius: 16px;
  padding: 10px 12px;
  background: #080808;
}
.advanced-editor-box summary {
  cursor: pointer;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
}
.friendly-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.danger-button {
  background: #000;
  color: #fff;
}
.station-detail-card {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  padding: clamp(20px, 4vw, 34px);
}
.station-logo-large {
  width: min(220px, 55vw);
  justify-self: center;
}
.station-detail-body {
  width: 100%;
  max-width: 860px;
  justify-items: center;
}
.station-detail-body > p,
.station-meta,
.station-owner,
.station-rating,
.station-comments,
.station-gallery {
  width: 100%;
}
.station-owner,
.station-detail-actions,
.star-buttons {
  justify-content: center;
}
.station-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.station-gallery {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.station-comments {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
#detailStationName,
#detailShortDescription {
  text-align: center;
}
#stationDetailPage .hero {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}
.layout-text {
  justify-content: center;
}
@media (max-width: 900px) {
  .editor-steps { grid-template-columns: 1fr; }
  .editor-toolbar { justify-content: flex-start; }
  .friendly-controls { grid-template-columns: 1fr; }
}

/* Improved station cards: big station image, clear name/description, big frequency and rating. */
.station-row {
  grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) minmax(170px, auto);
  gap: clamp(14px, 2vw, 22px);
  align-items: stretch;
  padding: clamp(14px, 2vw, 20px);
  border-radius: 22px;
}
.station-card-image {
  min-height: 112px;
  display: flex;
}
.station-logo-small {
  width: 100%;
  height: 100%;
  min-height: 112px;
  border-radius: 18px;
  object-fit: cover;
}
.station-image-placeholder {
  display: grid;
  place-items: center;
  color: #cfcfcf;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.station-card-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.station-card-main strong {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}
.station-card-main p {
  max-width: 58ch;
}
.station-owner-line {
  opacity: 0.75;
}
.station-card-side {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 8px;
  text-align: right;
}
.station-frequency {
  color: #fff !important;
  font-size: clamp(26px, 4vw, 44px) !important;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.station-rating-badge {
  color: #fff !important;
  border: 1px solid #ffffff70;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 900;
}
.station-card-meta {
  color: #cfcfcf !important;
}
.detail-frequency {
  display: block;
  color: #fff;
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
}
.detail-meta-line {
  display: block;
  margin-top: 8px;
  color: #cfcfcf;
}
.station-logo-large {
  width: min(360px, 82vw);
  aspect-ratio: 4 / 3;
}
@media (min-width: 900px) {
  .station-detail-card {
    max-width: 1120px;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    justify-items: stretch;
    text-align: left;
  }
  .station-detail-body {
    justify-items: stretch;
    align-content: center;
  }
  .station-owner,
  .station-detail-actions,
  .star-buttons {
    justify-content: flex-start;
  }
}
@media (max-width: 760px) {
  .station-row {
    grid-template-columns: 1fr;
  }
  .station-card-side {
    justify-items: start;
    text-align: left;
  }
  .station-card-image {
    min-height: 180px;
  }
  .station-logo-small {
    min-height: 180px;
  }
}

/* Resizeable station page blocks */
.editor-help,
.editor-tip {
  line-height: 1.45;
}
.layout-block .resize-handle {
  position: absolute;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 0 0 0 2px #fff, 0 10px 24px #000;
  transition: opacity 0.12s ease;
}
.editor-block:hover .resize-handle,
.editor-block.selected .resize-handle {
  opacity: 1;
  pointer-events: auto;
}
.resize-right {
  right: -7px;
  top: 50%;
  width: 14px;
  height: 46px;
  border-radius: 999px;
  transform: translateY(-50%);
  cursor: ew-resize;
}
.resize-bottom {
  left: 50%;
  bottom: -7px;
  width: 58px;
  height: 14px;
  border-radius: 999px;
  transform: translateX(-50%);
  cursor: ns-resize;
}
.resize-corner {
  right: -8px;
  bottom: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: nwse-resize;
}
.editor-block.selected {
  overflow: visible;
}
.layout-separator.editor-block.selected,
.layout-separator.editor-block:hover {
  background: #ffffff10;
}
.friendly-controls {
  align-items: end;
}
.friendly-controls label {
  min-width: 0;
}
@media (max-width: 760px) {
  .resize-right,
  .resize-bottom,
  .resize-corner {
    width: 24px;
    height: 24px;
  }
}

/* Final polish: circular profile avatars + centered station pages. */
.discord-avatar,
img.discord-avatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  object-fit: cover;
  object-position: center;
  display: block;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
  flex: 0 0 36px;
  background: #000;
}

#stationDetailPage,
#stationDetailPage .hero,
#stationDetailPage .panel,
#stationDetailPage .station-detail-card,
#stationDetailPage .station-detail-body,
#stationDetailPage .station-custom-layout,
#stationDetailPage .station-gallery,
#stationDetailPage .station-comments {
  margin-left: auto;
  margin-right: auto;
}

#stationDetailPage .hero,
#stationDetailPage .station-detail-card,
#stationDetailPage .station-detail-body {
  justify-items: center !important;
  text-align: center !important;
}

#stationDetailPage .station-detail-card {
  grid-template-columns: 1fr !important;
  max-width: 960px;
  width: 100%;
}

#stationDetailPage .station-detail-body {
  max-width: 860px;
}

#stationDetailPage .station-owner,
#stationDetailPage .station-detail-actions,
#stationDetailPage .star-buttons {
  justify-content: center !important;
}

#stationDetailPage .station-custom-layout {
  width: min(900px, 100%);
}

#stationDetailPage .layout-text {
  justify-content: center;
}

.comment-card > .discord-avatar {
  align-self: start;
  justify-self: center;
}
.avatar-placeholder {
  border: 1px dashed #ffffff88;
}


/* Top navigation must always stay clickable above station/editor layouts. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10000 !important;
  isolation: isolate;
  pointer-events: auto;
}
.topbar .nav-link {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.page[hidden] {
  pointer-events: none !important;
}
