@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;600;700&display=swap");

/* Namaste Nepali — motyw aplikacji.
 *
 * Noto Sans Devanagari (import wyżej — `@import` MUSI stać przed każdą regułą)
 * składa nepalskie pismo. Znak marki to pliki w `public/brand/` (źródła
 * i skrypt budujący: `design/logo/`), patrz `.bm-logo` niżej.
 *
 * Serwowany przez platformę jako `/theme.css` (poza pipeline'em Tailwinda —
 * `@theme inline` z tokenami shadcn dokłada CLI). Tu żyją WYŁĄCZNIE wartości
 * zmiennych + kilka klas pomocniczych; klasy `bg-primary`, `text-foreground`
 * itd. działają, bo poniższe `:root`/`.dark` wypełniają tokeny platformy.
 *
 * Kolor przewodni to granat z flagi Nepalu i logo (#003893 = oklch(0.375
 * 0.159 261)); tła i neutralne powierzchnie mają lekki odcień tego granatu
 * (hue 261). Zieleń zostaje tylko tam, gdzie coś znaczy: "dobrze" i kolor
 * lekcji `green`.
 */

/* Bazowy CSS React Flow (@xyflow/react) — WYMAGANY do pan/zoom/drag na kanwie
   diagramu (@bm/graph). Import `dist/style.css` w .tsx jest pomijany przez
   bundler platformy, a @import pakietowy nie jest resolvowany w trybie dev —
   dlatego arkusz jest wklejony wprost. Aktualizować przy bumpie @xyflow. */
/* --- @xyflow/react/dist/style.css (inline) --- */
/* this gets exported as style.css and can be used for the default theming */
/* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */
.react-flow {
  direction: ltr;

  --xy-edge-stroke-default: #b1b1b7;
  --xy-edge-stroke-width-default: 1;
  --xy-edge-stroke-selected-default: #555;

  --xy-connectionline-stroke-default: #b1b1b7;
  --xy-connectionline-stroke-width-default: 1;

  --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);

  --xy-minimap-background-color-default: #fff;
  --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);
  --xy-minimap-mask-stroke-color-default: transparent;
  --xy-minimap-mask-stroke-width-default: 1;
  --xy-minimap-node-background-color-default: #e2e2e2;
  --xy-minimap-node-stroke-color-default: transparent;
  --xy-minimap-node-stroke-width-default: 2;

  --xy-background-color-default: transparent;
  --xy-background-pattern-dots-color-default: #91919a;
  --xy-background-pattern-lines-color-default: #eee;
  --xy-background-pattern-cross-color-default: #e2e2e2;
  background-color: var(--xy-background-color, var(--xy-background-color-default));
  --xy-node-color-default: inherit;
  --xy-node-border-default: 1px solid #1a192b;
  --xy-node-background-color-default: #fff;
  --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
  --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
  --xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b;
  --xy-node-border-radius-default: 3px;

  --xy-handle-background-color-default: #1a192b;
  --xy-handle-border-color-default: #fff;

  --xy-selection-background-color-default: rgba(0, 89, 220, 0.08);
  --xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8);

  --xy-controls-button-background-color-default: #fefefe;
  --xy-controls-button-background-color-hover-default: #f4f4f4;
  --xy-controls-button-color-default: inherit;
  --xy-controls-button-color-hover-default: inherit;
  --xy-controls-button-border-color-default: #eee;
  --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);

  --xy-edge-label-background-color-default: #ffffff;
  --xy-edge-label-color-default: inherit;
  --xy-resize-background-color-default: #3367d9;
}
.react-flow.dark {
  --xy-edge-stroke-default: #3e3e3e;
  --xy-edge-stroke-width-default: 1;
  --xy-edge-stroke-selected-default: #727272;

  --xy-connectionline-stroke-default: #b1b1b7;
  --xy-connectionline-stroke-width-default: 1;

  --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);

  --xy-minimap-background-color-default: #141414;
  --xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6);
  --xy-minimap-mask-stroke-color-default: transparent;
  --xy-minimap-mask-stroke-width-default: 1;
  --xy-minimap-node-background-color-default: #2b2b2b;
  --xy-minimap-node-stroke-color-default: transparent;
  --xy-minimap-node-stroke-width-default: 2;

  --xy-background-color-default: #141414;
  --xy-background-pattern-dots-color-default: #555;
  --xy-background-pattern-lines-color-default: #333;
  --xy-background-pattern-cross-color-default: #333;
  --xy-node-color-default: #f8f8f8;
  --xy-node-border-default: 1px solid #3c3c3c;
  --xy-node-background-color-default: #1e1e1e;
  --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
  --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08);
  --xy-node-boxshadow-selected-default: 0 0 0 0.5px #999;

  --xy-handle-background-color-default: #bebebe;
  --xy-handle-border-color-default: #1e1e1e;

  --xy-selection-background-color-default: rgba(200, 200, 220, 0.08);
  --xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8);

  --xy-controls-button-background-color-default: #2b2b2b;
  --xy-controls-button-background-color-hover-default: #3e3e3e;
  --xy-controls-button-color-default: #f8f8f8;
  --xy-controls-button-color-hover-default: #fff;
  --xy-controls-button-border-color-default: #5b5b5b;
  --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);

  --xy-edge-label-background-color-default: #141414;
  --xy-edge-label-color-default: #f8f8f8;
}
.react-flow__background {
  background-color: var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));
  pointer-events: none;
  z-index: -1;
}
.react-flow__container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.react-flow__pane {
  z-index: 1;
  touch-action: none;
}
.react-flow__pane.draggable {
    cursor: grab;
  }
