:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65716c;
  --soft: #eef2ee;
  --paper: #f6f7f4;
  --panel: #ffffff;
  --line: #dbe2dc;
  --field: #355f4b;
  --field-dark: #243b31;
  --lime: #b8f36b;
  --coral: #f97368;
  --steel: #7195a5;
  --amber: #eeb54c;
  --shadow: 0 12px 30px rgba(23, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button,
.upload-drop,
.template-drop {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: #eef2ed;
}

.brand-block,
.section-row,
.panel-header,
.topbar,
.topbar-actions,
.legend {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--field);
  color: var(--lime);
  font-size: 16px;
  font-weight: 900;
}

.brand-block h1,
.topbar h2,
.panel-header h3,
.review-focus h3,
.section-row h2,
.player-card h4,
.coach-card h4 {
  margin: 0;
}

.brand-block h1 {
  font-size: 20px;
  line-height: 1.2;
}

.brand-block p,
.upload-drop small,
.job-item small,
.sidebar-note span,
.panel-header p,
.metric-card span,
.review-focus p,
.workflow-step small,
.player-card p,
.player-card small,
.coach-card li,
.readiness-item span,
.lane-item small {
  color: var(--muted);
  line-height: 1.55;
}

.brand-block p,
.upload-drop small,
.job-item small,
.sidebar-note span,
.panel-header p,
.metric-card span,
.workflow-step small,
.player-card p,
.player-card small,
.readiness-item span,
.lane-item small {
  font-size: 13px;
}

.upload-panel,
.queue-list,
.stat-bars,
.lane-list {
  display: grid;
  gap: 12px;
}

.upload-drop {
  min-height: 142px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #a8b5ad;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.upload-drop:hover,
.template-drop:hover {
  border-color: var(--field);
  background: #fff;
}

.upload-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--field-dark);
  background: var(--lime);
  font-size: 24px;
  line-height: 1;
}

.template-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.template-drop span,
.eyebrow,
.focus-label,
.metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.template-drop span,
.eyebrow,
.focus-label {
  text-transform: uppercase;
}

.template-drop strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 10px;
}

.primary-button,
.secondary-button,
.icon-button {
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  padding: 0 16px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.secondary-button {
  padding: 0 14px;
}

.icon-button {
  width: 40px;
  font-size: 16px;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.section-row,
.panel-header,
.topbar {
  justify-content: space-between;
  gap: 14px;
}

.section-row h2 {
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e2e9e3;
  color: #405149;
  font-size: 12px;
  font-weight: 800;
}

.pill.accent {
  background: var(--field-dark);
  color: var(--lime);
}

.job-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.job-item strong {
  font-size: 14px;
}

.job-item.active {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 20px rgba(23, 33, 29, 0.07);
}

.job-status {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--amber);
}

.job-status.done,
.job-status.running {
  background: var(--lime);
}

.job-status.failed {
  background: var(--coral);
}

.job-status.calibration {
  background: var(--steel);
}

.sidebar-note {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.sidebar-note strong {
  font-size: 14px;
}

.workspace {
  min-width: 0;
  padding: 28px;
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
}

.topbar h2 {
  font-size: 28px;
  line-height: 1.18;
  font-weight: 900;
}

.topbar-actions {
  gap: 10px;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  column-gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.workflow-step span {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8eee8;
  font-weight: 900;
}

.workflow-step.done span {
  background: var(--lime);
}

.workflow-step.active {
  border-color: rgba(249, 115, 104, 0.45);
  background: #fff8f6;
}

.workflow-step strong {
  font-size: 14px;
}

.review-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.58fr);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.focus-label {
  display: block;
  margin-bottom: 6px;
  color: var(--field);
}

.review-focus h3 {
  font-size: 21px;
  line-height: 1.35;
  font-weight: 900;
}

.review-focus p {
  margin: 0;
  font-size: 14px;
}

.calibration-panel[hidden] {
  display: none;
}

.calibration-panel {
  display: grid;
  gap: 14px;
}

.calibration-panel.is-complete {
  border-color: rgba(92, 122, 103, 0.48);
  background: #fbfdfb;
}

.calibration-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: stretch;
}

.calibration-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #16221e;
}

