:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --bio-color: #333333;
  --desc-color: #444444;
  --border-color: #000000;
  --border-muted: rgba(0, 0, 0, 0.15);
  --footer-color: #666666;
  --link-hover-bg: #000000;
  --link-hover-color: #ffffff;
  --code-bg: rgba(0, 0, 0, 0.04);
  --code-border: rgba(0, 0, 0, 0.12);
  --card-bg: rgba(0, 0, 0, 0.015);
  --modal-overlay: rgba(0, 0, 0, 0.55);
  --success-color: #15803d;
  --success-bg: rgba(34, 197, 94, 0.12);
  --danger-color: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --amber-color: #d97706;
  --amber-bg: rgba(217, 119, 6, 0.12);
  --radio-needle: #dc2626;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-color: #0d0e12;
    --text-color: #f3f4f6;
    --bio-color: #a1a1aa;
    --desc-color: #94a3b8;
    --border-color: #27272a;
    --border-muted: rgba(255, 255, 255, 0.15);
    --footer-color: #71717a;
    --link-hover-bg: #f3f4f6;
    --link-hover-color: #0d0e12;
    --code-bg: rgba(255, 255, 255, 0.06);
    --code-border: rgba(255, 255, 255, 0.14);
    --card-bg: rgba(255, 255, 255, 0.025);
    --modal-overlay: rgba(0, 0, 0, 0.78);
    --success-color: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.14);
    --danger-color: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.14);
    --amber-color: #fbbf24;
    --amber-bg: rgba(251, 191, 36, 0.14);
    --radio-needle: #f87171;
  }
}

[data-theme="dark"] {
  --bg-color: #0d0e12;
  --text-color: #f3f4f6;
  --bio-color: #a1a1aa;
  --desc-color: #94a3b8;
  --border-color: #27272a;
  --border-muted: rgba(255, 255, 255, 0.15);
  --footer-color: #71717a;
  --link-hover-bg: #f3f4f6;
  --link-hover-color: #0d0e12;
  --code-bg: rgba(255, 255, 255, 0.06);
  --code-border: rgba(255, 255, 255, 0.14);
  --card-bg: rgba(255, 255, 255, 0.025);
  --modal-overlay: rgba(0, 0, 0, 0.78);
  --success-color: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.14);
  --danger-color: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.14);
  --amber-color: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.14);
  --radio-needle: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 36px 20px 80px;
  font-size: 16px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Links */
a {
  color: var(--text-color);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a:hover {
  text-decoration: none;
  background-color: var(--link-hover-bg);
  color: var(--link-hover-color);
}

/* Header */
header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.brand {
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand a {
  text-decoration: none;
  color: var(--text-color);
}

.brand a:hover {
  background: transparent;
  color: var(--text-color);
}

.brand-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: var(--radio-needle);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--radio-needle);
  animation: pulse-dot 2.5s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bio {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94rem;
  color: var(--bio-color);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.relay-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--footer-color);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background-color: #f59e0b;
  transition: background-color 0.3s ease;
}

.status-dot.online {
  background-color: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* Bracket Buttons */
.bracket-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 3px;
  line-height: 1.3;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

.bracket-btn:hover:not(:disabled) {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-color);
  text-decoration: none;
}

.bracket-btn.btn-active {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-color);
}

.bracket-btn.btn-danger {
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.bracket-btn.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-color);
  color: #ffffff;
}

.bracket-btn.btn-success {
  border-color: var(--success-color);
  color: var(--success-color);
}

.bracket-btn.btn-success:hover:not(:disabled) {
  background-color: var(--success-color);
  color: #ffffff;
}

.bracket-btn.btn-power {
  border-color: var(--border-color);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.bracket-btn.btn-power.active {
  background-color: var(--success-bg);
  border-color: var(--success-color);
  color: var(--success-color);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.25);
}

.bracket-btn.btn-power.active:hover {
  background-color: var(--success-color);
  color: #ffffff;
}

.bracket-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bracket-btn:focus-visible {
  outline: 2px solid var(--text-color);
  outline-offset: 2px;
}

/* Animated Radio Equalizer */
.radio-eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  margin-left: 6px;
  vertical-align: middle;
}

.radio-eq-bars span {
  display: block;
  width: 3px;
  background-color: var(--radio-needle);
  border-radius: 1px;
  animation: eq-bounce 0.85s infinite ease-in-out alternate;
}

.radio-eq-bars span:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.radio-eq-bars span:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.radio-eq-bars span:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.radio-eq-bars span:nth-child(4) { height: 80%; animation-delay: 0.4s; }

