@font-face {
  font-family: Google Sans;
  src: url(fonts/google-sans.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: IBM Plex Mono;
  src: url(fonts/plex-mono.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --surface: #fff;
  --chrome: #fff;
  --toolbar: #f1f5fa;
  --hover: #e8edf3;
  --raised: #fff;
  --ink: #171818;
  --ui: #42474b;
  --muted: #596169;
  --soft: #e1e5e9;
  --border: #d8dce0;
  --blue: #0b57d0;
  --tint: #dce9ff;
  --download: #c2e7ff;
  --on-download: #001d35;
  --accent: #0b57d0;
  --paper-width: 840px;
  --header-h: 121px;
  --zoom: 1;
  --sans: "Google Sans", Arial, sans-serif;
  --doc: Arial, Helvetica, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1b1b1b;
    --chrome: #1b1b1b;
    --toolbar: #292c31;
    --hover: #373b40;
    --raised: #292b2e;
    --ink: #ecedef;
    --ui: #c7c9ce;
    --muted: #a6abb2;
    --soft: #393b40;
    --border: #45474d;
    --blue: #a8c7fa;
    --tint: #2b415e;
    --download: #b5d9fa;
    --on-download: #092a43;
    --accent: #a8c7fa;
  }
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  scroll-padding-top: 145px;
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
a {
  color: var(--blue);
}
button,
a,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
button:hover,
a:hover,
summary:hover {
  transition: background-color 0.12s ease;
}
button:focus:not(:focus-visible) {
  outline: none;
}
[hidden] {
  display: none !important;
}
.sr,
.symbol-bank,
.skip:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip:focus-visible {
  position: fixed;
  top: 6px;
  left: 6px;
  z-index: 30;
  padding: 8px 12px;
  background: var(--surface);
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  display: block;
}
.editor {
  background: var(--chrome);
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 9px 16px 9px;
  min-width: 0;
}
.filebar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
  padding: 0 4px 5px;
}
.doc-icon {
  width: 32px;
  height: 41px;
  flex: none;
  position: relative;
  clip-path: polygon(0 0, 65% 0, 100% 28%, 100% 100%, 0 100%);
  background: linear-gradient(140deg, #4285f4 20%, #4285f4 65%, #7a9dff 100%);
  border-radius: 3px;
  margin: 8px 0 0 6px;
}
.doc-icon:before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  background: #a8c7ff;
  width: 35%;
  height: 28%;
  box-shadow: 0 1px 1px #1458b955;
}
.doc-icon i,
.doc-icon b {
  position: absolute;
  left: 7px;
  bottom: 14px;
  width: 18px;
  border-top: 2px solid #fff;
}
.doc-icon b {
  width: 12px;
  bottom: 9px;
}
.file-stack {
  min-width: 0;
}
.title-row {
  display: flex;
  align-items: center;
  height: 31px;
  gap: 9px;
}
.file-name {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.45px;
  color: var(--ink);
}
.extension {
  font: 500 12px/19px var(--sans);
  color: #fff;
  background: #0b57d0;
  border-radius: 3px;
  padding: 0 6px;
  margin: 1px 3px 0 1px;
  letter-spacing: 0.1px;
}
.cloud {
  color: var(--ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}
.cloud .icon {
  width: 19px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 5px;
  color: var(--ui);
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-btn:hover,
.view-button:hover,
.select-wrap:hover,
.outline-toggle:hover,
.restore-tools:hover {
  background: var(--hover);
}
.title-row .icon-btn {
  height: 28px;
  width: 28px;
}
.title-row .icon-btn .icon {
  width: 19px;
  height: 19px;
}
#star[aria-pressed="true"] {
  color: var(--blue);
}
#star[aria-pressed="true"] svg {
  fill: var(--blue);
}
.section-tabs {
  display: flex;
  align-items: center;
  margin: -1px 0 0 -7px;
  gap: 2px;
  min-width: 0;
}
.section-tabs a {
  font: 400 15px/24px var(--sans);
  color: var(--ink);
  padding: 1px 8px 2px;
  text-decoration: none;
  border-radius: 4px;
  position: relative;
  white-space: nowrap;
}
.section-tabs a[aria-selected="true"] {
  color: var(--blue);
  background: var(--tint);
}
.section-tabs a:hover {
  background: var(--hover);
}
.file-actions {
  margin: auto 0 auto auto;
  display: flex;
  align-items: center;
  gap: 9px;
}
.file-actions > .icon-btn {
  border-radius: 50%;
  width: 40px;
  height: 40px;
}
.file-actions > .icon-btn .icon {
  width: 22px;
  height: 22px;
}
.download {
  min-height: 42px;
  background: var(--download);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 24px;
  padding: 0 20px;
  color: var(--on-download);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.download:hover {
  filter: brightness(0.96);
  box-shadow: 0 1px 3px #0002;
}
.download .icon {
  width: 19px;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  margin: 0 5px 0 8px;
  background: #17221f;
  border: 1px solid #40524a;
  color: #f7f8f2;
  text-decoration: none;
  font: 700 18px/1 var(--sans);
  letter-spacing: -1.4px;
}
.avatar span {
  border-bottom: 2px solid #00fec2;
}
.tools {
  border-radius: 24px;
  background: var(--toolbar);
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 45px;
  padding: 3px 13px;
}
.divider {
  height: 20px;
  width: 1px;
  background: var(--border);
  margin: 0 7px;
  flex: none;
}
.select-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  border-radius: 4px;
}
.select-wrap select {
  border: 0;
  border-radius: 3px;
  appearance: none;
  cursor: pointer;
  background: transparent;
  padding: 5px 24px 5px 6px;
  font-size: 14px;
  color: var(--ui);
  min-height: 32px;
}
.select-wrap option {
  background: var(--surface);
}
.select-wrap .icon {
  width: 15px;
  height: 15px;
  position: absolute;
  right: 5px;
  pointer-events: none;
  stroke-width: 2.2;
}
.view-button,
.view-status {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--ui);
  font-size: 14px;
}
.view-button {
  padding: 3px 7px;
  min-height: 34px;
  border-radius: 4px;
}
.view-button .icon {
  width: 18px;
  height: 18px;
}
.view-button .icon:last-child {
  width: 14px;
}
.view-status {
  padding: 0 9px;
}
.view-status .icon {
  width: 18px;
  height: 18px;
}
.toolbar-spacer {
  flex: 1;
}
.restore-tools {
  position: absolute;
  right: 20px;
  bottom: -27px;
  background: var(--toolbar);
  border-radius: 0 0 10px 10px;
  padding: 3px 10px;
  color: var(--ui);
}
.tools [aria-pressed="true"] {
  background: var(--tint);
  color: var(--blue);
}
.document-shell {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  padding: 70px 64px 112px;
}
.page {
  max-width: var(--paper-width);
  margin: 0 auto;
  outline: none;
  min-width: 0;
}
.prose,
.source-view {
  font-family: var(--doc);
  font-size: calc(18px * var(--zoom));
  line-height: 1.5;
  overflow-wrap: break-word;
}
.prose h1,
.source-view h2,
.prose.is-focused .doc-section.focus-section > summary h2 {
  font: 600 calc(40px * var(--zoom)) / 1.15 var(--doc);
  letter-spacing: -1.35px;
  margin: 0 0 21px;
}
.prose p,
.source-view p {
  margin: 0 0 18px;
}
.prose h2 {
  font: 500 calc(26px * var(--zoom)) / 1.32 var(--doc);
  letter-spacing: -0.6px;
  margin: 0;
}
.prose h3 {
  font: 600 calc(20px * var(--zoom)) / 1.4 var(--doc);
  letter-spacing: -0.3px;
  margin: 18px 0 5px;
}
.prose a {
  text-underline-offset: 3px;
}
.prose a:hover,
.source-view a:hover {
  text-decoration-thickness: 2px;
}
.prose .doc-section {
  margin-top: 19px;
}
.prose > .doc-section:first-of-type {
  margin-top: 29px;
}
.doc-section > summary,
.work-item > summary {
  list-style: none;
  cursor: pointer;
  position: relative;
}
.doc-section > summary::-webkit-details-marker,
.work-item > summary::-webkit-details-marker {
  display: none;
}
.doc-section > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  width: fit-content;
}
.doc-section > summary:before,
.work-item > summary:before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  position: absolute;
  left: -23px;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}
