  :root {
    --bg-dark: #0a0e17;
    --card-bg: #131b2e;
    --card-border: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-neon: #10b981;
    --accent-gold: #facc15;
    --accent-cyan: #06b6d4;
    --accent-orange: #f97316;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --danger: #ef4444;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 60px;
  }

  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
  }

  header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--card-border);
  }

  .header-title {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .header-title h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #38bdf8, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

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

  /* 요약 카드 */
  .grid-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }

  .stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
  }

  .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-neon), var(--accent-cyan));
  }

  .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 4px;
  }

  .stat-unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
  }

  .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
  }

  input[type="number"],
  input[type="time"],
  input[type="text"] {
    width: 100%;
    background: #0b1120;
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 12px 14px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
  }

  .btn-quick-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
  }

  .btn-quick {
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
  }

  .btn-quick:hover {
    background: #334155;
    color: #fff;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
  }

  .btn:hover {
    background: #1d4ed8;
  }

  .btn:active {
    transform: scale(0.98);
  }

  .btn-outline {
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
  }

  .btn-outline:hover {
    background: #1e293b;
    color: #fff;
  }

  .btn-green {
    background: #059669;
  }
  .btn-green:hover {
    background: #047857;
  }

  .btn-danger {
    background: #dc2626;
    color: #fff;
  }
  .btn-danger:hover {
    background: #b91c1c;
  }

  /* 테이블 섹션 */
  .table-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 28px;
  }

  .table-container {
    overflow-x: auto;
    max-height: 520px;
    margin-top: 16px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
  }

  th {
    background: #0b1120;
    color: #94a3b8;
    padding: 12px 14px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--card-border);
  }

  td {
    padding: 11px 14px;
    border-bottom: 1px solid #1a2234;
    color: #e2e8f0;
  }

  tr:hover {
    background: rgba(255, 255, 255, 0.03);
  }

  tr.active-row {
    background: rgba(16, 185, 129, 0.12) !important;
    border-left: 3px solid var(--accent-neon);
  }

  /* Time of Day 확실한 시간 vs 유추 시간 스타일링 */
  .row-verified {
    background: rgba(16, 185, 129, 0.08);
  }
  .row-verified:hover {
    background: rgba(16, 185, 129, 0.15) !important;
  }

  .time-verified {
    color: #34d399 !important;
    font-weight: 700 !important;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
  }

  .time-estimated {
    color: #93c5fd !important;
  }

  .badge-tag-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.2px;
  }

  .badge-tag-estimated {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
  }

  /* 이미지 갤러리 섹션 */
  .images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 18px;
    margin-top: 18px;
  }

  .img-preview-card {
    background: #0b1120;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
  }

  .img-preview-card:hover {
    border-color: #334155;
    transform: translateY(-2px);
  }

  .img-preview-card img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: top;
    background: #000;
  }

  .img-card-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 38, 38, 0.85);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: background 0.15s, transform 0.1s;
  }

  .img-card-delete-btn:hover {
    background: #ef4444;
    transform: scale(1.05);
  }

  .img-card-info {
    padding: 12px 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0b1120;
  }

  .tag {
    display: inline-block;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #1e293b;
    color: #94a3b8;
  }

  .legend-box {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    background: #090e1a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 0.8rem;
  }

  /* 반응형 */
  @media (max-width: 640px) {
    .header-title h1 {
      font-size: 1.3rem;
    }
  }

  /* 대회별 추천 영상 */
  .race-rec-box { margin-top: 16px; background: #090e1a; border: 1px solid #1e293b; border-radius: 12px; padding: 16px; }
  .race-rec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
  .race-rec-head h4 { font-size: 1rem; font-weight: 800; color: #f1f5f9; }
  .race-rec-head span { font-size: 0.74rem; color: #64748b; }
  /* 날짜 선택(왼쪽) → 그날 대회 선택(오른쪽). 기본 select 라 누르면 세로 목록으로 고른다 */
  .race-pick-row { display: flex; gap: 8px; margin-bottom: 8px; }
  .race-pick { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .race-pick.date { flex: 0 0 210px; }
  .race-pick.name { flex: 1; }
  .race-pick span { font-size: 0.74rem; font-weight: 700; color: #94a3b8; }
  .race-pick select { width: 100%; min-width: 0; background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 10px;
    padding: 9px 12px; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
  .race-pick select:hover, .race-pick select:focus { border-color: #38bdf8; outline: none; }
  .race-pick.date select { border-color: rgba(250,204,21,0.5); color: #fde047; }
  @media (max-width: 480px) { .race-pick.date { flex-basis: 42%; } }
  .race-meta { font-size: 0.78rem; color: #94a3b8; margin: 4px 0 10px; }
  .race-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; max-height: 520px; overflow-y: auto; padding-right: 2px; }
  .race-video-card { display: flex; flex-direction: column; text-align: left; background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; overflow: hidden; cursor: pointer; color: inherit; text-decoration: none; padding: 0; font: inherit; transition: all 0.15s; }
  .race-video-card:hover { border-color: #ef4444; transform: translateY(-1px); }
  .race-video-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; display: block; }
  .race-video-card .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 5px; }
  .race-video-card .t { font-size: 0.82rem; font-weight: 700; color: #e2e8f0; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .race-video-card .c { font-size: 0.72rem; color: #64748b; }
  .race-video-card .tags { display: flex; gap: 4px; flex-wrap: wrap; }
  .race-video-card .tag { font-size: 0.68rem; padding: 2px 6px; border-radius: 4px; background: #1e293b; color: #cbd5e1; }
  .race-video-card .tag.km { background: rgba(16,185,129,0.15); color: #34d399; }
  .race-video-card .tag.fin { background: rgba(250,204,21,0.12); color: #fde047; }
  .race-video-card .tag.clock { background: rgba(56,189,248,0.12); color: #7dd3fc; }
  .race-empty { font-size: 0.84rem; color: #64748b; padding: 18px; text-align: center; border: 1px dashed #334155; border-radius: 10px; }
  @media (max-width: 600px) { .race-video-grid { grid-template-columns: 1fr 1fr; } .race-video-card .body { padding: 6px 8px 8px; } }

  /* 유튜브 분석기 스타일 */
  .yt-section-card {
    background: linear-gradient(145deg, #131b2e, #0c1322);
    border: 1px solid #1e3a5f;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
  }

  .yt-section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #f97316, #06b6d4, #10b981);
  }

  .yt-input-container {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
  }

  .yt-input-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
  }

  .yt-url-input {
    width: 100%;
    background: #080d1a !important;
    border: 1px solid #334155 !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    color: #fff !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 0.2s;
  }

  .yt-url-input:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
  }

  .btn-yt-analyze {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 50px;
  }

  .btn-yt-analyze:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  }

  .yt-result-container {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  @media (max-width: 900px) {
    .yt-result-container {
      grid-template-columns: 1fr;
    }
  }

  .yt-meta-box {
    background: #090e1a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .yt-video-summary {
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }

  .yt-thumb {
    width: 140px;
    height: 85px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #334155;
    background: #000;
    flex-shrink: 0;
  }

  .yt-title-info h4 {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.4;
    color: #f1f5f9;
    margin-bottom: 4px;
  }

  .yt-title-info .channel-name {
    font-size: 0.8rem;
    color: #94a3b8;
  }

  .yt-analysis-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }

  .analysis-pill {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 9999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .analysis-pill.neon {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
  }

  .analysis-pill.orange {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.35);
    color: #fb923c;
  }

  .yt-expl-list {
    background: #060a14;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 12px 14px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.84rem;
    color: #cbd5e1;
  }

  .yt-clip-controls {
    background: #090e1a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .clip-time-setter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .clip-range-display {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
    text-align: center;
  }

  .clip-range-display .range-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
  }

  .clip-range-display .range-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #10b981;
    font-family: monospace;
    margin-top: 2px;
  }

  .btn-download-clip {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  }

  .btn-download-clip:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  }

  .btn-download-clip:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
  }

  .clip-player-box {
    margin-top: 14px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #22c55e;
    background: #000;
  }

  .clip-player-box video {
    width: 100%;
    max-height: 280px;
    display: block;
  }

/* ===== Step 접기/펼치기 ===== */
.step-card { background: #0f172a; border: 1px solid #1e293b; border-radius: 14px; margin-top: 20px; overflow: hidden; }
.step-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; user-select: none; }
.step-header:hover { background: rgba(255,255,255,0.03); }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: #10b981; color: #04130d; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-title { flex: 1; }
.step-title h2 { font-size: 1.15rem; font-weight: 800; color: #fff; }
.step-title p { font-size: 0.82rem; color: #94a3b8; margin-top: 2px; }
.step-chevron { font-size: 1.3rem; color: #94a3b8; transition: transform 0.2s; }
.step-card.collapsed .step-chevron { transform: rotate(-90deg); }
.step-body { padding: 4px 20px 20px; }
.step-card.collapsed .step-body { display: none; }
.step-footer { display: flex; justify-content: flex-end; margin-top: 20px; }
.step-next-btn { padding: 12px 22px; font-size: 0.95rem; }

/* ===== 인라인 스타일에서 분리한 레이아웃 클래스 ===== */
html { -webkit-text-size-adjust: 100%; }
img, video, iframe { max-width: 100%; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.ocr-status { align-self: center; margin-right: 14px; font-size: 0.85rem; color: #94a3b8; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.table-filter-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.laps-table th, .laps-table td { white-space: nowrap; }
.quick-row { display: flex; gap: 6px; flex-wrap: wrap; }
.clip-action-row { display: flex; gap: 10px; margin-top: 4px; }
.btn-open-yt { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; text-decoration: none; border-color: #ef4444; color: #f87171; font-weight: 700; }

.badge { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; border: 1px solid; white-space: nowrap; }
.yt-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.yt-head-main { flex: 1 1 320px; min-width: 0; }
.yt-head-title { display: flex; align-items: center; gap: 10px; }
.yt-head-icon { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 8px; padding: 6px; display: flex; flex-shrink: 0; }
.yt-head h3 { font-size: 1.25rem; font-weight: 800; color: #fff; }
.yt-head p { color: var(--text-muted); font-size: 0.84rem; margin-top: 2px; }
.yt-head-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.race-kind-hint { font-size: 0.74rem; color: #64748b; margin: -4px 0 10px; }

.yt-title-info { flex: 1; min-width: 0; }
.yt-title-info h4 { overflow-wrap: anywhere; }
.yt-expl-list li { overflow-wrap: anywhere; }
.yt-edit-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: #090e1a; border: 1px solid #334155; border-radius: 10px; padding: 10px 12px; }
.yt-edit-field label { display: block; font-size: 0.72rem; color: #94a3b8; margin-bottom: 3px; }
.yt-edit-row input.yt-edit-input { padding: 6px 8px; border-radius: 6px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; font-size: 0.9rem; font-weight: 500; }
.yt-edit-row input.yt-edit-input.dist { width: 110px; }
.yt-edit-row input.yt-edit-input.start { width: 130px; }
.yt-edit-btn { padding: 7px 14px; border-radius: 6px; border: none; background: #38bdf8; color: #0a0e17; font-weight: 700; cursor: pointer; }
.yt-edit-hint { font-size: 0.72rem; color: #64748b; }

/* ===== 모바일 (휴대폰 360~430px 기준) ===== */
@media (max-width: 640px) {
  body { padding-bottom: 32px; }
  .container { padding: 16px 12px; }

  /* 헤더 */
  header { gap: 12px; margin-bottom: 16px; padding-bottom: 14px; }
  header > div:first-child { width: 100%; }
  .header-title { gap: 8px; }
  .header-title svg { width: 24px; height: 24px; flex-shrink: 0; }
  .header-title h1 { font-size: 1.22rem; line-height: 1.3; word-break: keep-all; }
  .header-actions { width: 100%; display: grid; grid-template-columns: 1fr; gap: 8px; }
  .header-actions .btn { justify-content: center; text-align: center; min-height: 42px; padding: 8px 10px; font-size: 0.8rem; line-height: 1.25; }

  /* 공통 버튼·입력 터치 크기 */
  .btn { min-height: 40px; }
  .btn-quick { min-height: 38px; padding: 6px 12px; font-size: 0.8rem; }
  input[type="number"], input[type="time"], input[type="text"] { font-size: 16px; min-height: 44px; }
  input[type="range"] { height: 10px; }

  /* Step 카드 */
  .step-card { margin-top: 14px; border-radius: 12px; }
  .step-header { gap: 10px; padding: 14px 12px; }
  .step-num { width: 30px; height: 30px; font-size: 0.9rem; }
  .step-title { min-width: 0; }
  .step-title h2 { font-size: 1.02rem; line-height: 1.35; word-break: keep-all; }
  .step-title p { font-size: 0.76rem; word-break: keep-all; }
  .step-chevron { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .step-body { padding: 0 10px 14px; }
  .step-footer { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 14px; }
  .step-footer .ocr-status { margin-right: 0; align-self: auto; text-align: center; }
  .step-next-btn { width: 100%; justify-content: center; min-height: 48px; }

  .table-card { padding: 14px 12px; margin-bottom: 16px; border-radius: 12px; }
  .table-card h3 { font-size: 1rem !important; line-height: 1.35; word-break: keep-all; }
  .section-head > div:first-child { min-width: 0; flex: 1 1 100%; }

  /* Step 1 업로드·갤러리 */
  .upload-btn { width: 100%; justify-content: center; min-height: 44px; }
  .images-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
  .img-preview-card img { height: 210px; }
  .img-preview-card:hover { transform: none; }
  .img-card-delete-btn { top: 6px; right: 6px; padding: 6px 10px; min-height: 36px; }
  .img-card-info { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px; font-size: 0.74rem; }
  .img-card-info > span:first-child { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Step 2 요약·변환기 */
  .grid-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .stat-card { padding: 12px; }
  .stat-label { font-size: 0.66rem; letter-spacing: 0; word-break: keep-all; }
  .stat-value { font-size: 1.15rem; }
  .stat-value input[type="time"] { min-height: 0; font-size: 1rem !important; max-width: 100%; }
  .legend-box { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 0.76rem; }
  .legend-item { flex-wrap: wrap; }

  /* Step 2 타임테이블: 표 안에서만 가로 스크롤, 첫 열 고정 */
  .table-filter-btns { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .table-filter-btns .btn { justify-content: center; text-align: center; font-size: 0.78rem; padding: 8px; line-height: 1.25; }
  .table-container { max-height: 60vh; margin-top: 12px; -webkit-overflow-scrolling: touch; }
  .laps-table { font-size: 0.8rem; }
  .laps-table th { padding: 10px; font-size: 0.76rem; }
  .laps-table td { padding: 9px 10px; }
  .laps-table td[style*="font-size: 1rem"] { font-size: 0.86rem !important; }
  .laps-table th:first-child, .laps-table td:first-child { position: sticky; left: 0; z-index: 1; background: #111a2c; box-shadow: 1px 0 0 #1e293b; }
  .laps-table th:first-child { z-index: 3; background: #0b1120; }
  .laps-table tr.row-verified td:first-child { background: #11272a; }

  /* Step 3 유튜브 섹션 */
  .yt-section-card { padding: 16px 12px; border-radius: 12px; }
  .yt-head { gap: 10px; }
  .yt-head-main { flex-basis: 100%; }
  .yt-head-title { align-items: flex-start; }
  .yt-head-icon svg { width: 18px; height: 18px; }
  .yt-head h3 { font-size: 1.02rem; line-height: 1.35; word-break: keep-all; }
  .yt-head p { font-size: 0.78rem; word-break: keep-all; }

  .race-rec-box { padding: 12px 10px; }
  .race-video-grid { max-height: 70vh; gap: 8px; }
  .race-video-card .t { font-size: 0.78rem; }

  .yt-input-container { flex-direction: column; }
  .yt-input-wrapper { min-width: 0; width: 100%; }
  .btn-yt-analyze { width: 100%; justify-content: center; min-height: 48px; padding: 0 14px; font-size: 0.9rem; }

  .yt-result-container { margin-top: 16px; gap: 14px; }
  .yt-meta-box, .yt-clip-controls { padding: 12px; gap: 12px; }
  .yt-thumb { width: 112px; height: 63px; }
  .yt-video-summary { gap: 10px; }
  .yt-title-info h4 { font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .analysis-pill { font-size: 0.74rem; }
  .yt-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
  .yt-edit-row input.yt-edit-input.dist, .yt-edit-row input.yt-edit-input.start { width: 100%; font-size: 16px; min-height: 40px; }
  .yt-edit-btn, .yt-edit-hint { grid-column: 1 / -1; }
  .yt-edit-btn { min-height: 42px; }
  .yt-expl-list { font-size: 0.8rem; padding: 10px 12px; }
  #ytTimestampQuickBtns .btn-quick { width: 100%; text-align: left; }
  .yt-clip-controls h4 { font-size: 1rem !important; }
  .clip-range-display .range-val { font-size: 1.15rem; }
  .clip-time-setter { gap: 8px; }
  .clip-time-setter label { font-size: 0.76rem; }
  .quick-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-row .btn-quick { padding: 6px 4px; }
  #ytTimestampQuickBtns { grid-template-columns: 1fr; }
  .clip-action-row { flex-direction: column; }
  .clip-action-row .btn-download-clip { font-size: 0.95rem; padding: 12px; min-height: 48px; }
  .btn-open-yt { min-height: 44px; }
}

/* 로고는 상단 바(.topbar)가 보여주므로 변환기 헤더에는 액션만 남긴다 */

/* 촬영 지점·시작 시각 자동 추출 실패 팝업 */
.yt-fail-dialog { max-width: 420px; width: calc(100% - 32px); margin: auto; background: #131b2e; color: #e2e8f0; border: 1px solid #f97316; border-radius: 14px; padding: 20px; }
.yt-fail-dialog::backdrop { background: rgba(2, 6, 23, 0.7); }
.yt-fail-dialog h3 { font-size: 1.05rem; margin-bottom: 10px; color: #fdba74; }
.yt-fail-dialog p { font-size: 0.9rem; line-height: 1.55; margin-bottom: 8px; }
.yt-fail-dialog strong { color: #fdba74; }
.yt-fail-dialog ul { font-size: 0.82rem; color: #94a3b8; margin: 4px 0 16px 18px; line-height: 1.6; }
.yt-fail-dialog .btn { width: 100%; justify-content: center; }
.yt-edit-row input.yt-edit-input.missing { border-color: #f97316; box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25); }

/* Step 2: 추출 결과 확인 안내 + 추출값 직접 수정 */
.ocr-review { background: #090e1a; border: 1px solid #334155; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.ocr-review.extracted { border-color: rgba(16, 185, 129, 0.5); background: rgba(16, 185, 129, 0.06); }
.ocr-review.empty { border-color: rgba(249, 115, 22, 0.5); background: rgba(249, 115, 22, 0.06); }
.ocr-review.edited { border-color: rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.05); }
.ocr-review-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.ocr-review-title { font-weight: 800; font-size: 1rem; color: #f1f5f9; }
.ocr-review-head p { font-size: 0.84rem; color: #94a3b8; margin-top: 2px; }
.parsed-editor { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.parsed-editor[hidden] { display: none; }
.parsed-block h4 { font-size: 0.92rem; margin-bottom: 4px; color: #e2e8f0; }
.parsed-hint { font-size: 0.76rem; color: #64748b; margin-bottom: 8px; }
.parsed-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-bottom: 8px; }
.parsed-table th { text-align: left; font-size: 0.72rem; color: #94a3b8; font-weight: 600; padding: 4px; }
.parsed-table td { padding: 3px 4px; }
.parsed-table input { width: 100%; min-width: 0; padding: 6px 8px; border-radius: 6px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; font: inherit; font-family: monospace; }
.parsed-table input:focus { outline: none; border-color: #38bdf8; }
.parsed-table input.bad { border-color: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25); }
.parsed-table .lap-no { color: #94a3b8; font-weight: 700; white-space: nowrap; width: 1%; }
.parsed-del { background: none; border: none; color: #64748b; cursor: pointer; font-size: 0.9rem; padding: 4px 6px; }
.parsed-del:hover { color: #f87171; }
.est-mark { font-size: 0.66rem; font-weight: 700; color: #fbbf24; background: rgba(251, 191, 36, 0.12); border-radius: 4px; padding: 1px 4px; }
.parsed-scroll { max-height: 340px; overflow-y: auto; margin-bottom: 8px; }
.parsed-scroll .parsed-table { margin-bottom: 0; }
.parsed-scroll thead th { position: sticky; top: 0; background: #090e1a; }
.parsed-table td:last-child, .parsed-table th:last-child { width: 32px; }
.parsed-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.parsed-error { flex: 1; color: #f87171; font-size: 0.82rem; min-width: 200px; }

/* Step 1 사진 버튼 묶음 (전체 사진 비우기 + 새 사진 업로드) */
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* 공용 확인 팝업 */
.confirm-dialog { border-color: #334155; }
.confirm-dialog p { font-size: 0.95rem; margin-bottom: 16px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-dialog .confirm-actions .btn { width: auto; }
.need-start-input { width: 100%; font-size: 1.1rem; padding: 8px 10px; margin-bottom: 4px; background: #0b1222; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; }
.need-start-err { min-height: 1.2em; font-size: 0.8rem !important; color: #f87171; }
