:root {
  color-scheme: light;
  --ink: #151719;
  --muted: #5c6670;
  --line: #d8dee4;
  --soft: #f4f7f8;
  --paper: #ffffff;
  --accent: #196f68;
  --accent-strong: #10524d;
  --signal: #b3472f;
  --focus: #5b8def;
  --ok: #24734d;
  --shadow: 0 18px 40px rgba(27, 38, 49, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

main {
  flex: 1 0 auto;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--signal);
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 8px;
}

.main-nav,
.site-footer nav,
.admin-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.main-nav a,
.site-footer a,
.admin-nav a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:first-child {
  color: var(--accent-strong);
}

.site-footer {
  margin-top: auto;
  padding: 32px 0;
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-grid p {
  margin: 6px 0 0;
  color: var(--muted);
}

.hero,
.tool-hero {
  padding: 42px 0 34px;
  background: linear-gradient(180deg, #f7faf9 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}

.hero-grid,
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 36px;
  align-items: start;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.16;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 16px;
  font-size: 2.6rem;
}

h2 {
  margin: 0 0 18px;
  font-size: 1.7rem;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
}

.lead {
  max-width: 720px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-image {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.section {
  padding: 54px 0 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-header p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  color: var(--paper);
  background: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  color: var(--accent-strong);
  background: var(--paper);
}

.button.danger {
  border-color: var(--signal);
  background: var(--signal);
}

.button:hover {
  color: var(--paper);
  background: var(--signal);
  border-color: var(--signal);
}

.cards-grid,
.category-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card,
.calculator-card,
.result-card,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.card,
.admin-panel {
  padding: 22px;
}

.card p,
.admin-panel p {
  color: var(--muted);
}

.category-section {
  scroll-margin-top: 96px;
  padding-top: 18px;
}

.calculator-card,
.result-card {
  padding: 24px;
}

.calculator-card {
  position: relative;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.radio-group legend {
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.hint,
.validation-message,
.field-validation-error {
  color: var(--muted);
  font-size: 0.92rem;
}

.validation-message,
.field-validation-error,
.validation-summary-errors {
  color: var(--signal);
}

.radio-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.radio-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.results-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.result-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.result-line:last-child {
  border-bottom: 0;
}

.result-line strong {
  font-size: 1.2rem;
}

.total {
  color: var(--accent-strong);
  font-size: 1.45rem;
}

.notice {
  margin-top: 16px;
  padding: 14px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  border-radius: 8px;
}

.notice.warning {
  border-left-color: var(--signal);
}

.content-flow {
  display: grid;
  gap: 26px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 800;
}

.admin-shell {
  padding-top: 32px;
}

.admin-nav {
  margin: 16px 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.92rem;
}

.status-active,
.status-inactive {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 800;
}

.status-active {
  color: var(--ok);
  background: #edf7f1;
}

.status-inactive {
  color: var(--signal);
  background: #fbefec;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .header-inner,
  .footer-grid,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-grid,
  .tool-grid,
  .cards-grid,
  .category-grid,
  .stat-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.1rem;
  }

  .hero,
  .tool-hero {
    padding-top: 30px;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 24px, 1120px);
  }

  .main-nav,
  .site-footer nav {
    gap: 10px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .calculator-card,
  .result-card,
  .card,
  .admin-panel {
    padding: 18px;
  }

  .result-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
