/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* The product demo: a scaled-down Neoma window built from the same tokens as the app. */

.demo {
  position: relative;
}
.d-window {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 540px;
  overflow: hidden;
  background: var(--nm-surface);
  border: 1px solid var(--nm-border-strong);
  border-radius: var(--nm-radius-lg);
  box-shadow: var(--nm-shadow-lg);
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}
.d-window button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.d-window svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Title bar */
.d-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--nm-border);
  background: var(--nm-surface-2);
}
.d-dots {
  display: flex;
  gap: 6px;
}
.d-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--nm-border-strong);
}
.d-crumb {
  font-family: var(--nm-font-mono);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.d-kbar {
  display: flex !important;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  height: 26px;
  padding: 0 6px 0 10px !important;
  border: 1px solid var(--nm-border) !important;
  border-radius: var(--nm-radius-md);
  background: var(--nm-surface) !important;
  color: var(--nm-text-faint) !important;
  font-size: 12px !important;
}
.d-kbar span {
  margin-right: 14px;
}
.d-kbar:hover {
  border-color: var(--nm-border-strong) !important;
  color: var(--nm-text-muted) !important;
}

/* Three panes */
.d-body {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr) 200px;
  min-height: 0;
}
.d-side {
  min-height: 0;
  overflow: auto;
  padding: 10px 8px;
  border-right: 1px solid var(--nm-border);
  background: var(--nm-bg);
}
.d-side-head {
  display: flex;
  justify-content: space-between;
  padding: 2px 8px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nm-text-muted);
}
.d-side-head .faint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.d-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}
.d-file,
.d-folder {
  display: flex !important;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 28px;
  padding: 0 8px !important;
  border-radius: var(--nm-radius-sm);
  color: var(--nm-text-muted);
  white-space: nowrap;
}
.d-folder {
  margin-top: 4px;
}
.d-nested .d-file {
  padding-left: 22px !important;
}
.d-file:not(.is-file):hover {
  background: var(--nm-hover);
  color: var(--nm-text);
}
.d-file.active {
  background: var(--nm-active);
  color: var(--nm-text);
  font-weight: 500;
}
.d-file.is-file {
  color: var(--nm-text-faint);
  cursor: default;
}

.d-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.d-tabs {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px 0 0;
  border-bottom: 1px solid var(--nm-border);
}
.d-tab {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  border-right: 1px solid var(--nm-border);
  box-shadow: inset 0 -2px 0 var(--nm-accent);
  font-weight: 500;
}
.d-modes {
  margin-left: auto;
}
.d-modes button {
  height: 22px;
  padding: 0 8px !important;
  border-radius: var(--nm-radius-sm);
  color: var(--nm-text-faint) !important;
  font: 500 11px/22px var(--nm-font-mono) !important;
}
.d-modes button:hover,
.d-modes button[aria-pressed='true'] {
  background: var(--nm-hover) !important;
  color: var(--nm-text) !important;
}

