:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #171a21;
    --text: #e8eaed;
    --muted: #9aa1ac;
    --border: #262b35;
    --accent: #3b82f6;
    --ok: #86efac;
    --ok-bg: #14321f;
    --warn: #fcd34d;
    --warn-bg: #3a2c0c;
    --danger: #fca5a5;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 16px 48px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard", "Noto Sans KR", Segoe UI, Roboto, sans-serif;
  line-height: 1.55;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
}

.wrap.wide { max-width: 880px; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.01em;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 14px;
}

.hidden { display: none !important; }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 9px 14px;
  transition: opacity 0.15s;
}

button:hover { opacity: 0.85; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  font-weight: 600;
}

button.big {
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

button.danger { color: var(--danger); }

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

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row.between { justify-content: space-between; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--border);
}

.version {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 2px;
}

dl.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 16px 0 0;
  font-size: 13px;
}

dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; word-break: break-all; }

.notes {
  white-space: pre-wrap;
  font-size: 14px;
  border-left: 3px solid var(--border);
  padding-left: 12px;
  margin: 16px 0 0;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.pending { background: var(--warn-bg); color: var(--warn); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:last-child td { border-bottom: none; }

/* 앱 목록 */
.app-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.1s;
}

.app-item:hover { border-color: var(--accent); }
.app-item:active { transform: scale(0.99); }

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  flex: 0 0 auto;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
}

.app-icon.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
}

.app-text { flex: 1 1 auto; min-width: 0; }

.app-name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.chevron {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

/* 이전 버전 목록 */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.history-item:last-child { border-bottom: none; }
.history-item:first-child { padding-top: 0; }

.back {
  text-decoration: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  padding-right: 2px;
}

.back:hover { color: var(--text); }

.guide {
  font-size: 13px;
  color: var(--muted);
  padding-left: 18px;
  margin: 10px 0 0;
}

.guide li { margin-bottom: 4px; }

a { color: var(--accent); }
