/* ==========================================================================
   Bugtracker — стилі
   1. Токени  2. База  3. Каркас і меню  4. Компоненти  5. Сторінки  6. Адаптивність
   ========================================================================== */

/* ---------- 1. Токени ---------- */
:root{
  --bg:#f5f2ec; --surface:#fff; --surface-2:#faf8f4;
  --ink:#1b1d26; --ink-2:#444855; --muted:#7c7f8b;
  --line:#e8e3da; --line-2:#f1ede5;
  --side:#171922; --side-2:#232634; --side-line:#2e3140; --side-ink:#b9bcc8;
  --accent:#e4572e; --accent-600:#cc4521; --accent-50:#fdeee8; --accent-ring:rgba(228,87,46,.22);
  --danger:#c62f2a; --danger-600:#a82420; --danger-50:#fdecea;
  --c-new:#4f7fe0; --c-in_progress:#9a5fd6; --c-fixed:#3fa36b; --c-closed:#86b697; --c-wontfix:#a9acb6;
  --r:14px; --r-sm:10px;
  --sh-sm:0 1px 2px rgba(27,29,38,.05);
  --sh-md:0 8px 24px rgba(27,29,38,.09);
  --sh-lg:0 24px 64px rgba(15,17,26,.32);
  --ease:cubic-bezier(.2,.7,.2,1);
  --chip-bg:#eee9df; --chip-fg:#5c5f6b; --line-hover:#d8d2c5; --btn-file-hover:#eee9df; --notif-hover:#fbe6dd; --muted-line:#aaa69b;
  --sev-low-bg:#e4efe4; --sev-low-fg:#3b7a3b; --sev-medium-bg:#fdf0cf; --sev-medium-fg:#8a6a00;
  --sev-high-bg:#fde0d3; --sev-high-fg:#b3470f; --sev-critical-bg:#f9d0d0; --sev-critical-fg:#a21b1b;
  --st-new-bg:#dde8fb; --st-new-fg:#2954a8; --st-prog-bg:#efe2fb; --st-prog-fg:#6b2fa5; --st-done-bg:#e4efe4; --st-done-fg:#3b7a3b;
  --st-wont-bg:#ecebe8; --st-wont-fg:#666; --info-bg:#dde8fb; --info-fg:#2954a8; --ok-bg:#e4efe4; --ok-fg:#2d6a2d;
  --crit-tint:rgba(198,47,42,.045); --danger-border:#efcdca; --danger-border-h:#e5b0ac;
  --auth-glow-1:#fbe0d4; --auth-glow-2:#efe7d8;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#11131a; --surface:#1a1d27; --surface-2:#1f2330;
  --ink:#e9eaf0; --ink-2:#c4c7d2; --muted:#8e92a4;
  --line:#2b2f3e; --line-2:#242836;
  --side:#0c0e13; --side-2:#1a1d27; --side-line:#262a37;
  --accent-50:rgba(228,87,46,.15); --accent-ring:rgba(228,87,46,.35);
  --danger:#e5524d; --danger-600:#cf4540; --danger-50:rgba(229,82,77,.15);
  --c-new:#6b96ec; --c-closed:#6f9f81;
  --sh-sm:0 1px 2px rgba(0,0,0,.35); --sh-md:0 8px 24px rgba(0,0,0,.4); --sh-lg:0 24px 64px rgba(0,0,0,.6);
  --chip-bg:#2a2e3d; --chip-fg:#b7bacb; --line-hover:#3a3f52; --btn-file-hover:#2c3040; --notif-hover:#2a2430; --muted-line:#5d6275;
  --sev-low-bg:rgba(79,170,110,.18); --sev-low-fg:#7fd09d; --sev-medium-bg:rgba(232,185,58,.17); --sev-medium-fg:#efcb63;
  --sev-high-bg:rgba(228,87,46,.2); --sev-high-fg:#ff9d78; --sev-critical-bg:rgba(229,82,77,.24); --sev-critical-fg:#ff8d88;
  --st-new-bg:rgba(107,150,236,.2); --st-new-fg:#9db9f5; --st-prog-bg:rgba(154,95,214,.22); --st-prog-fg:#c9a3f0; --st-done-bg:rgba(79,170,110,.18); --st-done-fg:#7fd09d;
  --st-wont-bg:#2a2e3d; --st-wont-fg:#a3a7b8; --info-bg:rgba(107,150,236,.18); --info-fg:#9db9f5; --ok-bg:rgba(79,170,110,.18); --ok-fg:#7fd09d;
  --crit-tint:rgba(229,82,77,.07); --danger-border:rgba(229,82,77,.4); --danger-border-h:rgba(229,82,77,.65);
  --auth-glow-1:#2a1a17; --auth-glow-2:#1a1d27;
  color-scheme:dark;
}

