/* Brain Vision — komponenty (D26). Wymiary i warianty jak w systemie UI TriggerPharma
   (ui/components/*.py tam): przycisk 40 px / 700, plakietka 10,5 px / 800, karta 16 px,
   dialog 18 px. Podstrony stoją na tle przestrzeni ze sceny „mózg”, treść w jasnych kartach. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }
:root:has(dialog:modal) { overflow: hidden; }

body {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--space-text);
  background: var(--space);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); border-radius: var(--radius-sm); }
[x-cloak] { display: none !important; }
.icon { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted-foreground); }

/* --- tło przestrzeni (podstrony) ---------------------------------------------------------- */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(1100px 700px at 50% 0%, rgb(19 132 236 / 16%), transparent 65%),
    radial-gradient(900px 600px at 90% 110%, rgb(232 31 118 / 8%), transparent 60%),
    var(--space);
}
.backdrop::after { /* przerywane pionowe linie siatki, jak w scenie */
  content: ""; position: absolute; inset: 0; opacity: .45;
  background-image:
    repeating-linear-gradient(to bottom, rgb(232 31 118 / 40%) 0 4px, transparent 4px 9px),
    repeating-linear-gradient(to bottom, rgb(232 31 118 / 40%) 0 4px, transparent 4px 9px);
  background-size: 1px 100%, 1px 100%;
  background-position: 1% 0, 99% 0;
  background-repeat: no-repeat;
}
.backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
main { flex: 1; padding: 8px 0 56px; }
.stack > * + * { margin-top: var(--stack, 16px); }

