/* Compact notation workbench, editor tokens, and responsive navigation. */
:root {
  --paper: #faf7ef;
  --surface: #fffdf8;
  --ink: #2c3029;
  --muted: #666c60;
  --rule: #dfdfd2;
  --accent: #b74632;
  --sage: #4e6855;
  --code: #f4f1e8;
  color-scheme: light;
  font:
    12px/1.5 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}
button {
  background: transparent;
  border: 0;
}
input,
select {
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
button:hover {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection {
  background: #e9d9b7;
}
input[type='checkbox'] {
  accent-color: var(--sage);
}
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  top: -80px;
  left: 10px;
  z-index: 50;
  padding: 10px;
  background: white;
}
.skip:focus {
  top: 8px;
}
.eyebrow,
.nav-heading {
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 600;
}
.subtle {
  color: var(--muted);
  font-size: 12px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
.masthead {
  height: 48px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-family: inherit;
  white-space: nowrap;
  font-weight: 600;
}
.brand em {
  font: 12px system-ui;
  color: var(--muted);
  font-style: normal;
  border-left: 1px solid var(--rule);
  padding-left: 9px;
  margin-left: 8px;
}

.repo-link {
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.repo-link span {
  color: var(--accent);
  font-size: 17px;
}
.sidebar {
  position: fixed;
  top: 48px;
  bottom: 0;
  width: 212px;
  border-right: 1px solid var(--rule);
  padding: 14px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d9d9cc transparent;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 3px 7px;
  background: #f0f0e6;
}
.search-field input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  outline-offset: 5px;
  font-size: 12px;
  padding: 4px 0;
}
.search-field span {
  font-size: 23px;
  line-height: 1;
}
.search-field kbd {
  white-space: nowrap;
  font: 10px system-ui;
  color: #96988a;
}
.nav-heading {
  display: flex;
  justify-content: space-between;
  margin: 14px 8px 8px;
  color: var(--muted);
  font-size: 10px;
}
.nav-group {
  margin: 0 0 12px;
}
.nav-group h2 {
  margin: 0 8px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sage);
}
.nav-item {
  display: block;
  padding: 3px 8px;
  font-size: 11px;
  position: relative;
  border-radius: 3px;
  color: #62685b;
}
.nav-item.active {
  background: #eeeade;
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active:before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--accent);
}
.nav-item:hover {
  background: #f1eee4;
}
.no-results {
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
}
.glyph-nav {
  border-top: 0;
  border-bottom: 1px solid var(--rule);
  padding: 8px 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 8px;
}

.glyph-nav > span:last-child {
  margin-left: auto;
  color: var(--accent);
}
.glyph-nav-icon {
  font-size: 20px;
  color: var(--sage);
}
.sidebar-footer {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  margin: 12px 8px 0;
}
main {
  margin-left: 212px;
  padding: 18px 22px 0;
  max-width: none;
}
.intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0 0 14px;
}
.intro .eyebrow {
  color: var(--muted);
  margin-bottom: 4px;
}
h1 {
  font:
    600 24px/1.25 system-ui,
    sans-serif;
  letter-spacing: -0.025em;
  margin-bottom: 5px;
}
.intro p {
  max-width: 850px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 0;
}

.render-card {
  min-width: 0;
  align-self: start;
  border: 1px solid #d7d9cb;
  border-radius: 5px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: none;
}
.render-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--rule);
  background: #f7f7ef;
}
.live-label {
  font-size: 11px;
  letter-spacing: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}
.live-label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7d9273;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.font-control {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.font-control select {
  font-size: 11px;
  padding: 4px 7px;
  border: 0;
  background: none;
}
.toggle {
  font-size: 10px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
}
.toggle[aria-pressed='true'] {
  background: #e7ece2;
  color: #415c47;
  border-color: #d2dccb;
}
.icon-button {
  padding: 4px 7px;
  font-size: 18px;
  line-height: 1;
}
.text-button {
  font-size: 11px;
  white-space: nowrap;
  padding: 5px;
}
.preview {
  position: relative;
  background: var(--surface);
  transition: background 0.2s;
}
.preview.dark {
  background: #242b28;
}
#frame-host {
  position: relative;
  overflow: hidden;
}
.preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  display: block;
  width: 100%;
  border: 0;
}
.render-pending {
  position: absolute;
  bottom: 6px;
  right: 12px;
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
.render-meta {
  padding: 5px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font:
    10px/1.5 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  border-top: 1px solid var(--rule);
}
.controls {
  padding: 8px 10px;
  background: #f8f7f0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.control {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 100px;
  max-width: 320px;
}
.control label {
  font-size: 10px;
  color: var(--muted);
}
.control input,
.control select {
  padding: 4px 7px;
  width: 100%;
  font-size: 11px;
}
.control input[type='range'] {
  padding: 0;
  accent-color: var(--sage);
  height: 25px;
}
.range-label {
  display: flex;
  justify-content: space-between;
}
.range-label output {
  color: var(--sage);
  font-variant-numeric: tabular-nums;
}
.preview-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  margin-bottom: 14px;
}
.code-panel {
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
}

