:root {
  color: #171611;
  background: #ebe8de;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --shell-switch-link-height: 36px;
  --shell-switch-focus: #ee5138;
}

* { box-sizing: border-box; }
body { min-width: 300px; min-height: 100vh; margin: 0; }
a { color: inherit; }
button { font: inherit; }
.files-topbar { position: sticky; z-index: 5; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; min-height: 72px; padding: 12px clamp(18px, 3vw, 44px); border-bottom: 1px solid #4d4a43; color: #f7f5ef; background: #24231f; }
.files-brand { display: flex; flex-direction: column; justify-self: start; font-size: 0.88rem; font-weight: 850; text-decoration: none; }
.files-brand small { margin-top: 2px; color: #969188; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.56rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.files-contact { justify-self: end; color: #aaa69c; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.7rem; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid #ee5138; outline-offset: 2px; }
main { width: min(1540px, 100%); margin: 0 auto; padding: clamp(28px, 5vw, 70px) clamp(16px, 3vw, 44px) 50px; }
.files-intro { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr); gap: 12px 50px; align-items: end; margin-bottom: 38px; }
.eyebrow { grid-column: 1 / -1; display: flex; gap: 9px; align-items: center; margin: 0; color: #5d5a52; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.eyebrow span { width: 8px; height: 8px; border-radius: 50%; background: #34a864; box-shadow: 0 0 0 5px rgb(52 168 100 / 12%); }
h1 { margin: 0; max-width: 850px; font-size: clamp(3rem, 7vw, 7rem); letter-spacing: -0.075em; line-height: 0.88; }
.files-intro > p:not(.eyebrow) { max-width: 540px; margin: 0; color: #666158; font-size: clamp(1rem, 1.8vw, 1.25rem); line-height: 1.45; }
.revision { grid-column: 2; color: #827d73; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.65rem; }
.files-layout { display: grid; grid-template-columns: minmax(210px, 0.75fr) minmax(420px, 2.2fr) minmax(250px, 0.9fr); height: clamp(560px, 72vh, 760px); min-height: 0; overflow: hidden; border: 1px solid #b9b4a8; border-radius: 16px; background: #f6f3ec; box-shadow: 0 20px 60px rgb(59 53 41 / 8%); }
.file-browser, .change-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: #e4e0d5; }
.file-browser { border-right: 1px solid #c6c0b4; }
.change-panel { border-left: 1px solid #c6c0b4; }
.panel-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 54px; padding: 0 18px; border-bottom: 1px solid #c6c0b4; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.panel-heading small { color: #858076; font-size: 0.58rem; }
#file-tree { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 8px 18px; scrollbar-gutter: stable; }
.file-group { margin: 0 0 5px; }
.file-group > summary, .file-folder > summary { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 7px; align-items: center; border-radius: 7px; cursor: pointer; list-style: none; }
.file-group > summary::-webkit-details-marker, .file-folder > summary::-webkit-details-marker { display: none; }
.file-group > summary::before, .file-folder > summary::before { color: #9b958b; content: "›"; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-weight: 900; transform-origin: center; transition: transform 120ms ease; }
.file-group[open] > summary::before, .file-folder[open] > summary::before { transform: rotate(90deg); }
.file-group > summary { padding: 8px 9px; color: #68635b; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.file-group > summary:hover { color: #171611; background: rgb(255 255 255 / 38%); }
.file-group > summary small, .file-folder > summary small { color: #9a948a; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.55rem; letter-spacing: 0; }
.file-group-contents { padding: 1px 0 7px 8px; }
.file-folder { margin: 4px 0 1px; }
.file-folder > summary { margin: 0 5px 2px 8px; padding: 6px 8px; color: #777168; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.59rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.file-folder > summary:hover { color: #171611; background: rgb(255 255 255 / 38%); }
.file-folder-contents { padding-left: 9px; }
.file-link { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; width: 100%; padding: 6px 9px; border: 0; border-radius: 7px; color: #504c44; background: transparent; text-align: left; cursor: pointer; }
.file-link::before { content: "↳"; color: #9b958b; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.file-link span { overflow: hidden; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.file-link:hover { background: rgb(255 255 255 / 45%); }
.file-link.is-active { color: #111; background: #fff; box-shadow: 0 1px 4px rgb(44 39 30 / 8%); }
.folder-more { margin: 5px 9px 2px 32px; padding: 0; border: 0; color: #777168; background: transparent; font-size: 0.65rem; text-align: left; text-decoration: underline; text-decoration-color: #b2aca1; text-underline-offset: 3px; cursor: pointer; }
.folder-more:hover { color: #171611; text-decoration-color: #ee5138; }
.document-panel { min-width: 0; overflow-y: auto; padding: clamp(24px, 4vw, 54px); background: #fbfaf6; overscroll-behavior: contain; }
.document-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.document-heading p { margin: 0 0 8px; color: #ee5138; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.66rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.document-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 4.2rem); letter-spacing: -0.06em; line-height: 0.95; }
.document-heading time { flex: 0 0 auto; color: #8b867c; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.62rem; }
.document-path { margin: 20px 0 34px; padding-bottom: 13px; border-bottom: 1px solid #dedad0; color: #908a80; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.68rem; overflow-wrap: anywhere; }
.visual-evidence { max-width: 920px; margin: 0 0 34px; padding: 16px; border: 1px solid #d0cbc0; border-radius: 12px; color: #69645b; background: #f5f2e9; font-size: 0.74rem; }
.visual-evidence[hidden] { display: none; }
.visual-evidence-heading { display: flex; gap: 16px; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.visual-evidence-heading strong { color: #25231f; font-size: 0.82rem; }
.visual-evidence-heading span { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.6rem; }
.visual-evidence-gallery { display: grid; grid-template-columns: minmax(0, 2fr) minmax(180px, 0.8fr); gap: 12px; align-items: start; }
.visual-evidence figure { min-width: 0; margin: 0; }
.visual-evidence img { display: block; width: 100%; height: auto; max-height: 620px; object-fit: contain; object-position: top; border: 1px solid #cbc5b9; border-radius: 8px; background: #fff; }
.visual-evidence figcaption { margin-top: 6px; color: #817b71; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.58rem; text-transform: uppercase; }
.markdown { max-width: 760px; color: #37342e; font-size: 1rem; line-height: 1.7; }
.markdown h1, .markdown h2, .markdown h3 { margin: 1.7em 0 0.55em; color: #171611; letter-spacing: -0.035em; line-height: 1.08; }
.markdown h1 { font-size: 2rem; }
.markdown h2 { font-size: 1.5rem; }
.markdown h3 { font-size: 1.15rem; }
.markdown p { margin: 0 0 1em; }
.markdown ul { margin: 0 0 1.2em; padding-left: 1.25em; }
.markdown li { margin: 0.35em 0; }
.markdown blockquote { margin: 1.3em 0; padding: 2px 0 2px 18px; border-left: 3px solid #ee5138; color: #69645b; }
.markdown pre { max-width: 100%; overflow-x: auto; padding: 16px; border-radius: 9px; color: #e9e6df; background: #24231f; }
.markdown code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.87em; }
.change-panel ol { display: grid; min-height: 0; gap: 0; margin: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0; list-style: none; scrollbar-gutter: stable; }
.change-panel li { padding: 17px 18px; border-bottom: 1px solid #cbc5b9; }
.change-panel li strong { display: block; margin-bottom: 5px; font-size: 0.82rem; }
.change-files { display: grid; gap: 4px; }
.change-file-link, .change-file-unavailable { display: block; color: #69645b; font-size: 0.7rem; line-height: 1.45; overflow-wrap: anywhere; }
.change-file-link { width: fit-content; max-width: 100%; text-decoration-color: #a39d92; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.change-file-link::after { margin-left: 5px; color: #ee5138; content: "→"; text-decoration: none; }
.change-file-link:hover { color: #171611; text-decoration-color: #ee5138; }
.change-file-unavailable { opacity: 0.72; }
.change-panel time { display: block; margin-top: 8px; color: #969086; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.58rem; }
.change-loader { color: #817b71; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.6rem; text-align: center; }
.change-empty { margin: 18px; color: #777168; font-size: 0.74rem; line-height: 1.45; }

@media (max-width: 1050px) {
  .files-layout { height: auto; min-height: 650px; grid-template-columns: 230px minmax(0, 1fr); }
  .file-browser, .document-panel { height: 650px; }
  .change-panel { grid-column: 1 / -1; height: 440px; border-top: 1px solid #c6c0b4; border-left: 0; }
  .change-panel ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .files-topbar { grid-template-columns: 1fr auto; }
  .files-contact { display: none; }
  :root { --shell-switch-link-padding: 0 10px; }
  .files-intro { display: block; }
  .files-intro > p:not(.eyebrow) { margin-top: 20px; }
  .revision { display: block; margin-top: 18px; }
  .files-layout { display: block; }
  .file-browser { height: auto; border-right: 0; border-bottom: 1px solid #c6c0b4; }
  #file-tree { display: flex; gap: 10px; overflow-x: auto; padding: 12px; }
  .file-group { flex: 0 0 190px; }
  .document-panel { height: auto; min-height: 520px; overflow-y: visible; }
  .change-panel { height: min(68vh, 560px); min-height: 360px; }
  .change-panel ol { grid-template-columns: 1fr; }
  .visual-evidence-gallery { grid-template-columns: 1fr; }
}

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