:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #526071;
  --soft: #e5e7eb;
  --green: #16a34a;
  --green-dark: #0f7a37;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --yellow: #fff7d6;
  --yellow-border: #f2c94c;
  --red: #fee2e2;
  --red-border: #f87171;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  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,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(247, 249, 251, 0.94);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

.main-nav a {
  padding: 9px 11px;
  border-radius: var(--radius);
}

.main-nav a:hover,
.main-nav a:focus {
  background: var(--soft);
  color: var(--text);
}

.main-nav .nav-cta {
  color: var(--green-dark);
  background: #dcfce7;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.legal-strip {
  padding: 10px 16px;
  text-align: center;
  background: var(--yellow);
  border-bottom: 1px solid var(--yellow-border);
  color: #6f5500;
  font-size: 0.92rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 86px;
  border: 1px dashed #b8c0cc;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  color: #697386;
  font-size: 0.9rem;
}

.ad-top {
  margin: 18px 0 10px;
}

.ad-mid {
  margin: 22px 0 8px;
}

.tool-hero {
  padding: clamp(24px, 5vw, 48px) 0 24px;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 22px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.1;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.1rem, 5vw, 4.5rem);
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
}

h3 {
  font-size: 1.2rem;
}

.hero-copy p:last-child,
.section-heading p:last-child,
.plus-section p {
  max-width: 690px;
  color: var(--muted);
  font-size: 1.08rem;
}

.calculator-shell,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.tool-panel,
.result-panel,
.calendar-panel,
.plus-card,
.trust-box,
.article-card {
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-panel,
.result-panel,
.calendar-panel,
.plus-card {
  padding: clamp(18px, 3vw, 28px);
}

.tool-panel.compact,
.result-panel.compact {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #cfd6df;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.ghost-button,
.text-button {
  min-height: 46px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  padding: 0 18px;
}

.primary-button:hover {
  background: var(--green-dark);
}

.ghost-button {
  border: 1px solid #cfd6df;
  background: #fff;
  color: var(--text);
  padding: 0 16px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
}

.rate-editor {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--soft);
}

.rate-editor summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

.rate-table {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: end;
}

.result-panel {
  position: sticky;
  top: 94px;
}

.result-empty {
  padding: 18px;
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--muted);
}

.result-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.result-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--soft);
}

.result-item span:first-child {
  color: var(--muted);
}

.result-item strong {
  text-align: right;
}

.total-line {
  margin: 16px 0;
  padding: 16px;
  border-radius: var(--radius);
  background: #ecfdf3;
}

.total-line span {
  display: block;
  color: var(--green-dark);
  font-weight: 800;
}

.total-line strong {
  display: block;
  font-size: 1.8rem;
}

.warning-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.warning-list li {
  padding: 10px 12px;
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius);
  background: var(--yellow);
  color: #6f5500;
  font-size: 0.92rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 22px;
  align-items: start;
}

.content-main {
  display: grid;
  gap: 26px;
}

.section {
  padding: 40px 0;
  border-top: 1px solid rgba(229, 231, 235, 0.9);
}

.section-heading {
  margin-bottom: 18px;
}

.quiz,
.checklist,
.guide-grid,
.feature-list {
  display: grid;
  gap: 12px;
}

.quiz-card,
.checklist-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #cfd6df;
  border-radius: var(--radius);
  background: #f8fafc;
}

.segmented button {
  min-width: 58px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segmented button.active {
  background: var(--green);
  color: #fff;
}

.diagnosis-result {
  position: static;
  margin-top: 16px;
}

.risk-low {
  border-left: 4px solid var(--green);
}

.risk-mid {
  border-left: 4px solid var(--yellow-border);
}

.risk-high {
  border-left: 4px solid var(--red-border);
}

.calendar-panel {
  display: grid;
  gap: 18px;
}

.checklist-item {
  justify-content: flex-start;
}

.checklist-item input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--green);
}

.checklist-item.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.plus-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.price {
  margin: 0 0 12px;
  color: var(--text) !important;
  font-size: 2rem !important;
  font-weight: 900;
}

.feature-list {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
}

.notify-form {
  display: grid;
  gap: 10px;
}

.guide-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.article-card p {
  margin: 0;
  color: var(--muted);
}

.article-card a {
  color: var(--blue);
  font-weight: 800;
}

.desktop-aside {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 16px;
}

.ad-side {
  min-height: 320px;
}

.trust-box {
  padding: 18px;
}

.trust-box p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.article-view {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 0 54px;
}

.article-view h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.article-summary {
  color: var(--muted);
  font-size: 1.12rem;
}

.article-section {
  margin: 30px 0;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-table th,
.article-table td {
  padding: 13px;
  border-bottom: 1px solid var(--soft);
  text-align: left;
  vertical-align: top;
}

.article-table th {
  background: #eef6ff;
}

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--soft);
}

.faq-item h3 {
  margin-bottom: 8px;
}

.article-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-ad {
  margin: 28px 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 0;
  padding: 28px 0 40px;
  border-top: 1px solid var(--soft);
  color: var(--muted);
}

.site-footer p {
  margin: 5px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 920px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 70px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--soft);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .calculator-shell,
  .two-column,
  .content-layout,
  .plus-section {
    grid-template-columns: 1fr;
  }

  .result-panel,
  .desktop-aside {
    position: static;
  }

  .desktop-aside {
    display: none;
  }
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.drop-zone {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 130px;
  margin-top: 16px;
  padding: 22px;
  border: 2px dashed #b8c0cc;
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
}

.drop-zone.active {
  border-color: var(--green);
  background: #ecfdf3;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.metric-card strong {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.15;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--soft);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #eef6ff;
  color: var(--text);
  font-size: 0.86rem;
}

.data-table input,
.data-table select {
  min-width: 120px;
}

.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--soft);
  background: #f8fafc;
}

.notice.success {
  border-color: #86efac;
  background: #ecfdf3;
  color: #14532d;
}

.notice.error {
  border-color: var(--red-border);
  background: var(--red);
  color: #7f1d1d;
}

.notice.warning {
  border-color: var(--yellow-border);
  background: var(--yellow);
  color: #6f5500;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--soft);
  background: var(--surface);
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar nav a {
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 800;
}

.admin-sidebar nav a:hover {
  background: #eef6ff;
  color: var(--blue);
}

.admin-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-card,
.admin-actions {
  margin: 18px 0;
  padding: 22px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-form {
  display: grid;
  gap: 16px;
}

textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #cfd6df;
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline-actions form {
  margin: 0;
}

.danger {
  color: #b91c1c;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.post-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--soft);
}

.post-hero-image {
  width: 100%;
  max-height: 420px;
  margin: 24px 0;
  object-fit: cover;
  border-radius: var(--radius);
}

.rich-content {
  color: var(--text);
}

.rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

@media (max-width: 920px) {
  .metric-grid,
  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-body {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 640px) {
  .metric-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    padding-inline: 12px;
  }

  .form-grid,
  .guide-grid,
  .rate-row {
    grid-template-columns: 1fr;
  }

  .quiz-card {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .site-footer {
    flex-direction: column;
  }
}
