/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  color-scheme: dark;
  --bg-0: #171717;
  --bg-1: #202020;
  --bg-2: #2a2a2a;
  --border: #3a3a3a;
  --fg: #e5e5e5;
  --fg-muted: #a3a3a3;
  --accent: #737373;
  --button-bg: #2b2b2b;
  --button-fg: #dddddd;
  --focus-ring: #8a8a8a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg-0);
  color: var(--fg);
}

a {
  color: #d4d4d8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
}

.top-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  border-bottom: 1px solid #dbe3ef;
  height: 3.5rem;
  padding: 0 1rem;
}

.top-bar-title {
  font-size: 1rem;
  font-weight: 600;
}

.top-bar-context {
  display: grid;
  grid-gap: 0.1rem;
  gap: 0.1rem;
}

.breadcrumb-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.breadcrumb-line a {
  color: var(--fg-muted);
}

.breadcrumb-separator {
  color: var(--fg-muted);
}

.menu-button {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--button-bg);
  color: var(--fg-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.menu-button:hover {
  background: var(--bg-2);
  color: var(--fg);
}

.menu-button:active {
  background: var(--bg-1);
}

.menu-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.shell-layout {
  position: relative;
}

.drawer {
  position: fixed;
  top: 3.5rem;
  left: 0;
  bottom: 0;
  width: 16rem;
  background: #ffffff;
  border-right: 1px solid #dbe3ef;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 30;
  padding: 1rem;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  top: 3.5rem;
  left: 0;
  right: 0;
  bottom: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.3);
  z-index: 25;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
}

.menu-list a {
  display: block;
  padding: 0.5rem;
  border-radius: 0.4rem;
}

.menu-list a:hover {
  background: #2a2a2a;
}

.app-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
  overflow: auto;
}

.page-header {
  display: grid;
  grid-gap: 0.45rem;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.page-breadcrumbs {
  font-size: 0.8rem;
  color: #a1a1aa;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.page-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.page-breadcrumb-item a {
  color: #d4d4d8;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.page-title {
  margin: 0;
  color: #f4f4f5;
  font-size: 1.5rem;
}

.page-subtitle {
  margin: 0.25rem 0 0;
  color: #a1a1aa;
}

.section-grid {
  display: grid;
  grid-gap: 0.8rem;
  gap: 0.8rem;
}

.section-card {
  background: #202020;
  border: 1px solid #34343a;
  border-radius: 0.75rem;
  padding: 0.85rem;
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.section-card-header h2 {
  margin: 0;
  color: #f4f4f5;
  font-size: 1.02rem;
}

.section-card-content {
  display: grid;
  grid-gap: 0.45rem;
  gap: 0.45rem;
}

.section-card-meta {
  margin: 0;
  color: #a1a1aa;
}

.entity-list-v2 {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
}

.entity-card-item {
  list-style: none;
}

.entity-card {
  background: #202020;
  border: 1px solid #34343a;
  border-radius: 0.6rem;
  padding: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.entity-card-main {
  display: grid;
  grid-gap: 0.2rem;
  gap: 0.2rem;
}

.entity-card-title {
  color: #f4f4f5;
  font-weight: 600;
}

.entity-card-subtitle,
.entity-card-meta,
.entity-empty-hint {
  color: #a1a1aa;
  font-size: 0.83rem;
}

.entity-card-badge {
  border: 1px solid #52525b;
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  color: #e4e4e7;
}

.entity-empty-state {
  border: 1px dashed #3f3f46;
  border-radius: 0.65rem;
  padding: 1rem;
}

.entity-empty-title {
  margin: 0;
  color: #f4f4f5;
}

.entity-empty-hint {
  margin: 0.25rem 0 0;
}

.entity-error-banner {
  border: 1px solid #7f1d1d;
  background: #450a0a;
  border-radius: 0.65rem;
  padding: 0.75rem;
  color: #fecaca;
}

.entity-skeleton {
  height: 4.4rem;
  border-radius: 0.6rem;
  border: 1px solid #3f3f46;
  background: linear-gradient(90deg, #242428, #303036, #242428);
}

.home-page h1 {
  margin-top: 0;
}

.hint {
  color: var(--fg-muted);
  margin-top: 0;
}

.tile-grid {
  display: grid;
  grid-gap: 0.75rem;
  gap: 0.75rem;
}

.tile {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.85rem;
}

.document-page {
  --desktop-doc-topbar-height: 2.6rem;
  --desktop-pane-outline-width: minmax(14rem, 18rem);
  --desktop-pane-main-width: minmax(0, 1fr);
  --desktop-pane-chat-width: minmax(18rem, 24rem);
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 3.5rem - env(safe-area-inset-top));
  padding: 0;
}

.tile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.tile-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.tile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.45rem;
  gap: 0.45rem;
}

.tile-list > li:not(.list-row) {
  background: var(--bg-2);
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.5rem;
}

@media (min-width: 900px) {
  .tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.entity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
}

.entity-list > li:not(.list-row) {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.65rem;
}

.list-row {
  list-style: none;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0;
  overflow: hidden;
}

.list-row-link {
  display: grid;
  grid-gap: 0.2rem;
  gap: 0.2rem;
  padding: 0.65rem;
  color: inherit;
}

.list-row-title {
  color: var(--fg);
}

.list-row-subtitle {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.list-row-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
}


.project-hub-grid {
  display: grid;
  grid-gap: 0.75rem;
  gap: 0.75rem;
}

.project-hub-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.85rem;
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
}

.project-hub-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.project-hub-meta {
  margin: 0;
  color: var(--fg-muted);
}

.doc-status {
  text-transform: capitalize;
  font-size: 0.82rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg);
  color: var(--fg-muted);
}

