:root {
  --bg: #101211;
  --panel: #181b1a;
  --panel-2: #202321;
  --border: #313632;
  --text: #f4f0e8;
  --muted: #a9b0a8;
  --accent: #26c485;
  --accent-2: #d9a441;
  --danger: #ef5b5b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
  max-width: 100%;
}

.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;
}

button,
.button,
input,
select {
  touch-action: manipulation;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) 14px
    calc(18px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: rgba(16, 18, 17, 0.94);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar > div,
.topbar-main > div,
.panel-heading > div,
.sound-row > div:first-child,
.channel-header > div:first-child,
.player-card > div {
  min-width: 0;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.12;
}

.topbar p,
.panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.top-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  width: 46px;
  min-width: 46px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  gap: 5px;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 13px;
  cursor: pointer;
  color: var(--text);
  background: var(--panel-2);
  text-decoration: none;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button:hover,
button:hover {
  border-color: var(--accent);
}

.button.primary,
button.primary {
  background: var(--accent);
  color: #08110d;
  border-color: var(--accent);
  font-weight: 700;
}

.button.secondary,
button.secondary {
  background: transparent;
}

.button.danger,
button.danger {
  background: rgba(239, 91, 91, 0.14);
  border-color: rgba(239, 91, 91, 0.7);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 12px;
}

.pill.live {
  color: #06130e;
  background: var(--accent);
  border-color: var(--accent);
}

.console-layout,
.player-layout {
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.console-page .console-layout {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.console-layout {
  display: block;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.library-drawer {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  position: fixed;
  top: calc(88px + env(safe-area-inset-top));
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: calc(18px + env(safe-area-inset-left));
  z-index: 40;
  width: min(430px, calc(100vw - 36px));
  overflow: hidden;
  transform: translateX(calc(-100% - 28px));
  transition: transform 0.22s ease;
}

.library-open .library-drawer {
  transform: translateX(0);
}

.library-drawer .sound-list {
  max-height: none;
  min-height: 0;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.58);
  cursor: pointer;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer-close {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  flex: 0 0 auto;
  padding: 0;
  position: relative;
}

.drawer-close span {
  position: absolute;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.drawer-close span:first-child {
  transform: rotate(45deg);
}

.drawer-close span:last-child {
  transform: rotate(-45deg);
}

.floating-library-button {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 45;
  min-width: 128px;
  min-height: 52px;
  border-color: var(--accent);
  background: var(--accent);
  color: #06130e;
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(38, 196, 133, 0.26);
}

.toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.library-toolbar input {
  flex: 1 1 180px;
}

.library-toolbar select {
  flex: 0 0 138px;
}

.folder-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #121413;
}

.folder-up {
  min-height: 36px;
  padding: 7px 10px;
}

.folder-up:disabled {
  cursor: default;
  opacity: 0.42;
}

.folder-crumbs {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.folder-crumbs button {
  min-height: 36px;
  min-width: 0;
  padding: 7px 10px;
  flex: 0 0 auto;
  color: var(--muted);
  background: #0f1110;
}

.folder-crumbs button.current {
  color: #06130e;
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 800;
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #0f1110;
  color: var(--text);
}

input[type="range"] {
  appearance: none;
  width: 100%;
  min-height: 38px;
  padding: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: #616861;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #616861;
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}

.toolbar input {
  flex: 1 1 150px;
  min-width: 0;
}

.toolbar select {
  flex: 1 1 130px;
  min-width: 0;
}

.sound-list {
  display: grid;
  gap: 1px;
  background: var(--border);
  max-height: calc(100vh - 230px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sound-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--panel);
}

.folder-row {
  background: var(--panel);
}

.folder-row button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 58px;
  justify-content: start;
  border: 0;
  border-radius: 0;
  padding: 12px;
  text-align: left;
  background: var(--panel);
}

.folder-row button:hover {
  background: var(--panel-2);
}

.folder-mark {
  position: relative;
  width: 30px;
  height: 24px;
  border: 2px solid var(--accent);
  border-radius: 5px;
  background: rgba(38, 196, 133, 0.12);
}

.folder-mark::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 2px;
  width: 14px;
  height: 8px;
  border: 2px solid var(--accent);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: rgba(38, 196, 133, 0.12);
}

.folder-row strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.sound-name,
.channel-title,
.player-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-name {
  font-weight: 650;
}

.channel-title,
.player-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.sound-meta,
.channel-meta,
.player-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.sound-actions button {
  min-width: 62px;
}

.channels-board {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.channel-jump-nav {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 18, 17, 0.96);
}

.channel-jump-nav button {
  aspect-ratio: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  color: var(--muted);
  font-weight: 850;
}

.channel-jump-nav button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #06130e;
}

.channel-jump-nav button.selected {
  outline: 3px solid rgba(244, 240, 232, 0.82);
  outline-offset: 2px;
}

.channel-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
}

.channel-tile {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  border-color: var(--border);
  background: #111312;
  color: var(--muted);
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
  box-shadow: none;
}

.channel-tile.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #06130e;
}

