/* =============================================================
   App Update Checker — 전용 스타일 (파스텔 라이트 테마)
   /styles.css 토큰을 덮어써서 ReleaseKit 과 동일한 톤.
   ============================================================= */

:root {
  --bg: #f7f4fc;
  --bg-2: #fdfbff;
  --surface: #ffffff;
  --surface-2: #f8f4fd;
  --border: #ece4f6;
  --border-strong: #ddcef0;

  --text: #443c54;
  --text-2: #6a6280;
  --muted: #9b93ab;
  --faint: #c5bdd6;

  --live: #a78bfa;
  --radius: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  background-image:
    radial-gradient(900px 520px at 85% -10%, rgba(167, 139, 250, 0.12), transparent 60%),
    radial-gradient(720px 520px at -10% 8%, rgba(244, 168, 212, 0.12), transparent 60%);
}
::selection { background: rgba(167, 139, 250, 0.28); color: #2b2440; }

.ck-main {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 20px calc(80px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Hero ---------- */
.ck-hero { padding: 22px 0 6px; }
.ck-hero__title {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.ck-hero__lead { color: var(--text-2); max-width: 56ch; margin: 0; }

/* ---------- 추가 폼 ---------- */
.ck-add {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}
.ck-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ck-input {
  flex: 1 1 220px;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.95rem;
}
.ck-input:focus { outline: none; border-color: var(--live); }
.ck-addbtn {
  flex: none;
  background: var(--live);
  border: 1px solid var(--live);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.ck-addbtn:hover { filter: brightness(1.05); }
.ck-add__row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.ck-add__label { color: var(--muted); font-size: 0.85rem; }
.ck-country {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.88rem;
}
.ck-country:focus { outline: none; border-color: var(--live); }
.ck-refresh {
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.ck-refresh:hover { border-color: var(--live); color: var(--live); }
.ck-refresh:disabled { opacity: 0.6; cursor: default; }
.ck-hint { color: var(--muted); font-size: 0.8rem; margin: 10px 0 0; }

/* ---------- 목록 ---------- */
.ck-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.ck-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ck-card.is-new {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 6px 22px rgba(167, 139, 250, 0.14);
}
.ck-card__head { display: flex; align-items: flex-start; gap: 12px; }
.ck-card__icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--surface-2) center/cover no-repeat;
  border: 1px solid var(--border);
}
.ck-card__info { flex: 1; min-width: 0; }
.ck-card__title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 1rem;
}
.ck-card__name { font-weight: 700; }
.ck-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 0.85rem;
}
.ck-ver { font-weight: 600; color: var(--live); font-family: var(--font-mono); }
.ck-dot { color: var(--faint); }
.ck-muted { color: var(--muted); }
.ck-warn { color: #c0823a; }
.ck-stars { color: #f0b429; letter-spacing: 1px; }
.ck-stars--sm { font-size: 0.85rem; }
.ck-rate-num { color: var(--text-2); font-weight: 600; margin-left: 3px; }
.ck-card__ctl { display: flex; gap: 6px; flex: none; }
.ck-iconbtn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  border-radius: 9px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.ck-iconbtn:hover { color: var(--live); border-color: var(--live); }

.ck-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
}
.ck-badge--ios { background: #eef0f3; color: #5a6472; }
.ck-badge--and { background: #e6f5ec; color: #3c8456; }
.ck-new {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--live);
  color: #fff;
}

/* ---------- 릴리즈노트 ---------- */
.ck-notes { margin-top: 12px; }
.ck-notes__sum {
  cursor: pointer;
  color: var(--text-2);
  font-size: 0.85rem;
  list-style: none;
}
.ck-notes__sum::-webkit-details-marker { display: none; }
.ck-notes__sum::before { content: '▸ '; color: var(--faint); }
.ck-notes[open] .ck-notes__sum::before { content: '▾ '; }
.ck-notes__body {
  margin: 8px 0 0;
  padding: 11px 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ck-card__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.ck-link {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  color: var(--live);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.ck-link:hover { text-decoration: underline; }
.ck-ack {
  margin-left: auto;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: var(--live);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 0.8rem;
  cursor: pointer;
}
.ck-ack:hover { background: rgba(167, 139, 250, 0.2); }

.ck-empty {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 28px 16px;
  margin: 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- 리뷰 오버레이 ---------- */
.ck-reviews {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(40, 32, 60, 0.35);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.ck-reviews.is-open { display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) {
  .ck-reviews.is-open { align-items: center; }
}
.ck-reviews__panel {
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  box-shadow: 0 -10px 40px rgba(80, 60, 120, 0.25);
}
@media (min-width: 640px) {
  .ck-reviews__panel { border-radius: 18px; max-height: 80vh; }
}
.ck-reviews__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.ck-reviews__title { font-size: 1.02rem; display: flex; align-items: center; gap: 6px; }
.ck-reviews__sub { color: var(--muted); font-size: 0.78rem; margin-top: 3px; }
.ck-reviews__close {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  border-radius: 9px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.ck-reviews__close:hover { color: var(--text); border-color: var(--text-2); }
.ck-reviews__body {
  overflow-y: auto;
  padding: 14px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}
.ck-rv {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.ck-rv:last-child { border-bottom: none; }
.ck-rv__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.ck-rv__meta { color: var(--muted); font-size: 0.74rem; }
.ck-rv__title { font-weight: 700; font-size: 0.92rem; margin-bottom: 3px; }
.ck-rv__text {
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ck-rv-store { text-align: center; padding: 6px 0 4px; }

/* ---------- 푸터 / 맨 위로 ---------- */
.ck-appfoot {
  text-align: center;
  padding: 28px 20px calc(36px + env(safe-area-inset-bottom, 0px));
  color: var(--faint);
}
.ck-appfoot .mono { letter-spacing: 0.08em; }

.ck-top {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--live);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(110, 90, 160, 0.18);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.ck-top.is-show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
@media (min-width: 768px) { .ck-top { display: none; } }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 560px) {
  .ck-main { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px calc(56px + env(safe-area-inset-bottom, 0px)); }
  .ck-add { padding: 14px; }
  .ck-input { font-size: 16px; }   /* iOS 포커스 확대 방지 */
  .ck-refresh { margin-left: 0; }
}