.doc-tree-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.doc-tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-row {
  border-bottom: 1px solid #34343a;
}

.tree-row:last-child {
  border-bottom: 0;
}

.tree-row.selected {
  background: #2a2a32;
}

.tree-row-main {
  display: flex;
  align-items: stretch;
  min-height: 2.5rem;
}

.tree-caret,
.tree-caret-placeholder {
  width: 2rem;
  border: 0;
  background: transparent;
  color: #a1a1aa;
  font-size: 0.95rem;
}

.tree-open-button {
  flex: 1 1;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0.25rem;
  display: grid;
  grid-gap: 0.2rem;
  gap: 0.2rem;
  cursor: pointer;
}

.tree-row-title {
  font-size: 0.92rem;
  color: #f4f4f5;
}

.node-workbench {
  display: grid;
  grid-gap: 0.75rem;
  gap: 0.75rem;
}

.button-secondary {
  border: 1px solid var(--border);
  background: var(--button-bg);
  color: var(--button-fg);
  border-radius: 0.45rem;
  padding: 0.4rem 0.65rem;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  overflow: hidden;
}

.view-toggle button {
  border: 0;
  background: var(--bg-1);
  color: var(--fg);
  padding: 0.35rem 0.7rem;
}

.view-toggle button.is-active {
  background: var(--bg-2);
  color: var(--fg);
}

.node-content {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.7rem;
  background: var(--bg-1);
}

.node-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.83rem;
}

.document-controls-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: calc(3.5rem + env(safe-area-inset-top));
  z-index: 18;
  background: var(--bg-0);
  margin-bottom: 0.5rem;
  padding: 0.25rem 0 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}

/* Top bar for desktop panel toggles — above the 3-column grid */
.document-topbar-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: calc(3.5rem + env(safe-area-inset-top));
  z-index: 19;
  background: var(--bg-0);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  padding: 0.3rem 0;
}

.document-topbar-inner {
  display: grid;
  grid-template-columns: var(--desktop-pane-main-width);
  align-items: center;
  width: 100%;
}