.doc-section[open] > summary:before,
.work-item[open] > summary:before {
  transform: translateY(-65%) rotate(45deg);
}
.doc-section > summary:hover h2,
.work-item > summary:hover .work-title {
  color: var(--blue);
}
.doc-section > summary:focus-visible,
.work-item > summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}
.doc-section .work-item {
  margin-inline-start: 15px;
}
.section-content {
  padding: 1px 0 0;
}
.section-content p:last-child {
  margin-bottom: 2px;
}
.prose ul,
.prose ol {
  padding-left: 1.45em;
  margin: 12px 0 20px;
}
.prose li {
  margin-bottom: 11px;
  padding-left: 3px;
}
.prose blockquote {
  margin: 10px 0 18px;
  padding: 1px 0 1px 18px;
  border-left: 3px solid var(--border);
  color: var(--ui);
}
.prose blockquote p {
  margin: 0;
}
.prose.is-focused .doc-section.focus-section {
  margin: 0;
}
.prose.is-focused .doc-section.focus-section > summary {
  pointer-events: none;
}
.prose.is-focused .doc-section.focus-section > summary h2 {
  margin: 0 0 16px;
}
.prose.is-focused .doc-section.focus-section > summary:before {
  display: none;
}
.work-item {
  margin: 12px 0;
}
.work-item > summary {
  padding: 7px 0;
  min-height: 44px;
}
.work-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: 0 !important;
}
.work-status {
  color: var(--muted);
  font: 400 14px/1.4 var(--sans);
}
.work-toggle {
  display: none;
}
.work-body {
  padding-bottom: 12px;
}
.work-media {
  display: block;
  width: 100%;
  max-width: 680px;
  height: auto;
  border-radius: 4px;
  max-height: 420px;
  object-fit: cover;
  margin: 18px 0 9px;
  background: #101413;
}
.work-link {
  font-size: 0.9em;
}
.outline-area {
  position: fixed;
  z-index: 7;
  top: calc(var(--header-h) + 20px);
  inset-inline-start: 16px;
}
.outline-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--toolbar);
  color: var(--ui);
}
#outline-panel {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 216px;
  padding: 12px 6px;
  box-shadow: 0 8px 30px #0002;
  margin-top: 8px;
}
#outline-panel p {
  font: 500 13px/1.5 var(--sans);
  color: var(--muted);
  margin: 2px 12px 7px;
}
#outline-panel a {
  display: block;
  color: var(--ui);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 15px;
}
#outline-panel a:hover,
#outline-panel a[aria-current="page"] {
  background: var(--tint);
  color: var(--blue);
}
.source-view pre {
  background: var(--toolbar);
  border-radius: 8px;
  padding: 22px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    calc(14px * var(--zoom)) / 1.7 "IBM Plex Mono",
    monospace;
}
.source-view h2 {
  margin-bottom: 12px;
}
.toast {
  position: fixed;
  z-index: 20;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  border-radius: 6px;
  font: 500 14px/1.4 var(--sans);
  padding: 10px 16px;
  max-width: 90vw;
}
.toast:empty {
  display: none;
}
dialog {
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(80svh, 640px);
  box-shadow: 0 12px 55px #0003;
}
dialog::backdrop {
  background: #10131866;
}
.dialog-header,
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dialog-header {
  justify-content: space-between;
  margin-bottom: 14px;
}
.dialog-header h2 {
  font: 500 22px var(--sans);
  margin: 0;
}
.search-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
}
.search-box:focus-within {
  outline: 2px solid var(--blue);
}
.search-box input {
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  padding: 11px 0;
}
.search-box input:focus-visible {
  outline: 0;
}
#find-results {
  margin-top: 10px;
}
.find-result {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 6px;
  padding: 10px;
}
.find-result:hover,
.find-result:focus-visible {
  background: var(--toolbar);
}
.find-result-title,
.find-result-snippet {
  display: block;
}
.find-result-snippet,
.find-empty {
  font-size: 14px;
  color: var(--muted);
}
.find-empty {
  padding: 3px 10px;
}
@media (min-width: 1200px) {
  .document-shell {
    --paper-width: min(62vw, 930px);
    padding-top: 83px;
  }
}
@media (max-width: 800px) {
  .document-shell {
    padding: 56px 64px 90px 82px;
  }
  .filebar {
    gap: 12px;
  }
  .file-actions {
    gap: 3px;
  }
  .avatar {
    margin-left: 5px;
  }
  .editor {
    padding-inline: 10px;
  }
  .outline-area {
    inset-inline-start: 14px;
  }
  .file-actions > .icon-btn {
    display: none;
  }
}
@media (max-width: 600px) {
  :root {
    --header-h: 146px;
  }
  .editor {
    padding: 9px 7px 6px;
  }
  .filebar {
    min-height: 80px;
    padding: 0 4px;
    gap: 9px;
  }
  .doc-icon {
    width: 24px;
    height: 31px;
    margin: 2px 0 0 1px;
  }
  .doc-icon i {
    left: 5px;
    bottom: 11px;
    width: 14px;
  }
  .doc-icon b {
    left: 5px;
    bottom: 7px;
    width: 10px;
  }
  .file-name {
    font-size: 20px;
  }
  .extension {
    font-size: 11px;
    line-height: 17px;
    padding: 0 4px;
    margin: 0;
  }
  .title-row {
    gap: 6px;
    height: 34px;
  }
  .title-row .icon-btn,
  .title-row .cloud {
    display: none;
  }
  .file-actions {
    margin: 0 0 0 auto;
    align-items: center;
    min-height: 34px;
  }
  .download {
    padding: 0 12px;
    min-height: 36px;
    font-size: 13px;
    gap: 6px;
  }
  .download .icon {
    width: 16px;
  }
  .avatar {
    width: 29px;
    height: 29px;
    font-size: 15px;
    margin: 0 0 0 5px;
  }
  .section-tabs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    margin: 0;
    justify-content: space-between;
    gap: 0;
  }
  .section-tabs a {
    font-size: 14px;
    padding: 5px 8px;
    min-height: 36px;
    display: flex;
    align-items: center;
  }
  .tools {
    padding: 2px 5px;
    min-height: 40px;
  }
  .icon-btn {
    width: 34px;
    height: 36px;
  }
  .tools .icon {
    width: 18px;
    height: 18px;
  }
  .tools .divider {
    margin: 0 2px;
  }
  .view-button {
    font-size: 12px;
    gap: 4px;
    padding: 2px 4px;
  }
  .view-button .icon:first-child {
    display: none;
  }
  .view-button .icon:last-child {
    width: 11px;
  }
  .view-status,
  .secondary-tool,
  .collapse-divider {
    display: none;
  }
  .select-wrap select {
    font-size: 13px;
    padding-left: 4px;
  }
  .document-shell {
    padding: 44px 24px 72px 36px;
  }
  .prose,
  .source-view {
    font-size: calc(16px * var(--zoom));
    line-height: 1.52;
  }
  .prose h1,
  .source-view h2,
  .prose.is-focused .doc-section.focus-section > summary h2 {
    font-size: calc(32px * var(--zoom));
    letter-spacing: -1px;
  }
  .prose h2 {
    font-size: calc(22px * var(--zoom));
  }
  .prose h3 {
    font-size: calc(18px * var(--zoom));
  }
  .doc-section > summary:before,
  .work-item > summary:before {
    left: -16px;
    width: 6px;
    height: 6px;
  }
  .outline-area {
    position: static;
  }
  .outline-toggle {
    display: none;
  }
  #outline-panel {
    position: fixed;
    top: var(--header-h);
    inset-inline-start: 8px;
    z-index: 7;
  }
  .source-view pre {
    padding: 12px;
  }
  .work-status {
    flex-basis: 100%;
  }
  .work-heading {
    gap: 1px;
  }
  .toast {
    bottom: 14px;
  }
  .tools .icon-btn,
  .section-tabs a,
  .download,
  .view-button {
    min-height: 40px;
  }
}
@media (max-width: 360px) {
  .avatar {
    display: none;
  }
  .section-tabs a {
    padding-inline: 6px;
  }
  .tools {
    gap: 0;
  }
  .tools .icon-btn {
    width: 29px;
  }
}
@media print {
  .editor,
  .outline-area,
  .toast,
  .skip,
  dialog,
  .source-view,
  .work-media,
  .work-status + .work-toggle {
    display: none !important;
  }
  :root {
    --ink: #111;
    --surface: white;
    --ui: #333;
    --muted: #555;
    --blue: #111;
    --zoom: 1;
  }
  body,
  .document-shell,
  .page {
    background: white;
    color: #111;
    padding: 0;
    margin: 0;
    max-width: none;
  }
  .prose {
    font-size: 11pt;
  }
  .prose h1 {
    font-size: 23pt;
  }
  .prose h2,
  .prose.is-focused .doc-section.focus-section > summary h2 {
    font-size: 17pt;
  }
  .prose h3 {
    font-size: 13pt;
  }
  .prose summary:before {
    display: none;
  }
  .prose p,
  .prose li {
    orphans: 3;
    widows: 3;
  }
  .prose details > summary {
    break-after: avoid;
  }
  .prose > .doc-section {
    margin-top: 16px;
  }
}
.file-name {
  white-space: nowrap;
}
@media (max-width: 600px) {
  .filebar {
    gap: 7px;
  }
  .file-stack {
    flex: 1;
  }
  .avatar {
    display: none;
  }
  .tools .secondary-tool:not(.divider) {
    display: inline-flex;
  }
  .tools [data-action="print"],
  .tools #code-toggle {
    display: none;
  }
  .tools .icon-btn,
  .view-button,
  .section-tabs a,
  .download {
    min-height: 44px;
  }
  .work-heading {
    font-size: 1.06em;
  }
}
/* Document routes share the guide toolbar and persistent desktop outline. */
.filebar {
  align-items: center;
  padding: 1px 5px 4px;
  min-height: 42px;
}
.file-stack {
  flex: 1;
  overflow: hidden;
}
.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.title-row {
  min-width: 0;
}
.doc-icon {
  margin-top: 0;
}
.section-tabs {
  position: static;
  margin: 2px 0 6px 53px;
  justify-content: flex-start;
  gap: 3px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}
