:root {
  --bg: #090e1a;
  --surface: #111827;
  --surface-2: #1a2335;
  --border: #233046;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #dc2626;
  --accent-hover: #b91c1c;
  --accent-soft: rgba(220, 38, 38, 0.16);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.15);
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.16);
  --purple: #d8b4fe;
  --purple-strong: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.2);
  --purple-border: rgba(192, 132, 252, 0.55);
  --gold: #f59e0b;
  --silver: #cbd5e1;
  --bronze: #d97706;
  --radius: 12px;
  --mono: 'Consolas', 'D2Coding', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

body {
  background: radial-gradient(circle at top right, #18233a 0%, var(--bg) 52%);
  color: var(--text);
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Segoe UI', -apple-system, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 84px;
}

code {
  font-family: var(--mono);
  background: rgba(148, 163, 184, 0.14);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}

.hidden {
  display: none !important;
}

/* 상단 헤더 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(9, 14, 26, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PC 네비게이션 */
.desktop-nav {
  display: none;
  gap: 6px;
  background: var(--surface);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  color: var(--text);
}

.nav-btn.active {
  background: var(--accent);
  color: #fff;
}

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

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: #233049;
}

.btn-sm {
  font-size: 12px;
  padding: 6px 10px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.spin {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 컨테이너 */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* 히어로 배너 */
.hero-card {
  background: linear-gradient(135deg, #1b1118 0%, #131c2e 55%, #111827 100%);
  border: 1px solid #38232d;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.hero-track {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.hero-track-en {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hero-right {
  display: flex;
  gap: 10px;
}

.stat-pill {
  flex: 1;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--mono);
  margin-top: 2px;
}

/* 배지 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.badge-live {
  background: var(--accent-soft);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.badge-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.badge-muted {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.badge-done {
  background: var(--green-soft);
  color: #86efac;
}

.badge-upcoming {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

/* 툴바 카드 */
.toolbar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 4px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: var(--surface-2);
  color: #fff;
  box-shadow: inset 0 0 0 1px #364968;
}

.filter-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.input-select,
.input-date,
.input-text {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13.5px;
  width: 100%;
  outline: none;
}

.input-select:focus,
.input-date:focus,
.input-text:focus {
  border-color: var(--accent);
}

/* 일반 카드 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 리더보드 행 (모바일 친화 + 데스크톱 정렬) */
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.lb-row-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.lb-row:hover {
  border-color: #3f5578;
}

.lb-row.rank-1 {
  border-left: 3px solid var(--purple-strong);
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.14) 0%, var(--surface-2) 52%);
}

.lb-row.rank-2 {
  border-left: 3px solid var(--silver);
}

.lb-row.rank-3 {
  border-left: 3px solid var(--bronze);
}

.rank-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--mono);
  font-size: 14px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
}

.rank-1 .rank-badge {
  background: #7e22ce;
  color: #ffffff;
  border: 1px solid #a855f7;
}

/* 최단 시간 셀: 보라색 배경 + 굵은 흰색 글씨 (ACC / F1 스타일) */
.lap-time.is-purple,
.purple-cell {
  background: #9333ea !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-block;
  text-shadow: none;
}

.data-table td.purple-td {
  background: #9333ea !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* 세션별 타임(연습/예선/레이스) 및 섹터(S1/S2/S3) 칩 */
.session-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  font-size: 11.5px;
}

.session-chip-label {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
}

.session-chip-time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #e2e8f0;
}

.session-chip.is-purple {
  background: #9333ea;
  border-color: #a855f7;
}

.session-chip.is-purple .session-chip-label {
  color: #f3e8ff;
  font-weight: 800;
}

.session-chip.is-purple .session-chip-time {
  color: #ffffff;
  font-weight: 800;
}

.sector-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 2px;
}

.rank-2 .rank-badge {
  background: rgba(203, 213, 225, 0.2);
  color: #e2e8f0;
}

.rank-3 .rank-badge {
  background: rgba(217, 119, 6, 0.22);
  color: #fdba74;
}

.driver-col {
  min-width: 0;
}

.driver-name {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.time-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.lap-time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

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

.gap-text {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* 증감 배지 */
.delta-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}

.delta-faster {
  background: var(--green-soft);
  color: var(--green);
}

.delta-slower {
  background: var(--red-soft);
  color: var(--red);
}

.delta-same {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.delta-new {
  background: var(--blue-soft);
  color: var(--blue);
  font-family: inherit;
}

/* 드라이버 격차 바 */
.gap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gap-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.gap-row.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.45);
}

.gap-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.gap-driver-info {
  font-size: 13.5px;
  font-weight: 700;
}

.gap-driver-car {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
}

.gap-times {
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}

.gap-bar-track {
  height: 7px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.gap-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #dc2626, #f97316);
}

.gap-row:first-child .gap-bar-fill {
  background: linear-gradient(90deg, #9333ea, #c084fc);
}

/* 꺾은선 차트 */
.chart-tooltip-bar {
  font-size: 12px;
  font-family: var(--mono);
  color: #e2e8f0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
}

.chart-wrapper {
  width: 100%;
  overflow-x: auto;
}

.trend-svg {
  width: 100%;
  min-width: 320px;
  height: 250px;
  display: block;
}

.chart-point {
  cursor: pointer;
  transition: r 0.12s ease;
}

/* 일별 기록 테이블 */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
}