.desktop-control-outline-segment,
.desktop-control-chat-segment {
  display: none;
}

.desktop-control-document-segment {
  min-width: 0;
}

/* On desktop the document-controls-sticky top must account for topbar height (~2.4rem) */
@media (min-width: 1100px) {
  .document-controls-sticky {
    top: calc(3.5rem + var(--desktop-doc-topbar-height) + env(safe-area-inset-top));
  }
}


.desktop-panel-chevron {
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--bg-1);
  color: var(--fg);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
}

.desktop-panel-chevron:hover {
  background: var(--bg-2);
}

.document-desktop-layout {
  min-height: 0;
}

.document-main-panel {
  min-width: 0;
  padding: 0 0.8rem;
}

.document-main-content {
  width: 100%;
  margin: 0;
}

@media (min-width: 1100px) {
  .document-topbar-inner {
    grid-template-columns: var(--desktop-pane-outline-width) var(--desktop-pane-main-width) var(--desktop-pane-chat-width);
    min-height: var(--desktop-doc-topbar-height);
  }

  .document-topbar-sticky[data-outline-visible="false"] .document-topbar-inner {
    grid-template-columns: var(--desktop-pane-main-width) var(--desktop-pane-chat-width);
  }

  .document-topbar-sticky[data-chat-visible="false"] .document-topbar-inner {
    grid-template-columns: var(--desktop-pane-outline-width) var(--desktop-pane-main-width);
  }

  .document-topbar-sticky[data-outline-visible="false"][data-chat-visible="false"] .document-topbar-inner {
    grid-template-columns: var(--desktop-pane-main-width);
  }

  .desktop-control-outline-segment,
  .desktop-control-chat-segment {
    display: flex;
    align-items: center;
  }

  .desktop-control-outline-segment {
    justify-content: flex-end;
    padding-right: 0.35rem;
    border-right: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  }

  .desktop-control-chat-segment {
    justify-content: flex-start;
    padding-left: 0.35rem;
    border-left: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  }

  .desktop-control-document-segment {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0 0.4rem;
  }

  .desktop-control-document-segment .document-controls {
    width: 100%;
  }

  .document-topbar-sticky[data-outline-visible="false"] .desktop-control-outline-segment,
  .document-topbar-sticky[data-chat-visible="false"] .desktop-control-chat-segment {
    display: none;
  }

  .document-desktop-layout {
    display: grid;
    grid-template-columns: var(--desktop-pane-outline-width) var(--desktop-pane-main-width) var(--desktop-pane-chat-width);
    align-items: start;
    /* No border-top — topbar provides visual separation */
  }

  .document-main-panel {
    min-height: calc(100dvh - 3.5rem - var(--desktop-doc-topbar-height));
    padding: 0 0.5rem;
  }

  .document-main-content {
    scroll-padding-top: calc(3.5rem + var(--desktop-doc-topbar-height) + env(safe-area-inset-top) + 0.6rem);
  }

  .document-desktop-layout[data-outline-visible="false"] {
    grid-template-columns: var(--desktop-pane-main-width) var(--desktop-pane-chat-width);
  }

  .document-desktop-layout[data-chat-visible="false"] {
    grid-template-columns: var(--desktop-pane-outline-width) var(--desktop-pane-main-width);
  }

  .document-desktop-layout[data-outline-visible="false"][data-chat-visible="false"] {
    grid-template-columns: var(--desktop-pane-main-width);
  }

  .desktop-outline-panel,
  .desktop-chat-shell {
    min-height: 0;
    align-self: stretch;
    border-right: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  }

  .desktop-outline-panel {
    position: -webkit-sticky;
    position: sticky;
    top: calc(3.5rem + var(--desktop-doc-topbar-height) + env(safe-area-inset-top));
    max-height: calc(100vh - 3.5rem - var(--desktop-doc-topbar-height));
    overflow-y: auto;
    scroll-padding-top: 0.75rem;
    scroll-padding-bottom: 0.75rem;
  }

  .desktop-chat-shell {
    border-right: 0;
    border-left: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  }

  .desktop-outline-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    display: grid;
    grid-gap: 0.2rem;
    gap: 0.2rem;
  }

  .desktop-outline-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--fg-muted);
    border-radius: 0.35rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    scroll-margin-top: 0.5rem;
  }

  .desktop-outline-item.is-selected {
    background: var(--bg-2);
    color: var(--fg);
  }

  .desktop-chat-shell {
    padding: 0.5rem;
    position: -webkit-sticky;
    position: sticky;
    top: calc(3.5rem + var(--desktop-doc-topbar-height) + env(safe-area-inset-top));
    max-height: calc(100vh - 3.5rem - var(--desktop-doc-topbar-height));
    overflow: auto;
  }
}