/* The note */
.d-doc {
  min-height: 0;
  overflow: auto;
  padding: 26px 34px 40px;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
}
.d-doc > * + * {
  margin-top: 0.8em;
}
.d-doc h1 {
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}
.d-doc h2 {
  margin-top: 1.4em;
  font-size: 1.05rem;
}
.d-doc ul {
  margin-bottom: 0;
  padding-left: 1.2em;
}
.d-doc p,
.d-doc li {
  color: color-mix(in srgb, var(--nm-text) 88%, var(--nm-bg));
}
.d-link {
  display: inline !important;
  color: var(--nm-accent) !important;
  font-weight: 500 !important;
  text-decoration: underline !important;
  text-decoration-color: var(--nm-accent-line) !important;
  text-underline-offset: 0.2em;
}
.d-link:hover {
  text-decoration-color: currentColor !important;
}
.d-link.d-unresolved {
  color: var(--nm-text-muted) !important;
  text-decoration-style: dashed !important;
  text-decoration-color: var(--nm-border-strong) !important;
}
.d-pdf i {
  display: inline-block;
  margin-right: 5px;
  padding: 0 4px;
  border: 1px solid var(--nm-accent-line);
  border-radius: var(--nm-radius-xs);
  font: 600 9px/14px var(--nm-font-mono);
  font-style: normal;
  vertical-align: 1px;
}
.d-cite {
  font-family: var(--nm-font-mono);
  font-size: 0.86em;
  color: var(--nm-text-muted);
  background: var(--nm-bg-sunken);
  padding: 1px 4px;
  border-radius: var(--nm-radius-xs);
}
.d-tag {
  color: var(--nm-accent);
  font-size: 0.92em;
}
.d-math {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 1.08em;
}
.d-math .rm {
  font-style: normal;
}
.d-math .ov {
  border-top: 1px solid currentColor;
  padding-top: 1px;
}
.d-display {
  padding: 14px 0;
  text-align: center;
  font-size: 1.15rem;
}
.d-callout {
  padding: 10px 14px;
  border-left: 2px solid var(--nm-accent);
  background: var(--nm-accent-subtle);
  border-radius: 0 var(--nm-radius-sm) var(--nm-radius-sm) 0;
}
.d-callout b {
  display: block;
  font-size: 12px;
  color: var(--nm-accent);
}
.d-callout.d-definition {
  border-left-color: var(--nm-text-muted);
  background: var(--nm-bg-sunken);
}
.d-callout.d-definition b {
  color: var(--nm-text);
}
.d-card {
  padding: 12px 14px;
  border: 1px solid var(--nm-border);
  border-radius: var(--nm-radius-md);
  background: var(--nm-surface-2);
}
.d-card p {
  margin-top: 8px;
}
.d-card summary {
  margin-top: 6px;
  color: var(--nm-accent);
  cursor: pointer;
  font-size: 12px;
}
.d-tasks {
  list-style: none;
  padding-left: 0 !important;
}
.d-box {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 1.5px solid var(--nm-border-strong);
  border-radius: 3px;
}
.d-new {
  animation: d-in 0.5s var(--nm-ease);
  box-shadow: -10px 0 0 -8px var(--nm-accent);
}
@keyframes d-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.d-caret {
  display: inline-block;
  width: 1.5px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -3px;
  background: var(--nm-accent);
  animation: d-blink 1.1s steps(1) infinite;
}
@keyframes d-blink {
  50% {
    opacity: 0;
  }
}
.d-source {
  margin: 0;
  font: 12.5px/1.75 var(--nm-font-mono);
  white-space: pre-wrap;
  color: var(--nm-text);
}
.s-meta,
.s-mark {
  color: var(--nm-text-faint);
}
.s-head {
  font-weight: 600;
}
.s-link {
  color: var(--nm-accent);
}
.s-cite,
.s-math {
  color: var(--nm-text-muted);
}

