* {
  box-sizing: border-box;
}

:root {
  --bottom-safe-space: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-y: auto;
  background: #f4f6f8;
  color: #17202a;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
.file-button {
  min-height: 40px;
  border: 1px solid #b8c2cc;
  border-radius: 6px;
  background: #ffffff;
  color: #17202a;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.file-button:hover {
  background: #edf2f7;
}

button:active,
.file-button:active {
  transform: translateY(1px);
}

button.is-active {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #134e4a;
}

.button-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.throw-button.is-selected,
.display-toggle.is-active[data-display="throw1"] {
  border-color: #16a34a;
  background: #39ff14;
  color: #052e16;
}

.throw-button.is-selected.throw-2,
.display-toggle.is-active[data-display="throw2"] {
  border-color: #be185d;
  background: #ff4fd8;
  color: #500724;
}

.throw-button.is-selected.throw-3,
.display-toggle.is-active[data-display="throw3"] {
  border-color: #ca8a04;
  background: #ffd60a;
  color: #422006;
}

.wrist-button.is-selected {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e3a8a;
}

.app {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 18px calc(18px + var(--bottom-safe-space));
}

.app-header {
  margin-bottom: 14px;
}

.app-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.25;
}

.app-header p {
  margin: 0;
  color: #52616f;
  font-size: 14px;
}

.panel-toggle {
  margin-bottom: 10px;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 14px;
  align-items: stretch;
  min-height: calc(100vh - 118px - var(--bottom-safe-space));
}

.control-panel {
  display: flex;
  min-width: 0;
  max-height: calc(100vh - 118px - var(--bottom-safe-space));
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-bottom: var(--bottom-safe-space);
  transition: width 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.panel-collapsed .app-layout {
  grid-template-columns: minmax(0, 1fr) 0;
  gap: 0;
}

.panel-collapsed .control-panel {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(12px);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: #ffffff;
}

.control-panel .toolbar {
  align-content: flex-start;
  flex-direction: column;
  align-items: stretch;
}

.control-panel .button-group {
  width: 100%;
}

.control-panel .throw-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-panel .throw-row .throw-button {
  width: 100%;
  min-width: 0;
  padding-right: 8px;
  padding-left: 8px;
}

.control-panel button,
.control-panel .file-button,
.control-panel .control {
  width: 100%;
}

.control-panel .panel-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
}

.control-panel .panel-row .control,
.control-panel .panel-row button {
  width: auto;
  flex: 0 0 auto;
}

.control-panel .panel-row .range-control {
  flex: 1 1 auto;
  min-width: 0;
}

.control-panel .panel-row .range-control input[type="range"] {
  width: 100%;
  min-width: 72px;
}

.control-panel .grid-row .checkbox-control,
.control-panel .wrist-row .checkbox-control:first-child {
  flex: 0 0 auto;
}

.control-panel .drawing-row {
  justify-content: flex-start;
}

.control-panel .drawing-row .control {
  min-width: 0;
}

.control-panel .drawing-row #lineModeButton {
  flex: 1 1 auto;
  min-width: 0;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.file-button input {
  display: none;
}

.control {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  white-space: nowrap;
}

.checkbox-control input {
  width: 18px;
  height: 18px;
}

.range-control input[type="range"] {
  width: 120px;
}

.seek-control {
  flex: 1 1 280px;
}

.seek-control input[type="range"] {
  width: 100%;
  min-width: 180px;
}

input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.viewer {
  width: 100%;
  min-width: 0;
}

.video-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  backdrop-filter: blur(8px);
}

.video-stage {
  position: relative;
  width: 100%;
  min-height: 360px;
  height: calc(100vh - 118px - var(--bottom-safe-space));
  max-height: calc(100vh - 118px - var(--bottom-safe-space));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #111827;
  touch-action: none;
}

.video-stage .video-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  pointer-events: auto;
}

.video-stage .video-controls button,
.video-stage .video-controls .control {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.13);
  color: #f8fafc;
}

.video-stage .video-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.video-stage .video-controls button.is-active {
  border-color: rgba(45, 212, 191, 0.8);
  background: rgba(20, 184, 166, 0.35);
  color: #ecfeff;
}

.video-stage .video-controls .seek-control {
  flex: 1 1 220px;
}

