:root {
  --ink: #1f1633;
  --muted: #6c6074;
  --line: #ead9bd;
  --paper: #fff6e4;
  --panel: #ffffff;
  --green: #047857;
  --gold: #d99a18;
  --red: #c2410c;
  --blue: #312e81;
  --saffron: #f97316;
  --marigold: #facc15;
  --lotus: #be185d;
  --indigo: #241447;
  --surface-warm: #fffaf0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 7%, rgba(250,204,21,.22), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(249,115,22,.18), transparent 24%),
    linear-gradient(180deg, #fff7e6 0%, #fffaf0 46%, #f8efe0 100%);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, a { overflow-wrap: anywhere; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255,248,232,.94);
  border-bottom: 1px solid rgba(217,154,24,.28);
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
  background: white;
  border: 1px solid rgba(217,154,24,.34);
}
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--saffron), var(--lotus) 52%, var(--indigo));
  color: white;
  box-shadow: 0 10px 24px rgba(190,24,93,.22);
}
.main-nav { display: flex; justify-content: center; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.main-nav a, .lang-switch a { color: #3f3155; font-weight: 650; }
.main-nav a:hover, .lang-switch a:hover { color: var(--saffron); }
.lang-switch { display: flex; gap: 10px; font-size: 13px; }
.nav-toggle { display: none; }

main { min-height: 70vh; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(360px, .82fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-height: min(640px, calc(100vh - 70px));
  padding: clamp(30px, 4.5vw, 56px) clamp(18px, 5vw, 72px) clamp(24px, 3.5vw, 38px);
  background:
    linear-gradient(115deg, rgba(255,255,255,.34), rgba(255,236,179,.16)),
    radial-gradient(circle at 74% 44%, rgba(250,204,21,.14), transparent 30%);
}
.hero-copy {
  min-width: 0;
  max-width: calc(100vw - 48px);
}
.hero-copy h1,
.hero-copy p,
.hero-actions,
.trust-strip {
  max-width: 100%;
}
.hero img {
  max-width: calc(100vw - 48px);
}
.hero h1, .page-hero h1, .content-page h1, .qa-detail h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
}
.hero p, .page-hero p, .lead { color: var(--muted); font-size: 18px; max-width: 720px; }
.eyebrow { color: var(--lotus); font-weight: 850; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.hero img {
  width: 100%;
  height: min(52vh, 520px);
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  border: 1px solid rgba(250,204,21,.42);
  box-shadow: 0 22px 54px rgba(36,20,71,.18), 0 0 0 8px rgba(255,255,255,.28);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.trust-strip span {
  display: inline-flex; min-height: 30px; align-items: center;
  padding: 0 10px; border: 1px solid rgba(217,154,24,.38); border-radius: 999px;
  background: rgba(255,255,255,.78); color: #6b4d12; font-size: 12px; font-weight: 750;
}
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border: 1px solid rgba(217,154,24,.38);
  border-radius: 6px; background: #fffdf8; font-weight: 780;
  box-shadow: 0 8px 18px rgba(36,20,71,.06);
}
.button.primary {
  background: linear-gradient(135deg, var(--saffron), #dc2626);
  color: white;
  border-color: transparent;
  box-shadow: 0 16px 30px rgba(249,115,22,.25);
}
.download-panel {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 24px;
  padding: 0;
}
.download-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 22px;
  align-items: stretch;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(249,115,22,.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,243,205,.92)),
    radial-gradient(circle at 92% 14%, rgba(250,204,21,.28), transparent 28%);
  box-shadow: 0 20px 54px rgba(36,20,71,.12);
}
.download-main { min-width: 0; }
.download-panel h2 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
}
.download-copy {
  color: var(--muted);
  font-size: 17px;
  max-width: 760px;
}
.download-copy p { margin: 0 0 10px; }
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.download-button {
  min-width: 170px;
  font-size: 16px;
}
.download-checklist {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  border: 1px solid rgba(217,154,24,.34);
  border-radius: 8px;
  overflow: hidden;
  background: #fffdf8;
}
.download-checklist span,
.download-checklist p {
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid rgba(217,154,24,.24);
}
.download-checklist span {
  font-weight: 850;
  color: #573b08;
  background: #fff1c2;
}
.download-checklist p {
  color: var(--muted);
}
.download-checklist span:nth-last-child(-n+2),
.download-checklist p:nth-last-child(-n+2) {
  border-bottom: 0;
}

.module-grid, .article-grid, .split-section, .qa-layout, .content-page, .qa-detail, .page-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.module-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 28px 0 44px;
}
.module-card, .list-card, .news-card, .question-card, .accepted-answer, .qa-sidebar {
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-warm) 100%);
  border: 1px solid rgba(217,154,24,.28);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 14px 34px rgba(36,20,71,.07);
}
.module-card span, .tag {
  display: inline-flex; padding: 3px 8px; border-radius: 999px;
  background: #fff1c2; color: #8a4b00; font-size: 12px; font-weight: 850;
}
.module-card h2, .news-card h2, .question-card h2 { font-size: 20px; line-height: 1.25; margin: 12px 0 8px; }
.module-card p, .list-card p, .news-card p, .question-card p { color: var(--muted); }
.module-card a, .section-head a, .news-card a, .question-card a { color: var(--green); font-weight: 850; }

