:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f0eb;
  --surface-strong: #19191d;
  --text: #171717;
  --muted: #666966;
  --faint: #8d908b;
  --line: rgba(23, 23, 23, 0.1);
  --line-strong: rgba(23, 23, 23, 0.18);
  --accent: #d91f3f;
  --accent-dark: #a9142d;
  --success: #0c7a43;
  --warning: #b35d00;
  --danger: #ba1a1a;
  --shadow: 0 12px 32px rgba(18, 18, 18, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(16px, 4vw, 44px);
  background: rgba(247, 247, 244, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 240px;
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-strong);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.topnav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.topnav a.is-active {
  background: var(--surface-strong);
  color: #fff;
}

.button.ghost {
  border-color: transparent;
  background: var(--surface-soft);
}

.button.is-logged-in {
  border-color: rgba(12, 122, 67, 0.28);
  background: rgba(12, 122, 67, 0.1);
  color: var(--success);
}

main {
  padding: 34px clamp(16px, 4vw, 44px) 56px;
}

.view {
  display: none;
  max-width: 1320px;
  margin: 0 auto;
}

.view.is-active {
  display: block;
}

.group-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.group-entry__copy,
.group-search {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.group-entry__copy {
  padding: clamp(24px, 5vw, 54px);
}

.group-entry__copy h1 {
  margin-top: 18px;
}

.group-entry__copy p {
  max-width: 680px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.group-search {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 28px;
}

.group-search span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.group-search input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  background: var(--surface-soft);
}

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

.group-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 22px rgba(18, 18, 18, 0.05);
}

.group-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 0;
  background-color: #d9d9d5;
  background-position: center;
  background-size: cover;
  cursor: pointer;
}

.group-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.38));
}

.group-card__media span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.group-card__body {
  padding: 16px;
}

.group-card__body h2 {
  font-size: 22px;
}

.group-card__body p {
  min-height: 42px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.group-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.group-card__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.artist-hero {
  position: relative;
  min-height: clamp(280px, 42vw, 520px);
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 28px;
  background-color: #d9d9d5;
  background-position: center 28%;
  background-size: cover;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.artist-hero__shade {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(22px, 4vw, 42px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.68));
  color: #fff;
}

.artist-hero__label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 850;
}

.artist-hero h1 {
  margin-top: 8px;
  font-size: clamp(52px, 11vw, 132px);
  line-height: 0.9;
}

.feed-toolbar {
  margin-bottom: 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.section-heading,
.schema-panel,
.review-guide,
.system-grid article,
.admin-metrics article {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(24px, 5vw, 54px);
  border-radius: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(217, 31, 63, 0.18);
  border-radius: 999px;
  background: rgba(217, 31, 63, 0.07);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 820px;
  margin-top: 18px;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy p,
.section-heading p {
  max-width: 720px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  overflow: hidden;
  border-radius: 28px;
  background: var(--line);
}

.hero-panel > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  padding: 24px;
  background: var(--surface);
}

.metric {
  font-size: 36px;
  font-weight: 850;
  line-height: 1;
}

.hero-panel small,
.admin-metrics small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.segmented,
.review-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.segmented button,
.review-tabs button {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}

.segmented button.is-selected,
.review-tabs button.is-selected {
  background: var(--surface-strong);
  color: #fff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 380px);
  padding: 0 14px;
  min-height: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search-box span {
  color: var(--faint);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.video-card,
.candidate-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(18, 18, 18, 0.05);
}

.video-card {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(18, 18, 18, 0.1);
}

.thumb-link,
.candidate-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #d9d9d5;
}

.thumb-link img,
.candidate-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.video-body {
  padding: 15px;
}

.video-meta,
.channel-line,
.score-row,
.candidate-meta,
.run-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.channel-line {
  justify-content: space-between;
  margin-bottom: 10px;
}

.channel-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.format-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(12, 122, 67, 0.1);
  color: var(--success);
  font-size: 11px;
  font-weight: 850;
}

.format-badge.is-shorts {
  background: rgba(217, 31, 63, 0.08);
  color: var(--accent-dark);
}

.video-title {
  min-height: 48px;
  font-size: 16px;
  line-height: 1.45;
}

