/* Wspólne tokeny — MOSK / Lexi */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/jost-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/jost-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --text: #202124;
  --muted: #4a4f55;
  --line: #e6e8eb;
  --bg: #fff;
  --bg2: #f8f9fa;
  --accent: #0d5a87;
  --accent-soft: #e8eef3;
  --accept: #34a853;
  --accept-soft: #e7f4ea;
  --mosk-green: #0a5931;
  --mosk-ink: #2c2b2b;
  --flag: #b3261e;
  --flag-soft: #fdecea;
  --warn: #e65100;
  --warn-soft: #fff3e0;
  --drop: #1565c0;
  --drop-soft: #e3f2fd;
  --font-sans: 'Jost', Arial, sans-serif;
  /* Type scale */
  --fw-content: 600;
  --fw-action: 500;
  --fw-action-strong: 600;
  --fw-muted-ui: 400;
  --fs-title: 0.92rem;
  --fs-ui: 0.82rem;
  --fs-micro: 0.72rem;
  --fs-mini: 0.68rem;
}
html {
  width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  width: 100%;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 16px;
  background: var(--bg2);
  color: var(--text);
  line-height: 1.58;
}
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
button, input, select, textarea {
  font-family: var(--font-sans);
}
main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
.dashboard-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 2rem;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.04);
}
.countdown-banner {
  position: fixed;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 270;
  width: min(600px, calc(100vw - 2rem));
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1.5px solid #ffc107;
  background: #fff3cd;
  color: #7a5300;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 4px 16px rgba(255, 193, 7, 0.22);
  pointer-events: none;
}
.countdown-banner[hidden] {
  display: none !important;
}
.countdown-banner--urgent {
  background: #f8d7da;
  border-color: #dc3545;
  color: #6b1219;
  box-shadow: 0 4px 18px rgba(220, 53, 69, 0.22);
}
.maintenance-banner {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  z-index: 280;
  width: min(540px, calc(100vw - 2rem));
  margin: 0;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #f0b429;
  background: #fff8e1;
  color: #7a4d00;
  font-size: 0.92rem;
  line-height: 1.5;
  box-shadow: 0 16px 48px rgba(154, 106, 0, 0.22);
  pointer-events: auto;
}
body.mosk-maintenance .maintenance-banner {
  display: block;
}
.maintenance-banner__inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  text-align: center;
  max-width: none;
  margin: 0;
}
.maintenance-banner__title {
  font-weight: 700;
  font-size: 1rem;
  color: #9a6a00;
}
.maintenance-banner__detail {
  color: #7a4d00;
}
body.mosk-maintenance::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(244, 248, 251, 0.72);
  backdrop-filter: blur(2px);
  z-index: 150;
  pointer-events: auto;
  cursor: wait;
}
body.mosk-maintenance main,
body.mosk-maintenance .tree-add-modal,
body.mosk-maintenance .toast {
  pointer-events: none;
  user-select: none;
}
.dashboard-wrap--maintenance {
  opacity: 0.55;
  filter: grayscale(0.15);
}
body.mosk-maintenance .maintenance-banner,
body.mosk-maintenance .site-header {
  pointer-events: auto;
  user-select: auto;
}
.live-collab-banner {
  display: block;
  position: fixed;
  top: 4.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 190;
  max-width: min(720px, calc(100vw - 2rem));
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(239, 246, 255, 0.96);
  color: #1e3a8a;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.12);
  pointer-events: none;
}
.live-collab-banner[hidden] {
  display: none !important;
}
.live-collab-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
}
.live-collab-banner__pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
  animation: live-collab-pulse 1.8s ease-in-out infinite;
}
.live-collab-banner__entry strong {
  font-weight: 600;
}
.stale-plan-banner {
  display: block;
  position: sticky;
  top: 0;
  z-index: 180;
  margin: 0 0 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 1px solid #f0b429;
  background: #fff8e1;
  color: #7a4d00;
  font-size: 0.9rem;
}
.stale-plan-banner[hidden] {
  display: none !important;
}
.stale-plan-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.stale-plan-banner__text {
  font-weight: 600;
}
.stale-plan-banner__refresh {
  flex-shrink: 0;
}
.item-head-row,
.amount-wrap,
.item-notes-wrap,
.stage-head > div:first-child {
  position: relative;
}
.field-lock-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
  font-size: 0.72rem;
  color: #b45309;
  cursor: help;
  flex-shrink: 0;
  vertical-align: middle;
}
.field-lock-badge__icon {
  display: inline-block;
  animation: field-lock-pulse 2s ease-in-out infinite;
}
.item-notes-wrap .field-lock-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  margin-left: 0;
}
.amount-wrap .field-lock-badge {
  order: -1;
}
@keyframes live-collab-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes field-lock-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes mini-dash-live-pulse {
  0%, 100% { background: transparent; }
  50% { background: rgba(59, 130, 246, 0.08); }
}
.mini-dash-feed__item--live {
  animation: mini-dash-live-pulse 2.2s ease-in-out infinite;
  border-left: 3px solid #3b82f6;
  padding-left: 0.45rem;
  margin-left: -0.45rem;
}
.activity-item--live {
  animation: mini-dash-live-pulse 2.2s ease-in-out infinite;
  border-left: 3px solid #3b82f6;
  padding-left: 0.45rem;
}
.hint.page-intro {
  margin-bottom: 0.75rem;
  width: 100%;
  font-size: 0.95rem;
  line-height: 1.55;
  background: var(--accent-soft);
  color: var(--text);
}
.stage-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0.75rem;
}
.stage-toc a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
}
.stage-toc a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.legend-label {
  font-weight: 600;
  margin-right: 4px;
}
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg2);
}
.legend-chip.unpriced { border-color: #ffcc80; background: #fff3e0; color: #bf360c; }
.legend-chip.done { border-color: #cfe8d6; background: var(--accept-soft); color: #1b5e20; }
.legend-chip.cancelled { border-color: #dfe2e5; background: #eef0f2; color: #666; }
.legend-chip.over { border-color: #f2c7c1; background: var(--flag-soft); color: var(--flag); }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
}
.toolbar-filter-wrap,
.toolbar-actions-wrap {
  flex: 1 1 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
}
.toolbar-filter-wrap {
  margin-bottom: 0;
}
.toolbar-actions-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-bar-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
  flex: 0 0 auto;
}
.toolbar-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
h1 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.7rem); line-height: 1.2; color: var(--accent); margin: 0 0 0.6rem; }
.meta { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.75rem; }
.muted { color: var(--muted); }
.hint {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
}
.budget-alert {
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.budget-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.3;
  cursor: help;
  border: 1px solid;
  white-space: nowrap;
}
.budget-chip.budget-info {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #0d47a1;
}
.budget-chip.budget-warn {
  background: var(--warn-soft);
  border-color: #ffcc80;
  color: #bf360c;
}
.budget-chip.budget-provisional {
  background: #fff8e1;
  border-color: #ffe082;
  color: #6d4c00;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: stretch;
}
.dashboard-wrap .summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.summary-card.summary-card--wide {
  grid-column: 1 / -1;
}
.summary-card.mini-dash-card {
  padding: 0.85rem 1rem 1rem;
}
.summary-card.mini-dash-card .card-head {
  margin-bottom: 0.5rem;
}
.mini-dash {
  display: grid;
  grid-template-columns: minmax(140px, 0.85fr) minmax(0, 1.15fr);
  gap: 0.85rem 1rem;
}
.mini-dash__col--full {
  grid-column: 1 / -1;
}
.mini-dash__heading {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.mini-dash-statuses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}
.mini-dash-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.mini-dash-status:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.mini-dash-status.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(13, 90, 135, 0.12);
}
.mini-dash-status[data-status="pending"] .mini-dash-status__count { color: var(--muted); }
.mini-dash-status[data-status="in_progress"] .mini-dash-status__count { color: var(--accent); }
.mini-dash-status[data-status="done"] .mini-dash-status__count { color: var(--accept); }
.mini-dash-status[data-status="cancelled"] .mini-dash-status__count { color: var(--flag); }
.mini-dash-status__count {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.mini-dash-status__label {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.2;
}
.mini-dash-feed {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 9.5rem;
  overflow: auto;
}
.mini-dash-feed__item {
  font-size: 0.78rem;
  line-height: 1.35;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--line);
}
.mini-dash-feed__item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.mini-dash-feed__time {
  color: var(--muted);
  white-space: nowrap;
}
.mini-dash-feed__author {
  font-weight: 600;
  color: var(--accent);
}
.mini-dash-feed__text {
  color: var(--text);
}
.mini-dash-empty {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}
@media (max-width: 640px) {
  .summary-card.summary-card--wide {
    grid-column: span 1;
  }
  .mini-dash {
    grid-template-columns: 1fr;
  }
}
.summary-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}
.summary-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
/* Obracająca obwódka — wzorzec lexi .upload-zone.suggest-ready */
.mosk-glow-border {
  position: relative;
  border-color: transparent !important;
  background: transparent;
  overflow: hidden;
  z-index: 0;
}
.mosk-glow-border > * {
  position: relative;
  z-index: 1;
}
.mosk-glow-border::before {
  content: '';
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  will-change: transform;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 298deg,
    rgba(34, 197, 94, 0.1) 304deg,
    rgba(34, 197, 94, 0.28) 314deg,
    rgba(34, 197, 94, 0.48) 323deg,
    rgba(34, 197, 94, 0.62) 326deg,
    rgba(34, 197, 94, 0.48) 329deg,
    rgba(34, 197, 94, 0.28) 336deg,
    rgba(34, 197, 94, 0.1) 344deg,
    transparent 360deg
  );
  animation: mosk-glow-border-spin 4s linear infinite;
  pointer-events: none;
}
@keyframes mosk-glow-border-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.mosk-glow-border::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 1px;
  border-radius: 11px;
  background: var(--bg);
  pointer-events: none;
}
.summary-card.mosk-glow-border::after {
  border-radius: 11px;
  background: var(--bg);
}
.summary-card.savings {
  border-color: #cfe8d6;
  background: var(--accept-soft);
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #b3d4ea;
  white-space: nowrap;
}
.badge.flag { background: var(--flag-soft); color: var(--flag); border-color: #f2c7c1; }
.badge.star { background: #fff7e0; color: #8a6d00; border-color: #f0e2a8; }
.badge.vendor { background: #faf9ff; color: #7558b8; border-color: #e7e1fb; }
.badge.done { background: var(--accept-soft); color: #1b5e20; border-color: #cfe8d6; }
.summary-card .label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.summary-over-arrow {
  color: var(--flag);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.summary-card .value { font-size: 1.2rem; font-weight: 700; margin-top: 0.2rem; }
.summary-card .sub-line {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.summary-card .warn-line { font-size: 0.78rem; color: #c4682e; margin-top: 0.25rem; font-weight: 400; }
.amount-display {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}
.amount-main {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.amount-scale {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.summary-card .value.amount-display {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}
.stage-totals.amount-display strong {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
}
.stage-block.provisional-budget { border-color: #ffe082; }
.stage-block.provisional-budget .stage-head {
  background: linear-gradient(90deg, #fffde7, #fff8e1);
}
.stage-totals .provisional { color: #6d4c00; font-weight: 600; }
.stage-block {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.85rem;
  overflow: hidden;
  scroll-margin-top: 72px;
}
.stage-block--flat .stage-actions {
  padding: 0.65rem 0.75rem 0.35rem;
  border-bottom: none;
}
.stage-block--flat .items-list {
  padding-top: 0;
}
.stage-block.collapsed {
  opacity: 0.58;
  background: linear-gradient(180deg, #fff 0%, #f7f8f9 100%);
}
.stage-head h2 {
  margin: 0;
  font-size: 1rem;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
}
.stage-block.over-budget { border-color: #ffab91; }
.stage-over-arrow {
  color: var(--flag);
  font-weight: 700;
  font-size: 0.95em;
  line-height: 1;
}
.stage-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}
.stage-block.over-budget .stage-head {
  background: var(--warn-soft);
}
.stage-totals { font-size: 0.88rem; color: var(--muted); }
.stage-totals strong { color: var(--text); }
.stage-totals .over { color: var(--warn); font-weight: 700; }
.stage-drop-root {
  min-height: 28px;
  margin: 0.35rem 0.75rem 0.65rem;
  border: 2px dashed transparent;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.stage-drop-root.drag-over {
  border-color: var(--drop);
  background: var(--drop-soft);
  color: var(--drop);
}
.items-list { padding: 0 0.5rem 0.5rem; }
.items-list:has(.item-chunk--active) .item-chunk:not(.item-chunk--active):not(.item-chunk--selected) {
  opacity: 0.82;
}
.item-chunk {
  position: relative;
  margin: 0.55rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.item-chunk.status-pending { border-left: 4px solid var(--line); }
.item-chunk.status-in_progress { border-left: 4px solid var(--accent); }
.item-chunk.status-done { border-left: 4px solid var(--accept); }
.item-chunk.status-cancelled {
  opacity: 0.55;
  border-left: 4px solid var(--muted);
  background: #f5f5f5;
}
.item-chunk.status-cancelled .item-title-input {
  text-decoration: line-through;
  color: var(--muted);
}
.item-chunk--just-moved {
  box-shadow:
    inset 0 2px 0 0 rgba(13, 90, 135, 0.35),
    inset 0 -2px 0 0 rgba(13, 90, 135, 0.35),
    inset -2px 0 0 0 rgba(13, 90, 135, 0.35);
}
.item-chunk--depth-1 { margin-left: 1.75rem; }
.item-chunk--depth-2 { margin-left: 3.25rem; }
.item-chunk--depth-3 { margin-left: 4.75rem; }
.item-chunk--child { background: #fafbfc; }
.item-chunk--depth-2.item-chunk--child { background: #f6f8fa; }
.item-chunk--depth-3.item-chunk--child { background: #f3f5f7; }
.item-chunk--active,
.item-chunk--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  opacity: 1;
  z-index: 1;
}
.item-chunk--active .item-chunk__manage,
.item-chunk--selected .item-chunk__manage {
  background: #eef4ff;
  border-top-color: #bfd3f6;
}
.item-chunk .item-row {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.item-chunk.status-cancelled .item-row {
  background: transparent;
}
.item-chunk .item-row.item-row--depth-1,
.item-chunk .item-row.item-row--depth-2,
.item-chunk .item-row.item-row--depth-3 {
  margin-left: 0;
}
.item-chunk__manage {
  border-top: 1px solid var(--line);
  background: var(--bg2);
  padding: 0.35rem 0.65rem 0.45rem;
}
.item-chunk__scope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.item-chunk__scope-kicker {
  font-size: 0.68rem;
  font-weight: var(--fw-action);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.item-chunk__scope-lp {
  font-weight: var(--fw-action);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.item-chunk__scope-title {
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(100%, 28rem);
}
.item-chunk__manage .tree-toolbar--move {
  opacity: 1;
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.item-chunk__tools-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.item-chunk__add-below {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  flex: 0 1 auto;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.drop-slot {
  position: relative;
  min-height: 6px;
  height: auto;
  margin: 0;
  border-radius: 0;
  transition: min-height 0.12s, background 0.12s;
  display: block;
}
.drop-slot:not(.item-chunk .drop-slot) {
  margin: 2px 0.5rem;
  border-radius: 4px;
}
.drop-slot-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  width: 100%;
  padding: 0.25rem 0.65rem;
}
.item-chunk .drop-slot-toolbar {
  flex-wrap: nowrap;
  border-bottom: 1px dashed var(--line);
  background: rgba(248, 249, 250, 0.85);
}
.drop-slot__label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: var(--fw-action);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.2;
}
.drop-slot-add-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}
.drop-slot-move-bar {
  display: none;
}
.drop-slot .item-add-btn,
.item-chunk__add-below .item-add-btn {
  opacity: 0.55;
  padding: 2px 8px;
  min-width: 0;
  font-size: var(--fs-mini);
  font-weight: var(--fw-muted-ui);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.item-chunk--active .drop-slot .item-add-btn,
.item-chunk--selected .drop-slot .item-add-btn,
.item-chunk--active .item-chunk__add-below .item-add-btn,
.item-chunk--selected .item-chunk__add-below .item-add-btn,
.drop-slot:hover .item-add-btn,
.drop-slot:focus-within .item-add-btn,
.item-chunk__add-below:hover .item-add-btn,
.item-chunk__add-below:focus-within .item-add-btn {
  opacity: 1;
}
.drop-slot .item-add-btn:disabled,
.item-chunk__add-below .item-add-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}
.item-add-btn__ic {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.item-add-btn__ic .lucide-icon {
  width: 12px;
  height: 12px;
  display: block;
}
.item-add-btn--d0 .item-add-btn__ic { color: #1d4ed8; }
.item-add-btn--d1 .item-add-btn__ic { color: #0e7490; }
.item-add-btn--d2 .item-add-btn__ic { color: #9a6a00; }
.item-add-btn--d3 .item-add-btn__ic { color: #6d28d9; }
.tree-delete-modal__warn {
  color: var(--warn);
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
}
.drop-slot--tail {
  margin: 0.35rem 0.5rem 0.65rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg2);
}
.drop-slot--tail .drop-slot-toolbar {
  padding: 0.45rem 0.65rem;
}
.drop-slot.drag-over {
  min-height: 22px;
  background: var(--drop-soft);
  border: 2px dashed var(--drop);
}
.item-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  margin: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  position: relative;
  z-index: 0;
  transition: box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.items-list--compact-headers .drop-slot {
  min-height: 28px;
}
.items-list--compact-headers .item-chunk__add-below .item-add-btn,
.items-list--compact-headers .drop-slot .item-add-btn {
  display: inline-flex;
  opacity: 0.9;
}
.items-list--compact-headers .item-chunk--active .item-chunk__add-below .item-add-btn,
.items-list--compact-headers .item-chunk--selected .item-chunk__add-below .item-add-btn,
.items-list--compact-headers .item-chunk__add-below:hover .item-add-btn,
.items-list--compact-headers .item-chunk__add-below:focus-within .item-add-btn,
.items-list--compact-headers .drop-slot:hover .item-add-btn,
.items-list--compact-headers .drop-slot:focus-within .item-add-btn {
  opacity: 1;
}
.items-list--compact-headers .item-chunk__manage .tree-toolbar--move {
  opacity: 0.9;
}
.items-list--compact-headers .item-chunk--active .item-chunk__manage .tree-toolbar--move,
.items-list--compact-headers .item-chunk--selected .item-chunk__manage .tree-toolbar--move,
.items-list--compact-headers .item-chunk__manage .tree-toolbar--move:hover,
.items-list--compact-headers .item-chunk__manage .tree-toolbar--move:focus-within {
  opacity: 1;
}
.items-list--compact-headers .item-chunk__scope-title {
  max-width: 12rem;
}
.items-list--compact-headers .item-row {
  padding: 0.35rem 0.75rem;
  align-items: center;
}
.items-list--compact-headers .item-body > :not(.item-head-row) {
  display: none !important;
}
.items-list--compact-headers .item-actions {
  display: none;
}
.items-list--compact-headers .item-head-row {
  flex-wrap: nowrap;
}
.item-head-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}
.item-row.status-pending { border-left: 3px solid var(--line); }
.item-row.status-cancelled {
  opacity: 0.55;
  border-left: 3px solid var(--muted);
  background: #f5f5f5;
}
.item-row.status-cancelled .item-title-input {
  text-decoration: line-through;
  color: var(--muted);
}
.item-row.child { background: #fafbfc; }
.item-row.item-row--depth-1 { margin-left: 1.75rem; background: #fafbfc; }
.item-row.item-row--depth-2 { margin-left: 3.25rem; background: #f6f8fa; }
.item-row.item-row--depth-3 { margin-left: 4.75rem; background: #f3f5f7; }
.item-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-mini);
  font-weight: var(--fw-action);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}
.item-level-badge__icon {
  display: inline-flex;
  align-items: center;
}
.item-level-badge__icon .lucide-icon {
  width: 13px;
  height: 13px;
  display: block;
}
.item-level-badge--d0 { color: #1d4ed8; border-color: #bfd3f6; background: #eef4ff; }
.item-level-badge--d1 { color: #0e7490; border-color: #b9e3ee; background: #ecfbff; }
.item-level-badge--d2 { color: #9a6a00; border-color: #f0dcae; background: #fff7e6; }
.item-level-badge--d3 { color: #6d28d9; border-color: #ddd0f5; background: #f6f1ff; }
.item-prefix {
  font-weight: var(--fw-action);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 1.6rem;
}
.item-prefix--detail {
  color: var(--muted);
  font-weight: 500;
}
.stage-title-input {
  flex: 1;
  min-width: 12rem;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  background: transparent;
  box-sizing: border-box;
}
.stage-title-input:hover,
.stage-title-input:focus {
  border-color: var(--line);
  background: var(--bg);
}
.stage-notes-input {
  width: 100%;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 0.35rem;
  resize: vertical;
  min-height: 2em;
  background: var(--bg2);
  box-sizing: border-box;
}
.stage-notes-input:hover,
.stage-notes-input:focus {
  border-color: var(--line);
  background: var(--bg);
}
.tree-toolbar-wrap {
  position: relative;
  margin-top: 0.35rem;
}
.tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tree-toolbar--move {
  align-items: center;
  gap: 3px;
  padding: 0.1rem 0;
  background: transparent;
  border: 0;
  opacity: 0.7;
  transition: opacity 0.12s ease;
}
.tree-toolbar--move:hover,
.tree-toolbar--move:focus-within {
  opacity: 1;
}
.tree-toolbar__label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.64rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-right: 2px;
}
.tree-toolbar__label .lucide-icon {
  width: 12px;
  height: 12px;
  display: block;
}
.tree-del-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
}
.tree-del-btn__ic {
  display: inline-flex;
  align-items: center;
}
.tree-del-btn__ic .lucide-icon {
  width: 12px;
  height: 12px;
  display: block;
}
.tree-toolbar .ui-btn {
  font-size: 0.72rem;
  padding: 2px 7px;
  line-height: 1.35;
}
/* Pasek "Przenieś" to narzędzie pomocnicze — wyciszony, ożywa na hover */
.tree-toolbar--move .ui-btn {
  font-weight: 400;
  font-size: 0.72rem;
  padding: 2px 6px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tree-move-btn__ic {
  display: inline-flex;
  align-items: center;
}
.tree-move-btn__ic .lucide-icon {
  width: 12px;
  height: 12px;
  display: block;
}
.tree-toolbar-btn-wrap {
  display: inline-flex;
  vertical-align: middle;
}
.tree-toolbar--move .ui-btn:hover:not(:disabled) {
  background: var(--bg2);
  border-color: var(--line);
  color: var(--text);
}
.tree-toolbar--move .tree-del-btn {
  color: var(--warn);
  font-weight: 400;
}
.tree-toolbar--move .tree-del-btn:hover:not(:disabled) {
  background: var(--warn-soft);
  border-color: #ffcc80;
  color: var(--warn);
}
.tree-toolbar--move .tree-move-to__input {
  background: transparent;
}
.tree-move-to {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.tree-move-to__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
}
.tree-move-to__input {
  width: 3.2rem;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  box-sizing: border-box;
}
.tree-move-to__btn {
  min-width: 1.8rem;
  padding: 2px 6px;
  font-weight: var(--fw-muted-ui);
}
.tree-add-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tree-add-modal[hidden] {
  display: none;
}
.tree-add-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.tree-add-modal__panel {
  position: relative;
  width: min(100%, 420px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.tree-add-modal__panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.tree-add-modal__context {
  margin: 0 0 0.75rem;
}
.tree-add-modal__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}
.tree-add-modal__input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  box-sizing: border-box;
}
.tree-add-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.stage-block--flat .stage-actions .ui-btn.primary {
  font-size: 0.85rem;
}
.item-row.dragging {
  opacity: 0.4;
}
.item-chunk.dragging {
  opacity: 0.45;
  outline: 1px dashed var(--drop);
  outline-offset: -2px;
}
/* Wskaźnik upuszczenia: osobna szczelina między kartami (nie styl docelowej karty). */
.drag-insert-gap {
  box-sizing: border-box;
  min-height: 3rem;
  margin: 0.15rem 0.35rem;
  padding: 0.55rem 0.75rem;
  border: 2px dashed var(--drop);
  border-radius: 10px;
  background: var(--drop-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.1s ease, min-height 0.1s ease, padding 0.1s ease, margin 0.1s ease, border-width 0.1s ease;
}
.drag-insert-gap--hidden {
  opacity: 0;
  pointer-events: none;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
  overflow: hidden;
}
.drag-insert-gap__label {
  color: var(--drop);
  font-size: 0.72rem;
  font-weight: var(--fw-action);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.drag-insert-gap--noop {
  border-color: var(--line);
  background: var(--bg2);
}
.drag-insert-gap--noop .drag-insert-gap__label {
  color: var(--muted);
}
body.mosk-dragging .item-chunk--active,
body.mosk-dragging .item-chunk--selected {
  box-shadow: none;
  border-top-color: var(--line);
  border-right-color: var(--line);
  border-bottom-color: var(--line);
}
body.mosk-dragging .items-list .item-chunk:not(.dragging) {
  opacity: 1 !important;
}
body.mosk-dragging .drop-slot.drag-over {
  background: transparent;
  border-color: transparent;
}
/* Legacy: wiersze bez karty (gdyby wystąpiły). */
.item-row.drop-nest {
  border-color: var(--drop);
  background: var(--drop-soft);
  box-shadow: inset 0 0 0 2px var(--drop);
}
.item-row.drop-before::before,
.item-row.drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--drop);
  box-shadow: 0 0 0 3px var(--drop-soft), 0 2px 8px rgba(13, 90, 135, 0.35);
  z-index: 6;
  pointer-events: none;
}
.item-row.drop-before::before { top: -4px; }
.item-row.drop-after::after { bottom: -4px; }
body.mosk-dragging,
body.mosk-dragging * { cursor: grabbing !important; }
.mosk-drag-ghost {
  position: fixed;
  top: -1000px;
  left: -1000px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--drop);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 3000;
}
.drag-handle {
  cursor: grab;
  user-select: none;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  min-width: 28px;
  min-height: 34px;
  padding: 0.45rem 0.4rem;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drag-handle:hover {
  background: var(--drop-soft);
  color: var(--drop);
}
.drag-handle:active { cursor: grabbing; }
.item-body { min-width: 0; }
.item-title { font-weight: 600; font-size: 0.92rem; }
.item-title-input {
  flex: 1 1 6rem;
  min-width: 0;
  width: auto;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 4px;
  background: transparent;
  box-sizing: border-box;
}
.item-title-input:hover,
.item-title-input:focus {
  border-color: var(--line);
  background: var(--bg);
}
.item-notes { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }
.item-notes-input {
  width: 100%;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
  margin-top: 0.25rem;
  resize: vertical;
  min-height: 2.4em;
  box-sizing: border-box;
}
.item-notes-wrap { margin-top: 0.25rem; }
.item-notes-preview {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--bg2);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  white-space: pre-wrap;
  word-break: break-word;
}
.item-notes-preview.empty {
  color: var(--accent);
  font-style: italic;
}
.item-notes-preview:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.item-notes-preview:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.item-notes-readonly {
  cursor: default;
  border-style: solid;
  border-color: var(--line);
  background: var(--bg2);
  color: var(--muted);
}
.item-notes-readonly:hover {
  background: var(--bg2);
  border-color: var(--line);
}
.notes-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.computed-amount-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.computed-amount-hint .computed-label {
  font-weight: 700;
  color: var(--accent);
}
.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
}
.attach-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") center / contain no-repeat;
}
.attach-label {
  font-size: 0.78rem;
  font-weight: var(--fw-muted-ui);
}
.stage-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stage-toggle {
  white-space: nowrap;
}
.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0.65rem 0.65rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stage-block.collapsed .stage-actions {
  display: none;
}
.item-lp { font-size: 0.92rem; }
.item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.amount-input {
  width: 110px;
  min-width: 110px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  text-align: right;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
.amount-input.amount-unpriced {
  background: #fff8e8;
  border-color: #ffcc80;
}
.amount-wrap {
  display: flex;
  gap: 4px;
  align-items: center;
}
.currency-select {
  font: inherit;
  font-size: 0.78rem;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  box-sizing: border-box;
}
.item-row-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.item-add-btn {
  min-width: 28px;
  padding: 2px 8px;
  font-weight: var(--fw-muted-ui);
}
.item-del-btn {
  min-width: 28px;
  padding: 2px 8px;
}
.fx-rate-line {
  font-size: 0.82rem;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}
.nest-badge {
  font-size: 0.72rem;
  color: var(--drop);
  background: var(--drop-soft);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.ui-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0;
  padding: 6px 12px;
  font-size: var(--fs-ui);
  font-weight: var(--fw-action);
  font-family: var(--font-sans);
  line-height: 1.35;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, color 0.15s;
}
.ui-btn:hover { background: var(--bg2); border-color: #cfd4d9; }
.ui-btn:active { transform: translateY(1px); }
.ui-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ui-btn.icon {
  border-radius: 0;
  min-width: 32px;
  padding: 4px 8px;
}
.ui-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: var(--fw-action-strong); }
.ui-btn.primary:hover { background: #0a4a6e; border-color: #0a4a6e; }
.ui-btn.warn { background: var(--warn-soft); border-color: #ffcc80; color: var(--warn); font-weight: var(--fw-action-strong); }
.ui-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ui-btn--ghost {
  font-weight: var(--fw-muted-ui);
  font-size: var(--fs-micro);
}
.ui-btn--strong {
  font-weight: var(--fw-action-strong);
}
.status-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0.4rem;
}
.status-bar .status-btn {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-btn,
.filter-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 400;
  font-family: var(--font-sans);
  line-height: 1.35;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-height: 34px;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, color 0.15s;
}
.status-btn:hover,
.filter-btn:hover { background: var(--bg2); border-color: #cfd4d9; }
.status-btn:active,
.filter-btn:active { transform: translateY(1px); }
.status-btn:focus-visible,
.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.status-btn.is-active { color: #fff; }
.status-btn[data-status="pending"].is-active {
  background: #6f7782;
  border-color: #6f7782;
}
.status-btn[data-status="in_progress"].is-active {
  background: var(--accent);
  border-color: var(--accent);
}
.status-btn[data-status="done"].is-active {
  background: var(--accept);
  border-color: var(--accept);
}
.status-btn[data-status="cancelled"].is-active {
  background: #9aa0a6;
  border-color: #9aa0a6;
}
.filter-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.filter-btn.is-active:hover {
  background: #dceaf3;
}
.filter-btn[data-filter=""].is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.filter-btn[data-filter=""].is-active:hover {
  background: #0a4a6e;
  border-color: #0a4a6e;
}
.filter-btn.filter-toggle.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.stack-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 0.35rem;
  table-layout: auto;
}
.stack-table th,
.stack-table td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  vertical-align: top;
}
.stack-table thead th {
  background: var(--bg2);
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}
.stack-table--kv td:first-child {
  width: 1%;
  white-space: nowrap;
  font-weight: 600;
  background: var(--bg2);
  color: var(--muted);
}
.stack-table--kv td:last-child {
  white-space: nowrap;
}
.stack-table--data {
  table-layout: fixed;
  width: 100%;
}
.stack-table--data td:first-child,
.stack-table--data td:nth-child(2) {
  white-space: nowrap;
  width: 1%;
}
.stack-table--data td:nth-child(n+3),
.stack-table--data .stack-table__detail {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.stack-table--data .stack-table__detail {
  min-width: 0;
}
.stack-table td:first-child {
  font-weight: 600;
}
.status-btn .lbl-short { display: none; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 1rem;
}
.toolbar input {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.35;
}
.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  max-width: 360px;
  z-index: 100;
}
.toast.show { opacity: 1; }
.history-panel {
  margin-top: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.history-panel h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.history-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
}
.history-item.undone { opacity: 0.55; text-decoration: line-through; }
.history-item .hist-text { flex: 1 1 200px; }
.history-undo-btn {
  flex-shrink: 0;
  min-height: 26px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--warn);
  border-color: #ffcc80;
  background: var(--warn-soft);
}
.history-undo-btn:hover {
  background: #ffe8c2;
  border-color: #ffb74d;
}
.history-item.undone .history-undo-btn {
  display: none;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.04);
}
.scroll-progress {
  height: 3px;
  background: var(--line);
  overflow: hidden;
}
.scroll-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accept);
  transition: width 0.08s ease-out;
}
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.5rem 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  background: var(--bg);
  box-sizing: border-box;
}
.top-nav-brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  color: var(--mosk-ink);
}
.top-nav-brand__head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.top-nav-icon {
  display: block;
  height: 26px;
  width: auto;
  flex-shrink: 0;
}
.top-nav-wordmark {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--mosk-ink);
}
.top-nav-brand__tagline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.top-nav-brand__line {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--mosk-green);
  flex-shrink: 0;
}
.top-nav-brand__text {
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--mosk-ink);
  white-space: nowrap;
}
.top-nav-brand__place {
  letter-spacing: 0.04em;
}
.top-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
}
.top-nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  background: var(--bg2);
}
.top-nav-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.top-nav-links a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.top-nav-logout {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg2);
  cursor: pointer;
}
.top-nav-logout:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.poll-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg2);
}
.poll-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.poll-dot--ok {
  background: #2e7d32;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.25);
}
.poll-dot--err {
  background: var(--flag);
  box-shadow: 0 0 0 2px var(--flag-soft);
}
.poll-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.poll-refresh {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}
.poll-refresh .lucide-icon {
  animation: poll-refresh-spin 2s linear infinite;
}
.poll-status--err .poll-refresh .lucide-icon {
  animation-play-state: paused;
  color: var(--muted);
}
@keyframes poll-refresh-spin {
  to { transform: rotate(360deg); }
}
.tab-placeholder {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px dashed var(--line);
  background: var(--bg2);
  border-radius: 8px;
}
.tab-placeholder__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}
.drag-hint {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}
.list-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}
.list-controls-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.list-controls-label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-content);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}
.list-controls-hint {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.list-controls-hint__text {
  white-space: nowrap;
}
.tooltips-toggle.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.compact-headers-toggle {
  color: #1d4ed8;
  border-color: #bfd3f6;
  background: #eef4ff;
}
.compact-headers-toggle:hover {
  color: #1d4ed8;
  border-color: #9fb8f0;
  background: #e0ecff;
}
.compact-headers-toggle.is-active {
  color: #1d4ed8;
  border-color: #1d4ed8;
  background: #eef4ff;
}
html.mosk-tooltips-off .mosk-tooltip {
  display: none !important;
}
.filter-bar--compact {
  flex: 0 0 auto;
  gap: 3px;
  row-gap: 4px;
}
.filter-btn--compact {
  min-height: 28px;
  line-height: 1.1;
}
.filter-btn--labeled {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 3px 6px;
}
.filter-btn--labeled .lucide-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}
.filter-btn__label {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}
.filter-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.filter-btn--icon .lucide-icon {
  display: block;
  pointer-events: none;
}
.filter-btn--compact.filter-toggle.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.lucide-icon {
  flex-shrink: 0;
}
.item-row--just-moved {
  /* lewa krawedz = wylacznie border-left statusu; ring na gorze, prawej i dole */
  box-shadow:
    inset 0 2px 0 0 rgba(13, 90, 135, 0.35),
    inset 0 -2px 0 0 rgba(13, 90, 135, 0.35),
    inset -2px 0 0 0 rgba(13, 90, 135, 0.35);
}
.item-undo-btn {
  flex-shrink: 0;
  min-height: 28px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: var(--fw-action-strong);
  color: var(--warn);
  border-color: #ffcc80;
  background: var(--warn-soft);
}
.item-undo-btn:hover {
  background: #ffe8c2;
  border-color: #ffb74d;
}
.stage-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid var(--line);
}
.stage-export-btn {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 0.82rem;
}
.index-hero {
  text-align: center;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}
.index-logo {
  display: block;
  width: min(520px, 100%);
  height: auto;
  margin: 0 auto 1.25rem;
}
.index-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0;
}
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(32, 33, 36, 0.45);
  backdrop-filter: blur(2px);
}
.login-gate[hidden] {
  display: none !important;
}
body.login-gate-open {
  overflow: hidden;
}
html.mosk-auth-pending body {
  visibility: hidden;
}
.login-gate__panel {
  position: relative;
  width: min(100%, 360px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 16px 48px rgba(31, 41, 55, 0.18);
}
.login-gate__close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}
.login-gate__close:hover {
  color: var(--text);
  background: var(--bg2);
}
.login-gate__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mosk-ink);
}
.login-gate__hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.login-gate__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.login-gate__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.login-gate__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.login-gate__field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
}
.login-gate__field input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.login-gate__error {
  margin: 0;
  font-size: 0.82rem;
  color: var(--flag);
}
.login-gate__error[hidden] {
  display: none;
}
.login-gate__submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 8px 12px;
}
.status-select {
  margin-top: 0.35rem;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 0.8rem;
}
.comments-block {
  margin-top: 0.5rem;
  padding: 0.5rem 0.6rem 0.55rem;
  border-radius: 8px;
  background: #f4f8fb;
  border: 1px solid #e2eaf0;
}
.comment-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 8px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(13, 90, 135, 0.07);
}
.comment-line:last-of-type {
  margin-bottom: 0;
}
.comment-line__body {
  flex: 1 1 12rem;
  min-width: 0;
}
.comment-line__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.55rem;
  margin-bottom: 0.15rem;
}
.comment-line__author {
  font-weight: 600;
  color: var(--text);
}
.comment-line__author--unknown {
  color: #9a6a00;
  font-style: italic;
}
.comment-line__date {
  font-size: var(--fs-mini);
  font-weight: var(--fw-muted-ui);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.comment-line__text {
  word-break: break-word;
  color: var(--text);
  line-height: 1.45;
}
.comment-line__actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-left: auto;
}
.comment-action-btn {
  font-size: var(--fs-mini);
  padding: 2px 8px;
  line-height: 1.35;
  font-weight: var(--fw-muted-ui);
  min-height: 24px;
}
.comment-action-btn.warn,
.ui-btn--ghost.comment-action-btn.warn {
  font-weight: var(--fw-muted-ui);
}
.comment-line--editing {
  align-items: stretch;
}
.comment-line--editing .comment-edit-input {
  flex: 1 1 100%;
}
.comment-form {
  display: flex;
  gap: 4px;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed #d8e3ec;
}
.documents-block {
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--line);
}
.doc-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}
.doc-line__name {
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  max-width: 100%;
  word-break: break-word;
}
.doc-line__name:hover {
  color: #0b4f7a;
}
.doc-line__meta {
  color: var(--muted);
  font-size: 0.72rem;
}
.doc-action-btn {
  min-height: 24px;
  padding: 1px 6px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-muted-ui);
}
.doc-upload-progress {
  margin-top: 0.25rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #ffcc80;
  border-radius: 6px;
  background: #fff8e8;
}
.doc-upload-progress__text {
  font-size: 0.74rem;
  color: #8a4b00;
  margin-bottom: 0.25rem;
  word-break: break-word;
}
.doc-upload-progress__track {
  height: 6px;
  border-radius: 999px;
  background: #ffe0b2;
  overflow: hidden;
}
.doc-upload-progress__bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb74d, #fb8c00);
  transition: width 0.15s ease;
}
.doc-upload-retry {
  margin-top: 0.35rem;
  font-size: 0.74rem;
}
.comment-edit-input {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 0.8rem;
  box-sizing: border-box;
}
.comment-input {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 0.8rem;
  box-sizing: border-box;
}
.item-row.status-done { border-left: 3px solid var(--accept); }
.item-row.status-in_progress { border-left: 3px solid var(--accent); }
.side-panels details,
.history-panel details {
  background: var(--bg);
  border: 1px dashed #cfd4d9;
  border-radius: 8px;
  padding: 0 12px;
  margin: 0.75rem 0;
}
.side-panels details[open],
.history-panel details[open] {
  padding-bottom: 10px;
}
.side-panels details summary,
.history-panel details summary {
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  padding: 9px 0;
  list-style: none;
}
.side-panels details summary::-webkit-details-marker,
.history-panel details summary::-webkit-details-marker { display: none; }
.side-panels details summary::before,
.history-panel details summary::before {
  content: "\25B8  ";
  color: var(--accent);
}
.side-panels details[open] summary::before,
.history-panel details[open] summary::before {
  content: "\25BE  ";
}
@media (max-width: 639px) {
  .dashboard-wrap { padding: 0.85rem 1rem 1.5rem; border-radius: 0; border-left: none; border-right: none; overflow-x: clip; max-width: 100%; }
  main { width: 100%; max-width: none; padding: 0; overflow-x: clip; }
  .site-header { overflow-x: clip; max-width: 100%; }
  .top-nav { min-width: 0; max-width: 100%; }
  .list-controls { width: 100%; min-width: 0; }
  .list-controls-filters { flex: 1 1 100%; width: 100%; min-width: 0; }
  .filter-bar--compact {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
  }
  .list-controls-hint { flex: 1 1 100%; min-width: 0; }
  .list-controls-hint__text { white-space: normal; }
  .page-head-author { min-width: 0; max-width: 100%; overflow-x: clip; }
  .author-picker-compact { width: 100%; min-width: 0; }
  h1 { font-size: 1.1rem; }
  .item-row {
    grid-template-columns: 1fr;
  }
  .item-row > .drag-handle {
    display: inline-block;
    margin-bottom: 4px;
  }
  .item-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  }
  .item-row.child {
    border-left: 2px solid var(--line);
    padding-left: 0.65rem;
  }
  .item-row.item-row--depth-1 { margin-left: 0.6rem; }
  .item-row.item-row--depth-2 { margin-left: 1.4rem; }
  .item-row.item-row--depth-3 { margin-left: 2.2rem; }
  .item-head-row {
    flex-wrap: wrap;
    align-items: baseline;
  }
  .item-title-input {
    flex: 1 1 100%;
  }
  .tree-toolbar .ui-btn {
    font-size: 0.68rem;
    padding: 2px 5px;
  }
  .amount-input { width: 100%; max-width: 140px; }
  .stage-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .stage-totals { font-size: 0.82rem; }
  .summary-grid { grid-template-columns: 1fr; }
  .dashboard-wrap .summary-grid { grid-template-columns: 1fr; }
  .persona-chip { min-width: 0; flex: 1 1 calc(50% - 6px); }
  .persona-chip-wrap { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .toolbar-actions .ui-btn { flex: 1 1 calc(50% - 4px); justify-content: center; text-align: center; }
  .status-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-btn { min-height: 44px; }
  .status-btn .lbl-full { display: none; }
  .status-btn .lbl-short { display: inline; }
  .toast {
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    max-width: none;
  }
  .comment-form { flex-wrap: wrap; }
  .comment-input { min-width: 0; flex: 1 1 100%; }
  .filter-bar { gap: 6px; }
  .filter-bar .filter-btn { flex: 1 1 auto; min-height: 40px; }
  .subpage-nav { gap: 6px; }
  .top-nav { gap: 8px; }
  .top-nav-links { margin-left: auto; }
  .top-nav-icon { height: 22px; }
  .top-nav-wordmark { font-size: 1rem; }
  .top-nav-brand__text { font-size: 0.58rem; white-space: normal; }
  .top-nav-brand__line { width: 14px; }
  .dashboard-wrap.ai-panel .panel-box { padding: 0.65rem 0.75rem; }
  .page-back-link {
    font-size: 0.78rem;
    padding: 4px 8px;
  }
  .author-picker-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .author-picker-head {
    width: 100%;
  }
}
@media (max-width: 400px) {
  .status-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (hover: none), (pointer: coarse) {
  .mosk-cursor-indicator { display: none !important; }
  .mosk-tooltip { display: none !important; }
}
.side-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.panel-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.panel-box h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.suggestion-item, .activity-item {
  font-size: 0.82rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
}
.activity-item--linked {
  cursor: pointer;
}
.activity-item--linked:hover {
  color: var(--accent);
}
.activity-item__row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  justify-content: space-between;
}
.activity-item__main {
  flex: 1;
  min-width: 0;
}
.activity-undo-btn {
  flex-shrink: 0;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
}
.activity-undo-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.mini-dash-feed__item--linked {
  cursor: pointer;
}
.mini-dash-feed__item--linked:hover .mini-dash-feed__text {
  color: var(--accent);
}
.backup-panel__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.backup-panel__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.82rem;
}
.backup-panel__meta {
  color: var(--muted);
  font-size: 0.75rem;
}
.backup-diff__section {
  margin: 0.5rem 0 0.75rem;
}
.backup-diff__section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}
.backup-diff__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
}
.tree-add-modal__panel--wide {
  max-width: 36rem;
}
.item-row--activity-focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dashboard-wrap.ai-panel {
  max-width: none;
  margin: 0;
  width: 100%;
}
.ai-panel .meta {
  margin: -0.25rem 0 0.85rem;
  line-height: 1.5;
  font-size: 0.88rem;
  color: var(--muted);
}
.ai-panel .meta code {
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 0.86em;
  font-weight: 500;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.12em 0.4em;
  color: var(--text);
}
.ai-panel .panel-box {
  margin-top: 0.85rem;
}
.ai-panel .panel-box:first-of-type {
  margin-top: 0;
}
.ai-panel .panel-box h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--accent);
}
.ai-panel .form-row {
  margin: 0 0 0.85rem;
}
.ai-panel .form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.ai-panel .form-control {
  display: block;
  width: 100%;
  max-width: 420px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
}
.ai-panel .form-control--wide {
  max-width: 100%;
}
.ai-panel #aiForm > .ui-btn.primary {
  margin-top: 0.15rem;
  font-size: 0.88rem;
}
.ai-panel .panel-box > .ui-btn {
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
}
.ai-panel__lead {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.ai-panel__detail {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}
.ai-panel__empty {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}
.file-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-input-btn {
  margin: 0;
}
.file-input-name {
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--muted);
}
.job-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.5;
}
.job-card__head {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.job-card__meta {
  font-size: 0.82rem;
  color: var(--muted);
}
.job-card__error {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--flag);
}
.job-status { font-weight: 600; color: var(--accent); }
.job-result {
  white-space: pre-wrap;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  background: var(--bg2);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 0.5rem;
  color: var(--text);
}
.page-head-author {
  margin: 0 0 0.65rem;
  padding: 0.35rem 0.5rem;
  background: var(--accent-soft);
  border-radius: 0;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.page-head-author.author-picker-wrap {
  flex: none;
  margin-bottom: 0.65rem;
}
.author-picker-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.author-roles-panel {
  margin-top: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.page-head-author .author-roles-panel {
  border-top-color: var(--line);
}
.page-head-author.author-none-selected:not(.persona-list-hidden) .author-roles-panel {
  border-top-color: var(--line);
}
.author-active-badge--placeholder {
  border-style: dashed;
  border-color: var(--line);
  background: var(--bg2);
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}
.author-active-badge--placeholder .persona-name {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}
.author-active-badge--placeholder .persona-emoji {
  opacity: 0.72;
}
.page-head-author.author-none-selected .author-active-badge--placeholder {
  background: var(--bg2);
}
.page-head-author .author-list-toggle.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.page-head-author .author-picker-bar {
  margin-bottom: 0;
  gap: 4px;
  align-items: center;
}
.page-head-author .author-picker-head {
  gap: 4px;
}
.page-head-author .filter-bar-label {
  font-size: 0.78rem;
}
.page-head-author .author-active-badge {
  padding: 2px 6px;
  font-size: 0.75rem;
  gap: 4px;
}
.page-head-author .author-roles-toggle,
.page-head-author .author-add-toggle,
.page-head-author .author-list-toggle {
  min-height: 28px;
  padding: 2px 8px;
  font-size: 0.75rem;
  display: inline-grid;
  align-items: center;
  justify-items: center;
}
.page-head-author .author-list-toggle__sizer,
.page-head-author .author-list-toggle__label {
  grid-area: 1 / 1;
}
.page-head-author .author-list-toggle__sizer {
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
}
.page-head-author .author-list-toggle.author-pick-nudge {
  position: relative;
  border-color: transparent !important;
  background: transparent;
  overflow: hidden;
  z-index: 0;
}
.page-head-author .author-list-toggle.author-pick-nudge .author-list-toggle__label {
  position: relative;
  z-index: 1;
}
.page-head-author .author-list-toggle.author-pick-nudge::before {
  content: '';
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  will-change: transform;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 280deg,
    rgba(210, 88, 78, 0.15) 290deg,
    rgba(210, 88, 78, 0.35) 310deg,
    #d4584e 325deg,
    #e57373 335deg,
    rgba(210, 88, 78, 0.35) 345deg,
    rgba(210, 88, 78, 0.15) 355deg,
    transparent 360deg
  );
  animation: mosk-glow-border-spin 4s linear infinite;
  pointer-events: none;
}
.page-head-author .author-list-toggle.author-pick-nudge::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 1px;
  border-radius: 0;
  background: #fff;
  pointer-events: none;
}
.page-head-author .author-list-toggle.author-pick-nudge.is-active::after {
  background: var(--accent-soft);
}
.page-head-author .persona-chips {
  gap: 4px;
}
.page-head-author .persona-chip-wrap {
  max-width: none;
}
.page-head-author .persona-chip {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: none;
  min-height: 28px;
  padding: 2px 6px;
  gap: 4px;
}
.page-head-author .persona-line {
  font-size: 0.75rem;
  gap: 3px;
}
.page-head-author .persona-emoji {
  font-size: 0.85rem;
}
.page-head-author .persona-role {
  padding-left: 0;
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8rem;
}
.page-head-author .persona-action {
  padding: 0 4px;
  font-size: 0.68rem;
  min-height: 14px;
}
.page-head-author .author-custom-row {
  margin-top: 0.35rem;
  gap: 4px;
}
.page-head-author.author-add-collapsed [data-author-add-panel],
[data-author-add-panel][hidden],
.author-custom-row[hidden] {
  display: none !important;
}
.page-head-author .author-custom-row input {
  flex: 1 1 120px;
  min-width: 90px;
  padding: 4px 6px;
  font-size: 0.75rem;
}
.page-head-author .author-custom-row .ui-btn {
  min-height: 28px;
  padding: 2px 8px;
  font-size: 0.75rem;
}
.page-head-author .author-role-input {
  flex: 1 1 90px;
  min-width: 70px;
}
#dashboardTitle[title]:not([title=""]) {
  cursor: help;
}
.toolbar-admin-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.toolbar-admin-actions[hidden] {
  display: none !important;
}
.toolbar-section--full {
  flex: 1 1 100%;
}
.panel-box .author-picker-wrap {
  margin: 0.75rem 0;
}
.author-picker-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.author-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.author-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  border-radius: 0;
}
.author-active-badge[hidden] {
  display: none !important;
}
.author-active-badge .persona-role {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}
.author-picker-wrap.persona-roles-hidden .persona-role,
.author-picker-wrap.persona-roles-hidden .author-active-badge .persona-role {
  display: none;
}
.author-roles-toggle.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.dashboard-wrap.info-fields-hidden [data-info-fields] {
  display: none;
}
#btnToggleInfoFields.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.persona-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}
.persona-chip-wrap {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
}
.persona-chip-wrap .persona-chip {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.persona-chip-actions {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-left: none;
}
.persona-chip-wrap .persona-chip.is-active + .persona-chip-actions {
  border-color: var(--accent);
}
.persona-action {
  flex: 1 1 50%;
  border: none;
  background: var(--bg2);
  color: var(--muted);
  cursor: pointer;
  padding: 0 7px;
  font-size: 0.78rem;
  line-height: 1;
  min-width: 28px;
  font-family: var(--font-sans);
  border-radius: 0;
}
.persona-action:hover,
.persona-action:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}
.persona-delete:hover,
.persona-delete:focus-visible {
  background: var(--flag-soft);
  color: var(--flag);
}
.persona-chip-wrap .persona-chip.is-active + .persona-chip-actions .persona-action {
  background: #eef4f8;
}
.persona-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  min-width: 140px;
  max-width: 220px;
  min-height: auto;
  height: auto;
  padding-top: 5px;
  padding-bottom: 5px;
  border-radius: 0;
}
.persona-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}
.persona-emoji {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.persona-name {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}
.persona-role {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
  padding-left: 1.35rem;
}
.persona-chip.is-active .persona-role {
  color: var(--accent);
}
.author-custom-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.author-custom-row input {
  flex: 1 1 180px;
  min-width: 140px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
}
.author-role-input {
  flex: 1 1 120px;
  min-width: 100px;
}
.author-custom-row [data-author-cancel-edit][hidden] {
  display: none !important;
}

.mosk-cursor-indicator {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  will-change: transform;
}
.mosk-cursor-indicator[hidden] {
  display: none !important;
}
.mosk-cursor-indicator__emoji {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 0.95rem;
  line-height: 1;
}
.mosk-cursor-indicator__initials {
  min-width: 1.1em;
  text-align: center;
}

/* Zakładki dashboardu + panel 0,499 MWe */
.subpage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0.75rem 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.subpage-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: var(--fs-ui);
  font-weight: var(--fw-action);
  color: var(--accent);
  text-decoration: none;
  background: var(--bg2);
}
.subpage-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.subpage-link.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: var(--fw-content);
}
.page-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1.25rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.page-head-row h1 {
  margin: 0;
  min-width: 0;
}
.page-back-link {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--bg2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.page-back-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.page-intro a {
  color: var(--accent);
  font-weight: 600;
}
.page-intro__greenfield {
  color: var(--mosk-green);
  font-weight: 700;
}
.abbr.term,
abbr.term {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
  border-bottom: none;
}
.critical-step {
  white-space: nowrap;
}
.path-arrow {
  color: var(--muted);
  padding: 0 2px;
}

.panel-block {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 0.85rem 0;
}
.panel-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--accent);
}
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.checklist-col h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}
.checklist-col ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.checklist-ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: checklist;
}
.checklist-ol li {
  position: relative;
  margin: 0 0 0.55rem;
  padding-left: 2.1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  counter-increment: checklist;
}
.checklist-ol li::before {
  content: counter(checklist);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45rem;
  text-align: center;
}
.checklist-page-note {
  margin-top: 1rem;
}
.search-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  margin-bottom: 0.75rem;
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--bg);
  color: var(--muted);
}
.cost-bar-row {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0.55rem 0;
}
.cost-bar-track {
  height: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.cost-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accept));
  border-radius: 999px;
}
.cost-bar-value { font-size: 0.9rem; white-space: nowrap; }
.gantt-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}
.gantt-head,
.gantt-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr minmax(120px, 160px);
  gap: 10px;
  align-items: center;
}
.gantt-head {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.gantt-head-axis {
  position: relative;
  min-height: 1.35rem;
}
.gantt-axis-head {
  position: relative;
  height: 100%;
  min-height: 1.35rem;
  border-bottom: 1px solid var(--line);
}
.gantt-axis-tick {
  position: absolute;
  bottom: 2px;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
}
.gantt-row {
  min-height: 48px;
  border-bottom: 1px dashed var(--line);
  padding: 4px 0;
}
.gantt-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.gantt-axis {
  position: relative;
  height: 34px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.gantt-axis-date {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.62rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
  line-height: 1;
  z-index: 2;
  background: var(--bg);
  padding: 0 3px;
  border-radius: 3px;
}
.gantt-axis-date--edge-start {
  transform: translate(4px, -50%);
}
.gantt-axis-date--edge-end {
  transform: translate(calc(-100% - 4px), -50%);
}
.gantt-row.critical .gantt-axis-date {
  color: #9a4a00;
}
.gantt-bar {
  position: absolute;
  height: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accept));
  z-index: 1;
}
.gantt-row.critical .gantt-bar {
  background: linear-gradient(90deg, var(--warn), var(--flag));
}
.gantt-milestone { font-size: 0.75rem; color: var(--muted); }
.risk-high { color: var(--flag); font-weight: 600; }
.risk-medium { color: var(--warn); font-weight: 600; }
.json-preview {
  width: 100%;
  min-height: 420px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text);
  resize: vertical;
}
.summary-grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.stage-block.stage-reference {
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 0.25rem 0.5rem 0.75rem;
}
.stage-block.stage-reference .stage-head h2 .badge.reference {
  font-size: 0.72rem;
  vertical-align: middle;
}
.summary-card.reference-card {
  border-style: dashed;
  background: var(--accent-soft);
}
.badge.reference {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
}

@media (max-width: 639px) {
  .gantt-head { display: none; }
  .gantt-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0.65rem 0;
  }
  .gantt-milestone::before {
    content: "Kamień milowy: ";
    font-weight: 600;
    color: var(--text);
  }
  .critical-step { white-space: normal; }
  .panel-block {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cost-bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .cost-bar-value { justify-self: start; }
  .subpage-link {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    text-align: center;
  }
}
@media (max-width: 400px) {
  .subpage-link { flex: 1 1 100%; }
}

.mosk-tooltip {
  position: fixed;
  z-index: 500;
  max-width: min(360px, 90vw);
  padding: 6px 10px;
  border-radius: 6px;
  background: #1f2937;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s ease;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  white-space: pre-wrap;
}
.mosk-tooltip.is-visible {
  opacity: 1;
}
.mosk-tooltip[hidden] {
  display: none !important;
}