@keyframes eq-bounce {
  0% { transform: scaleY(0.25); opacity: 0.6; }
  100% { transform: scaleY(1); opacity: 1; }
}

/* Embedded Media Player */
.media-player-container {
  margin: 14px 0 16px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--border-muted);
  transition: all 0.2s ease;
}

.media-player-container iframe {
  width: 100%;
  border: none;
  display: block;
}

.media-player-container audio {
  width: 100%;
  padding: 8px;
  display: block;
  outline: none;
}

.media-player-prompt {
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--bio-color);
  background: var(--code-bg);
  border: 1px dashed var(--border-muted);
  border-radius: 4px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.media-player-prompt:hover {
  background: rgba(0, 0, 0, 0.07);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
  line-height: 1.3;
  letter-spacing: 0.4px;
}

.auth-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--success-color);
  background-color: var(--success-bg);
  border: 1px solid var(--success-color);
  padding: 3px 8px;
  border-radius: 3px;
}

/* Section Dividers */
section {
  margin-bottom: 44px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border-muted);
  padding-bottom: 6px;
}

h2 {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.2px;
}

/* Radio Tuner Box */
.radio-tuner {
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
  z-index: 5;
}

[data-theme="dark"] .radio-tuner {
  background-color: #121319;
}

.frequency-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.frequency-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.freq-unit {
  font-size: 0.85rem;
  color: var(--bio-color);
  font-weight: normal;
}

.peer-frequency-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--desc-color);
  background: var(--code-bg);
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--code-border);
}

/* Analog Tuner Scale */
.tuner-scale-container {
  position: relative;
  margin: 16px 0 20px;
  user-select: none;
}

.tuner-scale {
  height: 48px;
  border: 1px solid var(--border-color);
  background: var(--code-bg);
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  cursor: pointer;
}

.scale-ticks {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 10px;
}

.tick {
  width: 1px;
  background-color: var(--border-muted);
  height: 12px;
}

.tick.major {
  height: 24px;
  background-color: var(--border-color);
}

.tuner-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--radio-needle);
  box-shadow: 0 0 6px var(--radio-needle);
  left: 50%;
  transition: left 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 2;
  pointer-events: none;
}

.tuner-needle::after {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 6px;
  background-color: var(--radio-needle);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.scale-legend {
  display: flex;
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--footer-color);
  margin-top: 4px;
}

/* Tuner Controls */
.tuner-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.tuner-nav-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tag-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.tag-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border-muted);
  background: transparent;
  color: var(--desc-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-chip:hover {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-color);
  border-color: var(--border-color);
}

.tag-chip.active {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-color);
  border-color: var(--border-color);
  font-weight: 600;
}

/* Active Pick Display Card */
.pick-card {
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  border-radius: 4px;
  padding: 22px;
  transition: border-color 0.2s ease;
}

.pick-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--bio-color);
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.peer-tag-badge {
  background-color: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--desc-color);
}

.pick-target-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400;
  text-decoration: none;
  padding: 8px 12px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  margin-bottom: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  overflow: hidden;
  color: var(--text-color);
}

.pick-target-link:hover {
  border-color: var(--border-color);
  background-color: var(--card-bg);
  text-decoration: none;
}

.pick-target-link:hover #pick-url-text {
  text-decoration: underline;
}

.domain-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--success-color);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

#pick-url-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--desc-color);
  font-size: 0.85rem;
}

/* Media Player & TuneCamp Integration */
.media-player-container {
  margin: 14px 0 16px;
  border-radius: 4px;
  overflow: hidden;
}

.tunecamp-player-card {
  display: flex;
  gap: 16px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 14px;
  align-items: center;
}

.tunecamp-cover-wrapper {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border: 1px solid var(--border-muted);
  background: var(--card-bg);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tunecamp-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tunecamp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tunecamp-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--success-color);
  letter-spacing: 0.5px;
}

.tunecamp-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tunecamp-artist {
  font-size: 0.88rem;
  color: var(--desc-color);
  margin-bottom: 6px;
}

.tunecamp-audio {
  width: 100%;
  height: 34px;
}

@media (max-width: 520px) {
  .tunecamp-player-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .tunecamp-cover-wrapper {
    width: 100%;
    height: 140px;
  }
}

.pick-caption {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--desc-color);
  margin-top: 14px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--code-bg);
  border-left: 3px solid var(--border-muted);
  border-radius: 0 4px 4px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.pick-caption.user-caption {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-color);
  border-left-color: var(--border-color);
}

