/* MASTER AI — Galaktyka wiedzy. Wszystkie klasy z prefiksem gx-. Zmienne pochodzą z app.css; wartości po przecinku to zapas. */
.gx-root {
  --gx-bg0: var(--bg-0, #040607); --gx-bg1: var(--bg-1, #090d0f); --gx-bg2: var(--bg-2, #0f1518); --gx-bg3: var(--bg-3, #151d21);
  --gx-line: var(--line, #1c2a2f); --gx-line2: var(--line-2, #2a3d44); --gx-text: var(--text, #e8f3f0); --gx-muted: var(--muted, #8fa7a0); --gx-dim: var(--dim, #5d736c);
  --gx-green: var(--green, #1fe08f); --gx-emerald: var(--emerald, #0fb37a); --gx-blue: var(--blue, #2aa8ff); --gx-electric: var(--electric, #35c8ff);
  --gx-warn: var(--warn, #ffb547); --gx-danger: var(--danger, #ff5d6c); --gx-r: var(--r, 10px);
  display: flex; flex-direction: column; height: 100%; min-height: 420px; min-width: 0;
  color: var(--gx-text); font-family: var(--font, 'Google Sans', system-ui, sans-serif); font-size: 13px; line-height: 1.4;
}
.gx-root *, .gx-root *::before, .gx-root *::after { box-sizing: border-box; }
.gx-root [hidden] { display: none !important; }
.gx-root button, .gx-root input, .gx-root select { font: inherit; color: inherit; }
.gx-root :focus-visible { outline: 2px solid var(--gx-electric); outline-offset: 2px; }
.gx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gx-muted { color: var(--gx-muted); margin: 4px 0; }
.gx-err, .gx-warn { color: var(--gx-warn); }
.gx-err { color: var(--gx-danger); }
.gx-hint { color: var(--gx-dim); font-size: 12px; margin: 10px 0 0; }

/* pasek narzędzi */
.gx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; border-bottom: 1px solid var(--gx-line); background: var(--gx-bg1); }
.gx-seg { display: inline-flex; border: 1px solid var(--gx-line2); border-radius: var(--gx-r); overflow: hidden; background: var(--gx-bg2); }
.gx-seg-btn { border: 0; background: none; padding: 7px 12px; cursor: pointer; color: var(--gx-muted); min-height: 34px; white-space: nowrap; transition: background .15s, color .15s; }
.gx-seg-btn + .gx-seg-btn { border-left: 1px solid var(--gx-line2); }
.gx-seg-btn:hover { color: var(--gx-text); background: var(--gx-bg3); }
.gx-seg-btn[aria-pressed="true"] { color: #04130d; background: linear-gradient(135deg, var(--gx-green), var(--gx-electric)); font-weight: 600; }
.gx-seg-sm .gx-seg-btn { padding: 5px 10px; min-height: 30px; font-size: 12px; }
.gx-search { display: flex; gap: 6px; flex: 1 1 220px; min-width: 180px; max-width: 420px; }
.gx-input, .gx-select { background: var(--gx-bg2); border: 1px solid var(--gx-line2); border-radius: var(--gx-r); padding: 6px 10px; min-height: 34px; min-width: 0; }
.gx-input { flex: 1 1 auto; }
.gx-input::placeholder { color: var(--gx-dim); }
.gx-input:focus, .gx-select:focus { border-color: var(--gx-electric); outline: none; box-shadow: 0 0 0 2px rgba(53, 200, 255, .2); }
.gx-select { padding-right: 6px; max-width: 100%; }
.gx-wide { width: 100%; }
.gx-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gx-group { display: inline-flex; align-items: center; gap: 6px; color: var(--gx-muted); }
.gx-count { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--gx-muted); font-variant-numeric: tabular-nums; }
.gx-btn { border: 1px solid var(--gx-line2); background: var(--gx-bg2); border-radius: var(--gx-r); padding: 6px 12px; min-height: 34px; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.gx-btn:hover:not(:disabled) { border-color: var(--gx-electric); background: var(--gx-bg3); }
.gx-btn:disabled { opacity: .45; cursor: default; }
.gx-btn[aria-pressed="true"], .gx-btn[aria-expanded="true"] { border-color: var(--gx-green); color: var(--gx-green); box-shadow: inset 0 0 0 1px rgba(31, 224, 143, .35); }
.gx-ghost { background: none; border-color: transparent; color: var(--gx-muted); }
.gx-ghost:hover:not(:disabled) { color: var(--gx-text); }
.gx-accent { border-color: var(--gx-green); color: var(--gx-green); }
.gx-sm { padding: 3px 9px; min-height: 28px; font-size: 12px; }
.gx-close { padding: 2px 8px; min-height: 28px; }

/* scena */
.gx-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--gx-bg0); }
.gx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline-offset: -3px; }
.gx-canvas.gx-pointer { cursor: pointer; }
.gx-canvas.gx-grabbing { cursor: grabbing; }
.gx-tip { position: absolute; z-index: 4; max-width: 260px; pointer-events: none; padding: 6px 9px; border-radius: 8px; background: rgba(9, 13, 15, .94); border: 1px solid var(--gx-line2); box-shadow: 0 6px 22px rgba(0, 0, 0, .5); }
.gx-tip b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.gx-tip span { display: block; color: var(--gx-muted); font-size: 12px; }
.gx-msg { position: absolute; z-index: 7; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: min(560px, 92%); padding: 8px 14px; border-radius: 999px; background: rgba(9, 13, 15, .94); border: 1px solid var(--gx-line2); color: var(--gx-text); text-align: center; }
.gx-msg.gx-busy::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--gx-green); animation: gx-pulse 1s ease-in-out infinite; }
.gx-msg.gx-msg-err { border-color: var(--gx-danger); color: #ffd7db; border-radius: var(--gx-r); }
@keyframes gx-pulse { 50% { opacity: .25; } }
.gx-pathbar { position: absolute; z-index: 3; left: 10px; right: 10px; top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 10px; border-radius: var(--gx-r); background: rgba(9, 13, 15, .9); border: 1px solid rgba(31, 224, 143, .45); max-height: 40%; overflow: auto; }
.gx-arrow { color: var(--gx-green); }
.gx-pchip { border: 1px solid var(--c, var(--gx-line2)); background: var(--gx-bg2); border-radius: 999px; padding: 2px 10px; min-height: 26px; cursor: pointer; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-pchip:hover { background: var(--gx-bg3); }

/* panele (szkło z umiarem) */
.gx-panel, .gx-hits { background: rgba(9, 13, 15, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--gx-line2); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04); }
.gx-panel { position: absolute; z-index: 5; top: 10px; bottom: 10px; width: min(330px, 86%); overflow: auto; padding: 12px; overscroll-behavior: contain; }
.gx-filters { left: 10px; }
.gx-detail { right: 10px; width: min(390px, 90%); }
.gx-hits { position: absolute; z-index: 6; top: 10px; left: 50%; transform: translateX(-50%); width: min(430px, 92%); max-height: 56%; overflow: auto; padding: 10px 12px; }
.gx-p-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.gx-root h3 { margin: 0; font-size: 14px; font-weight: 600; }
.gx-root h4 { margin: 14px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gx-muted); }
.gx-sec { padding-bottom: 4px; border-bottom: 1px solid var(--gx-line); }
.gx-sec:last-of-type { border-bottom: 0; }
.gx-row { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.gx-check { display: flex; align-items: center; gap: 7px; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.gx-check input { accent-color: var(--gx-green); width: 15px; height: 15px; flex: none; margin: 0; }
.gx-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-check b { margin-left: auto; padding-left: 6px; font-weight: 400; color: var(--gx-dim); font-variant-numeric: tabular-nums; }
.gx-only { opacity: 0; }
.gx-row:hover .gx-only, .gx-only:focus-visible { opacity: 1; }
.gx-locked { color: var(--gx-dim); }
.gx-locked .gx-check { cursor: default; }
.gx-bulk { display: flex; gap: 6px; margin: 6px 0; }
.gx-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; color: transparent; }
.gx-dot-ring { background: none !important; border: 2px solid #7c9cff; }
.gx-lock { position: relative; flex: none; width: 11px; height: 9px; margin: 5px 1px 0 2px; border-radius: 2px; background: var(--gx-dim); }
.gx-lock::before { content: ''; position: absolute; left: 2px; top: -6px; width: 7px; height: 7px; border: 2px solid var(--gx-dim); border-bottom: 0; border-radius: 4px 4px 0 0; }
.gx-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--c, var(--gx-line2)); color: var(--c, var(--gx-text)); font-size: 12px; }