.desktop-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(8rem, 1fr) auto;
  grid-gap: 0.45rem;
  gap: 0.45rem;
  min-height: 18rem;
}

.desktop-chat-header {
  padding: 0.3rem 0.2rem;
}

.desktop-chat-empty {
  color: var(--fg-muted);
  padding: 0.4rem;
}

.document-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.document-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  overflow: hidden;
}

.document-mode-toggle button {
  border: 0;
  background: var(--bg-1);
  color: var(--fg);
  padding: 0.35rem 0.7rem;
}

.document-mode-toggle button.is-active {
  background: var(--bg-2);
  color: var(--fg);
}

.document-menu {
  position: relative;
}

.document-menu > button {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--bg-1);
  color: var(--fg);
}

.document-menu-items {
  position: absolute;
  right: 0;
  top: 2.3rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
  padding: 0.25rem;
  display: grid;
  grid-gap: 0.2rem;
  gap: 0.2rem;
  min-width: 8.5rem;
  z-index: 30;
}

.document-menu-items button {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.5rem;
  text-align: left;
}

.doc-block {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  padding-bottom: 0.34rem;
  margin-bottom: 0.46rem;
}

.doc-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.doc-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
  min-width: 0;
}

.doc-row-icon-slot {
  width: 1.6rem;
  flex: 0 0 1.6rem;
}

.doc-row-main {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.doc-row-title-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: nowrap;
}

.doc-row-title {
  color: var(--fg);
  font-weight: 500;
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}

.doc-row-chat-marker {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, #2563eb 72%, var(--fg-muted));
  opacity: 0.75;
  display: inline-block;
  flex: 0 0 auto;
}

.doc-row-title > * {
  margin: 0;
}

.doc-row-meta {
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--fg-muted);
  font-size: 0.78rem;
}



.doc-block-heading {
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

@media (min-width: 1100px) {
  .doc-block-heading {
    scroll-margin-top: calc(3.5rem + var(--desktop-doc-topbar-height) + env(safe-area-inset-top) + 0.75rem);
  }
}

.doc-block-heading.is-selected {
  background: transparent;
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--fg-muted) 45%, transparent);
}

.doc-row-title-button {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  flex: 1 1;
  min-width: 0;
  cursor: text;
  display: inline-flex;
  align-items: center;
}

.doc-row-title-input {
  flex: 1 1;
  min-width: 0;
  font: inherit;
  color: var(--fg);
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.05rem 0.3rem;
  margin: 0;
}

