:root {
  color-scheme: dark;
  --bg: #070b12;
  --bg-soft: #0d1420;
  --panel: #101827;
  --panel-strong: #151f31;
  --line: rgba(183, 198, 226, 0.16);
  --line-strong: rgba(183, 198, 226, 0.28);
  --text: #f4f7fb;
  --muted: #9ca9bd;
  --soft: #c3cedd;
  --accent: #6ee7c8;
  --accent-2: #7aa7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --topbar-h: 68px;
  --timeline-h: 246px;
  --panel-w: 340px;
  --timeline-inner-width: 100%;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: radial-gradient(circle at top left, rgba(110, 231, 200, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(122, 167, 255, 0.18), transparent 36%), var(--bg);
  color: var(--text);
  overflow: hidden;
}

button,
input,
textarea,
select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

button,
.file-picker {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
  border-radius: 999px;
  min-height: 42px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

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

button:focus-visible,
.file-picker:focus-visible,
.track-lane:focus-visible {
  outline: 2px solid rgba(110, 231, 200, 0.82);
  outline-offset: 2px;
}

.app-shell {
  width: 100vw;
  height: 100dvh;
  padding: calc(10px + var(--safe-top)) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--timeline-h);
  gap: 10px;
}

.topbar,
.viewer-zone,
.context-panel,
.timeline-zone {
  border: 1px solid var(--line);
  background: rgba(13, 20, 32, 0.78);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  min-width: 0;
  min-height: 0;
}

.topbar {
  min-height: var(--topbar-h);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  border-radius: 12px;
  flex: 0 0 auto;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

.brand-copy { display: grid; line-height: 1.08; }
.brand-copy strong { font-size: 1.08rem; letter-spacing: -0.04em; }
.brand-copy span { color: var(--muted); font-size: 0.76rem; }

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-actions::-webkit-scrollbar { display: none; }

.top-button {
  min-width: max-content;
  padding: 0 18px;
  font-weight: 750;
}

.top-button.is-active {
  color: var(--text);
  border-color: rgba(110, 231, 200, 0.62);
  background: rgba(110, 231, 200, 0.15);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  gap: 10px;
}

.viewer-zone,
.context-panel,
.timeline-zone { border-radius: var(--radius-xl); }

.viewer-zone {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
}

.viewer-head,
.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1,
h2 {
  margin-bottom: 0;
  letter-spacing: -0.04em;
}

h1 { font-size: clamp(1.25rem, 2.4vw, 2.4rem); }
h2 { font-size: clamp(1.05rem, 1.7vw, 1.45rem); }

.viewer-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.viewer-badges span,
.timeline-meta,
.track-lane span,
.tool-grid span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.052);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.viewer-frame {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(135deg, #0b1020, #141b2b 52%, #071016);
  border: 1px solid rgba(255, 255, 255, 0.085);
  display: grid;
  place-items: center;
  isolation: isolate;
}

.viewer-grid {
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.preview-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #02050a;
}

.viewer-frame.has-video .preview-video { display: block; }
.viewer-frame.has-video .viewer-placeholder,
.viewer-frame.has-video .viewer-grid { display: none; }

.viewer-placeholder {
  position: relative;
  z-index: 1;
  width: min(520px, 86%);
  max-height: 100%;
  overflow: hidden;
  text-align: center;
  color: var(--soft);
}

.placeholder-mark {
  width: clamp(58px, 8vh, 82px);
  height: clamp(58px, 8vh, 82px);
  margin: 0 auto 16px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #071016;
  font-weight: 900;
  letter-spacing: -0.08em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.viewer-placeholder h2 { color: var(--text); margin-bottom: 8px; }
.viewer-placeholder p { color: var(--muted); line-height: 1.5; margin-bottom: 0; }

.safe-frame {
  position: absolute;
  z-index: 2;
  inset: 7%;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  pointer-events: none;
}

.transport {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.transport::-webkit-scrollbar { display: none; }
.transport-button { min-width: 44px; padding: 0 12px; }
.transport-button.primary {
  border-color: rgba(110, 231, 200, 0.4);
  background: rgba(110, 231, 200, 0.16);
  color: var(--text);
}

.step-button {
  min-width: 54px;
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.transport-button.primary.is-playing {
  border-color: rgba(122, 167, 255, 0.58);
  background: rgba(122, 167, 255, 0.18);
}

.timecode {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.context-panel { padding: 14px; overflow: hidden; }
.panel-card { display: none; height: 100%; overflow: auto; padding-right: 2px; }
.panel-card.is-visible { display: block; }
.panel-card p { color: var(--muted); line-height: 1.55; }

.status-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.status-list div,
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

dt,
.setting-row span { color: var(--muted); }
dd,
.setting-row strong { margin: 0; color: var(--text); text-align: right; }

.file-picker {
  width: 100%;
  min-height: 78px;
  border: 1px solid rgba(110, 231, 200, 0.45);
  background: rgba(110, 231, 200, 0.12);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: grid;
  gap: 5px;
  cursor: pointer;
}
.file-picker span { font-weight: 800; }
.file-picker small { color: var(--muted); line-height: 1.35; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.status-list.compact { margin-top: 12px; }
.status-list.compact dd { max-width: 58%; overflow-wrap: anywhere; }
.tool-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.timeline-zone {
  padding: 12px 14px 14px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.timeline-header h2 { margin: 0; }

.timeline-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0 12px;
  font-size: 1rem;
  font-weight: 850;
}

.timeline-meta {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(183, 198, 226, 0.3) transparent;
  padding-bottom: 2px;
}

.timeline-content {
  width: var(--timeline-inner-width);
  min-width: 100%;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr);
  gap: 8px;
}

.timeline-ruler {
  display: flex;
  height: 24px;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  padding-left: 96px;
}

.timeline-tick {
  position: relative;
  flex: 0 0 var(--tick-width, 120px);
  border-left: 1px solid var(--line);
  padding-left: 6px;
  white-space: nowrap;
}

.timeline-tick:last-child { flex-basis: 0; }

.tracks {
  min-height: 0;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.track {
  min-height: 36px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.track strong {
  display: flex;
  align-items: center;
  color: var(--soft);
  font-size: 0.82rem;
}

.track-lane {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(110, 231, 200, 0.05));
  overflow: hidden;
  min-height: 36px;
}

.track-lane::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255, 255, 255, 0.07) 60px);
  pointer-events: none;
}

.track-lane span {
  position: absolute;
  z-index: 4;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  max-width: calc(100% - 56px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-lane.has-clip {
  border-color: rgba(110, 231, 200, 0.42);
  background: linear-gradient(90deg, rgba(110, 231, 200, 0.07), rgba(122, 167, 255, 0.06));
}

.clip-block {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 0%;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(110, 231, 200, 0.34), rgba(122, 167, 255, 0.27));
  border: 1px solid rgba(110, 231, 200, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0;
}

.video-lane.has-clip .clip-block {
  opacity: 1;
  width: 100%;
}

.timeline-scrubber {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.timeline-scrubber:disabled { cursor: not-allowed; }

.playhead {
  position: absolute;
  z-index: 6;
  top: -4px;
  bottom: -4px;
  left: 0%;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(110, 231, 200, 0.72);
  opacity: 0;
  pointer-events: none;
}

.playhead span {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 13px;
  height: 13px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(110, 231, 200, 0.65);
}
.video-lane.has-clip .playhead { opacity: 1; }

.noscript {
  position: fixed;
  inset: auto 12px 12px;
  z-index: 20;
  border-radius: 14px;
  padding: 12px;
  background: #171d2a;
  color: #fff;
}

@media (orientation: landscape) and (min-width: 881px) and (max-height: 980px) {
  :root {
    --topbar-h: 58px;
    --timeline-h: clamp(196px, 26vh, 232px);
    --panel-w: 330px;
  }

  .app-shell {
    gap: 8px;
    padding: calc(8px + var(--safe-top)) calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left));
  }

  .topbar { padding: 8px 10px; }
  .top-button,
  .transport-button { min-height: 38px; }
  .viewer-zone,
  .context-panel { padding: 12px; }
  .viewer-head h1 { font-size: clamp(1.1rem, 2vw, 1.7rem); }
  .viewer-placeholder p { display: none; }
  .safe-frame { inset: 8%; }
  .timeline-zone { padding: 10px 12px 12px; gap: 8px; }
  .track { min-height: 32px; }
  .track-lane { min-height: 32px; }
}

@media (max-width: 880px) {
  :root {
    --topbar-h: auto;
    --timeline-h: 232px;
  }

  html,
  body { overflow: auto; }

  .app-shell {
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    grid-template-rows: auto auto auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .top-actions { width: 100%; }
  .workspace { grid-template-columns: 1fr; }
  .context-panel { min-height: 220px; }
  .viewer-frame { min-height: 260px; height: min(56vh, 420px); }
  .timeline-zone { min-height: var(--timeline-h); }
}

@media (max-width: 560px) {
  .app-shell {
    padding: calc(8px + var(--safe-top)) calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left));
  }

  .viewer-head,
  .timeline-header { flex-direction: column; }
  .viewer-badges { justify-content: flex-start; }
  .track { grid-template-columns: 72px minmax(0, 1fr); }
  .timeline-ruler { padding-left: 80px; }
  .timecode { width: 100%; margin-left: 0; }
}


/* RingoCut v0.4 — compact iPad/PWA layout, iOS double-tap zoom guard and initial object layer */
html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body,
.app-shell,
.topbar,
.viewer-zone,
.context-panel,
.timeline-zone,
.viewer-frame,
.transport,
.timeline-scroll,
.track-lane {
  touch-action: manipulation;
}

:root {
  --topbar-h: 52px;
  --timeline-h: clamp(164px, 22vh, 190px);
  --panel-w: clamp(248px, 25vw, 300px);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

.app-shell {
  padding: calc(6px + var(--safe-top)) calc(6px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(6px + var(--safe-left));
  gap: 7px;
}

.topbar {
  min-height: var(--topbar-h);
  padding: 6px 8px;
}

.brand { gap: 7px; }
.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}
.brand-copy strong { font-size: 0.98rem; }
.brand-copy span { font-size: 0.68rem; }

.top-actions { gap: 6px; }
.top-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.86rem;
}

.workspace {
  gap: 7px;
}

.viewer-zone {
  padding: 9px;
  gap: 7px;
}

.viewer-head {
  align-items: center;
}

.viewer-head h1 {
  font-size: clamp(1rem, 1.75vw, 1.5rem);
}

.eyebrow {
  margin-bottom: 2px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.viewer-badges span,
.timeline-meta,
.track-lane span,
.tool-grid span {
  padding: 5px 8px;
  font-size: 0.68rem;
}

.viewer-frame {
  border-radius: 18px;
}

.safe-frame {
  inset: 6%;
  border-radius: 14px;
}

.viewer-placeholder {
  width: min(460px, 82%);
}

.placeholder-mark {
  width: clamp(50px, 7vh, 68px);
  height: clamp(50px, 7vh, 68px);
  margin-bottom: 10px;
  border-radius: 18px;
}

.viewer-placeholder h2 {
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  margin-bottom: 5px;
}

.viewer-placeholder p {
  font-size: 0.82rem;
  line-height: 1.35;
}

.transport {
  min-height: 36px;
  gap: 6px;
}

.transport-button {
  min-width: 36px;
  min-height: 36px;
  padding: 0 9px;
  font-size: 0.82rem;
}

.timecode {
  font-size: 0.82rem;
}

.context-panel {
  padding: 10px;
}

.panel-card p {
  font-size: 0.82rem;
  line-height: 1.38;
}

.panel-card h2 {
  font-size: 1.03rem;
}

.status-list {
  gap: 7px;
  margin-top: 10px;
}

.status-list div,
.setting-row {
  padding: 9px 10px;
  font-size: 0.78rem;
}

.file-picker {
  min-height: 62px;
  padding: 10px;
  gap: 3px;
  font-size: 0.82rem;
}

.file-picker small {
  font-size: 0.72rem;
}

.timeline-zone {
  padding: 8px 10px 9px;
  gap: 6px;
}

.timeline-header {
  align-items: center;
}

.timeline-header h2 {
  font-size: 1rem;
}

.timeline-controls {
  gap: 5px;
}

.timeline-button {
  min-width: 32px;
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.9rem;
}

.timeline-meta {
  min-height: 32px;
}

.timeline-content {
  grid-template-rows: 18px minmax(0, 1fr);
  gap: 5px;
}

.timeline-ruler {
  height: 18px;
  padding-left: 74px;
  font-size: 0.64rem;
}

.timeline-tick {
  padding-left: 5px;
}

.tracks {
  gap: 5px;
}

.track {
  min-height: 30px;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 6px;
}

.track strong {
  position: sticky;
  left: 0;
  z-index: 8;
  min-width: 70px;
  padding-right: 4px;
  background: linear-gradient(90deg, rgba(13, 20, 32, 0.96), rgba(13, 20, 32, 0.68));
  font-size: 0.72rem;
}

.track-lane {
  min-height: 30px;
  border-radius: 12px;
}

.track-lane::before {
  background-image: repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(255, 255, 255, 0.055) 48px);
}

.track-lane span {
  left: 8px;
  padding: 3px 7px;
}

.clip-block {
  top: 4px;
  bottom: 4px;
  border-radius: 10px;
}

.playhead {
  top: -3px;
  bottom: -3px;
  width: 2px;
}

.playhead span {
  top: -6px;
  width: 11px;
  height: 11px;
}

@media (orientation: landscape) and (min-width: 881px) and (max-height: 980px) {
  :root {
    --topbar-h: 48px;
    --timeline-h: clamp(150px, 21vh, 174px);
    --panel-w: clamp(238px, 24vw, 286px);
  }

  .app-shell {
    gap: 6px;
    padding: calc(5px + var(--safe-top)) calc(5px + var(--safe-right)) calc(5px + var(--safe-bottom)) calc(5px + var(--safe-left));
  }

  .topbar { padding: 5px 7px; }
  .top-button { min-height: 34px; padding: 0 12px; }
  .viewer-zone { padding: 8px; gap: 6px; }
  .context-panel { padding: 9px; }
  .transport { min-height: 34px; }
  .transport-button { min-width: 34px; min-height: 34px; }
  .timeline-zone { padding: 7px 9px 8px; }
  .track { min-height: 28px; }
  .track-lane { min-height: 28px; }
}

@media (max-width: 880px) {
  :root {
    --timeline-h: 190px;
  }

  .viewer-frame {
    min-height: 220px;
    height: min(58vh, 420px);
  }
}

@media (max-width: 560px) {
  .track { grid-template-columns: 58px minmax(0, 1fr); }
  .timeline-ruler { padding-left: 62px; }
  .track strong { min-width: 58px; font-size: 0.66rem; }
  .top-button { padding: 0 11px; }
}


/* RingoCut v0.7 — initial visual object engine and basic object editing */
.object-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: auto;
}

.object-layer.is-drawing {
  pointer-events: auto;
  cursor: crosshair;
}

.visual-object {
  position: absolute;
  transform: translate(-50%, -50%);
  color: var(--accent);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  touch-action: none;
}

.visual-object.live-stroke {
  pointer-events: none;
}

.visual-object.is-selected {
  outline: 2px solid rgba(110, 231, 200, 0.95);
  outline-offset: 5px;
}

.visual-object[data-type="text"] {
  max-width: 72%;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(7, 11, 18, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 850;
  font-size: clamp(1rem, 2.4vw, 2rem);
  line-height: 1.12;
}

.visual-object[data-type="pointer"] {
  width: 0;
  height: 0;
  transform: translate(-50%, -50%) rotate(-38deg);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.75));
}

.visual-object[data-type="pointer"]::before {
  content: "";
  display: block;
  width: clamp(46px, 8vw, 92px);
  height: clamp(12px, 2vw, 24px);
  background: var(--object-color, #ff3b5f);
  border-radius: 999px;
}

.visual-object[data-type="pointer"]::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-top: clamp(13px, 2vw, 24px) solid transparent;
  border-bottom: clamp(13px, 2vw, 24px) solid transparent;
  border-left: clamp(22px, 3.4vw, 42px) solid var(--object-color, #ff3b5f);
}

.visual-object[data-type="draw"] {
  pointer-events: none;
  transform: none;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.visual-object svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.visual-object[data-type="draw"] svg {
  pointer-events: none;
}

.tool-actions {
  align-items: stretch;
}

.tool-button {
  border-radius: 14px;
  min-height: 42px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 850;
}

.tool-button.is-active {
  color: var(--text);
  border-color: rgba(110, 231, 200, 0.62);
  background: rgba(110, 231, 200, 0.16);
}

.tool-hint {
  margin-top: 10px;
  font-size: 0.78rem;
}

.object-clip {
  position: absolute;
  z-index: 3;
  top: 4px;
  bottom: 4px;
  min-width: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 59, 95, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.text-clip {
  background: rgba(110, 231, 200, 0.32);
}

.objects-lane.has-objects,
.text-lane.has-objects {
  border-color: rgba(110, 231, 200, 0.28);
}

.viewer-frame.is-tool-armed {
  border-color: rgba(110, 231, 200, 0.44);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 200, 0.12), var(--shadow);
}


/* RingoCut v0.7 — basic object editor */
.object-editor {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.52);
}

.object-editor.is-visible { display: grid; gap: 9px; }
.object-editor h3 { margin: 0; font-size: 0.92rem; }
.object-editor p { margin: 0; font-size: 0.76rem; color: var(--muted); }

.editor-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--muted);
}

.editor-row input[type="number"] {
  width: 100%;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(2, 6, 23, 0.58);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-weight: 800;
}

.editor-row input[type="color"] {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.58);
  padding: 4px;
}