/* trafienia wyszukiwania */
.gx-hitlist, .gx-nblist { display: flex; flex-direction: column; gap: 2px; }
.gx-hit, .gx-nb { display: grid; grid-template-columns: 12px 1fr; align-items: center; column-gap: 8px; text-align: left; border: 0; background: none; border-radius: 8px; padding: 5px 6px; cursor: pointer; min-height: 34px; }
.gx-hit:hover, .gx-nb:hover { background: var(--gx-bg3); }
.gx-hit-n, .gx-nb-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-hit small, .gx-nb small { grid-column: 2; color: var(--gx-dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* szczegóły */
.gx-d-title { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; margin: 4px 0 8px; }
.gx-d-meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 10px; }
.gx-d-meta dt { color: var(--gx-dim); }
.gx-d-meta dd { margin: 0; overflow-wrap: anywhere; }
.gx-d-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--gx-line); }
.gx-d-descr { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; }
.gx-src { border: 1px solid var(--gx-line); border-left: 2px solid var(--gx-electric); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; background: rgba(15, 21, 24, .7); }
.gx-src header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 12px; }
.gx-src header b { font-weight: 600; overflow-wrap: anywhere; }
.gx-src header span, .gx-src small { color: var(--gx-muted); font-size: 11px; }
.gx-src small { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.gx-src p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 190px; overflow: auto; }
.gx-src-off { opacity: .55; border-left-color: var(--gx-dim); }
.gx-hist-list { list-style: none; margin: 0; padding: 0; }
.gx-hist-list li { padding: 3px 0; border-bottom: 1px dashed var(--gx-line); overflow-wrap: anywhere; }
.gx-hist-list time { color: var(--gx-muted); font-variant-numeric: tabular-nums; }
.gx-hist-list small { color: var(--gx-dim); }