.doc-row-actions-slot {
  width: 1.75rem;
  flex: 0 0 1.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.doc-row-node-menu {
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.doc-row-node-menu:hover {
  color: var(--fg);
}

.doc-row-node-menu-popover {
  position: fixed;
  min-width: 9rem;
  width: max-content;
  max-width: min(16rem, calc(100vw - 1.5rem));
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.14);
  padding: 0.2rem;
  z-index: 30;
}

.doc-row-node-menu-item {
  border: 0;
  width: 100%;
  text-align: left;
  background: transparent;
  padding: 0.5rem 0.55rem;
  border-radius: 0.35rem;
  font-size: 0.83rem;
  color: var(--fg);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .doc-block {
    padding-bottom: 0.3rem;
    margin-bottom: 0.5rem;
  }
}

.doc-row-node-menu-item:hover {
  background: var(--bg-2);
}

.doc-row-node-menu-item.has-chat {
  font-weight: 600;
}

.doc-row-description {
  margin: 0.35rem 0 0;
  color: var(--fg-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.doc-row-outline-number {
  color: color-mix(in srgb, var(--fg-muted) 88%, transparent);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  font-weight: 500;
  flex: 0 0 auto;
}

@media (max-width: 1099px) {
  .document-topbar-sticky {
    display: none;
  }

  .doc-row-outline-number {
    display: none;
  }
}

.document-page[data-mode="full"] .doc-row-description {
  padding-left: 0;
  max-width: min(78ch, 100%);
}

.document-page[data-mode="full"] .doc-row-main > .doc-row-description,
.document-page[data-mode="full"] .doc-row-main > .doc-description-editor {
  margin-left: -1.95rem;
}

.document-page[data-mode="full"] .doc-block-text,
.document-page[data-mode="full"] .doc-block-preview {
  max-width: none;
}

.doc-description-editor {
  margin-top: 0.4rem;
}

.doc-description-textarea {
  width: 100%;
  min-height: 7rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--fg);
}

.doc-description-textarea:disabled {
  background: var(--bg-2);
}

.doc-description-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.doc-description-button {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #ffffff;
  color: var(--fg);
  min-height: 44px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
}

.doc-description-button-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.doc-description-button:disabled {
  opacity: 0.7;
}

.doc-row-updated {
  margin-left: auto;
}

.toast-feedback {
  position: fixed;
  top: 1rem;
  right: 1rem;
  margin: 0;
  border-radius: 0.45rem;
  background: #2f2f2f;
  color: #ffffff;
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.toast-feedback.is-visible {
  opacity: 1;
}

.node-chevron,
.node-chevron-placeholder {
  width: 1.6rem;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  padding: 0;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.5;
}

.pending-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-muted);
  font-size: 0.73rem;
  padding: 0.1rem 0.45rem;
}

.pending-badge.compact {
  font-size: 0.7rem;
  padding: 0.05rem 0.4rem;
}

.doc-block-preview,
.doc-block-text {
  padding-right: 0.75rem;
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.doc-block-heading-joined {
  border-bottom: 0;
}

.node-preview,
.doc-block-text p,
.node-preview-text {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

.node-preview-description {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.25rem 0;
  min-width: 0;
}

.node-preview-label {
  font-size: 0.72rem;
  line-height: 1;
  color: var(--fg-muted);
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.node-preview-description-text {
  min-width: 0;
  color: var(--fg-muted);
  font-size: 0.83rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.node-preview-fallback {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 2;
}

.doc-block-text p {
  display: block;
  -webkit-line-clamp: unset;
}


.markdown-content > :first-child {
  margin-top: 0;
}

.markdown-content > :last-child {
  margin-bottom: 0;
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content pre,
.markdown-content blockquote,
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin: 0.2rem 0;
}

.markdown-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.88em;
}

.markdown-content pre {
  overflow-x: auto;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 60;
  display: flex;
  align-items: flex-end;
}

.sheet {
  width: 100%;
  max-height: 70vh;
  background: #202020;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-gap: 0.5rem;
  gap: 0.5rem;
  padding: 0.75rem;
  border-bottom: 1px solid #34343a;
}

.sheet-header strong {
  text-align: center;
  font-size: 1rem;
  color: #f4f4f5;
}

.sheet-body {
  padding: 0.75rem;
  overflow: auto;
}

.sheet-textarea {
  width: 100%;
  min-height: 12rem;
  border: 1px solid #34343a;
  border-radius: 0.65rem;
  padding: 0.75rem;
  font-size: 1rem;
  line-height: 1.45;
  color: #f4f4f5;
  background: #18181b;
  resize: vertical;
}

.chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 70;
  display: flex;
  align-items: flex-end;
}

.chat-sheet {
  width: 100%;
  max-height: 82vh;
  background: #202020;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #34343a;
}

.chat-messages {
  flex: 1 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-row {
  display: flex;
  margin-bottom: 0.5rem;
}

.chat-row-out {
  justify-content: flex-end;
}

.chat-row-in {
  justify-content: flex-start;
}

.chat-message-stack {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.chat-bubble {
  display: inline-block;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.94rem;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}

.chat-bubble-user {
  margin-left: auto;
  background: #1d3b63;
  color: #dbeafe;
}

.chat-bubble-assistant {
  margin-right: auto;
  background: #2a2a2f;
  color: #f4f4f5;
}

.chat-composer {
  border-top: 1px solid #34343a;
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
}

.chat-composer textarea {
  flex: 1 1;
  border: 1px solid #34343a;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  resize: none;
  font: inherit;
  background: #18181b;
  color: #f4f4f5;
}

 .chat-send {
  border: 1px solid var(--border);
  background: var(--button-bg);
  color: var(--button-fg);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
}

.chat-send:disabled {
  opacity: 0.6;
}

.chat-message-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #ef4444;
  cursor: pointer;
}

.mobile-app-layout {
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--fg);
}

.mobile-top-bar {
  height: 3.5rem;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: center;
  grid-gap: 0.5rem;
  gap: 0.5rem;
  padding: 0 0.75rem;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}

.mobile-top-title {
  font-size: 0.86rem;
  color: var(--fg-muted);
  font-weight: 500;
  min-width: 0;
  position: relative;
  z-index: 81;
  pointer-events: none;
}

.mobile-top-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  color: var(--fg-muted);
  pointer-events: auto;
}

.mobile-top-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.mobile-top-breadcrumb-item a {
  color: var(--fg);
  pointer-events: auto;
  position: relative;
  z-index: 82;
}

.mobile-top-breadcrumb-separator {
  color: var(--fg-muted);
}

.top-actions button,
.mobile-deck-header button,
.node-actions button,
.link-button {
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 0.4rem 0.55rem;
}

.mobile-active-view {
  position: relative;
  z-index: 1;
  /* Document page fills the view; other pages add their own padding */
}

.mobile-view-scroll {
  display: grid;
  grid-gap: 0.75rem;
  gap: 0.75rem;
  padding: 0.8rem;
}

.mobile-deck {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-1);
  padding: 0.7rem;
}

.mobile-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-deck-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.mobile-card-list {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
}

.mobile-card {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-2);
  padding: 0.6rem;
}

