:root {
  --ink: #151515;
  --muted: #646464;
  --line: #e7e7e7;
  --paper: #ffffff;
  --soft: #f7f7f7;
  --brand: #08915d;
  --brand-dark: #066b47;
  --accent: #e1492d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Plus Jakarta Sans", "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  letter-spacing: 0;
  line-height: 1.45;
}

body.note-modal-open {
  overflow: hidden;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

main {
  width: 100%;
}

.notes-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 52px) 72px;
}

.notes-breadcrumb {
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.notes-breadcrumb ol,
.note-detail-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.notes-breadcrumb li:not(:last-child)::after,
.note-detail-breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--muted);
}

.notes-intro {
  max-width: 1240px;
  padding: clamp(18px, 3vw, 34px) 0 24px;
}

.notes-kicker {
  display: inline-flex;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.notes-intro h1,
.notes-intro h2 {
  margin: 8px 0 12px;
  font-size: clamp(31px, 6vw, 54px);
  line-height: 1.12;
  letter-spacing: 0;
}

.notes-intro p {
  margin: 0;
  max-width: 1240px;
  color: var(--muted);
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.7;
  font-weight: 700;
}

.notes-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.notes-category-filter a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 8px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.notes-category-filter a.active,
.notes-category-filter a:focus-visible {
  border-color: rgba(8, 145, 93, 0.28);
  background: #edf7f2;
  color: var(--brand-dark);
  outline: 0;
}

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

.note-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.note-card:hover,
.note-card:focus-visible {
  border-color: #cfcfcf;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.note-card-media {
  position: relative;
  display: block;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--soft);
}

.note-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-card-media figcaption {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--paper);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.note-card-body {
  display: grid;
  gap: 8px;
  padding: 15px;
}

.note-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.note-card-meta span {
  color: var(--brand-dark);
}

.note-card h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.note-card p {
  margin: 0;
  color: #4a4a4a;
  font-size: 14px;
  line-height: 1.65;
}

.notes-empty {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--muted);
  padding: 28px;
  text-align: center;
  font-weight: 800;
}

.note-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  background: rgba(15, 15, 15, 0.54);
  backdrop-filter: blur(2px);
}

.note-modal-backdrop.open {
  display: block;
}

.note-modal-backdrop.intro-open {
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: none;
}

.note-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 60;
  display: none;
  width: min(960px, calc(100vw - 64px));
  max-width: 960px;
  max-height: calc(100svh - 56px);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
}

.note-modal.open {
  display: block;
}

.note-modal.intro-open {
  width: auto;
  max-width: min(680px, calc(100vw - 40px));
  max-height: calc(100svh - 80px);
  padding: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.note-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  color: #111111;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.note-modal-close .lucide {
  width: 20px;
  height: 20px;
}

.note-modal.intro-open .note-modal-close {
  display: none;
}

#noteModalContent {
  display: block;
  max-height: calc(100svh - 56px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
}

#noteModalContent.intro-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-height: calc(100svh - 80px);
  overflow: hidden;
  padding: clamp(20px, 3.5vw, 36px);
}

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

.intro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 640px;
}

.intro-avatar-wrap {
  width: min(320px, 46vw);
  max-width: 340px;
  aspect-ratio: 1537 / 1023;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(4, 8, 12, 0.18);
}

.intro-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
}

.intro-text {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgba(6, 107, 71, 0.06);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 145, 93, 0.03), rgba(255, 255, 255, 0.02));
  padding: 14px 16px;
}

.intro-text::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 12px;
  width: 4px;
  border-radius: 4px;
  background: var(--brand);
}

.intro-message {
  margin: 0;
  padding-left: 26px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

@media (min-width: 901px) {
  #noteModalContent.intro-layout .intro-card {
    max-width: 520px;
  }

  #noteModalContent.intro-layout .intro-avatar-wrap {
    width: 100%;
    max-width: 100%;
  }
}

.note-detail-article {
  max-height: none;
  overflow: visible;
  scroll-padding-top: 24px;
}

.note-detail-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(22px, 4vw, 42px) clamp(66px, 6vw, 72px) clamp(16px, 2.5vw, 24px) clamp(22px, 5vw, 56px);
}

.note-detail-breadcrumb {
  margin-top: 18px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.note-detail-breadcrumb a {
  color: var(--brand-dark);
}

.note-detail-category {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.note-detail-header h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.12;
}

.note-detail-header > p {
  margin: 12px 0 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  font-weight: 700;
}

.note-detail-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 16px 0 0;
}

