:root {
  --color-primary: #2A2F8F;
  --color-secondary: #0E7C86;
  --color-accent: #E24A8D;
  --color-background: #F6F4EF;
  --color-surface: #FFFFFF;
  --color-text: #14151A;
  --color-text-muted: #4E5563;
  --color-border: #D7D2C7;
  --lm-bg: var(--color-background);
  --lm-surface: var(--color-surface);
  --lm-text: var(--color-text);
  --lm-muted: var(--color-text-muted);
  --lm-border: var(--color-border);
  --lm-primary: var(--color-primary);
  --lm-secondary: var(--color-secondary);
  --lm-accent: var(--color-accent);
  --lm-radius: 2px;
  --lm-shadow: 0 1px 3px rgba(20, 21, 26, 0.08);
  --lm-maxw: 1200px;
  --baseline: 1.5rem;
}

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

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

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

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

header .header-inner {
  max-width: var(--lm-maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

header .site-name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lm-primary);
  line-height: 1.2;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--lm-text);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 0.125rem;
}

nav a:hover {
  color: var(--lm-primary);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--lm-accent);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

nav a:focus-visible {
  outline: 2px solid var(--lm-accent);
  outline-offset: 4px;
  border-radius: var(--lm-radius);
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--baseline);
  color: var(--lm-text);
}

h1 {
  font-size: 2.25rem;
  margin-bottom: calc(var(--baseline) * 1.5);
  border-bottom: 3px solid var(--lm-primary);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 1.75rem;
  margin-top: calc(var(--baseline) * 2);
  color: var(--lm-primary);
}

h3 {
  font-size: 1.375rem;
  margin-top: calc(var(--baseline) * 1.5);
}

h4 {
  font-size: 1.125rem;
  margin-top: var(--baseline);
}

p {
  margin-bottom: var(--baseline);
  max-width: 70ch;
}

a {
  color: var(--lm-secondary);
  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(--lm-primary);
  text-decoration-color: var(--lm-accent);
}

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

ul, ol {
  margin-bottom: var(--baseline);
  padding-left: 2rem;
  max-width: 70ch;
}

li {
  margin-bottom: 0.5rem;
}

.breadcrumbs {
  background-color: var(--lm-surface);
  padding: 0.75rem 1rem;
  margin: calc(var(--baseline) * -2) -1rem var(--baseline);
  border-bottom: 1px solid var(--lm-border);
  font-size: 0.875rem;
}

.breadcrumbs nav {
  max-width: var(--lm-maxw);
  margin: 0 auto;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0;
  margin: 0;
}

.breadcrumbs li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  color: var(--lm-muted);
  font-weight: 400;
}

.breadcrumbs a {
  color: var(--lm-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--lm-primary);
  text-decoration: underline;
}

blockquote {
  background-color: rgba(42, 47, 143, 0.03);
  border-left: 4px solid var(--lm-accent);
  padding: var(--baseline) calc(var(--baseline) * 1.5);
  margin: calc(var(--baseline) * 1.5) 0;
  font-style: italic;
  color: var(--lm-text);
  max-width: 70ch;
}

blockquote p:last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: calc(var(--baseline) * 1.5) 0;
  background-color: var(--lm-surface);
  border: 1px solid var(--lm-border);
  font-size: 0.9375rem;
  line-height: 1.5;
}

caption {
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  background-color: var(--lm-primary);
  color: var(--lm-surface);
  letter-spacing: 0.01em;
  font-size: 1rem;
}

thead {
  background-color: rgba(42, 47, 143, 0.05);
}

th {
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--lm-border);
  color: var(--lm-text);
  letter-spacing: 0.01em;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--lm-border);
  color: var(--lm-text);
}

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

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: rgba(14, 124, 134, 0.05);
}

.table-wrapper {
  overflow-x: auto;
  margin: calc(var(--baseline) * 1.5) 0;
  box-shadow: var(--lm-shadow);
  border-radius: var(--lm-radius);
}

details {
  background-color: var(--lm-surface);
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s ease;
}

details:hover {
  box-shadow: var(--lm-shadow);
}

details[open] {
  box-shadow: 0 2px 6px rgba(20, 21, 26, 0.1);
}

summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--lm-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  user-select: none;
}

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

summary::before {
  content: '▸';
  display: inline-block;
  font-size: 1.125rem;
  color: var(--lm-accent);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

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

summary:hover {
  color: var(--lm-secondary);
}

summary:focus-visible {
  outline: 2px solid var(--lm-accent);
  outline-offset: 4px;
  border-radius: var(--lm-radius);
}

details > *:not(summary) {
  margin-top: var(--baseline);
  padding-left: 2rem;
}

details p:last-child {
  margin-bottom: 0;
}

section {
  margin-bottom: calc(var(--baseline) * 3);
}

article {
  margin-bottom: calc(var(--baseline) * 2);
}

aside {
  background-color: var(--lm-surface);
  border-left: 3px solid var(--lm-secondary);
  padding: var(--baseline) calc(var(--baseline) * 1.5);
  margin: calc(var(--baseline) * 1.5) 0;
  box-shadow: var(--lm-shadow);
}

aside h2, aside h3, aside h4 {
  margin-top: 0;
}

@media (min-width: 768px) {
  header .header-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  header .site-name {
    font-size: 2rem;
  }

  h1 {
    font-size: 2.75rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  main {
    padding: calc(var(--baseline) * 3) 2rem;
  }

  .breadcrumbs {
    padding: 0.75rem 2rem;
    margin: calc(var(--baseline) * -3) -2rem var(--baseline);
  }
}

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

  main {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--baseline) * 2);
  }

  table {
    font-size: 1rem;
  }

  thead {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(20, 21, 26, 0.05);
  }

  th {
    background-color: var(--lm-primary);
    color: var(--lm-surface);
  }
}

@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;
  }

  summary::before {
    transition: none;
  }

  nav a::after {
    transition: none;
  }
}

:focus {
  outline: none;
}

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

::selection {
  background-color: var(--lm-accent);
  color: var(--lm-surface);
}

@media print {
  body {
    background-color: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }

  header, footer, nav, .breadcrumbs {
    display: none;
  }

  main {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

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

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

  details {
    border: 1px solid #ccc;
  }

  summary::before {
    display: none;
  }

  details[open] summary {
    margin-bottom: 0.5rem;
  }

  table {
    border: 1px solid black;
  }

  th, td {
    border: 1px solid black;
    padding: 0.5rem;
  }

  thead {
    display: table-header-group;
  }

  tr {
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  blockquote {
    border-left: 3px solid black;
    page-break-inside: avoid;
  }
}