.channel-tile.selected {
  outline: 3px solid rgba(244, 240, 232, 0.82);
  outline-offset: 2px;
}

.channel-tile:focus-visible,
.floating-library-button:focus-visible,
.drawer-close:focus-visible,
.menu-toggle:focus-visible {
  outline: 3px solid rgba(244, 240, 232, 0.86);
  outline-offset: 3px;
}

.channel-detail {
  width: min(760px, 100%);
  margin: 0 auto;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  padding: 16px;
}

.channel-card,
.player-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #131514;
  overflow: hidden;
}

.channel-card.active,
.player-card.active {
  border-color: rgba(38, 196, 133, 0.75);
}

.channel-header,
.player-card {
  padding: 12px;
}

.channel-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.channel-status {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.channel-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.channel-body select {
  width: 100%;
}

.channel-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.region-editor {
  display: grid;
  gap: 8px;
}

.region-editor.disabled {
  opacity: 0.55;
}

.region-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.region-head output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-canvas {
  display: block;
  width: 100%;
  height: 68px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0e100f;
  cursor: crosshair;
  touch-action: none;
}

.region-actions {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(58px, 0.65fr);
  gap: 8px;
}

.control-line {
  display: grid;
  grid-template-columns: 62px minmax(96px, 1fr) 54px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.control-line output {
  min-width: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.toggle-line label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toggle-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 16px;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: calc(18px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right))
    calc(18px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
}

.auth-shell {
  width: min(420px, 100%);
}

.auth-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-heading {
  margin-bottom: 18px;
}

.auth-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.auth-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.auth-form button {
  width: 100%;
  margin-top: 2px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.player-meter {
  display: block;
  width: 100%;
  margin-top: 12px;
}

.radio-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: calc(18px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right))
    calc(18px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
  background: #080908;
}

.radio-button {
  width: 88px;
  height: 88px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-color: var(--accent);
  border-radius: 50%;
  background: var(--accent);
  color: #06130e;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(38, 196, 133, 0.22);
}

.radio-button.is-playing {
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 16px 40px rgba(239, 91, 91, 0.22);
}

.radio-icon {
  display: block;
}

.radio-icon.play {
  width: 0;
  height: 0;
  margin-left: 7px;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-left: 28px solid #06130e;
}

.radio-icon.stop {
  width: 30px;
  height: 30px;
  border-radius: 3px;
  background: #160707;
}

meter {
  width: 180px;
  height: 18px;
  accent-color: var(--accent);
}

@media (min-width: 901px) and (orientation: landscape), (min-width: 1101px) {
  .console-page .console-layout {
    display: grid;
    grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding-bottom: 16px;
  }

  .library-drawer {
    position: sticky;
    top: 88px;
    bottom: auto;
    left: auto;
    z-index: 1;
    width: auto;
    max-height: calc(100vh - 104px);
    transform: none;
    transition: none;
  }

  .library-open .library-drawer {
    transform: none;
  }

  .floating-library-button,
  .drawer-backdrop,
  .drawer-close {
    display: none;
  }

  .channels-board.desktop-channels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .channels-board.desktop-channels .channel-jump-nav {
    display: grid;
    position: sticky;
    top: 88px;
    z-index: 5;
    grid-template-columns: repeat(12, minmax(42px, 1fr));
  }

  .desktop-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
  }
}

@media (min-width: 1500px) {
  .topbar {
    padding-right: calc(24px + env(safe-area-inset-right));
    padding-left: calc(24px + env(safe-area-inset-left));
  }

  .console-layout,
  .player-layout {
    padding: 20px;
  }

  .channels-board {
    gap: 18px;
    padding: 18px;
  }

  .channels-board.desktop-channels {
    gap: 16px;
    padding: 18px;
  }

  .desktop-channel-grid {
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 16px;
  }

  .player-grid {
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 16px;
    padding: 18px;
  }

  .channel-tiles {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 12px;
  }

  .region-canvas {
    height: 76px;
  }
}

@media (pointer: coarse) {
  .button,
  button,
  input,
  select {
    min-height: 44px;
  }

  input[type="range"] {
    min-height: 44px;
  }

  .toggle-line label {
    min-height: 40px;
  }
}

@media (max-width: 900px), (max-width: 1100px) and (orientation: portrait) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .topbar-main {
    width: 100%;
    justify-content: space-between;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .top-actions {
    display: none;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .topbar.menu-open .top-actions {
    display: grid;
  }

  .top-actions .pill {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .console-layout {
    grid-template-columns: 1fr;
  }

  .library-drawer {
    top: calc(74px + env(safe-area-inset-top));
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: calc(12px + env(safe-area-inset-left));
    width: min(430px, calc(100vw - 24px));
  }

  .sound-list {
    max-height: clamp(300px, 38dvh, 520px);
  }
}

@media (min-width: 641px) and (max-width: 1100px) and (orientation: portrait) {
  .console-layout,
  .player-layout {
    padding: 14px;
  }

  .player-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .channel-tiles {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }

  .region-canvas {
    height: 78px;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 8px;
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-bottom: 10px;
    padding-right: calc(12px + env(safe-area-inset-right));
    padding-left: calc(12px + env(safe-area-inset-left));
  }

  .topbar h1 {
    font-size: 19px;
  }

  .topbar p {
    display: none;
  }

  .panel p {
    font-size: 12px;
  }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions .pill {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .top-actions .button,
  .top-actions button {
    width: 100%;
    min-height: 46px;
    padding-right: 10px;
    padding-left: 10px;
    text-align: center;
  }

  .console-layout,
  .player-layout {
    padding: 10px;
  }

  .panel {
    border-radius: 8px;
    box-shadow: none;
  }

  .auth-panel {
    padding: 18px;
    box-shadow: none;
  }

  .auth-heading h1 {
    font-size: 24px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .library-drawer .panel-heading {
    align-items: center;
    flex-direction: row;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .folder-nav {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .folder-up {
    width: 100%;
    min-height: 44px;
  }

  .folder-crumbs button {
    min-height: 42px;
  }

  .toolbar input,
  .toolbar select,
  input,
  select {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .sound-list {
    max-height: clamp(260px, 44dvh, 520px);
  }

  .sound-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .sound-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .sound-actions button {
    min-height: 44px;
  }

  .folder-row button {
    min-height: 62px;
  }

  .channels-board,
  .player-grid {
    gap: 10px;
    padding: 10px;
  }

  .channel-tiles {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 8px;
  }

  .channel-header {
    align-items: flex-start;
  }

  .channel-title,
  .player-title {
    font-size: 16px;
  }

  .channel-body {
    gap: 12px;
    padding: 10px;
  }

  .channel-controls {
    gap: 10px;
  }

  .channel-controls button,
  .region-actions button {
    min-height: 44px;
  }

  .region-canvas {
    height: 80px;
  }

  .region-actions {
    grid-template-columns: 1fr 1fr;
  }

  .region-actions button:last-child {
    grid-column: 1 / -1;
  }

  .control-line {
    grid-template-columns: 48px minmax(0, 1fr) 54px;
    gap: 6px;
  }

  .control-line input[type="range"] {
    min-height: 42px;
  }

  .toggle-line {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .toggle-line label {
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0f1110;
  }

  meter {
    width: 100%;
  }

  .radio-button {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding-right: calc(10px + env(safe-area-inset-right));
    padding-left: calc(10px + env(safe-area-inset-left));
  }

  .console-layout,
  .player-layout {
    padding: 8px;
  }

  .toolbar {
    gap: 8px;
  }

  .sound-row,
  .folder-row button,
  .channel-header,
  .channel-body,
  .player-card {
    padding: 10px;
  }

  .channels-board,
  .player-grid {
    gap: 8px;
    padding: 8px;
  }

  .channel-body {
    gap: 9px;
  }
}

@media (max-width: 420px) {
  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar h1 {
    font-size: 18px;
  }

  .sound-name,
  .channel-title,
  .player-title {
    white-space: normal;
  }

  .channel-header {
    align-items: flex-start;
  }

  .channel-status {
    align-self: auto;
  }

  .control-line {
    grid-template-columns: 44px minmax(0, 1fr) 52px;
  }

  .control-line span {
    grid-column: auto;
  }
}