.mobile-card-title,
.mobile-card-meta {
  margin: 0;
}

.mobile-card-meta {
  margin-top: 0.25rem;
  color: var(--fg-muted);
  font-size: 0.82rem;
}

.mobile-full-view {
  min-height: calc(100vh - 5.1rem);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--bg-1);
  padding: 0.8rem;
  display: grid;
  grid-gap: 0.75rem;
  gap: 0.75rem;
  align-content: start;
}

.node-header {
  font-size: 1.02rem;
  font-weight: 600;
}

.presence-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.presence-chip {
  position: relative;
}

.avatar-circle {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  color: var(--fg);
  font-size: 0.72rem;
  font-weight: 600;
}

.presence-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  position: absolute;
  right: -0.05rem;
  bottom: 0;
}

.presence-dot.online {
  background: #22c55e;
}

.presence-dot.offline {
  background: #64748b;
}

.node-content {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.65rem;
  background: var(--bg-2);
}

.node-content h2,
.node-content h3,
.node-content p {
  margin: 0 0 0.55rem;
}

.node-markdown-li {
  margin-left: 1rem;
}

.node-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.node-editor-input {
  min-height: 13rem;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-0);
  color: var(--fg);
  padding: 0.65rem;
}

.node-chat-view {
  grid-template-rows: auto auto 1fr auto;
}