/* Right pane */
.d-right {
  min-height: 0;
  overflow: auto;
  padding: 16px 16px;
  border-left: 1px solid var(--nm-border);
  background: var(--nm-bg);
}
.d-info + .d-info {
  margin-top: 18px;
}
.d-info h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font: 500 10.5px var(--nm-font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nm-text-faint);
}
.d-count {
  padding: 0 5px;
  border-radius: 8px;
  background: var(--nm-accent-subtle);
  color: var(--nm-accent);
  font: 500 10px/16px var(--nm-font-mono);
  letter-spacing: 0;
}
.d-props {
  display: grid;
  gap: 3px;
  margin: 0;
  font-size: 12px;
}
.d-props div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
}
.d-props dt {
  color: var(--nm-text-faint);
}
.d-props dd {
  margin: 0;
  color: var(--nm-text);
}
.d-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
}
.d-rows li {
  padding: 3px 0;
  color: var(--nm-text-muted);
}
.d-rows.mono li {
  font: 11.5px var(--nm-font-mono);
}
.d-rows button {
  display: block !important;
  width: 100%;
  margin: 0 -6px;
  padding: 2px 6px !important;
  border-radius: var(--nm-radius-sm);
  color: var(--nm-accent) !important;
  text-align: left;
}
.d-rows button:hover {
  background: var(--nm-hover) !important;
}
.d-outline li {
  padding-left: calc(var(--l) * 10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.d-empty {
  color: var(--nm-text-faint);
  font-size: 12px;
}

/* Graph */
.d-window .d-graph-svg {
  display: block;
  width: 100%;
  height: auto;
}
.d-graph-svg line {
  stroke: var(--nm-border-strong);
  stroke-width: 1;
}
.d-graph-svg line.on {
  stroke: var(--nm-accent);
  stroke-width: 1.4;
}
.d-graph-svg .node circle {
  fill: var(--nm-surface);
  stroke: var(--nm-text-faint);
  stroke-width: 1.5;
}
.d-graph-svg .node.near circle {
  fill: var(--nm-text-muted);
  stroke: var(--nm-text-muted);
}
.d-graph-svg .node.active circle {
  fill: var(--nm-accent);
  stroke: var(--nm-accent);
}
.d-graph-svg .node.missing circle {
  fill: var(--nm-surface);
  stroke-dasharray: 2 2;
}
.d-graph-svg .node.file circle {
  fill: var(--nm-surface);
}
.d-graph-svg .node text {
  fill: var(--nm-text-muted);
  font: 11px var(--nm-font-sans);
}
.d-graph-svg .node.active text {
  fill: var(--nm-text);
  font-weight: 600;
}
.d-graph-svg .node.far text {
  fill: var(--nm-text-faint);
}
.d-graph-svg .node[role='button'] {
  cursor: pointer;
  outline: none;
}
.d-graph-svg .node[role='button']:hover circle,
.d-graph-svg .node[role='button']:focus-visible circle {
  stroke: var(--nm-accent);
  stroke-width: 3;
}
.d-graphview {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
}
.d-graphview .d-graph-svg {
  max-width: 560px;
}
.d-graphview .d-graph-svg .node text {
  font-size: 12px;
}
.d-legend {
  display: flex;
  gap: 16px;
  font: 11px var(--nm-font-mono);
  color: var(--nm-text-faint);
}
.d-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--nm-text-faint);
}
.d-legend .a {
  background: var(--nm-accent);
  border-color: var(--nm-accent);
}
.d-legend .m {
  border-style: dashed;
}

/* Status bar */
.d-status {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 28px;
  padding: 0 12px;
  border-top: 1px solid var(--nm-border);
  background: var(--nm-surface-2);
  font: 500 10.5px/1 var(--nm-font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nm-text-faint);
}
.d-ok::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--nm-success);
  vertical-align: 1px;
}
.d-status-r {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
}

