.home-screen-scroll {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.home-screen {
  flex: none;
  width: min(100%, 640px);
  margin: auto;
  padding: 48px 32px 32px;
  text-align: center;
}
.home-screen-symbol {
  color: var(--accent);
  font:
    38px ui-monospace,
    monospace;
}
.home-screen h1 {
  margin: 24px 0 16px;
  font-size: clamp(25px, 3.6vw, 34px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.home-screen-description {
  max-width: 470px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.home-screen-open {
  margin-top: 28px;
}
.home-screen-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.home-screen-drop-hint,
.home-screen-local {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.home-screen-local {
  margin-top: 16px;
}
.home-screen > .update-available {
  margin-top: 12px;
}
.home-screen-recovery {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.home-screen-recovery p {
  max-width: 440px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.home-screen-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 11px;
}
.home-screen-footer a {
  color: var(--accent);
  text-underline-offset: 3px;
}
@media (max-width: 480px) {
  .home-screen {
    padding: 28px 20px;
  }
  .home-screen-actions button {
    flex: 1 1 auto;
  }
}

.home-screen-footer .home-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.home-footer-link svg {
  flex-shrink: 0;
}
.home-footer-link:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.home-footer-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.home-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}
@layer rdg {
  @layer Defaults, Cell, HeaderCell, EditCell, Row, HeaderRow, GroupedRow, Root;
}
.rdg-7-0-0-beta-64-fa71d63e {
  @layer rdg.MeasuringCell {
    contain: strict;
    visibility: hidden;
    grid-row: 1;
  }
}
.rdg-7-0-0-beta-64-85c48527 {
  @layer rdg.Cell {
    border-inline-end: var(--rdg-border-width) solid var(--rdg-border-color);
    border-block-end: var(--rdg-border-width) solid var(--rdg-border-color);
    background-color: inherit;
    white-space: nowrap;
    text-overflow: ellipsis;
    outline: none;
    align-content: center;
    padding-block: 0;
    padding-inline: 8px;
    position: relative;
    overflow: clip;

    &[aria-selected="true"] {
      outline: var(--rdg-selection-width) solid var(--rdg-selection-color);
      outline-offset: calc(var(--rdg-selection-width) * -1);
    }
  }
}

.rdg-7-0-0-beta-64-203d9925 {
  @layer rdg.Cell {
    z-index: 1;
    position: sticky;
  }
}

.rdg-7-0-0-beta-64-bfba19bc {
  @layer rdg.DragHandle {
    --rdg-drag-handle-size: 8px;
    z-index: 0;
    cursor: move;
    inline-size: var(--rdg-drag-handle-size);
    block-size: var(--rdg-drag-handle-size);
    background-color: var(--rdg-selection-color);
    place-self: end;

    &:hover {
      --rdg-drag-handle-size: 16px;
      border: 2px solid var(--rdg-selection-color);
      background-color: var(--rdg-background-color);
    }

    @media (forced-colors: active) {
      outline: 1px solid canvas;
    }
  }
}

.rdg-7-0-0-beta-64-7abddb3e {
  @layer rdg.DragHandle {
    z-index: 1;
    position: sticky;
  }
}
.rdg-7-0-0-beta-64-3b807ead {
  @layer rdg.CheckboxInput {
    block-size: 20px;
    inline-size: 20px;
    margin: auto;
    display: block;

    &:focus-visible {
      outline: 2px solid var(--rdg-checkbox-focus-color);
      outline-offset: -3px;
    }

    &:enabled {
      cursor: pointer;
    }
  }
}
.rdg-7-0-0-beta-64-07919382 {
  @layer rdg.GroupCellContent {
    outline: none;
  }
}

.rdg-7-0-0-beta-64-02a50147 {
  @layer rdg.GroupCellCaret {
    stroke: currentColor;
    stroke-width: 1.5px;
    fill: #0000;
    vertical-align: middle;
    margin-inline-start: 4px;

    @media (prefers-reduced-motion: no-preference) {
      & > path {
        transition: d .1s;
      }
    }
  }
}
.rdg-7-0-0-beta-64-56a248e4 {
  @layer rdg.SortableHeaderCell {
    display: flex;
  }
}

.rdg-7-0-0-beta-64-7fad8c83 {
  @layer rdg.SortableHeaderCellName {
    text-overflow: ellipsis;
    flex-grow: 1;
    overflow: clip;
  }
}
.rdg-7-0-0-beta-64-35ccb4c8 {
  @layer rdg.Cell {
    background-color: #ccf;

    @media (forced-colors: active) {
      background-color: mark;
    }
  }
}
.rdg-7-0-0-beta-64-46f9ea88 {
  @layer rdg.EditCell {
    padding: 0;
  }
}

.rdg-7-0-0-beta-64-e7fb7249 {
  @layer rdg.EditCell {
    @media (forced-colors: active) {
      --rdg-selection-color: CanvasText;
    }
  }
}
.rdg-7-0-0-beta-64-0dbd5994 {
  @layer rdg.HeaderRow {
    background-color: var(--rdg-header-background-color);
    font-weight: bold;
    display: contents;

    & > .rdg-7-0-0-beta-64-85c48527 {
      z-index: 2;
      position: sticky;
    }

    & > .rdg-7-0-0-beta-64-203d9925 {
      z-index: 3;
    }
  }
}
.rdg-7-0-0-beta-64-2a7e240d {
  @layer rdg.HeaderCell {
    cursor: pointer;
  }
}

.rdg-7-0-0-beta-64-efff103a {
  @layer rdg.HeaderCell {
    touch-action: none;
    cursor: col-resize;
    inline-size: 10px;
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
  }
}

.rdg-7-0-0-beta-64-e292b4e4 {
  @layer rdg.HeaderCell {
    background-color: var(--rdg-header-draggable-background-color);

    @media (forced-colors: active) {
      outline-offset: -2px;
      outline: 2px dashed highlight;
    }
  }
}

.rdg-7-0-0-beta-64-61a00d28 {
  @layer rdg.HeaderCell {
    outline-offset: -2px;
    border-radius: 4px;
    outline: 2px solid #008cff;
    width: fit-content;
  }
}
.rdg-7-0-0-beta-64-3c083f1b {
  @layer rdg.Row {
    grid-column: 1 / -1;
    grid-template: subgrid / subgrid;
    background-color: var(--rdg-background-color);
    display: grid;

    &:hover {
      background-color: var(--rdg-row-hover-background-color);
    }

    &:focus {
      outline: none;
    }

    &[tabindex="0"] {
      &:after {
        content: "";
        z-index: 1;
        pointer-events: none;
        border: var(--rdg-selection-width) solid var(--rdg-selection-color);
        grid-column: 1 / -1;
      }

      & > .rdg-cell-frozen-start:first-child:before, & > .rdg-cell-frozen-end:last-child:after {
        content: "";
        display: inline-block;
        position: absolute;
        inset-block: 0;
      }

      & > .rdg-cell-frozen-start:first-child:before {
        border-inline-start: var(--rdg-selection-width) solid var(--rdg-selection-color);
        inset-inline-start: 0;
      }

      & > .rdg-cell-frozen-end:last-child:after {
        border-inline-end: var(--rdg-selection-width) solid var(--rdg-selection-color);
        inset-inline-end: 0;
      }
    }

    &[aria-selected="true"] {
      background-color: var(--rdg-row-selected-background-color);

      &:hover {
        background-color: var(--rdg-row-selected-hover-background-color);
      }

      @media (forced-colors: active) {
        --rdg-selection-color: SelectedItemText;
        --rdg-checkbox-focus-color: SelectedItemText;

        &, &:hover {
          background-color: selecteditem;
        }
      }
    }
  }
}
.rdg-7-0-0-beta-64-3d5115f3 {
  @layer rdg.SortIcon {
    fill: currentColor;

    @media (prefers-reduced-motion: no-preference) {
      & > path {
        transition: d .1s;
      }
    }
  }
}
.rdg-7-0-0-beta-64-ccd2e5d9 {
  @layer rdg.Defaults {
    & *, & :before, & :after {
      box-sizing: inherit;
    }
  }

  @layer rdg.Root {
    --rdg-selection-width: 2px;
    --rdg-selection-color: #67afe9;
    --rdg-font-size: 14px;
    --rdg-border-width: 1px;
    --rdg-summary-border-width: calc(var(--rdg-border-width) * 2);
    --rdg-color: light-dark(#000, #ddd);
    --rdg-border-color: light-dark(#ddd, #444);
    --rdg-summary-border-color: light-dark(#aaa, #555);
    --rdg-background-color: light-dark(#fff, #212121);
    --rdg-header-background-color: light-dark(#f9f9f9, #1b1b1b);
    --rdg-header-draggable-background-color: light-dark(#e7e7e7, #2d2d2d);
    --rdg-row-hover-background-color: light-dark(#f5f5f5, #171717);
    --rdg-row-selected-background-color: light-dark(#dbecfa, #1a73bc);
    --rdg-row-selected-hover-background-color: light-dark(#c9e3f8, #1768ab);
    --rdg-checkbox-focus-color: #61b8ff;
    --rdg-frozen-column-shadow-color: light-dark(#00000026, #0006);

    @media (forced-colors: active) {
      --rdg-selection-color: CanvasText;
      --rdg-checkbox-focus-color: CanvasText;
    }

    &.rdg-dark {
      color-scheme: dark;
    }

    &.rdg-light {
      color-scheme: light;
    }

    accent-color: light-dark(#005194, #94cfff);
    contain: content;
    content-visibility: auto;
    border: 1px solid var(--rdg-border-color);
    box-sizing: border-box;
    background-color: var(--rdg-background-color);
    block-size: 350px;
    color: var(--rdg-color);
    font-size: var(--rdg-font-size);
    font-variant-numeric: tabular-nums;
    display: grid;
    overflow: auto;
    container: rdg-root / scroll-state;

    &:before {
      content: "";
      grid-area: -2 / -2 / -1 / -1;
    }

    & > :nth-last-child(1 of .rdg-top-summary-row) {
      & > .rdg-7-0-0-beta-64-85c48527 {
        border-block-end: var(--rdg-summary-border-width) solid var(--rdg-summary-border-color);
      }
    }

    & > :nth-child(1 of .rdg-bottom-summary-row) {
      & > .rdg-7-0-0-beta-64-85c48527 {
        border-block-start: var(--rdg-summary-border-width) solid var(--rdg-summary-border-color);
      }
    }
  }
}

.rdg-7-0-0-beta-64-e9b0e1c9 {
  @layer rdg.Root {
    -webkit-user-select: none;
    user-select: none;

    & .rdg-7-0-0-beta-64-3c083f1b {
      cursor: move;
    }
  }
}

.rdg-7-0-0-beta-64-2e639f12 {
  @layer rdg.FrozenColumnShadow {
    pointer-events: none;
    z-index: 1;
    opacity: 1;
    width: 10px;
    transition: opacity .1s;
    position: sticky;

    &:dir(rtl) {
      transform: scaleX(-1);
    }
  }
}

.rdg-7-0-0-beta-64-86aef152 {
  @layer rdg.FrozenColumnShadow {
    background-image: linear-gradient(to right, var(--rdg-frozen-column-shadow-color), transparent);

    @container rdg-root not scroll-state(scrollable: inline-start) {
      opacity: 0;
    }
  }
}

.rdg-7-0-0-beta-64-7689f238 {
  @layer rdg.FrozenColumnShadow {
    background-image: linear-gradient(to left, var(--rdg-frozen-column-shadow-color), transparent);

    @container rdg-root not scroll-state(scrollable: inline-end) {
      opacity: 0;
    }
  }
}

.rdg-7-0-0-beta-64-487ac462 {
  @layer rdg.FrozenColumnShadow {
    z-index: 2;
  }
}
.rdg-7-0-0-beta-64-0b90c82c {
  @layer rdg.SummaryRow {
    z-index: 2;
    position: sticky;
  }
}
.rdg-7-0-0-beta-64-3fe05231 {
  @layer rdg.GroupedRow {
    &:not([aria-selected="true"]) {
      background-color: var(--rdg-header-background-color);
    }

    & > .rdg-7-0-0-beta-64-85c48527:not(:last-child, .rdg-7-0-0-beta-64-203d9925), & > :nth-last-child(n+2 of .rdg-cell-frozen-start), & > :nth-last-child(n+2 of .rdg-cell-frozen-end) {
      border-inline-end: none;
    }
  }
}
.rdg-7-0-0-beta-64-2f8db206 {
  @layer rdg.TextEditor {
    appearance: none;
    box-sizing: border-box;
    vertical-align: top;
    block-size: 100%;
    inline-size: 100%;
    color: var(--rdg-color);
    background-color: var(--rdg-background-color);
    font-family: inherit;
    font-size: var(--rdg-font-size);
    border: 2px solid light-dark(#8f8f8f, #ccc);
    padding-block: 0;
    padding-inline: 6px;

    &:focus {
      border-color: var(--rdg-selection-color);
      outline: none;
    }

    &::placeholder {
      color: light-dark(#767676, #999);
      opacity: 1;
    }
  }
}
:root {
  font:
    13px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color-scheme: light;
  --surface: #fff;
  --raised: #fff;
  --chrome: #f6f7f9;
  --line: #e1e5eb;
  --text: #202936;
  --muted: #657285;
  --accent: #235cc9;
  --selection: #eaf1ff;
  --text-selection: #c9daf9;
  --error: #ac2525;
  --error-bg: #fff0ef;
  --hover: #edf0f5;
  --diff-added: #299460;
  --diff-removed: #cc5050;
  color: var(--text);
  background: var(--surface);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #202020;
  --raised: #333333;
  --chrome: #2b2b2b;
  --line: #404040;
  --text: #ededed;
  --muted: #b5b5b5;
  --accent: #8ab4f8;
  --selection: #293b54;
  --text-selection: #36547b;
  --error: #ffaaaa;
  --error-bg: #402727;
  --hover: #353535;
  --diff-added: #6fc695;
  --diff-removed: #ed949d;
  --syntax-string: #a8d7b0;
  --syntax-number: #e6c084;
  --syntax-keyword: #c4b1ec;
  --syntax-definition: #8dbbf2;
  --syntax-escape: #edbb87;
  --syntax-comment: #ababab;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover {
  background: var(--hover);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.primary {
  color: var(--surface);
  background: var(--accent);
  border-color: var(--accent);
}
.primary:hover {
  background: var(--accent);
  filter: brightness(0.95);
}
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 8px;
}
textarea {
  font:
    13px/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  resize: vertical;
}
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 720px;
  overflow: hidden;
}
.toolbar {
  height: 54px;
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}
.toolbar strong {
  margin-right: 10px;
}
.spacer {
  flex: 1;
}
.divider {
  height: 20px;
  width: 1px;
  background: var(--line);
  margin: 0 5px;
}
.muted,
.small {
  color: var(--muted);
}
.small {
  font-size: 12px;
  line-height: 1.65;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.document-tab {
  height: 43px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--chrome);
  font-size: 12px;
}
.dirty-dot {
  color: var(--accent);
}
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
.outline {
  width: 210px;
  flex-shrink: 0;
  background: var(--chrome);
  border-right: 1px solid var(--line);
  padding: 20px 10px;
  overflow: auto;
}
.pane-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 10px 15px;
}
.tree {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 9px 10px;
}
.tree.active {
  background: var(--selection);
  color: var(--accent);
}
.tree small {
  margin-left: auto;
  color: var(--muted);
}
.tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-icon {
  color: var(--muted);
  font:
    11px ui-monospace,
    monospace;
}
.outline-path {
  padding: 16px 10px 8px;
  font:
    11px/1.5 ui-monospace,
    monospace;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.outline-help {
  margin: 28px 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.document {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.location {
  min-height: 55px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.location nav {
  overflow: auto;
  white-space: nowrap;
}
.location nav button {
  border: 0;
  background: transparent;
  padding: 3px;
  color: var(--muted);
}
.location nav button:last-child {
  color: var(--text);
}
.segmented {
  display: flex;
  gap: 3px;
}
button[aria-pressed="true"] {
  background: var(--selection);
  border-color: var(--accent);
  color: var(--accent);
}
.table-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
}
.pagination #find {
  color: var(--text);
  width: 220px;
  min-width: 140px;
  max-width: 100%;
  padding: 5px 8px;
}
.table-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
}
.table-summary > span {
  margin: 0;
}
.data-grid {
  flex: 1;
  min-height: 80px;
  border: 0;
  border-top: 1px solid var(--line);
  --rdg-color: var(--text);
  --rdg-background-color: var(--surface);
  --rdg-header-background-color: var(--chrome);
  --rdg-border-color: var(--line);
  --rdg-row-hover-background-color: var(--hover);
  --rdg-row-selected-background-color: var(--selection);
  --rdg-selection-color: var(--accent);
  --rdg-font-size: 13px;
}
.cell-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-value.missing {
  font-style: italic;
  color: var(--muted);
}
.cell-value.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.container-value {
  color: var(--accent);
}
.pagination {
  min-height: 36px;
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.pagination button {
  padding: 4px 8px;
}
.empty-table {
  padding: 20px;
  color: var(--muted);
}
.inspector {
  width: 280px;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  padding: 20px;
  overflow: auto;
  background: var(--surface);
}
.pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.pane-heading h2 {
  margin: 0;
  font-size: 13px;
}
.inspector-close {
  display: none;
}
.inspector label {
  display: block;
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.path {
  display: block;
  font:
    12px/1.7 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.type-label {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 12px;
}
.value-preview {
  padding: 12px;
  background: var(--chrome);
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    13px/1.7 ui-monospace,
    monospace;
  max-height: 300px;
  overflow: auto;
}
.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.structural-actions {
  margin: 24px 0 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.danger {
  color: var(--error);
}
.inspector-empty {
  color: var(--muted);
  line-height: 1.7;
}
.inspector-empty > span {
  font:
    30px ui-monospace,
    monospace;
  color: var(--line);
  display: block;
  margin: 24px 0;
}
.status {
  height: 29px;
  background: var(--chrome);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 0 16px;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.message {
  padding: 9px 16px;
  background: var(--selection);
  display: flex;
  align-items: center;
  gap: 12px;
}
.message.error {
  color: var(--error);
  background: var(--error-bg);
}
.message span {
  flex: 1;
}
.message button {
  font-size: 12px;
}
.diagnostics {
  padding: 14px 18px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 12px;
  max-height: 180px;
  overflow: auto;
}
.diagnostics p {
  margin: 6px 0;
}
.source-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.source-editor {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cm-editor {
  background: var(--surface);
  color: var(--text);
}
.cm-activeLine {
  background: var(--selection) !important;
}
.cm-cursor {
  border-left-color: var(--text) !important;
}
.review {
  padding: 0 18px;
  overflow: auto;
  flex: 1;
}
.review > p {
  color: var(--muted);
  font-size: 12px;
}
.review-columns {
  display: flex;
  gap: 14px;
}
.review-columns section {
  width: 50%;
  min-width: 0;
}
.review h2 {
  font-size: 13px;
}
.review pre {
  font:
    12px/1.65 ui-monospace,
    monospace;
  background: var(--chrome);
  padding: 12px;
  overflow: auto;
  max-height: 65vh;
}
.welcome {
  margin: auto;
  max-width: 560px;
  padding: 40px;
  text-align: center;
}
.welcome h1 {
  font-size: 25px;
  line-height: 1.3;
  font-weight: 600;
  margin: 24px 0 12px;
}
.welcome p {
  color: var(--muted);
  line-height: 1.8;
}
.file-symbol {
  font:
    36px ui-monospace,
    monospace;
  color: var(--accent);
}
.welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 15px;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
}
.welcome .small {
  margin-top: 36px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #0006;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.edit-dialog {
  width: 540px;
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 40px #0003;
  padding: 24px;
}
.edit-dialog h2 {
  font-size: 18px;
  margin: 0 0 12px;
}
.edit-dialog label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.edit-dialog label > * {
  color: var(--text);
}
.edit-dialog p {
  line-height: 1.6;
}
.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}
.edit-error {
  background: var(--error-bg);
  color: var(--error);
  padding: 10px;
  border-radius: 4px;
}
@media (max-width: 1180px) {
  .outline {
    width: 180px;
  }
  .inspector {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 290px;
    z-index: 5;
    box-shadow: -6px 0 20px #0002;
  }
  .inspector-close {
    display: block;
  }
  .toolbar strong {
    font-size: 12px;
  }
  .toolbar {
    gap: 5px;
  }
  .toolbar .muted {
    display: none;
  }
}
@media (forced-colors: active) {
  .data-grid {
    --rdg-selection-color: Highlight;
  }
  .primary {
    color: ButtonText;
    border-color: ButtonText;
  }
  .dirty-dot {
    color: Highlight;
  }
}

.document-tab {
  padding: 0 12px;
  gap: 12px;
}
.document-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  flex: 1;
}
.document-tabs::-webkit-scrollbar {
  display: none;
}
.document-tab-item {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--line);
  flex-shrink: 0;
}
.document-tab-item button {
  border: 0;
  border-radius: 0;
  background: transparent;
  height: 100%;
}
.document-tab-item.active {
  background: var(--surface);
  box-shadow: inset 0 2px var(--accent);
}
.document-tab-item button[role="tab"] {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.document-tab-item button:last-child {
  color: var(--muted);
  padding: 0 9px;
}
.sheet-tabs {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  overflow-x: auto;
  min-height: 37px;
  border-top: 1px solid var(--line);
  background: var(--chrome);
  padding: 0 12px;
}
.sheet-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.sheet-tabs button[aria-current="page"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: inset 0 -2px var(--accent);
  font-weight: 600;
}
.sheet-tabs span {
  padding: 8px;
  white-space: nowrap;
  color: var(--muted);
}
.inline-cell {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 7px;
  border: 2px solid var(--accent);
  border-radius: 0;
  outline: none;
}
.inline-cell[aria-invalid="true"] {
  border-color: var(--error);
}
.column-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--chrome);
}
.column-form label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.column-form [role="alert"] {
  color: var(--error);
}

/* Spreadsheet workspace: the grid owns the available space. */
.toolbar {
  height: 42px;
  padding: 0 10px;
  gap: 6px;
}
.toolbar button,
.location button,
.table-tools button {
  padding: 4px 9px;
  border-radius: 3px;
}
.document-tab {
  height: 34px;
}
.location {
  min-height: 36px;
  padding: 4px 10px;
}
.row-number {
  text-align: center;
  color: var(--muted);
  background: var(--chrome);
  font-variant-numeric: tabular-nums;
  padding: 0 !important;
}
.sheet-column-heading small {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}
.sheet-column-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-error {
  color: var(--error);
}
.pagination {
  min-height: 28px;
  padding: 3px 10px;
}
.diff-review {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.diff-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.diff-tools span {
  flex: 1;
}
.diff-headings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--chrome);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.diff-host {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.diff-host .cm-mergeView {
  min-height: 100%;
  color: var(--text);
  background: var(--surface);
}
.diff-host .cm-editor {
  background: var(--surface);
  color: var(--text);
}
.diff-host .cm-editor.cm-merge-a .cm-changedLine {
  background: color-mix(in srgb, var(--diff-removed) 8%, var(--surface));
}
.diff-host .cm-editor.cm-merge-b .cm-changedLine {
  background: color-mix(in srgb, var(--diff-added) 8%, var(--surface));
}
.diff-host .cm-editor.cm-merge-a .cm-changedText {
  background: color-mix(in srgb, var(--diff-removed) 25%, transparent);
  border-radius: 2px;
}
.diff-host .cm-editor.cm-merge-b .cm-changedText {
  background: color-mix(in srgb, var(--diff-added) 25%, transparent);
  border-radius: 2px;
}
.diff-host .cm-merge-revert {
  width: 28px;
  background: var(--chrome);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.diff-host .cm-merge-revert button {
  width: 24px;
  height: 24px;
  margin: 0 1px;
  padding: 0;
  font: 16px/24px system-ui;
  color: var(--muted);
  border-radius: 3px;
}
.diff-host .cm-merge-revert button:hover {
  color: var(--accent);
  background: var(--selection);
}
.diff-tools > span {
  flex: 0 0 auto;
  min-width: 140px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.diff-error {
  margin: 0;
  padding: 7px 12px;
  font-size: 12px;
  background: var(--surface);
  color: var(--error);
  border-top: 1px solid var(--line);
}
.range-sheet {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.range-message {
  padding: 5px 10px;
  background: var(--selection);
  display: flex;
  justify-content: space-between;
}
.sheet-menu {
  position: fixed;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px #00000014;
  padding: 4px;
  min-width: 190px;
  display: flex;
  flex-direction: column;
}
.sheet-menu button {
  text-align: left;
  border: 0;
}
.value-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--chrome);
}
.value-bar output {
  min-width: 65px;
  font-variant-numeric: tabular-nums;
}
.value-bar input {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
}
.value-bar [role="alert"] {
  color: var(--error);
}

/* Preserve the native dropdown arrow with additional text spacing. */
select {
  padding-right: 24px;
}

/* The border belongs to the wrapper so native arrow chrome has a real inset. */
.select-inset {
  display: inline-flex;
  align-items: center;
  padding-right: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}
.select-inset select {
  border: 0;
  background: transparent;
  padding-right: 10px;
}
.select-inset:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.select-inset select:focus-visible {
  outline: none;
}
.header-filter {
  position: absolute;
  right: 0;
  bottom: 2px;
  padding: 0 4px;
  font-size: 12px;
  border-radius: 2px;
}
.column-menu {
  position: fixed;
  right: 16px;
  top: 120px;
  z-index: 120;
  width: 300px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px #00000014;
  padding: 12px;
}
.column-menu > button {
  text-align: left;
}
.filter-values {
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  padding: 5px;
}
.filter-values label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 26px;
}
.filter-values span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 2px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.header-filter:hover,
.header-filter:focus-visible {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}
.filter-dot {
  position: absolute;
  right: 1px;
  top: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.column-menu {
  right: auto;
  max-height: calc(100vh - 16px);
}
.sort-indicator {
  color: var(--accent);
  font-weight: 700;
}
.sort-summary {
  color: var(--accent);
}
.sort-summary button {
  padding: 1px 6px;
  margin-left: 6px;
  font-size: 11px;
}

.column-menu .filter-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* One selection border: grid owns selection; the input owns edit focus. */
.data-grid [role="gridcell"]:has(.inline-cell) {
  outline: var(--rdg-selection-width, 2px) solid var(--accent);
  outline-offset: calc(var(--rdg-selection-width, 2px) * -1);
  padding: 0;
}
.data-grid .inline-cell {
  border: 0;
  /* Chromium ignores right padding where a textarea stops scrolling, so the
     editor is inset instead; the caret at the end of long text stays visible. */
  margin: 0 6px 0 0;
  /* Match the cell text; the global textarea rule is monospace. */
  font: inherit;
  line-height: 20px;
  padding: 4px 8px;
  width: calc(100% - 6px);
  height: 100%;
  box-sizing: border-box;
  background: var(--surface);
}
.data-grid [role="gridcell"]:has(.inline-cell[aria-invalid="true"]) {
  outline-color: var(--error);
}
.data-grid .inline-cell:focus-visible {
  outline: none;
  outline-offset: 0;
}

/* Keep filter-search focus inside its existing bounds. */
.column-menu input[aria-label="Search filter values"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
/* Explicit option colours for native Windows/Chrome popup menus. */
select {
  color-scheme: inherit;
  color: var(--text);
  background-color: var(--surface);
}
select option,
select optgroup {
  color: var(--text);
  background-color: var(--surface);
}
.select-inset select {
  background-color: var(--surface);
}

.activity {
  display: inline-block;
  animation: working 1s linear infinite;
}
@keyframes working {
  to {
    transform: rotate(360deg);
  }
}
.toolbar {
  padding-right: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .activity {
    animation: none;
  }
}

.welcome-install {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.welcome-install strong {
  font-weight: 600;
}
.welcome-install p {
  max-width: 440px;
  margin: 6px auto 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.welcome-install-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.cell-value.empty-value {
  height: 100%;
}

.wrap-text .cell-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 20px;
  max-height: 100%;
  padding: 3px 0;
}
.row-number-content {
  height: 100%;
  position: relative;
}
.row-height-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: row-resize;
  touch-action: none;
  z-index: 2;
}
.row-height-handle:hover,
.row-height-handle:focus-visible {
  background: var(--accent);
}
.data-grid .inline-cell {
  resize: none;
  display: block;
  line-height: 20px;
  padding-top: 3px;
  padding-bottom: 3px;
  overflow: auto;
}

.wrap-text .array-value {
  white-space: normal;
}

.outline[hidden] {
  display: none;
}
.outline-tree,
.outline-tree ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.outline-tree ul {
  padding-left: 14px;
}
.outline-entry {
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 3px;
}
.outline-entry.active {
  color: var(--accent);
  background: var(--selection);
}
.outline-disclosure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 30px;
  border: 0;
  background: transparent;
  padding: 0;
}
.outline-node {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 3px;
}
.outline-note {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.location-history {
  display: flex;
  gap: 2px;
}
.document-filename {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outline-node .tree-label {
  min-width: 0;
  white-space: nowrap;
}

.sheet-menu {
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  max-width: calc(100vw - 16px);
}
.sheet-menu button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
[data-show-mnemonics] :is([data-mnemonic], [data-table-mnemonic]):not(:disabled)
  .mnemonic-letter {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sheet-menu kbd {
  color: var(--muted);
  font: inherit;
  font-size: 11px;
}
.sheet-menu hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

.table-tools .sort-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.table-counts {
  white-space: nowrap;
}

.wrap-text .cell-value {
  tab-size: 4;
}

.navigation-icon {
  display: block;
  flex: none;
}
.outline-disclosure[aria-expanded="true"] .navigation-icon {
  transform: rotate(90deg);
}
.location nav .root-home:hover:not(:disabled) {
  background: var(--hover);
}

.generated-column-tag {
  margin-left: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: normal;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 3px;
}

.column-select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-width: 0;
  flex: 1;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
  border-radius: 0;
}
.column-select > small {
  font-weight: 400;
}
.row-select,
.select-all-cells {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
}
.row-select[aria-pressed="true"] {
  background: transparent;
  color: var(--surface);
  font-weight: 600;
}
.column-select:focus-visible,
.row-select:focus-visible,
.select-all-cells:focus-visible {
  outline-offset: -2px;
}
.selection-status {
  white-space: nowrap;
}

/* Shared pane boundaries, compact actions and bounded header wrapping. */
.pane-resizer {
  flex: 0 0 5px;
  width: 5px;
  cursor: col-resize;
  touch-action: none;
  background: var(--chrome);
  z-index: 6;
}
.pane-resizer:hover,
.pane-resizer:focus-visible {
  background: var(--accent);
  outline: none;
}
.inspector {
  position: relative;
}
.pane-resizer-right {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
}
.table-actions {
  display: contents;
}
.table-actions .table-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.table-actions .table-counts {
  font-size: 11px;
}
.pagination {
  gap: 8px;
  padding: 6px 10px;
}
.column-title > span {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 17px;
}
.location-history button:disabled {
  color: var(--muted);
  opacity: 0.45;
}
.activity {
  box-sizing: border-box;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 1.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation:
    working 0.8s linear infinite,
    busy-reveal 0.18s step-end;
}
@keyframes busy-reveal {
  from {
    visibility: hidden;
  }
  to {
    visibility: visible;
  }
}
.notice-toast {
  position: fixed;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(560px, 90vw);
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 5px;
  box-shadow: 0 2px 10px #0002;
  z-index: 30;
  font-size: 13px;
}
@media (max-width: 1180px) {
  .inspector {
    position: absolute;
    max-width: 70vw;
  }
}
@media (prefers-reduced-motion: reduce) {
  .activity {
    animation: none;
  }
}
@media (max-width: 1180px) {
  .outline {
    max-width: calc(100vw - 365px) !important;
  }
}

/* Document tabs belong to the document area; status stays separate from actions. */
.document-tab {
  padding: 0;
  gap: 0;
}
.browse-tab-slot {
  flex: 0 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  height: 100%;
}
.browse-tab-slot.expanded {
  margin-right: 5px;
  border-right: 1px solid var(--line);
}
.document-tab > button {
  margin-left: 8px;
}
.document-tab > button:last-child {
  margin-right: 12px;
}
@media (max-width: 1180px) {
  .browse-tab-slot.expanded {
    max-width: calc(100vw - 365px) !important;
  }
}

/* Details is a bounded preview, not a miniature squeezed spreadsheet. */
.details-preview {
  min-width: 0;
  max-width: 100%;
}
.details-table-scroll {
  overflow: auto;
  max-height: 288px;
  margin: 8px 0 16px;
  border: 1px solid var(--line);
}
.details-table-scroll:focus-visible {
  outline-offset: -2px;
}
.details-preview table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 300px;
  font-size: 12px;
  line-height: 18px;
}
.details-preview th,
.details-preview td {
  text-align: left;
  vertical-align: top;
  padding: 7px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.details-preview th:last-child,
.details-preview td:last-child {
  border-right: 0;
}
.details-preview tbody tr:last-child > * {
  border-bottom: 0;
}
.details-preview thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--chrome);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.details-preview tbody th {
  font-weight: 400;
  color: var(--muted);
}
.details-cell {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  max-height: 54px;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.select-all-cells {
  display: flex;
  align-items: center;
  justify-content: center;
}
.select-all-cells:hover {
  color: var(--accent);
}

.welcome-recovery {
  max-width: 450px;
  margin-top: 22px;
}
.recovery-setting {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.recovery-setting input {
  margin: 0;
}
.update-dialog {
  max-width: 420px;
  text-align: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 32px #0003;
}
.update-dialog::backdrop {
  background: #0005;
}
.update-dialog h2 {
  font-size: 17px;
  margin: 0 0 12px;
}
.update-dialog p {
  font-size: 13px;
  line-height: 1.6;
}
.update-dialog .update-build {
  color: var(--muted);
  font-size: 12px;
}
.update-dialog .dialog-actions {
  flex-wrap: wrap;
  gap: 12px;
}
.update-available {
  white-space: nowrap;
}
.diff-tools {
  flex-wrap: wrap;
}
.diff-review > p[role="alert"] {
  margin: 0;
  padding: 8px 14px;
  color: var(--error);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.freeze-menu {
  position: relative;
  color: var(--text);
}
.freeze-menu summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 3px;
  background: var(--surface);
}
.freeze-menu summary::-webkit-details-marker {
  display: none;
}
.freeze-menu[open] summary {
  color: var(--accent);
  border-color: var(--accent);
}
.freeze-options {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 0;
  z-index: 12;
  width: 265px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 3px 15px #0002;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.freeze-options button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px;
}
.freeze-options p {
  margin: 5px 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.data-grid [role="row"][style*="sticky"] {
  box-shadow: 0 1px var(--line);
}

/* When a header control owns focus, show its own boundary. */
.data-grid :is(.sheet-corner, .sheet-header:has(.sheet-column-heading)):not(:focus-visible) {
  outline: none;
}
.diff-review .diff-host .cm-editor .cm-collapsedLines {
  background: var(--chrome);
  color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  padding: 4px 10px;
}
.diff-host .cm-collapsedLines:before {
  content: "⋯";
}
.diff-host .cm-collapsedLines:after {
  display: none;
}

/* The letter strip and field headers share the grid’s column widths. */
.data-grid .sheet-header {
  --sheet-letter-height: 28px;
  padding: 0;
}
.data-grid .sheet-corner {
  display: flex;
}
.sheet-column-heading {
  display: grid;
  grid-template: var(--sheet-letter-height) minmax(0, 1fr) / minmax(0, 1fr);
}
.sheet-column-heading {
  width: 100%;
  height: 100%;
  line-height: 17px;
}
/* Keep the grid's keyboard resizing and take over pointer drags for groups. */
.sheet-header:has(.column-group-resizer) > .rdg-resize-handle {
  pointer-events: none;
}
.column-group-resizer {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 1;
  inline-size: 10px;
  cursor: col-resize;
  touch-action: none;
}
.sheet-column-heading .column-select,
.sheet-column-heading .column-title {
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.sheet-column-heading .column-select {
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.sheet-column-heading
  .column-select[aria-pressed="false"]:hover:not(:disabled) {
  background: var(--hover);
}
.data-grid .sheet-header-selected {
  background-color: var(--selection);
  background-image: linear-gradient(
    to bottom,
    var(--axis-label-selection) var(--sheet-letter-height),
    transparent var(--sheet-letter-height)
  );
}
.sheet-header-selected .column-select[aria-pressed="true"] {
  background: transparent;
  color: var(--surface);
  font-weight: 600;
}
.sheet-header-selected .column-select[aria-pressed="true"] > small {
  color: inherit;
  font-weight: inherit;
}
.column-field-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
}
.sheet-column-heading .column-title {
  padding-block: 3px;
  text-align: left;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
}
.sheet-column-heading .column-title > span {
  overflow-wrap: anywhere;
}
.column-field-heading:has(.column-title[aria-pressed="true"]) {
  background: var(--selection);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.sheet-column-heading .column-title[aria-pressed="true"] {
  color: var(--accent);
}
.sheet-column-heading :is(.column-select, .column-title):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.column-field-heading:has(.column-title[aria-pressed="true"])
  .column-title:focus-visible {
  outline: none;
}
.sheet-column-heading .header-filter {
  position: static;
  align-self: center;
  width: 24px;
  height: 24px;
  margin: 0 4px 0 0;
  border-radius: 4px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
}
.sheet-column-heading .header-filter:hover {
  background: var(--selection);
}
.data-grid .inline-cell {
  color: var(--text);
  caret-color: var(--text);
  white-space: pre;
}
.wrap-text .inline-cell {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.data-grid .cell-value::selection,
.data-grid .inline-cell::selection {
  background: var(--accent);
  color: #fff;
  -webkit-text-fill-color: #fff;
}
.source-scope-switch {
  margin-right: 8px;
}

/* Preserve all file/theme controls at the desktop minimum width and high zoom. */
@media (max-width: 900px) {
  .toolbar {
    gap: 4px;
  }
  .toolbar strong {
    margin-right: 4px;
  }
}

.file-drop-root {
  display: contents;
}
.file-drop-overlay {
  position: fixed;
  inset: var(--file-drop-top, 64px) 12px 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
}
.file-drop-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(420px, calc(100vw - 48px));
  min-height: 176px;
  padding: 24px;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  background: var(--surface);
  text-align: center;
  font-size: 13px;
}
.file-drop-hint span {
  color: var(--muted);
  font-size: 12px;
}
.status > span {
  white-space: nowrap;
}
.status .document-filename {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-version {
  flex-shrink: 0;
}
.diagnostics details {
  margin-top: 8px;
  font-size: 12px;
}
.diagnostics summary {
  cursor: pointer;
}
@media (max-width: 1000px) {
  .status {
    gap: 8px;
    padding-inline: 8px;
  }
  .status-encoding {
    display: none;
  }
}
.inspector {
  max-width: 50vw;
}
.status .selection-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1000px) {
  .status-bytes {
    display: none;
  }
}

.select-all-cells:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* Navigation controls share one geometry and treatment, including document root. */
.location .location-history button,
.location nav .root-home {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.file-drop-root:has(.home-screen) > .file-drop-overlay {
  background: var(--surface);
}
.file-drop-hint > svg {
  color: var(--muted);
  margin-bottom: 4px;
}
.file-drop-hint strong {
  font-weight: 550;
}

.data-grid.without-selection {
  --rdg-selection-color: transparent;
}
/* Workspace visual contract. */
.toolbar {
  height: 44px;
  gap: 2px;
  padding: 0 12px;
}
.toolbar strong {
  font-size: 14px;
  letter-spacing: -0.25px;
  margin: 0 14px 0 4px;
  font-weight: 650;
}
.toolbar button,
.document-tab > button,
.browse-tab-slot button,
.pagination > button,
.pagination .table-actions > button,
.pagination .sort-summary button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 4px;
  padding: 0 9px;
}
.toolbar button:hover:not(:disabled),
.document-tab > button:hover:not(:disabled),
.browse-tab-slot button:hover,
.pagination button:hover:not(:disabled) {
  background: var(--hover);
}
.toolbar button:disabled,
.pagination button:disabled {
  opacity: 0.4;
}
.toolbar .divider {
  height: 16px;
  margin-inline: 7px;
}
.toolbar .select-inset select {
  font-size: 12px;
  height: 28px;
  border-color: transparent;
  background: transparent;
}
.toolbar .muted {
  font-size: 11px;
}
.document-tab {
  height: auto;
  min-height: 37px;
  flex-shrink: 0;
  align-items: flex-start;
  padding: 0;
  gap: 5px;
  font-size: 12px;
}
.document-tab-strip {
  display: flex;
  flex: 1;
  min-width: 0;
  align-self: stretch;
}
.document-tab-scroll {
  display: flex;
  flex: none;
  align-items: center;
  padding-inline: 2px;
  border-inline-start: 1px solid var(--line);
}
.document-tab-scroll button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.document-tab-scroll button:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.document-tab-scroll button:first-child svg {
  transform: rotate(180deg);
}
.document-tab-item,
.document-tab .browse-tab-slot {
  height: 36px;
}
.document-tab-item button[role="tab"] {
  font-size: 12px;
  padding-inline: 15px;
}
.document-tab-item button:last-child {
  font-size: 17px;
}
.document-tab > button {
  margin-top: 4px;
  margin-left: 3px;
  font-size: 12px;
}
.document-tab > button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--selection);
}
.browse-tab-slot {
  padding-inline: 10px;
}
.browse-tab-slot.expanded {
  margin-right: 0;
}
.browse-tab-slot button {
  font-size: 12px;
  height: 28px;
}
.browse-tab-slot button[aria-pressed="true"] {
  background: transparent;
  color: var(--accent);
}
.outline {
  background: var(--chrome);
  padding: 16px 10px;
}
.pane-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 8px 10px;
}
.outline-entry {
  border-radius: 4px;
  min-height: 31px;
}
.outline-node {
  padding-block: 6px;
  font-size: 12px;
}
.outline-node .node-icon {
  font-size: 10px;
  color: var(--muted);
}
.outline-disclosure {
  height: 30px;
  color: var(--muted);
}
.pane-resizer {
  flex-basis: 3px;
  width: 3px;
  background: var(--line);
}
.location {
  min-height: 42px;
  padding: 5px 12px;
  gap: 8px;
}
.location nav {
  font-size: 12px;
}
.location .location-history button,
.location nav .root-home {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
}
.location .location-history button:hover:not(:disabled),
.location nav .root-home:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.location .segmented {
  gap: 6px;
  align-items: center;
}

.view-mode {
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--chrome);
  padding: 2px;
}
:is(.location, .inspector) .view-mode button {
  border: 0;
  border-radius: 3px;
  background: transparent;
  padding: 0 11px;
  height: 24px;
  font-size: 12px;
  color: var(--muted);
}
:is(.location, .inspector) .view-mode button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px #17243b12;
}
:is(.location, .inspector) .view-mode button:hover:not(:disabled) {
  color: var(--text);
}
.sheet-column-heading small {
  font-size: 11px;
  line-height: 17px;
}
.sheet-column-heading {
  line-height: 19px;
}

.column-select {
  font-weight: 550;
}
.header-filter {
  color: var(--muted);
}
.data-grid {
  --rdg-border-color: color-mix(in srgb, var(--line) 78%, var(--surface));
  --rdg-header-background-color: var(--chrome);
}

.pagination {
  padding: 5px 10px;
  min-height: 38px;
  gap: 4px;
  font-size: 12px;
  background: var(--surface);
}
.pagination > button,
.pagination .table-actions > button,
.pagination .sort-summary button {
  height: 27px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 8px;
}
.pagination button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--selection);
}
.pagination #find {
  height: 28px;
  font-size: 12px;
  border-radius: 4px;
  padding: 4px 9px;
}
.sheet-tabs {
  min-height: 30px;
  padding-inline: 0;
}
.sheet-tabs button {
  position: relative;
  padding: 0 12px;
  min-height: 30px;
  color: var(--muted);
  border-right: 0;
  font-size: 12px;
}
.sheet-tabs .new-sheet {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  padding: 0;
}
.sheet-tabs .new-sheet:focus-visible {
  outline-offset: -2px;
}
.sheet-tabs .new-sheet:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.sheet-tabs button[aria-current="page"] {
  background: transparent;
  box-shadow: none;
}
/* Overlay scrollbars float over content; keep them clear of the tab names. */
.sheet-tabs[data-overlay-scrollbar] {
  padding-bottom: 10px;
}
.sheet-tabs button[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--accent);
}
.inspector {
  padding: 0 18px 18px;
}
.pane-heading {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.pane-heading h2 {
  font-size: 12px;
  font-weight: 550;
}
.inspector label {
  font-size: 11px;
  margin-top: 20px;
  margin-bottom: 6px;
}
.inspector .path {
  font-size: 11px;
}
.type-label {
  border: 0;
  padding: 0;
  border-radius: 0;
}
.value-preview {
  max-height: 168px;
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 4px;
}
.inspector-actions button,
.structural-actions button {
  font-size: 11px;
  padding: 4px 8px;
}
.status {
  min-height: 27px;
  padding: 4px 12px;
  gap: 14px;
  font-size: 11px;
}
@media (max-width: 1100px) {
  .toolbar {
    gap: 1px;
    padding-inline: 8px;
  }
  .toolbar button {
    padding-inline: 7px;
  }
  .document-tab > button {
    padding-inline: 6px;
  }
}

.pagination .freeze-menu summary {
  display: flex;
  align-items: center;
  min-height: 27px;
  border: 0;
  border-radius: 4px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
}
.pagination .freeze-menu summary:hover {
  background: var(--hover);
}
.pagination .freeze-menu[open] summary {
  background: var(--selection);
  color: var(--accent);
}

/* Match error disclosure to the sheet's shared chevron, without a native marker. */
.diagnostics summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  border-radius: 3px;
  padding: 3px 4px;
}
.diagnostics summary::-webkit-details-marker {
  display: none;
}
.diagnostics summary svg {
  transform: rotate(-90deg);
}
.diagnostics details[open] summary svg {
  transform: rotate(0deg);
}
.diagnostics summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Active view state must remain distinct from an unavailable alternative. */
:is(.location, .inspector) .view-mode button[aria-pressed="true"]:disabled {
  opacity: 1;
}

/* Automatic row sizing is bounded; a manually enlarged row reveals more. */
.wrap-text .container-value.cell-value,
.wrap-text .array-value.cell-value {
  display: block;
  white-space: pre-wrap;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 20px;
  max-height: 100%;
  text-overflow: clip;
}

/* A plain ellipsis in a reserved text gutter, without a coloured badge. */
.cell-value[data-clipped] {
  position: relative;
  box-sizing: border-box;
  text-overflow: clip;
}

.cell-value[data-clipped]::after {
  content: "…";
  position: absolute;
  inset-inline-end: 1px;
  bottom: 0;
  line-height: 20px;
  background: transparent;
  color: var(--muted);
  pointer-events: none;
}
/* Nested values are editable content; table navigation has its own control. */
.data-grid .container-value {
  color: var(--text);
}

.cell-value:has(> .cell-open-table) {
  --cell-table-gutter: 29px;
  position: relative;
  margin-inline-end: -5px;
  /* Keep the 20px button inside the preview's clipping area. */
  min-block-size: 20px;
  line-height: 20px;
}
.cell-value[data-clipped]:has(> .cell-open-table)::after {
  inset-inline-end: 0;
  inset-block-start: 50%;
  inset-block-end: auto;
  width: 22px;
  text-align: center;
  transform: translateY(-50%);
  opacity: calc(1 - var(--cell-table-icon-opacity, 0));
}
.cell-open-table {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 22px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--muted);
  opacity: var(--cell-table-icon-opacity, 0);
  visibility: var(--cell-table-icon-visibility, hidden);
  pointer-events: var(--cell-table-icon-pointer, none);
}
.data-grid [role="gridcell"]:is(:hover, :focus-within) .cell-value,
.data-grid:not(.without-selection) [role="gridcell"][aria-selected="true"]
  .cell-value {
  --cell-table-icon-opacity: 1;
  --cell-table-icon-visibility: visible;
  --cell-table-icon-pointer: auto;
}
.cell-open-table:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--hover) 93%, var(--text));
  color: var(--text);
}
.cell-open-table:focus-visible {
  outline-offset: -2px;
}
.cell-open-table svg {
  pointer-events: none;
}
.cell-preview-text {
  display: block;
  width: calc(100% - var(--cell-table-gutter, 0px));
  overflow: hidden;
  text-overflow: clip;
}
[data-clipped] > .cell-preview-text {
  width: calc(100% - 18px);
}
.cell-value:has(> .cell-open-table) > .cell-preview-text {
  width: calc(100% - var(--cell-table-gutter));
}
/* The editor keeps the cell's size; extra lines grow the row (see rowHeight). */
.data-grid .inline-cell {
  scrollbar-width: thin;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Breadcrumb text and navigation glyphs share the same vertical centre. */
.location nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.location nav > span {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
  line-height: 20px;
}
.location nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  line-height: 20px;
}
.location nav .root-home {
  flex-shrink: 0;
}

/* Search matches remain distinct from the blue cell-selection outline. */
.find-match {
  background: #ffe39a;
  color: #20262e;
  border-radius: 1px;
  padding: 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
:root[data-theme="dark"] .find-match {
  background: #725619;
  color: #fff3cb;
}

.theme-picker {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
  padding: 2px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--chrome);
}
.toolbar .theme-picker button {
  width: 28px;
  height: 24px;
  padding: 0;
  color: var(--muted);
  border-radius: 3px;
}
.toolbar .theme-picker button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px #17243b12;
}
.toolbar .theme-picker button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.diff-navigation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Pinned columns use the sheet's normal divider rather than a floating shadow. */
.data-grid {
  --rdg-frozen-column-shadow-color: transparent;
}
.data-grid .row-number {
  background-color: var(--rdg-header-background-color);
  border-inline-end: 1px solid var(--line);
}

.find-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  flex-wrap: wrap;
}
.find-bar input {
  width: 200px;
  min-width: 100px;
  height: 28px;
  font-size: 12px;
  padding: 4px 9px;
}
.find-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 27px;
  min-width: 27px;
  border: 0;
  padding: 0 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.find-bar button[aria-pressed="true"] {
  background: var(--selection);
  color: var(--accent);
}
.find-count {
  font-size: 11px;
  color: var(--muted);
  padding-inline: 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.whole-word-glyph {
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* A faint location cue is distinct from selecting an entire row or column. */
.data-grid .row-number.active-cell-header,
.data-grid .active-cell-header .column-select {
  background-color: var(--selection);
}

.active-cell-header .column-select > small,
.active-cell-header .row-select {
  color: var(--text);
  font-weight: 550;
}

/* Source text selection must not sit behind an opaque active-line fill. */
.source-editor .cm-activeLine {
  background: transparent !important;
}
.source-editor .cm-activeLineGutter {
  background: var(--selection);
  color: var(--text);
}
.source-editor .cm-selectionBackground {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.source-editor .cm-focused .cm-selectionBackground {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}
.source-editor .cm-content {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

/* Home is an icon control, not the last textual breadcrumb. */
.location .location-history button:not(:disabled),
.location nav .root-home:not(:disabled) {
  color: var(--muted);
}
.location .location-history button:hover:not(:disabled),
.location nav .root-home:hover:not(:disabled) {
  color: var(--text);
}
.toolbar .toolbar-history {
  width: 28px;
  padding: 0;
  color: var(--muted);
}
.navigation-icon {
  pointer-events: none;
}

/* Column filters sit beside view switching, with their details kept in a popover. */
.active-filters {
  position: relative;
  margin-right: 8px;
  flex-shrink: 0;
  font-size: 12px;
}
.active-filters > summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 8px;
  list-style: none;
  border-radius: 4px;
  color: var(--accent);
  background: var(--selection);
  cursor: pointer;
}
.active-filters > summary::-webkit-details-marker {
  display: none;
}
.active-filters > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.active-filters-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 12px #0002;
}
.active-filters-heading {
  padding: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.active-filters-list {
  max-height: min(320px, 45vh);
  overflow-y: auto;
}
.active-filter-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.active-filter-row:last-child {
  border-bottom: 0;
}
.active-filter-row > div {
  min-width: 0;
}
.active-filter-row strong {
  font-weight: 550;
  overflow-wrap: anywhere;
}
.active-filter-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.location .active-filters-panel button {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}
.active-filters-footer {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}
.active-filters-footer button {
  width: 100%;
}
.data-grid .header-filter.filter-active {
  color: var(--accent);
}
/* MergeView anchors restore arrows at the first changed line. */
.diff-host .cm-merge-revert button {
  margin-top: 0;
  transform: none;
}
.diff-review .diff-host .cm-editor .cm-restore-target {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.source-format-actions {
  display: flex;
  gap: 4px;
  margin-right: 12px;
}
.location .source-format-actions button {
  font-size: 12px;
  height: 28px;
}
.table-state-control {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-size: 12px;
}
.table-state-control .active-filters {
  margin-right: 0;
}
.table-state-control .active-filters > summary {
  border-radius: 3px 0 0 3px;
  background: transparent;
}
.location .table-state-control > button {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 3px 3px 0;
  width: 26px;
  height: 28px;
  padding: 0;
  font-size: 17px;
  color: var(--muted);
  background: transparent;
}
.location .table-state-control > button:hover {
  background: var(--chrome);
  color: var(--text);
}
:is(.active-sort, .active-find) > span {
  max-width: 200px;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--accent);
}

/* Keep wrapping width stable when the overflow indicator appears or disappears. */
.wrap-text .cell-preview-text {
  width: calc(100% - 18px);
}

.file-location {
  position: relative;
  min-width: 0;
}
.file-location > summary {
  display: block;
  list-style: none;
  cursor: pointer;
  border-radius: 3px;
}
.file-location > summary::-webkit-details-marker {
  display: none;
}
.file-location > summary:hover {
  color: var(--text);
}
.file-location > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.file-location-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(300px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 12px #0002;
  white-space: normal;
  font-size: 12px;
}
.file-location-panel strong {
  display: block;
  overflow-wrap: anywhere;
  user-select: text;
}
.file-location-panel p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.5;
}
.file-location-panel button {
  height: 28px;
  font-size: 12px;
}

.header-filter .active-filter-icon {
  color: var(--accent);
  fill: var(--selection);
}

.source-scope-switch {
  margin-right: 12px;
}
.source-format-status {
  font-size: 12px;
  color: var(--muted);
  margin-right: 8px;
}

.file-location > summary {
  user-select: none;
  -webkit-user-select: none;
}

.source-editor .source-cell-location {
  text-decoration: underline dotted var(--accent);
  text-underline-offset: 3px;
}
.source-editor .source-location-gutter {
  width: 9px;
}
.source-cell-marker {
  display: block;
  width: 5px;
  height: 100%;
  min-height: 1.4em;
  margin: 0 2px;
  background: var(--accent);
}

/* Brief arrival cue spans the line, distinct from a text selection. */
.source-editor .source-cell-arrival {
  animation: source-cell-arrival 2.4s ease-out forwards;
}
@keyframes source-cell-arrival {
  0%,
  55% {
    background-color: color-mix(in srgb, var(--accent) 14%, transparent);
  }
  100% {
    background-color: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .source-editor .source-cell-arrival {
    animation-timing-function: step-end;
  }
}

.location .source-cell-locator {
  font-size: 12px;
  height: 28px;
  margin-right: 8px;
  color: var(--accent);
}
.source-format-actions button[aria-pressed="true"] {
  background: var(--selection);
  color: var(--accent);
}

/* Menus sit one surface above the sheet; grid dividers remain quieter. */
.column-menu,
.sheet-menu,
.edit-dialog,
.active-filters-panel,
.file-location-panel {
  background: var(--raised);
}

:root[data-theme="dark"] .source-editor .cm-selectionBackground {
  background: color-mix(in srgb, var(--text-selection) 65%, transparent);
}
:root[data-theme="dark"] .source-editor .cm-focused .cm-selectionBackground {
  background: var(--text-selection);
}

/* Neutral sheet chrome keeps dark mode distinct from blue selection cues. */
:root[data-theme="dark"] .data-grid {
  --rdg-header-background-color: #303030;
}
:root[data-theme="dark"]
  .value-bar
  :is(textarea, output, .value-bar-empty-field) {
  background: #262626;
  border-color: #555;
}
:root[data-theme="dark"] .value-bar textarea:focus {
  border-color: var(--accent);
}

/* Syntax errors stay inline while the source draft is being edited. */
.source-editor .source-syntax-error {
  text-decoration: underline wavy var(--error);
  text-underline-offset: 3px;
}
.source-syntax-error-empty {
  display: inline-block;
  min-width: 0.6em;
}
.source-syntax-message {
  padding: 7px 10px;
  max-width: min(420px, 90vw);
  white-space: normal;
  font:
    12px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.source-editor .source-syntax-gutter {
  width: 16px;
}
.source-editor .source-syntax-gutter .cm-gutterElement {
  display: flex;
  align-items: center;
  justify-content: center;
}
.source-syntax-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-height: 18px;
  height: 100%;
  cursor: help;
}
.source-syntax-marker::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--error);
  pointer-events: none;
}
.source-syntax-line-number {
  display: inline-block;
  min-width: 100%;
  cursor: help;
}

/* Motion stays on controls and floating surfaces, never on the sheet or editor. */
@media (prefers-reduced-motion: no-preference) {
  :is(.column-menu, .sheet-menu, .active-filters-panel, .file-location-panel) {
    animation: workspace-menu-enter 120ms ease-out;
  }

  .edit-dialog {
    animation: workspace-menu-enter 140ms ease-out;
  }

  .notice-toast {
    animation: workspace-fade-enter 120ms ease-out;
  }

  .cell-value[data-clipped]:has(> .cell-open-table)::after {
    transition: opacity 100ms ease-out;
  }

  .cell-open-table {
    transition: opacity 100ms ease-out, visibility 100ms;
  }
}

@keyframes workspace-menu-enter {
  from {
    opacity: 0.75;
    translate: 0 2px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes workspace-fade-enter {
  from {
    opacity: 0.75;
  }
  to {
    opacity: 1;
  }
}

.location:has(.source-format-actions) {
  flex-wrap: wrap;
}
.source-format-actions,
.source-format-options {
  display: flex;
  align-items: center;
  gap: 4px;
}
.source-format-options {
  flex-wrap: nowrap;
  gap: 6px;
  margin-inline-start: 6px;
}

.location .source-format-options button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-inline: 9px;
}
.source-format-buttons {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
.source-format-buttons > .source-format-option + .source-format-option {
  border-inline-start: 1px solid var(--line);
}
.source-format-buttons > .source-format-option:first-child > button {
  border-radius: 3px 0 0 3px;
}
.source-format-buttons > .source-format-option:last-child > button {
  border-radius: 0 3px 3px 0;
}
.location .source-format-options button:hover:not(:disabled) {
  background: var(--hover);
}
.source-format-option {
  display: inline-flex;
}
.source-format-hint {
  position: fixed;
  z-index: 130;
  width: 240px;
  max-width: calc(100vw - 24px);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--raised);
  color: var(--text);
  box-shadow: 0 2px 8px #00000014;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}

/* Nested value previews use the Source palette (dark values come from the editor theme). */
:root {
  /* Slightly softer than Source's #a11: strings repeat down whole columns. */
  --json-string: #9c3d3d;
  --json-number: #164;
  --json-literal: #219;
}
:root[data-theme="dark"] {
  --json-string: var(--syntax-string);
  --json-number: var(--syntax-number);
  --json-literal: var(--syntax-keyword);
}
.json-string {
  color: var(--json-string);
}
.json-number {
  color: var(--json-number);
}
.json-literal {
  color: var(--json-literal);
}

/*
 * One look for every popup (context menu, column menu, freeze options, file
 * location, active filters): same corner radius, shadow, text size and row
 * height, so they read as parts of one interface. Change them here only.
 */
:root {
  --popup-radius: 6px;
  --popup-shadow: 0 4px 14px #00000024;
  --popup-item-height: 28px;
}
.column-menu,
.sheet-menu,
.freeze-options,
.file-location-panel,
.active-filters-panel {
  border: 1px solid var(--line);
  border-radius: var(--popup-radius);
  box-shadow: var(--popup-shadow);
  font-size: 13px;
}
.sheet-menu button,
.column-menu > button,
.freeze-options button,
.file-location-panel button {
  min-height: var(--popup-item-height);
  font-size: 13px;
}

/*
 * Shared control standards. Individual rules above predate these and picked
 * their own values (3/4/5 px corners, 28/32 px popup rows, 0.4/0.45 disabled);
 * the values below win so every control of a kind looks the same.
 */
:root {
  --control-radius: 4px;
  --disabled-opacity: 0.4;
}
.toolbar button,
.toolbar .theme-picker button,
:is(.location, .inspector) .view-mode button,
.pagination button,
.pagination .freeze-menu summary,
.file-location > summary,
.table-state-control .active-filters > summary {
  border-radius: var(--control-radius);
}
/* Segmented groups keep square inner edges. */
.source-format-buttons > .source-format-option:first-child > button {
  border-radius: var(--control-radius) 0 0 var(--control-radius);
}
.source-format-buttons > .source-format-option:last-child > button {
  border-radius: 0 var(--control-radius) var(--control-radius) 0;
}
.source-format-buttons
  > .source-format-option:not(:first-child):not(:last-child)
  > button {
  border-radius: 0;
}
.freeze-options button,
.file-location-panel button,
.column-menu > button,
.sheet-menu button {
  box-sizing: border-box;
  height: var(--popup-item-height);
  padding-block: 0;
  border-radius: calc(var(--control-radius) - 1px);
}
button:disabled,
.location-history button:disabled,
.toolbar button:disabled,
.pagination button:disabled,
select:disabled,
summary[aria-disabled="true"] {
  opacity: var(--disabled-opacity);
}
/* The active view toggle stays readable even when it cannot be pressed. */
:is(.location, .inspector) .view-mode button[aria-pressed="true"]:disabled {
  opacity: 1;
}

/* Why an in-cell edit was rejected: a popup under the cell, in the error colour. */
.inline-error {
  position: fixed;
  z-index: 110;
  max-width: 320px;
  padding: 6px 10px;
  border: 1px solid var(--error);
  border-radius: var(--popup-radius);
  background: var(--raised);
  box-shadow: var(--popup-shadow);
  color: var(--error);
  font-size: 12px;
  line-height: 1.4;
}

.inline-error .inline-error-discard {
  color: var(--text);
  display: block;
  min-height: 24px;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: var(--control-radius);
  font-size: inherit;
}

/* Anchor the result controls above the field so they never shift it. */
.find-bar {
  position: relative;
  margin-inline-start: auto;
  flex-wrap: nowrap;
}
.find-bar .find-field {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.find-bar .find-tools {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: max-content;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  box-shadow: 0 2px 8px #0002;
}
.find-bar .find-count {
  display: inline-block;
  width: 17ch;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.pagination .find-bar #find {
  padding-inline-end: 30px;
}
.find-bar .find-clear {
  position: absolute;
  right: 3px;
  top: 50%;
  translate: 0 -50%;
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: var(--control-radius);
  color: var(--muted);
}
.find-bar .find-clear:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.sheet-column-heading .header-filter[aria-expanded="true"] {
  background: var(--surface);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.file-opening-status {
  padding: 4px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.inspector-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.inspector-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.inspector-path,
.inspector-value-state {
  flex-basis: 100%;
  min-width: 0;
}
.inspector-metadata .inspector-path .path {
  color: var(--text);
  font-size: 12px;
}
.inspector-type {
  text-transform: capitalize;
}
.inspector-index {
  display: flex;
  gap: 4px;
}
.inspector-index::before {
  content: "·";
  margin-inline-end: 4px;
}
.inspector-raw {
  position: relative;
  min-height: 27px;
  margin-top: 12px;
  font-size: 12px;
}
.inspector-raw > button {
  padding: 4px 8px;
  font-size: 11px;
}
.inspector-raw:has(.inspector-json) > button {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
}
.inspector-json summary {
  color: var(--muted);
  min-height: 27px;
  padding-inline-end: 86px;
}
.inspector-json summary {
  color: var(--muted);
}
.inspector-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.inspector-json {
  margin-top: 12px;
  font-size: 12px;
}
.inspector-json summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  padding-block: 4px;
}
.inspector-json summary::-webkit-details-marker {
  display: none;
}
.inspector-json summary svg {
  flex: none;
  transform: rotate(-90deg);
}
.inspector-json[open] summary svg {
  transform: none;
}
.sheet-tabs button[data-ancestor] {
  box-shadow: inset 0 -2px var(--line);
  font-weight: 550;
}
@media (max-width: 1180px) {
  .inspector {
    position: relative;
    inset: auto;
    max-width: 38vw;
    box-shadow: none;
  }
}

.inspector .pane-heading {
  margin-bottom: 12px;
}
.inspector-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.inspector .inspector-open-table {
  color: var(--accent);
  background: var(--selection);
}
.inspector .structural-actions {
  flex-wrap: wrap;
  margin: 14px 0 0;
  padding-top: 10px;
}
.inspector .details-preview table {
  min-width: 0;
}

.details-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 14px;
}
.details-preview-heading h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 550;
  color: var(--muted);
}
.source-editor .cm-panel.cm-search {
  padding: 6px 10px;
}
.source-editor .cm-search :is(.cm-textfield, .cm-button) {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  font: inherit;
}
.source-editor .cm-searchMatch {
  background: var(--find-highlight, #ffd76a);
  color: #202936;
}
.source-editor .cm-searchMatch-selected {
  outline: 1px solid var(--accent);
}

.find-previous-chevron {
  display: inline-flex;
  transform: rotate(180deg);
}

.range-sheet[data-axis-selection] {
  --axis-label-selection: var(--accent);
}
.range-sheet .select-all-cells[aria-pressed="true"] {
  background-color: var(--axis-label-selection);
}
.range-sheet
  :is(.column-select, .row-select, .select-all-cells)[aria-pressed="true"]:focus-visible {
  outline: 2px solid var(--surface);
  outline-offset: -3px;
}
.range-sheet[data-axis-selection]
  .row-number:has(.row-select[aria-pressed="true"]) {
  background-image: linear-gradient(
    var(--axis-label-selection),
    var(--axis-label-selection)
  );
  background-clip: padding-box;
}

.range-sheet[data-axis-selection]
  :is([role="gridcell"], .sheet-header-selected) {
  border-block-end-color: var(
    --range-bottom-border,
    var(--range-divider, var(--rdg-border-color))
  );
  border-inline-end-color: var(--range-divider, var(--rdg-border-color));
  box-shadow:
    inset var(--range-left, 0px) 0 var(--accent),
    inset calc(-1 * var(--range-right, 0px)) 0 var(--accent),
    inset 0 var(--range-top, 0px) var(--accent);
}
/* A real edit field: address box, explicit label, and spreadsheet-like input. */
.value-bar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 12px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
}
.value-bar output {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 54px;
  min-width: 54px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.value-bar label,
.value-bar-caption {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  cursor: text;
}
.value-bar-editable label {
  color: var(--text);
}
.value-bar textarea {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  height: 32px;
  max-height: 32px;
  box-sizing: border-box;
  resize: none;
  overflow-y: auto;
  padding: 5px 9px;
  font: inherit;
  line-height: 20px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
}
.value-bar textarea:hover:not([readonly]) {
  border-color: var(--muted);
}
.value-bar textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.value-bar textarea[readonly] {
  color: var(--muted);
  background: var(--chrome);
}
.value-bar textarea::placeholder {
  color: var(--muted);
  font-style: italic;
}
.value-bar textarea::selection {
  color: var(--surface);
  background: var(--accent);
}
/* The error sits on its own line under the field, aligned with it. */
.value-bar {
  flex-wrap: wrap;
}
.value-bar > .value-bar-error {
  flex: 0 0 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  max-width: none;
  padding: 0 0 2px;
  font-size: 12px;
  color: var(--error);
}
.value-bar > .value-bar-error[data-aligned] {
  /* address box (54px) plus the bar's gap (8px) */
  margin-left: 62px;
}
.value-bar-error .text-button {
  font-size: 12px;
  padding: 0;
  white-space: nowrap;
}
.value-bar-field:has(textarea[aria-invalid="true"]) {
  border-color: var(--error);
}

.value-bar-empty-field {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  line-height: 20px;
}

.value-bar .value-bar-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 5px;
  height: 32px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.value-bar-expanded textarea {
  max-height: min(152px, 25vh);
}
.value-bar .value-bar-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.value-bar .value-bar-expand:hover {
  background: var(--hover);
  color: var(--text);
}
.value-bar-expand[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Expansion belongs to the field; table navigation remains a separate action. */
.value-bar-field {
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}
.value-bar-field:focus-within {
  border-color: var(--accent);
}
.value-bar .value-bar-field textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.value-bar .value-bar-field textarea[readonly] {
  color: var(--text);
}
.value-bar-field .value-bar-expand {
  height: 30px;
  border-radius: 0;
}
.value-bar .value-bar-open {
  border-color: transparent;
  background: transparent;
}
.value-bar .value-bar-open:hover {
  background: var(--hover);
  color: var(--text);
}

.value-bar:not(.value-bar-expanded) .value-bar-field textarea {
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  line-height: 20px;
  padding-block: 5px;
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.value-bar:not(.value-bar-expanded)
  .value-bar-field
  textarea::-webkit-scrollbar {
  display: none;
}

/* Keep the field label accessible without consuming space in the bar. */
.value-bar label.sr-only,
.value-bar-caption.sr-only {
  min-height: 0;
  padding: 0;
  margin: -1px;
}