.note-detail-meta div {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border-radius: 999px;
  background: #f4f6f5;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.note-detail-meta dt,
.note-detail-meta dd {
  margin: 0;
}

.note-detail-meta dt {
  color: var(--muted);
}

.note-detail-body {
  min-width: 0;
  padding: clamp(18px, 4vw, 36px) clamp(22px, 5vw, 56px) clamp(28px, 5vw, 52px);
}

.note-detail-figure {
  display: grid;
  gap: 8px;
  margin: 0 clamp(22px, 5vw, 56px);
}

.note-detail-figure img {
  width: 100%;
  max-height: 360px;
  aspect-ratio: 16 / 7;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--soft);
}

.note-detail-figure figcaption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.note-detail-main {
  min-width: 0;
  max-width: 820px;
  margin: 0 auto;
}

.note-content {
  color: #303030;
  font-size: 16px;
  line-height: 1.82;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.note-content > :first-child {
  margin-top: 0;
}

.note-content > :last-child {
  margin-bottom: 0;
}

.note-content p {
  margin: 0 0 18px;
}

.note-content h2,
.note-content h3 {
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: 0;
}

.note-content h2 {
  margin: 42px 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
  font-weight: 900;
}

.note-content h3 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 900;
}

.note-content ul,
.note-content ol {
  margin: 0 0 22px;
  padding-left: 24px;
}

.note-content li {
  margin: 8px 0;
  line-height: 1.76;
  padding-left: 2px;
}

.note-content li::marker {
  color: var(--brand-dark);
  font-weight: 900;
}

.note-content strong {
  color: #202020;
  font-weight: 900;
}

.note-content a {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.note-content a:hover {
  color: var(--ink);
}

.note-content a:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--brand-dark);
  outline-offset: 3px;
}

.note-content blockquote {
  margin: 28px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--brand-dark);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--soft);
  color: #303030;
}

.note-content blockquote > :last-child {
  margin-bottom: 0;
}