.editor-row input[type="range"] { width: 100%; }

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  font-size: 0.76rem;
  color: var(--muted);
}

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


.danger-button {
  min-height: 38px;
  border: 1px solid rgba(255, 91, 91, 0.4);
  border-radius: 14px;
  background: rgba(255, 91, 91, 0.12);
  color: #ffd5d5;
  font-weight: 900;
}

.danger-button:disabled { opacity: 0.45; }

.object-clip { cursor: pointer; }
.object-clip.is-selected {
  border-color: rgba(110, 231, 200, 0.92);
  box-shadow: 0 0 0 2px rgba(110, 231, 200, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* RingoCut v0.7 — privacy, magnifier, freeze, ruler and timer objects */
.fx-lane.has-objects {
  border-color: rgba(122, 167, 255, 0.34);
}

.fx-clip {
  background: rgba(122, 167, 255, 0.30);
}

.visual-rect-object {
  transform: translate(-50%, -50%);
  min-width: 42px;
  min-height: 34px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: clamp(0.62rem, 1vw, 0.82rem);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.visual-rect-object[data-type="blur"] {
  background: rgba(5, 8, 18, 0.28);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
}

.visual-rect-object[data-type="pixel"] {
  background-color: rgba(5, 8, 18, 0.44);
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.20) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.16) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.14) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  image-rendering: pixelated;
}