.video-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.video-meta span,
.candidate-meta span,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding: 28px;
  border-radius: 24px;
}

.section-heading h1 {
  margin-top: 12px;
  font-size: clamp(28px, 4vw, 44px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.danger {
  border-color: rgba(186, 26, 26, 0.28);
  color: var(--danger);
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.admin-metrics article {
  min-height: 104px;
  padding: 20px;
  border-radius: 18px;
}

.admin-metrics span {
  display: block;
  font-size: 28px;
  font-weight: 850;
}

.review-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}

.review-guide {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 22px;
  border-radius: 18px;
}

.review-guide h2,
.schema-panel h2 {
  font-size: 18px;
}

.review-guide ul {
  padding-left: 18px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.review-tabs {
  margin-bottom: 14px;
}

.candidate-list {
  display: grid;
  gap: 14px;
}

.candidate-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.candidate-content {
  padding: 18px;
}

.candidate-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.candidate-head h2 {
  font-size: 20px;
  line-height: 1.25;
}

.candidate-head h2 a {
  color: inherit;
  text-decoration: none;
}

.candidate-head h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(217, 31, 63, 0.08);
  color: var(--accent-dark);
  font-weight: 850;
  white-space: nowrap;
}

.candidate-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.score-row {
  margin: 10px 0 12px;
}

.score-row .tag {
  font-size: 12px;
  font-weight: 750;
}

.risk {
  background: rgba(179, 93, 0, 0.1);
  color: var(--warning);
}

.reasons {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.empty-state p {
  margin: 10px auto 20px;
  max-width: 520px;
  color: var(--muted);
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.system-grid article {
  min-height: 220px;
  padding: 22px;
  border-radius: 18px;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 34px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: #fff;
  font-weight: 850;
}

.system-grid h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.system-grid p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.schema-panel {
  padding: 24px;
  border-radius: 22px;
}

.schema-table {
  display: grid;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.schema-table div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.schema-table span {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-strong);
  color: #fff;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.36);
}

.modal[hidden] {
  display: none;
}

.modal__panel {
  width: min(100%, 460px);
  padding: 24px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.modal__panel h2 {
  font-size: 22px;
}

.modal__panel p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.modal__actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 980px) {
  .topbar,
  .top-actions,
  .toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .topnav,
  .segmented,
  .review-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .topnav a,
  .segmented button,
  .review-tabs button {
    white-space: nowrap;
  }

  .hero,
  .group-entry,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-panel > div {
    min-height: 110px;
  }

  .video-grid,
  .group-grid,
  .admin-metrics,
  .system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-guide {
    position: static;
  }
}

@media (max-width: 680px) {
  main {
    padding-top: 22px;
  }

  .hero-copy,
  .section-heading,
  .schema-panel {
    border-radius: 18px;
  }

  .hero-panel,
  .video-grid,
  .group-grid,
  .admin-metrics,
  .system-grid {
    grid-template-columns: 1fr;
  }

  .video-title {
    min-height: 0;
  }

  .candidate-card {
    grid-template-columns: 1fr;
  }

  .candidate-head {
    flex-direction: column;
  }

  .schema-table div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* ── Fan channel request page ─────────────────────────────────────────── */
.request-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.request-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 260px;
  font-size: 13px;
  color: var(--muted);
}
.request-field select,
.request-field input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}
.request-form .button { min-height: 42px; }
.request-hint {
  margin: 10px 2px 24px;
  color: var(--faint);
  font-size: 13px;
}
.request-hint code {
  background: var(--surface-soft);
  padding: 1px 6px;
  border-radius: 6px;
}
.request-list-title { font-size: 16px; margin: 8px 2px 12px; }
.request-list { display: flex; flex-direction: column; gap: 10px; }
.request-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.request-note { color: var(--danger); }
.request-status {
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: var(--surface-soft);
  color: var(--muted);
}
.request-status.status-RESOLVED { background: rgba(12, 122, 67, 0.12); color: var(--success); }
.request-status.status-PENDING { background: rgba(179, 93, 0, 0.12); color: var(--warning); }
.request-status.status-FAILED { background: rgba(186, 26, 26, 0.12); color: var(--danger); }
.score-pill.is-request { background: rgba(12, 122, 67, 0.12); color: var(--success); }