.note-content figure {
  max-width: 100%;
  margin: 28px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.note-content figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.note-content table {
  width: 100%;
  min-width: 620px;
  margin: 24px 0;
  border: 1px solid #d8ded8;
  border-collapse: collapse;
  border-spacing: 0;
  color: #2f2f2f;
  font-size: 15px;
  line-height: 1.55;
}

.note-content figure table {
  margin: 0;
}

.note-content th,
.note-content td {
  border: 1px solid #d8ded8;
  padding: 12px 14px;
  vertical-align: top;
}

.note-content thead th {
  background: #f2f7f4;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.note-content tbody th {
  background: #fafafa;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.note-content tbody td {
  text-align: left;
}

.note-content td.is-number,
.note-content th.is-number,
.note-content td[data-type="number"],
.note-content th[data-type="number"],
.note-content td[data-align="right"],
.note-content th[data-align="right"] {
  text-align: right;
  white-space: nowrap;
}

.note-section-heading {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  margin: 0 0 14px;
}

.note-section-heading span {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.note-section-heading h2,
.note-reference-section h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.note-related-section,
.note-reference-section,
.note-adjacent-nav {
  margin-top: 34px;
}

.note-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.note-related-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 36%) minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.note-related-card:focus-visible,
.note-related-card:hover {
  border-color: rgba(0, 112, 74, 0.32);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.note-related-card figure {
  display: grid;
  place-items: center;
  margin: 0;
  background: var(--soft);
}

.note-related-card img {
  width: 100%;
  height: 100%;
  min-height: 156px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.note-related-card.is-truck-category {
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 126px;
  background: #fbfbfb;
}

.note-related-card.is-truck-category figure {
  color: var(--ink);
  background: linear-gradient(180deg, #f8f8f8 0%, #efefef 100%);
}

.note-related-category-svg {
  width: 78px;
  height: auto;
}

.note-related-card.is-truck-category div {
  padding: 15px 46px 15px 18px;
}

.note-related-card.is-truck-category h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.note-related-card.is-truck-category p {
  max-width: 430px;
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
}

.note-related-card.is-truck-category small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.note-related-card div {
  position: relative;
  display: grid;
  align-content: start;
  min-width: 0;
  padding: 18px 48px 18px 20px;
}

.note-related-card span {
  display: inline-flex;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.note-related-card h3 {
  margin: 5px 0 6px;
  max-width: 420px;
  font-size: 17px;
  line-height: 1.35;
}

.note-related-card p {
  display: -webkit-box;
  margin: 0;
  max-width: 520px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-related-card small {
  display: block;
  margin-top: 12px;
  color: #3d3d3d;
  font-size: 12px;
  font-weight: 900;
}

.note-related-card .lucide {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 18px;
  height: 18px;
  color: var(--brand-dark);
}

.note-reference-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.note-reference-section ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.note-reference-section li {
  display: grid;
  gap: 3px;
  color: #333333;
  font-size: 14px;
}

.note-reference-section a {
  color: var(--brand-dark);
  font-weight: 900;
}

.note-reference-section em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.note-adjacent-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.note-adjacent-card {
  display: block;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.note-adjacent-card.is-empty {
  color: var(--muted);
  background: #ffffff;
}

.note-adjacent-card:not(.is-empty):focus-visible,
.note-adjacent-card:not(.is-empty):hover {
  border-color: rgba(0, 112, 74, 0.28);
  background: #edf7f2;
  outline: 0;
}

.note-adjacent-nav span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.note-adjacent-nav strong {
  display: block;
  font-size: 15px;
  line-height: 1.45;
}

.note-back-row {
  margin-top: 24px;
}

.note-back-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: #ffffff;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 900;
}

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

  .note-modal {
    width: min(920px, calc(100vw - 36px));
  }
}

@media (max-width: 720px) {
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .note-modal {
    inset: auto;
    left: 50%;
    top: 50%;
    width: min(94vw, calc(100vw - 36px));
    max-width: none;
    max-height: calc(100svh - 18px);
    border-radius: var(--radius);
    transform: translate(-50%, -50%);
  }

  .note-modal.open {
    display: block;
  }

  .note-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    margin: 0;
  }

  #noteModalContent {
    min-height: 0;
    max-height: calc(100svh - 18px);
  }

  .note-detail-article {
    max-height: none;
    overflow: visible;
  }

  .note-detail-header {
    padding: 18px 18px 14px 18px;
  }

  .note-detail-header h1 {
    font-size: clamp(24px, 8vw, 32px);
  }

  .note-detail-header > p {
    font-size: 14px;
  }

  .note-detail-figure {
    margin: 0 18px;
  }

  .note-detail-figure img {
    max-height: 270px;
    aspect-ratio: 16 / 10;
  }

  .note-detail-body {
    padding: 18px 18px 32px;
  }

  .note-detail-main {
    max-width: none;
  }

  .note-content {
    font-size: 15px;
    line-height: 1.76;
  }

  .note-content p {
    margin-bottom: 16px;
  }

  .note-content h2 {
    margin: 34px 0 12px;
    padding-bottom: 9px;
    font-size: 19px;
  }

  .note-content h3 {
    margin: 24px 0 9px;
    font-size: 17px;
  }

  .note-content ul,
  .note-content ol {
    margin-bottom: 20px;
    padding-left: 21px;
  }

  .note-content li {
    margin: 7px 0;
    line-height: 1.72;
  }

  .note-content blockquote {
    margin: 22px 0;
    padding: 15px 16px;
  }

  .note-content figure {
    margin: 22px 0;
  }

  .note-content figcaption {
    font-size: 13px;
  }

  .note-content table {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 20px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
    white-space: normal;
  }

  .note-content figure table {
    margin: 0;
  }

  .note-content th,
  .note-content td {
    min-width: 132px;
    padding: 10px 11px;
  }

  .note-related-grid,
  .note-adjacent-nav {
    grid-template-columns: 1fr;
  }

  .note-related-card {
    grid-template-columns: minmax(132px, 38%) minmax(0, 1fr);
  }

  .note-related-card.is-truck-category {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .note-related-category-svg {
    width: 68px;
  }

  .note-related-card div {
    padding: 14px 42px 14px 14px;
  }

  .note-related-card h3 {
    font-size: 15px;
  }

  .note-related-card p {
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .intro-avatar-wrap {
    width: 88vw;
  }

  .intro-message {
    font-size: 14px;
  }

  .notes-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .note-card-body {
    padding: 14px;
  }

  .note-related-card {
    grid-template-columns: 1fr;
  }

  .note-related-card.is-truck-category {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .note-related-card.is-truck-category div {
    padding: 13px 38px 13px 13px;
  }

  .note-related-category-svg {
    width: 58px;
  }

  .note-related-card img {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .note-related-card div {
    padding: 14px 40px 16px 14px;
  }

  .note-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

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