.visual-rect-object[data-type="cover"] {
  background: var(--object-color, #050816);
  border-color: rgba(255, 255, 255, 0.16);
}

.visual-rect-object[data-type="magnifier"] {
  border-radius: 999px;
  border-color: rgba(110, 231, 200, 0.72);
  background: rgba(110, 231, 200, 0.10);
  -webkit-backdrop-filter: brightness(1.22) contrast(1.15) saturate(1.2);
  backdrop-filter: brightness(1.22) contrast(1.15) saturate(1.2);
}

.magnifier-video {
  position: absolute;
  width: 200%;
  height: 200%;
  object-fit: contain;
  transform: scale(1.45);
  transform-origin: center;
  opacity: 0.92;
  pointer-events: none;
}

.visual-rect-object[data-type="freeze"] {
  background: rgba(15, 23, 42, 0.68);
  border-color: rgba(122, 167, 255, 0.72);
}

.visual-rect-object[data-type="freeze"] img {
  position: absolute;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.visual-ruler {
  height: 28px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(5, 8, 18, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--object-color, #6ee7c8);
}

.visual-ruler span {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--object-color, #6ee7c8);
  box-shadow: 0 0 12px rgba(110, 231, 200, 0.52);
}

.visual-ruler::before,
.visual-ruler::after {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 999px;
  background: var(--object-color, #6ee7c8);
}

.visual-ruler::before { left: 8px; }
.visual-ruler::after { right: 8px; }

.visual-ruler strong {
  position: relative;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(5, 8, 18, 0.78);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.visual-timer {
  min-width: 112px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(5, 8, 18, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 950;
  font-size: clamp(1rem, 2.1vw, 1.8rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

@media (orientation: landscape) and (min-width: 881px) and (max-height: 980px) {
  .tool-grid {
    gap: 6px;
  }

  .tool-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.72rem;
  }
}

/* RingoCut v0.7 — edición mejorada de objetos */
.visual-object {
  touch-action: none;
  user-select: none;
}

.visual-object[data-type="pointer"]::before {
  transform: translate(-50%, -50%) scale(var(--object-size, 1));
  transform-origin: center;
}

.visual-object[data-type="pointer"]::after {
  transform: translate(-50%, -50%) scale(var(--object-size, 1));
  transform-origin: center;
}

.resize-handle {
  position: absolute;
  z-index: 12;
  right: -10px;
  bottom: -10px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(7, 11, 18, 0.88);
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  cursor: nwse-resize;
  touch-action: none;
}

.resize-handle::before,
.resize-handle::after {
  content: "";
  position: absolute;
  background: rgba(7, 11, 18, 0.78);
  border-radius: 999px;
}

.resize-handle::before {
  left: 6px;
  right: 6px;
  top: 10px;
  height: 2px;
}

.resize-handle::after {
  top: 6px;
  bottom: 6px;
  left: 10px;
  width: 2px;
}

.visual-object[data-type="draw"] .resize-handle {
  right: 4px;
  bottom: 4px;
}

.object-editor {
  max-height: none;
}

.editor-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.editor-row select,
.editor-row input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  border-radius: 11px;
  padding: 8px 9px;
  outline: none;
}

.editor-row select:focus,
.editor-row input[type="text"]:focus,
.editor-row input[type="number"]:focus {
  border-color: rgba(110, 231, 200, 0.62);
}

.editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.secondary-button {
  border-color: rgba(122, 167, 255, 0.42);
  background: rgba(122, 167, 255, 0.12);
  color: var(--text);
  min-height: 38px;
  border-radius: 14px;
  font-weight: 800;
}

.danger-button {
  min-height: 38px;
  border-radius: 14px;
}

.object-clip.is-selected {
  box-shadow: 0 0 0 2px rgba(110, 231, 200, 0.85), 0 0 24px rgba(110, 231, 200, 0.28);
}

.object-clip::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 50%;
  width: 4px;
  height: 16px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0.72;
}

@media (max-width: 880px) {
  .editor-grid-two,
  .editor-actions {
    grid-template-columns: 1fr;
  }
}

/* RingoCut v0.10 — exportación con audio experimental */
.export-box {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.32);
}

.export-button {
  width: 100%;
  min-height: 40px;
  margin: 6px 0 8px;
  border-color: rgba(110, 231, 200, 0.46);
  background: rgba(110, 231, 200, 0.16);
  color: var(--text);
  font-weight: 950;
}

.download-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(122, 167, 255, 0.44);
  background: rgba(122, 167, 255, 0.14);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 950;
  text-decoration: none;
}

.download-link[hidden] { display: none; }

/* RingoCut v0.12 — voz en off y audio adicional local */
.voice-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.voice-controls .secondary { grid-column: 1 / -1; }

.voice-button {
  min-height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(110, 231, 200, 0.36);
  background: rgba(110, 231, 200, 0.12);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 950;
}

.voice-button.secondary {
  border-color: rgba(122, 167, 255, 0.36);
  background: rgba(122, 167, 255, 0.12);
}

.voice-button.danger {
  border-color: rgba(255, 74, 106, 0.42);
  background: rgba(255, 74, 106, 0.13);
}

.voice-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-lane.has-voice {
  border-color: rgba(186, 230, 253, 0.42);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.08), rgba(122, 167, 255, 0.08));
}

.voice-clip {
  position: absolute;
  z-index: 3;
  top: 5px;
  bottom: 5px;
  min-width: 20px;
  border-radius: 12px;
  border: 1px solid rgba(186, 230, 253, 0.48);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.32), rgba(122, 167, 255, 0.27));
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.voice-clip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* RingoCut v0.11 — proyectos .ringocut locales */
.project-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 8px;
}

