:root {
  color-scheme: dark;
  --bg: #070b14;
  --panel: #101724;
  --panel-2: #151e2d;
  --panel-3: #0c121d;
  --ink: #f3f6fb;
  --muted: #a9b3c3;
  --line: #273246;
  --line-strong: #3a4962;
  --accent: #7dc9ff;
  --accent-2: #a98cff;
  --accent-soft: rgba(125, 201, 255, 0.12);
  --green: #8de2a0;
  --gold: #f2ca72;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.3);
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.light {
  color-scheme: light;
  --bg: #edf1f7;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --panel-3: #eef2f8;
  --ink: #182033;
  --muted: #647086;
  --line: #d7dee9;
  --line-strong: #bcc7d6;
  --accent: #2f68c5;
  --accent-2: #7654d5;
  --accent-soft: rgba(47, 104, 197, 0.09);
  --green: #247c42;
  --gold: #8b6414;
  --shadow: 0 18px 54px rgba(45, 57, 77, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -8%, rgba(69, 127, 201, 0.18), transparent 28rem),
    radial-gradient(circle at 90% 3%, rgba(136, 93, 210, 0.14), transparent 25rem),
    var(--bg);
  color: var(--ink);
}

body.light {
  background:
    radial-gradient(circle at 15% -8%, rgba(89, 151, 221, 0.17), transparent 28rem),
    radial-gradient(circle at 90% 3%, rgba(146, 113, 205, 0.13), transparent 25rem),
    var(--bg);
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(125, 201, 255, 0.38);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-head,
.page,
.site-footer {
  width: min(100% - 32px, 1120px);
  margin-inline: auto;
}

.site-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(125, 201, 255, 0.22), rgba(169, 140, 255, 0.2));
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: 0.12em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
}

.theme-button,
.ghost-button,
.primary-button,
.secondary-button,
.card-button,
.card-link,
.chip {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.theme-button,
.ghost-button,
.secondary-button,
.card-link {
  background: transparent;
  color: var(--ink);
}

.theme-button {
  min-height: 36px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.card-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07101d;
  border-color: transparent;
}

body.light .primary-button,
body.light .card-button {
  color: #ffffff;
}

.secondary-button,
.primary-button,
.card-button,
.card-link,
.ghost-button {
  padding: 9px 14px;
}

button:hover,
a:hover {
  filter: brightness(1.06);
}

.page {
  padding: 34px 0 72px;
}

.hero {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(125, 201, 255, 0.11), rgba(169, 140, 255, 0.08) 58%, transparent),
    rgba(16, 23, 36, 0.86);
  box-shadow: var(--shadow);
  padding: clamp(26px, 6vw, 46px);
}

body.light .hero {
  background:
    linear-gradient(135deg, rgba(80, 151, 218, 0.1), rgba(135, 105, 200, 0.08) 58%, transparent),
    rgba(255, 255, 255, 0.9);
}

.pill,
.eyebrow,
.section-tag,
.card-code,
.platform-tag {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  border: 1px solid rgba(125, 201, 255, 0.35);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 7px 11px;
}

.hero h1 {
  margin: 18px 0 10px;
  font-size: clamp(54px, 10vw, 94px);
  line-height: 0.88;
  letter-spacing: -0.05em;
}

.hero > p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.hero-tags span,
.card-meta span,
.dialog-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 11px;
}

.notice,
.toolbar,
.note-section,
.aux-section {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 23, 36, 0.82);
}

body.light .notice,
body.light .toolbar,
body.light .note-section,
body.light .aux-section {
  background: rgba(255, 255, 255, 0.86);
}

