:root {
  --canvas: #ffffff;
  --ink: #222222;
  --body-text: #3f3f3f;
  --muted: #6a6a6a;
  --muted-soft: #929292;
  --hairline: #dddddd;
  --hairline-soft: #ebebeb;
  --surface-soft: #f7f7f7;
  --surface-strong: #f2f2f2;
  --rausch: #ff385c;
  --shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px, rgba(0, 0, 0, 0.1) 0 4px 8px;
  --radius-card: 14px;
  --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.5;
}

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

img {
  display: block;
}

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

.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 80px;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
}

.top-nav .container {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
}

.logo {
  align-self: center;
  display: inline-flex;
  flex: none;
}

.logo-img {
  display: block;
  height: 48px;
  width: auto;
}

.top-nav-right {
  justify-self: end;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Content tabs (2026-08-31): icon-free, enlarged filled pills centered in
   the 80px top nav — active = ink fill with white text, inactive = hairline
   outline. The bigger surface makes the 롱폼/쇼츠 split read at a glance. */
.ptabs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ptab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 40px;
  border-radius: 9999px;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.ptab:not(.active):hover {
  background: var(--surface-soft);
}

.ptab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

/* Header date stepper (2026-09-01): [‹ 8/30] [8/31 ›] — each pill button
   carries its target date and steps to the adjacent published archive of
   the current tab. Home (current day) shows only the ‹ button. */
.date-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header control cluster (2026-09-01): 시청 숨김 · 전체 · date stepper —
   all buttons share the DESIGN.md `button-secondary` treatment (white fill,
   ink text, 1px ink outline, 8px radius, weight 500). Hover lifts with the
   single shadow tier; disabled softens to a hairline outline. */
.step-pill,
.seen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}

.step-pill:hover,
.seen-toggle:hover {
  box-shadow: var(--shadow);
}

.step-pill.disabled {
  border-color: var(--hairline);
  color: var(--muted-soft);
  cursor: default;
}

.seen-toggle.active,
.step-pill.active {
  background: var(--ink);
  color: #ffffff;
}

/* Watched-content marking (2026-09-01, all pages): a clicked video tile
   gets .seen — dimmed thumbnail plus a check badge top-right of the photo.
   The header eye toggle adds body.hide-seen to hide them entirely. */
.tile.seen .tile-img {
  opacity: 0.45;
  filter: saturate(0.75);
}

.tile.seen .tile-link::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

body.hide-seen .tile.seen {
  display: none;
}


.page {
  padding: 64px 0;
}

.edition-head {
  margin-bottom: 32px;
}

.head-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.43;
  margin: 0;
  text-align: center;
}

.edition-meta {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 0;
  text-align: center;
}

[x-cloak] {
  display: none !important;
}

.home-head {
  text-align: center;
  margin-bottom: 24px;
}

.filter-wrap {
  padding: 0 0 16px;
  margin-bottom: 24px;
}

.filter-row {
  display: flex;
  align-items: center;
}

/* 채널관리 button — DESIGN.md `button-secondary`: white fill, ink text,
   1px ink outline, 8px radius, weight 500 (48px content-height button).
   Hover lifts with the single shadow tier; the count badge is ink-filled. */
.channel-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.channel-btn:hover {
  box-shadow: var(--shadow);
}

.channel-btn-icon {
  width: 18px;
  height: 18px;
}

.channel-count {
  background: var(--ink);
  color: #ffffff;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  font-variant-numeric: tabular-nums;
}

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-panel {
  background: var(--canvas);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 640px;
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: none;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-close:hover {
  background: var(--hairline);
}

.modal-sub {
  margin: 6px 24px 0;
  padding: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline-soft);
}

.channel-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-content: start;
}

.chrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  min-width: 0;
}

.chrow:hover {
  background: var(--surface-soft);
}

.chrow-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.chrow-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chrow-fallback {
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
}

.chrow-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chrow-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrow-cat {
  font-size: 12px;
  color: var(--muted-soft);
}

.chrow-state {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.chrow-state svg {
  width: 12px;
  height: 12px;
}

.chrow-state.off {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--hairline);
}

.chrow.off .chrow-avatar img {
  filter: brightness(0.55) saturate(0.5);
}

.chrow.off .chrow-fallback {
  color: var(--muted-soft);
}

.chrow.off .chrow-name {
  color: var(--muted-soft);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  border-top: 1px solid var(--hairline-soft);
}

.modal-foot-info {
  font-size: 13px;
  color: var(--muted);
}

.text-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}

.load-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 0;
  min-height: 64px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--hairline);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.load-text {
  font-size: 13px;
  color: var(--muted);
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 16px;
}

.tile-link {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface-soft);
}

.tile-link:hover {
  box-shadow: var(--shadow);
}

.tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid-shorts {
  grid-template-columns: repeat(6, 1fr);
}

.grid-shorts .tile-link {
  aspect-ratio: 9 / 16;
}

.grid-shorts .tile-meta {
  gap: 8px;
  padding-top: 8px;
}

.grid-shorts .tile-avatar {
  width: 28px;
  height: 28px;
}

.grid-shorts .tile-avatar-fallback {
  font-size: 12px;
}

.grid-shorts .tile-title {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.grid-shorts .tile-channel,
.grid-shorts .tile-sub {
  font-size: 12px;
}

.badge-ago,
.badge-dur {
  position: absolute;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badge-ago {
  left: 8px;
}

.badge-dur {
  right: 8px;
}

.tile-meta {
  display: flex;
  gap: 12px;
  padding: 12px 4px 0;
}

.tile-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-avatar-fallback {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

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

.tile-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-channel {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.empty-state {
  padding: 64px 0;
  text-align: center;
}

.empty-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
}

.empty-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.prose {
  max-width: 720px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
}

.prose h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.43;
  margin: 0 0 32px;
}

.prose h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  margin: 32px 0 8px;
}

.prose p {
  margin: 0 0 16px;
  color: var(--body-text);
}

.prose ul {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--body-text);
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-top: 48px;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.footer-col h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 12px;
}

.footer-link {
  display: block;
  font-size: 14px;
  color: var(--ink);
  padding: 3px 0;
}

.footer-link:hover {
  text-decoration: underline;
}

.legal-band {
  margin-top: 40px;
  border-top: 1px solid var(--hairline-soft);
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

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

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

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

@media (max-width: 743px) {
  .container {
    padding: 0 16px;
  }

  .page {
    padding: 48px 0;
  }

  .channel-list {
    grid-template-columns: 1fr;
  }

  .modal-scrim {
    padding: 16px;
  }

  .ptab {
    padding: 10px 20px;
    font-size: 15px;
  }

  .date-stepper {
    gap: 6px;
  }

  .step-pill {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .seen-toggle {
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .logo-img {
    height: 32px;
  }

  .head-title {
    font-size: 22px;
  }

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

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

  }