.project-button {
  min-height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(110, 231, 200, 0.36);
  background: rgba(110, 231, 200, 0.12);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

.project-button.import-project {
  border-color: rgba(122, 167, 255, 0.36);
  background: rgba(122, 167, 255, 0.12);
}

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

@media (max-width: 560px) {
  .project-actions { grid-template-columns: 1fr; }
}


/* RingoCut v0.12 — audio adicional básico */
.audio-picker {
  border-color: rgba(250, 204, 21, 0.32);
  background: rgba(250, 204, 21, 0.08);
}

.audio-lane.has-audio {
  border-color: rgba(250, 204, 21, 0.42);
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.08), rgba(251, 146, 60, 0.08));
}

.audio-clip {
  position: absolute;
  z-index: 3;
  top: 5px;
  bottom: 5px;
  min-width: 20px;
  border-radius: 12px;
  border: 1px solid rgba(250, 204, 21, 0.52);
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.32), rgba(251, 146, 60, 0.27));
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.audio-clip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* RingoCut v0.13.1 — UI/UX profesional compacta.
   Referencia estructural: editor profesional de vídeo en iPad.
   Diseño propio: no copia literal de ninguna app. */
:root {
  --bg: #05070b;
  --bg-soft: #080d14;
  --panel: rgba(11, 16, 25, 0.92);
  --panel-strong: rgba(16, 23, 36, 0.96);
  --line: rgba(210, 220, 238, 0.105);
  --line-strong: rgba(210, 220, 238, 0.22);
  --text: #f5f7fb;
  --muted: #8d9aad;
  --soft: #cbd4e2;
  --accent: #55e6c1;
  --accent-2: #8ea7ff;
  --warning: #ffd166;
  --danger: #ff6b7a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --topbar-h: 46px;
  --timeline-h: clamp(188px, 25vh, 240px);
  --panel-w: clamp(300px, 27vw, 370px);
}

