/* TVAK Work — оболочка. Палитра совпадает с доской (board/style.css). */
:root{color-scheme:dark;--bg:#191a1d;--panel:#202125;--panel2:#25262b;--line:#34353c;--muted:#9b9ba6;--text:#eeeef0;--accent:#f28b54;--accent-text:#1d1c1f;--accent-soft:rgba(242,139,84,.14);--rail:#141518;--hover:rgba(255,255,255,.055);--input:#1c1d21;--input-line:#41424b;--danger:#e5696b;--danger-soft:rgba(229,105,107,.13);--ok:#6fb593;--warn:#e0b45c;--shadow:0 10px 30px rgba(0,0,0,.45);--link:#edaa80;
 font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:13px;line-height:1.45}
html[data-theme=light]{color-scheme:light;--bg:#f5f5f3;--panel:#fff;--panel2:#ededeb;--line:#d6d6d3;--muted:#666970;--text:#292b30;--accent:#b95421;--accent-text:#fff;--accent-soft:rgba(185,84,33,.1);--rail:#e9e9e6;--hover:rgba(0,0,0,.045);--input:#fff;--input-line:#c9c9c5;--danger:#c23b3d;--danger-soft:rgba(194,59,61,.09);--ok:#2f8a5f;--warn:#9a6b10;--shadow:0 10px 30px rgba(0,0,0,.14);--link:#a64a1b}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text)}
body{overflow:hidden;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
h1,h2,h3,p{margin:0}
a{color:var(--link);text-decoration:none}a:hover{text-decoration:underline}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hidden{display:none!important}
.muted{color:var(--muted)}.center{text-align:center}.nowrap{white-space:nowrap}.grow{flex:1}.pad{padding:12px 0}.block{display:block}
.mono{font-family:ui-monospace,"SF Mono",Consolas,monospace;letter-spacing:.3px}
.ic{display:inline-flex;width:16px;height:16px;flex:none}.ic svg{width:100%;height:100%}

/* Элементы управления */
input,select,textarea{background:var(--input);border:1px solid var(--input-line);border-radius:6px;padding:7px 9px;min-width:0;outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--accent)}
input[type=checkbox]{accent-color:var(--accent);width:15px;height:15px;margin:0;padding:0;cursor:pointer}
select{cursor:pointer}
textarea{resize:none;line-height:1.5}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);background:var(--panel2);border-radius:7px;padding:7px 12px;cursor:pointer;white-space:nowrap;font-weight:500}
.btn:hover{border-color:var(--muted)}
.btn:disabled{opacity:.45;cursor:default}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}
.btn.primary:hover{filter:brightness(1.07)}
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn.danger-outline{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 45%,var(--line))}
.btn.danger-outline:hover{background:var(--danger-soft)}
.btn.sm{padding:4px 9px;font-size:12px;border-radius:6px}
.btn.block{width:100%;padding:9px 12px}
.btn .ic{width:15px;height:15px}
.icon-btn{display:inline-grid;place-items:center;width:30px;height:30px;border:0;background:transparent;border-radius:6px;color:var(--muted);cursor:pointer;flex:none;padding:0}
.icon-btn:hover{background:var(--hover);color:var(--text)}
.icon-btn:disabled{opacity:.35;cursor:default;background:transparent}
.icon-btn.sm{width:24px;height:24px}.icon-btn.sm .ic{width:14px;height:14px}
.link{border:0;background:none;padding:0;color:var(--link);cursor:pointer;font-weight:500}
.link:hover{text-decoration:underline}
.tag{display:inline-block;font-size:11px;padding:1px 7px;border-radius:999px;background:var(--panel2);border:1px solid var(--line);color:var(--muted);margin-left:6px;vertical-align:1px;font-weight:500}
.tag.accent{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 40%,var(--line));background:var(--accent-soft);margin-left:0}
.check{display:inline-flex;align-items:center;gap:7px;cursor:pointer;user-select:none;white-space:nowrap}
.switch{appearance:none;-webkit-appearance:none;width:30px!important;height:17px!important;border-radius:999px;background:var(--line);border:0;position:relative;transition:background .15s;vertical-align:middle}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;transition:transform .15s}
.switch:checked{background:var(--accent)}.switch:checked::after{transform:translateX(13px)}
.switch:disabled{opacity:.45;cursor:not-allowed}

