* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

body.viewport-fullscreen {
  overflow: hidden;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.in-session .app {
  max-width: none;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "logo"
    "stage";
  column-gap: 0;
  row-gap: 14px;
  align-items: start;
  padding: 14px 18px 18px;
}

body.in-session #appLogo {
  grid-area: logo;
  margin: 0;
}

body.in-session #sessionPanel {
  display: contents;
}

body.in-session .room-header {
  grid-area: header;
  margin-top: 0;
  padding: 8px 10px;
  border: 1px solid rgba(71, 85, 105, 0.75);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.86));
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

body.in-session #activeRoomTitle {
  font-size: 1rem;
  font-weight: 700;
  color: #dbeafe;
  letter-spacing: 0.01em;
}

body.in-session #videoStage {
  grid-area: stage;
  justify-self: center;
  align-self: center;
}

body.in-session .participants-box {
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
}

body.in-session .participants-list {
  margin-top: 0;
  gap: 6px;
  font-size: 13px;
}

@media (max-width: 980px) {
  body.in-session .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "logo"
      "stage";
    align-items: stretch;
  }

  body.in-session #appLogo {
    white-space: normal;
  }
}

#appLogo {
  margin: 0 0 14px;
  cursor: pointer;
  user-select: none;
}

.tutorial-entry {
  margin: -4px 0 14px;
}

.tutorial-entry-panel {
  margin: 0 0 12px;
}

.tutorial-entry a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #93c5fd;
  text-decoration: none;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(30, 58, 138, 0.2);
  border-radius: 999px;
  padding: 6px 10px;
}

.tutorial-entry a:hover {
  background: rgba(37, 99, 235, 0.32);
  color: #bfdbfe;
}

#appLogo:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 5px;
  border-radius: 8px;
}


.subtitle {
  margin-top: 0;
  color: #94a3b8;
}



#sessionPanel label {
  display: grid;
  gap: 4px;
  font-size: 14px;
}

#sessionPanel input,
#sessionPanel button {
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  padding: 10px 12px;
}

#sessionPanel button {
  cursor: pointer;
  font-weight: 600;
}

#sessionPanel button:hover {
  background: #334155;
}

#sessionPanel button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: saturate(0.7);
}

.speed-btn {
  min-width: 38px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.hidden {
  display: none !important;
}

body.in-session .subtitle,
body.in-session #lobbyPanel {
  display: none;
}

#sessionPanel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.room-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

#shareRoomBtn {
  margin-left: 0;
}
#shareRoomBtn:hover {
  background: rgba(30, 41, 59, 0.8);
}

.participants-box {
  min-width: 0;
}

.participants-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #cbd5e1;
}

.participant-chip {
  padding: 4px 10px;
  border: 1px solid rgba(125, 211, 252, 0.55);
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.24);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.2;
}

.participant-chip-empty {
  border-color: rgba(100, 116, 139, 0.65);
  background: rgba(30, 41, 59, 0.5);
  color: #cbd5e1;
}

.controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
  white-space: nowrap;
}

.controls-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.controls-room-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 5px 8px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
}

.controls-room-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #bfdbfe;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls-participants-box {
  min-width: 0;
}

.controls-participants-list {
  gap: 4px;
  font-size: 10px;
  max-width: min(48vw, 360px);
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
}

.controls-participants-list .participant-chip {
  padding: 2px 7px;
  font-size: 10px;
  border-color: rgba(100, 116, 139, 0.55);
  background: rgba(30, 41, 59, 0.45);
}

.share-icon-btn {
  margin-left: 2px;
}

.room-back-btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #e2e8f0;
  border-color: rgba(100, 116, 139, 0.65);
  background: rgba(30, 41, 59, 0.78);
}

.room-back-btn:hover {
  background: rgba(51, 65, 85, 0.94);
  color: #f1f5f9;
}

.controls-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.playback-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
}

.playback-row .icon-btn {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  min-width: 42px;
  border-color: rgba(100, 116, 139, 0.65);
  background: rgba(30, 41, 59, 0.88);
}

.playback-row .play-pause-btn {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: rgba(147, 197, 253, 0.7);
  color: #fff;
  min-width: 52px;
}

.playback-row .play-pause-btn:hover {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.controls-meta {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-btn {
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(100, 116, 139, 0.65);
  color: #cbd5e1;
}

.meta-btn:hover {
  background: rgba(51, 65, 85, 0.94);
  color: #f1f5f9;
}

.meta-btn.active {
  background: rgba(37, 99, 235, 0.34);
  border-color: rgba(96, 165, 250, 0.72);
  color: #bfdbfe;
}

.controls-utility {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding-left: 8px;
  border-left: 1px solid rgba(71, 85, 105, 0.45);
}

.utility-icon-btn {
  flex: 0 0 auto;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  border-radius: 9px;
}

.record-icon-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  color: #fff;
  border-color: rgba(252, 165, 165, 0.72);
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.96), rgba(153, 27, 27, 0.96));
  box-shadow: 0 0 0 1px rgba(127, 29, 29, 0.5), 0 2px 8px rgba(220, 38, 38, 0.35);
}

