/* 최애랑 — 목업(최애랑_UI목업.html)의 디자인 토큰을 그대로 옮겨온 것 */
:root {
  --void: #0e0618;
  --stage: #170c28;
  --riser: #241539;
  --riser-2: #2e1b47;
  --line: #37225a;
  --hi: #f2ecfb;
  --mid: #ac9cc9;
  --low: #7c6c99;

  --pink: #ff2e7e;
  --violet: #9b6bff;
  --gold: #ffc24b;
  --ok: #4ade80;
  --bad: #ff6b6b;

  --s-youtube: #ff3b3b;
  --s-news: #22c55e;
  --s-instagram: #f0518b;
  --s-weverse: #6c7bff;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic",
    "Apple SD Gothic Neo", "Noto Sans KR", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "D2Coding", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--void);
  color: var(--hi);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 78px;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 6px; }

.shell { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 0 12px;
}
.top h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.top .spacer { margin-left: auto; }

.btn {
  border: 1px solid var(--line); background: var(--riser); color: var(--hi);
  font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--riser-2); }
.btn[data-primary] { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- artist / filter chips ---------- */
.chips { display: flex; gap: 7px; flex-wrap: wrap; padding: 4px 0 12px; }
.chip {
  border: 1px solid var(--line); background: var(--riser); color: var(--mid);
  font: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #fff; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--riser); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px; text-decoration: none; color: inherit;
  display: block;
}
.card:hover { border-color: #4a2e72; }
.card[data-fresh="true"] { border-color: #4a2e72; }

.card__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.src {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 999px; background: var(--riser-2); color: var(--mid);
  text-transform: uppercase;
}
.src i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--mid)); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); flex: none; }
.time { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--low); }

.card__title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.45; letter-spacing: -.01em; }
.card__sub { margin: 5px 0 0; font-size: 11.5px; color: var(--mid); line-height: 1.5; }
.card__thumb {
  width: 100%; border-radius: 10px; margin: 10px 0 0; display: block;
  aspect-ratio: 16 / 9; object-fit: cover; background: var(--riser-2);
}

.empty {
  text-align: center; padding: 56px 20px; color: var(--mid); font-size: 13.5px; line-height: 1.7;
}
.empty strong { display: block; color: var(--hi); font-size: 15px; margin-bottom: 6px; }

/* ---------- panels (설정/지표) ---------- */
.panel {
  background: var(--riser); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px; margin-bottom: 10px;
}
.panel h2 { margin: 0 0 12px; font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.panel h3 { margin: 16px 0 8px; font-size: 12px; font-weight: 700; color: var(--mid); }

.row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row__label { min-width: 0; }
.row__label b { display: block; font-size: 13px; font-weight: 700; }
.row__label span { font-size: 11px; color: var(--mid); }
.row .sw { margin-left: auto; }

.sw {
  width: 40px; height: 23px; border-radius: 999px; background: var(--line);
  border: none; position: relative; cursor: pointer; flex: none; padding: 0;
}
.sw::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 17px; height: 17px; border-radius: 50%; background: var(--low);
  transition: left .15s ease, background .15s ease;
}
.sw[aria-checked="true"] { background: var(--pink); }
.sw[aria-checked="true"]::after { left: 20px; background: #fff; }
.sw[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- metrics ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--stage); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b {
  display: block; font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2;
}
.stat span { font-size: 10.5px; color: var(--mid); letter-spacing: .02em; }
.stat[data-state="good"] b { color: var(--ok); }
.stat[data-state="bad"] b { color: var(--bad); }

.note {
  font-size: 11.5px; color: var(--mid); line-height: 1.65;
  background: var(--stage); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; margin-top: 10px;
}
.note b { color: var(--hi); }

.feedrow { display: flex; align-items: center; gap: 9px; padding: 8px 0; font-size: 12px; }
.feedrow + .feedrow { border-top: 1px solid var(--line); }
.feedrow .status { margin-left: auto; font-family: var(--mono); font-size: 10px; }
.status[data-ok="true"] { color: var(--ok); }
.status[data-ok="false"] { color: var(--bad); }
.status[data-ok="link"] { color: var(--low); }

/* ---------- tab bar ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--stage); border-top: 1px solid var(--line);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.tab {
  background: none; border: none; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--low); font-size: 10px; font-weight: 700; padding: 4px 0;
}
.tab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-selected="true"] { color: var(--pink); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: var(--riser-2); border: 1px solid var(--line);
  color: var(--hi); font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; z-index: 30;
  max-width: calc(100vw - 32px); text-align: center;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .8);
}
.toast[hidden] { display: none; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .sw::after { transition: none; }
}
