:root {
  --bg: #f6f7f2;
  --card: #ffffff;
  --text: #1d2a1d;
  --muted: #5f6b5f;
  --accent: #4c8c2b; /* pickle green */
  --accent-soft: #e3f0d9;
  --line: #e2e6dc;
  --tabbar-h: 60px; /* 하단 탭 막대 높이 (안전 영역 제외) */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121612;
    --card: #1b211b;
    --text: #e8efe3;
    --muted: #9aa89a;
    --accent: #7fbf55;
    --accent-soft: #263321;
    --line: #2b342b;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  /* 아래쪽은 고정된 하단 탭 막대에 내용이 가려지지 않도록 그 높이만큼 비워 둔다. */
  padding: calc(16px + env(safe-area-inset-top)) 16px
    calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
}

.status {
  text-align: center;
  color: var(--muted);
  margin-top: 40vh;
}
.status.error {
  color: #c0392b;
}

.header h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  color: var(--accent);
}
.progress-text {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}
.track {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 12px;
}
.chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.item-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  font: inherit;
}
.phrase {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
}
.tag {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
.check {
  color: var(--accent);
  font-weight: 700;
}

.detail {
  padding: 0 14px 14px;
}
.meaning {
  margin: 0 0 8px;
}
.example {
  margin: 0 0 12px;
  color: var(--muted);
  font-style: italic;
}
.learn-btn {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
}
.learn-btn.done {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 하단 탭 막대 */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner {
  max-width: 640px;
  margin: 0 auto;
  height: var(--tabbar-h);
  display: flex;
}
.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
}
.tab.active {
  color: var(--accent);
  font-weight: 600;
}
.tab-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* About 탭: 버전 정보 */
.info-card {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}
.info-row + .info-row {
  border-top: 1px solid var(--line);
}
.info-label {
  color: var(--muted);
}
.info-value {
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

/* 마우스로 쓰는 웹에서 버튼 위에 손가락 모양 커서가 나오게 한다 */
button {
  cursor: pointer;
}
