html, body { margin: 0; min-height: 100%; box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

:root {
  --map-bg: #f3f7fc;
  --map-surface: #ffffff;
  --map-soft: #f7fbff;
  --map-border: #d9e6f4;
  --map-text: #17324e;
  --map-muted: #5c7188;
  --map-primary: #0f397c;
  --map-blue: #167fc1;
  --map-cyan: #62c5e5;
  --map-warning: #8a4b08;
  --map-warning-bg: #fff8e8;
  --map-shadow: 0 18px 48px rgba(15, 57, 124, .09);
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--map-text);
  background: radial-gradient(circle at 10% 0%, rgba(98, 197, 229, .14), transparent 28%), var(--map-bg);
  padding-bottom: 120px !important;
}

.map-topbar {
  min-height: 74px;
  padding: 14px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #081d4c;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.map-topbar > div { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.map-topbar img { width: 42px; height: 42px; object-fit: contain; }
.map-back { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.map-back:hover { text-decoration: underline; }
.map-back svg { width: 18px; height: 18px; }

.code-map { max-width: 1480px; margin: 0 auto; padding: 30px clamp(18px, 4vw, 58px) 80px; }
.map-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, .75fr);
  gap: 28px;
  padding: clamp(28px, 4vw, 54px);
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg, #071b49 0%, #0f397c 58%, #1687c4 100%);
  box-shadow: 0 24px 64px rgba(7, 27, 73, .22);
  overflow: hidden;
  position: relative;
}
.map-hero::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; right: -180px; top: -220px; background: rgba(255,255,255,.09); }
.map-hero__copy, .map-hero__rule { position: relative; z-index: 1; }
.map-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 800; letter-spacing: .12em; }
.map-eyebrow svg { width: 18px; height: 18px; }
.map-hero h1 { margin: 14px 0 14px; font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: 1; }
.map-hero p { margin: 0; max-width: 900px; color: rgba(255,255,255,.88); font-size: 1.06rem; line-height: 1.75; }
.map-hero code { color: #fff; background: rgba(255,255,255,.12); padding: 2px 7px; border-radius: 7px; }
.map-source { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.map-source span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.1); font-size: .88rem; }
.map-hero__rule { align-self: center; display: flex; gap: 14px; padding: 22px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; background: rgba(255,255,255,.11); backdrop-filter: blur(8px); }
.map-hero__rule svg { flex: 0 0 auto; width: 26px; height: 26px; }
.map-hero__rule strong { display: block; margin-bottom: 6px; font-size: 1.05rem; }
.map-hero__rule p { font-size: .94rem; line-height: 1.55; }

