      :root {
        --bg: #0a0a0a;
        --text: #ededed;
        --text-soft: rgba(255, 255, 255, 0.8);
        --text-muted: rgba(255, 255, 255, 0.6);
        --line: rgba(255, 255, 255, 0.1);
        --line-strong: rgba(255, 255, 255, 0.2);
        --panel: rgba(255, 255, 255, 0.05);
        --panel-strong: rgba(255, 255, 255, 0.1);
        --accent: #80cdc6;
        --accent-hover: #9dddd7;
        --accent-dim: rgba(128, 205, 198, 0.15);
        --danger: #e53e3e;
        --editorial: #f97316;
        --mono: "Space Mono", ui-monospace, monospace;
        --display: "Archivo", system-ui, sans-serif;
        --sans: "Inter", system-ui, sans-serif;
        --header-h: 4.25rem;
        --dock-h: 4.9rem;
        --radius-md: 0.75rem;
        --radius-lg: 0.95rem;
      }

      * {
        box-sizing: border-box;
      }

      html {
        font-size: 16px;
      }

      @media (min-width: 900px) {
        html {
          font-size: 18px;
        }
      }

      body {
        margin: 0;
        min-height: 100vh;
        font-family: var(--sans);
        color: var(--text);
        background: linear-gradient(to bottom, #000000, #111827, #000000);
      }

      .app {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0.75rem;
        padding-bottom: 5.5rem;
        display: grid;
        gap: 0.75rem;
        min-height: 100vh;
      }

      .topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgba(0, 0, 0, 0.72);
        border: 1px solid var(--line-strong);
        backdrop-filter: blur(12px);
        border-radius: 0.9rem;
        padding: 0.42rem 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
      }

      .title-row {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        min-width: 0;
      }

      .topbar-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }

      .mobile-only {
        display: inline-flex;
      }

      .desktop-only {
        display: none;
      }

      .desktop-side {
        display: none;
      }

      .icon-btn {
        width: auto;
        min-width: 2.2rem;
        padding: 0.45rem 0.62rem;
        border-radius: 0.6rem;
        font-family: var(--mono);
        letter-spacing: 0.01em;
        text-transform: none;
        background: var(--panel);
        color: var(--text-soft);
        border: 1px solid var(--line);
      }

      .icon-btn:hover {
        border-color: var(--accent);
        color: #ffffff;
      }

      .icon-btn i,
      button i {
        width: 1rem;
        height: 1rem;
      }

      .btn-label {
        margin-left: 0.35rem;
      }

      .title {
        margin: 0;
        font-family: var(--display);
        font-weight: 600;
        letter-spacing: -0.02em;
        line-height: 1.1;
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .meta {
        margin: 0;
        font-family: var(--mono);
        color: var(--text-muted);
        font-size: 0.68rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .layout {
        display: grid;
        gap: 0.75rem;
        min-width: 0;
      }

      .panel {
        background: rgba(0, 0, 0, 0.62);
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-lg);
        backdrop-filter: blur(10px);
        padding: 0.72rem;
      }

      .media-panel {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        gap: 0.7rem;
        min-width: 0;
      }

      .player-shell {
        position: relative;
        width: 100%;
        border-radius: 0.75rem;
        border: 1px solid var(--line);
        background: #000;
        overflow: hidden;
        aspect-ratio: 16 / 9;
        min-height: 0;
      }

      video {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
        background: #000;
        object-fit: contain;
      }

      .preview-compact .player-shell {
        max-height: min(34vh, 16rem);
      }

      .preview-focus .player-shell {
        max-height: min(56vh, 28rem);
      }

      .upload-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.45rem;
      }

      .upload-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
      }

      .timeline-wrap {
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: var(--panel);
        padding: 0.68rem;
        display: grid;
        gap: 0.62rem;
      }

      .editor-shell {
        display: grid;
        grid-template-rows: minmax(0, auto) auto;
        gap: 0.7rem;
        min-height: 0;
      }

      .editor-disabled {
        opacity: 0.35;
        pointer-events: none;
        filter: grayscale(0.35);
      }

      .upload-hero {
        border: 1px solid var(--line-strong);
        border-radius: 0.9rem;
        padding: 1rem;
        background: linear-gradient(145deg, rgba(128, 205, 198, 0.11), rgba(0, 0, 0, 0.65));
        display: grid;
        gap: 0.65rem;
      }

      .upload-hero h2 {
        margin: 0;
        font-family: var(--display);
      }

      .upload-hero p {
        margin: 0;
        color: var(--text-soft);
        font-size: 0.8rem;
      }

      .hero-progress {
        width: 100%;
        height: 0.55rem;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: rgba(0, 0, 0, 0.55);
        overflow: hidden;
      }

      .hero-progress-bar {
        width: 0;
        height: 100%;
        background: linear-gradient(to right, #3fa89e, #80cdc6);
        transition: width 0.2s ease;
      }

      .hero-progress-text {
        font-family: var(--mono);
        font-size: 0.68rem;
        color: var(--text-muted);
      }

      /* CAP CAPTCHA widget container */
      .cap-widget-wrap {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin: 0.75rem 0 0.25rem;
        padding: 1rem 1.25rem;
        background: #fff;
        border-radius: 0.75rem;
        animation: fadeIn 0.2s ease;
      }

      .cap-widget-wrap--visible {
        display: flex;
      }

      .cap-hint {
        font-size: 0.78rem;
        color: #333;
        margin: 0;
      }

      .timeline-top {
        display: flex;
        justify-content: space-between;
        gap: 0.5rem;
        align-items: center;
        font-family: var(--mono);
        color: var(--text-muted);
        font-size: 0.7rem;
        min-width: 0;
      }

      .mode-toggle {
        display: inline-flex;
        gap: 0.25rem;
        padding: 0.18rem;
        border-radius: 0.6rem;
        border: 1px solid var(--line);
        background: rgba(0, 0, 0, 0.35);
      }

      .mode-btn {
        width: auto;
        min-height: 0;
        padding: 0.24rem 0.5rem;
        border-radius: 0.45rem;
        border: 1px solid transparent;
        background: transparent;
        color: var(--text-muted);
        font-family: var(--mono);
        font-size: 0.66rem;
        letter-spacing: 0;
        text-transform: none;
      }

      .mode-btn.active {
        background: var(--accent-dim);
        color: var(--accent);
        border-color: var(--accent);
      }

      .timeline-readout {
        display: none;
      }

      .timeline-hint {
        color: var(--text-muted);
        font-size: 0.64rem;
        white-space: nowrap;
      }

      .timeline {
        position: relative;
        height: 2.15rem;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: rgba(0, 0, 0, 0.5);
        overflow: hidden;
      }

      .timeline .range {
        position: absolute;
        top: 0;
        height: 100%;
        background: var(--accent-dim);
        border-left: 2px solid var(--accent);
        border-right: 2px solid var(--accent);
        cursor: grab;
      }

      .timeline .range.dragging {
        cursor: grabbing;
      }

      .playhead {
        position: absolute;
        top: 0;
        width: 2px;
        height: 100%;
        background: #ffffff;
        opacity: 0.9;
        pointer-events: none;
      }

      .handle {
        position: absolute;
        top: 50%;
        width: 1.15rem;
        height: 1.15rem;
        margin-top: -0.58rem;
        margin-left: -0.58rem;
        border-radius: 999px;
        border: 2px solid rgba(0, 0, 0, 0.7);
        background: var(--accent);
        cursor: ew-resize;
      }

      .timeline-actions,
      .timeline-tools,
      .transport-row,
      .action-strip,
      .controls,
      .notes {
        display: grid;
        gap: 0.45rem;
      }

      .transport-row {
        grid-template-columns: 1fr 1fr 1fr 1fr;
      }

      .timeline-actions,
      .controls {
        grid-template-columns: 1fr 1fr;
      }

      .timeline-tools {
        grid-template-columns: 1fr 1fr 1fr;
      }

      .action-strip {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(6.2rem, 1fr));
        gap: 0.42rem;
      }

      .action-strip button {
        width: 100%;
        min-width: 0;
        white-space: nowrap;
      }

      .action-strip .btn-label {
        display: inline;
        margin-left: 0.25rem;
      }

      .btn-toggle-active {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-dim);
      }

      .shots-panel {
        display: grid;
        gap: 0.55rem;
        min-height: 0;
      }

      .drawer-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
      }

      .drawer-overlay.open {
        opacity: 1;
        pointer-events: auto;
      }

      .drawer {
        position: fixed;
        top: 0;
        bottom: 0;
        width: min(22rem, 92vw);
        background: rgba(8, 8, 8, 0.95);
        border: 1px solid var(--line-strong);
        backdrop-filter: blur(14px);
        z-index: 100;
        display: grid;
        grid-template-rows: auto 1fr;
        transition: transform 0.25s ease;
      }

      .drawer-left {
        left: 0;
        transform: translateX(-102%);
        border-right: 1px solid var(--line-strong);
      }

      .drawer-right {
        right: 0;
        transform: translateX(102%);
        border-left: 1px solid var(--line-strong);
      }

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

      .drawer-head {
        padding: 0.75rem;
        border-bottom: 1px solid var(--line);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
      }

      .drawer-title {
        margin: 0;
        font-family: var(--display);
        font-size: 0.95rem;
      }

      .drawer-body {
        padding: 0.75rem;
        overflow: auto;
        display: grid;
        gap: 0.65rem;
        align-content: start;
      }

      .drawer-stack {
        display: grid;
        gap: 0.45rem;
      }

      .shots {
        max-height: 52vh;
        overflow: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
        min-width: 0;
      }

      .shot {
        display: block;
        width: 100%;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        padding: 0.65rem 0.75rem;
        margin-bottom: 0.4rem;
        cursor: pointer;
        transition: background 0.12s, border-color 0.12s;
        text-align: left;
        background: transparent;
        color: inherit;
      }

      .shot:hover {
        background: var(--panel);
        border-color: var(--line-strong);
      }

      .shot.active {
        border-color: var(--accent);
        background: var(--accent-dim);
      }

      .shot-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.2rem;
      }

      .shot-index {
        font-family: var(--mono);
        font-size: 0.65rem;
        font-weight: 700;
        color: var(--accent);
        letter-spacing: 0.04em;
      }

      .shot-duration {
        font-family: var(--mono);
        font-size: 0.62rem;
        color: var(--text-muted);
        letter-spacing: 0.02em;
      }

      .shot-tc {
        font-family: var(--mono);
        font-size: 0.62rem;
        color: var(--text-muted);
        margin-bottom: 0.35rem;
        letter-spacing: 0.01em;
      }

      .active .shot-index {
        color: var(--accent);
      }

      .active .shot-tc {
        color: rgba(128, 205, 198, 0.75);
      }

      .shot-desc {
        font-family: var(--sans);
        font-size: 0.78rem;
        line-height: 1.55;
        color: var(--text-soft);
        text-transform: none;
      }

      .shot:focus-visible,
      button:focus-visible,
      .mode-btn:focus-visible,
      .icon-btn:focus-visible,
      .note-toggle:focus-visible,
      input:focus-visible,
      textarea:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }

      .notes textarea {
        min-height: 4.5rem;
        resize: vertical;
      }

      .note-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
      }

      .note-toggle {
        width: auto;
        min-height: 0;
        padding: 0.22rem 0.4rem;
        border-radius: 0.45rem;
        border: 1px solid var(--line);
        background: var(--panel);
        color: var(--text-soft);
        font-family: var(--mono);
        font-size: 0.66rem;
        text-transform: none;
        letter-spacing: 0;
      }

      .note-toggle:hover {
        border-color: var(--accent);
      }

      .notes.collapsed textarea {
        display: none;
      }

      .note-label,
      label {
        font-family: var(--mono);
        color: var(--text-muted);
        font-size: 0.68rem;
        margin-bottom: 0.25rem;
        display: block;
      }

      .status {
        color: var(--text-muted);
        font-family: var(--mono);
        font-size: 0.68rem;
        white-space: nowrap;
      }

      .share-url {
        color: var(--editorial);
        font-family: var(--mono);
        font-size: 0.68rem;
        word-break: break-all;
      }

      .visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
      }

      .result {
        white-space: pre-wrap;
        word-break: break-word;
        margin: 0;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid var(--line);
        border-radius: 0.75rem;
        padding: 0.55rem 0.7rem;
        font-family: var(--mono);
        font-size: 0.68rem;
        color: var(--text-muted);
      }

      .control-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
        margin-top: 0.1rem;
      }

      input,
      button,
      textarea {
        width: 100%;
        border: 1px solid var(--line);
        border-radius: 0.7rem;
        padding: 0.55rem 0.62rem;
        font: inherit;
        font-size: 0.78rem;
        color: var(--text);
        background: rgba(0, 0, 0, 0.55);
      }

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

      input[type="file"] {
        color: var(--text-muted);
        font-size: 0.74rem;
      }

      input[type="file"]::file-selector-button {
        border: 1px solid var(--line);
        border-radius: 0.5rem;
        background: var(--panel-strong);
        color: var(--text);
        padding: 0.25rem 0.55rem;
        margin-right: 0.5rem;
      }

      button {
        cursor: pointer;
        background: var(--accent);
        color: #000000;
        border: none;
        font-family: var(--display);
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }

      button:hover {
        background: var(--accent-hover);
      }

      button:disabled {
        opacity: 0.4;
        cursor: default;
      }

      .btn-muted {
        background: var(--panel);
        border: 1px solid var(--line);
        color: var(--text-soft);
        letter-spacing: 0.02em;
        text-transform: none;
        font-weight: 500;
      }

      .btn-muted:hover {
        border-color: var(--accent);
        color: #ffffff;
      }

      .btn-danger {
        background: var(--danger);
        color: #ffffff;
      }

      .btn-danger:hover {
        background: #c53030;
      }

      .hidden {
        display: none !important;
      }

      @media (max-width: 979px) {
        .app {
          height: 100dvh;
          padding: calc(var(--header-h) + 0.55rem) 0.65rem 0.65rem;
          gap: 0.65rem;
          overflow: hidden;
        }

        .topbar {
          position: fixed;
          top: 0.5rem;
          left: 0.65rem;
          right: 0.65rem;
          height: calc(var(--header-h) - 0.6rem);
          z-index: 80;
        }

        .title {
          font-size: 0.9rem;
        }

        .topbar-actions {
          gap: 0.4rem;
        }

        .meta,
        .status,
        .timeline-top,
        .note-label,
        label,
        .shot-tc,
        .shot-index,
        .shot-duration,
        .share-url {
          font-size: 0.6rem;
        }

        .timeline-top {
          display: flex;
          align-items: center;
        }

        .timeline-hint {
          display: none;
        }

        .timeline {
          height: 2.05rem;
        }

        .handle {
          width: 1.35rem;
          height: 1.35rem;
          margin-top: -0.68rem;
          margin-left: -0.68rem;
        }

        .transport-row {
          grid-template-columns: repeat(4, minmax(0, 1fr));
          gap: 0.35rem;
        }

        .controls,
        .timeline-actions {
          grid-template-columns: 1fr 1fr;
          gap: 0.35rem;
        }

        .timeline-tools {
          grid-template-columns: repeat(3, minmax(0, 1fr));
          gap: 0.35rem;
        }

        .action-strip {
          gap: 0.35rem;
          grid-template-columns: repeat(4, minmax(0, 1fr));
        }

        .action-strip .btn-label {
          display: none;
        }

        .action-strip button {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          padding: 0.42rem 0.4rem;
          font-size: 0.68rem;
        }

        .control-actions {
          grid-template-columns: 1fr 1fr;
          gap: 0.4rem;
        }

        .btn-label {
          display: none;
          margin-left: 0;
        }

        .status {
          display: none;
        }

        /* Keep desktop sidebar hidden on mobile; mobile shots remain available via drawer button. */
        #side,
        .desktop-side {
          display: none !important;
        }

        input,
        button,
        textarea {
          min-height: 2.25rem;
          padding: 0.45rem 0.5rem;
        }

        .panel {
          padding: 0.5rem;
        }

        .layout {
          height: 100%;
          min-height: 0;
        }

        .media-panel {
          height: 100%;
          min-height: 0;
          grid-template-rows: auto minmax(0, 1fr) auto;
          overflow: hidden;
        }

        .player-shell {
          height: 100%;
          max-height: none;
          aspect-ratio: auto;
        }

        .timeline-wrap {
          overflow: auto;
          max-height: 38vh;
        }

        .topbar {
          padding: 0.38rem 0.44rem;
        }

        .player-shell {
          border-radius: 0.65rem;
        }

        .timeline-wrap {
          padding: 0.5rem;
          gap: 0.45rem;
        }

        .transport-row button,
        .controls input {
          font-size: 0.72rem;
        }

        .icon-btn {
          min-width: 2.05rem;
          padding: 0.45rem 0.5rem;
        }

        .preview-compact .player-shell {
          max-height: none;
        }

        .preview-focus .player-shell {
          max-height: none;
        }
      }

      @media (min-width: 980px) {
        .app {
          padding: 1rem;
          padding-top: calc(var(--header-h) + 1.15rem);
          padding-bottom: 1.15rem;
          gap: 1rem;
          height: 100vh;
          overflow: hidden;
        }

        .layout {
          grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
          align-items: stretch;
          gap: 1rem;
          height: 100%;
          min-height: 0;
        }

        .topbar {
          position: fixed;
          top: 0.55rem;
          left: 50%;
          transform: translateX(-50%);
          width: calc(100% - 2rem);
          max-width: 1400px;
          z-index: 85;
          padding: 0.45rem 0.6rem;
        }

        .upload-row {
          grid-template-columns: 1fr auto auto;
        }

        .upload-actions {
          display: contents;
        }

        .control-actions {
          margin: 0.15rem 0 0;
          max-width: min(100%, 540px);
          align-items: center;
        }

        .timeline-wrap {
          padding: 0.88rem;
          border-color: var(--line-strong);
          background: rgba(10, 10, 10, 0.9);
          margin-top: auto;
          max-height: none;
          overflow: visible;
          flex-shrink: 0;
          position: sticky;
          bottom: 0;
          z-index: 2;
        }

        .media-panel {
          height: 100%;
          min-height: 0;
          grid-template-rows: auto minmax(0, 1fr) auto;
          overflow: hidden;
        }

        .editor-shell {
          height: 100%;
          min-height: 0;
          grid-template-rows: minmax(0, 1fr) auto;
          overflow: hidden;
        }

        .player-shell {
          height: 100%;
          max-height: none;
          aspect-ratio: auto;
          min-height: 0;
          display: flex;
          align-items: center;
          justify-content: center;
        }

        .player-shell video {
          display: block;
        }

        #result {
          max-height: 5.5rem;
          overflow: auto;
        }

        .transport-row {
          grid-template-columns: repeat(4, minmax(0, 1fr));
        }

        .controls {
          grid-template-columns: 1fr 1fr;
        }

        .controls > div {
          display: flex;
          align-items: center;
          gap: 0.45rem;
        }

        .controls label {
          margin: 0;
          min-width: 1.9rem;
          white-space: nowrap;
        }

        .controls input {
          flex: 1;
        }

        .timeline-tools {
          grid-template-columns: repeat(3, minmax(0, 1fr));
          max-width: min(100%, 700px);
        }

        .action-strip {
          max-width: 100%;
          grid-template-columns: repeat(7, minmax(0, 1fr));
        }

        .control-actions {
          grid-template-columns: minmax(180px, 260px) minmax(180px, 220px);
          justify-content: start;
        }

        .drawer {
          width: min(19rem, 30vw);
        }

        .drawer-right {
          display: none;
        }

        .desktop-side {
          display: grid;
          grid-template-rows: auto minmax(0, 1fr) auto;
          position: sticky;
          top: calc(var(--header-h) + 1.2rem);
          height: calc(100vh - var(--header-h) - 2.3rem);
          max-height: calc(100vh - var(--header-h) - 2.3rem);
          min-height: 0;
          align-content: start;
          overflow: hidden;
          border-color: var(--line-strong);
          background: rgba(8, 8, 8, 0.82);
        }

        .desktop-side .timeline-top {
          margin-bottom: 0.45rem;
          padding-bottom: 0.45rem;
          border-bottom: 1px solid var(--line);
        }

        #shots-island-desktop {
          min-height: 0;
          overflow: hidden;
        }

        .desktop-side .shots {
          min-height: 0;
          height: 100%;
          max-height: none;
          padding-right: 0.1rem;
        }

        #comments-island-desktop {
          min-height: 0;
          max-height: min(30vh, 18rem);
          overflow: hidden;
          border-top: 1px solid var(--line);
          padding-top: 0.65rem;
        }

        #comments-island-desktop .comments-section {
          height: 100%;
          margin-top: 0;
          grid-template-rows: auto minmax(0, 1fr);
        }

        #comments-island-desktop .comments-list {
          overflow: auto;
          padding-right: 0.1rem;
        }

        .mobile-only {
          display: none;
        }

        .desktop-only {
          display: inline-flex;
        }

        .preview-compact .player-shell {
          max-height: min(40vh, 20rem);
        }

        .preview-focus .player-shell {
          max-height: min(62vh, 34rem);
        }
      }

      @media (min-width: 1240px) {
        .layout {
          grid-template-columns: minmax(0, 1.85fr) minmax(340px, 0.92fr);
        }

        .media-panel,
        .shots-panel {
          padding: 0.9rem;
        }
      }

      /* ─── Timeline track wrapper (allows flags to overflow above) ─── */
      .timeline-track {
        position: relative;
        padding-top: 1rem; /* space for comment flags floating above the bar */
      }

      .comment-flags {
        position: absolute;
        inset: 0;
        pointer-events: none;
        overflow: visible;
      }

      .comment-flag {
        position: absolute;
        bottom: calc(100% - 0.9rem); /* align to top of the padding-top gap */
        width: 10px;
        height: 10px;
        border-radius: 2px;
        background: var(--editorial); /* fallback; overridden by inline style */
        transform: translateX(-50%);
        pointer-events: auto;
        cursor: pointer;
        border: none;
        padding: 0;
        transition: transform 0.1s, opacity 0.1s;
        opacity: 0.85;
      }

      .comment-flag:hover,
      .comment-flag:focus-visible {
        transform: translateX(-50%) scale(1.35);
        opacity: 1;
        outline: none;
      }

      .comment-flag-range {
        position: absolute;
        top: 1rem; /* align with the timeline bar */
        bottom: 0;
        background: rgba(249, 115, 22, 0.18); /* fallback; overridden by inline style */
        border-left: 2px solid var(--editorial);
        border-right: 2px solid var(--editorial);
        pointer-events: auto;
        cursor: pointer;
      }

      .comment-flag-range:hover {
        background: rgba(249, 115, 22, 0.28);
      }

      /* ─── Comments section ─── */
      .comments-section {
        display: grid;
        gap: 0.4rem;
        margin-top: 0.75rem;
        min-height: 0;
      }

      .comments-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.7rem;
        font-family: var(--display);
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted);
        padding-bottom: 0.3rem;
        border-bottom: 1px solid var(--line);
      }

      .comments-count {
        font-family: var(--mono);
        font-size: 0.65rem;
        color: var(--editorial);
      }

      .comments-list {
        display: grid;
        gap: 0.35rem;
        min-height: 0;
      }

      /* ─── Add comment form ─── */
      .comment-form {
        background: var(--panel);
        border: 1px solid var(--line-strong);
        border-left: 3px solid var(--editorial);
        border-radius: var(--radius-md);
        padding: 0.6rem 0.7rem;
        display: grid;
        gap: 0.4rem;
      }

      .comment-form-meta {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        flex-wrap: wrap;
      }

      .comment-type-badge {
        font-family: var(--mono);
        font-size: 0.58rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        padding: 0.12em 0.42em;
        border-radius: 3px;
        line-height: 1.5;
      }

      .comment-type-badge.cb-point {
        background: rgba(249, 115, 22, 0.18);
        color: var(--editorial);
      }

      .comment-type-badge.cb-range {
        background: rgba(249, 115, 22, 0.14);
        color: var(--editorial);
      }

      .comment-tc {
        font-family: var(--mono);
        font-size: 0.6rem;
        color: var(--text-muted);
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .comment-textarea {
        width: 100%;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--line);
        border-radius: 0.45rem;
        color: var(--text);
        font-family: var(--sans);
        font-size: 0.8rem;
        line-height: 1.5;
        padding: 0.45rem 0.55rem;
        resize: vertical;
        min-height: 3.5rem;
        box-sizing: border-box;
      }

      .comment-textarea:focus {
        outline: 2px solid var(--editorial);
        outline-offset: 1px;
      }

      .comment-form-actions {
        display: flex;
        gap: 0.35rem;
        justify-content: flex-end;
      }

      /* ─── Comment item ─── */
      .comment-item {
        border: 1px solid var(--line);
        border-left: 3px solid var(--cc, var(--editorial));
        border-radius: var(--radius-md);
        padding: 0.55rem 0.65rem;
        display: grid;
        gap: 0.3rem;
        transition: border-color 0.12s;
      }

      .comment-item.editing {
        border-left-color: var(--cc, var(--editorial));
        background: color-mix(in srgb, var(--cc, var(--editorial)) 5%, transparent);
      }

      .comment-item.highlighted {
        border-left-color: var(--cc, var(--accent));
        background: color-mix(in srgb, var(--cc, var(--accent)) 8%, transparent);
      }

      .comment-item-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
      }

      .comment-seek {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex: 1;
        min-width: 0;
        background: transparent;
        border: none;
        color: inherit;
        cursor: pointer;
        padding: 0;
        text-align: left;
      }

      .comment-seek:hover .comment-tc {
        color: var(--text);
      }

      .comment-item-actions {
        display: flex;
        gap: 0.2rem;
        flex-shrink: 0;
      }

      .icon-btn-sm {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 0.4rem;
        background: transparent;
        border: 1px solid var(--line);
        color: var(--text-muted);
        cursor: pointer;
        transition: background 0.12s, color 0.12s, border-color 0.12s;
        flex-shrink: 0;
      }

      .icon-btn-sm svg,
      .icon-btn-sm i {
        width: 13px;
        height: 13px;
        pointer-events: none;
      }

      .icon-btn-sm:hover {
        background: var(--panel-strong);
        color: var(--text);
      }

      .icon-btn-sm.danger:hover {
        background: rgba(229, 62, 62, 0.12);
        color: #e53e3e;
        border-color: #e53e3e;
      }

      .comment-text {
        font-size: 0.78rem;
        line-height: 1.55;
        color: var(--text-soft);
        margin: 0;
        white-space: pre-wrap;
        word-break: break-word;
      }

      .comments-empty {
        font-size: 0.76rem;
        color: var(--text-muted);
        margin: 0.2rem 0;
        font-style: italic;
      }