.data-table td.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* 주간 트랙 일정표 */
.schedule-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.week-card:hover {
  border-color: #3f5578;
}

.week-card.status-current {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.14) 0%, var(--surface) 60%);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35);
}

.week-card.status-completed {
  border-color: #263948;
}

.week-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.week-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.week-card.status-current .week-num {
  color: #fca5a5;
}

.week-track-ko {
  font-size: 16px;
  font-weight: 800;
}

.week-track-en {
  font-size: 11.5px;
  color: var(--text-muted);
}

.week-dates {
  font-size: 12px;
  font-family: var(--mono);
  color: #cbd5e1;
  margin-top: 8px;
}

.week-winner {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.winner-name {
  font-weight: 700;
  color: #fde68a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-time {
  font-family: var(--mono);
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* === F1 스타일 서킷 맵 & 섹터 최단 기록 카드 === */
.circuit-card {
  padding: 16px;
}

.circuit-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
}

.circuit-map-panel {
  background: radial-gradient(circle at center, #131e33 0%, #0a101f 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  position: relative;
}

.circuit-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.circuit-meta-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.circuit-meta-specs {
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--text-muted);
}

.circuit-svg {
  width: 100%;
  height: auto;
  max-height: 250px;
  display: block;
}

.track-sector-path {
  cursor: pointer;
  transition: stroke-width 0.16s ease, opacity 0.16s ease;
}

.map-sector-pin {
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.circuit-svg.has-highlight .track-sector-path {
  opacity: 0.32;
}

.circuit-svg.has-highlight .track-sector-path.active {
  opacity: 1;
  stroke-width: 7.5;
  filter: url(#sectorGlow);
}

.circuit-svg.has-highlight .map-sector-pin {
  opacity: 0.45;
}

.circuit-svg.has-highlight .map-sector-pin.active {
  opacity: 1;
}

.circuit-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 4px;
  border-radius: 999px;
}

.sector-records-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sector-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.sector-panel-title {
  font-size: 13.5px;
  font-weight: 800;
}

.sector-panel-scope {
  font-size: 11px;
  color: var(--text-muted);
}

.sector-record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sector-record-card[data-sector="s1"] {
  border-left-color: #ef4444;
}

.sector-record-card[data-sector="s2"] {
  border-left-color: #38bdf8;
}

.sector-record-card[data-sector="s3"] {
  border-left-color: #facc15;
}

.sector-record-card.active,
.sector-record-card:hover {
  background: #212d44;
  border-color: #475569;
}

.sector-record-card[data-sector="s1"].active,
.sector-record-card[data-sector="s1"]:hover {
  border-left-color: #ef4444;
}

.sector-record-card[data-sector="s2"].active,
.sector-record-card[data-sector="s2"]:hover {
  border-left-color: #38bdf8;
}

.sector-record-card[data-sector="s3"].active,
.sector-record-card[data-sector="s3"]:hover {
  border-left-color: #facc15;
}

.sector-rec-left {
  min-width: 0;
}

.sector-rec-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.sector-pill-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 4px;
}

.sector-pill-s1 { background: #ef4444; color: #fff; }
.sector-pill-s2 { background: #38bdf8; color: #090e1a; }
.sector-pill-s3 { background: #facc15; color: #090e1a; }

.sector-rec-holder {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-rec-car {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-rec-time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  flex-shrink: 0;
}

.sector-summary-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.sector-summary-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.sector-summary-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sector-summary-value {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 800;
}

.sector-summary-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* 모바일 하단 탭 바 */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 9px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.mobile-nav-btn svg {
  width: 21px;
  height: 21px;
}

.mobile-nav-btn.active {
  color: #f87171;
}

/* 모달 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
}

.icon-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.form-group label {
  font-size: 13px;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--blue);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.info-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.info-box-title {
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 6px;
}

.network-urls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 13px;
  color: #7dd3fc;
}

/* 토스트 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  z-index: 200;
  background: #1e293b;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  max-width: 92vw;
  text-align: center;
}

/* 모바일 헤더 컴팩트 처리 */
@media (max-width: 540px) {
  .header-actions .btn-label {
    display: none;
  }
  .header-actions .btn {
    padding: 8px 11px;
  }
}

/* 태블릿 / 데스크톱 반응형 */
@media (min-width: 768px) {
  body {
    padding-bottom: 28px;
  }

  .desktop-nav {
    display: flex;
  }

  .mobile-bottom-nav {
    display: none;
  }

  .hero-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero-right {
    min-width: 280px;
  }

  .toolbar-card {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .segmented {
    min-width: 340px;
  }

  .filter-group {
    grid-template-columns: minmax(220px, 1fr) 160px;
  }

  .filter-group.wide {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .schedule-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .schedule-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .circuit-layout {
    grid-template-columns: 1.25fr 1fr;
  }

  .toast {
    bottom: 26px;
  }
}

@media (min-width: 1024px) {
  .schedule-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