html,
body {
  background: linear-gradient(180deg, #060911 0%, #030507 100%);
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

.app-shell {
  padding: calc(5px + var(--safe-top)) calc(5px + var(--safe-right)) calc(5px + var(--safe-bottom)) calc(5px + var(--safe-left));
  gap: 5px;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--timeline-h);
}

.topbar,
.viewer-zone,
.context-panel,
.timeline-zone {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(255,255,255,0.035) inset, var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  min-height: var(--topbar-h);
  padding: 5px 7px;
  border-radius: 14px;
  gap: 8px;
}

.brand {
  min-width: 130px;
  gap: 8px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: none;
}

.brand-copy strong {
  font-size: 0.92rem;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.brand-copy span {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions {
  flex: 1;
  justify-content: flex-end;
  gap: 5px;
  padding: 1px;
}

.top-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-button:hover:not(:disabled) {
  background: rgba(255,255,255,0.055);
  color: var(--soft);
}

.top-button.is-active {
  color: var(--text);
  border-color: rgba(85,230,193,0.32);
  background: linear-gradient(180deg, rgba(85,230,193,0.18), rgba(85,230,193,0.08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.045);
}

.nav-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  color: #95a4b9;
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
}

.top-button.is-active .nav-dot {
  background: rgba(85,230,193,0.22);
  color: var(--accent);
}

.workspace {
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  gap: 5px;
}

.viewer-zone {
  position: relative;
  padding: 6px;
  gap: 5px;
  border-radius: 16px;
  grid-template-rows: minmax(0, 1fr) auto;
}

.viewer-head {
  position: absolute;
  z-index: 20;
  top: 10px;
  left: 10px;
  right: 10px;
  pointer-events: none;
  align-items: flex-start;
}

.viewer-head > div:first-child {
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(16px);
  max-width: min(360px, 58%);
}

.viewer-head .eyebrow {
  display: none;
}

.viewer-head h1 {
  font-size: 0.86rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-badges {
  opacity: 0.84;
  gap: 4px;
}

.viewer-badges span {
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 9px;
  background: rgba(0,0,0,0.36);
  backdrop-filter: blur(14px);
  color: #b7c4d6;
  font-size: 0.62rem;
}

.viewer-frame {
  grid-row: 1;
  border-radius: 14px;
  background: #010204;
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

.viewer-grid {
  opacity: 0.18;
  background-size: 36px 36px;
}

.viewer-placeholder {
  width: min(430px, 82%);
}

.placeholder-mark {
  width: clamp(46px, 6vh, 62px);
  height: clamp(46px, 6vh, 62px);
  margin-bottom: 10px;
  border-radius: 15px;
  font-size: 0.95rem;
}

.viewer-placeholder h2 {
  font-size: clamp(0.98rem, 1.4vw, 1.22rem);
}

.viewer-placeholder p {
  font-size: 0.76rem;
  max-width: 36rem;
  margin-inline: auto;
}

.safe-frame {
  inset: 4.5%;
  border-color: rgba(255,255,255,0.11);
  border-radius: 10px;
  opacity: 0.55;
}

.transport {
  grid-row: 2;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(3,6,10,0.66);
  gap: 5px;
}

.transport-button {
  min-width: 34px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 9px;
  background: rgba(255,255,255,0.052);
  border-color: rgba(255,255,255,0.07);
  font-size: 0.76rem;
  font-weight: 850;
}

.transport-button.primary {
  min-width: 46px;
  color: #06110f;
  border-color: rgba(85,230,193,0.75);
  background: linear-gradient(180deg, #65f1cd, #38cfa9);
}

.timecode {
  margin-left: 4px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(0,0,0,0.36);
  color: #eaf0f9;
  font-size: 0.76rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.context-panel {
  padding: 6px;
  border-radius: 16px;
  overflow: hidden;
}

.panel-card {
  height: 100%;
  overflow: auto;
  padding: 12px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,0.042), rgba(255,255,255,0.018));
  scrollbar-width: thin;
  scrollbar-color: rgba(180,196,220,0.28) transparent;
}

.panel-card:not(.is-visible) { display: none; }

.panel-card .eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 0.58rem;
}

.panel-card h2 {
  margin-bottom: 8px;
  font-size: 0.98rem;
  letter-spacing: -0.03em;
}

.panel-card h3 {
  font-size: 0.82rem;
  margin: 12px 0 6px;
}

.panel-card p,
.tool-hint,
.export-note {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.34;
}

.status-list {
  gap: 6px;
  margin-top: 8px;
}

.status-list div,
.setting-row,
.editor-row,
.check-row {
  border-radius: 10px;
  padding: 8px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.055);
}

.status-list dt,
.setting-row span,
.editor-row span,
.check-row span {
  color: #aebacf;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-list dd {
  font-size: 0.77rem;
}

.file-picker,
.project-button,
.tool-button,
.export-button,
.download-link {
  border-radius: 11px;
  min-height: 38px;
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.08);
  box-shadow: none;
}

.file-picker {
  min-height: 56px;
  padding: 10px;
}

.tool-grid {
  gap: 6px;
}

.tool-button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.editor-grid-two {
  gap: 6px;
}

input,
select,
textarea {
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(0,0,0,0.28);
  color: var(--text);
}

.timeline-zone {
  padding: 6px;
  gap: 5px;
  border-radius: 16px;
  background: rgba(8,12,19,0.94);
  grid-template-rows: auto minmax(0,1fr);
}

.timeline-header {
  min-height: 34px;
  padding: 2px 4px 0;
  align-items: center;
}

.timeline-header .eyebrow { display: none; }

.timeline-header h2 {
  font-size: 0.86rem;
  letter-spacing: -0.02em;
}

.timeline-controls {
  gap: 4px;
}

.timeline-button {
  min-width: 30px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.055);
}

.timeline-meta {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.28);
  font-size: 0.68rem;
}

.timeline-scroll {
  padding: 0 2px 2px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.19), rgba(0,0,0,0.29));
}

.timeline-content {
  grid-template-rows: 18px minmax(0, 1fr);
  gap: 4px;
  padding: 4px 0;
}

.timeline-ruler {
  height: 18px;
  padding-left: 68px;
  color: #7e8b9f;
  font-size: 0.6rem;
}

.timeline-tick {
  border-left-color: rgba(255,255,255,0.08);
}

.tracks {
  gap: 4px;
}

.track {
  min-height: 28px;
  grid-template-columns: 66px minmax(0,1fr);
  gap: 5px;
}

.track strong {
  min-width: 66px;
  padding: 0 6px;
  border-radius: 9px;
  background: rgba(0,0,0,0.24);
  color: #cad4e5;
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.track-lane {
  min-height: 28px;
  border-radius: 10px;
  background: rgba(255,255,255,0.032);
  border-color: rgba(255,255,255,0.075);
}

.track-lane::before {
  background-image: repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(255,255,255,0.052) 48px);
}

.track-lane span {
  left: 7px;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(0,0,0,0.36);
  color: #d8e0ec;
  font-size: 0.62rem;
}

.video-lane.has-clip {
  border-color: rgba(85,230,193,0.36);
  background: linear-gradient(90deg, rgba(85,230,193,0.08), rgba(142,167,255,0.055));
}

#objectsTrackLane { background: linear-gradient(90deg, rgba(142,167,255,0.08), rgba(255,255,255,0.025)); }
#textTrackLane { background: linear-gradient(90deg, rgba(255,209,102,0.075), rgba(255,255,255,0.025)); }
#fxTrackLane { background: linear-gradient(90deg, rgba(255,107,122,0.07), rgba(255,255,255,0.025)); }
#voiceTrackLane { background: linear-gradient(90deg, rgba(170,126,255,0.08), rgba(255,255,255,0.025)); }
#audioTrackLane { background: linear-gradient(90deg, rgba(85,230,193,0.07), rgba(255,255,255,0.025)); }

.clip-block,
.object-block,
.voice-block,
.audio-block {
  top: 4px;
  bottom: 4px;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 8px 18px rgba(0,0,0,0.18);
}

.clip-block {
  background: linear-gradient(90deg, rgba(85,230,193,0.42), rgba(142,167,255,0.32));
  border-color: rgba(85,230,193,0.42);
}

.playhead {
  width: 2px;
  background: #f8fbff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.38), 0 0 18px rgba(85,230,193,0.78);
}

.playhead span {
  width: 10px;
  height: 10px;
  top: -5px;
  border-radius: 2px;
  background: #f8fbff;
}

.object-layer {
  touch-action: none;
}

.visual-object {
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.45));
}

.visual-object.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(85,230,193,0.12);
}

.resize-handle {
  width: 15px;
  height: 15px;
  right: -8px;
  bottom: -8px;
  border-radius: 5px;
  background: var(--accent);
  border: 2px solid #06110f;
}

@media (orientation: landscape) and (min-width: 881px) and (max-height: 980px) {
  :root {
    --topbar-h: 42px;
    --timeline-h: clamp(168px, 24vh, 214px);
    --panel-w: clamp(286px, 26vw, 350px);
  }

  .app-shell { gap: 4px; padding: calc(4px + var(--safe-top)) calc(4px + var(--safe-right)) calc(4px + var(--safe-bottom)) calc(4px + var(--safe-left)); }
  .topbar { padding: 4px 6px; }
  .brand-icon { width: 26px; height: 26px; }
  .top-button { min-height: 30px; padding: 0 8px; font-size: 0.7rem; }
  .nav-dot { width: 16px; height: 16px; font-size: 0.52rem; }
  .viewer-zone { padding: 5px; }
  .viewer-frame { border-radius: 12px; }
  .transport { min-height: 34px; }
  .transport-button { min-height: 28px; min-width: 32px; }
  .context-panel { padding: 5px; }
  .panel-card { padding: 10px; }
  .timeline-zone { padding: 5px; }
  .timeline-header { min-height: 30px; }
  .track { min-height: 25px; }
  .track-lane { min-height: 25px; }
}