.section-tabs a {
  flex: none;
  min-height: 32px;
  padding: 4px 9px;
}
.section-tabs a[aria-current="page"] {
  background: var(--tint);
  color: var(--blue);
}
.file-actions {
  flex: none;
  align-self: center;
  gap: 8px;
}
.copy-for-ai,
.download--secondary {
  font: 500 15px/1.25 var(--sans);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  text-decoration: none;
  border-radius: 24px;
  white-space: nowrap;
}
.copy-for-ai {
  background: var(--tint);
  color: var(--blue);
  font-weight: 600;
}
.copy-for-ai .icon { width: 17px; height: 17px; }
.copy-for-ai:hover {
  filter: brightness(0.95);
}
.download--secondary {
  background: transparent;
  color: var(--ui);
  border: 1px solid var(--border);
}
.download--secondary:hover {
  background: var(--toolbar);
}
.language-select {
  position: relative;
  font: 500 14px/1.3 var(--sans);
}
.language-select > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 6px;
}
.language-select summary::-webkit-details-marker {
  display: none;
}
.language-select > nav {
  position: absolute;
  inset-inline-end: 0;
  top: 100%;
  z-index: 12;
  background: var(--raised);
  color: var(--ink);
  box-shadow: 0 5px 24px #0002;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
  min-width: 114px;
}
.language-select a {
  display: block;
  padding: 8px;
  color: var(--ui);
  text-decoration: none;
}
.language-select a:hover,
.language-select a[aria-current="page"] {
  background: var(--tint);
}
.doc-section > summary,
.work-item > summary {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.doc-section > summary h2,
.work-item > summary .work-heading {
  pointer-events: none;
  user-select: none;
}
.work-heading {
  font-family: var(--doc);
  font-weight: 500;
  font-size: 1.05em;
}
.work-item {
  margin-block: 3px;
}
.section-content > h3 {
  margin-top: 24px;
}
.prose [id] {
  scroll-margin-top: 12px;
}
.prose > a[id]:empty,
.prose p > a[id]:empty {
  display: block;
}
.prose img {
  max-width: 100%;
  height: auto;
}
.prose p:has(> img[src="/media/fadil-khan.webp"]) {
  float: inline-end;
  width: clamp(90px, 22%, 164px);
  margin-block: 0 12px;
  margin-inline: clamp(16px, 3vw, 28px) 0;
}
.prose img[src="/media/fadil-khan.webp"] {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
}
.prose table {
  border-collapse: collapse;
  max-width: 100%;
  display: block;
  overflow: auto;
}
.prose td,
.prose th {
  border: 1px solid var(--border);
  padding: 7px 11px;
}
.prose > h2 {
  margin: 32px 0 12px;
}
.prose blockquote {
  margin-block: 22px;
}
.prose .doc-parent,
.prose .byline,
.prose .article-author {
  font: 400 14px/1.5 var(--sans);
  color: var(--muted);
}
.doc-parent a {
  text-decoration: none;
}
.writing-entry {
  border-block: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 30px;
  align-items: center;
  padding: 26px 0;
  margin-top: 28px;
}
.writing-entry > :only-child { grid-column: 1 / -1; max-width: 68ch; }
.writing-entry h2 {
  margin: 0 0 10px;
  font-weight: 600;
}
.writing-entry h2 a {
  color: var(--ink);
  text-decoration: none;
}
.writing-entry h2 a:hover {
  text-decoration: underline;
}
.writing-entry img {
  display: block;
  border: 1px solid var(--border);
  height: auto;
  border-radius: 5px;
}
.writing-entry .byline {
  margin-bottom: 9px;
}
.writing-entry .article-author {
  margin: 0;
}
.document-footer {
  border-top: 1px solid var(--border);
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 24px clamp(20px, 4vw, 60px) 48px;
  color: var(--muted);
  font: 400 14px/1.6 var(--sans);
}
.document-footer p {
  font-weight: 600;
}
.document-footer nav,
.document-footer > div {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.document-footer a {
  color: inherit;
  text-underline-offset: 3px;
}
.outline-open #outline-panel {
  max-height: calc(100svh - var(--header-h) - 86px);
  overflow-y: auto;
}
#outline-panel a[aria-current="location"] {
  background: var(--tint);
  color: var(--blue);
}
.intake-link:has([hidden]) {
  display: none;
}
.prose form {
  font-family: var(--sans);
}
[dir="rtl"] .doc-section > summary:before,
[dir="rtl"] .work-item > summary:before {
  left: auto;
  right: -22px;
}
.source-view pre {
  direction: ltr;
  text-align: start;
}
@media (min-width: 1024px) {
  .document-shell {
    --outline-width: 216px;
    --outline-gap: clamp(56px, 5.5vw, 96px);
    --page-inset: 64px;
    padding-inline: var(--page-inset);
    padding-top: 50px;
  }
  /* Center the document whenever its natural margin clears the outline. */
  .outline-open .page {
    margin-inline-start: max(
      calc((100% - var(--paper-width)) / 2),
      calc(16px + var(--outline-width) + var(--outline-gap) - var(--page-inset))
    );
  }
  #outline-panel {
    inline-size: var(--outline-width);
  }
  html {
    scroll-padding-top: calc(var(--header-h) + 16px);
  }
}
@media (max-width: 1023px) {
  .outline-area {
    z-index: 9;
  }
  #outline-panel {
    max-width: min(78vw, 300px);
  }
  .document-shell {
    padding-inline-start: 62px;
    padding-inline-end: 34px;
  }
  .section-tabs {
    margin-inline-start: 47px;
  }
  .outline-toggle {
    width: 34px;
    height: 34px;
  }
  .copy-for-ai,
  .download--secondary {
    padding-inline: 12px;
  }
  .writing-entry {
    gap: 18px;
  }
}
@media (max-width: 600px) {
  .filebar {
    min-height: 42px;
    gap: 6px;
  }
  .title-row {
    gap: 4px;
  }
  .file-name {
    font-size: 17px;
  }
  .file-actions {
    gap: 3px;
    margin-inline-start: auto;
  }
  .doc-icon {
    width: 20px;
    height: 27px;
  }
  .copy-for-ai .icon { display: none; }
  .copy-for-ai {
    min-height: 38px;
    font-size: 12px;
    padding-inline: 9px;
  }
  .download--secondary {
    height: 38px;
    min-height: 38px;
    width: 33px;
    border: 0;
    padding: 4px;
  }
  .download--secondary span {
    display: none;
  }
  .language-select {
    font-size: 12px;
  }
  .language-select summary {
    padding: 8px 2px;
  }
  .section-tabs {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    margin: 6px 0 6px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .section-tabs a {
    font-size: 13px;
    min-height: 44px;
    padding: 4px 7px;
  }
  .document-shell {
    padding: 33px 22px 64px 32px;
  }
  .writing-entry {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .outline-area {
    inset-inline-start: 8px;
  }
  #outline-panel {
    position: fixed;
    inset-inline-start: 8px;
    max-height: calc(100svh - var(--header-h) - 36px);
  }
  .document-footer {
    margin: 0 14px;
    padding: 16px 2px 30px;
  }
  [dir="rtl"] .document-shell {
    padding-inline: 32px 22px;
  }
  [dir="rtl"] .doc-section > summary:before,
  [dir="rtl"] .work-item > summary:before {
    right: -16px;
  }
  .document-shell .prose {
    line-height: 1.55;
  }
}
@media print {
  .document-footer,
  [data-booking-chip],
  .intake-link,
  .language-select,
  .doc-parent,
  .prose form {
    display: none !important;
  }
  .outline-open .document-shell,
  .document-shell {
    padding: 0;
  }
  .outline-open .page {
    margin-inline: 0;
    max-width: 100%;
  }
  .prose > h2 {
    break-after: avoid;
  }
}

/* Navigation fits whole tabs; remaining destinations are available in More. */
.section-tabs {
  position: relative;
  flex-wrap: wrap;
  overflow: visible;
  margin-inline: 53px 0;
}
.more-sections { position: relative; flex: none; }
.more-sections > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding-inline: 9px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.more-sections > summary::-webkit-details-marker { display: none; }
.more-sections > summary::after {
  content: "";
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-block-start-color: currentColor;
  transform: translateY(2px);
}
.more-sections[open] > summary,
.more-sections > summary:hover { background: var(--hover); }
.more-sections > summary.contains-current { background: var(--tint); color: var(--blue); }
.more-sections > div {
  position: absolute;
  z-index: 15;
  inset-block-start: calc(100% + 2px);
  inset-inline-end: 0;
  min-width: 9rem;
  max-width: calc(100vw - 22px);
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--raised);
  box-shadow: 0 5px 24px #0002;
}
.section-tabs .more-sections a { display: flex; align-items: center; padding-inline: 10px; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
[dir="rtl"] .file-actions { margin-inline: auto 0; }
@media (max-width: 1023px) {
  .section-tabs { margin-inline: 47px 0; }
}
@media (max-width: 600px) {
  .section-tabs { margin-inline: 0; }
  .section-tabs :is(a, summary) { min-height: 44px; font-size: 14px; }
  .more-sections > summary { padding-inline: 8px; }
  .file-actions :is(.language-select > summary, .download, .copy-for-ai) { min-height: 44px; }
  .file-actions :is(.language-select > summary, .download) { min-width: 44px; }
  .language-select > summary { display: grid; place-content: center; grid-auto-flow: column; gap: 3px; }
  .tools .icon-btn, .tools .view-button, .tools select { min-width: 44px; min-height: 44px; }
  .tools .icon-btn { width: 44px; }
  .tools .divider { margin-inline: 2px; }
  .language-select nav a { min-height: 44px; }
}
@media (max-width: 380px) {
  .tools .view-button > span { display: none; }
  .tools .view-button > .icon:first-child { display: block; }
  .tools .view-button > .icon:last-child { display: none; }
  .file-actions { gap: 1px; }
}
@media (pointer: coarse) and (min-width: 601px) {
  .editor :is(.tools button, .tools select, .file-actions a, .file-actions button, .language-select summary, .section-tabs a, .more-sections summary) {
    min-height: 44px;
  }
  .tools .icon-btn, .file-actions .language-select summary { min-width: 44px; }
}

.more-sections:not([open]) > div,
.language-select:not([open]) > nav { display: none; }
@media (pointer: coarse) and (min-width: 601px) {
  .title-row .icon-btn { min-height: 44px; min-width: 44px; }
}
@media (min-width: 601px) and (max-width: 740px) {
  .tools #code-toggle, .tools .view-status, .tools .collapse-divider { display: none; }
}
@media screen and (max-height: 500px) and (orientation: landscape) {
  :root { --sticky-strip: 54px; }
  .editor { top: calc(var(--sticky-strip) - var(--header-h)); }
  .editor:has(:focus-visible) { top: 0; }
  html { scroll-padding-top: calc(var(--sticky-strip) + 16px); }
  .outline-area, #outline-panel { top: calc(var(--sticky-strip) + 5px); }
  .outline-open #outline-panel { max-height: calc(100dvh - var(--sticky-strip) - 14px); }
}

.book-discovery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding-inline: 15px;
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--ui);
  background: var(--chrome);
  font: 500 14px/1.3 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}