/* Загрузка */
.boot{height:100dvh;display:grid;place-items:center}
.mark{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:9px;background:var(--accent);color:var(--accent-text);font-weight:800;font-size:21px;flex:none}
html:not([data-theme=light]) .mark,html:not([data-theme=light]) .rail-mark{color:#232124}

/* Вход и регистрация */
.auth{min-height:100dvh;display:grid;place-items:center;padding:24px 16px;overflow:auto;height:100dvh}
.auth-card{width:100%;max-width:380px;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:28px}
.auth-card.pending{max-width:460px;text-align:center}
.auth-card.pending .auth-brand{justify-content:center;text-align:left}
.auth-brand{display:flex;align-items:center;gap:11px;margin-bottom:26px}
.auth-brand b{display:block;font-size:15px;letter-spacing:.2px}.auth-brand small{color:var(--muted);font-size:12px}
.auth h1{font-size:20px;font-weight:650;letter-spacing:-.3px;margin-bottom:6px}
.auth-sub{color:var(--muted);margin-bottom:20px;line-height:1.55}
.auth-sub b{color:var(--text)}
.auth-form{display:flex;flex-direction:column;gap:13px}
.auth-error{color:var(--danger);min-height:0;font-size:12.5px}.auth-error:empty{display:none}
.auth-switch{margin-top:18px;color:var(--muted);text-align:center}
.pending-icon{width:52px;height:52px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;margin:0 auto 16px}
.pending-icon .ic{width:24px;height:24px}
.pending-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.net-note{display:flex;align-items:center;gap:6px;justify-content:center;color:var(--warn);font-size:12px;margin-top:16px}
.field{display:flex;flex-direction:column;gap:5px}
.field-label{font-size:12px;font-weight:550;color:var(--muted)}
.field-hint{font-size:11.5px;color:var(--muted)}
.field input,.field select,.field textarea{width:100%}

/* Каркас */
.layout{display:grid;grid-template-columns:64px 1fr;height:100dvh;overflow:hidden}
.main{position:relative;min-width:0;min-height:0;overflow:hidden;background:var(--bg)}
.frames,.view{position:absolute;inset:0}
.board-frame{width:100%;height:100%;border:0;display:block;background:var(--bg)}
.view{overflow:auto}

/* Рельса */
.rail{background:var(--rail);border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:center;padding:10px 0;min-height:0;gap:0}
.rail-top,.rail-bottom{display:flex;flex-direction:column;align-items:center;gap:6px}
.rail-bottom{margin-top:auto;padding-top:8px}
.rail-spaces{display:flex;flex-direction:column;align-items:center;gap:6px;overflow-y:auto;overflow-x:hidden;min-height:0;width:100%;padding:2px 0 4px;scrollbar-width:none}
.rail-spaces::-webkit-scrollbar{display:none}
.rail-mark{width:36px;height:36px;border-radius:9px;background:var(--accent);color:var(--accent-text);border:0;font-weight:800;font-size:20px;cursor:pointer;margin-bottom:6px}
.rail-sep{width:28px;height:1px;background:var(--line);margin:8px 0;flex:none}
.rail-sep.small{width:18px;margin:2px 0}
.rail-item{position:relative;width:64px;display:flex;justify-content:center;flex:none}
.rail-item::before{content:"";position:absolute;left:0;top:50%;width:3px;height:0;border-radius:0 3px 3px 0;background:var(--text);transform:translateY(-50%);transition:height .15s}
.rail-item:hover::before{height:14px}
.rail-item.active::before{height:26px;background:var(--accent)}
.rail-btn{width:40px;height:40px;border-radius:10px;border:0;background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;padding:0;position:relative}
.rail-btn:hover{background:var(--hover);color:var(--text)}
.rail-item.active .rail-btn{color:var(--text);background:var(--hover)}
.rail-btn .ic{width:20px;height:20px}
.rail-btn.add{border:1px dashed var(--line)}
.rail-btn.add:hover{border-color:var(--accent);color:var(--accent);background:transparent}
.space-av{width:40px;height:40px;border-radius:10px;display:grid;place-items:center;font-weight:650;font-size:13.5px;letter-spacing:.3px;color:#fff;background:var(--c);flex:none;user-select:none}
.space-av.personal{background:transparent;color:var(--c);box-shadow:inset 0 0 0 1.5px var(--c);border-radius:50%}
html[data-theme=light] .space-av.personal{color:color-mix(in srgb,var(--c) 80%,#000)}
.space-av.sm{width:26px;height:26px;font-size:10.5px;border-radius:7px}
.space-av.sm.personal{border-radius:50%}
.rail-item.active .rail-btn{background:transparent}
.rail-item.active .space-av{outline:2px solid var(--accent);outline-offset:2px}
.rail-btn:has(.space-av):hover{background:transparent}
.rail-btn:has(.space-av):hover .space-av{filter:brightness(1.1)}
.user-av,.mini-av{display:grid;place-items:center;border-radius:50%;background:var(--c);color:#fff;font-weight:600;flex:none;user-select:none}
.user-av{width:32px;height:32px;font-size:12px}
.mini-av{width:20px;height:20px;font-size:9px;border-radius:5px}
.mini-av.lg{width:34px;height:34px;font-size:12.5px;border-radius:8px}
.mini-av.xl{width:52px;height:52px;font-size:18px;border-radius:12px}
.badge{position:absolute;top:2px;right:8px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--danger);color:#fff;font-size:10px;font-weight:700;display:grid;place-items:center;border:2px solid var(--rail);line-height:1;pointer-events:none;box-sizing:content-box}
.badge.inline{position:static;display:inline-grid;border:0;margin-left:6px;vertical-align:1px}
.dot-unread{position:absolute;top:3px;right:10px;width:9px;height:9px;border-radius:50%;background:var(--text);border:2px solid var(--rail);pointer-events:none}
.net{position:fixed;left:72px;bottom:12px;z-index:30;display:flex;align-items:center;gap:6px;background:var(--panel);border:1px solid color-mix(in srgb,var(--warn) 50%,var(--line));color:var(--warn);font-size:12px;padding:5px 10px;border-radius:999px;box-shadow:var(--shadow)}
.net .ic{width:14px;height:14px}

/* Меню */
.menu{position:fixed;z-index:60;min-width:210px;max-width:300px;background:var(--panel);border:1px solid var(--line);border-radius:9px;padding:5px;box-shadow:var(--shadow)}
.menu-head{padding:8px 10px 9px;border-bottom:1px solid var(--line);margin:-1px 0 5px;display:flex;flex-direction:column;gap:2px;align-items:flex-start}
.menu-head b{font-size:13px;overflow:hidden;text-overflow:ellipsis;max-width:100%;white-space:nowrap}.menu-head small{color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.menu-head .tag{margin-top:5px}
.menu-item{display:flex;align-items:center;gap:9px;width:100%;border:0;background:transparent;padding:7px 10px;border-radius:6px;text-align:left;cursor:pointer}
.menu-item .ic{color:var(--muted)}
.menu-item small{margin-left:auto;color:var(--muted);font-size:11px}
.menu-item:hover,.menu-item:focus-visible{background:var(--hover);outline:none}
.menu-item:disabled{opacity:.4;cursor:default;background:transparent}
.menu-item.danger,.menu-item.danger .ic{color:var(--danger)}
.menu-item.danger:hover{background:var(--danger-soft)}
.menu-sep{height:1px;background:var(--line);margin:5px 0}

/* Диалоги */
.overlay{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.5);display:grid;place-items:center;padding:16px;animation:fade .12s ease-out}
html[data-theme=light] .overlay{background:rgba(30,30,30,.32)}
.dlg{width:100%;max-width:440px;max-height:calc(100dvh - 32px);background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden}
.dlg.wide{max-width:600px}
.dlg-form{display:flex;flex-direction:column;min-height:0}
.dlg-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 16px 6px 20px}
.dlg-head h2{font-size:15px;font-weight:650;overflow-wrap:anywhere}
.dlg-body{padding:8px 20px 4px;display:flex;flex-direction:column;gap:13px;overflow:auto;min-height:0}
.dlg-text{color:var(--muted);line-height:1.55}.dlg-text b{color:var(--text);font-weight:600}
.dlg-error{color:var(--danger);font-size:12.5px;padding:4px 20px 0}.dlg-error:empty{display:none}
.dlg-foot{display:flex;justify-content:flex-end;gap:8px;padding:14px 20px 18px;flex-wrap:wrap}
.pw-row{display:flex;gap:8px}.pw-row input{flex:1}
.people-list{display:flex;flex-direction:column;gap:2px;max-height:min(360px,50dvh);overflow:auto;margin:0 -8px}
.person{display:flex;align-items:center;gap:10px;border:0;background:transparent;padding:7px 8px;border-radius:7px;cursor:pointer;text-align:left}
.person:hover,.person:focus-visible{background:var(--hover)}
.person-main{display:flex;flex-direction:column;min-width:0}.person-main small{color:var(--muted);font-size:12px}
.grant-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.grant-row{display:flex;align-items:center;gap:12px;padding:9px 12px;border-top:1px solid var(--line)}
.grant-row:first-child{border-top:0}
.grant-name{display:flex;align-items:center;gap:9px;flex:1;min-width:0;cursor:pointer}
.grant-name span{display:flex;flex-direction:column;min-width:0}.grant-name small{color:var(--muted);font-size:11px}
.grant-row select{width:160px}
.grant-perm{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
@keyframes fade{from{opacity:0}}

/* Уведомления */
#toasts{position:fixed;z-index:70;bottom:18px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{background:var(--text);color:var(--bg);padding:8px 14px;border-radius:8px;box-shadow:var(--shadow);font-weight:500;max-width:min(480px,90vw);animation:fade .15s;transition:opacity .25s}
.toast.error{background:var(--danger);color:#fff}
.toast.out{opacity:0}

/* Пустые состояния */
.empty{max-width:460px;margin:12vh auto 0;padding:0 20px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px}
.empty.small{margin-top:14vh}
.empty h1{font-size:19px;font-weight:650;letter-spacing:-.2px}
.empty p{color:var(--muted);line-height:1.6}
.empty-mark{width:54px;height:54px;border-radius:14px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-weight:800;font-size:28px;margin-bottom:6px}
.empty-icon{width:48px;height:48px;border-radius:12px;background:var(--panel2);color:var(--muted);display:grid;place-items:center;margin-bottom:4px}
.empty-icon .ic{width:22px;height:22px}
.empty-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:8px}

/* Чат */
.view-chat{overflow:hidden}
.chat{display:grid;grid-template-columns:260px 1fr;height:100%;min-height:0}
.chat-panel{background:var(--panel);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}
.chat-panel-head{display:flex;align-items:center;justify-content:space-between;height:52px;padding:0 10px 0 16px;border-bottom:1px solid var(--line);flex:none}
.chat-panel-head h2{font-size:15px;font-weight:650}
.chat-panel-scroll{overflow:auto;padding:8px 8px 16px;flex:1;min-height:0}
.ch-group{margin-bottom:12px}
.ch-group-head{display:flex;align-items:center;justify-content:space-between;padding:4px 2px 3px 8px;gap:6px}
.ch-group-name{font-size:11px;font-weight:650;color:var(--muted);text-transform:uppercase;letter-spacing:.6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch-item{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;color:var(--muted);text-decoration:none!important;min-height:30px}
.ch-item:hover{background:var(--hover);color:var(--text)}
.ch-item.active{background:var(--accent-soft);color:var(--text)}
.ch-item.active .ch-hash{color:var(--accent)}
.ch-item.unread{color:var(--text);font-weight:650}
.ch-hash{width:15px;height:15px;color:var(--muted);opacity:.85}
.ch-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.count{background:var(--danger);color:#fff;font-size:10.5px;font-weight:700;border-radius:9px;padding:1px 6px;min-width:18px;text-align:center}
.ch-add{display:flex;align-items:center;gap:8px;width:100%;border:0;background:transparent;color:var(--muted);padding:5px 8px;border-radius:6px;cursor:pointer;font-size:12.5px;text-align:left}
.ch-add:hover{background:var(--hover);color:var(--text)}
.ch-add .ic{width:14px;height:14px}
.ch-empty{color:var(--muted);padding:6px 8px 12px;font-size:12.5px;line-height:1.5}
.chat-main{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bg)}
.chat-head{display:flex;align-items:center;gap:10px;height:52px;padding:0 12px 0 20px;border-bottom:1px solid var(--line);flex:none;background:var(--bg)}
.chat-head .back{display:none}
.chat-title{flex:1;min-width:0}
.chat-title h2{font-size:14.5px;font-weight:650;display:flex;align-items:center;gap:7px;min-width:0}
.chat-title h2 .t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-title h2 .ch-hash{width:16px;height:16px}
.chat-topic{color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head-actions{display:flex;align-items:center;gap:6px}
.msgs-wrap{position:relative;flex:1;min-height:0}
.msgs{position:absolute;inset:0;overflow-y:auto;padding:12px 0 8px;outline:none}
.msgs-loading,.msgs-more{color:var(--muted);text-align:center;padding:16px;font-size:12px}
.msgs-intro{padding:22px 20px 14px;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.msgs-intro .intro-icon{width:52px;height:52px;border-radius:12px;background:var(--panel2);display:grid;place-items:center;color:var(--muted);margin-bottom:4px}
.msgs-intro .intro-icon .ic{width:24px;height:24px}
.msgs-intro h3{font-size:17px;font-weight:650}
.msgs-intro p{color:var(--muted);max-width:620px}
.day-sep{display:flex;align-items:center;gap:12px;margin:14px 20px 6px;color:var(--muted);font-size:11.5px;font-weight:600}
.day-sep::before,.day-sep::after{content:"";flex:1;height:1px;background:var(--line)}
.msg{position:relative;display:grid;grid-template-columns:44px 1fr;gap:0 10px;padding:2px 20px 2px 16px}
.msg.first{margin-top:8px;padding-top:4px}
.msg:hover{background:var(--hover)}
.msg-gutter{display:flex;justify-content:center;padding-top:2px}
.msg-time-side{visibility:hidden;color:var(--muted);font-size:10.5px;padding-top:3px;white-space:nowrap}
.msg:hover .msg-time-side{visibility:visible}
.msg-body{min-width:0}
.msg-head{display:flex;align-items:baseline;gap:8px;margin-bottom:1px}
.msg-author{font-weight:650;font-size:13.5px}
.msg-head time{color:var(--muted);font-size:11px}
.msg-text{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;line-height:1.5}
.msg-text a{text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--link) 40%,transparent);text-underline-offset:2px}
.msg.deleted .msg-text{color:var(--muted);font-style:normal;font-size:12.5px}
.edited{color:var(--muted);font-size:11px;white-space:nowrap}
.msg-actions{position:absolute;right:16px;top:-12px;display:none;gap:2px;background:var(--panel);border:1px solid var(--line);border-radius:7px;padding:2px;box-shadow:0 2px 8px rgba(0,0,0,.2)}
.msg:not(.first) .msg-actions{top:-14px}
.msg:hover .msg-actions,.msg:focus-within .msg-actions{display:flex}
.msg.editing .msg-actions{display:none}
.msg.editing{background:var(--accent-soft)}
.edit-box{display:flex;flex-direction:column;gap:6px;margin:3px 0 4px}
.edit-area{width:100%;min-height:38px}
.edit-foot{display:flex;align-items:center;gap:6px}.edit-foot small{color:var(--muted);font-size:11px}
.jump{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);display:flex;align-items:center;gap:6px;background:var(--accent);color:var(--accent-text);border:0;border-radius:999px;padding:6px 13px;font-weight:600;cursor:pointer;box-shadow:var(--shadow);font-size:12px}
.jump .ic{width:14px;height:14px}
.composer{padding:6px 20px 12px;flex:none}
.composer-box{display:flex;align-items:flex-end;gap:6px;background:var(--panel);border:1px solid var(--input-line);border-radius:10px;padding:6px 6px 6px 12px}
.composer-box:focus-within{border-color:var(--accent)}
.composer textarea{flex:1;border:0;background:transparent;padding:5px 0;min-height:30px;max-height:40vh;outline:none;overflow-y:auto}
.send-btn{width:32px;height:32px;border-radius:7px;border:0;background:var(--accent);color:var(--accent-text);display:grid;place-items:center;cursor:pointer;flex:none;padding:0}
.send-btn:disabled{background:var(--panel2);color:var(--muted);cursor:default}
.send-btn .ic{width:16px;height:16px}
.composer-hint{font-size:11px;color:var(--muted);padding:4px 2px 0}

/* Админка */
.admin{max-width:1180px;margin:0 auto;padding:22px 28px 40px}
.admin-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);margin-bottom:18px;flex-wrap:wrap}
.admin-head h1{font-size:19px;font-weight:650;letter-spacing:-.2px;padding-bottom:12px}
.tabs{display:flex;gap:4px}
.tab{padding:9px 12px 11px;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px;font-weight:550;text-decoration:none!important;display:inline-flex;align-items:center}
.tab:hover{color:var(--text)}
.tab.active{color:var(--text);border-bottom-color:var(--accent)}
.toolbar{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.toolbar .search{width:260px}
.notice{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:8px;background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line));margin-bottom:14px}
.notice .ic{color:var(--accent)}
.table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:9px;background:var(--panel)}
.card.flush .table-wrap{border:0;border-radius:0}
.table{width:100%;border-collapse:collapse}
.table th{text-align:left;font-size:11px;font-weight:650;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);padding:9px 12px;border-bottom:1px solid var(--line);white-space:nowrap;background:var(--panel)}
.table td{padding:9px 12px;border-top:1px solid var(--line);vertical-align:middle}
.table tbody tr:first-child td{border-top:0}
.table tbody tr:hover td{background:var(--hover)}
.table .num{text-align:right;font-variant-numeric:tabular-nums}
.table .actions{text-align:right;white-space:nowrap}
.table .actions>*{vertical-align:middle;margin-left:4px}
.table th.center,.table td.center{text-align:center}
.table tr.pending td{background:var(--accent-soft)}
.table tr.pending td:first-child{box-shadow:inset 3px 0 0 var(--accent)}
.table tr.blocked td{opacity:.62}
.table tr.blocked td.actions{opacity:1}
.cell-user{display:flex;align-items:center;gap:9px;min-width:0}
.cell-user b{font-weight:600;white-space:nowrap}
.cell-user .mini-av{width:26px;height:26px;font-size:10px;border-radius:7px}
.status{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.status::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--muted)}
.status.active::before{background:var(--ok)}
.status.pending{color:var(--accent);font-weight:600}.status.pending::before{background:var(--accent)}
.status.blocked{color:var(--danger)}.status.blocked::before{background:var(--danger)}
.chips{display:flex;flex-wrap:wrap;gap:4px;max-width:300px}
.chip{font-size:11.5px;padding:1px 7px;border-radius:5px;background:var(--panel2);border:1px solid var(--line);white-space:nowrap}
.chip-mark{color:var(--accent)}
.space-head{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.space-head h2{font-size:16px;font-weight:650}
.card{background:var(--panel);border:1px solid var(--line);border-radius:9px;padding:14px 16px;margin-bottom:14px}
.card.flush{padding:0;overflow:hidden}
.card h3{font-size:13px;font-weight:650;margin-bottom:10px}
.add-member{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.add-member select:first-child{flex:1;min-width:220px;max-width:420px}
.members-table select{min-width:150px}

/* Адаптив */
.hide-sm{}
@media (max-width:760px){
 .layout{grid-template-columns:1fr;grid-template-rows:1fr auto}
 .main{grid-row:1}
 .rail{grid-row:2;flex-direction:row;height:calc(58px + env(safe-area-inset-bottom));padding:0 4px env(safe-area-inset-bottom);border-right:0;border-top:1px solid var(--line);align-items:center;gap:0}
 .rail-top,.rail-bottom{flex-direction:row;gap:0}
 .rail-bottom{margin:0;padding:0}
 .rail-mark{display:none}
 .rail-spaces{flex-direction:row;overflow-x:auto;overflow-y:hidden;flex:1;width:auto;padding:0 2px;gap:0}
 .rail-sep{width:1px;height:26px;margin:0 4px}
 .rail-sep.small{width:1px;height:16px;margin:0 2px}
 .rail-item{width:50px}
 .rail-item::before{left:50%;top:-9px;transform:translateX(-50%);width:0;height:3px!important;border-radius:0 0 3px 3px}
 .rail-item:hover::before{width:0}
 .rail-item.active::before{width:22px}
 .badge{right:2px}
 .dot-unread{right:4px}
 .net{left:50%;transform:translateX(-50%);bottom:72px}
 .chat{grid-template-columns:1fr}
 .chat .chat-main{display:none}
 .chat.has-channel .chat-panel{display:none}
 .chat.has-channel .chat-main{display:flex}
 .chat-panel{border-right:0}
 .chat-head{padding:0 8px 0 4px}
 .chat-head .back{display:inline-grid}
 .msg{padding:2px 12px 2px 8px;grid-template-columns:38px 1fr;gap:0 8px}
 .msg-actions{display:flex;position:static;grid-column:2;justify-self:end;margin:2px 0;box-shadow:none;background:transparent;border:0}
 .msg:not(:hover):not(:focus-within) .msg-actions{display:none}
 .composer{padding:6px 10px 10px}
 .composer-hint{display:none}
 .hide-sm{display:none}
 .admin{padding:14px 12px 30px}
 .admin-head{align-items:flex-start;flex-direction:column;gap:4px}
 .admin-head h1{padding-bottom:2px}
 .toolbar .search{width:100%}
 .toolbar select{flex:1;min-width:130px}
 .table td,.table th{padding:8px 9px}
 .users-table th:nth-child(2),.users-table td:nth-child(2),.users-table th:nth-child(4),.users-table td:nth-child(4),.users-table th:nth-child(5),.users-table td:nth-child(5),.users-table th:nth-child(6),.users-table td:nth-child(6){display:none}
 .grant-row{flex-wrap:wrap;row-gap:8px}.grant-name{flex-basis:100%}.grant-perm{flex:1}.grant-row select{width:auto;flex:1}
 .members-table thead{display:none}
 .members-table tr{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:8px 14px;padding:10px 12px;border-top:1px solid var(--line)}
 .members-table tbody tr:first-child{border-top:0}
 .members-table td{padding:0;border:0!important;background:none!important}
 .members-table td:first-child{grid-column:1/3}
 .members-table td.actions{grid-column:3;grid-row:1}
 .members-table td[data-label]{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
 .members-table td[data-label]::before{content:attr(data-label)}
 .members-table td[data-label="Задачи"] select{min-width:0;flex:1;color:var(--text)}
 .members-table td[data-label="Задачи"]{grid-column:1/-1}
 .members-table td[data-label="Чат"]{grid-column:1;justify-content:flex-start}
 .members-table td[data-label="Управление"]{grid-column:2/-1;justify-content:flex-end}
 .add-member select:first-child{min-width:100%}
 .dlg-foot .btn{flex:1}
 .auth-card{padding:22px 18px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