.react-flow__pane.dragging {
    cursor: grabbing;
  }
.react-flow__pane.selection {
    cursor: pointer;
  }
.react-flow__viewport {
  transform-origin: 0 0;
  z-index: 2;
  pointer-events: none;
}
.react-flow__renderer {
  z-index: 4;
}
.react-flow__selection {
  z-index: 6;
}
.react-flow__nodesselection-rect:focus,
.react-flow__nodesselection-rect:focus-visible {
  outline: none;
}
.react-flow__edge-path {
  stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
  stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));
  fill: none;
}
.react-flow__connection-path {
  stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));
  stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));
  fill: none;
}
.react-flow .react-flow__edges {
  position: absolute;
}
.react-flow .react-flow__edges svg {
    overflow: visible;
    position: absolute;
    pointer-events: none;
  }
.react-flow__edge {
  pointer-events: visibleStroke;
}
.react-flow__edge.selectable {
    cursor: pointer;
  }
.react-flow__edge.animated path {
    stroke-dasharray: 5;
    animation: dashdraw 0.5s linear infinite;
  }
.react-flow__edge.animated path.react-flow__edge-interaction {
    stroke-dasharray: none;
    animation: none;
  }
.react-flow__edge.inactive {
    pointer-events: none;
  }
.react-flow__edge.selected,
  .react-flow__edge:focus,
  .react-flow__edge:focus-visible {
    outline: none;
  }
.react-flow__edge.selected .react-flow__edge-path,
  .react-flow__edge.selectable:focus .react-flow__edge-path,
  .react-flow__edge.selectable:focus-visible .react-flow__edge-path {
    stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default));
  }
.react-flow__edge-textwrapper {
    pointer-events: all;
  }
.react-flow__edge .react-flow__edge-text {
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }
/* Arrowhead marker styles - use CSS custom properties as default */
.react-flow__arrowhead polyline {
  stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
}
.react-flow__arrowhead polyline.arrowclosed {
  fill: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
}
.react-flow__connection {
  pointer-events: none;
}
.react-flow__connection .animated {
    stroke-dasharray: 5;
    animation: dashdraw 0.5s linear infinite;
  }
svg.react-flow__connectionline {
  z-index: 1001;
  overflow: visible;
  position: absolute;
}
.react-flow__nodes {
  pointer-events: none;
  transform-origin: 0 0;
}
.react-flow__node {
  position: absolute;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: all;
  transform-origin: 0 0;
  box-sizing: border-box;
  cursor: default;
}
.react-flow__node.selectable {
    cursor: pointer;
  }
.react-flow__node.draggable {
    cursor: grab;
    pointer-events: all;
  }
.react-flow__node.draggable.dragging {
      cursor: grabbing;
    }
.react-flow__nodesselection {
  z-index: 3;
  transform-origin: left top;
  pointer-events: none;
}
.react-flow__nodesselection-rect {
    position: absolute;
    pointer-events: all;
    cursor: grab;
  }
.react-flow__handle {
  position: absolute;
  pointer-events: none;
  min-width: 5px;
  min-height: 5px;
  width: 6px;
  height: 6px;
  background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default));
  border: 1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));
  border-radius: 100%;
}
.react-flow__handle.connectingfrom {
    pointer-events: all;
  }
.react-flow__handle.connectionindicator {
    pointer-events: all;
    cursor: crosshair;
  }
.react-flow__handle-bottom {
    top: auto;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%);
  }
.react-flow__handle-top {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
  }
.react-flow__handle-left {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
  }
.react-flow__handle-right {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
  }
.react-flow__edgeupdater {
  cursor: move;
  pointer-events: all;
}
.react-flow__pane.selection .react-flow__panel {
  pointer-events: none;
}
.react-flow__panel {
  position: absolute;
  z-index: 5;
  margin: 15px;
}
.react-flow__panel.top {
    top: 0;
  }
.react-flow__panel.bottom {
    bottom: 0;
  }
.react-flow__panel.top.center, .react-flow__panel.bottom.center {
      left: 50%;
      transform: translateX(-15px) translateX(-50%);
    }
.react-flow__panel.left {
    left: 0;
  }
.react-flow__panel.right {
    right: 0;
  }
.react-flow__panel.left.center, .react-flow__panel.right.center {
      top: 50%;
      transform: translateY(-15px) translateY(-50%);
    }
.react-flow__attribution {
  font-size: 10px;
  background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));
  padding: 2px 3px;
  margin: 0;
}
.react-flow__attribution a {
    text-decoration: none;
    color: #999;
  }
