:root {
  color-scheme: light dark;
  --bg: #f5f1e8;
  --surface: #fffdf9;
  --text: #1f2421;
  --muted: #5f675f;
  --line: #ddd6c8;
  --accent: #1d5c48;
  --on-accent: #ffffff;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --surface: #1d2320;
    --text: #eef1ec;
    --muted: #a8b0a8;
    --line: #333b36;
    --accent: #7fd1b5;
    --on-accent: #0d1f18;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.wrap { width: min(100%, 1120px); margin-inline: auto; padding-inline: 16px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.25; letter-spacing: -.035em; }
h2 { font-size: 1.2rem; line-height: 1.4; }
h3 { font-size: 1.15rem; line-height: 1.4; }
button, input, textarea { font: inherit; color: inherit; }
button, input, textarea, dialog { border: 1px solid var(--line); border-radius: var(--radius); }
button { min-height: 44px; padding: 8px 16px; background: var(--surface); cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .65; cursor: wait; }
.primary, .chips button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
input, textarea { display: block; width: 100%; padding: 11px 14px; background: var(--surface); min-height: 48px; font-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }
.page-header { padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: 8px; }
.address { color: var(--accent); font-size: .85rem; letter-spacing: .08em; margin-bottom: 12px; }
.intro { margin-bottom: 12px; color: var(--muted); }
#install-area { margin-bottom: 12px; }
.article-header #install-area { display: none; }
#ios-install { margin: 0; }
.search-dock { position: sticky; top: 0; z-index: 5; padding-block: calc(10px + env(safe-area-inset-top)) 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.search-dock .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
#search { border-color: var(--accent); }
.chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 16px 3px 12px; margin-inline: -3px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.counts { margin-block: 16px 24px; color: var(--muted); font-variant-numeric: tabular-nums; }
.term-section { margin-bottom: 32px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-title small { font-size: .85rem; font-weight: normal; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.term-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.term-card h3 { margin-bottom: 4px; }
.term-card p { margin-bottom: 12px; white-space: pre-wrap; }
.term-card p:last-child { margin-bottom: 0; }
.aka { color: var(--muted); font-size: .875rem; }
.usage { font-size: .9rem; color: var(--muted); }
.usage strong { color: var(--text); font-weight: 600; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.personal-label { color: var(--accent); font-size: .8rem; font-weight: 600; }
.delete-button { padding-inline: 12px; font-size: .85rem; }
.empty-state { padding-block: 40px; text-align: center; }
.notice { border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin-block: 16px; background: var(--surface); }
.notice p { margin-bottom: 8px; }
.page-footer { margin-top: 32px; padding-top: 24px; padding-bottom: max(32px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.page-footer p { max-width: 74ch; color: var(--muted); font-size: .9rem; }
dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; background: var(--surface); color: var(--text); overflow-y: auto; }
dialog::backdrop { background: rgb(0 0 0 / .58); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-heading h2 { margin: 0; }
form label { display: block; font-weight: 600; margin-block: 16px 6px; }
form label span { color: var(--muted); font-size: .8rem; font-weight: normal; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.field-error { color: var(--text); font-weight: 600; margin-block: 8px; }
[aria-invalid="true"] { border: 2px solid var(--accent); }
.eyebrow { color: var(--accent); font-size: .9rem; margin-bottom: 6px; }
#review-term { font-size: 1.5rem; margin-bottom: 20px; }
#review-answer p { white-space: pre-wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 20; padding: 12px 16px; background: var(--surface); }
.skip-link:focus { top: 8px; }
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.site-menu { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.site-menu a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--text); text-decoration: none; border-radius: var(--radius); white-space: nowrap; }
.site-menu a[aria-current] { color: var(--on-accent); background: var(--accent); }
.site-menu a:hover { text-decoration: underline; text-underline-offset: 4px; }
.home-header { padding-top: 32px; padding-bottom: 24px; }
.home-content { padding-bottom: 48px; }
.home-section { padding-block: 24px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.home-section h2 { font-size: 1.35rem; margin-bottom: 16px; }
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry { padding-block: 18px; border-bottom: 1px solid var(--line); }
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; }
.entry h3 { margin-block: 4px 6px; }
.entry p { margin-bottom: 0; }
.entry time, .article-date { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.text-link, .back-link a { display: inline-flex; align-items: center; min-height: 44px; }
.article-layout { max-width: 720px; padding-bottom: 48px; }
.article-header { padding-block: 28px 16px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.article-body { min-width: 0; }
.article-body > :first-child { margin-top: 0; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4, .article-body h5, .article-body h6 { margin-block: 28px 12px; scroll-margin-top: 16px; }
.article-body h1 { font-size: 1.6rem; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote { margin-inline: 0; padding: 8px 16px; border-left: 3px solid var(--accent); }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body pre { max-width: 100%; overflow-x: auto; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); white-space: pre; }
.article-body code { font: .9em/1.65 Consolas, ui-monospace, monospace; }
.article-body :not(pre) > code { overflow-wrap: anywhere; }
.article-body .table-scroll { max-width: 100%; overflow-x: auto; margin-block: 16px; }
.article-body table { border-collapse: collapse; min-width: 100%; background: var(--surface); }
.article-body th, .article-body td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; min-width: 6em; }
.article-body td.nw, .article-body th.nw { white-space: nowrap; }
.article-body img, .article-body video { display: block; max-width: 100%; height: auto; margin-block: 16px; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin-block: 24px; }
.attachments { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.attachments ul { padding-left: 24px; }
.attachments a { display: inline-block; min-height: 44px; padding-block: 8px; }
.back-link { margin-top: 32px; }