.message-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
  overflow: auto;
}

.message-item {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.55rem;
  background: var(--bg-2);
}

.message-author {
  margin: 0;
  display: flex;
  justify-content: space-between;
  color: var(--fg-muted);
  font-size: 0.82rem;
}

.message-text {
  margin: 0.2rem 0 0;
}

.message-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-gap: 0.45rem;
  gap: 0.45rem;
}

.message-input-row input,
.drawer-search {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-0);
  color: var(--fg);
  padding: 0.5rem;
}

.patch-preview {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.65rem;
  background: var(--bg-0);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.patch-preview p {
  margin: 0 0 0.35rem;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  width: min(86vw, 20rem);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 35;
}

.drawer-content {
  display: grid;
  grid-gap: 0.8rem;
  gap: 0.8rem;
}

.drawer-nav-list,
.drawer-account-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-gap: 0.45rem;
  gap: 0.45rem;
}

.drawer-nav-list button,
.drawer-account-menu button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-2);
  color: var(--fg);
  padding: 0.5rem;
}

.drawer-account {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  display: grid;
  grid-gap: 0.65rem;
  gap: 0.65rem;
}

.drawer-account-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.drawer-account-head p {
  margin: 0;
}

.online-label {
  color: #86efac;
  font-size: 0.8rem;
}

.mobile-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mobile-card:hover,
.drawer-nav-list button:hover,
.drawer-account-menu button:hover,
.top-actions button:hover,
.mobile-deck-header button:hover {
  background: var(--button-bg);
  border-color: var(--accent);
}

.mobile-card:focus-visible,
.drawer-nav-list button:focus-visible,
.drawer-account-menu button:focus-visible,
.drawer-account-head:focus-visible,
.mobile-deck-header button:focus-visible,
.top-actions button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.drawer-nav-list button,
.drawer-account-menu button,
.drawer-account-head,
.mobile-deck-header button,
.top-actions button,
.link-button {
  cursor: pointer;
}

.drawer-nav-list button.is-active {
  border-color: var(--accent);
  background: var(--button-bg);
}

.drawer-account-head {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-2);
  color: var(--fg);
  padding: 0.45rem;
  text-align: left;
}

.mobile-placeholder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
}

.mobile-placeholder-list li {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--bg-2);
  padding: 0.55rem 0.65rem;
  color: var(--fg-muted);
}


.chat-inline-header {
  margin-bottom: 0.75rem;
}

.chat-inline-header h1 {
  margin: 0;
  font-size: 1.1rem;
}

.chat-inline-header p {
  margin: 0.2rem 0 0;
  color: var(--fg-muted);
  font-size: 0.82rem;
}


.fullscreen-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
}

.fullscreen-modal {
  position: fixed;
  inset: 0;
  background: var(--bg-1);
  color: var(--fg);
  display: flex;
  flex-direction: column;
}

.fullscreen-modal-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.fullscreen-modal-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-gap: 0.5rem;
  gap: 0.5rem;
  flex: 0 0 auto;
  padding: calc(0.75rem + env(safe-area-inset-top)) 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.fullscreen-modal-header strong {
  text-align: center;
}

.fullscreen-modal-body {
  padding: 0.75rem;
  min-height: 0;
  overflow: auto;
  flex: 1 1 auto;
}

.fullscreen-modal-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

.fullscreen-modal-footer .btn {
  flex: 1 1;
}

.fullscreen-modal-textarea {
  width: 100%;
  min-height: 65vh;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.75rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--fg);
  background: var(--bg-0);
  resize: vertical;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--button-bg);
  color: var(--button-fg);
  min-height: 40px;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--fg);
}

.btn-secondary {
  background: transparent;
}

.text-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-0);
  color: var(--fg);
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
}

.create-project-form-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--fg-muted);
  font-size: 0.85rem;
}