@keyframes dashdraw {
  from {
    stroke-dashoffset: 10;
  }
}
.react-flow__edgelabel-renderer {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  left: 0;
  top: 0;
}
.react-flow__viewport-portal {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.react-flow__minimap {
  background: var(
    --xy-minimap-background-color-props,
    var(--xy-minimap-background-color, var(--xy-minimap-background-color-default))
  );
}
.react-flow__minimap-svg {
    display: block;
  }
.react-flow__minimap-mask {
    fill: var(
      --xy-minimap-mask-background-color-props,
      var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default))
    );
    stroke: var(
      --xy-minimap-mask-stroke-color-props,
      var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default))
    );
    stroke-width: var(
      --xy-minimap-mask-stroke-width-props,
      var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default))
    );
  }
.react-flow__minimap-node {
    fill: var(
      --xy-minimap-node-background-color-props,
      var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default))
    );
    stroke: var(
      --xy-minimap-node-stroke-color-props,
      var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default))
    );
    stroke-width: var(
      --xy-minimap-node-stroke-width-props,
      var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default))
    );
  }
.react-flow__background-pattern.dots {
    fill: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default))
    );
  }
.react-flow__background-pattern.lines {
    stroke: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default))
    );
  }
.react-flow__background-pattern.cross {
    stroke: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default))
    );
  }
.react-flow__controls {
  display: flex;
  flex-direction: column;
  box-shadow: var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default));
}
.react-flow__controls.horizontal {
    flex-direction: row;
  }
.react-flow__controls-button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 26px;
    width: 26px;
    padding: 4px;
    border: none;
    background: var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));
    border-bottom: 1px solid
      var(
        --xy-controls-button-border-color-props,
        var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))
      );
    color: var(
      --xy-controls-button-color-props,
      var(--xy-controls-button-color, var(--xy-controls-button-color-default))
    );
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }
.react-flow__controls-button svg {
      width: 100%;
      max-width: 12px;
      max-height: 12px;
      fill: currentColor;
    }
.react-flow__edge.updating .react-flow__edge-path {
      stroke: #777;
    }
.react-flow__edge-text {
    font-size: 10px;
  }
.react-flow__node.selectable:focus,
  .react-flow__node.selectable:focus-visible {
    outline: none;
  }
.react-flow__node-input,
.react-flow__node-default,
.react-flow__node-output,
.react-flow__node-group {
  padding: 10px;
  border-radius: var(--xy-node-border-radius, var(--xy-node-border-radius-default));
  width: 150px;
  font-size: 12px;
  color: var(--xy-node-color, var(--xy-node-color-default));
  text-align: center;
  border: var(--xy-node-border, var(--xy-node-border-default));
  background-color: var(--xy-node-background-color, var(--xy-node-background-color-default));
}
.react-flow__node-input.selectable:hover, .react-flow__node-default.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover {
      box-shadow: var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default));
    }
.react-flow__node-input.selectable.selected,
    .react-flow__node-input.selectable:focus,
    .react-flow__node-input.selectable:focus-visible,
    .react-flow__node-default.selectable.selected,
    .react-flow__node-default.selectable:focus,
    .react-flow__node-default.selectable:focus-visible,
    .react-flow__node-output.selectable.selected,
    .react-flow__node-output.selectable:focus,
    .react-flow__node-output.selectable:focus-visible,
    .react-flow__node-group.selectable.selected,
    .react-flow__node-group.selectable:focus,
    .react-flow__node-group.selectable:focus-visible {
      box-shadow: var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default));
    }
.react-flow__node-group {
  background-color: var(--xy-node-group-background-color, var(--xy-node-group-background-color-default));
}
.react-flow__nodesselection-rect,
.react-flow__selection {
  background: var(--xy-selection-background-color, var(--xy-selection-background-color-default));
  border: var(--xy-selection-border, var(--xy-selection-border-default));
}
.react-flow__nodesselection-rect:focus,
  .react-flow__nodesselection-rect:focus-visible,
  .react-flow__selection:focus,
  .react-flow__selection:focus-visible {
    outline: none;
  }
.react-flow__controls-button:hover {
      background: var(
        --xy-controls-button-background-color-hover-props,
        var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default))
      );
      color: var(
        --xy-controls-button-color-hover-props,
        var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default))
      );
    }
.react-flow__controls-button:disabled {
      pointer-events: none;
    }
.react-flow__controls-button:disabled svg {
        fill-opacity: 0.4;
      }
.react-flow__controls-button:last-child {
    border-bottom: none;
  }
.react-flow__controls.horizontal .react-flow__controls-button {
    border-bottom: none;
    border-right: 1px solid
      var(
        --xy-controls-button-border-color-props,
        var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))
      );
  }
.react-flow__controls.horizontal .react-flow__controls-button:last-child {
    border-right: none;
  }