/* --- nagłówek podstron: jak HUD sceny --------------------------------------------------- */
.hud-head { position: sticky; top: 0; z-index: 30; padding: 16px 0; }
.hud-head__inner { display: flex; align-items: center; gap: 18px; }
.hud-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgb(5 13 32 / 92%), rgb(5 13 32 / 70%) 70%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  mask-image: linear-gradient(to bottom, #000 75%, transparent);
}
.hud-box { position: relative; display: flex; gap: 8px; padding: 8px; border-radius: var(--radius-xl); background: #eef2f8; box-shadow: 0 10px 30px -10px rgb(0 0 0 / 60%); }
.hud-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--space); color: #fff; cursor: pointer;
  box-shadow: inset 0 -2px 0 rgb(255 255 255 / 6%), 0 2px 6px rgb(5 13 32 / 35%);
  transition: transform var(--t) var(--ease), background var(--t) var(--ease);
}
.hud-btn:hover { transform: translateY(-1px); background: #0c2150; }
.hud-btn--accent { background: var(--primary); }
.hud-btn--accent:hover { background: #0b55c5; }
.hud-brand { font-weight: 700; font-size: 1rem; letter-spacing: .16em; color: var(--space-text); white-space: nowrap; }
/* logo Medsolutions (negatyw na ciemne tło) nad napisem BRAIN VISION; plik ma szerokie marginesy */
.hud-logo { display: block; height: 44px; width: auto; margin: -9px 0 -5px -6px; }
.hud-brand { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.hud-nav { display: none; gap: 4px; margin-left: 6px; }
.hud-nav a {
  padding: 7px 12px; border-radius: 999px; font-size: .6875rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--space-muted); transition: color var(--t), background var(--t);
}
.hud-nav a:hover { color: #fff; background: rgb(255 255 255 / 6%); }
.hud-nav a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / 10%); }
.hud-kbd { margin-left: auto; display: none; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--space-line); color: var(--space-muted); font-size: .75rem; cursor: pointer; background: rgb(255 255 255 / 4%); }
.hud-kbd:hover { color: #fff; border-color: rgb(169 188 220 / 30%); }
kbd { font-family: var(--font-sans); font-size: .625rem; font-weight: 700; padding: 2px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .8; }
@media (min-width: 900px) { .hud-nav { display: flex; } .hud-kbd { display: inline-flex; } }

/* --- menu rozwijane (Pharma: popover 10 px, pozycje 11 px) -------------------------------- */
.menu-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; min-width: 230px; padding: 4px;
  background: var(--popover); color: var(--foreground); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md), var(--shadow-lg);
}
.menu-panel--right { left: auto; right: 0; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .75rem; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; background: none;
  border-radius: var(--radius-sm); font-size: .75rem; font-weight: 500; text-align: left; cursor: pointer; color: var(--foreground);
}
.menu-item:hover { background: var(--accent); color: var(--accent-foreground); }
.menu-item.is-danger { color: var(--destructive); }
.menu-item.is-danger:hover { background: var(--destructive); color: #fff; }
.menu-item kbd { margin-left: auto; color: var(--muted-foreground); }
.menu-sep { height: 1px; background: var(--border); margin: 4px -4px; }

/* --- nagłówek strony na tle przestrzeni (Pharma: h1 29 px / 800) ------------------------ */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 12px 0 22px; }
.eyebrow { font-size: .65625rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--space-azure); }
.page-title { font-size: 1.8125rem; line-height: 1.14; font-weight: 800; letter-spacing: -0.045em; color: var(--space-text); margin-top: 4px; }
.page-desc { font-size: .78125rem; line-height: 1.55; color: var(--space-muted); max-width: 780px; margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--space-muted); font-weight: 600; font-size: .75rem; }
.back:hover { color: #fff; }

/* --- przyciski (Pharma) ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-md); border: 1px solid transparent;
  font-size: .8125rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-primary);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t) var(--ease);
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { opacity: .9; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn--outline { background: var(--card); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn--outline:hover { background: var(--accent); color: var(--accent-foreground); opacity: 1; }
.btn--secondary { background: var(--secondary); color: var(--foreground); box-shadow: none; }
.btn--ghost { background: transparent; color: var(--foreground); box-shadow: none; }
.btn--ghost:hover { background: var(--accent); color: var(--accent-foreground); opacity: 1; }
.btn--danger { background: var(--destructive); color: #fff; box-shadow: 0 5px 14px color-mix(in oklab, var(--destructive) 22%, transparent); }
.btn--space { background: rgb(255 255 255 / 8%); color: var(--space-text); border-color: var(--space-line); box-shadow: none; }
.btn--space:hover { background: rgb(255 255 255 / 14%); opacity: 1; }
.btn--sm { height: 32px; padding: 0 12px; font-size: .75rem; }
.btn--lg { height: 44px; padding: 0 24px; font-size: .875rem; }
.btn--icon { width: 40px; padding: 0; }
.btn--block { width: 100%; }
.btn--star.is-on { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in oklab, var(--star) 45%, transparent); }
.btn--star.is-on .icon { fill: var(--star); color: var(--star); }
@media (pointer: coarse) { .btn { min-height: 44px; } }

/* --- plakietki (Pharma: 10,5 px / 800, pigułka) ------------------------------------------- */
.badge {
  --c: var(--muted-foreground);
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 999px;
  border: 1px solid transparent; font-size: .65625rem; font-weight: 800; line-height: 1.2; white-space: nowrap;
  background: var(--secondary); color: var(--foreground);
}
.badge .icon { width: 12px; height: 12px; }
.badge__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--cat { background: color-mix(in oklab, var(--c) 13%, #fff); color: color-mix(in oklab, var(--c) 70%, #11182a); }
.badge--cat .badge__dot { background: var(--c); }
.badge--outline { background: transparent; border-color: var(--border); }
.status--new { background: var(--accent); color: var(--accent-foreground); }
.status--in_progress { background: var(--success-soft); color: var(--success); }
.status--deprecated { background: transparent; border-color: var(--border); color: var(--muted-foreground); }
.status--archived { background: var(--secondary); color: var(--muted-foreground); }
.badge--star { background: var(--warning-soft); color: var(--warning); }
.badge--star .icon { fill: var(--star); color: var(--star); }

/* --- karty (Pharma: 16 px, cień sm) -------------------------------------------------------- */
.card { background: var(--card); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.card__title { font-size: 1rem; font-weight: 600; line-height: 1.2; }
.card__desc { font-size: .6875rem; color: var(--muted-foreground); }
.card__body { padding: 16px 22px 22px; }

.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 40px 24px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--card); color: var(--muted-foreground); }
.empty__icon { width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; background: var(--muted); color: var(--muted-foreground); }
.empty__title { font-size: 1.125rem; font-weight: 500; color: var(--foreground); }

.alert { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--destructive); font-size: .75rem; font-weight: 600; }

/* --- pola formularzy (Pharma: 40 px, promień 10 px) ---------------------------------------- */
.input, .form input[type="text"], .form input[type="email"], .form input[type="password"], .form input[type="search"], .form select, .form textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-md); border: 1px solid var(--input);
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-xs); font-size: .8125rem;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.form textarea, textarea.input { height: auto; min-height: 64px; padding: 8px 12px; line-height: 1.5; resize: vertical; }
.form select, select.input {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2311182a' stroke-opacity='.5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input::placeholder, .form ::placeholder { color: var(--muted-foreground); }
.input:focus, .form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--ring); box-shadow: var(--focus); }
input[type="color"].input { padding: 4px; cursor: pointer; }
@media (max-width: 767px) { .input, .form input, .form select, .form textarea { font-size: 16px; } }
.form { display: grid; gap: 16px; }
.form label, .label { display: block; font-weight: 600; font-size: .8125rem; margin-bottom: 6px; color: var(--foreground); }
.form .help, .help { font-size: .6875rem; color: var(--muted-foreground); margin-top: 4px; display: block; }
.form .errorlist { color: var(--destructive); font-size: .6875rem; list-style: none; padding: 0; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; color: var(--foreground); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* --- dialog (Pharma: natywny <dialog>, 18 px, tło z rozmyciem) ----------------------------- */
.dialog {
  margin: auto; width: 100%; max-width: min(512px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem);
  border: 1px solid var(--border); border-radius: var(--radius-dialog); background: var(--card); color: var(--foreground);
  padding: 22px; box-shadow: var(--shadow-dialog);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.dialog:not([open]) { opacity: 0; transform: scale(.95); }
@starting-style { .dialog[open] { opacity: 0; transform: scale(.95); } }
.dialog::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
.dialog > form { display: grid; gap: 16px; }
.dialog__icon { width: 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center; background: var(--accent); color: var(--accent-foreground); }
.dialog__icon--danger { background: var(--destructive-soft); color: var(--destructive); }
.dialog__title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.dialog__text { font-size: .8125rem; color: var(--muted-foreground); line-height: 1.55; }
.dialog__actions { display: flex; flex-direction: column-reverse; gap: 8px; }
@media (min-width: 640px) { .dialog__actions { flex-direction: row; justify-content: flex-end; } }

/* --- toasty (Pharma: prawy dół, 356 px) ------------------------------------------------------ */
.toasts { position: fixed; z-index: 100; right: 32px; bottom: 32px; width: 356px; display: grid; gap: 8px; }
@media (max-width: 640px) { .toasts { left: 16px; right: 16px; bottom: 16px; width: auto; } }
.toast {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 16px 40px 16px 16px;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--popover); color: var(--foreground);
  box-shadow: var(--shadow-lg); font-size: .75rem; line-height: 1.45;
}
.toast__icon { display: inline-flex; color: var(--success); }
.toast--error { border-color: color-mix(in oklab, var(--destructive) 50%, transparent); }
.toast--error .toast__icon, .toast--warning .toast__icon { color: var(--destructive); }
.toast__close { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: none; border-radius: 6px; color: var(--muted-foreground); cursor: pointer; }
.toast__close:hover { background: var(--muted); color: var(--foreground); }

/* --- paleta poleceń (⌘K) --------------------------------------------------------------------- */
.palette { max-width: min(620px, calc(100% - 2rem)); padding: 0; margin-top: 12vh; overflow: hidden; }
.palette__search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); }
.palette__search input { flex: 1; border: 0; outline: none; background: none; font-size: .9375rem; color: var(--foreground); height: 28px; }
.palette__list { list-style: none; padding: 6px; margin: 0; max-height: min(420px, 60vh); overflow-y: auto; }
.palette__group { padding: 8px 10px 4px; font-size: .65625rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-foreground); }
.palette__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--radius-sm); border: 0; background: none; text-align: left; cursor: pointer; font-size: .8125rem; color: var(--foreground); }
.palette__item.is-active { background: var(--accent); color: var(--accent-foreground); }
.palette__item small { margin-left: auto; color: var(--muted-foreground); font-size: .6875rem; white-space: nowrap; }
.palette__swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.palette__foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: .6875rem; color: var(--muted-foreground); }
.palette__empty { padding: 22px; text-align: center; color: var(--muted-foreground); }