/* ---------- 2. База ---------- */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 Manrope,system-ui,-apple-system,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
a{color:inherit;text-decoration:none}
a:hover{color:var(--accent)}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
h1{font-size:28px;font-weight:800;letter-spacing:-.025em;line-height:1.2;margin:0}
h2{margin:0}
h3{margin:20px 0 8px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.card>h3:first-child,.card>form>h3:first-child{margin-top:0}
.muted{color:var(--muted)}.small{font-size:12.5px}.pre{white-space:pre-wrap;overflow-wrap:anywhere}.nowrap{white-space:nowrap}
.sub{margin:4px 0 0;color:var(--muted);font-size:14px}.sub b{color:var(--ink)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ic{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.code{font-family:"JetBrains Mono",ui-monospace,monospace;font-weight:500;color:var(--accent);letter-spacing:-.01em}
.code{white-space:nowrap}
.code.big{font-size:14px}
.accent-link{color:var(--accent);font-weight:600}.accent-link:hover{text-decoration:underline}
.note{padding:6px 2px 2px;margin:0}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* ---------- 3. Каркас і меню ---------- */
.shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh}
.side{background:var(--side);color:var(--side-ink);padding:24px 14px 18px;display:flex;flex-direction:column;gap:22px;position:sticky;top:0;height:100vh;overflow-y:auto}
.brand{display:flex;align-items:center;gap:10px;padding:0 10px;font-weight:800;font-size:20px;letter-spacing:-.02em;color:#fff}
.brand:hover{color:#fff}
.dot{width:12px;height:12px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px rgba(228,87,46,.2)}
.side nav{display:flex;flex-direction:column;gap:2px}
.side nav a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:var(--r-sm);color:var(--side-ink);font-weight:500;transition:background .15s,color .15s}
.side nav a .ic{opacity:.75;transition:color .15s,opacity .15s}
.side nav a:hover{background:var(--side-2);color:#fff}
.side nav a.active{background:var(--side-2);color:#fff;box-shadow:inset 3px 0 0 var(--accent)}
.side nav a.active .ic{color:var(--accent);opacity:1}
.count{margin-left:auto;background:var(--accent);color:#fff;border-radius:99px;min-width:22px;padding:0 7px;font-size:12px;font-weight:700;line-height:20px;text-align:center}
.sound{display:flex;align-items:center;gap:10px;background:transparent;border:1px solid var(--side-line);color:var(--side-ink);border-radius:var(--r-sm);padding:9px 12px;font:inherit;font-size:13px;font-weight:500;cursor:pointer;text-align:left;transition:background .15s,color .15s}
.sound:hover{background:var(--side-2);color:#fff}
.sound[aria-pressed="true"] .off,.sound[aria-pressed="false"] .on{display:none}
.sound[aria-pressed="true"] .on{color:var(--accent)}
.side-tools{display:flex;flex-direction:column;gap:8px}
:root[data-theme="dark"] .t-sun,:root:not([data-theme="dark"]) .t-moon{display:none}
#theme-toggle .ic{color:var(--accent)}
.me{margin-top:auto;padding:16px 8px 0;border-top:1px solid var(--side-line);display:flex;align-items:center;gap:12px;font-size:13px}
.avatar{width:36px;height:36px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:800;font-size:15px;flex:none}
.me-info{min-width:0;display:flex;flex-direction:column;align-items:flex-start;line-height:1.35}
.me-name{color:#fff;font-weight:700;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.me form{margin:0}
.logout{background:none;border:0;padding:0;color:#ff8a69;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
.logout:hover{color:#ffab93;text-decoration:underline}
.main{padding:36px 48px 56px;max-width:1680px;width:100%;margin-inline:auto;min-width:0}
.head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px 24px;margin-bottom:24px;flex-wrap:wrap}
.head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.head-actions form{margin:0}
.crumb{display:inline-flex;align-items:center;gap:6px;margin-bottom:10px;color:var(--muted);font-size:13px;font-weight:600}
.crumb .ic{width:15px;height:15px}.crumb:hover{color:var(--accent)}

/* ---------- 4. Компоненти ---------- */
/* кнопки */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--accent);color:#fff;border:1px solid transparent;border-radius:var(--r-sm);padding:10px 18px;font:inherit;font-weight:600;line-height:1.25;cursor:pointer;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 1px 2px rgba(204,69,33,.35);transition:background .15s,border-color .15s,box-shadow .15s,transform .06s}
.btn:hover{background:var(--accent-600);color:#fff}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn.block{width:100%}
.btn.sm{padding:7px 12px;font-size:13px}
.btn.ghost{background:var(--surface);color:var(--ink);border-color:var(--line);box-shadow:var(--sh-sm)}
.btn.ghost:hover{background:var(--surface-2);border-color:var(--line-hover);color:var(--ink)}
.btn.danger{background:var(--danger);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 2px rgba(168,36,32,.35)}
.btn.danger:hover{background:var(--danger-600)}
.btn.danger-ghost{background:var(--surface);color:var(--danger);border-color:var(--danger-border);box-shadow:none}
.btn.danger-ghost:hover{background:var(--danger-50);color:var(--danger-600);border-color:var(--danger-border-h)}
.icon-btn{display:inline-grid;place-items:center;width:34px;height:34px;border:0;border-radius:9px;background:transparent;color:var(--muted-line);cursor:pointer;transition:background .15s,color .15s}
.icon-btn:hover{background:var(--surface-2);color:var(--ink)}
.icon-btn.danger:hover{background:var(--danger-50);color:var(--danger)}
.icon-btn:disabled{opacity:.5;cursor:progress}
.link{background:none;border:0;color:var(--accent);cursor:pointer;font:inherit;font-weight:600;padding:0}
.link:hover{text-decoration:underline}.link.danger-link{color:var(--danger)}

/* картки */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:22px;margin-bottom:20px;box-shadow:var(--sh-sm)}
.card.flush{padding:0;overflow:hidden}
.empty{display:flex;flex-direction:column;align-items:center;gap:4px;padding:36px 16px;text-align:center}
.empty b{font-size:16px}.empty span{color:var(--muted);font-size:14px}

/* поля */
select,input,textarea{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-sm);font:inherit;color:var(--ink);background-color:var(--surface);transition:border-color .15s,box-shadow .15s}
input::placeholder,textarea::placeholder{color:#a3a5af}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring)}
textarea{resize:vertical;min-height:92px;line-height:1.5}
select{appearance:none;padding-right:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c7f8b' stroke-width='2.5' 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 12px center;cursor:pointer}
input[type=checkbox]{width:auto;accent-color:var(--accent)}
input[type=file]{padding:7px;cursor:pointer}
input[type=file]::file-selector-button{margin-right:12px;padding:6px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);font:inherit;font-weight:600;font-size:13px;color:var(--ink);cursor:pointer}
input[type=file]::file-selector-button:hover{background:var(--btn-file-hover)}
label{display:block;font-weight:600;font-size:14px;margin-bottom:6px}
.form{max-width:760px}
.form>div{margin-bottom:16px}
.helptext{color:var(--muted);font-size:12.5px;margin:-2px 0 6px}
.errorlist{color:var(--danger);margin:4px 0 6px;padding:0;list-style:none;font-size:13px}
.search{position:relative;flex:1 1 280px;margin:0;font-weight:400}
.search .ic{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
.search input{padding-left:38px}

/* бейджі й теги */
.badge{display:inline-flex;align-items:center;gap:6px;padding:1px 10px;border-radius:99px;font-size:12px;font-weight:600;line-height:20px;background:var(--chip-bg);color:var(--ink-2);white-space:nowrap}
.badge[class*="st-"]::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.75}
.sev-low{background:var(--sev-low-bg);color:var(--sev-low-fg)}.sev-medium{background:var(--sev-medium-bg);color:var(--sev-medium-fg)}
.sev-high{background:var(--sev-high-bg);color:var(--sev-high-fg)}.sev-critical{background:var(--sev-critical-bg);color:var(--sev-critical-fg)}
.st-new{background:var(--st-new-bg);color:var(--st-new-fg)}.st-in_progress{background:var(--st-prog-bg);color:var(--st-prog-fg)}
.st-fixed,.st-closed{background:var(--st-done-bg);color:var(--st-done-fg)}.st-wontfix{background:var(--st-wont-bg);color:var(--st-wont-fg)}
.badge.perm{background:var(--st-done-bg);color:var(--st-done-fg);margin-right:4px}
.chip{display:inline-block;padding:0 9px;border-radius:99px;font-size:12px;font-weight:600;line-height:20px;background:var(--chip-bg);color:var(--chip-fg);border:0;cursor:pointer;font-family:inherit;transition:background .15s,color .15s}
.chip:hover{background:var(--accent);color:#fff}
.tag-suggest{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}

/* таблиці */
.table-wrap{padding:0;overflow-x:auto}
.table-wrap.allow-pop{overflow:visible}
table{width:100%;border-collapse:collapse}
th{font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);text-align:left;white-space:nowrap}
th,td{padding:14px 16px;border-bottom:1px solid var(--line-2);vertical-align:middle}
thead th{background:var(--surface-2);border-bottom:1px solid var(--line);padding-top:12px;padding-bottom:12px}
thead th:first-child{border-top-left-radius:var(--r)}thead th:last-child{border-top-right-radius:var(--r)}
tbody tr:last-child td{border-bottom:0}
.allow-pop tbody tr:last-child td:first-child{border-bottom-left-radius:var(--r)}
.allow-pop tbody tr:last-child td:last-child{border-bottom-right-radius:var(--r)}
tbody tr{transition:background .12s}
tbody tr:hover td{background:var(--surface-2)}
.bugs td:not(.title){white-space:nowrap}
.bugs tr.row-low{--stripe:#86b697}.bugs tr.row-medium{--stripe:#e8b93a}.bugs tr.row-high{--stripe:#e4572e}.bugs tr.row-critical{--stripe:var(--danger)}
.bugs tbody tr[class*="row-"] td:first-child{box-shadow:inset 4px 0 0 var(--stripe)}
.bugs tr.row-critical td{background:var(--crit-tint)}
th a.sort{display:inline-flex;align-items:center;gap:5px;color:inherit}
th a.sort:hover{color:var(--ink)}
th.sorted a.sort{color:var(--ink)}
.sort-ic{width:13px;height:13px;stroke-width:2.2;opacity:.45}
th.sorted .sort-ic{opacity:1;color:var(--accent)}
.sort-ic.asc{--sd:.25}.sort-ic.desc{--su:.25}
.bugs td.title{min-width:240px}
.bugs a.t{font-weight:600;color:var(--ink)}.bugs a.t:hover{color:var(--accent)}
.bugs .meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;margin-top:3px;font-size:12.5px;color:var(--muted)}
.row-actions{width:1%;white-space:nowrap;text-align:right}
.bugs tr.is-deleting{opacity:.45;pointer-events:none}
.bugs tr.gone{opacity:0;transition:opacity .24s ease}
.bugs .empty-row:hover td{background:transparent}

/* спливайки */
.toasts{position:fixed;right:24px;bottom:24px;display:flex;flex-direction:column;gap:10px;z-index:100;width:min(380px,calc(100vw - 32px));pointer-events:none}
.toast{pointer-events:auto;display:flex;align-items:flex-start;gap:6px;background:var(--side);color:#fff;border-left:4px solid var(--accent);border-radius:12px;padding:13px 8px 13px 16px;box-shadow:var(--sh-lg);animation:toast-in .3s var(--ease)}
.toast-success{border-left-color:#3fa36b}.toast-error{border-left-color:#e5484d}.toast-info{border-left-color:#4f7fe0}
.toast-body{flex:1;min-width:0;color:#fff;font-size:14px;line-height:1.45;overflow-wrap:anywhere}
a.toast-body:hover{color:#fff;text-decoration:underline}
.toast .x{display:grid;place-items:center;width:26px;height:26px;border:0;border-radius:7px;background:none;color:#9a9dab;cursor:pointer;flex:none}
.toast .x:hover{background:rgba(255,255,255,.1);color:#fff}
.toast .x .ic{width:15px;height:15px}
:root[data-theme="dark"] .toast{box-shadow:0 0 0 1px rgba(255,255,255,.08),var(--sh-lg)}
.toast.leaving{animation:toast-out .22s ease forwards}
@keyframes toast-in{from{opacity:0;transform:translateX(24px) scale(.98)}to{opacity:1;transform:none}}
@keyframes toast-out{to{opacity:0;transform:translateX(24px)}}

/* діалог підтвердження */
dialog.modal{border:0;padding:0;background:transparent;width:calc(100vw - 32px);max-width:440px;color:var(--ink);overflow:visible}
dialog.modal::backdrop{background:rgba(15,17,26,.55);backdrop-filter:blur(3px)}
dialog.modal[open]{animation:pop .2s var(--ease)}
.modal-box{background:var(--surface);border-radius:18px;padding:26px;box-shadow:var(--sh-lg)}
.modal-icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--accent-50);color:var(--accent);margin-bottom:14px}
.modal.is-danger .modal-icon{background:var(--danger-50);color:var(--danger)}
.modal-icon .ic{width:22px;height:22px}
.modal-box h2{font-size:19px;font-weight:800;letter-spacing:-.01em;margin:0 0 6px}
.modal-box p{margin:0 0 24px;color:var(--ink-2);overflow-wrap:anywhere}
.modal-actions{display:flex;justify-content:flex-end;gap:10px}
@keyframes pop{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}

/* flash (запасний варіант, якщо JS вимкнено) */
.flash{padding:11px 14px;border-radius:var(--r-sm);background:var(--ok-bg);color:var(--ok-fg);margin-bottom:16px;font-weight:500}
.flash.error{background:var(--danger-50);color:var(--danger-600)}.flash.info{background:var(--info-bg);color:var(--info-fg)}

/* ---------- 5. Сторінки ---------- */
/* список багів + права панель */
.page-grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:24px;align-items:start}
.page-main{min-width:0}
.filters{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:16px}
.filters select{width:auto;min-width:150px}
.rail{position:sticky;top:24px}
.rail-body{display:flex;flex-direction:column;gap:16px}
.rail-card{margin:0;padding:18px}
.rail-title{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:14px}
.rail-title h3{margin:0}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:16px}
.stat{background:var(--surface-2);border:1px solid var(--line-2);border-radius:var(--r-sm);padding:10px 12px}
.stat b{display:block;font-size:24px;font-weight:800;letter-spacing:-.02em;line-height:1.15}
.stat span{font-size:11.5px;font-weight:600;color:var(--muted)}
.stat-hot b{color:var(--accent)}
.bar{display:flex;gap:2px;height:8px;border-radius:99px;overflow:hidden;background:var(--line-2);margin-bottom:12px}
.bar .seg{flex-basis:0;min-width:6px}
.seg-new{background:var(--c-new)}.seg-in_progress{background:var(--c-in_progress)}.seg-fixed{background:var(--c-fixed)}
.seg-closed{background:var(--c-closed)}.seg-wontfix{background:var(--c-wontfix)}
.legend{list-style:none;margin:0;padding:0}
.legend a{display:flex;align-items:center;gap:10px;padding:6px 8px;margin:0 -8px;border-radius:8px;font-size:14px;color:var(--ink-2)}
.legend a:hover{background:var(--surface-2);color:var(--ink)}
.legend a span{flex:1}.legend b{font-weight:700;color:var(--ink)}
.seg-dot{width:9px;height:9px;border-radius:50%;flex:none}
.mini{display:flex;flex-direction:column;gap:3px;padding:10px 8px;margin:0 -8px;border-radius:8px}
.mini:hover{background:var(--surface-2);color:var(--ink)}
.mini-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.mini-title{font-size:14px;font-weight:600;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.feed{list-style:none;margin:0;padding:0 0 0 14px;border-left:2px solid var(--line-2)}
.feed li{position:relative;padding:0 0 14px 14px;font-size:13.5px;line-height:1.45;overflow-wrap:anywhere}
.feed li:last-child{padding-bottom:0}
.feed li::before{content:"";position:absolute;left:-21px;top:6px;width:10px;height:10px;border-radius:50%;background:var(--surface);border:2px solid var(--accent)}

/* картка бага */
.grid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:start}
.col{min-width:0}
.side-card{position:sticky;top:24px}
dl{margin:0 0 18px;display:grid;grid-template-columns:auto 1fr;gap:8px 16px}
dt{color:var(--muted);font-size:14px}dd{margin:0;font-weight:500}
.timeline{list-style:none;margin:0 0 18px;padding:0 0 0 6px}
.timeline li{padding:10px 0 10px 18px;border-left:2px solid var(--line);position:relative}
.timeline li::before{content:"";position:absolute;left:-6px;top:17px;width:10px;height:10px;border-radius:50%;background:var(--line)}
.tl-comment{background:var(--surface-2);border-radius:0 var(--r-sm) var(--r-sm) 0;margin-bottom:6px}
.tl-comment::before{background:var(--accent)!important}
.tl-comment p{margin:4px 0 0}
.tl-event{color:var(--muted);font-size:14px}.tl-event b{color:var(--ink-2)}
.files{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px;margin-bottom:14px}
.thumb img{height:110px;border-radius:var(--r-sm);border:1px solid var(--line);display:block;transition:border-color .15s,transform .15s}
.thumb:hover img{border-color:var(--accent);transform:translateY(-1px)}
.filelink{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface-2);font-weight:500}
.upload-row{display:flex;gap:10px;align-items:center}.upload{margin-bottom:16px}

/* нова форма + підказки */
.form-layout{display:grid;grid-template-columns:minmax(0,880px) 340px;gap:24px;align-items:start}
.form-layout .form{max-width:none}
.tips{position:sticky;top:24px;background:var(--surface-2)}
.tips ol{margin:0;padding-left:20px;color:var(--ink-2);font-size:14px}
.tips li{margin-bottom:10px;padding-left:4px}.tips li:last-child{margin:0}

/* команди */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px}
.cards .card{margin:0}
.team{transition:border-color .15s,box-shadow .15s,transform .15s}
.team:hover{border-color:var(--accent);box-shadow:var(--sh-md);transform:translateY(-2px);color:inherit}
.team h3{margin:0 0 6px;font-size:17px;font-weight:800;letter-spacing:-.01em;text-transform:none;color:var(--ink)}
.team p{margin:0}
.split{display:grid;grid-template-columns:repeat(auto-fit,minmax(360px,1fr));gap:20px;align-items:start}
.split>.card{margin:0}.split .form{max-width:none}
.actions{white-space:nowrap;text-align:right}.actions form{display:inline;margin:0}
details{position:relative;display:inline-block;margin-right:14px;text-align:left}
details summary{cursor:pointer;color:var(--accent);font-weight:600;list-style:none}
details summary::-webkit-details-marker{display:none}
details summary:hover{text-decoration:underline}
.member-form{position:absolute;right:0;z-index:5;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;margin-top:8px;min-width:270px;box-shadow:var(--sh-md);white-space:normal}
.member-form label{display:block;font-weight:600;margin-bottom:10px}
.member-form label.check{font-weight:400;display:flex;gap:8px;align-items:center}
.invite{border-top:1px solid var(--line);padding:14px 0 0;margin-top:14px}
.invite-url{display:flex;gap:8px;margin-bottom:8px}
.invite .inline{display:inline;margin-left:10px}
.join{max-width:520px;margin:8vh auto}

/* сповіщення */
.notif{display:flex;align-items:baseline;gap:12px;padding:14px 20px;border-bottom:1px solid var(--line-2);transition:background .12s}
.notif:last-child{border-bottom:0}.notif:hover{background:var(--surface-2);color:inherit}
.notif-text{flex:1;min-width:0;overflow-wrap:anywhere}.notif-time{white-space:nowrap}
.notif.unread{font-weight:600;background:var(--accent-50);box-shadow:inset 3px 0 0 var(--accent)}
.notif.unread:hover{background:var(--notif-hover)}
#notif-list .note{padding:28px 20px;text-align:center}

/* вхід / реєстрація */
.auth{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(900px 520px at 12% -10%,var(--auth-glow-1) 0,transparent 62%),radial-gradient(700px 420px at 100% 110%,var(--auth-glow-2) 0,transparent 60%),var(--bg)}
.auth-wrap{width:min(420px,100%)}
.auth-brand{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:20px;font-weight:800;font-size:22px;letter-spacing:-.02em}
.auth-card{max-width:none;padding:30px;box-shadow:var(--sh-md);margin:0}
.auth-card h1{font-size:24px}.auth-card .sub{margin:4px 0 22px}
.auth-alt{margin:18px 0 0;text-align:center}.auth-alt a{color:var(--accent);font-weight:600}

/* ---------- 6. Адаптивність ---------- */
@media (max-width:1240px){
  .page-grid{grid-template-columns:minmax(0,1fr)}
  .rail{position:static}
  .rail-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));align-items:start}
  .form-layout{grid-template-columns:minmax(0,1fr)}.tips{position:static}
}
@media (max-width:980px){
  .grid{grid-template-columns:minmax(0,1fr)}.side-card{position:static}
}
@media (max-width:860px){
  .shell{grid-template-columns:minmax(0,1fr)}
  .side{position:static;height:auto;flex-direction:row;flex-wrap:wrap;align-items:center;gap:12px 16px;padding:14px 16px}
  .side nav{flex-direction:row;flex-wrap:wrap;order:3;width:100%}
  .side nav a{padding:8px 12px}
  .sound{margin-left:auto}
  .me{margin:0;padding:0;border:0}
  .main{padding:22px 16px 40px}
  .table-wrap{overflow-x:auto}
  h1{font-size:24px}
  .toasts{right:16px;bottom:16px}
}

/* ---------- профіль і аватарки ---------- */
.avatar{overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar.xs{width:24px;height:24px;font-size:11px}
.avatar.lg{width:112px;height:112px;font-size:44px;box-shadow:0 0 0 4px var(--accent-50)}
.me-avatar{display:flex;flex:none;border-radius:50%}
.me-avatar:hover .avatar{box-shadow:0 0 0 3px var(--accent-ring)}
a.me-name:hover{color:var(--accent);text-decoration:underline}
.uchip{display:inline-flex;align-items:center;gap:8px;color:inherit;font-weight:600;max-width:100%;vertical-align:middle}
.uchip span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.uchip:hover{color:var(--accent)}
.tl-comment .uchip,.tl-event .uchip{margin-right:2px}

.profile-head{display:flex;align-items:center;gap:28px;flex-wrap:wrap;padding:28px}
.profile-info{flex:1;min-width:240px}
.profile-info h1{margin-bottom:2px}
.profile-bio{margin:12px 0 0;max-width:62ch;color:var(--ink-2)}
.profile-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:14px}

.stat-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:20px}
.stat-grid .stat{background:var(--surface);border-color:var(--line);box-shadow:var(--sh-sm);border-radius:var(--r);padding:18px 20px}
.stat-grid .stat b{font-size:34px}
.stat-grid .stat span{font-size:13px}
.stat-ok b{color:var(--c-fixed)}

.sevbars{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.sevbars li{display:grid;grid-template-columns:96px minmax(0,1fr) 32px;align-items:center;gap:12px;font-size:14px}
.sevbars-label{color:var(--ink-2);font-weight:600}
.sevbars b{text-align:right}
.sevbars-track,.rate-track{display:block;height:10px;border-radius:99px;background:var(--line-2);overflow:hidden}
.sevbars-fill,.rate-track i{display:block;height:100%;border-radius:99px;min-width:0}
.sevbars-low{background:#86b697}.sevbars-medium{background:#e8b93a}.sevbars-high{background:var(--accent)}.sevbars-critical{background:var(--danger)}
.rate{display:flex;align-items:baseline;gap:12px;margin-bottom:12px}
.rate b{font-size:40px;font-weight:800;letter-spacing:-.03em;color:var(--c-fixed);line-height:1}
.rate-track i{background:var(--c-fixed)}

.avatar-edit{display:flex;align-items:center;gap:24px;flex-wrap:wrap;padding-bottom:20px;margin-bottom:20px!important;border-bottom:1px solid var(--line-2)}
.avatar-edit-fields{flex:1;min-width:240px;display:flex;flex-direction:column;gap:6px}
.avatar-edit-fields .check{display:flex;align-items:center;gap:8px;font-weight:500}
.avatar-edit-fields p{margin:0}
.form-actions{display:flex;gap:10px;flex-wrap:wrap}
.profile-form textarea{resize:vertical}
.profile-form .errorlist{list-style:none;margin:4px 0;padding:0;color:var(--danger-600);font-size:13px;font-weight:600}
@media (max-width:860px){
  .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .profile-head{gap:18px;padding:20px}
  .avatar.lg{width:84px;height:84px;font-size:34px}
}

/* ---------- API-токени ---------- */
.token-new{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring)}
.token-new input{font-family:"JetBrains Mono",monospace;font-size:13px}