.react-flow__resize-control {
  position: absolute;
}
.react-flow__resize-control.left,
.react-flow__resize-control.right {
  cursor: ew-resize;
}
.react-flow__resize-control.top,
.react-flow__resize-control.bottom {
  cursor: ns-resize;
}
.react-flow__resize-control.top.left,
.react-flow__resize-control.bottom.right {
  cursor: nwse-resize;
}
.react-flow__resize-control.bottom.left,
.react-flow__resize-control.top.right {
  cursor: nesw-resize;
}
/* handle styles */
.react-flow__resize-control.handle {
  width: 5px;
  height: 5px;
  border: 1px solid #fff;
  border-radius: 1px;
  background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));
  translate: -50% -50%;
}
.react-flow__resize-control.handle.left {
  left: 0;
  top: 50%;
}
.react-flow__resize-control.handle.right {
  left: 100%;
  top: 50%;
}
.react-flow__resize-control.handle.top {
  left: 50%;
  top: 0;
}
.react-flow__resize-control.handle.bottom {
  left: 50%;
  top: 100%;
}
.react-flow__resize-control.handle.top.left {
  left: 0;
}
.react-flow__resize-control.handle.bottom.left {
  left: 0;
}
.react-flow__resize-control.handle.top.right {
  left: 100%;
}
.react-flow__resize-control.handle.bottom.right {
  left: 100%;
}
/* line styles */
.react-flow__resize-control.line {
  border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));
  border-width: 0;
  border-style: solid;
}
.react-flow__resize-control.line.left,
.react-flow__resize-control.line.right {
  width: 1px;
  transform: translate(-50%, 0);
  top: 0;
  height: 100%;
}
.react-flow__resize-control.line.left {
  left: 0;
  border-left-width: 1px;
}
.react-flow__resize-control.line.right {
  left: 100%;
  border-right-width: 1px;
}
.react-flow__resize-control.line.top,
.react-flow__resize-control.line.bottom {
  height: 1px;
  transform: translate(0, -50%);
  left: 0;
  width: 100%;
}
.react-flow__resize-control.line.top {
  top: 0;
  border-top-width: 1px;
}
.react-flow__resize-control.line.bottom {
  border-bottom-width: 1px;
  top: 100%;
}
.react-flow__edge-textbg {
  fill: var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default));
}
.react-flow__edge-text {
  fill: var(--xy-edge-label-color, var(--xy-edge-label-color-default));
}
/* --- /xyflow --- */

:root {
  --radius: 0.75rem;

  /* Akcenty marki — używane przez `var(--nepal-*)` w komponentach i node'ach
     diagramu (Tailwind nie generuje dla nich utilities, patrz nagłówek). */
  --nepal-blue: oklch(0.375 0.159 261);
  --nepal-blue-light: oklch(0.93 0.035 261);
  --nepal-blue-lighter: oklch(0.96 0.02 261);
  --nepal-accent: oklch(0.45 0.16 261);
  --nepal-muted: oklch(0.55 0.06 261);
  --nepal-surface: oklch(1 0 0 / 70%);

  /* Akcenty node'ów diagramu kart (rola karty w module). */
  --card-entry: oklch(0.55 0.15 155);
  --card-normal: oklch(0.6 0.05 155);
  --card-terminal: oklch(0.6 0.1 60);
  --card-crossing: oklch(0.55 0.12 265);
  --card-orphan: oklch(0.65 0.18 40);
  --card-missing: oklch(0.6 0.22 25);

  --background: oklch(0.98 0.005 261);
  --foreground: oklch(0.2 0.03 261);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.2 0.03 261);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.2 0.03 261);
  --primary: oklch(0.375 0.159 261);
  --primary-foreground: oklch(0.98 0.005 261);
  --secondary: oklch(0.94 0.02 261);
  --secondary-foreground: oklch(0.3 0.05 261);
  --muted: oklch(0.94 0.02 261);
  --muted-foreground: oklch(0.5 0.04 261);
  --accent: oklch(0.94 0.03 261);
  --accent-foreground: oklch(0.3 0.05 261);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.98 0.005 261);
  --border: oklch(0.88 0.02 261);
  --input: oklch(0.88 0.02 261);
  --ring: oklch(0.375 0.159 261);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.96 0.01 261);
  --sidebar-foreground: oklch(0.2 0.03 261);
  --sidebar-primary: oklch(0.375 0.159 261);
  --sidebar-primary-foreground: oklch(0.98 0.005 261);
  --sidebar-accent: oklch(0.94 0.02 261);
  --sidebar-accent-foreground: oklch(0.3 0.05 261);
  --sidebar-border: oklch(0.88 0.02 261);
  --sidebar-ring: oklch(0.375 0.159 261);
}