.calibration-video-wrap video,
.calibration-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.calibration-video-wrap video {
  object-fit: contain;
  background: #16221e;
}

.calibration-layer {
  cursor: crosshair;
}

.calibration-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.calibration-svg polygon {
  fill: rgba(180, 245, 104, 0.16);
  stroke: rgba(180, 245, 104, 0.88);
  stroke-width: 0.8;
}

.calibration-svg polyline {
  fill: none;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 0.25;
}

.calibration-handle {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}

.calibration-guide {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.calibration-guide strong {
  font-size: 15px;
}

.calibration-guide span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 18px;
}

.video-panel,
.metric-card,
.player-panel,
.court-map-panel,
.direction-panel,
.coaching-panel,
.calibration-panel,
.readiness-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.video-panel,
.player-panel,
.court-map-panel,
.direction-panel,
.coaching-panel,
.calibration-panel,
.readiness-panel {
  padding: 16px;
}

.panel-header h3 {
  font-size: 18px;
  line-height: 1.3;
}

.panel-header p {
  margin: 4px 0 0;
}

.video-stage {
  position: relative;
  margin-top: 14px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--field);
}

.mock-player {
  position: absolute;
  inset: 34px 58px;
  border: 2px solid rgba(255, 255, 255, 0.62);
}

.mock-player.doubles .player-token {
  position: absolute;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.p1 { left: 28%; top: 18%; background: var(--coral); }
.p2 { right: 26%; top: 24%; background: #d95f59; }
.p3 { left: 34%; bottom: 18%; background: var(--lime); color: var(--ink) !important; }
.p4 { right: 24%; bottom: 24%; background: #84c9a1; color: var(--ink) !important; }

.shuttle-dot,
.trajectory {
  position: absolute;
  border-radius: 999px;
}

.shuttle-dot {
  left: 51%;
  top: 44%;
  width: 10px;
  height: 10px;
  background: #fff;
}

.trajectory {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.t1 { left: 47%; top: 38%; opacity: 0.45; }
.t2 { left: 49%; top: 41%; opacity: 0.68; }
.t3 { left: 53%; top: 47%; opacity: 0.86; }
.t4 { left: 57%; top: 52%; opacity: 0.92; }

.video-panel {
  position: relative;
}

.video-panel::after {
  content: "AI 코칭 초안";
  position: absolute;
  right: 16px;
  bottom: 72px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(23, 33, 29, 0.76);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.timeline {
  position: relative;
  height: 40px;
  margin-top: 14px;
  border-radius: 8px;
  background: #eff3ee;
}

.segment,
.hit-marker {
  position: absolute;
  top: 13px;
  height: 14px;
  border-radius: 999px;
}

.segment {
  background: var(--steel);
}

.s1 { left: 4%; width: 20%; }
.s2 { left: 31%; width: 28%; }
.s3 { left: 68%; width: 22%; }

.hit-marker {
  width: 6px;
  background: var(--coral);
}

.h1 { left: 43%; }
.h2 { left: 77%; }
.h3 { left: 86%; }

.summary-column {
  display: grid;
  gap: 12px;
}

.metric-card {
  display: grid;
  align-content: center;
  min-height: 118px;
  padding: 16px 18px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 900;
  word-break: keep-all;
}

.metric-card.experimental {
  border-color: rgba(249, 115, 104, 0.38);
  background: #fff8f6;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.player-panel,
.coaching-panel,
.calibration-panel,
.readiness-panel {
  grid-column: 1 / -1;
}

.player-grid,
.coach-grid,
.readiness-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.player-card,
.coach-card,
.readiness-item,
.lane-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.player-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.player-card header,
.lane-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.player-card h4,
.coach-card h4,
.readiness-item strong {
  font-size: 15px;
}

.player-role,
.stat-bar label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.player-score {
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.stat-bar {
  display: grid;
  gap: 4px;
}

.stat-bar label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.bar-track,
.lane-meter {
  border-radius: 999px;
  background: #e8eee8;
  overflow: hidden;
}

.bar-track {
  height: 7px;
}

.bar-fill,
.lane-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar-fill {
  background: var(--field);
}

.bar-fill.balance {
  background: var(--steel);
}

.bar-fill.pressure {
  background: var(--coral);
}

.court-map {
  position: relative;
  height: 260px;
  margin-top: 14px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  overflow: hidden;
  background: var(--field);
}

.density {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
}

.upper-a { left: 22%; top: 16%; width: 100px; height: 72px; background: rgba(249, 115, 104, 0.52); }
.upper-b { left: 54%; top: 30%; width: 72px; height: 52px; background: rgba(249, 115, 104, 0.34); }
.lower-a { left: 48%; bottom: 14%; width: 118px; height: 84px; background: rgba(184, 243, 107, 0.46); }
.lower-b { left: 18%; bottom: 31%; width: 82px; height: 60px; background: rgba(184, 243, 107, 0.28); }

.map-net {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.72);
}

.legend {
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 999px;
}

.upper-dot { background: var(--coral); }
.lower-dot { background: var(--lime); }

.lane-list {
  margin-top: 14px;
}

.lane-item {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.lane-item header {
  font-weight: 900;
  font-size: 14px;
}

.lane-meter {
  height: 9px;
}

.lane-meter span {
  background: var(--amber);
}

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

.coach-card,
.readiness-item {
  padding: 14px;
}

.coach-card.training {
  background: #f7fbef;
  border-color: rgba(184, 243, 107, 0.55);
}

.coach-card ul {
  display: grid;
  gap: 9px;
  padding-left: 18px;
  margin: 12px 0 0;
}

.readiness-item {
  display: grid;
  gap: 8px;
}

@media (max-width: 1180px) {
  .hero-dashboard,
  .analysis-layout,
  .review-focus,
  .calibration-workbench {
    grid-template-columns: 1fr;
  }

  .player-grid,
  .coach-grid,
  .workflow-strip,
  .readiness-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .topbar-actions,
  .panel-header {
    align-items: flex-start;
  }

  .topbar,
  .topbar-actions {
    flex-direction: column;
  }

  .topbar-actions,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .button-row,
  .player-grid,
  .coach-grid,
  .workflow-strip,
  .readiness-grid {
    grid-template-columns: 1fr;
  }

  .mock-player {
    inset: 24px;
  }

  .metric-card strong {
    font-size: 25px;
  }
}
/* Upload robustness: long mobile messenger filenames must never push the layout. */
.sidebar,
.upload-panel,
.upload-drop,
.template-drop,
.queue-list,
.job-item,
.job-item span,
.button-row {
  min-width: 0;
  max-width: 100%;
}

.upload-drop strong,
.upload-drop small,
.job-item strong,
.job-item small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-drop strong,
.job-item strong {
  white-space: nowrap;
}

.upload-drop small,
.job-item small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.workspace {
  overflow-x: hidden;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 276px minmax(0, 1fr);
  }

  .sidebar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .workspace {
    padding-left: 22px;
    padding-right: 22px;
  }

  .hero-dashboard {
    grid-template-columns: minmax(0, 1fr) 252px;
  }
}
.vacancy-panel {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.vacancy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.vacancy-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.vacancy-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.vacancy-card h4 {
  margin: 0;
  font-size: 15px;
}

.vacancy-card header span,
.vacancy-card p,
.vacancy-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.vacancy-card p {
  margin: 0;
}

.vacancy-card header strong {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  color: var(--coral);
}

.vacancy-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vacancy-zones span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff0ed;
  color: #8e3b35;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 680px) {
  .vacancy-grid {
    grid-template-columns: 1fr;
  }
}