/* --- KPI i wykresy (statystyki) ----------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(5, 1fr); gap: 16px; } .kpis > .kpi:last-child:nth-child(odd) { grid-column: auto; } }
.kpi--shared .kpi__value { color: #a855f7; }
.kpi { padding: 18px 20px; display: block; }
.kpi__label { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-weight: 700; font-size: .65625rem; text-transform: uppercase; letter-spacing: .08em; }
.kpi__value { font-size: 2rem; font-weight: 800; letter-spacing: -0.045em; margin-top: 8px; line-height: 1.1; }
.kpi__foot { margin-top: 4px; font-size: .6875rem; color: var(--muted-foreground); display: flex; gap: 6px; align-items: center; }
.delta { display: inline-flex; padding: 1px 7px; border-radius: 999px; font-weight: 800; font-size: .65625rem; }
.delta--up { background: var(--success-soft); color: var(--success); }
.delta--down { background: var(--destructive-soft); color: var(--destructive); }
.delta--flat { background: var(--muted); color: var(--muted-foreground); }
.charts { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 900px) { .charts { grid-template-columns: 1.7fr 1fr; } }
.chart { width: 100%; height: 260px; }
.chart--sm { height: 220px; }
.statusbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--muted); gap: 2px; }
.statusbar span { display: block; min-width: 6px; }
.statusbar .status--new { background: var(--primary); }
.statusbar .status--in_progress { background: var(--success); }
.statusbar .status--deprecated { background: #94a3b8; }
.statusbar .status--archived { background: #64748b; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .75rem; }
.legend__item { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-foreground); }
.legend__dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.legend__item.status--new, .legend__item.status--in_progress, .legend__item.status--deprecated, .legend__item.status--archived { background: none; border: 0; }
.legend__item b { color: var(--foreground); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kw { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: .6875rem; font-weight: 600; color: var(--foreground); }
.kw b { color: var(--muted-foreground); font-weight: 700; }
a.kw:hover { border-color: var(--primary); color: var(--primary); }

/* --- lista pomysłów --------------------------------------------------------------------------- */
.toolbar { padding: 12px; display: grid; gap: 10px; margin-bottom: 18px; }
.toolbar__row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
.toolbar__row::-webkit-scrollbar { display: none; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--muted-foreground); pointer-events: none; }
.search .input { padding-left: 38px; }
.chip {
  --c: var(--primary);
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); font-size: .6875rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  color: var(--muted-foreground); transition: all var(--t) var(--ease);
}
.chip:hover { color: var(--foreground); border-color: var(--input-strong); }
.chip.is-on { background: color-mix(in oklab, var(--c) 12%, #fff); border-color: color-mix(in oklab, var(--c) 50%, transparent); color: color-mix(in oklab, var(--c) 75%, #11182a); }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.results-count { color: var(--space-muted); font-size: .6875rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.results.htmx-request { opacity: .55; transition: opacity var(--t); }

.idea-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .idea-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .idea-grid { grid-template-columns: repeat(3, 1fr); } }
.idea-card {
  --c: #94a3b8;
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px 20px;
  background: var(--card); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color var(--t);
}
.idea-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.idea-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in oklab, var(--c) 40%, var(--border)); }
.idea-card__top { display: flex; align-items: flex-start; gap: 8px; }
.idea-card__title { font-size: .9375rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; flex: 1; }
.idea-card__num { color: var(--muted-foreground); font-size: .6875rem; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.idea-card__summary { color: var(--muted-foreground); font-size: .78125rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.idea-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; font-size: .6875rem; color: var(--muted-foreground); }
.idea-card__meta .sep { flex: 1; }
.idea-card__link::after { content: ""; position: absolute; inset: 0; }
.star { color: var(--star); display: inline-flex; }
.star .icon { fill: var(--star); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .65625rem; font-weight: 800; background: linear-gradient(135deg, #e81f76, #9b1bd1); color: #fff; flex: none; }
.avatar--sm { width: 20px; height: 20px; font-size: .5625rem; }

/* --- szczegóły -------------------------------------------------------------------------------- */
.detail { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .detail { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; } }
.detail__hero { --c: #94a3b8; padding: 24px; position: relative; overflow: hidden; }
.detail__hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.detail__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.detail__title { font-size: 1.625rem; line-height: 1.18; font-weight: 800; letter-spacing: -0.04em; }
.summary { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); display: flex; gap: 10px; background: var(--accent); color: var(--foreground); font-size: .8125rem; font-weight: 500; }
.summary .icon { color: var(--accent-foreground); margin-top: 2px; }
.prose { margin-top: 18px; color: #2b3650; font-size: .875rem; line-height: 1.7; white-space: pre-line; }
.side { display: grid; gap: 16px; }
@media (min-width: 980px) { .side { position: sticky; top: 92px; } }
.field-label { font-size: .65625rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 8px; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 3px; border-radius: var(--radius); background: var(--muted); }
.segmented button { height: 32px; border-radius: 9px; border: 0; background: transparent; font-size: .6875rem; font-weight: 600; cursor: pointer; color: var(--muted-foreground); }
.segmented button:hover:not([disabled]) { color: var(--foreground); }
.segmented button.is-on { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.segmented button[disabled] { cursor: default; }
.tabs { display: flex; gap: 4px; padding: 3px; margin-bottom: 14px; width: fit-content; max-width: 100%; overflow-x: auto; border-radius: var(--radius); background: var(--muted); }
.tabs__item { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 9px; font-size: .75rem; font-weight: 600; white-space: nowrap; color: var(--muted-foreground); text-decoration: none; }
.tabs__item:hover { color: var(--foreground); }
.tabs__item.is-on { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.readonly-note .card__body { display: flex; gap: 10px; align-items: flex-start; font-size: .75rem; color: var(--muted-foreground); }
.readonly-note b { color: var(--foreground); }
.readonly-note p { margin: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .75rem; }
.facts dt { color: var(--muted-foreground); }
.facts dd { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.timeline { display: grid; gap: 12px; }
.note { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.note__bubble { padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: var(--muted); font-size: .8125rem; }
.note__meta { font-size: .6875rem; color: var(--muted-foreground); margin-bottom: 2px; }
.note-form { display: flex; gap: 8px; }
.history ul { list-style: none; padding: 0; display: grid; gap: 8px; font-size: .75rem; color: var(--muted-foreground); }
.history li { display: flex; gap: 8px; }
.history .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--input-strong); margin-top: 6px; flex: none; }

/* --- worki (statystyki, tryb bez WebGL) ------------------------------------------------- */
.bags { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bag { --c: #6366f1; display: grid; gap: 6px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--foreground); transition: border-color var(--t), transform 220ms var(--ease-out); }
.bag:hover { border-color: var(--c); transform: translateY(-2px); }
.bag__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.bag__name { font-weight: 700; }
.bag__count { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.04em; }
.bag__meta { display: flex; gap: 6px; align-items: center; font-size: .6875rem; color: var(--muted-foreground); }

/* --- logowanie / komunikaty pełnoekranowe ------------------------------------------------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth__card { width: 100%; max-width: 400px; padding: 30px 26px; text-align: center; }
.auth__logo { width: 168px; margin: 0 auto 20px; }
.auth__title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.045em; }
.btn-ms { background: var(--foreground); color: #fff; box-shadow: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-foreground); font-size: .6875rem; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* --- stopka ------------------------------------------------------------------------------- */
.footer { padding: 20px 0 28px; color: var(--space-muted); font-size: .6875rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px dashed var(--space-line); padding-top: 18px; }
.archive-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--space-line); font-weight: 700; color: var(--space-muted); }
.archive-link:hover { color: #fff; border-color: rgb(169 188 220 / 35%); }

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .45s var(--ease-out) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
.palette__search input:focus-visible { box-shadow: none; }