.dark {
  --nepal-blue: oklch(0.72 0.12 261);
  --nepal-blue-light: oklch(0.25 0.04 261);
  --nepal-blue-lighter: oklch(0.18 0.03 261);
  --nepal-accent: oklch(0.65 0.13 261);
  --nepal-muted: oklch(0.6 0.06 261);
  --nepal-surface: oklch(0.2 0.02 261 / 70%);

  --card-entry: oklch(0.75 0.14 155);
  --card-normal: oklch(0.62 0.05 155);
  --card-terminal: oklch(0.75 0.12 60);
  --card-crossing: oklch(0.7 0.12 265);
  --card-orphan: oklch(0.75 0.16 40);
  --card-missing: oklch(0.7 0.2 25);

  --background: oklch(0.14 0.015 261);
  --foreground: oklch(0.92 0.01 261);
  --card: oklch(0.18 0.02 261);
  --card-foreground: oklch(0.92 0.01 261);
  --popover: oklch(0.18 0.02 261);
  --popover-foreground: oklch(0.92 0.01 261);
  --primary: oklch(0.72 0.12 261);
  --primary-foreground: oklch(0.14 0.015 261);
  --secondary: oklch(0.22 0.025 261);
  --secondary-foreground: oklch(0.85 0.02 261);
  --muted: oklch(0.22 0.025 261);
  --muted-foreground: oklch(0.6 0.03 261);
  --accent: oklch(0.22 0.03 261);
  --accent-foreground: oklch(0.85 0.02 261);
  --destructive: oklch(0.704 0.191 22.216);
  --destructive-foreground: oklch(0.14 0.015 261);
  --border: oklch(0.28 0.025 261);
  --input: oklch(0.28 0.025 261);
  --ring: oklch(0.72 0.12 261);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.18 0.02 261);
  --sidebar-foreground: oklch(0.92 0.01 261);
  --sidebar-primary: oklch(0.72 0.12 261);
  --sidebar-primary-foreground: oklch(0.14 0.015 261);
  --sidebar-accent: oklch(0.22 0.025 261);
  --sidebar-accent-foreground: oklch(0.85 0.02 261);
  --sidebar-border: oklch(0.28 0.025 261);
  --sidebar-ring: oklch(0.72 0.12 261);
}

/* Mrożone szkło paneli — odpowiednik `bg-nepal-surface` z aplikacji Vite,
   której utility Tailwind już nie ma (patrz nagłówek pliku). */
.nepal-surface {
  background: var(--nepal-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in oklch, var(--nepal-blue) 12%, transparent);
}

/* Znak marki — pliki z `public/brand/` jako tło, żeby jedna klasa sama
   przełączała wersję jasną i ciemną. Element dostaje wysokość (`h-12`), a
   szerokość wynika z proporcji pliku. `.bm-logo` to logo poziome (znak +
   „Namaste Nepali” + „by 8mountains”), `.bm-wordmark` sam napis w dwóch
   liniach, `.bm-wordmark-centred` to samo z „by 8mountains” na środku,
   `.bm-symbol` sam znak.

   „by 8Mountains” prowadzi do strony 8Mountains: `<a className="bm-byline">`
   wewnątrz `.bm-logo`/`.bm-wordmark` leży dokładnie na tej linijce napisu.
   Proporcje i położenie wypisuje `design/logo/build-brand.ts` — po zmianie
   napisu przepisz je stamtąd. */
.bm-logo,
.bm-wordmark,
.bm-wordmark-centred,
.bm-symbol {
  position: relative;
  display: inline-block;
  flex: none;
  background: no-repeat center / contain;
}
.bm-logo {
  aspect-ratio: 637 / 138;
  background-image: url("/brand/logo.svg");
}
.dark .bm-logo {
  background-image: url("/brand/logo-dark.svg");
}
.bm-wordmark {
  aspect-ratio: 502 / 99;
  background-image: url("/brand/wordmark.svg");
}
.dark .bm-wordmark {
  background-image: url("/brand/wordmark-dark.svg");
}
/* The same two lines, "by 8mountains" centred under the name (sign-in). */
.bm-wordmark-centred {
  aspect-ratio: 499 / 99;
  background-image: url("/brand/wordmark-centred.svg");
}
.dark .bm-wordmark-centred {
  background-image: url("/brand/wordmark-centred-dark.svg");
}
.bm-byline {
  position: absolute;
  z-index: 1;
  border-radius: 6px;
}
/* The line is ~14 px tall in the bar: a bigger, invisible tap area. */
.bm-byline::after {
  content: "";
  position: absolute;
  inset: -8px -6px;
}
.bm-byline:hover {
  background: color-mix(in oklch, var(--bm-brand-red) 10%, transparent);
}
.bm-byline:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
.bm-logo > .bm-byline { left: 21.01%; top: 60.37%; width: 36.53%; height: 28.73%; }
.bm-wordmark > .bm-byline { left: -0.23%; top: 61.94%; width: 46.36%; height: 40.05%; }
.bm-wordmark-centred > .bm-byline { left: 26.73%; top: 61.94%; width: 46.63%; height: 40.05%; }
.bm-symbol {
  aspect-ratio: 1;
  background-image: url("/brand/symbol.svg");
}

/* ===========================================================================
 * Learner app (@bm/learn) — lesson accents and the "chunky" look.
 *
 * Every lesson has a `color` token (green, blue, purple, orange, red, yellow).
 * Each one has four shades:
 *   --lesson-X        the fill of a button, a node, a progress bar
 *   --lesson-X-shade  the darker bottom edge under the fill (the "press" depth)
 *   --lesson-X-soft   a tinted surface (a card, a chip, a bubble)
 *   --lesson-X-ink    text on the soft surface
 * Components never name a colour: they set `--lc*` on a parent (see
 * `accentStyle` in @bm/learn) and the classes below read those.
 * ======================================================================== */