video,
canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
}

video {
  object-fit: contain;
  background: #111827;
}

canvas {
  z-index: 2;
  cursor: crosshair;
  touch-action: none;
}

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #dbeafe;
  font-size: 18px;
  text-align: center;
  pointer-events: none;
}

.empty-state.is-hidden {
  display: none;
}

@media (orientation: landscape) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-y: auto;
  }

  .app {
    padding: 10px;
    padding-bottom: calc(10px + var(--bottom-safe-space));
    min-height: 100svh;
    height: auto;
    overflow: visible;
  }

  .app-header {
    display: none;
  }

  .panel-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
  }

  .app-layout {
    grid-template-columns: minmax(0, 1fr) clamp(260px, 30vw, 380px);
    gap: 10px;
    min-height: calc(100vh - 20px - var(--bottom-safe-space));
    height: auto;
  }

  .control-panel {
    max-height: calc(100svh - 20px - var(--bottom-safe-space));
    padding-top: 50px;
    padding-bottom: var(--bottom-safe-space);
  }

  .video-stage {
    height: calc(100svh - 20px - var(--bottom-safe-space));
    max-height: calc(100svh - 20px - var(--bottom-safe-space));
    min-height: 0;
  }
}

/*
 * Legacy mobile layouts are intentionally disabled.
 * Small screens now use the same layout as the desktop version.
 *
@media (max-width: 720px) and (orientation: portrait) {
  .app {
    padding: 12px;
  }

  .app-header h1 {
    font-size: 20px;
  }

  .toolbar {
    gap: 8px;
  }

  .video-controls {
    gap: 8px;
  }

  .app-layout {
    display: block;
  }

  .control-panel {
    max-height: none;
    margin-top: 10px;
  }

  .panel-collapsed .control-panel {
    display: none;
  }

  button,
  .file-button,
  .control {
    min-height: 38px;
    font-size: 13px;
  }

  .range-control input[type="range"] {
    width: 92px;
  }

  .seek-control {
    flex-basis: 100%;
  }

  .video-stage {
    min-height: 220px;
    max-height: calc(100vh - 230px);
  }
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 0;
  }

  .app {
    width: 100%;
    max-width: 100%;
    min-height: 100svh;
    padding: 10px 10px calc(120px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  .app-header {
    display: block;
  }

  .app-header h1 {
    font-size: 20px;
  }

  .panel-toggle {
    position: static;
    width: 100%;
    margin: 0 0 10px;
  }

  .app-layout,
  .panel-collapsed .app-layout {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    flex-direction: column;
    gap: 10px;
  }

  .viewer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .video-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 220px;
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .video-stage.mobile-landscape {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: var(--mobile-video-aspect, 16 / 9);
  }

  .video-stage.mobile-portrait {
    width: min(100%, var(--mobile-portrait-width, 100%));
    height: auto;
    min-height: 0;
    max-height: 65svh;
    margin-right: auto;
    margin-left: auto;
    aspect-ratio: var(--mobile-video-aspect, 9 / 16);
  }

  .video-stage video,
  .video-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
  }

  .video-stage.mobile-landscape video,
  .video-stage.mobile-landscape canvas,
  .video-stage.mobile-portrait video,
  .video-stage.mobile-portrait canvas {
    object-fit: contain;
  }

  .video-controls {
    max-width: 100%;
    gap: 6px;
    padding: 8px;
  }

  .video-stage .video-controls .seek-control {
    flex: 1 1 100%;
    min-width: 0;
  }

  .seek-control input[type="range"] {
    width: 100%;
    min-width: 0;
  }

  .control-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 60svh;
    margin-top: 0;
    padding: 0 0 calc(80px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    opacity: 1;
    transform: none;
  }

  .panel-collapsed .control-panel {
    display: none;
    width: 100%;
  }

  .toolbar,
  .control-panel .toolbar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .control-panel .panel-row {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .control-panel .panel-row .range-control {
    flex: 1 1 140px;
  }

  .control-panel .throw-row {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }

  .control-panel button,
  .control-panel .file-button,
  .control-panel .control {
    max-width: 100%;
  }

  .button-group {
    max-width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  html,
  body {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .app-header,
  .panel-toggle {
    display: none;
  }

  .app-layout,
  .panel-collapsed .app-layout {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .viewer {
    width: 100%;
    height: 100%;
  }

  .video-stage,
  .video-stage.mobile-landscape,
  .video-stage.mobile-portrait {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
    border-radius: 0;
    aspect-ratio: auto;
  }

  .video-stage video,
  .video-stage canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .control-panel,
  .panel-collapsed .control-panel {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    left: calc(8px + env(safe-area-inset-left));
    z-index: 7;
    display: block;
    width: auto;
    max-width: 42vw;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    opacity: 1;
    transform: none;
    pointer-events: none;
  }

  .control-panel .toolbar {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .control-panel .toolbar > * {
    display: none;
  }

  .control-panel .toolbar > .file-button {
    display: inline-flex;
    width: auto;
    min-height: 36px;
    padding: 6px 10px;
    pointer-events: auto;
  }

  .video-controls {
    padding-right: calc(8px + env(safe-area-inset-right));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    padding-left: calc(8px + env(safe-area-inset-left));
  }

  .video-stage .video-controls button,
  .video-stage .video-controls .control {
    min-height: 34px;
    padding: 5px 8px;
  }

  .app::after {
    content: "詳細設定は縦画面で操作できます";
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    z-index: 6;
    max-width: 48vw;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    text-align: right;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    pointer-events: none;
  }
}
*/