.create-project-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.75rem;
}

.create-project-actions .btn {
  flex: 1 1;
}

.create-project-error {
  margin: 0.5rem 0 0;
  color: #fca5a5;
  font-size: 0.85rem;
}

.doc-node-ops {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}


.doc-title-edit-actions {
  margin-top: 0;
}

.doc-node-op-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-1);
  color: var(--fg);
  font-size: 0.72rem;
  line-height: 1.1;
  min-width: 2rem;
  padding: 0.12rem 0.36rem;
}

.doc-node-op-button-danger {
  color: #f87171;
}


/* ── Inline body editor (full / md modes) ─────────────────────── */
.doc-inline-body-editor {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.doc-inline-body-textarea {
  width: 100%;
  min-height: 6rem;
  max-height: 55vh;
  resize: vertical;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg-1);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  box-sizing: border-box;
}

.doc-inline-body-textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--fg) 40%, transparent);
}

.doc-inline-body-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  /* Sticky so Save/Cancel stay visible while textarea is long */
  position: -webkit-sticky;
  position: sticky;
  bottom: 0.5rem;
  background: var(--bg-0);
  padding: 0.3rem 0;
  z-index: 6;
}

.doc-inline-body-error {
  font-size: 0.82rem;
  color: var(--fg-danger, #e05252);
  margin-left: 0.5rem;
}

.doc-block-text-editing {
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--bg-1) 55%, transparent);
  padding-bottom: 0.4rem;
}

/* ── Raw MD display (md mode) ─────────────────────────────────── */
.doc-raw-md {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--fg-muted);
  background: transparent;
}

/* ── Description editor sticky actions ───────────────────────── */
.doc-description-editor {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.doc-description-editor .doc-node-ops {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0.5rem;
  background: var(--bg-0);
  padding: 0.25rem 0;
  z-index: 5;
}

.auth-page {
  min-height: calc(100vh - 3.5rem);
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  display: grid;
  grid-gap: 0.75rem;
  gap: 0.75rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.35rem;
}

.auth-form {
  display: grid;
  grid-gap: 0.6rem;
  gap: 0.6rem;
}

.auth-form input,
.auth-form select,
.auth-form button {
  width: 100%;
  min-height: 2.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--fg);
  padding: 0.55rem 0.7rem;
}

.auth-form button {
  background: var(--button-bg);
  cursor: pointer;
}

.auth-help {
  margin: 0;
  color: var(--fg-muted);
}

.auth-error {
  margin: 0;
  color: #fca5a5;
}

.drawer-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-2);
  color: var(--fg);
  padding: 0.5rem;
}

.drawer-link.is-active {
  border-color: var(--accent);
  background: var(--button-bg);
}

.drawer-account-email {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.8rem;
  word-break: break-all;
}

.settings-page {
  padding: 1rem;
  display: grid;
  grid-gap: 0.8rem;
  gap: 0.8rem;
}

.settings-card {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-1);
  padding: 0.85rem;
}

.settings-card h1,
.settings-card h2 {
  margin: 0 0 0.5rem;
}

.settings-muted { color: var(--fg-muted); margin: 0; }

.settings-form {
  margin-top: 0.5rem;
  display: grid;
  grid-gap: 0.45rem;
  gap: 0.45rem;
  max-width: 420px;
}

.settings-form input,
.settings-form select,
.settings-form button,
.settings-table-actions button,
.settings-actions button {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-2);
  color: var(--fg);
  padding: 0.5rem;
}

.settings-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.settings-table-wrap { overflow-x: auto; }

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.settings-table th,
.settings-table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.45rem;
}

.settings-table-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.settings-shell-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.settings-shell-link {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  color: var(--fg-muted);
  text-decoration: none;
  background: var(--bg-2);
}

.settings-shell-link.is-active {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--button-bg);
}

.settings-shell-content {
  display: grid;
  grid-gap: 0.8rem;
  gap: 0.8rem;
}