.map-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px; margin-top: 28px; align-items: start; }
.map-nav { position: sticky; top: 20px; padding: 20px; border-radius: 20px; background: var(--map-surface); border: 1px solid var(--map-border); box-shadow: var(--map-shadow); }
.map-nav strong { display: block; color: var(--map-primary); margin: 0 0 12px; }
.map-nav a { display: block; padding: 10px 11px; margin: 4px 0; border-radius: 10px; color: var(--map-text); text-decoration: none; font-size: .93rem; }
.map-nav a:hover { background: #eaf4fd; color: var(--map-primary); }
.map-content { display: grid; gap: 26px; min-width: 0; }
.map-section { padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: var(--map-surface); border: 1px solid var(--map-border); box-shadow: var(--map-shadow); scroll-margin-top: 20px; }
.map-section__heading > span { display: block; color: var(--map-blue); font-size: .78rem; font-weight: 900; letter-spacing: .13em; }
.map-section__heading h2 { margin: 8px 0 8px; color: var(--map-primary); font-size: clamp(1.65rem, 3vw, 2.35rem); }
.map-section__heading p { margin: 0; color: var(--map-muted); line-height: 1.7; }
.map-section__heading--with-filter { display: flex; align-items: end; justify-content: space-between; gap: 24px; }

.tree-panel { margin-top: 24px; overflow: auto; border-radius: 18px; background: #07152f; border: 1px solid #183663; }
.tree-panel pre { margin: 0; padding: 26px; color: #d9ecff; font: 14px/1.75 Consolas, "Courier New", monospace; min-width: 720px; }
.tree-panel code { color: inherit; }

.map-filter { min-width: min(390px, 100%); display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #c7dced; border-radius: 14px; background: #f9fcff; }
.map-filter svg { width: 19px; height: 19px; color: var(--map-blue); }
.map-filter input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--map-text); font: inherit; }
.folder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.folder-card { border: 1px solid var(--map-border); border-radius: 20px; background: linear-gradient(180deg, #fff 0%, #fbfdff 100%); overflow: hidden; }
.folder-card[hidden] { display: none !important; }
.folder-card__top { display: flex; justify-content: space-between; gap: 16px; padding: 20px 20px 14px; border-bottom: 1px solid #e7eff8; }
.folder-category { display: inline-block; margin-bottom: 7px; color: var(--map-blue); font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.folder-card h3 { margin: 0; font-size: 1.35rem; }
.folder-card h3 code { color: var(--map-primary); }
.folder-count { min-width: 76px; text-align: right; }
.folder-count strong, .folder-count span, .folder-count small { display: block; }
.folder-count strong { color: var(--map-primary); font-size: 1.35rem; }
.folder-count span, .folder-count small { color: var(--map-muted); font-size: .76rem; }
.folder-purpose { margin: 0; padding: 16px 20px; color: var(--map-muted); line-height: 1.65; }
.folder-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px 18px; }
.folder-columns > div { padding: 14px; border-radius: 14px; background: var(--map-soft); border: 1px solid #e4eef8; min-width: 0; }
.folder-card h4 { margin: 0 0 10px; display: flex; align-items: center; gap: 7px; color: var(--map-primary); font-size: .88rem; }
.folder-card h4 svg { width: 16px; height: 16px; }
.folder-card ul { margin: 0; padding-left: 18px; color: var(--map-muted); font-size: .86rem; line-height: 1.55; overflow-wrap: anywhere; }
.folder-card li + li { margin-top: 5px; }
.folder-card code { color: #0d4f82; overflow-wrap: anywhere; }
.folder-warning { padding: 15px 20px 18px; background: var(--map-warning-bg); border-top: 1px solid #f1dfb9; }
.folder-warning h4 { color: var(--map-warning); }
.folder-warning ul { color: #6e4b20; }
.folder-empty { margin: 24px 0 0; padding: 20px; text-align: center; border-radius: 14px; background: #fff8e8; color: #7a4c12; }

.critical-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.critical-card { padding: 22px; border-radius: 18px; border: 1px solid var(--map-border); background: var(--map-soft); }
.critical-card h3 { margin: 0 0 10px; color: var(--map-primary); }
.critical-card p { color: var(--map-muted); line-height: 1.65; }
.critical-card > div { color: var(--map-muted); line-height: 1.55; }
.critical-care { display: flex; gap: 9px; margin-top: 14px; padding: 12px; border-radius: 12px; background: #fff8e8; color: #73480f !important; }
.critical-care svg { flex: 0 0 auto; width: 18px; height: 18px; }

.entry-table-wrap { margin-top: 22px; overflow-x: auto; border: 1px solid var(--map-border); border-radius: 16px; }
.entry-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.entry-table th { background: #0f397c; color: #fff; text-align: left; font-size: .82rem; letter-spacing: .03em; }
.entry-table th, .entry-table td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid #e3edf7; line-height: 1.55; }
.entry-table tbody tr:nth-child(even) { background: #f8fbff; }
.entry-table code { color: #0d4f82; font-weight: 700; }

.change-flow { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: mapStep; display: grid; gap: 12px; }
.change-flow li { counter-increment: mapStep; display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 14px; padding: 16px; border: 1px solid var(--map-border); border-radius: 15px; background: var(--map-soft); }
.change-flow li::before { content: counter(mapStep); grid-row: 1 / span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--map-primary); font-weight: 800; }
.change-flow strong { color: var(--map-primary); }
.change-flow span { color: var(--map-muted); margin-top: 4px; line-height: 1.55; }

.map-final-note { display: flex; gap: 16px; padding: 24px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #0f397c, #167fc1); box-shadow: var(--map-shadow); }
.map-final-note svg { flex: 0 0 auto; width: 28px; height: 28px; }
.map-final-note strong { display: block; margin-bottom: 5px; font-size: 1.05rem; }
.map-final-note p { margin: 0; color: rgba(255,255,255,.88); line-height: 1.6; }

@media (max-width: 1120px) {
  .map-hero { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .map-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .map-nav strong { width: 100%; }
  .map-nav a { margin: 0; }
}
@media (max-width: 850px) {
  .folder-grid, .critical-grid { grid-template-columns: 1fr; }
  .map-section__heading--with-filter { align-items: stretch; flex-direction: column; }
  .map-filter { min-width: 0; width: 100%; }
}
@media (max-width: 620px) {
  .map-topbar { align-items: flex-start; flex-direction: column-reverse; }
  .code-map { padding-left: 12px; padding-right: 12px; }
  .map-hero, .map-section { border-radius: 18px; padding: 22px 18px; }
  .folder-columns { grid-template-columns: 1fr; }
  .folder-card__top { align-items: flex-start; }
  .map-source { flex-direction: column; align-items: stretch; }
  .map-source span { border-radius: 10px; }
}