@media (max-width: 768px) and (orientation: portrait) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: auto;
    margin-bottom: 0;
    padding-bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app {
    display: flex;
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-width: 0;
    min-height: auto;
    flex-direction: column;
    margin-right: 0;
    margin-left: 0;
    padding:
      calc(env(safe-area-inset-top) + 5px)
      5px
      calc(4px + env(safe-area-inset-bottom));
    margin-bottom: 0;
    overflow-x: hidden;
    overflow-y: visible;
    transform: none;
  }

  .app-header,
  .panel-toggle {
    display: none;
  }

  .app-layout,
  .panel-collapsed .app-layout {
    display: flex;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 4px;
    margin-right: 0;
    margin-left: 0;
    transform: none;
  }

  .viewer {
    position: relative;
    top: auto;
    z-index: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    margin-right: 0;
    margin-left: 0;
    padding: 0;
    background: #111827;
    transform: none;
  }

  .video-stage,
  .video-stage.mobile-landscape {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: min(calc(100vw - 10px), var(--mobile-video-width, calc(100vw - 10px)));
    max-width: calc(100vw - 10px);
    min-width: 0;
    min-height: 0;
    height: var(--mobile-video-height, auto);
    max-height: 52dvh;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    aspect-ratio: var(--mobile-video-aspect, 16 / 9);
    overflow: hidden;
    transform: none;
  }

  .video-stage.mobile-portrait {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: min(100%, var(--mobile-video-width, var(--mobile-portrait-width, 100%)));
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    height: var(--mobile-video-height, auto);
    max-height: 52dvh;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    aspect-ratio: var(--mobile-video-aspect, 9 / 16);
  }

  .video-stage video,
  .video-stage canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
  }

  .video-stage video {
    object-fit: contain;
  }

  .viewer > .video-controls {
    position: static;
    width: 100%;
    display: grid;
    max-width: 100%;
    grid-template-columns: 44px max-content max-content minmax(0, 1fr);
    gap: 2px;
    margin-top: 2px;
    padding: 3px;
    transform: none;
  }

  .viewer > .video-controls button,
  .viewer > .video-controls .control {
    min-width: 0;
    min-height: 22px;
    padding: 1px 3px;
    font-size: 9px;
    line-height: 1.1;
  }

  .viewer > .video-controls #stopButton {
    display: none;
  }

  .viewer > .video-controls #playPauseButton {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
  }

  .viewer > .video-controls .button-group {
    display: flex;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 2px;
  }

  .viewer > .video-controls .speed-button {
    flex: 1 1 0;
    padding-right: 2px;
    padding-left: 2px;
  }

  .viewer > .video-controls .seek-control {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    min-height: 20px;
    gap: 4px;
    padding: 1px 4px;
    font-size: 9px;
  }

  .seek-control input[type="range"] {
    width: 100%;
    min-width: 0;
    height: 14px;
  }

  .control-panel,
  .panel-collapsed .control-panel {
    position: static;
    order: 2;
    display: flex;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    max-height: none;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .app-layout,
  .viewer,
  .video-stage,
  .control-panel,
  .control-panel .toolbar {
    margin-bottom: 0;
  }

  .control-panel *,
  .viewer > .video-controls * {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  .control-panel .toolbar {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 3px;
    padding: 5px;
  }

  .control-panel .toolbar > * {
    min-width: 0;
    max-width: 100%;
  }

  .control-panel .toolbar > .file-button,
  .control-panel .toolbar > .grid-row,
  .control-panel .toolbar > .wrist-row,
  .control-panel .toolbar > .drawing-row,
  .control-panel .toolbar > .display-row,
  .control-panel .toolbar > .delete-row {
    grid-column: 1 / -1;
  }

  .control-panel .toolbar > .checkbox-control,
  .control-panel .toolbar > #angleModeButton,
  .control-panel .toolbar > .throw-row {
    grid-column: span 1;
  }

  .control-panel .panel-row {
    max-width: 100%;
    flex-wrap: wrap;
    gap: 3px;
  }

  .control-panel .grid-row {
    flex-wrap: nowrap;
    min-height: 17px;
    padding: 1px 4px;
    border: 1px solid #d7dde3;
    border-radius: 6px;
    background: #ffffff;
  }

  .control-panel .grid-row .checkbox-control {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    white-space: nowrap;
  }

  .control-panel .grid-row .range-control {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
    border: 0;
    background: transparent;
  }

  .control-panel .grid-row .range-control input[type="range"] {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .control-panel .grid-row #gridSizeValue {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .control-panel .wrist-row {
    flex-wrap: nowrap;
  }

  .control-panel .wrist-row .control {
    min-width: 0;
    padding-right: 3px;
    padding-left: 3px;
  }

  .control-panel .panel-row .range-control {
    min-width: 0;
    flex: 1 1 140px;
  }

  .control-panel .throw-row {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .control-panel .throw-row .throw-button {
    padding-right: 0;
    padding-left: 0;
    font-size: 7px;
    white-space: nowrap;
    overflow: hidden;
  }

  .control-panel button,
  .control-panel .file-button,
  .control-panel .control {
    width: 100%;
    min-width: 0;
    min-height: 27px;
    max-width: 100%;
    padding: 2px 5px;
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .control-panel .checkbox-control {
    height: 16px;
    min-height: 16px;
    gap: 3px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 9px;
    line-height: 1;
  }

  .control-panel .checkbox-control input {
    width: 12px;
    height: 12px;
  }

  .control-panel .button-group {
    width: 100%;
    max-width: 100%;
    gap: 3px;
  }

  .control-panel .display-row {
    display: grid;
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .control-panel .display-row .display-toggle {
    width: 100%;
    min-width: 0;
    padding-right: 3px;
    padding-left: 3px;
  }

  .control-panel .file-button,
  .control-panel .grid-row .control,
  .control-panel .drawing-row > .control:not(.checkbox-control),
  .control-panel #lineModeButton,
  .control-panel .throw-row .throw-button,
  .control-panel .display-row .display-toggle {
    height: 15px;
    min-height: 15px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 8px;
    line-height: 1;
  }

  .control-panel .grid-row .checkbox-control input {
    width: 11px;
    height: 11px;
  }

  .control-panel .grid-row input[type="range"] {
    height: 10px;
  }

  .control-panel .drawing-row #penColor {
    width: 18px;
    height: 11px;
    min-width: 18px;
    max-width: 18px;
    padding: 0;
  }

  .control-panel .throw-row .throw-button {
    font-size: 7px;
    white-space: nowrap;
  }

  .control-panel .display-row .display-toggle[data-display="current"] {
    grid-column: 1 / -1;
    height: 15px;
    min-height: 15px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 8px;
    line-height: 1;
  }

  .control-panel #angleModeButton {
    height: 15px;
    min-height: 15px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 8px;
    line-height: 1;
  }

  .control-panel .delete-row {
    display: grid;
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .control-panel .delete-row button {
    width: 100%;
    min-width: 0;
    height: 24px;
    min-height: 24px;
    padding-right: 3px;
    padding-left: 3px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 9px;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .control-panel input[type="range"],
  .viewer > .video-controls input[type="range"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}
