/* Панель Inquisitor Time на сайті — для комп'ютера (сайдбар із групами й розділами), на телефоні — меню-шухляда.
 * Айдентика Time Town (графіт, латунь) зі сталевим сяйвом Інквізитора (#5B8DEF), як на сайті й у макеті панелі v4. */
:root {
  --ink: #0B0F17; --side: #0E1420; --panel: #131A26; --panel2: #18212F; --line: #263244;
  --ivory: #EAE5D7; --soft: #B6BFCC; --dust: #8E9BB0; --gold: #E2BE6A;
  --steel: #5B8DEF; --steel-hi: #8CB0F5; --red: #E0786E; --green: #7FC4A0;
  --display: "Playfair Display", Georgia, serif; --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; background: var(--ink); color: var(--ivory); font: 400 15.5px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--steel-hi); outline-offset: 2px; }
a { color: var(--steel-hi); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
code { font: 500 13px var(--mono); color: var(--steel-hi); background: rgba(91,141,239,.12); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; }
p { margin: 6px 0 0; }
.muted { color: var(--dust); }

/* вхід */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(60% 60% at 70% 10%, rgba(91,141,239,.2), transparent 60%), radial-gradient(50% 50% at 10% 100%, rgba(226,190,106,.08), transparent 60%), #0B1424; }
.login-card { width: min(460px, 100%); text-align: center; background: rgba(19,26,38,.85); border: 1px solid var(--line); border-radius: 24px; padding: 36px 30px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-card h1 { font-size: 30px; margin-top: 14px; }
.login-card p { color: var(--soft); }
.login-card .small { font-size: 13px; color: var(--dust); margin-top: 18px; }
.login-card .warn { color: var(--red); }
.crest { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 34px;
  background: radial-gradient(circle at 35% 30%, #23375A, #0B1220); box-shadow: 0 0 0 1px rgba(226,190,106,.5), 0 0 40px rgba(91,141,239,.35); }
.crest.sm { width: 38px; height: 38px; font-size: 18px; margin: 0; flex: none; }
.tg-login { min-height: 48px; margin-top: 22px; display: flex; justify-content: center; }

/* каркас */
.shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ivory); text-decoration: none; font: 800 19px var(--display); padding: 4px 6px 14px; }
.brand small { display: block; font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dust); }
.side-label { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dust); padding: 6px 6px 2px; }
.side-empty { color: var(--dust); font-size: 13.5px; padding: 0 6px; }
.chat-sel { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.nav { display: grid; gap: 2px; margin-top: 14px; }
.nav-b { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--soft); text-align: left; cursor: pointer; }
.nav-b:hover { background: var(--panel); color: var(--ivory); }
.nav-b.on { background: rgba(91,141,239,.16); color: #fff; box-shadow: inset 3px 0 0 var(--steel); }
.count { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; text-align: center; }
.side-foot { margin-top: auto; padding: 14px 6px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.side-foot a { text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: rgba(11,15,23,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-title h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--soft); white-space: nowrap; }
.pill.admin { border-color: var(--steel); color: var(--steel-hi); }
.user { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; white-space: nowrap; }
.user small { color: var(--dust); }
.ghost { min-height: 36px; padding: 6px 14px; border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.ghost:hover { border-color: var(--steel); }
.burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 18px; }
.content { padding: 28px; max-width: 1100px; width: 100%; }
.head { margin-bottom: 18px; }
.head h2 { font-size: 30px; }
.head p { max-width: 75ch; }
h3.sub { font-size: 20px; margin: 26px 0 10px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.card + .card, .stats + .card, .add + .card { margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; text-align: left; }
.stat b { display: block; font: 600 28px var(--body); font-variant-numeric: tabular-nums; }
.stat span { color: var(--dust); font-size: 13.5px; }
.stat.link { cursor: pointer; }
.stat.link:hover { border-color: var(--steel); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-weight: 600; cursor: pointer; margin-top: 10px; }
.btn:hover { border-color: var(--steel); }
.btn.primary { background: var(--steel); border-color: var(--steel); color: #fff; }
.btn.danger { border-color: rgba(224,120,110,.5); color: #F2A79F; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; margin-top: 0; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* налаштування */
.groups { columns: 2 380px; column-gap: 14px; }
.group { break-inside: avoid; margin: 0 0 14px; }
.group h3 { font-size: 18px; margin-bottom: 6px; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid rgba(38,50,68,.7); }
.group h3 + .set { border-top: 0; }
.set > span { color: var(--soft); }
.toggle { flex: none; width: 48px; height: 28px; border-radius: 999px; border: 1px solid var(--line); background: #0B1220; position: relative; cursor: pointer; padding: 0; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dust); transition: transform .15s, background .15s; }
.toggle.on { background: rgba(91,141,239,.35); border-color: var(--steel); }
.toggle.on i { transform: translateX(20px); background: #fff; }
.set select { min-height: 36px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); }
.val { flex: none; min-height: 34px; padding: 4px 12px; border-radius: 10px; border: 1px dashed var(--line); background: transparent; cursor: pointer; font-variant-numeric: tabular-nums; }
.val:hover { border-color: var(--steel); }
.val span { color: var(--dust); }
.edit { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.edit input { width: 130px; min-height: 36px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--steel); background: #0B1220; font-size: 16px; }
.edit .hint { width: 100%; text-align: right; font-size: 12.5px; color: var(--dust); }

/* списки */
.item-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.link { font-size: 14px; }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid rgba(38,50,68,.7); }
.row:first-child { border-top: 0; padding-top: 0; }
.row p { overflow-wrap: anywhere; }
.rules { white-space: pre-wrap; }
.add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.add label { display: grid; gap: 4px; font-size: 13.5px; color: var(--dust); }
.add .grow { flex: 1 1 260px; }
.add input, .add textarea { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #0B1220; font-size: 16px; resize: vertical; }
.add .btn { margin-top: 0; }
.table-wrap { overflow-x: auto; padding: 6px 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dust); padding: 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid rgba(38,50,68,.6); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; padding: 10px 18px; border-radius: 12px; background: #1F2A3C; border: 1px solid var(--steel); box-shadow: 0 10px 30px rgba(0,0,0,.4); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 10; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 60px rgba(0,0,0,.6); }
  .menu-open .side { transform: none; }
  .burger { display: grid; place-items: center; }
  .top { padding: 10px 14px; gap: 10px; }
  .top-title h1 { font-size: 18px; }
  .user > span { display: none; }
  .content { padding: 18px 14px; }
  .head h2 { font-size: 24px; }
  .table thead { display: none; }
  .table tr { display: grid; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table td { display: flow-root; border: 0; padding: 2px 4px 2px 6.5em; }
  .table td::before { content: attr(data-l); float: left; width: 6em; margin-left: -6.5em; color: var(--dust); font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .side, .toggle i { transition: none; } }

/* привітання, правила, списки (26.11) */
.stack { display: grid; gap: 10px; margin-top: 12px; }
.stack textarea { width: 100%; min-height: 96px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #0B1220; font-size: 16px; line-height: 1.5; resize: vertical; }
.add select { min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #0B1220; font-size: 16px; }
.small { font-size: 13.5px; }
.preview { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(11,18,32,.6); overflow-wrap: anywhere; }
.preview-label { display: block; font-size: 12px; color: var(--dust); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.preview .mention { color: var(--steel-hi); }
.preview .spoiler { background: var(--line); color: transparent; border-radius: 4px; }
.preview .spoiler:hover { color: inherit; }
.preview blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--steel); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14.5px; overflow-wrap: anywhere; }
.chip-x { border: 0; background: none; color: var(--dust); cursor: pointer; min-width: 28px; min-height: 28px; border-radius: 50%; }
.chip-x:hover { color: var(--ivory); background: rgba(255,255,255,.06); }