.book-discovery:hover { background: var(--toolbar); }
.book-label-short { display: none; }
.source-download { color: var(--blue); text-underline-offset: 3px; }
@media (pointer: coarse) {
  .book-discovery { min-height: 44px; }
}
@media (max-width: 600px) {
  .book-label-long { display: none; }
  .book-label-short { display: inline; }
  .book-discovery { min-height: 44px; padding-inline: 10px; font-size: 13px; }
}
@media (max-width: 480px) {
  .editor {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 5px;
    padding-inline: 8px;
  }
  .filebar, .file-actions { display: contents; }
  .doc-icon { grid-area: 1 / 1; }
  .file-stack { grid-area: 1 / 2; }
  .booking-menu-wrap { grid-area: 1 / 3; }
  .copy-for-ai { grid-area: 1 / 4; }
  .section-tabs {
    grid-area: 2 / 1 / 3 / -1;
    margin-inline: 0;
  }
  .editor:has(.language-select) .section-tabs { margin-inline-end: 48px; }
  .language-select { grid-area: 2 / 1 / 3 / -1; justify-self: end; z-index: 2; }
  .tool-row { grid-area: 3 / 1 / 4 / -1; }
}

/* Across a physical hinge, put navigation on one screen and reading on the other. */
@media screen and (horizontal-viewport-segments: 2) {
  :root {
    --controls-pane: env(viewport-segment-width 0 0);
    --reading-pane: env(viewport-segment-width 1 0);
  }
  :root[dir="rtl"] {
    --controls-pane: env(viewport-segment-width 1 0);
    --reading-pane: env(viewport-segment-width 0 0);
  }
  .editor {
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    width: var(--controls-pane);
    padding-inline: 8px;
  }
  .editor .section-tabs { margin-inline: 0; }
  .filebar, .file-actions { gap: 5px; }
  .editor .file-name { font-size: 17px; }
  .title-row .cloud, .title-row .icon-btn, .tools #code-toggle,
  .tools .view-status, .tools .collapse-divider, .book-label-long { display: none; }
  .book-label-short { display: inline; }
  .book-discovery, .copy-for-ai { padding-inline: 9px; font-size: 13px; }
  .language-select > nav { inset-inline: 0 auto; }
  .tool-row { container: doc-controls / inline-size; }
  .tools { gap: 0; padding-inline: 5px; }
  .tools .divider { margin-inline: 2px; }
  .document-shell, .document-footer {
    width: var(--reading-pane);
    max-width: var(--reading-pane);
    margin-inline: auto 0;
    padding-inline: clamp(21px, 2.5vw, 36px);
  }
  .document-shell { padding-block-start: 34px; min-height: 100svh; }
  .outline-open .page { margin-inline: 0; }
  .outline-area {
    position: fixed;
    inset-inline-start: 12px;
    top: calc(var(--header-h) + 10px);
    width: calc(var(--controls-pane) - 24px);
  }
  .outline-area #outline-panel {
    position: static;
    inline-size: 100%;
    max-width: 100%;
    max-height: calc(100svh - var(--header-h) - 64px);
  }
  .outline-toggle { display: inline-flex; }
  html { scroll-padding-top: 16px; }
}

@container doc-controls (max-width: 400px) {
  .tools [data-action="print"], .tools .view-button > span,
  .tools .view-button > .icon:last-child { display: none; }
  .tools .view-button > .icon:first-child { display: block; }
  .tools .view-button { min-width: 44px; justify-content: center; }
}