@media (max-width: 880px) {
  :root {
    --topbar-h: auto;
    --timeline-h: 206px;
    --panel-w: 100%;
  }

  .app-shell {
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) var(--timeline-h);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }

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

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(160px, 29vh);
  }

  .context-panel {
    min-height: 0;
  }

  .viewer-head > div:first-child {
    max-width: 70%;
  }

  .timeline-ruler { padding-left: 58px; }
  .track { grid-template-columns: 56px minmax(0,1fr); }
  .track strong { min-width: 56px; font-size: 0.58rem; }
}

@media (max-width: 560px) {
  .nav-dot { display: none; }
  .top-button { padding: 0 9px; }
  .viewer-badges { display: none; }
  .timecode { flex: 1 1 100%; justify-content: center; }
  .transport { flex-wrap: wrap; }
}

/* RingoCut v0.13.3 — segunda pasada UI/UX profesional: inspector compacto, timeline denso y selección más clara */
:root {
  --bg: #05070c;
  --bg-soft: #080d15;
  --panel: #0b111c;
  --panel-strong: #101725;
  --line: rgba(163, 177, 203, 0.14);
  --line-strong: rgba(163, 177, 203, 0.26);
  --accent: #55e6c1;
  --accent-2: #8ea7ff;
  --warning: #ffd166;
  --danger: #ff6b7a;
  --topbar-h: 40px;
  --timeline-h: clamp(176px, 24vh, 220px);
  --panel-w: clamp(292px, 25vw, 356px);
  --radius-xl: 16px;
  --radius-lg: 13px;
  --radius-md: 10px;
}

html,
body {
  background: #05070c;
}

.app-shell {
  gap: 5px;
  padding: calc(5px + var(--safe-top)) calc(5px + var(--safe-right)) calc(5px + var(--safe-bottom)) calc(5px + var(--safe-left));
}

.topbar,
.viewer-zone,
.context-panel,
.timeline-zone {
  background: rgba(8, 13, 21, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: none;
}

.topbar {
  border-radius: 14px;
  padding: 4px 6px;
  gap: 8px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.brand-copy strong {
  font-size: 0.88rem;
  letter-spacing: -0.03em;
}

.brand-copy span {
  font-size: 0.62rem;
}

.top-actions {
  gap: 4px;
  flex: 1;
}

.top-button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 820;
  background: rgba(255, 255, 255, 0.035);
}

.nav-dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 0.68rem;
}

.top-button.is-active {
  background: rgba(85, 230, 193, 0.14);
  border-color: rgba(85, 230, 193, 0.45);
}

.top-button.is-active .nav-dot {
  color: #06110f;
  background: var(--accent);
}

.workspace {
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
}

.viewer-zone {
  padding: 6px;
  gap: 5px;
  grid-template-rows: auto minmax(0, 1fr) 34px;
}

.viewer-head {
  min-height: 26px;
  align-items: center;
}

.viewer-head h1,
.timeline-header h2,
.panel-card h2 {
  font-size: 0.98rem;
  letter-spacing: -0.025em;
}

.eyebrow {
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  margin-bottom: 0;
}

.viewer-badges span {
  padding: 4px 7px;
  font-size: 0.62rem;
  border-radius: 7px;
}

.viewer-frame {
  border-radius: 13px;
  background: #02050a;
}

.safe-frame {
  inset: 5.5%;
  border-color: rgba(255,255,255,0.12);
  border-radius: 10px;
}

.viewer-placeholder {
  width: min(430px, 78%);
}

.viewer-placeholder p {
  display: none;
}

.placeholder-mark {
  width: clamp(44px, 6vh, 60px);
  height: clamp(44px, 6vh, 60px);
  border-radius: 14px;
  margin-bottom: 8px;
}

.transport {
  min-height: 34px;
  gap: 5px;
  padding: 0 1px;
}

.transport-button {
  min-width: 34px;
  min-height: 32px;
  border-radius: 9px;
  padding: 0 8px;
  font-size: 0.76rem;
}

.transport-button.primary {
  min-width: 42px;
}

.step-button {
  min-width: 48px;
  font-size: 0.72rem;
}

.timecode {
  padding: 0 8px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  font-size: 0.72rem;
}

.context-panel {
  padding: 6px;
  border-radius: 14px;
}

.panel-card {
  scrollbar-width: thin;
  padding-right: 3px;
}

.panel-card p {
  font-size: 0.72rem;
  line-height: 1.32;
  margin-bottom: 10px;
}

.status-list {
  gap: 5px;
  margin-top: 8px;
}

.status-list div,
.setting-row {
  min-height: 31px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
}

.status-list.compact dd {
  max-width: 62%;
}

.file-picker {
  min-height: 50px;
  border-radius: 11px;
  padding: 9px 10px;
  gap: 2px;
  font-size: 0.74rem;
}

.file-picker small {
  font-size: 0.64rem;
}

.project-actions,
.voice-controls,
.editor-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.voice-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-button,
.voice-button,
.secondary-button,
.danger-button,
.export-button,
.tool-button {
  min-height: 34px;
  border-radius: 9px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 850;
}

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

.tool-button {
  justify-content: center;
  width: 100%;
}

.object-editor {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.object-editor h3 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: var(--soft);
}

#selectedObjectLabel {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.035);
  color: var(--soft);
}

.editor-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.editor-row,
.check-row {
  gap: 6px;
  min-height: 32px;
  font-size: 0.68rem;
}

.editor-row input:not([type="range"]):not([type="color"]),
.editor-row select {
  min-height: 30px;
  border-radius: 8px;
  padding: 4px 7px;
}

.editor-row input[type="color"] {
  min-height: 30px;
  border-radius: 8px;
}

.tool-hint {
  font-size: 0.66rem !important;
  color: #8795aa !important;
}

.timeline-zone {
  padding: 6px 7px 7px;
  gap: 5px;
  border-radius: 14px;
}

.timeline-header {
  min-height: 30px;
  align-items: center;
}

.timeline-controls {
  gap: 4px;
}

.timeline-button {
  min-width: 30px;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 0.76rem;
}

.timeline-meta {
  min-height: 28px;
  padding: 0 7px;
  border-radius: 8px;
  font-size: 0.66rem;
}

.timeline-content {
  grid-template-rows: 16px minmax(0, 1fr);
  gap: 4px;
}

.timeline-ruler {
  height: 16px;
  padding-left: 76px;
  font-size: 0.58rem;
  color: #7e8ba0;
}

.tracks {
  gap: 4px;
}

.track {
  min-height: 25px;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 5px;
}

.track strong {
  min-width: 72px;
  padding: 0 5px;
  border: 1px solid rgba(163,177,203,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  color: #b7c4d6;
  font-size: 0.66rem;
  font-weight: 850;
  overflow: hidden;
}

.track-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-right: 5px;
  border-radius: 5px;
  background: rgba(255,255,255,0.08);
  color: var(--accent);
  font-size: 0.58rem;
  flex: 0 0 auto;
}

