/* motywy: okno wyboru (górny pasek), konfigurator w Ustawieniach i podgląd w kolorach motywu */

/* ---- lista motywów ---- */
.tlist { display:flex; flex-direction:column; gap:6px; }
.titem { display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:8px 12px; border-radius:10px; background:var(--col); color:var(--text); box-shadow:inset 0 0 0 1px var(--line); }
.titem:hover { background:var(--line); }
.titem.on { background:var(--selbg-p); color:var(--sel-text); box-shadow:inset 0 0 0 2px var(--accent); font-weight:600; }
.titem .tn { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.titem small { opacity:.7; font-weight:400; font-size:.72rem; }
.swatches { display:inline-flex; flex:0 0 auto; }
.swatches i { width:14px; height:22px; box-shadow:inset 0 0 0 1px rgba(128,128,128,.45); }
.swatches i:first-child { border-radius:6px 0 0 6px; }
.swatches i:last-child { border-radius:0 6px 6px 0; }
.swatches i + i { margin-left:-1px; }

/* ---- okno wyboru motywu: lista po lewej, podgląd po prawej ---- */
dialog.modal.themedlg { width:min(780px, 94vw); }
.tdlg { display:grid; grid-template-columns:190px 1fr; gap:16px; align-items:start; }
.tdlg .tprev { min-width:0; }

/* ---- konfigurator w Ustawieniach: formularz po lewej, duży podgląd na żywo po prawej ---- */
.thpage { display:grid; grid-template-columns:minmax(340px, 520px) minmax(0, 1fr); gap:28px; align-items:start; }
.thleft { display:flex; flex-direction:column; gap:12px; min-width:0; }
.thleft .uh { margin-bottom:0; }
.thleft p.hint { margin:0; }
.thform { display:flex; flex-direction:column; gap:12px; margin-top:6px; padding-top:14px; border-top:1px solid var(--line); }
.thsec { border:1px solid var(--line); border-radius:10px; padding:0 12px 10px; }
.thsec > summary { cursor:pointer; padding:10px 0; font-weight:600; font-size:.85rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.throw { display:flex; flex-direction:column; gap:6px; padding:8px 0; border-top:1px dashed var(--line); }
.thcap { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; font-size:.9rem; }
.glink { font-size:.7rem; font-weight:600; padding:1px 8px; border-radius:10px; background:var(--selbg-p); color:var(--sel-text); }
.thctl { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.tmode { width:auto; padding:5px 8px; }
.tangle { width:auto; padding:5px 8px; }
.cpair { display:inline-flex; align-items:center; gap:6px; }
.cpair input[type=color] { width:40px; height:32px; padding:2px; cursor:pointer; border-radius:8px; flex:0 0 auto; }
.cpair input.hex { width:92px; padding:5px 8px; font-family:ui-monospace, Consolas, monospace; text-transform:lowercase; }
.cpair input.hex.bad { border-color:var(--danger); }
.thgroups { display:flex; flex-direction:column; gap:8px; }
.thgroups .subh { margin-bottom:0; }
.thgroups p.hint { margin:0; }
.grow { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 10px; background:var(--col); border-radius:8px; }
.gchips { display:flex; flex-wrap:wrap; gap:4px; flex:1; min-width:0; }
.gchip { font-size:.75rem; padding:1px 8px; border-radius:10px; background:var(--selbg-p); color:var(--sel-text); }
.thwarn { color:#e2830f; font-size:.82rem; display:flex; flex-direction:column; gap:3px; }
.thwarn:empty { display:none; }
.thform .tfoot { margin-top:4px; flex-wrap:wrap; max-width:none; }
.thright { position:sticky; top:0; display:flex; flex-direction:column; gap:10px; min-width:0; }
textarea.tjson { font-family:ui-monospace, Consolas, monospace; font-size:.82rem; min-height:200px; white-space:pre; }

/* ---- podgląd: mini tablica i okno modalne; rozmiar zależy od font-size (okno 11px, konfigurator 15px) ---- */
.tp { font-size:11px; display:flex; flex-direction:column; border-radius:.8em; overflow:hidden; background:var(--bg-p); color:var(--text);
  box-shadow:0 0 0 1px var(--btn-edge), 0 2px 8px rgba(0,0,0,.18); text-align:left; line-height:1.25; user-select:none; pointer-events:none; }
.tp.big { font-size:14px; }
.tp b { font-weight:700; }
.tp svg { flex:0 0 auto; }
.tp-top { display:flex; align-items:center; gap:.6em; padding:.5em .8em; background:var(--topbar-p); border-bottom:1px solid var(--bar-line);
  --text:var(--bar-text); --muted:var(--bar-muted); color:var(--bar-text); }
.tp-logo { width:1.7em; height:1.7em; border-radius:.5em; background:var(--bplus-p); flex:0 0 auto; }
.tp-sp { flex:1; }
.tp-ico svg { width:1.4em; height:1.4em; fill:none; stroke:var(--nav-s); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; }
.tp-av { width:2.4em; height:2.4em; font-size:.7em; border-radius:50%; background:var(--avatar-p); color:var(--on-avatar); display:inline-flex; align-items:center; justify-content:center; font-weight:700; flex:0 0 auto; }
.tp-av.sm { font-size:.6em; }
.tp-body { display:grid; grid-template-columns:27% 1fr; min-height:0; }
.tp-side { background:var(--side-p); padding:.7em .6em; display:flex; flex-direction:column; gap:.3em; border-right:1px solid var(--side-line); min-width:0;
  --text:var(--side-text); --muted:var(--side-muted); --col:var(--side-col); color:var(--side-text); }
.tp-node { margin-left:.4em; padding:.25em .4em; border-radius:.35em; border-left:.2em solid transparent; display:flex; align-items:center; gap:.4em; min-width:0; }
.tp-node.sel { background:var(--side-col); border-left-color:var(--accent); font-weight:600; }
.tp-name { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.tp-team svg { width:1.2em; height:1.2em; fill:var(--team-f); stroke:none; display:block; }
.tp-plus { width:1.8em; height:1.8em; border-radius:50%; background:var(--bplus-p); color:var(--on-bplus); display:inline-flex; align-items:center; justify-content:center; font-weight:700; align-self:flex-start; flex:0 0 auto; }
.tp-side .tp-plus { margin:.3em 0 0 .5em; }
.tp-main { padding:.6em; display:flex; flex-direction:column; gap:.45em; min-width:0; }
.tp-pname { font-size:1.3em; }
.tp-grid { display:grid; grid-template-columns:minmax(0,1.15fr) repeat(3, minmax(0,1fr)); gap:.4em; }
.tp-cols span { background:var(--ccp) top left / 100% .25em no-repeat, var(--colbg-p); border-radius:.4em; padding:.55em .4em .3em; font-weight:600; font-size:.85em; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.tp-cols span:first-child { background:none; }
.tp-cols i { font-style:normal; font-weight:600; opacity:.75; margin-left:.3em; }
.tp-cols i.over { background:#f59e0b; color:#111827; opacity:1; font-weight:700; padding:0 .45em; border-radius:.8em; }
.tp-row { background:var(--colbg-p); border-radius:.6em; padding:.4em; align-items:stretch; }
.tp-task { background:var(--task-p); border-left:.3em solid var(--rc); border-radius:.45em; padding:.4em .5em; display:flex; flex-direction:column; gap:.35em; min-width:0;
  --text:var(--task-text); --muted:var(--task-muted); color:var(--task-text); }
.tp-bar { display:flex; height:.5em; border-radius:.3em; background:var(--prog-p); overflow:hidden; }
.tp-bar i { display:block; }
.tp-foot { display:flex; align-items:center; justify-content:space-between; gap:.3em; }
.tp-foot small { color:var(--task-muted); font-size:.8em; }
.tp-cell { background:color-mix(in srgb, var(--cc) 10%, transparent); border-radius:.45em; padding:.3em; min-height:3.2em; min-width:0; overflow:hidden; }
.tp-act { background:var(--act-p); color:var(--act-text); border-left:.28em solid var(--cc); border-radius:.4em; padding:.35em .4em; display:flex; justify-content:space-between; align-items:center; gap:.3em; box-shadow:0 1px 2px rgba(0,0,0,.2); }
.tp-act > span:first-child, .tp-task > b { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tp-lower { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:.6em; align-items:start; }
.tp-samples { display:flex; flex-direction:column; gap:.35em; padding:.2em 0; min-width:0; }
.tp-samples small { color:var(--muted); font-size:.85em; }
.tp-samples hr { width:100%; border:0; border-top:1px solid var(--line); margin:.2em 0; }
.tp-modal { border-radius:.6em; overflow:hidden; background:var(--modal-p); color:var(--modal-text); box-shadow:0 0 0 1px var(--modal-line), 0 .4em 1.2em rgba(0,0,0,.25); }
.tp-mhead { background:var(--mhead-p); color:var(--mhead-text); font-weight:700; padding:.45em .6em; border-bottom:1px solid var(--modal-line); }
.tp-mbody { padding:.5em .6em; display:flex; flex-direction:column; gap:.35em; }
.tp-input { background:var(--inbg-p); color:var(--in-text); border:1px solid var(--inbd); border-radius:.35em; padding:.3em .5em; }
.tp-opt { padding:.25em .5em; border-radius:.3em; }
.tp-opt.sel { background:var(--selbg-p); color:var(--sel-text); font-weight:600; }
.tp-btns { display:flex; flex-wrap:wrap; gap:.35em; margin-top:.15em; }
.tp-b { padding:.25em .7em; border-radius:.4em; font-weight:600; }
.tp-b.pri { background:var(--bp-p); color:var(--on-bp); }
.tp-b.sec { background:var(--bs-p); color:var(--on-bs); box-shadow:inset 0 0 0 1px var(--btn-edge); }
.tp-b.dng { background:var(--bd-p); color:var(--on-bd); }

/* wąska strona (małe okno, telefon): podgląd nad formularzem */
@media (max-width: 1150px) {
  .thpage { grid-template-columns:1fr; }
  .thright { position:sticky; top:0; z-index:4; order:-1; background:var(--bg-p); padding-bottom:8px; }   /* podgląd zostaje widoczny podczas zmiany kolorów */
  .thright .tp.big { font-size:11px; }
}
@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  .tdlg { grid-template-columns:1fr; }
  .tdlg .tlist { flex-direction:row; flex-wrap:wrap; }
  .tdlg .titem { width:auto; }
  .thpage { grid-template-columns:1fr; }
  .thright { position:static; padding-bottom:0; }
  .tp-lower { grid-template-columns:1fr; }
}
.titem .tn small { display:block; font-weight:400; color:var(--muted); font-size:.75rem; }