:root {
  --lesson-green: oklch(0.72 0.19 145);
  --lesson-green-shade: oklch(0.58 0.17 145);
  --lesson-green-soft: oklch(0.95 0.05 145);
  --lesson-green-ink: oklch(0.38 0.11 145);

  --lesson-blue: oklch(0.7 0.15 235);
  --lesson-blue-shade: oklch(0.56 0.15 240);
  --lesson-blue-soft: oklch(0.95 0.035 235);
  --lesson-blue-ink: oklch(0.4 0.12 245);

  --lesson-purple: oklch(0.66 0.18 300);
  --lesson-purple-shade: oklch(0.52 0.18 300);
  --lesson-purple-soft: oklch(0.95 0.035 300);
  --lesson-purple-ink: oklch(0.42 0.16 300);

  --lesson-orange: oklch(0.76 0.16 60);
  --lesson-orange-shade: oklch(0.62 0.16 50);
  --lesson-orange-soft: oklch(0.96 0.04 70);
  --lesson-orange-ink: oklch(0.45 0.12 50);

  --lesson-red: oklch(0.67 0.2 25);
  --lesson-red-shade: oklch(0.54 0.19 25);
  --lesson-red-soft: oklch(0.95 0.035 25);
  --lesson-red-ink: oklch(0.45 0.16 25);

  --lesson-yellow: oklch(0.85 0.16 90);
  --lesson-yellow-shade: oklch(0.72 0.15 80);
  --lesson-yellow-soft: oklch(0.97 0.05 95);
  --lesson-yellow-ink: oklch(0.45 0.1 75);

  /* The brand's own "chunky" accent (the logo's navy): buttons and progress
     bars outside a lesson, where no `--lc` is set. */
  --bm-brand: oklch(0.45 0.16 261);
  --bm-brand-shade: oklch(0.33 0.14 261);
  --bm-brand-soft: oklch(0.95 0.03 261);
  --bm-brand-ink: oklch(0.38 0.15 261);
  /* Its crimson (#DC143C), for the warm lessons on the path. */
  --bm-brand-red: oklch(0.571 0.222 20);
  --bm-brand-red-shade: oklch(0.45 0.19 20);
  --bm-brand-red-soft: oklch(0.95 0.03 20);
  --bm-brand-red-ink: oklch(0.45 0.19 20);

  /* @arc/ds reads its own brand tokens (the "gradient" button, kickers) and
     the "info" tone; left alone they keep the framework's blue and violet. */
  --brand-1: oklch(0.5 0.17 261);
  --brand-2: #003893;
  --tone-info: #003893;
  --tone-info-bg: color-mix(in srgb, #003893 10%, transparent);
  --tone-info-border: color-mix(in srgb, #003893 30%, transparent);
  --hue-blue: #003893;
  --hue-blue-fill: color-mix(in srgb, #003893 12%, transparent);

  /* Neutral "chunky" surfaces: a card, a locked node, a secondary button. */
  --bm-surface: oklch(1 0 0);
  --bm-edge: oklch(0.89 0.01 261);
  --bm-edge-strong: oklch(0.82 0.015 261);
  --bm-locked: oklch(0.9 0.008 261);
  --bm-locked-ink: oklch(0.6 0.01 261);

  /* Answer feedback — the bar that slides up after "Check". */
  --bm-correct: oklch(0.72 0.19 145);
  --bm-correct-shade: oklch(0.58 0.17 145);
  --bm-correct-soft: oklch(0.93 0.07 145);
  --bm-correct-ink: oklch(0.42 0.12 145);
  --bm-wrong: oklch(0.67 0.2 25);
  --bm-wrong-shade: oklch(0.54 0.19 25);
  --bm-wrong-soft: oklch(0.94 0.045 25);
  --bm-wrong-ink: oklch(0.48 0.17 25);

  /* Today's points pill. */
  --bm-points: oklch(0.8 0.16 75);
  --bm-points-ink: oklch(0.5 0.13 60);

  /* A step done without the alphabet (roman mode) — striped amber. */
  --bm-partial: oklch(0.82 0.13 70);
  --bm-partial-shade: oklch(0.66 0.13 58);
  --bm-partial-soft: oklch(0.96 0.045 82);
  --bm-partial-ink: oklch(0.47 0.11 58);

  --bm-tabbar-h: 4.25rem;
}

.dark {
  --lesson-green: oklch(0.7 0.17 145);
  --lesson-green-shade: oklch(0.5 0.14 145);
  --lesson-green-soft: oklch(0.28 0.05 145);
  --lesson-green-ink: oklch(0.85 0.12 145);

  --lesson-blue: oklch(0.68 0.14 235);
  --lesson-blue-shade: oklch(0.5 0.13 240);
  --lesson-blue-soft: oklch(0.28 0.05 240);
  --lesson-blue-ink: oklch(0.85 0.09 235);

  --lesson-purple: oklch(0.65 0.16 300);
  --lesson-purple-shade: oklch(0.48 0.15 300);
  --lesson-purple-soft: oklch(0.28 0.05 300);
  --lesson-purple-ink: oklch(0.85 0.09 300);

  --lesson-orange: oklch(0.74 0.15 60);
  --lesson-orange-shade: oklch(0.55 0.14 50);
  --lesson-orange-soft: oklch(0.3 0.05 60);
  --lesson-orange-ink: oklch(0.87 0.1 70);

  --lesson-red: oklch(0.65 0.18 25);
  --lesson-red-shade: oklch(0.48 0.16 25);
  --lesson-red-soft: oklch(0.28 0.05 25);
  --lesson-red-ink: oklch(0.85 0.09 25);

  --lesson-yellow: oklch(0.82 0.15 90);
  --lesson-yellow-shade: oklch(0.62 0.13 80);
  --lesson-yellow-soft: oklch(0.3 0.05 90);
  --lesson-yellow-ink: oklch(0.9 0.1 95);

  --bm-brand: oklch(0.62 0.15 261);
  --bm-brand-shade: oklch(0.45 0.14 261);
  --bm-brand-soft: oklch(0.27 0.05 261);
  --bm-brand-ink: oklch(0.85 0.08 261);
  --bm-brand-red: oklch(0.63 0.2 20);
  --bm-brand-red-shade: oklch(0.47 0.18 20);
  --bm-brand-red-soft: oklch(0.27 0.06 20);
  --bm-brand-red-ink: oklch(0.86 0.08 20);

  --brand-1: oklch(0.64 0.15 261);
  --brand-2: oklch(0.5 0.16 261);
  --tone-info: oklch(0.75 0.11 261);
  --tone-info-bg: color-mix(in oklch, oklch(0.75 0.11 261) 15%, transparent);
  --tone-info-border: color-mix(in oklch, oklch(0.75 0.11 261) 36%, transparent);
  --hue-blue: oklch(0.75 0.11 261);
  --hue-blue-fill: color-mix(in oklch, oklch(0.75 0.11 261) 18%, transparent);

  --bm-surface: oklch(0.2 0.02 261);
  --bm-edge: oklch(0.3 0.02 261);
  --bm-edge-strong: oklch(0.36 0.02 261);
  --bm-locked: oklch(0.27 0.015 261);
  --bm-locked-ink: oklch(0.55 0.015 261);

  --bm-correct: oklch(0.7 0.17 145);
  --bm-correct-shade: oklch(0.5 0.14 145);
  --bm-correct-soft: oklch(0.27 0.06 145);
  --bm-correct-ink: oklch(0.85 0.13 145);
  --bm-wrong: oklch(0.65 0.18 25);
  --bm-wrong-shade: oklch(0.48 0.16 25);
  --bm-wrong-soft: oklch(0.27 0.06 25);
  --bm-wrong-ink: oklch(0.85 0.1 25);

  --bm-points: oklch(0.8 0.15 75);
  --bm-points-ink: oklch(0.85 0.13 75);

  --bm-partial: oklch(0.74 0.12 70);
  --bm-partial-shade: oklch(0.54 0.11 58);
  --bm-partial-soft: oklch(0.3 0.05 75);
  --bm-partial-ink: oklch(0.88 0.1 80);
}

/* A pressable "chunky" button: a coloured fill on a darker bottom edge that
   sinks when pressed. The colours come from `--press-fill`/`--press-shade`
   (an accent) or fall back to the neutral surface. */
.bm-press {
  --press-fill: var(--bm-surface);
  --press-shade: var(--bm-edge-strong);
  --press-ink: var(--foreground);
  --press-depth: 4px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  border: 2px solid var(--press-shade);
  background: var(--press-fill);
  color: var(--press-ink);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 var(--press-depth) 0 var(--press-shade);
  margin-bottom: var(--press-depth);
  transition:
    transform 80ms ease-out,
    box-shadow 80ms ease-out,
    filter 120ms ease-out;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.bm-press:hover:not(:disabled) {
  filter: brightness(1.04);
}
.bm-press:active:not(:disabled),
.bm-press[data-pressed="true"] {
  transform: translateY(var(--press-depth));
  box-shadow: 0 0 0 var(--press-shade);
}
.bm-press:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.bm-press[data-tone="accent"] {
  --press-fill: var(--lc, var(--bm-brand));
  --press-shade: var(--lc-shade, var(--bm-brand-shade));
  --press-ink: oklch(1 0 0);
}
.bm-press[data-tone="correct"] {
  --press-fill: var(--bm-correct);
  --press-shade: var(--bm-correct-shade);
  --press-ink: oklch(1 0 0);
}
.bm-press[data-tone="wrong"] {
  --press-fill: var(--bm-wrong);
  --press-shade: var(--bm-wrong-shade);
  --press-ink: oklch(1 0 0);
}
.bm-press[data-tone="soft"] {
  --press-fill: var(--lc-soft, var(--bm-brand-soft));
  --press-shade: var(--lc, var(--bm-brand));
  --press-ink: var(--lc-ink, var(--bm-brand-ink));
}
/* Done without the alphabet: amber with diagonal stripes, so it never reads
   as a lesson's own colour. */
.bm-press[data-tone="partial"] {
  --press-fill: var(--bm-partial);
  --press-shade: var(--bm-partial-shade);
  --press-ink: oklch(1 0 0);
  background-image: repeating-linear-gradient(
    135deg,
    oklch(1 0 0 / 0.22) 0 6px,
    transparent 6px 12px
  );
}
.bm-press[data-selected="true"] {
  --press-fill: var(--lc-soft, var(--lesson-blue-soft));
  --press-shade: var(--lc, var(--lesson-blue));
  --press-ink: var(--lc-ink, var(--lesson-blue-ink));
}
/* After the tones, so a disabled accent button still reads as disabled. */
.bm-press:disabled {
  --press-fill: var(--bm-locked);
  --press-shade: var(--bm-locked);
  --press-ink: var(--bm-locked-ink);
  cursor: not-allowed;
}
.bm-press[data-size="sm"] {
  --press-depth: 3px;
  min-height: 2.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.8rem;
  font-size: 0.875rem;
}
.bm-press[data-size="icon"] {
  --press-depth: 3px;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem;
  border-radius: 0.9rem;
}
.bm-press[data-size="xl"] {
  --press-depth: 6px;
  min-height: 4.5rem;
  min-width: 4.5rem;
  padding: 0;
  border-radius: 9999px;
  font-size: 1.75rem;
}

/* A rounded "chunky" card: neutral surface, a slightly heavier bottom edge. */
.bm-card {
  background: var(--bm-surface);
  border: 2px solid var(--bm-edge);
  border-bottom-width: 4px;
  border-radius: 1.25rem;
}
.bm-card[data-tone="partial"] {
  background: var(--bm-partial-soft);
  border-color: var(--bm-partial);
  color: var(--bm-partial-ink);
}
.bm-card[data-tone="accent"] {
  background: var(--lc-soft);
  border-color: color-mix(in oklch, var(--lc) 45%, transparent);
  color: var(--lc-ink);
}

/* The progress bar of a lesson or a round. */
.bm-progress {
  height: 1rem;
  border-radius: 9999px;
  background: var(--bm-locked);
  overflow: hidden;
}
.bm-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lc, var(--bm-brand));
  box-shadow: inset 0 -0.2rem 0 color-mix(in oklch, var(--lc-shade, var(--bm-brand-shade)) 55%, transparent);
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Devanagari reads better a little larger and with more line height. */
.bm-nepali {
  font-family: "Noto Sans Devanagari", "Mukta", "Kohinoor Devanagari", system-ui, sans-serif;
  line-height: 1.5;
}

/* Safe areas for the phone chrome. */
.bm-safe-top {
  padding-top: env(safe-area-inset-top);
}
.bm-safe-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

@media (prefers-reduced-motion: reduce) {
  .bm-press,
  .bm-progress > span {
    transition: none;
  }
}

/* The learning-mode chip in a lesson's top bar. */
.bm-script-chip {
  border-color: var(--bm-edge-strong);
  background: var(--bm-surface);
  color: var(--foreground);
}
.bm-script-chip[data-script="roman"] {
  border-color: var(--bm-partial-shade);
  background: var(--bm-partial-soft);
  color: var(--bm-partial-ink);
}

/*
 * The base stylesheet gives `body` `min-height: 100vh`. On a phone, `vh` is
 * the viewport with the browser's toolbar HIDDEN — taller than what shows
 * while the toolbar is up — so every screen scrolled by the toolbar's height
 * into empty padding. The shell fills the screen itself (`100dvh`); the body
 * only needs the dynamic height.
 */
body {
  min-height: 100dvh;
}

/*
 * The installed app on iPhone (status bar `black-translucent`,
 * `viewport-fit=cover`): iOS slides the page up under the status bar but
 * sizes its viewport one status bar SHORTER than the screen, and draws no
 * `position: fixed` content below that edge. The shell's frame and the
 * pinned tab and action bars stopped a status bar's height (~60pt) above
 * the bottom, over a band of bare page background (WebKit bugs 301108,
 * 301994). A document as tall as the screen gets the full viewport, so the
 * root grows by the top inset — capped at the large viewport, so it never
 * scrolls. An opaque status bar or a browser tab has no top inset here, and
 * nothing changes.
 */
@media (display-mode: standalone) {
  html {
    min-height: min(100lvh, calc(100% + env(safe-area-inset-top)));
  }
}

/*
 * Room under a lesson screen for its pinned action bar. `ActionBar` measures
 * itself and publishes `--bm-actionbar-h` (home indicator included), so the
 * room follows the bar — one button, two, or the answer's feedback.
 */
.bm-actionbar-space {
  padding-bottom: calc(var(--bm-actionbar-h, 0px) + 0.75rem);
}

/*
 * No rubber band on the page itself: the shell scrolls its content area,
 * and a pull on a bar must not move the whole screen (iOS, installed app).
 */
html,
body {
  overscroll-behavior: none;
}

/*
 * The platform fades every page in with tw-animate's `enter`, which animates
 * `transform` too. A transformed ancestor captures `position: fixed`
 * children, so for those 150 ms the pinned Next / Got it bar sat mid-screen
 * and then jumped down. The page wrapper (straight under the shell's main)
 * fades on opacity alone; dialogs and menus keep their own animation.
 */
main > .animate-in.fade-in {
  animation-name: bm-page-in;
}

@keyframes bm-page-in {
  from {
    opacity: 0;
  }
}