.track-lane {
  min-height: 25px;
  border-radius: 8px;
  background: rgba(255,255,255,0.026);
}

.track-lane::before {
  background-image: repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255, 255, 255, 0.045) 40px);
}

.track-lane span {
  padding: 2px 6px;
  left: 6px;
  font-size: 0.57rem;
  border-radius: 6px;
}

.clip-block,
.object-clip,
.voice-block,
.audio-block {
  top: 3px !important;
  bottom: 3px !important;
  min-height: 0;
  border-radius: 7px !important;
}

.object-clip {
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(90deg, rgba(142,167,255,0.42), rgba(142,167,255,0.22));
}

.text-clip {
  background: linear-gradient(90deg, rgba(255,209,102,0.45), rgba(255,209,102,0.22));
}

.fx-clip {
  background: linear-gradient(90deg, rgba(255,107,122,0.45), rgba(255,107,122,0.20));
}

.object-clip.is-selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(85,230,193,0.9), 0 0 18px rgba(85,230,193,0.28) !important;
}

.video-lane.has-clip {
  border-color: rgba(85,230,193,0.34);
}

.clip-block {
  background: linear-gradient(90deg, rgba(85,230,193,0.52), rgba(142,167,255,0.34));
  border-color: rgba(85,230,193,0.50);
}

.playhead {
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.46), 0 0 16px rgba(85,230,193,0.72);
}

.playhead span {
  width: 12px;
  height: 8px;
  top: -5px;
  border-radius: 2px;
  transform: translateX(-50%);
}

.visual-object.is-selected {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(85,230,193,0.18), 0 0 22px rgba(85,230,193,0.22) !important;
}

.resize-handle {
  width: 18px;
  height: 18px;
  right: -9px;
  bottom: -9px;
  border-radius: 6px;
}

.export-box {
  display: grid;
  gap: 5px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 9px;
  padding: 0 10px;
  border: 1px solid rgba(85,230,193,0.38);
  background: rgba(85,230,193,0.10);
  color: var(--text);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 850;
}

@media (orientation: landscape) and (min-width: 881px) and (max-height: 980px) {
  :root {
    --topbar-h: 38px;
    --timeline-h: clamp(170px, 24vh, 210px);
    --panel-w: clamp(300px, 26vw, 360px);
  }

  .topbar { padding: 4px 6px; }
  .viewer-zone { padding: 5px; }
  .context-panel { padding: 5px; }
  .timeline-zone { padding: 5px 6px 6px; }
  .viewer-placeholder h2 { font-size: 0.95rem; }
}

@media (max-width: 880px) {
  :root {
    --timeline-h: 204px;
    --panel-w: 100%;
  }

  body { background: #05070c; }
  .workspace { grid-template-columns: 1fr; }
  .context-panel { min-height: 250px; }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .top-button { padding: 0 8px; }
  .nav-dot { margin-right: 3px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .track { grid-template-columns: 62px minmax(0, 1fr); }
  .track strong { min-width: 62px; font-size: 0.6rem; }
  .track-icon { display: none; }
  .timeline-ruler { padding-left: 66px; }
}


/* RingoCut v0.13.3 — reajuste UI/UX: visor protagonista, timeline completo y menos espacio muerto */
:root {
  --topbar-h: 38px;
  --timeline-h: clamp(246px, 29vh, 286px);
  --panel-w: clamp(286px, 24vw, 330px);
  --radius-xl: 14px;
  --radius-lg: 11px;
  --radius-md: 8px;
}

.app-shell {
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--timeline-h) !important;
  gap: 5px !important;
  padding: calc(4px + var(--safe-top)) calc(4px + var(--safe-right)) calc(4px + var(--safe-bottom)) calc(4px + var(--safe-left)) !important;
}

.topbar {
  min-height: var(--topbar-h) !important;
  border-radius: 12px !important;
  padding: 3px 6px !important;
}

.brand { min-width: 118px !important; }
.brand-icon { width: 26px !important; height: 26px !important; }
.brand-copy strong { font-size: 0.84rem !important; }
.brand-copy span { font-size: 0.58rem !important; }

.top-actions { gap: 4px !important; }
.top-button {
  min-height: 30px !important;
  padding: 0 9px !important;
  font-size: 0.72rem !important;
  border-radius: 8px !important;
}
.nav-dot {
  width: 17px !important;
  height: 17px !important;
  margin-right: 4px !important;
  border-radius: 5px !important;
  font-size: 0.62rem !important;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) var(--panel-w) !important;
  gap: 5px !important;
  min-height: 0 !important;
}

.viewer-zone {
  position: relative !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) 38px !important;
  gap: 5px !important;
  padding: 5px !important;
  border-radius: 14px !important;
  overflow: hidden !important;
}

.viewer-head {
  position: absolute !important;
  z-index: 12 !important;
  top: 9px !important;
  left: 9px !important;
  right: 9px !important;
  min-height: 0 !important;
  pointer-events: none !important;
}

.viewer-head > div:first-child {
  width: auto !important;
  max-width: min(340px, 58%) !important;
  padding: 6px 9px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,0.075) !important;
  background: rgba(0,0,0,0.46) !important;
  backdrop-filter: blur(14px) !important;
}

.viewer-head .eyebrow { display: none !important; }
.viewer-head h1 {
  font-size: 0.8rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.viewer-badges { display: none !important; }

.viewer-frame {
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 12px !important;
  background: #010308 !important;
  display: grid !important;
  place-items: center !important;
}

.viewer-grid { opacity: 0.18 !important; background-size: 64px 64px !important; }
.safe-frame { inset: 6% !important; border-radius: 12px !important; opacity: 0.52 !important; }

.viewer-placeholder {
  width: min(380px, 78%) !important;
  display: grid !important;
  place-items: center !important;
  gap: 7px !important;
}
.placeholder-mark {
  width: clamp(44px, 7vh, 64px) !important;
  height: clamp(44px, 7vh, 64px) !important;
  margin: 0 !important;
  border-radius: 14px !important;
}
.viewer-placeholder h2 {
  margin: 0 !important;
  font-size: clamp(0.95rem, 1.7vw, 1.3rem) !important;
}
.viewer-placeholder p { display: none !important; }

.transport {
  min-height: 38px !important;
  height: 38px !important;
  gap: 5px !important;
  padding: 0 !important;
  align-items: center !important;
  overflow: hidden !important;
}
.transport-button {
  min-width: 38px !important;
  min-height: 34px !important;
  height: 34px !important;
  border-radius: 9px !important;
  padding: 0 8px !important;
  font-size: 0.72rem !important;
}
.transport-button.primary { min-width: 50px !important; }
.step-button { min-width: 46px !important; }
.timecode {
  margin-left: auto !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 10px !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
}

.context-panel {
  border-radius: 14px !important;
  padding: 7px !important;
  overflow: hidden !important;
}
.panel-card { padding-right: 4px !important; }
.panel-card .eyebrow { font-size: 0.58rem !important; }
.panel-card h2 { font-size: 0.98rem !important; margin-bottom: 6px !important; }
.panel-card p {
  font-size: 0.7rem !important;
  line-height: 1.28 !important;
  margin-bottom: 8px !important;
}
.status-list { gap: 5px !important; margin-top: 7px !important; }
.status-list div,
.setting-row {
  min-height: 30px !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  font-size: 0.68rem !important;
}
.file-picker {
  min-height: 48px !important;
  padding: 8px 9px !important;
  border-radius: 10px !important;
}
.tool-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin-top: 8px !important;
}
.tool-button,
.project-button,
.voice-button,
.secondary-button,
.danger-button,
.export-button {
  min-height: 32px !important;
  border-radius: 8px !important;
  padding: 0 8px !important;
  font-size: 0.68rem !important;
}
.editor-row { min-height: 31px !important; padding: 5px 7px !important; font-size: 0.68rem !important; }
.editor-row input[type="number"],
.editor-row input[type="text"],
.editor-row select { min-height: 26px !important; }

