:root {
  color-scheme: light;
  --background: #faf8f5;
  --surface: #fffdfb;
  --surface-soft: #f5efeb;
  --text: #252120;
  --muted: #6f6763;
  --line: #eadfd8;
  --primary: #a52b2e;
  --primary-dark: #812023;
  --primary-soft: #f9e8e5;
  --gold-soft: #fff3c7;
  --shadow: 0 16px 45px rgba(75, 37, 27, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

button, input { font: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  padding: .7rem 1rem;
}

.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 251, .94);
  padding: 0 1.5rem;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: .7rem;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(165, 43, 46, .22);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: .96rem; }
.brand small {
  margin-top: .08rem;
  color: var(--muted);
  font-size: .69rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  width: min(620px, 58vw);
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
}

.global-search {
  display: flex;
  width: min(390px, 100%);
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  padding: 0 .75rem;
  color: var(--muted);
}

.global-search:focus-within {
  border-color: rgba(165, 43, 46, .5);
  box-shadow: 0 0 0 3px rgba(165, 43, 46, .08);
}

.global-search input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  border-radius: 9px;
  background: var(--primary);
  color: white;
  padding: .55rem .9rem;
  cursor: pointer;
  font-size: .83rem;
  font-weight: 650;
  transition: .18s ease;
}

.button:hover { background: var(--primary-dark); }
.button.secondary {
  border-color: var(--line);
  background: white;
  color: var(--text);
}
.button.secondary:hover { border-color: #d7c5bb; background: var(--surface-soft); }

.shell {
  display: grid;
  min-height: calc(100vh - 72px);
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 72px;
  display: flex;
  height: calc(100vh - 72px);
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #f7f2ef;
  padding: 1.2rem 1rem;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .55rem .6rem;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.icon-button {
  display: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 1.35rem;
}

.nav-group { margin-bottom: 1.15rem; }
.nav-group h2 {
  margin: 0 0 .3rem;
  padding: 0 .55rem;
  color: #8c817c;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.nav-group a {
  display: block;
  border-radius: 8px;
  color: #554d49;
  font-size: .82rem;
  line-height: 1.35;
  padding: .55rem .6rem;
  transition: .15s ease;
}
.nav-group a:hover { background: rgba(255, 255, 255, .8); color: var(--text); }
.nav-group a.active { background: var(--gold-soft); color: var(--primary-dark); font-weight: 650; }

.version-card {
  display: grid;
  gap: .15rem;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .65);
  padding: .8rem;
}
.version-card span, .version-card small { color: var(--muted); font-size: .68rem; }
.version-card strong { font-size: .82rem; }

#content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  outline: none;
  padding: 2rem clamp(1.25rem, 4vw, 4rem) 5rem;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 211, 115, .32), transparent 30%),
    linear-gradient(135deg, white, #fff9f3);
  padding: clamp(2rem, 5vw, 4.5rem);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: -4rem;
  bottom: -6rem;
  width: 17rem;
  height: 17rem;
  border: 34px solid rgba(165, 43, 46, .05);
  border-radius: 50%;
  content: "";
}

.eyebrow, .pill, .card-category {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: .3rem .65rem;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 1rem 0 .8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 4.3rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.02;
}
.hero > p { max-width: 680px; margin: 0; color: var(--muted); font-size: 1.02rem; }
.hero-meta { display: flex; gap: 1.5rem; margin-top: 1.6rem; color: var(--muted); font-size: .75rem; }

.section-title, .category-section > h2 {
  margin: 2.4rem 0 1rem;
  font-size: 1.08rem;
}
.result-count { margin: 2rem 0 1rem; color: var(--muted); font-size: .85rem; }

.guide-grid, .related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.guide-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem;
  box-shadow: 0 7px 24px rgba(75, 37, 27, .035);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.guide-card:hover {
  border-color: rgba(165, 43, 46, .35);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.guide-card h3 { margin: .85rem 0 .45rem; font-size: 1rem; line-height: 1.35; }
.guide-card p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.card-category { background: var(--surface-soft); font-size: .62rem; }
.card-link { margin-top: auto; padding-top: 1rem; color: var(--primary); font-size: .78rem; font-weight: 700; }

.article { max-width: 820px; margin: 0 auto; }
.breadcrumbs { display: flex; gap: .5rem; margin-bottom: 2rem; color: var(--muted); font-size: .75rem; }
.breadcrumbs a { color: var(--primary); }
.article-header { padding-bottom: 2.2rem; border-bottom: 1px solid var(--line); }
.article-labels { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .72rem; }
.article-header h1 {
  margin: 1rem 0 .8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.08;
}
.article-header p { max-width: 720px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.75; }

.article-section { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.article-section > h2 { margin: 0 0 1.2rem; font-size: 1.18rem; }

.check-list { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 1.7rem; color: var(--muted); font-size: .88rem; }
.check-list li::before {
  position: absolute;
  left: 0;
  top: .05rem;
  display: grid;
  width: 1.15rem;
  height: 1.15rem;
  place-items: center;
  border-radius: 50%;
  background: #e2f4e8;
  color: #1a7540;
  content: "✓";
  font-size: .68rem;
  font-weight: 800;
}

.steps { display: grid; gap: 1.35rem; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: .85rem; }
.step-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: .75rem;
  font-weight: 750;
}
.steps h3 { margin: .18rem 0 .3rem; font-size: .92rem; }
.steps p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.68; }

.callout {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: .65rem;
  border: 1px solid #f0dda6;
  border-radius: 10px;
  background: #fff9e8;
  padding: 1rem;
}
.callout > span { color: #ac7110; }
.callout ul { display: grid; gap: .55rem; margin: 0; padding-left: 1.1rem; color: #66573e; font-size: .84rem; }

.troubleshooting { display: grid; gap: .7rem; }
.troubleshooting details { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: .85rem 1rem; }
.troubleshooting summary { cursor: pointer; font-size: .86rem; font-weight: 650; }
.troubleshooting p { margin: .65rem 0 0; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.related-grid .guide-card { min-height: 190px; }

.article-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
  color: var(--muted);
  font-size: .72rem;
}
.article-footer a { color: var(--primary); font-weight: 650; }

.loading, .empty, .error {
  display: grid;
  min-height: 40vh;
  place-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}
.empty strong, .error strong { color: var(--text); font-size: 1rem; }
.empty p, .error p { margin: .4rem 0 1rem; font-size: .85rem; }
.mobile-nav { display: none; }

@media (max-width: 1000px) {
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-actions { width: 55vw; }
}

@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 .9rem; }
  .brand small, #open-app { display: none; }
  .top-actions { width: min(58vw, 330px); }
  .shell { display: block; min-height: calc(100vh - 64px); }
  .sidebar {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    width: min(86vw, 310px);
    height: 100vh;
    box-shadow: 20px 0 60px rgba(40, 20, 15, .2);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .icon-button { display: inline-grid; place-items: center; }
  #content { padding: 1.15rem 1rem 5rem; }
  .hero { padding: 2rem 1.35rem; }
  .guide-grid, .related-grid { grid-template-columns: 1fr; }
  .guide-card { min-height: 190px; }
  .mobile-nav {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
    display: inline-flex;
    box-shadow: var(--shadow);
  }
  .article { padding-top: .4rem; }
  .article-header h1 { font-size: 2.25rem; }
}

@media print {
  .topbar, .sidebar, .mobile-nav, .breadcrumbs { display: none !important; }
  .shell { display: block; }
  #content { max-width: none; padding: 0; }
  .article { max-width: none; }
  .article-section, .article-header { break-inside: avoid; }
}
