:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --row-h: 52px;
  --event-row-h: 36px;
  --label-w: 120px;
  --axis-h: 40px;
  --radius: 6px;
  --font: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.header h1,
.event-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.event-title {
  color: var(--text);
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.now-line-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.now-line-switch-label {
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
}

.now-line-switch {
  position: relative;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}

.now-line-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.now-line-switch-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #334155;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.now-line-switch[aria-checked="true"] .now-line-switch-track {
  background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.15),
    0 0 14px rgba(244, 63, 94, 0.55);
}

.now-line-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.32s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.now-line-switch[aria-checked="true"] .now-line-switch-thumb {
  transform: translateX(1.25rem);
}

.now-line-switch[aria-checked="true"]:active .now-line-switch-thumb {
  width: 1.35rem;
}

.now-line-switch[aria-checked="false"]:active .now-line-switch-thumb {
  width: 1.35rem;
  transform: translateX(0.1rem);
}

.day-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.day-select-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.day-select {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.25rem;
  min-width: 9rem;
}

.day-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.meta-bar strong {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.35rem;
}

.meta-notes {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.meta-note {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-swatch-break {
  border: 1px dashed #4ade80;
}

.photo-team-groups {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.photo-team-groups-title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.photo-team-groups-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.photo-team-group {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.photo-team-group-swatch {
  width: 14px;
  height: 14px;
  margin-top: 0.15rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.photo-team-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.photo-team-group-label {
  font-weight: 600;
  color: var(--text);
}

.photo-team-group-members {
  color: var(--text-muted);
}

.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.status {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.status.error {
  color: #fca5a5;
}

.chart {
  overflow-x: auto;
  padding: 0 0 0.5rem;
}

.gantt {
  min-width: 720px;
  position: relative;
}

.gantt-axis {
  display: grid;
  grid-template-columns: var(--label-w) 1fr;
  height: var(--axis-h);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}

.gantt-axis-label {
  border-right: 1px solid var(--border);
}

.gantt-axis-scale {
  position: relative;
  overflow: hidden;
}

.tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed rgba(148, 163, 184, 0.55);
  pointer-events: none;
  z-index: 1;
}

.tick-hour {
  border-left-style: solid;
  border-left-width: 1px;
  border-left-color: rgba(148, 163, 184, 0.85);
}

.tick-half {
  border-left-style: dashed;
  border-left-width: 1px;
  border-left-color: rgba(148, 163, 184, 0.5);
}

.tick-ten {
  border-left-style: dotted;
  border-left-width: 1px;
  border-left-color: rgba(148, 163, 184, 0.2);
}

.tick-label {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 500;
  color: #cbd5e1;
  white-space: nowrap;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tick-label-half {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
}

.gantt-row {
  display: grid;
  grid-template-columns: var(--label-w) 1fr;
  min-height: var(--row-h);
  border-bottom: 1px solid var(--border);
}

.gantt-row:last-child {
  border-bottom: none;
}

.gantt-row-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.row-photo-badge {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.1rem 0.35rem;
  border-left: 3px solid;
  line-height: 1.2;
}

.row-photo-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.row-photo-subteam-badge {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.05rem 0.3rem;
  border: 1px solid;
  border-radius: 3px;
  line-height: 1.2;
}

.gantt-axis-scale {
  position: relative;
}

.break-band {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #86efac;
  border-left: 1px dashed;
  border-right: 1px dashed;
  box-sizing: border-box;
}

.gantt-axis-scale .break-band {
  top: 4px;
  bottom: 4px;
  border-radius: 3px;
}

.gantt-row-track {
  position: relative;
  margin: 8px 4px;
  min-height: calc(var(--row-h) - 16px);
  background-color: rgba(15, 20, 25, 0.4);
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent calc(100% / var(--grid-slot-count, 48) - 1px),
    rgba(148, 163, 184, 0.06) calc(100% / var(--grid-slot-count, 48) - 1px),
    rgba(148, 163, 184, 0.06) calc(100% / var(--grid-slot-count, 48))
  );
  border-radius: 4px;
}

.block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 0.68rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: filter 0.12s, transform 0.12s;
  min-width: 4px;
}

.block-photo {
  z-index: 0;
  opacity: 0.72;
  font-weight: 500;
}

.block-duty {
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.gantt-row-event {
  min-height: var(--event-row-h);
  background: rgba(99, 102, 241, 0.06);
}

.gantt-row-event .gantt-row-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gantt-row-track-event {
  min-height: calc(var(--event-row-h) - 12px);
  margin: 6px 4px;
  background: rgba(51, 65, 85, 0.2);
}

.block-event {
  z-index: 0;
  opacity: 0.95;
  font-size: 0.65rem;
  border: 1px dashed rgba(255, 255, 255, 0.25);
}

.block:hover,
.block:focus-visible {
  filter: brightness(1.12);
  z-index: 2;
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1px;
  background: linear-gradient(
    180deg,
    rgba(251, 113, 133, 0.95) 0%,
    #f43f5e 35%,
    #e11d48 100%
  );
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.75);
  z-index: 6;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.22s ease;
}

.now-line--hide {
  opacity: 0;
}

.now-line--off-day {
  opacity: 0.72;
  background: linear-gradient(
    180deg,
    rgba(148, 163, 184, 0.9) 0%,
    #94a3b8 100%
  );
  box-shadow: 0 0 8px rgba(148, 163, 184, 0.45);
}

.now-line-badge {
  position: absolute;
  top: calc(var(--axis-h) * 0.5);
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: #e11d48;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.now-line--off-day .now-line-badge {
  background: #64748b;
}

.legend-swatch-now {
  background: linear-gradient(180deg, #fb7185, #e11d48);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.tooltip {
  position: fixed;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 260px;
}

.tooltip strong {
  display: block;
  margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
  :root {
    --label-w: 88px;
    --row-h: 48px;
  }

  .header h1 {
    font-size: 1.25rem;
  }
}