/* lista */
.gx-list { position: absolute; inset: 0; overflow: auto; padding: 8px 12px 16px; background: var(--gx-bg0); }
.gx-table { width: 100%; border-collapse: collapse; }
.gx-table th { position: sticky; top: 0; z-index: 1; background: var(--gx-bg1); text-align: left; padding: 0; border-bottom: 1px solid var(--gx-line2); }
.gx-th { width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; color: var(--gx-muted); font-weight: 600; white-space: nowrap; }
.gx-th:hover { color: var(--gx-text); }
.gx-table td { padding: 7px 10px; border-bottom: 1px solid var(--gx-line); vertical-align: top; overflow-wrap: anywhere; }
.gx-table td:first-child { min-width: 180px; }
.gx-table td .gx-dot { margin-right: 8px; }
.gx-table tbody tr { cursor: pointer; }
.gx-table tbody tr:hover { background: var(--gx-bg2); }
.gx-table tr.gx-row-sel { background: rgba(31, 224, 143, .09); box-shadow: inset 2px 0 0 var(--gx-green); }
.gx-num { text-align: right; font-variant-numeric: tabular-nums; }
.gx-new { margin-left: 8px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--gx-green); color: var(--gx-green); font-style: normal; font-size: 11px; }
.gx-more { display: block; margin: 12px auto 0; }