.timeline-zone {
  border-radius: 14px !important;
  padding: 6px 7px 7px !important;
  gap: 5px !important;
  display: grid !important;
  grid-template-rows: 30px minmax(0, 1fr) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.timeline-header { min-height: 30px !important; align-items: center !important; }
.timeline-header h2 { font-size: 0.94rem !important; }
.timeline-controls { gap: 4px !important; }
.timeline-button,
.timeline-meta {
  min-height: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  font-size: 0.68rem !important;
  padding: 0 8px !important;
}
.timeline-scroll {
  min-height: 0 !important;
  overflow: auto !important;
  padding-bottom: 0 !important;
}
.timeline-content {
  grid-template-rows: 18px minmax(0, 1fr) !important;
  gap: 5px !important;
  min-height: 100% !important;
}
.timeline-ruler {
  height: 18px !important;
  padding-left: 72px !important;
  font-size: 0.62rem !important;
}
.tracks {
  gap: 4px !important;
  min-height: 0 !important;
}
.track {
  min-height: 28px !important;
  grid-template-columns: 68px minmax(0, 1fr) !important;
  gap: 5px !important;
}
.track strong {
  min-width: 68px !important;
  height: 28px !important;
  border-radius: 8px !important;
  padding: 0 6px !important;
  font-size: 0.66rem !important;
  letter-spacing: 0.07em !important;
}
.track-lane {
  min-height: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
}
.track-lane span {
  padding: 2px 7px !important;
  font-size: 0.64rem !important;
  border-radius: 7px !important;
}
.clip-block,
.object-clip,
.voice-block,
.audio-block {
  top: 3px !important;
  bottom: 3px !important;
  border-radius: 6px !important;
}
.playhead { top: -3px !important; bottom: -3px !important; }

@media (orientation: landscape) and (min-width: 881px) and (max-height: 980px) {
  :root {
    --topbar-h: 36px;
    --timeline-h: clamp(238px, 28vh, 272px);
    --panel-w: clamp(276px, 23vw, 318px);
  }
  .app-shell { gap: 4px !important; padding: calc(4px + var(--safe-top)) calc(4px + var(--safe-right)) calc(4px + var(--safe-bottom)) calc(4px + var(--safe-left)) !important; }
  .topbar { min-height: 36px !important; }
  .top-button { min-height: 28px !important; padding: 0 8px !important; }
  .viewer-zone { grid-template-rows: minmax(0, 1fr) 36px !important; }
  .transport { height: 36px !important; min-height: 36px !important; }
  .transport-button,
  .timecode { height: 32px !important; min-height: 32px !important; }
  .timeline-zone { grid-template-rows: 28px minmax(0, 1fr) !important; }
}

@media (max-width: 880px) {
  :root {
    --timeline-h: 250px;
    --panel-w: 100%;
  }
  html,
  body { overflow: auto !important; }
  .app-shell { height: auto !important; min-height: 100dvh !important; grid-template-rows: auto auto auto !important; }
  .topbar { align-items: flex-start !important; flex-direction: column !important; }
  .top-actions { width: 100% !important; justify-content: flex-start !important; }
  .workspace { grid-template-columns: 1fr !important; }
  .viewer-frame { min-height: 300px !important; height: min(62vh, 520px) !important; }
  .context-panel { min-height: 220px !important; }
  .timeline-zone { min-height: var(--timeline-h) !important; }
}

@media (max-width: 560px) {
  .brand { min-width: auto !important; }
  .brand-copy strong { font-size: 0.78rem !important; }
  .top-button { padding: 0 7px !important; }
  .nav-dot { display: none !important; }
  .track { grid-template-columns: 56px minmax(0, 1fr) !important; }
  .track strong { min-width: 56px !important; font-size: 0.58rem !important; }
  .timeline-ruler { padding-left: 60px !important; }
  .timecode { font-size: 0.68rem !important; }
}


/* RingoCut v0.13.4 — menú compacto superior y corrección de placeholder con vídeo cargado */
.topbar {
  grid-template-columns: auto auto !important;
  display: grid !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 8px !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 5px 8px !important;
  position: relative !important;
  overflow: visible !important;
  z-index: 30 !important;
}

.brand {
  min-width: 0 !important;
}

.brand-icon {
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
}

.brand-copy strong {
  font-size: 0.92rem !important;
}

.brand-copy span {
  font-size: 0.68rem !important;
}

.main-menu {
  position: relative !important;
  justify-self: end !important;
  z-index: 50 !important;
}

.main-menu > summary {
  list-style: none !important;
}

.main-menu > summary::-webkit-details-marker {
  display: none !important;
}

.main-menu-button {
  min-height: 34px !important;
  border-radius: 14px !important;
  padding: 0 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  border: 1px solid rgba(110, 231, 200, 0.38) !important;
  background: rgba(110, 231, 200, 0.12) !important;
  color: var(--text) !important;
  font-weight: 850 !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none !important;
}

.main-menu-button span {
  width: 22px !important;
  height: 22px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 8px !important;
  background: rgba(110, 231, 200, 0.18) !important;
  color: var(--accent) !important;
  font-size: 0.92rem !important;
}

.menu-panel.top-actions {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  width: min(260px, calc(100vw - 28px)) !important;
  max-height: min(68dvh, 440px) !important;
  overflow-y: auto !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  padding: 8px !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  border-radius: 16px !important;
  background: rgba(9, 14, 24, 0.98) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.68) !important;
  backdrop-filter: blur(22px) !important;
}

.menu-panel .top-button {
  width: 100% !important;
  justify-content: flex-start !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 10px !important;
  border-radius: 12px !important;
  font-size: 0.82rem !important;
  text-align: left !important;
}

.menu-panel .nav-dot {
  flex: 0 0 auto !important;
}

.viewer-frame.has-video .viewer-placeholder,
.viewer-frame.has-video .viewer-placeholder * {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.viewer-frame.has-video .viewer-grid {
  display: none !important;
}

.viewer-frame.has-video .preview-video {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

@media (max-width: 860px) {
  .topbar {
    height: 42px !important;
    min-height: 42px !important;
  }

  .main-menu-button strong {
    display: none !important;
  }

  .main-menu-button {
    width: 38px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
}


/* RingoCut v0.14 — herramienta de dibujo en reproducción */
.tool-button#liveDrawButton.is-active {
  color: #03120f;
  border-color: rgba(110, 231, 200, 0.95);
  background: linear-gradient(135deg, rgba(110, 231, 200, 0.92), rgba(74, 144, 226, 0.78));
}
.object-layer.is-drawing .visual-object:not(.live-stroke) {
  pointer-events: none;
}
.visual-object.live-stroke {
  z-index: 20;
  opacity: 0.98;
}