h2 {
  font:
    600 13px/1.4 system-ui,
    sans-serif;
  margin: 0;
  letter-spacing: 0;
}
.code-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.primary-button {
  background: var(--sage);
  color: #fffdf5;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
}
.primary-button:hover {
  background: #354e3c;
  color: white;
}
.primary-button span {
  opacity: 0.6;
  font-size: 10px;
  margin-left: 6px;
}
.editor-shell {
  display: flex;
  height: 320px;
  background: var(--code);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  resize: vertical;
  min-height: 160px;
  max-height: 80vh;
}
#line-numbers {
  padding: 10px 8px;
  margin: 0;
  text-align: right;
  color: #a6a799;
  border-right: 1px solid #e4e2d6;
  overflow: hidden;
  user-select: none;
  flex: 0 0 38px;
  font-variant-numeric: tabular-nums;
}
#editor {
  resize: none;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: #30382d;
  padding: 10px;
  outline: 0;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  border-radius: 0;
  caret-color: var(--ink);
}
#line-numbers,
#editor {
  font:
    11px/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 0;
}
.editor-shell:focus-within {
  box-shadow: inset 0 0 0 1px #a4b49b;
}
.editor-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  padding: 5px 10px;
}
.editor-footer label {
  display: flex;
  align-items: center;
  gap: 5px;
}
.editor-footer > :last-child {
  margin-left: auto;
}
.environment {
  border-top: 1px solid var(--rule);
  padding: 7px 10px;
  font-size: 11px;
  color: var(--muted);
}
summary {
  cursor: pointer;
}
.environment p {
  margin-top: 10px;
}
.environment pre {
  overflow: auto;
  color: #455845;
  font-size: 11px;
}
.detail-panel {
  padding: 0 2px;
  min-width: 0;
}
.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--rule);
  gap: 18px;
  margin-bottom: 10px;
}
.detail-tabs button {
  font-size: 11px;
  padding: 9px 0 8px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.detail-tabs button[aria-selected='true'] {
  border-color: var(--accent);
  color: var(--ink);
}
.inspector-hint {
  padding: 0;
}

h3 {
  font:
    600 12px/1.5 system-ui,
    sans-serif;
  margin: 8px 0;
}
.detail-panel p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.element-picker {
  font-size: 10px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  margin-top: 10px;
}
.element-picker select {
  width: 100%;
  font:
    11px ui-monospace,
    monospace;
  padding: 5px;
}
.diagnostics {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  color: var(--muted);
}
.diagnostics p {
  font-size: 11px;
}
.inspection-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inspection-title h3 {
  font-size: 13px;
  color: var(--sage);
}
.inspection-id {
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
}
.metric-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  margin: 8px 0;
}
.metric-table td {
  padding: 4px 0;
  border-bottom: 1px solid #e5e4d9;
  vertical-align: top;
}
.metric-table td:first-child {
  color: var(--muted);
  width: 40%;
}
.metric-table td:last-child {
  font-family: ui-monospace, monospace;
  overflow-wrap: anywhere;
}
.related {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.related button,
.api-link {
  display: inline-block;
  border: 1px solid var(--rule);
  padding: 5px 8px;
  font:
    10px ui-monospace,
    monospace;
  border-radius: 3px;
  margin-bottom: 5px;
}
.api-link {
  margin-right: 5px;
}
.example-pagination {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 11px;
  padding: 16px 0;
  color: var(--muted);
}
.example-pagination span {
  font-family: ui-monospace, monospace;
  font-size: 10px;
}
.main-footer {
  border-top: 1px solid var(--rule);
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  gap: 15px;
}
.error-panel {
  padding: 10px 12px;
  background: #fcf0e9;
  border-top: 1px solid #e6c9b8;
  color: #8c3429;
  font-size: 12px;
}
.error-panel pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  max-height: 150px;
  overflow: auto;
}
.glyph-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 11px;
}
.glyph-tools input[type='search'] {
  padding: 6px 9px;
  flex: 1;
  min-width: 230px;
}
.glyph-tools select {
  padding: 5px;
}
.glyph-tools label {
  display: flex;
  gap: 6px;
  align-items: center;
}
.glyph-tools span {
  color: var(--muted);
}
.glyph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  gap: 14px;
}
.glyph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
}
.glyph-cell {
  min-height: 92px;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: 5px;
  padding: 7px;
  min-width: 0;
  overflow: hidden;
  text-align: left;
}
.glyph-cell:hover,
.glyph-cell.active {
  border-color: var(--accent);
}
.glyph-symbol {
  display: block;
  text-align: center;
  font-size: 26px;
  line-height: 46px;
  height: 48px;
}
.glyph-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font:
    9px ui-monospace,
    monospace;
  color: var(--muted);
}
.glyph-code {
  font:
    8px ui-monospace,
    monospace;
  color: #a0a28f;
}
.glyph-detail {
  position: sticky;
  top: 62px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 12px;
  overflow: hidden;
}
.glyph-large {
  height: 125px;
  display: grid;
  place-items: center;
  font-size: 65px;
  background: linear-gradient(transparent 49.5%, #e2e4d5 50%, transparent 50.5%);
  margin-bottom: 10px;
}
.glyph-detail h2 {
  font:
    12px/1.6 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
}
.glyph-detail pre {
  font:
    10px/1.7 ui-monospace,
    monospace;
  background: var(--code);
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.glyph-detail p {
  font-size: 11px;
  color: var(--muted);
}
.more-button {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 7px 14px;
  margin: 16px auto;
  font-size: 11px;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #344c3c;
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 50;
}
.mobile-only {
  display: none;
}

@media (max-width: 1100px) {
  .sidebar {
    width: 195px;
    padding-left: 14px;
    padding-right: 14px;
  }
  main {
    margin-left: 195px;
    padding: 16px;
  }
  .preview-workbench {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 16px;
  }

  .toolbar-actions {
    gap: 3px;
  }
  .glyph-layout {
    grid-template-columns: minmax(0, 1fr) 200px;
  }
}
@media (max-width: 850px) {
  .preview-workbench {
    grid-template-columns: 1fr;
  }
  .detail-panel {
    border: 1px solid var(--rule);
    border-radius: 7px;
    padding: 0 18px 18px;
  }
  .inspector-hint {
    padding: 0;
  }
  .render-toolbar {
    align-items: flex-start;
  }
  .live-label {
    padding-top: 8px;
  }
  .toolbar-actions {
    justify-content: flex-end;
  }

  .repo-link {
    margin-left: auto;
  }
  .glyph-layout {
    grid-template-columns: 1fr;
  }
  .glyph-detail {
    position: static;
    grid-row: 1;
  }
  .glyph-large {
    float: left;
    width: 100px;
    height: 100px;
    margin-right: 20px;
  }
  .glyph-detail pre {
    margin-left: 120px;
  }
  .glyph-detail h2 {
    margin-top: 10px;
  }
}
@media (max-width: 640px) {
  .masthead {
    height: 48px;
    padding: 0 16px;
    gap: 10px;
  }
  .brand {
    font-size: 14px;
    gap: 7px;
  }
  .brand img {
    width: 24px;
    height: 24px;
  }
  .brand em {
    font-size: 10px;
    margin-left: 6px;
    padding-left: 7px;
  }
  .mobile-only {
    display: block;
  }
  .sidebar {
    top: 48px;
    width: 260px;
    background: var(--paper);
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s;
    box-shadow: 15px 0 30px #343c2c12;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  main {
    margin-left: 0;
    padding: 14px 12px 0;
  }
  .intro {
    padding-bottom: 12px;
  }
  .intro p {
    font-size: 13px;
  }
  h1 {
    font-size: 23px;
  }
  .render-toolbar {
    padding: 10px;
    gap: 5px;
  }
  .toolbar-actions {
    gap: 2px;
  }
  .font-control {
    font-size: 0;
  }
  .font-control select {
    font-size: 10px;
  }
  .toggle {
    font-size: 9px;
    padding: 5px;
  }
  .live-label {
    font-size: 8px;
    letter-spacing: 0.05em;
  }
  .render-meta {
    font-size: 8px;
    flex-wrap: wrap;
    padding: 8px 11px;
  }
  .controls {
    padding: 12px;
    gap: 10px;
  }
  .control {
    min-width: 110px;
  }
  .panel-heading {
    padding: 8px 10px;
  }
  .primary-button span {
    display: none;
  }
  .code-actions {
    gap: 3px;
  }
  #editor,
  #line-numbers {
    font-size: 11px;
  }
  .editor-shell {
    height: 330px;
  }
  .glyph-tools {
    gap: 9px;
  }
  .glyph-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .main-footer {
    font-size: 9px;
    align-items: flex-start;
  }
  .main-footer a {
    max-width: 150px;
    text-align: right;
  }
  .example-pagination a {
    max-width: 40%;
  }
  .repo-link {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Prism JavaScript tokens use subdued colors against the editor's warm background. */
.token.comment,
.token.prolog {
  color: #72776b;
  font-style: italic;
}
.token.keyword {
  color: #8c3d66;
}
.token.string,
.token.template-string {
  color: #42643d;
}
.token.number,
.token.boolean {
  color: #9a4d26;
}
.token.function,
.token.class-name {
  color: #235f78;
}
.token.operator,
.token.punctuation {
  color: #62675b;
}
.token.regex {
  color: #8b5421;
}