.pick-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px dashed var(--border-muted);
  padding-top: 16px;
}

.pick-action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Positive Friction Box */
.friction-box {
  padding: 12px 16px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.friction-box.locked {
  background-color: var(--amber-bg);
  border: 1px solid var(--amber-color);
  color: var(--text-color);
}

.friction-box.unlocked {
  background-color: var(--success-bg);
  border: 1px solid var(--success-color);
  color: var(--text-color);
}

.friction-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Transmitter Section (Your Slot) */
.transmitter-card {
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  border-radius: 4px;
  padding: 22px;
}

.transmitter-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--desc-color);
  margin-bottom: 18px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-color);
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea {
  width: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--text-color);
  box-shadow: 0 0 0 1px var(--text-color);
}

.char-counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--footer-color);
  margin-top: 4px;
}

.char-counter.warning {
  color: var(--amber-color);
  font-weight: 600;
}

.char-counter.danger {
  color: var(--danger-color);
  font-weight: 700;
}

/* Compatible Audio Providers Panel & Live Validation */
.compatible-providers-panel {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--border-muted);
  border-radius: 4px;
  background-color: var(--card-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  transition: all 0.2s ease;
}

.compatible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.compatible-title {
  color: var(--desc-color);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.url-validation-status {
  font-weight: 700;
  font-size: 0.75rem;
}

.url-validation-status.valid {
  color: var(--success-color);
}

.url-validation-status.invalid {
  color: var(--danger-color);
}

.url-validation-status.info {
  color: var(--amber-color);
}

.provider-badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--border-muted);
  border-radius: 3px;
  background-color: var(--code-bg);
  color: var(--bio-color);
  font-size: 0.74rem;
  transition: all 0.18s ease;
  user-select: none;
}

.provider-badge.detected {
  background-color: var(--success-bg);
  border-color: var(--success-color);
  color: var(--success-color);
  font-weight: 700;
  transform: translateY(-1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.non-sound-hint {
  margin-top: 4px;
  color: var(--bio-color);
  font-size: 0.75rem;
  line-height: 1.35;
}

.radio-preset-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.state-warning-callout {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--footer-color);
  margin-top: 14px;
  line-height: 1.4;
  border-top: 1px dashed var(--border-muted);
  padding-top: 10px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-content {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 26px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-height: 88vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.modal-header h3 {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.2rem;
}

/* Cassetto Items List */
.cassetto-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.cassetto-item {
  border: 1px solid var(--border-muted);
  background: var(--card-bg);
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}

.cassetto-item:hover {
  border-color: var(--border-color);
}

.cassetto-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--footer-color);
  margin-bottom: 6px;
}

.cassetto-item-link {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 6px;
  word-break: break-all;
}

.cassetto-item-caption {
  font-size: 0.88rem;
  color: var(--bio-color);
  line-height: 1.4;
  margin-bottom: 8px;
}

.cassetto-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--link-hover-bg);
  color: var(--link-hover-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  padding: 8px 16px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 2000;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
footer {
  margin-top: 60px;
  border-top: 1px solid var(--border-muted);
  padding-top: 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--footer-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand {
  font-weight: 600;
  color: var(--text-color);
}

.footer-author {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--desc-color);
  font-size: 0.8rem;
}

.footer-author-link {
  font-weight: 700;
  color: var(--text-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-sublink {
  color: var(--bio-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-sep {
  color: var(--border-muted);
}

.footer-endorsement {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.tc-endorse-badge {
  color: var(--success-color);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.footer-tc-link {
  color: var(--success-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
}

.footer-tc-link:hover {
  opacity: 0.85;
}

.tc-philosophy {
  color: var(--bio-color);
  font-style: italic;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  border: 1px dashed var(--border-muted);
  border-radius: 4px;
  color: var(--desc-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Clickable Badge */
.clickable-badge {
  cursor: pointer;
  transition: opacity 0.15s ease, text-decoration 0.15s ease;
}
.clickable-badge:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Jammed Signal Banner (Community Jamming) */
.jammed-banner {
  background-color: var(--amber-bg);
  border: 1px solid var(--amber-color);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.jammed-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}

.jammed-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.jammed-text {
  flex: 1;
  min-width: 200px;
}

.jammed-toggle-btn {
  font-size: 0.78rem;
  padding: 2px 8px;
}

/* Obscured Player when Jammed */
.media-player-container.jammed-obscured {
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.4;
}

/* Station Profile Modal */
.station-profile-details {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.profile-key {
  color: var(--desc-color);
  flex-shrink: 0;
}

.profile-val {
  color: var(--text-color);
}

.profile-val.bold {
  font-weight: 700;
}

.pubkey-container {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.pubkey-code {
  background: var(--card-bg);
  border: 1px solid var(--border-muted);
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permalink-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.permalink-input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  padding: 6px 10px;
  border: 1px solid var(--border-muted);
  background: var(--bg-color);
  color: var(--text-color);
  border-radius: 3px;
}

.profile-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Report Modal Box */
.report-box {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 14px;
}

.report-box h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.report-select {
  width: 100%;
  padding: 8px;
  font-size: 0.88rem;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  border-radius: 3px;
}

.btn-report {
  color: var(--danger-color) !important;
  border-color: var(--danger-color) !important;
}

.btn-report:hover {
  background-color: var(--danger-bg) !important;
}

/* Tutorial & Onboarding Modal */
.tutorial-modal-content {
  max-width: 620px;
}

.tutorial-stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-muted);
}

.tutorial-step-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-color);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 3px 8px;
  border-radius: 3px;
}

.tutorial-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tutorial-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--border-muted);
  transition: all 0.2s ease;
}

.tutorial-dots .dot.active {
  background-color: var(--text-color);
  transform: scale(1.3);
}

.tutorial-body {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tutorial-step-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-color);
}

.tutorial-step-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--desc-color);
  margin: 0;
}

.tutorial-step-callout {
  background: var(--code-bg);
  border-left: 3px solid var(--accent-color);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--bio-color);
  margin-top: 4px;
}

.tutorial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border-muted);
}