.split-section {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px 0 64px;
}
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.list-card + .list-card, .qa-row + .qa-row { margin-top: 12px; }
.qa-row { display: grid; grid-template-columns: 70px 1fr; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.qa-row div, .qa-stats { display: grid; justify-items: center; color: var(--muted); font-size: 12px; }
.qa-row strong, .qa-stats strong { font-size: 18px; color: var(--ink); }

.page-hero { padding: 46px 0 26px; }
.page-hero.compact h1 { font-size: clamp(32px, 4vw, 52px); }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-bottom: 40px; }
.news-card time { color: var(--muted); font-size: 13px; }
.qa-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; padding-bottom: 56px; }
.qa-sidebar { align-self: start; position: sticky; top: 86px; display: grid; gap: 10px; }
.qa-sidebar h2 { font-size: 18px; margin: 0 0 8px; }
.qa-sidebar a { color: var(--blue); font-weight: 800; }
.qa-note { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.qa-feed { display: grid; gap: 12px; }
.question-card { display: grid; grid-template-columns: 90px 1fr; gap: 18px; }
.question-card > div { min-width: 0; }
.qa-stats.large { min-width: 82px; background: #fff1c2; border-radius: 8px; padding: 12px; align-self: start; }

.content-page, .qa-detail { padding: 42px 0 72px; max-width: 900px; }
.breadcrumb { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.rich-text h2 { margin-top: 32px; }
.rich-text a { color: var(--green); text-decoration: underline; }
.rich-text table { width: 100%; border-collapse: collapse; background: #fffdf8; }
.rich-text th, .rich-text td { border: 1px solid var(--line); padding: 10px; text-align: left; }
.question-title { display: flex; gap: 22px; align-items: flex-start; }
.accepted-answer { margin-top: 24px; }

.seo-band, .feature-columns, .disclaimer-band, .news-topics {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.seo-band { padding: 8px 0 42px; }
.table-wrap { overflow-x: auto; border: 1px solid rgba(217,154,24,.32); border-radius: 8px; background: #fffdf8; box-shadow: 0 14px 34px rgba(36,20,71,.06); }
.ranking-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.ranking-table th, .ranking-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.ranking-table th { background: linear-gradient(135deg, #fff1c2, #ffe3b0); font-size: 13px; text-transform: uppercase; color: #573b08; }
.ranking-table tr:last-child td { border-bottom: 0; }
.feature-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 8px 0 38px;
}
.feature-columns article {
  background: linear-gradient(180deg, #ffffff, #fff8e8); border: 1px solid rgba(217,154,24,.3); border-radius: 8px; padding: 24px;
  box-shadow: 0 14px 34px rgba(36,20,71,.07);
}
.feature-columns h2 { margin: 8px 0 14px; }
.step-list { padding-left: 22px; margin-bottom: 0; }
.step-list li + li { margin-top: 8px; }
.step-list a, .text-link { color: var(--green); font-weight: 800; }
.safety-checks {
  display: grid; grid-template-columns: 120px 1fr; gap: 0;
  border: 1px solid rgba(217,154,24,.32); border-radius: 8px; overflow: hidden; margin-bottom: 14px;
}
.safety-checks span { padding: 10px 12px; border-bottom: 1px solid rgba(217,154,24,.24); background: #fffdf8; }
.safety-checks span:nth-child(odd) { font-weight: 850; color: #573b08; background: #fff1c2; }
.safety-checks span:nth-last-child(-n+2) { border-bottom: 0; }
.disclaimer-band {
  margin-bottom: 56px; padding: 24px;
  border: 1px solid #f0c987; border-radius: 8px; background: linear-gradient(135deg, #fff4d6, #fff9ee);
  box-shadow: 0 14px 34px rgba(36,20,71,.06);
}
.disclaimer-band h2 { margin: 0 0 8px; }
.disclaimer-band p { margin: 0; color: #6f5531; }
.news-topics {
  display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 18px;
}
.news-topics a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border: 1px solid rgba(217,154,24,.34); border-radius: 999px; background: #fffdf8; color: var(--blue); font-weight: 800;
}
.related-links { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.related-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.related-grid a {
  display: inline-flex; min-height: 38px; align-items: center; padding: 0 12px;
  border: 1px solid rgba(217,154,24,.34); border-radius: 6px; background: #fffdf8; color: var(--green); font-weight: 850;
}

.pager { display: flex; gap: 8px; justify-content: center; margin: 20px 0 60px; }
.pager a { min-width: 38px; min-height: 38px; display: grid; place-items: center; border: 1px solid rgba(217,154,24,.38); border-radius: 6px; background: #fffdf8; }
.pager a.active { background: var(--saffron); color: white; border-color: var(--saffron); }

.site-footer {
  display: grid; grid-template-columns: 1fr auto; gap: 24px;
  padding: 32px clamp(16px, 5vw, 72px);
  background: linear-gradient(135deg, var(--indigo), #3b0764 55%, #7c2d12); color: white;
}
.site-footer p { max-width: 620px; color: #f8e6c5; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; align-content: start; max-width: 480px; }

.admin-body { background: #eef3f0; }
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-sidebar { background: #13201d; color: white; padding: 22px; }
.admin-sidebar a { display: block; padding: 9px 0; color: #d8e5e0; }
.admin-main { padding: 28px; }
.admin-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-image-preview {
  width: 120px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}
.admin-image-preview.small { width: 72px; height: 72px; }
label { display: grid; gap: 6px; font-weight: 700; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px;
  font: inherit; background: white;
}
textarea { min-height: 150px; }
.admin-table { width: 100%; border-collapse: collapse; background: white; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 11px; text-align: left; vertical-align: top; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
  font-weight: 800;
}
.muted-text { color: var(--muted); }
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.checkbox-line input {
  width: auto;
}
.large-editor { min-height: 260px; }
.quality-card {
  border-width: 2px;
}
.quality-card h2 {
  margin-top: 0;
}
.quality-ok {
  border-color: #86efac;
  background: #f0fdf4;
}
.quality-bad {
  border-color: #fda4af;
  background: #fff7ed;
}
.quality-card h3 {
  margin-bottom: 8px;
}
.quality-card ul {
  margin-top: 0;
}
.quality-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.quality-metrics span,
.status-good,
.status-bad {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 850;
  font-size: 13px;
}
.quality-metrics span {
  background: #fffdf8;
  border: 1px solid rgba(217,154,24,.34);
}
.status-good {
  background: #dcfce7;
  color: #166534;
}
.status-bad {
  background: #fee2e2;
  color: #991b1b;
}
.quality-note,
.quality-guide p {
  color: #5f4b34;
}
.quality-override {
  margin: 18px 0;
  padding: 12px;
  border: 1px dashed #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .nav-toggle { display: inline-flex; border: 1px solid var(--line); background: white; border-radius: 6px; padding: 8px 10px; }
  .main-nav, .lang-switch { display: none; grid-column: 1 / -1; justify-content: start; }
  .nav-open .main-nav, .nav-open .lang-switch { display: flex; }
  .hero, .split-section, .qa-layout, .site-footer, .admin-shell { grid-template-columns: 1fr; }
  .download-shell { grid-template-columns: 1fr; }
  .feature-columns { grid-template-columns: 1fr; }
  .module-grid, .article-grid { grid-template-columns: 1fr 1fr; }
  .qa-sidebar { position: static; }
}

@media (max-width: 600px) {
  .site-header { grid-template-columns: minmax(0, 1fr) auto; }
  .main-nav, .lang-switch { display: none !important; }
  .nav-toggle { display: inline-flex !important; }
  .hero {
    display: block;
    width: 100%;
    max-width: 100%;
  }
  .hero-copy, .hero img {
    width: 100%;
    max-width: 100%;
  }
  .hero img { margin-top: 20px; }
  .module-grid, .article-grid, .split-section, .qa-layout, .content-page, .qa-detail, .page-hero,
  .seo-band, .feature-columns, .disclaimer-band, .news-topics, .download-panel {
    width: auto;
    max-width: none;
    margin-left: 16px;
    margin-right: 16px;
  }
  .module-grid, .article-grid, .admin-grid { grid-template-columns: 1fr; }
  .question-card, .question-title { grid-template-columns: 1fr; display: grid; }
  .question-card, .question-card > div, .qa-sidebar, .qa-feed, .news-card, .module-card, .download-panel, .download-shell, .download-main { min-width: 0; max-width: 100%; }
  .qa-sidebar a, .qa-note, .question-card h2, .question-card p { word-break: break-word; overflow-wrap: anywhere; }
  .page-hero p, .question-card p { font-size: 16px; line-height: 1.55; }
  .question-card h2 { font-size: 18px; line-height: 1.28; }
  .safety-checks { grid-template-columns: 1fr; }
  .download-checklist { grid-template-columns: 1fr; }
  .safety-checks span, .safety-checks span:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .download-checklist span:nth-last-child(-n+2), .download-checklist p:nth-last-child(-n+2) { border-bottom: 1px solid rgba(217,154,24,.24); }
  .hero { overflow: hidden; }
  .hero h1, .content-page h1, .qa-detail h1 {
    font-size: 31px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .download-panel h2 {
    font-size: 28px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