.record-icon-btn:hover {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.98), rgba(185, 28, 28, 0.98));
  box-shadow: 0 0 0 1px rgba(127, 29, 29, 0.5), 0 3px 12px rgba(220, 38, 38, 0.5);
}

.record-icon-btn.staging {
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.82),
    0 0 12px rgba(251, 191, 36, 0.32);
}

.record-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.35);
}

.record-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}


#pinControlsBtn.utility-icon-btn {
  color: #cbd5e1;
  border-color: rgba(100, 116, 139, 0.65);
  background: rgba(30, 41, 59, 0.78);
  opacity: 0.6;
}

#pinControlsBtn.utility-icon-btn:hover {
  opacity: 1;
  background: rgba(51, 65, 85, 0.94);
}

#pinControlsBtn.utility-icon-btn.active {
  opacity: 1;
  border-color: rgba(96, 165, 250, 0.72);
  background: rgba(30, 64, 175, 0.42);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.18), 0 0 8px rgba(59, 130, 246, 0.28);
}

#toggleControlsBtn.utility-icon-btn {
  color: #cbd5e1;
  border-color: rgba(100, 116, 139, 0.65);
  background: rgba(30, 41, 59, 0.78);
}

#toggleControlsBtn.utility-icon-btn:hover {
  color: #f1f5f9;
  background: rgba(51, 65, 85, 0.94);
}

#toggleControlsBtn.utility-icon-btn.show-state {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.62);
  background: rgba(30, 64, 175, 0.3);
}

.draw-controls-group button.active {
  background: rgba(14, 165, 233, 0.38);
  border-color: rgba(125, 211, 252, 0.8);
  color: #e0f2fe;
  box-shadow: inset 0 0 0 1px rgba(224, 242, 254, 0.2);
}

.tools-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding-top: 0;
  border-top: none;
  padding-left: 10px;
  border-left: 1px solid rgba(71, 85, 105, 0.35);
  flex: 0 0 auto;
}

.controls .control-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.controls .draw-controls-group {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  padding-left: 10px;
  border-left: 1px solid rgba(71, 85, 105, 0.35);
}

.controls .draw-controls-group button {
  padding: 5px 8px;
  font-size: 12px;
}

.color-dot-field {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #64748b;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
  flex-shrink: 0;
}

.color-dot-preview {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff3b30;
  pointer-events: none;
  transition:
    width 80ms linear,
    height 80ms linear,
    background-color 80ms linear;
}

.color-dot-field input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  opacity: 0;
  cursor: pointer;
}

.color-dot-field:focus-within {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.35);
}

.size-field {
  display: flex;
  align-items: center;
}

.size-field input[type="range"] {
  width: 76px;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #334155;
  outline: none;
  cursor: pointer;
}

.size-field input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: #334155;
}

.size-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid #0ea5e9;
  cursor: pointer;
  margin-top: -5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.size-field input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: #334155;
}

.size-field input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid #0ea5e9;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.controls .moment-controls-group {
  border: none;
  border-radius: 0;
  padding: 0;
  padding-left: 10px;
  border-left: 1px solid rgba(71, 85, 105, 0.35);
  margin-left: 0;
  background: transparent;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.moment-add-btn {
  padding: 5px 10px;
  font-size: 12px;
  background: rgba(250, 204, 21, 0.22);
  border: 1px solid rgba(250, 204, 21, 0.7);
  color: #fef08a;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.12), 0 2px 6px rgba(250, 204, 21, 0.12);
}

.moment-add-btn:hover {
  background: rgba(250, 204, 21, 0.34);
  border-color: rgba(250, 204, 21, 0.88);
  color: #fef9c3;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.2), 0 2px 8px rgba(250, 204, 21, 0.22);
}

.moment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  max-width: 220px;
  overflow-x: auto;
  overflow-y: hidden;
}

.moment-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.5);
  border-radius: 6px;
  padding: 1px 4px 1px 6px;
}

.moment-jump-btn {
  background: transparent;
  border: none;
  color: #fde047;
  font-size: 11px;
  padding: 1px 3px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.moment-jump-btn:hover {
  color: #fef08a;
  text-decoration: underline;
}

.moment-delete-btn {
  background: rgba(239, 68, 68, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 4px;
  color: #fca5a5;
  font-size: 10px;
  padding: 1px 4px;
  cursor: pointer;
  line-height: 1;
}

.moment-delete-btn:hover {
  background: rgba(239, 68, 68, 0.5);
  color: #fee2e2;
}

.controls .playback-controls-group {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.35);
}

.controls .recording-controls-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 9px;
  background: transparent;
  box-shadow: none;
  min-height: 32px;
}

.controls .recording-controls-group.active {
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.24), rgba(69, 10, 10, 0.24));
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.14);
}