.tutorial-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--desc-color);
  cursor: pointer;
  user-select: none;
}

.tutorial-remember-label input[type="checkbox"] {
  cursor: pointer;
}

.tutorial-nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Radio Sigil (Cryptographic Generative Identicon) */
.station-sigil-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-color);
  flex-shrink: 0;
  vertical-align: middle;
  padding: 2px;
  box-sizing: border-box;
}

.station-sigil-icon .sigil-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.peer-frequency-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pick-author-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.prof-header-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-muted);
}

.prof-sigil-large {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-color);
  padding: 6px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.prof-sigil-large .sigil-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.prof-header-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prof-node-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
}

.prof-freq-sub {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--bio-color);
}

.item-sigil-prefix {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 6px;
}

/* Helper utilities */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Canvas Mode (Focus View)
   Places only the radio box centered in the viewport and hides all else
   ========================================================================== */

body.canvas-mode {
  min-height: 100vh;
  margin: 0;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  background-image: radial-gradient(var(--border-muted) 1px, transparent 1px);
  background-size: 24px 24px;
}

body.canvas-mode header,
body.canvas-mode #transmitter-section,
body.canvas-mode footer {
  display: none !important;
}

body.canvas-mode .container {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 5;
}

body.canvas-mode #radio-section {
  margin-bottom: 0;
  width: 100%;
}

body.canvas-mode .radio-tuner {
  background-color: var(--bg-color);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.09);
  position: relative;
  z-index: 5;
}

[data-theme="dark"] body.canvas-mode .radio-tuner {
  background-color: #121319;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
}

/* Floating exit button in canvas mode */
.canvas-exit-bar {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInExit 0.2s ease forwards;
}

@keyframes fadeInExit {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-exit-canvas {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font-weight: 600;
}

.btn-exit-canvas:hover {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-color);
}

.btn-canvas-quick {
  font-size: 0.76rem;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 600px) {
  body {
    padding: 20px 14px 60px;
  }
  body.canvas-mode {
    padding: 60px 12px 20px;
    justify-content: flex-start;
  }
  .canvas-exit-bar {
    top: 12px;
    right: 12px;
  }
  .brand {
    font-size: 1.7rem;
  }
  .frequency-display {
    font-size: 1.3rem;
  }
  .tuner-scale {
    height: 40px;
  }
}

/* ==========================================================================
   Radio Ether Wave Canvas Background (FM Carrier & Shockwave Visualizer)
   ========================================================================== */
.radio-ether-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .radio-ether-canvas {
  opacity: 0.98;
}

/* Subtle analog tuner hardware feedback on tuning */
body.ether-tuning-warp .radio-tuner {
  border-color: var(--amber-color);
  box-shadow: 0 0 26px rgba(245, 158, 11, 0.35);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