/* modulator czasu */
.gx-time { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-top: 1px solid var(--gx-line); background: var(--gx-bg1); }
.gx-play { width: 38px; padding: 0; text-align: center; color: var(--gx-green); border-color: rgba(31, 224, 143, .5); }
.gx-slider { position: relative; flex: 1 1 260px; min-width: 170px; height: 44px; }
.gx-hist { position: absolute; left: 9px; right: 9px; top: 0; height: 22px; display: flex; align-items: flex-end; gap: 1px; }
.gx-hist i { flex: 1 1 0; min-width: 1px; border-radius: 1px 1px 0 0; background: linear-gradient(180deg, rgba(53, 200, 255, .75), rgba(31, 224, 143, .35)); }
.gx-track { position: absolute; left: 9px; right: 9px; bottom: 9px; height: 4px; border-radius: 2px; background: var(--gx-line2); }
.gx-range-fill { position: absolute; top: 0; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--gx-green), var(--gx-electric)); }
.gx-range { position: absolute; left: 0; bottom: 0; width: 100%; height: 22px; margin: 0; padding: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.gx-range::-webkit-slider-runnable-track { height: 22px; background: none; }
.gx-range::-moz-range-track { height: 22px; background: none; }
.gx-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--gx-bg1); border: 2px solid var(--gx-green); box-shadow: 0 0 10px rgba(31, 224, 143, .55); cursor: ew-resize; }
.gx-range::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--gx-bg1); border: 2px solid var(--gx-green); box-shadow: 0 0 10px rgba(31, 224, 143, .55); cursor: ew-resize; }
.gx-range-b::-webkit-slider-thumb { border-color: var(--gx-electric); box-shadow: 0 0 10px rgba(53, 200, 255, .55); }
.gx-range-b::-moz-range-thumb { border-color: var(--gx-electric); box-shadow: 0 0 10px rgba(53, 200, 255, .55); }
.gx-range:focus-visible { outline: none; }
.gx-range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--gx-text); outline-offset: 2px; }
.gx-range:focus-visible::-moz-range-thumb { outline: 2px solid var(--gx-text); outline-offset: 2px; }
.gx-range:disabled::-webkit-slider-thumb { border-color: var(--gx-dim); box-shadow: none; cursor: default; }
.gx-tlabel { min-width: 150px; font-variant-numeric: tabular-nums; color: var(--gx-text); }
.gx-und { flex: 0 0 auto; color: var(--gx-warn); }
.gx-und b { color: var(--gx-warn); opacity: .8; }
.gx-vis { margin-left: auto; color: var(--gx-muted); font-variant-numeric: tabular-nums; }
.gx-time-off .gx-slider { opacity: .45; }

/* telefon: filtry i szczegóły jako arkusze od dołu, pasek czasu w jednym wierszu */
@media (max-width: 760px) {
  .gx-toolbar { padding: 6px 8px; gap: 6px; }
  .gx-seg:not(.gx-seg-sm) { width: 100%; overflow-x: auto; }
  .gx-seg:not(.gx-seg-sm) .gx-seg-btn { flex: 1 0 auto; padding: 7px 10px; }
  .gx-search { max-width: none; flex: 1 1 100%; }
  .gx-count { margin-left: 0; width: 100%; justify-content: space-between; }
  .gx-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 68%; border-radius: 14px 14px 0 0; border-bottom: 0; }
  .gx-detail { width: auto; }
  .gx-hits { top: 6px; max-height: 48%; }
  .gx-only { opacity: 1; }
  .gx-time { flex-wrap: nowrap; gap: 8px; padding: 6px 8px; }
  .gx-time .gx-seg-sm, .gx-time .gx-vis, .gx-time .gx-hist, .gx-und span { display: none; }
  .gx-slider { flex: 1 1 auto; min-width: 90px; height: 28px; }
  .gx-tlabel { min-width: 0; font-size: 12px; white-space: nowrap; }
  .gx-btn, .gx-seg-btn, .gx-input, .gx-select { min-height: 40px; }
  .gx-sm { min-height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-root *, .gx-root *::before { transition: none !important; animation: none !important; }
}