/* Overlays: palette, search, slash, publish */
.d-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 64px;
  background: color-mix(in srgb, var(--nm-bg) 55%, transparent);
  animation: d-fade 0.14s ease;
}
.d-layer[hidden] {
  display: none;
}
@keyframes d-fade {
  from {
    opacity: 0;
  }
}
.d-pop {
  width: min(520px, calc(100% - 32px));
  overflow: hidden;
  background: var(--nm-surface);
  border: 1px solid var(--nm-border-strong);
  border-radius: var(--nm-radius-lg);
  box-shadow: var(--nm-shadow-lg);
  animation: d-rise 0.18s var(--nm-ease);
}
@keyframes d-rise {
  from {
    transform: translateY(-6px) scale(0.99);
    opacity: 0;
  }
}
.d-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--nm-border);
}
.d-input svg {
  width: 16px;
  height: 16px;
  color: var(--nm-text-faint);
}
.d-input input {
  flex: 1;
  height: 46px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--nm-text);
  font: 15px var(--nm-font-sans);
}
.d-input input::placeholder {
  color: var(--nm-text-faint);
}
.d-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--nm-border);
}
.d-filters button {
  height: 22px;
  padding: 0 8px !important;
  border: 1px solid var(--nm-border) !important;
  border-radius: var(--nm-radius-sm);
  color: var(--nm-text-muted) !important;
  font: 11px var(--nm-font-mono) !important;
}
.d-filters button[aria-pressed='true'] {
  border-color: var(--nm-accent-line) !important;
  color: var(--nm-accent) !important;
  background: var(--nm-accent-subtle) !important;
}
.d-list {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
}
.d-list .grp {
  padding: 8px 10px 4px;
  font: 500 10.5px var(--nm-font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nm-text-faint);
}
.d-opt {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px !important;
  border-radius: var(--nm-radius-md);
  text-align: left;
}
.d-opt[aria-selected='true'] {
  background: var(--nm-active) !important;
}
.d-opt .t {
  flex: 1;
  min-width: 0;
}
.d-opt .t small {
  display: block;
  color: var(--nm-text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.d-opt .t small mark {
  background: var(--nm-accent-subtle);
  color: var(--nm-accent);
  border-radius: 2px;
}
.d-opt .k {
  display: flex;
  gap: 3px;
}
.d-opt .hint {
  font: 11px var(--nm-font-mono);
  color: var(--nm-text-faint);
}
.d-opt kbd {
  font-size: 10px;
}
.d-foot {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--nm-border);
  background: var(--nm-surface-2);
  font: 11px var(--nm-font-mono);
  color: var(--nm-text-faint);
}
.d-slash {
  position: absolute;
  z-index: 6;
  width: 260px;
  overflow: hidden;
  background: var(--nm-surface);
  border: 1px solid var(--nm-border-strong);
  border-radius: var(--nm-radius-md);
  box-shadow: var(--nm-shadow-md);
  animation: d-rise 0.14s var(--nm-ease);
}
.d-slash .d-input input {
  height: 34px;
  font-size: 13px;
  font-family: var(--nm-font-mono);
}
.d-slash .d-list {
  max-height: 236px;
  padding: 4px;
}
.d-slash .d-opt {
  min-height: 28px;
  padding: 3px 8px !important;
}

/* Publish */
.d-publish {
  padding: 18px;
}
.d-publish h3 {
  font-size: 15px;
}
.d-publish p {
  color: var(--nm-text-muted);
  font-size: 12.5px;
  margin-top: 4px;
}
.d-publish ul {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  border: 1px solid var(--nm-border);
  border-radius: var(--nm-radius-md);
}
.d-publish li {
  display: flex;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid var(--nm-border);
  font-size: 12.5px;
}
.d-publish li:last-child {
  border-bottom: 0;
}
.d-publish li span {
  font-family: var(--nm-font-mono);
  color: var(--nm-text-faint);
  font-size: 11.5px;
}
.d-publish .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.d-publish .row .mono {
  color: var(--nm-text-faint);
  font-size: 11.5px;
}
.d-publish .btn {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}
.d-log {
  margin: 14px 0 0;
  padding: 12px 14px;
  min-height: 132px;
  border-radius: var(--nm-radius-md);
  background: var(--nm-bg-sunken);
  font: 12px/1.7 var(--nm-font-mono);
  white-space: pre-wrap;
  color: var(--nm-text-muted);
}
.d-log b {
  color: var(--nm-success);
  font-weight: 500;
}
.d-log i {
  color: var(--nm-text);
  font-style: normal;
}

/* Controls under the window */
.d-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
}
.d-controls button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--nm-border);
  border-radius: var(--nm-radius-md);
  background: var(--nm-surface);
  color: var(--nm-text-muted);
  font: 500 12.5px var(--nm-font-sans);
  cursor: pointer;
}
.d-controls button:hover,
.d-controls button[aria-pressed='true'] {
  border-color: var(--nm-border-strong);
  color: var(--nm-text);
}
.d-controls kbd {
  font-size: 10.5px;
}
.d-caption {
  margin-top: 10px;
  text-align: center;
  font: 12px var(--nm-font-mono);
  color: var(--nm-text-faint);
}

/* Smaller screens: one pane, the note. */
@media (max-width: 980px) {
  .d-body {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  .d-right {
    display: none;
  }
}
@media (max-width: 640px) {
  .d-window {
    height: 470px;
    font-size: 12.5px;
  }
  .d-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .d-side {
    display: none;
  }
  .d-kbar span {
    display: none;
  }
  .d-crumb .faint {
    display: none;
  }
  .d-doc {
    padding: 18px 18px 32px;
    font-size: 13.5px;
  }
  .d-status span:nth-child(3) {
    display: none;
  }
  .d-controls [data-wide] {
    display: none;
  }
  .d-layer {
    padding-top: 44px;
  }
}
