:root {
  --color-primary: #1F6F5B;
  --color-secondary: #2E3A59;
  --color-accent: #D97A2B;
  --color-bg: #F6F4EF;
  --color-surface: #FFFFFF;
  --color-text: #141A1F;
  --color-muted: #4C5963;
  --color-border: #D7D2C8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 26, 31, 0.10);
  --maxw: 1120px;
  --space: clamp(14px, 2.2vw, 22px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.65;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 0.75em;
  color: var(--color-secondary);
}

h1 {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  margin-bottom: 1em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 2em;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  margin-top: 1.5em;
}

p, ul, ol, table, blockquote, details {
  margin-bottom: 1.25em;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--color-accent);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

ul, ol {
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space) 0;
  box-shadow: var(--shadow);
}

header .header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space);
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--space) * 0.75);
  align-items: center;
}

header .site-name {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--color-secondary);
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--space) * 0.5);
}

nav a {
  display: inline-block;
  padding: 0.5em 0.875em;
  background-color: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
  border-radius: calc(var(--radius) * 0.5);
  border: 1px solid var(--color-border);
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

nav a:hover {
  background-color: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
}

nav a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--space) * 2) var(--space);
  width: 100%;
}

article, section, aside {
  margin-bottom: calc(var(--space) * 1.5);
}

.breadcrumbs {
  font-size: 0.875rem;
  margin-bottom: calc(var(--space) * 1.5);
  color: var(--color-muted);
}

.breadcrumbs a {
  color: var(--color-muted);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

blockquote {
  background-color: rgba(255, 255, 255, 0.6);
  border-left: 4px solid var(--color-accent);
  padding: 1em 1.25em;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--color-secondary);
}

aside {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25em;
  box-shadow: var(--shadow);
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-surface);
  font-size: 0.9375rem;
  margin-bottom: 0;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  padding: 0.75em 1em;
  background-color: var(--color-secondary);
  color: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0;
}

thead th {
  background-color: var(--color-primary);
  color: var(--color-surface);
  font-weight: 600;
  text-align: left;
  padding: 0.875em 1em;
  border-bottom: 2px solid var(--color-border);
}

tbody td {
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--color-border);
}

tbody tr:nth-child(even) {
  background-color: rgba(246, 244, 239, 0.5);
}

tbody tr:hover {
  background-color: rgba(31, 111, 91, 0.08);
}

details {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 1em;
  overflow: hidden;
}

summary {
  cursor: pointer;
  padding: 1em 1.25em;
  font-weight: 600;
  color: var(--color-secondary);
  background-color: rgba(246, 244, 239, 0.4);
  user-select: none;
  transition: background-color 0.2s ease;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 0.5em;
  transition: transform 0.25s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

summary:hover {
  background-color: rgba(31, 111, 91, 0.1);
}

summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

details .details-content {
  padding: 1em 1.25em;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

details[open] .details-content {
  opacity: 1;
  max-height: 5000px;
}

footer {
  background-color: var(--color-secondary);
  color: var(--color-surface);
  padding: calc(var(--space) * 1.5) var(--space);
  text-align: center;
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
}

footer a {
  color: var(--color-surface);
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

footer a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

@media (min-width: 768px) {
  body {
    grid-template-columns: repeat(6, 1fr);
  }

  header {
    grid-column: 1 / -1;
  }

  header .header-inner {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  nav ul {
    justify-content: flex-end;
  }

  main {
    grid-column: 1 / -1;
    padding: calc(var(--space) * 3) var(--space);
  }

  footer {
    grid-column: 1 / -1;
  }

  thead th {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  table {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  body {
    grid-template-columns: repeat(12, 1fr);
  }

  header {
    grid-column: 1 / -1;
  }

  main {
    grid-column: 1 / -1;
  }

  footer {
    grid-column: 1 / -1;
  }

  article, section {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space);
  }

  article > *, section > * {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  details .details-content {
    transition: none;
  }

  summary::before {
    transition: none;
  }
}

@media print {
  body {
    background-color: white;
    color: black;
  }

  header, footer {
    box-shadow: none;
  }

  table, aside, details, blockquote {
    box-shadow: none;
    border: 1px solid black;
  }

  a {
    text-decoration: underline;
    color: black;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.875em;
  }

  nav, .breadcrumbs {
    display: none;
  }

  details {
    border: 1px solid black;
  }

  details summary::before {
    content: "";
  }

  details .details-content {
    max-height: none;
    opacity: 1;
    display: block;
  }
}