.notice {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.notice strong {
  display: block;
  margin-bottom: 5px;
}

.notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.notice a {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.toolbar {
  padding: 18px;
}

.search-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

input[type="search"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-3);
  color: var(--ink);
  padding: 0 13px;
}

body.light input[type="search"] {
  background: #ffffff;
}

.filter-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.filter-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.filter-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  min-height: 34px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.chip.active {
  border-color: rgba(125, 201, 255, 0.56);
  background: var(--accent-soft);
  color: var(--accent);
}

.sections {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.note-section {
  margin-top: 0;
  overflow: hidden;
}

.note-section summary {
  min-height: 96px;
  padding: 20px 22px;
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.note-section summary::-webkit-details-marker {
  display: none;
}

.note-section summary::after {
  content: "＋";
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.note-section details[open] summary::after {
  content: "－";
}

.section-tag,
.eyebrow {
  display: block;
  color: var(--accent);
}

.note-section h2,
.section-heading h2 {
  margin: 6px 0 0;
  font-size: 25px;
}

.note-section summary p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card-grid,
.aux-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.note-card,
.aux-card {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  padding: 17px;
  display: flex;
  flex-direction: column;
}

.note-card[data-family="MEMORY"] {
  border-top: 3px solid var(--accent-2);
}

.note-card[data-family="DB"] {
  border-top: 3px solid var(--accent);
}

.aux-card.lite {
  border-top: 3px solid var(--gold);
}

.aux-card.guide {
  border-top: 3px solid var(--green);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-code {
  color: var(--accent);
}

.platform-tag {
  color: var(--muted);
  letter-spacing: 0.06em;
}

.note-card h3,
.aux-card h3 {
  margin: 17px 0 8px;
  font-size: 20px;
}

.note-card p,
.aux-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
  font-size: 14px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.card-button,
.card-link {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
}

.section-heading > p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  text-align: right;
  line-height: 1.55;
  font-size: 14px;
}

.aux-section {
  overflow: hidden;
}

.empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.site-footer {
  min-height: 74px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.dialog {
  width: min(100% - 28px, 980px);
  max-height: min(88vh, 850px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.dialog-head,
.dialog-actions {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-head {
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 5px 0 0;
}

.dialog-file {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.integrity {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  padding: 12px 18px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.integrity.valid {
  color: var(--green);
}

.integrity.invalid {
  color: #ff8d8d;
}

.preview {
  margin: 0;
  max-height: 56vh;
  overflow: auto;
  background: var(--panel-3);
  padding: 18px;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", "D2Coding", Consolas, monospace;
  font-size: 13px;
  line-height: 1.62;
}

.dialog-actions {
  border-top: 1px solid var(--line);
}

.dialog-stats,
.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 200;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 13px;
  box-shadow: var(--shadow);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.recovery-note {
  margin: 0 14px 14px;
  border: 1px solid rgba(242, 202, 114, 0.34);
  border-radius: 10px;
  background: rgba(242, 202, 114, 0.08);
  color: var(--muted);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
}

.recovery-card {
  min-height: 235px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 11px;
  background: var(--panel-2);
  padding: 17px;
  display: flex;
  flex-direction: column;
}

.recovery-card h3 {
  margin: 17px 0 8px;
  font-size: 20px;
}

.recovery-card > p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.58;
  font-size: 14px;
}

.recovery-card details {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.recovery-card summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recovery-card summary::-webkit-details-marker {
  display: none;
}

.recovery-card summary::after {
  content: "＋";
  float: right;
}

.recovery-card details[open] summary::after {
  content: "－";
}

.recovery-card pre {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: var(--panel-3);
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", "D2Coding", Consolas, monospace;
  font-size: 12px;
  line-height: 1.58;
}

.recovery-card > .card-button {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 760px) {
  .card-grid,
  .aux-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .section-heading > p {
    text-align: left;
  }

  .notice {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .site-head,
  .page,
  .site-footer {
    width: min(100% - 22px, 1120px);
  }

  .site-head {
    min-height: 62px;
  }

  .theme-button {
    width: 38px;
    overflow: hidden;
    white-space: nowrap;
    text-indent: -999px;
  }

  .theme-button::after {
    content: "◐";
    text-indent: 0;
    font-size: 16px;
  }

  .page {
    padding-top: 22px;
  }

  .hero {
    padding: 24px 19px;
  }

  .hero h1 {
    font-size: clamp(49px, 19vw, 72px);
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .note-section summary,
  .section-heading {
    padding: 18px;
  }

  .card-grid,
  .aux-grid {
    padding: 10px;
  }

  .dialog-head,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .action-group > * {
    flex: 1 1 auto;
  }
}