.begin-recording-btn {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff1f2;
  border: 1px solid rgba(254, 202, 202, 0.6);
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.95), rgba(159, 18, 57, 0.95));
}

.begin-recording-btn:hover {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.98), rgba(190, 24, 93, 0.98));
}

.mic-staging-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mic-level-track {
  width: 120px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(15, 23, 42, 0.9);
}

.mic-level-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #f59e0b 70%, #ef4444 100%);
  transition: width 120ms linear;
}

.mic-level-text {
  font-size: 12px;
  color: #cbd5e1;
  min-width: 64px;
}

.recording-status {
  font-size: 11px;
  color: #fecaca;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.recording-download-link {
  font-size: 13px;
  color: #38bdf8;
}

.recording-download-link.hidden {
  display: none;
}

.small {
  width: 120px;
}

.controls .control-field {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.controls .field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  white-space: nowrap;
}

.controls .control-field input {
  margin: 0;
}

.controls .control-field select {
  margin: 0;
  border: 1px solid rgba(100, 116, 139, 0.8);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  padding: 5px 8px;
  min-height: 30px;
}

.controls .control-field-color input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  cursor: pointer;
}

.controls .control-field-color input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.controls .control-field-color input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 5px;
}

.controls .control-field input[type="range"] {
  width: 96px;
  padding: 0;
}

@media (max-width: 980px) {
  .controls-header {
    gap: 8px;
  }

  .controls-room-meta {
    flex-basis: 100%;
    order: 1;
  }

  .playback-row {
    order: 2;
    width: 100%;
    overflow-x: auto;
  }

  .controls-utility {
    order: 3;
    margin-left: 0;
    border-left: none;
    padding-left: 0;
  }

  .tools-row {
    border-left: none;
    padding-left: 0;
  }
}


#videoStage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  min-height: 0;
  margin: 0 auto;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.controls-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(71, 85, 105, 0.62);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(6px);
  z-index: 45;
  transition: opacity 180ms ease, transform 180ms ease;
}

#videoStage.controls-hidden .controls-overlay {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

#controlsWakeZone {
  position: absolute;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  background: transparent;
}

#videoStage.controls-hidden:not(.controls-manually-hidden) #controlsWakeZone {
  pointer-events: auto;
}

#controlsFab {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 46;
  display: none;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(100, 116, 139, 0.9);
}

#videoStage.controls-hidden.controls-manually-hidden #controlsFab {
  display: inline-flex;
}

#videoStage:fullscreen {
  width: min(100vw, calc(100vh * 16 / 9));
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

body.viewport-fullscreen #sessionPanel {
  position: fixed;
  inset: 0;
  z-index: 999;
  margin: 0;
  padding: 0;
  background: #000;
  display: grid;
  place-items: center;
}

body.viewport-fullscreen .room-header {
  display: none;
}

body.viewport-fullscreen #videoStage {
  width: min(100vw, calc(100vh * 16 / 9));
  border-radius: 0;
}

#player,
#drawCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#drawCanvas {
  z-index: 20;
  touch-action: none;
  pointer-events: none;
  cursor: default;
}

.webcam-preview {
  position: fixed;
  right: auto;
  bottom: auto;
  left: 0;
  top: 0;
  width: 210px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.65);
  background: rgba(2, 6, 23, 0.9);
  z-index: 120;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.5);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.webcam-preview.dragging {
  cursor: grabbing;
}

.webcam-preview-hint {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  font-size: 11px;
  line-height: 1;
  color: #e2e8f0;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.5);
  pointer-events: none;
}

#webcamPreview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}

.webcam-resize-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 28px;
  height: 28px;
  z-index: 3;
  cursor: nwse-resize;
  border-radius: 8px;
  border: 2px solid rgba(226, 232, 240, 0.95);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.webcam-move-handle {
  position: absolute;
  right: 36px;
  bottom: 4px;
  width: 28px;
  height: 28px;
  z-index: 3;
  cursor: move;
  border-radius: 8px;
  border: 2px solid rgba(226, 232, 240, 0.95);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.webcam-move-handle::before {
  content: "✥";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1;
}

.webcam-resize-handle::before {
  content: "⤡";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f8fafc;
  font-size: 16px;
  line-height: 1;
}

#drawCursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background: rgba(255, 59, 48, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transform: translate(-9999px, -9999px);
  will-change: transform;
}

.timeline-hud {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 44;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.7);
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.timeline-hud.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.timeline-track {
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.34);
  overflow: hidden;
}

.timeline-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8 0%, #f472b6 100%);
  transition: width 120ms linear;
}

.timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid #0ea5e9;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.timeline-label {
  font-size: 12px;
  color: #dbeafe;
  text-align: right;
  letter-spacing: 0.01em;
}

#videoStage.draw-enabled #drawCanvas {
  pointer-events: auto;
  cursor: none;
}

#videoStage.draw-enabled #drawCursor {
  display: block;
}

#drawModeBtn.active {
  background: #0ea5e9;
  border-color: #0284c7;
  color: #00111f;
}


