:root {
  color-scheme: dark;
  --canvas: #0c0c0c;
  --sidebar: #131313;
  --surface: #191919;
  --surface-2: #222222;
  --surface-3: #2b2b2b;
  --text: #f4f4f1;
  --muted: #999b99;
  --accent: #f4f4f1;
  --accent-soft: #303230;
  --brand: #69df91;
  --aqua: var(--brand);
  --green: var(--brand);
  --danger: #ff7d7d;
  --border: #2b3b42;
  --shadow: 0 20px 60px #05090b66;
}
:root[data-theme="harbor"] { --canvas:#0b121a;--sidebar:#111d28;--surface:#172633;--surface-2:#203440;--surface-3:#294450;--text:#eff7f8;--muted:#92aab4;--accent:#63a2ff;--accent-soft:#243c55;--border:#2c4653; }
:root[data-theme="ember"] { --canvas:#151111;--sidebar:#1e1918;--surface:#251e1c;--surface-2:#332825;--surface-3:#42332e;--text:#fff5e9;--muted:#b8a49a;--accent:#ff806c;--accent-soft:#4a2923;--border:#49342e; }
:root[data-theme="orchard"] { --canvas:#0d100e;--sidebar:#151916;--surface:#1b211c;--surface-2:#252d26;--surface-3:#303a31;--text:#f2f5ed;--muted:#99a096;--accent:#b8e65a;--accent-soft:#303c22;--border:#364137; }
:root[data-theme="afterglow"] { --canvas:#121019;--sidebar:#1b1725;--surface:#211b2d;--surface-2:#2e253d;--surface-3:#3a304b;--text:#faf4ff;--muted:#ad9fba;--accent:#b69cff;--accent-soft:#35294d;--border:#443754; }
:root[data-theme="frost"] { --canvas:#10161b;--sidebar:#182128;--surface:#1d2931;--surface-2:#273640;--surface-3:#31444f;--text:#f2f7f8;--muted:#9aacb5;--accent:#7dc6ed;--accent-soft:#263f4c;--border:#344954; }
:root[data-theme="monochrome"] { --canvas:#0c0c0c;--sidebar:#131313;--surface:#191919;--surface-2:#222;--surface-3:#2b2b2b;--text:#f4f4f1;--muted:#999b99;--accent:#f4f4f1;--accent-soft:#303230;--border:#363636; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--canvas); color: var(--text); font: 18px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
.desktop-titlebar{display:none}
.krit-desktop .app,.krit-desktop .auth-shell{height:calc(100% - 38px);margin-top:38px}
.krit-desktop .desktop-titlebar{position:fixed;z-index:10000;inset:0 0 auto;display:grid;place-items:center;height:38px;background:var(--canvas);border-bottom:1px solid var(--border);user-select:none;-webkit-user-select:none;app-region:drag;-webkit-app-region:drag}
.krit-desktop #desktop-window-title{position:absolute;left:50%;display:block;max-width:calc(100vw - 430px);padding:0 14px;overflow:hidden;color:var(--text);font-size:12px;font-weight:750;line-height:26px;text-align:center;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;transform:translateX(-50%)}
.krit-desktop .desktop-titlebar .desktop-update{position:absolute;right:142px;top:3px;display:flex;align-items:center;justify-content:center;gap:3px;width:auto;min-width:50px;height:32px;padding:0 7px;border:0;border-radius:6px;color:var(--brand);background:transparent;app-region:no-drag;-webkit-app-region:no-drag}.desktop-update:hover{background:var(--surface-3)!important}
.desktop-update span{display:block;font-size:18px;font-weight:900;line-height:1}.desktop-update small{position:static;display:block;min-width:0;padding:0;color:inherit;background:none;font-size:9px;font-weight:800;line-height:1}.desktop-update.ready{animation:update-ready-pulse 1.8s ease-in-out infinite}.desktop-update.downloading span{animation:update-spin 1s linear infinite}@keyframes update-ready-pulse{50%{box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 12%,transparent)}}@keyframes update-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.desktop-update.ready,.desktop-update.downloading span{animation:none}}
.desktop-window-controls{display:none}.krit-linux .desktop-window-controls{position:absolute;right:0;top:0;display:grid;grid-template-columns:repeat(3,46px);height:38px;app-region:no-drag;-webkit-app-region:no-drag}.krit-linux .desktop-window-controls button{display:grid;place-items:center;width:46px;height:38px;min-width:0;padding:0;border:0;border-radius:0;color:var(--muted);background:transparent;font-size:16px;line-height:1}.krit-linux .desktop-window-controls button:hover{color:var(--text);background:var(--surface-3)}.krit-linux .desktop-window-controls button:last-child:hover{color:#fff;background:#c42b1c}
button, input, select, textarea { font: inherit; }
button { color: inherit; background: var(--surface-3); border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer; transition: background .15s, color .15s, transform .15s; }
button:hover { background: #30444d; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { width: 100%; color: var(--text); background: #0f191e; border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #f2b84b20; }
label { display: grid; gap: 6px; color: #c4cfd2; font-size: 15.6px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { min-height: 20px; margin: 0; color: #ff9b9b; font-size: 13px; }
.primary { background: var(--brand); color: #102017; font-weight: 800; }
.primary:hover { background: #8af0aa; }
.link-button { background: transparent; color: var(--brand); padding: 3px; }

.brand-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border-radius: 18px 18px 18px 6px; background: var(--brand); color: #102017; font-size: 27px; font-weight: 950; box-shadow: 0 10px 30px #69df9130; }
.brand-mark:has(img) { background: transparent; box-shadow: none; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-mark.small { flex: 0 0 auto; width: 42px; height: 42px; margin: 0; border-radius: 14px 14px 14px 5px; font-size: 20px; }
.brand-word { font-size: 17px; font-weight: 850; letter-spacing: -.02em; }
.auth-shell { display: grid; place-items: center; width: 100%; height: 100%; padding: 22px; overflow-y: auto; background: radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--surface-3) 70%, transparent) 0, transparent 34%), radial-gradient(circle at 88% 85%, color-mix(in srgb, var(--brand) 12%, transparent) 0, transparent 31%), var(--canvas); }
.auth-card { display: grid; gap: 16px; width: min(430px, 100%); padding: 38px; border: 1px solid var(--border); border-radius: 28px 28px 28px 10px; background: #172329ee; box-shadow: var(--shadow); }
.auth-card h1 { margin: 8px 0 -12px; text-align: center; letter-spacing: -.04em; }
.auth-card > p { text-align: center; }
.desktop-downloads { display: grid; gap: 10px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--border); }
.krit-desktop .desktop-downloads { display: none; }
.download-heading { color: var(--muted); font-size: 13px; text-align: center; }
.download-buttons a { display: grid; place-items: center; min-height: 42px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface-2); font-size: 13px; font-weight: 750; text-decoration: none; }
.download-buttons a:hover { border-color: var(--accent); }

/* Focus Stack: quiet utilities, spaces, contextual navigation, conversation, people. */
.app { display: grid; grid-template: minmax(0, 1fr) / 70px var(--dm-rail-width,46px) minmax(220px,260px) minmax(0,1fr) 250px; grid-template-areas: "spaces direct navigation conversation people"; gap: 8px; width: 100%; height: 100%; padding: 10px; background: var(--canvas); }
.dm-rail-collapsed .app{--dm-rail-width:12px}
.dm-bubbles-normal .app{--dm-rail-width:58px}
.utility-rail { grid-area: utilities; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 0; padding: 10px 5px; border: 1px solid var(--border); border-radius: 20px 8px 8px 20px; background: color-mix(in srgb, var(--sidebar) 90%, var(--canvas)); }
.utility-button { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 12px; color: var(--muted); background: transparent; font-size: 19px; }
.utility-button:hover { color: var(--text); background: var(--surface-2); }
.utility-button.active, .utility-button[aria-current="page"] { border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); }
.utility-button:focus-visible, .mobile-primary-nav button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.utility-voice { margin-top: auto; }
.utility-voice.connected { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.utility-badge { position: absolute; top: 4px; right: 3px; min-width: 8px; height: 8px; border: 2px solid var(--sidebar); border-radius: 99px; background: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.guild-rail { grid-area: spaces; display: flex; flex-direction: column; align-items: center; gap: 9px; min-height: 0; min-width: 0; padding: 10px 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--sidebar); }
.dm-rail{grid-area:direct;position:relative;display:grid;grid-template-rows:auto minmax(0,1fr) auto;justify-items:center;gap:7px;min-width:0;padding:7px 3px;border:1px solid var(--border);border-radius:8px;background:var(--sidebar);transition:width .16s,opacity .16s}.dm-rail-top,.dm-rail-bottom{display:grid;gap:5px}.dm-rail-control,.dm-bubble{position:relative;display:grid;place-items:center;width:40px;height:40px;min-width:40px;padding:0;border-radius:11px;background:transparent}.dm-rail-control:hover,.dm-bubble:hover{background:var(--surface-2)}.dm-bubbles{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}.dm-bubble-avatar{display:grid;place-items:center;width:24px;height:24px;overflow:hidden;border-radius:50%;font-size:9px;font-weight:800;background:var(--surface-3)}.dm-bubble-avatar img{width:100%;height:100%;object-fit:cover}.dm-bubble.selected{box-shadow:inset 3px 0 var(--brand)}.dm-bubble.unread::before{content:'';position:absolute;left:1px;width:4px;height:12px;border-radius:3px;background:var(--brand)}.dm-bubble .presence-dot{position:absolute;right:5px;bottom:5px;width:7px;height:7px;border:1px solid var(--sidebar)}.dm-bubble>b{position:absolute;right:0;top:0;min-width:14px;height:14px;padding:0 3px;border-radius:8px;color:var(--canvas);background:var(--brand);font-size:8px;line-height:14px}.dm-rail[data-size=normal]{--bubble-avatar:34px}.dm-rail[data-size=normal] .dm-bubble-avatar{width:34px;height:34px;font-size:12px}.dm-rail[data-size=normal] .dm-bubble,.dm-rail[data-size=normal] .dm-rail-control{width:48px;height:48px}.dm-rail[data-size=normal]{margin-inline:-4px}.dm-rail-reveal{display:none;position:absolute;inset:0;width:100%;min-width:0;padding:0;border-radius:6px;background:var(--surface-2)}.dm-rail-reveal .dm-strip-badge{position:absolute;top:8px;left:1px;min-width:9px;height:9px;border-radius:7px;background:var(--brand);font-size:0}.dm-rail.collapsed{padding:0}.dm-rail.collapsed>:not(.dm-rail-reveal){display:none}.dm-rail.collapsed .dm-rail-reveal{display:block}.dm-rail button:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
.dm-bubble>i{display:none;position:absolute;right:2px;bottom:1px;color:var(--brand);font-size:8px;font-style:normal}.dm-bubble.typing>i{display:block}
.guild-rail .brand-word { display: none; }
.guild-list { display: flex; flex: 1 1 auto; flex-direction: column; gap: 7px; min-width: 0; width: 100%; overflow-x: hidden; overflow-y: auto; align-items: center; scrollbar-width: none; }
.guild-list::-webkit-scrollbar { display: none; }
.guild-group { display: flex; flex: 0 0 auto; width: 100%; min-width: 0; flex-direction: column; align-items: center; gap: 6px; padding: 2px 0 5px; border-radius: 8px; }
.guild-group[draggable="true"] { cursor: grab; }
.guild-group-heading { display: grid; place-items: center; width: 100%; min-height: 22px; padding: 5px 3px; border: 0; background: transparent; color: var(--muted); }
.guild-group-heading:hover, .guild-group-heading:focus-visible { color: var(--text); background: var(--surface-2); }
.guild-group-color { display: block; width: 24px; height: 4px; border-radius: 999px; background: var(--group-color, var(--brand)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--group-color, var(--brand)) 55%, transparent); transition: width .15s ease; }
.guild-group-heading:hover .guild-group-color, .guild-group-heading:focus-visible .guild-group-color { width: 34px; }
.guild-group-separator { width: 34px; height: 1px; background: var(--border); }
.guild-group-items { display: flex; width: 100%; flex-direction: column; align-items: center; gap: 7px; }
.guild-group.collapsed .guild-group-items { display: none; }
.guild-group-add { color: var(--muted); font-size: 18px; }
.guild-group-add:hover { color: var(--brand); }
.guild-button { flex: 0 0 auto; width: 42px; height: 42px; padding: 0; border: 1px solid transparent; border-radius: 14px; background: var(--surface-2); color: #c3d0d4; font-size: 12px; font-weight: 850; }
.guild-button img { width: 100%; height: 100%; border-radius: inherit; object-fit: contain; }
.guild-button.has-image, .guild-button.has-image.active { background: transparent; color: inherit; }
.guild-button.has-image.active { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.guild-button:hover { border-color: #4b626b; }
.guild-button.active { background: var(--brand); color: #102017; border-radius: 14px 14px 14px 5px; }
.guild-button.add { color: var(--aqua); font-size: 22px; }
.guild-button.add:hover { background: var(--aqua); color: #10201f; }

.channel-panel { grid-area: navigation; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px 16px 16px 8px; background: var(--sidebar); }
.guild-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 14px; }
.guild-header h2 { overflow: hidden; margin: 0; font-size: 18px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.guild-header small { color: var(--accent); font-size: 10px; }
.guild-header small:not(:empty) { cursor: pointer; }
.guild-header-actions, .invite-actions { display: flex; gap: 5px; }
.icon-button, .danger-icon { width: 36px; height: 36px; padding: 0; background: transparent; color: var(--brand); font-size: 17px; }
.danger-icon { color: var(--danger); }
.channel-list { padding: 4px 10px 14px; overflow-y: auto; }
.game-tools{display:grid;gap:4px;padding:8px 9px;border-bottom:1px solid var(--border)}.game-tools button{display:grid;grid-template-columns:26px 1fr;align-items:center;padding:7px 8px;color:var(--muted);background:transparent;text-align:left}.game-tools button>span{grid-row:span 2;color:var(--brand);font-size:17px}.game-tools b{color:var(--text);font-size:11px}.game-tools small{font-size:9px}.game-tools button.active{background:var(--surface-3);color:var(--brand)}.game-dashboard{display:grid;align-content:start;gap:12px;width:min(1050px,100%);margin:auto;padding:22px}.game-dashboard>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.game-dashboard h2,.game-dashboard h3,.game-dashboard p{margin:0}.game-dashboard>header p,.game-card p{color:var(--muted)}.game-dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.game-card{display:grid;gap:9px;padding:14px;border:1px solid var(--border);border-radius:13px;background:var(--surface)}.game-card.premium{border-color:#7b6334;background:linear-gradient(135deg,color-mix(in srgb,#8e681e 18%,var(--surface)),var(--surface))}.game-card header{display:flex;align-items:center;justify-content:space-between;gap:8px}.game-card-actions{display:flex;flex-wrap:wrap;gap:6px}.game-card-actions button{padding:7px 9px}.game-badge{width:max-content;padding:3px 7px;border-radius:99px;color:var(--brand);background:color-mix(in srgb,var(--brand) 12%,var(--surface-2));font-size:10px;font-weight:800}.game-badge.live{color:#b9f5ce;background:#1c422b}.character-vitals{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.character-vitals span{padding:7px;border:1px solid var(--border);border-radius:8px;text-align:center}.character-vitals strong,.character-vitals small{display:block}.character-vitals small{color:var(--muted);font-size:9px}.atlas-calendar{display:grid;grid-template-columns:repeat(7,minmax(70px,1fr));gap:5px;overflow-x:auto}.atlas-day{min-height:92px;padding:8px;border:1px solid var(--border);border-radius:8px;color:var(--muted)}.atlas-event{display:block;margin-top:6px;padding:5px;border-radius:6px;color:var(--text);background:var(--surface-3);font-size:10px}.game-dialog{width:min(580px,calc(100% - 24px))}.game-dialog form{display:grid;gap:12px;padding:20px}.game-dialog form>header{display:flex;align-items:center;justify-content:space-between}.game-dialog form>header h2{margin:0}.game-dialog form>p{margin:0;color:var(--muted)}.game-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.game-context{display:grid;gap:9px;padding:14px}.game-context .game-card{padding:11px}
.character-abilities{display:grid;grid-template-columns:repeat(6,1fr);gap:4px}.character-abilities span{padding:5px;border:1px solid var(--border);border-radius:7px;text-align:center}.character-abilities strong,.character-abilities small{display:block}.character-abilities small{color:var(--muted);font-size:8px}
.game-tools{display:grid;gap:1px;padding:4px 10px;border:0}.game-tools button{display:flex;grid-template-columns:none;align-items:center;gap:7px;width:100%;min-height:32px;padding:5px 8px}.game-tools button>span{grid-row:auto;width:18px;font-size:13px;text-align:center}.game-tools b{font-size:11px}.game-tools small{display:none}.game-tools button.active{color:var(--text)}
.game-tools{padding:4px 10px}.game-tools button{min-height:42px!important;padding:8px 10px!important;border:0!important;border-radius:10px!important;box-shadow:none!important;background:transparent!important;font-weight:500}.game-tools button:hover,.game-tools button.active{background:var(--surface-3)!important}.game-tools button>span{width:22px;font-size:17px}.game-tools b{font-size:13px;font-weight:650}.game-dashboard{gap:8px;padding:14px}.game-dashboard>header{align-items:center}.game-dashboard>header h2{font-size:18px}.game-dashboard>header p{font-size:11px}.game-dashboard-grid{gap:7px}.game-card{gap:6px;padding:9px;border-radius:9px}.game-card h3{font-size:13px}.game-card p{font-size:11px}.character-vitals span{padding:4px}.game-card-actions button{min-height:30px;padding:4px 7px;font-size:10px}
.dm-list-tools{padding:6px}.dm-list-tools button{width:100%}.dm-empty{padding:12px}.dm-row{width:100%;display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:9px;padding:8px;border:0;background:transparent;color:var(--text);text-align:left;border-radius:8px}.dm-row:hover,.dm-row.active{background:var(--surface-2)}.dm-row.unread strong{color:var(--brand)}.dm-row>span:nth-child(2){min-width:0;display:grid}.dm-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}.dm-row>b{min-width:20px;padding:2px 6px;border-radius:10px;background:var(--brand);color:var(--canvas);font-size:11px;text-align:center}
.dm-inbox{display:grid;align-content:start;gap:8px;max-width:850px;margin:auto;padding:24px}.dm-inbox>header{display:flex;align-items:center;justify-content:space-between;gap:16px}.dm-inbox h2,.dm-inbox p{margin:0}.dm-inbox-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;border:1px solid var(--border);border-radius:13px;background:var(--surface)}.dm-inbox-row>button:first-child{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;background:transparent}.dm-inbox-row>button:first-child>span:nth-child(2){display:grid;min-width:0}.dm-inbox-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}.dm-inbox-row.unread{border-left:3px solid var(--brand)}
.channel-section { margin: 14px 10px 7px; color: #7f969e; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.channel-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; margin-bottom: 4px; border-radius: 12px; }
.channel-row:hover { background: var(--surface-2); }
.channel-item { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 10px 11px; background: transparent; color: #acbcc1; text-align: left; }
.channel-item:hover { background: transparent; }
.channel-item.active { background: var(--accent-soft); color: #ffe3a2; }
.channel-item.unread:not(.active) { color: var(--text); font-weight: 850; background: color-mix(in srgb, var(--brand) 7%, transparent); }
.channel-item.unread:not(.active) .channel-symbol { color: var(--brand); }
.channel-item > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-symbol { display: grid; place-items: center; width: 22px; height: 22px; color: #7f969e; font-size: 15px; text-align: center; }
.unread-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--brand); }
.channel-options, .member-options { width: 28px; height: 28px; padding: 0; background: transparent; color: var(--muted); opacity: 0; font-size: 11px; letter-spacing: -1px; }
.channel-row:hover .channel-options, .channel-options:focus-visible, .member:hover .member-options, .member:focus-within .member-options { opacity: 1; }
.channel-options:hover, .member-options:hover { color: var(--text); background: var(--surface-3); }
.voice-channel-users { display: grid; gap: 4px; padding: 1px 8px 7px 43px; }
.voice-channel-user { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 14.4px; }
.voice-channel-user.speaking { color: var(--green); }
.voice-channel-user .avatar { width: 26.4px; height: 26.4px; font-size: 10.8px; }
.voice-channel-user.speaking .avatar { box-shadow: 0 0 0 2px var(--green); }
.voice-channel-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-bar{display:grid;justify-items:center;gap:7px;width:calc(100% - 20px);max-width:100%;margin:0 10px 8px;padding:11px 8px;border:1px solid #315349;border-radius:14px;background:#162a27;overflow:hidden}.voice-bar .voice-connection-toggle{display:grid;justify-items:center;width:100%;min-width:0;padding:2px 6px;color:inherit;background:none;box-shadow:none;text-align:center;cursor:pointer}.voice-connection-toggle:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.voice-bar-controls{display:flex;flex-wrap:wrap;justify-content:center;gap:5px;width:100%;min-width:0}
.voice-bar strong { color: var(--green); font-size: 12px; }
.voice-bar small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.voice-bar .voice-network-stats{display:grid;gap:6px;width:100%;padding:7px;border:1px solid #315349;border-radius:9px;color:var(--text);background:#0f201e;font:700 9px/1.35 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:normal}.voice-stat-graphs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.voice-stat-graphs figure{display:grid;gap:2px;min-width:0;margin:0;padding:4px;border-radius:6px;background:#132925}.voice-stat-graphs figcaption{display:grid;gap:1px;color:var(--muted);font-size:7px}.voice-stat-graphs b{overflow:hidden;color:var(--text);font-size:8px;text-overflow:ellipsis}.voice-stat-graphs svg{display:block;width:100%;height:34px;overflow:visible;border-bottom:1px solid #ffffff24}.voice-stat-graphs polyline{fill:none!important;stroke:#fff!important;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.graph-timeline{display:flex;justify-content:space-between;color:#ffffff55;font-size:6px;font-weight:500}.graph-timeline i{font-style:normal}
.voice-bar #deepfilter-toggle.active{color:var(--canvas);background:var(--brand);box-shadow:0 0 0 1px var(--brand)}
.voice-bar #deepfilter-toggle.fallback{color:var(--warning,#ffd27a);background:var(--surface-3);box-shadow:0 0 0 1px currentColor}
.voice-bar .fine-line-icon{display:grid;place-items:center;width:40px;height:40px;min-width:40px;padding:0}.voice-bar .fine-line-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.voice-bar .leave-arrow-icon{color:#fff;background:var(--danger)}.voice-bar .leave-arrow-icon:hover{background:#ff6262}.voice-bar .leave-arrow-icon svg{width:26px;height:26px;stroke-width:2.2}
.user-panel { display: flex; align-items: center; gap: 9px; margin: 0 8px 8px; padding: 10px; border-radius: 15px; background: var(--surface); }
.user-identity { display: grid; flex: 1; min-width: 0; }
.user-identity strong, .user-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { color: var(--muted); font-size: 10px; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 12px 12px 12px 4px; font-weight: 800; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.content-panel { grid-area: conversation; display: grid; grid-template-rows: 66px minmax(0, 1fr) auto; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 22px 10px 22px 22px; background: var(--surface); box-shadow: var(--shadow); }
.content-header { display: flex; align-items: center; gap: 10px; padding: 0 24px; border-bottom: 1px solid var(--border); }
.content-header::after { content: 'Conversation'; color: #6f858d; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.channel-tools { display: flex; gap: 4px; margin-left: auto; }
.channel-tools button { min-width: 34px; width: 34px; padding: 6px; color: var(--muted); background: transparent; font-size: 19px; }
.channel-tools button:hover { color: var(--brand); background: var(--surface-3); }
.content-header > span { color: var(--brand); font-size: 20px; }
.content-header strong { font-size: 16px; }
.krit-desktop .content-header>#channel-symbol,.krit-desktop .content-header>#channel-name{display:none}.krit-desktop .content-header::after{display:none}
.mobile-menu { display: none; padding: 5px 8px; }
.empty-state { place-self: center; max-width: 360px; padding: 30px; color: var(--muted); text-align: center; }
.empty-state div { font-size: 48px; }
.empty-state h2 { margin: 9px 0 6px; color: var(--text); letter-spacing: -.035em; }
.messages { overflow-y: auto; padding: 24px clamp(15px, 4vw, 48px) 8px; }
.message { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 58px; gap: 12px; margin: 2px 0; padding: 8px 10px; border-radius: 13px; }
.message:hover { background: #ffffff05; }
.message.message-flash { background: color-mix(in srgb, var(--brand) 17%, transparent); }
.message .avatar { grid-row: span 2; width: 42px; height: 42px; }
.message.compact { padding-block: 3px; }
.message-mini-time { align-self: start; padding-top: 2px; color: #6f858d; font-size: 10px; text-align: right; opacity: 0; }
.message.compact:hover .message-mini-time { opacity: 1; }
.message-body { min-width: 0; }
.message-head { display: flex; align-items: baseline; gap: 8px; }
.message-head time { color: #7f939a; font-size: 11px; }
.webhook-label { color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 55%, transparent); border-radius: 4px; padding: 1px 4px; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.message-content { color: #dce4e5; overflow-wrap: anywhere; white-space: pre-wrap; }
.mention { padding: 1px 3px; border-radius: 4px; color: #b9dfff; background: #3d67a055; font-weight: 700; }
.mention-me { color: #102017; background: var(--brand); }
.pinned-label { margin-left: 7px; color: var(--brand); font-size: 11px; white-space: nowrap; }
.message-reply { display: block; max-width: 100%; margin: 0 0 4px; padding: 2px 5px; overflow: hidden; color: var(--muted); background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.message-reply:hover { color: var(--text); background: var(--surface-3); }
.edited-label { margin-left: 6px; color: #7f939a; font-size: 11px; white-space: nowrap; }
.message-actions { display: flex; align-items: flex-start; justify-content: flex-end; gap: 2px; min-width: 58px; opacity: 0; }
.message:hover .message-actions { opacity: 1; }
.message-action { width: 28px; height: 28px; padding: 0; background: transparent; color: var(--muted); }
.message-action:hover { color: var(--text); background: var(--surface-3); }
.message-action.danger:hover { color: var(--danger); }
.message-reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.message-image { display: block; min-width: 0; max-width: 100%; padding: 0; overflow: hidden; border-radius: 13px; background: transparent; cursor: zoom-in; }
.message-image:hover { background: transparent; }
.message-image img { display: block; max-width: 100%; max-height: 420px; width: auto; height: auto; object-fit: contain; }
.reaction-chip { min-width: 0; padding: 3px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font-weight: 600; }
.reaction-chip:hover { border-color: var(--brand); background: var(--surface-3); }
.reaction-chip.reacted { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 18%, var(--surface-2)); }
.reaction-chip span { color: var(--muted); font-size: 11px; }
.edit-message-form { display: grid; gap: 8px; }
.edit-message-form > div { display: flex; gap: 8px; }
.edit-message-form button { padding: 7px 10px; }
.message-form { display: flex; position: relative; flex-wrap: wrap; gap: 9px; margin: 10px clamp(14px, 4vw, 48px) 22px; padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: #101a1f; }
.typing-indicator { align-self:start; min-height:14px; width:max-content; max-width:calc(100% - 40px); margin:0 0 -8px clamp(24px,calc(4vw + 10px),58px); overflow:hidden; color:#7f8a84; font-size:9.5px; font-weight:500; line-height:14px; text-overflow:ellipsis; white-space:nowrap; }
.typing-indicator::before { content: '•••'; margin-right: 5px; color: #68736d; font-size: 7px; letter-spacing: .5px; }
.reply-preview { display: flex; flex: 0 0 100%; align-items: center; justify-content: space-between; padding: 3px 8px 7px; color: var(--muted); border-bottom: 1px solid var(--border); font-size: 12px; }
.reply-preview button { min-width: 26px !important; width: 26px; height: 26px; padding: 0 !important; color: var(--muted) !important; background: transparent !important; }
.message-browser { width: min(680px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); overflow: auto; }
.message-search { display: flex; gap: 8px; }
.message-search input { flex: 1; }
#message-browser-results { display: grid; gap: 7px; margin-top: 14px; }
.browser-message { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; width: 100%; padding: 11px; color: var(--text); background: var(--surface-2); text-align: left; }
.browser-message time { color: var(--muted); font-size: 11px; }
.browser-message > span { grid-column: 1 / -1; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.message-form.dragging { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.message-form input,.message-form textarea { border: 0; background: transparent; box-shadow: none; }
.message-form > #message-input { flex: 1; min-width: 100px; min-height: 40px; max-height: 180px; padding: 8px; resize: none; color: var(--text); font: inherit; }
.message-form button { min-width: 72px; background: var(--brand); color: #102017; font-weight: 800; }
.message-form .composer-emoji { min-width: 38px; width: 38px; height: 38px; align-self: center; padding: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 22px; }
.message-form .composer-emoji:hover { color: var(--brand); background: var(--surface-3); }
.message-form .composer-format { min-width: 38px; width: 38px; height: 38px; align-self: center; padding: 0; color: var(--muted); background: transparent; font-family: Georgia,serif; font-size: 20px; }.message-form .composer-format:hover,.message-form .composer-format.active{color:var(--brand);background:var(--surface-3)}
.format-tray{display:grid;flex:0 0 100%;gap:7px;padding:10px;border-top:1px solid var(--border)}.format-tray header,.format-tray [role=toolbar]{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.format-tray header strong{flex:1}.format-tray header label{display:flex;align-items:center;gap:7px;font-size:11px}.format-tray [role=toolbar]>span{width:64px;color:var(--muted);font-size:10px;text-transform:uppercase}.format-tray button,.selection-toolbar button{min-width:38px!important;min-height:38px;padding:7px 9px!important;color:var(--text)!important;background:var(--surface-2)!important;font-size:11px}.format-tray button:hover,.selection-toolbar button:hover{background:var(--surface-3)!important;color:var(--brand)!important}.rich-preview{max-height:180px;padding:9px;overflow:auto;border:1px dashed var(--border);border-radius:10px;background:var(--surface-2)}
.selection-toolbar{position:fixed;z-index:31;display:flex;gap:3px;padding:5px;border:1px solid var(--border);border-radius:12px;background:var(--sidebar);box-shadow:var(--shadow)}.slash-menu{position:fixed;z-index:30;width:min(390px,calc(100vw - 20px));max-height:360px;padding:6px;overflow:auto;border:1px solid var(--border);border-radius:14px;background:var(--sidebar);box-shadow:var(--shadow)}.slash-menu button{display:grid;grid-template-columns:32px 1fr;gap:2px 8px;width:100%;padding:9px;color:var(--text);background:transparent;text-align:left}.slash-menu button.active,.slash-menu button:hover{background:var(--surface-3)}.slash-menu button i{grid-row:span 2;font-size:20px}.slash-menu button small{color:var(--muted)}
.mention-menu button{grid-template-columns:36px minmax(0,1fr)!important;align-items:center}.mention-menu .avatar{grid-row:span 2;width:34px;height:34px;font-size:11px}.mention-menu b,.mention-menu small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mention-menu b{font-size:13px}.mention-menu small{font-size:10px}
.message-content.rich-content{display:grid;gap:6px;max-width:100%;overflow-wrap:anywhere}.rich-content p{margin:0}.rich-content h2,.rich-content h3,.rich-content h4{margin:7px 0 2px}.rich-content blockquote{margin:3px 0;padding:5px 10px;border-left:3px solid var(--brand);color:var(--muted)}.rich-content pre{max-width:100%;padding:10px;overflow:auto;border-radius:10px;background:#090d0f}.rich-content code{font-family:ui-monospace,monospace}.rich-content mark{padding:1px 3px;color:var(--text);background:#8b772d}.rich-spoiler{display:inline;min-width:0;padding:1px 4px;color:transparent;background:#080a0b}.rich-spoiler:hover,.rich-spoiler.revealed{color:var(--text)}.rich-callout,.rich-card,.rich-poll,.rich-event,.rich-collapse{max-width:680px;padding:12px;border:1px solid var(--border);border-left:4px solid var(--accent);border-radius:12px;background:var(--surface-2)}.rich-success{border-left-color:var(--green)}.rich-warning{border-left-color:#e7bd61}.rich-danger{border-left-color:var(--danger)}.rich-info{border-left-color:#68a8e8}.rich-collapse summary{cursor:pointer;font-weight:800}.rich-card h3,.rich-poll h3,.rich-event h3{margin:0 0 5px}.rich-card dl{display:grid;grid-template-columns:minmax(80px,140px) 1fr;margin:5px 0}.rich-card dt{color:var(--muted)}.rich-card dd{margin:0}.rich-actions{display:flex;flex-wrap:wrap;gap:6px}.rich-actions button,.rich-poll button{min-height:40px}.rich-poll{display:grid;gap:6px}.rich-poll button{display:flex;gap:8px;color:var(--text);background:var(--surface-3)}.rich-event{display:flex;gap:10px}.rich-event time{color:var(--brand)}.rich-style-muted{color:var(--muted)}.rich-style-accent{color:var(--accent)}.rich-style-info{color:#83bdf1}.rich-style-success{color:var(--green)}.rich-style-warning{color:#e7bd61}.rich-style-danger{color:var(--danger)}.rich-checklist{padding:0;list-style:none}.rich-checklist input{width:auto}.rich-view-no-colors .rich-content *{color:inherit!important;border-left-color:var(--border)!important}.rich-view-compact .rich-callout,.rich-view-compact .rich-card,.rich-view-compact .rich-poll,.rich-view-compact .rich-event{padding:7px}.rich-view-reduced .rich-card .rich-actions,.rich-view-reduced .rich-gallery{display:none}
.attach-menu { position: relative; flex: 0 0 38px; align-self: center; }
.attach-menu summary { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 25px; font-weight: 700; line-height: 1; list-style: none; }
.attach-menu summary::-webkit-details-marker { display: none; }
.attach-menu[open] summary,.attach-menu summary:hover { color: #102017; background: var(--brand); }
.attach-menu-panel { position: absolute; z-index: 12; left: 0; bottom: 47px; display: grid; gap: 8px; width: 270px; padding: 9px; border: 1px solid var(--border); border-radius: 14px 14px 14px 5px; background: var(--sidebar); box-shadow: var(--shadow); }
.attach-menu-panel label { display: block; padding: 11px 12px; border-radius: 10px; color: var(--text); background: var(--surface-2); cursor: pointer; font-size: 14px; }
.attach-menu-panel label:hover { background: var(--surface-3); }
.message-form .attach-menu-panel button { width: 100%; min-width: 0; padding: 11px 12px; color: var(--text); background: var(--surface-2); text-align: left; font-size: 14px; }
.message-form .attach-menu-panel button:hover { background: var(--surface-3); }
.attach-menu-panel input { display: none; }
.attach-menu-panel small { padding: 0 5px 3px; color: var(--muted); font-size: 11px; }
.attachment-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); flex: 0 0 100%; gap: 7px; }
.attachment-preview { display: grid; grid-template-columns: 42px minmax(0,1fr) 28px; align-items: center; gap: 8px; padding: 7px; border-radius: 11px; background: var(--surface-2); }
.attachment-preview img,.attachment-preview video { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.attachment-preview > span { display: grid; min-width: 0; }
.attachment-preview strong,.attachment-preview small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview small,.file-card small { color: var(--muted); }
.attachment-preview button { min-width: 28px; width: 28px; height: 28px; padding: 0; background: transparent; color: var(--muted); }
.message-attachments { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 320px)); gap: 7px; margin-top: 7px; }
.remote-media-embeds { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 320px)); gap: 7px; max-width: 100%; margin-top: 7px; }
.remote-media-embeds .remote-image { width: fit-content; max-width: min(520px, 100%); }
.remote-media-embeds .remote-image img { width: auto; max-width: 100%; max-height: 420px; }
.message-image { display: block; overflow: hidden; max-width: 520px; border-radius: 12px; background: var(--surface-2); }
.message-image img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.message-video{position:relative;display:grid;grid-column:1/-1;width:min(820px,100%);max-width:100%;overflow:hidden;border-radius:12px;background:#000}.message-video video{display:block;width:100%;min-height:min(420px,52vw);max-height:70vh;background:#000;object-fit:contain}.message-video video:fullscreen{width:100vw!important;height:100vh!important;min-height:0!important;max-width:none!important;max-height:none!important;border-radius:0;object-fit:contain}.message-video video:-webkit-full-screen{width:100vw!important;height:100vh!important;max-height:none!important}
.file-card { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface-2); text-decoration: none; }
.file-card > span:last-child { display: grid; min-width: 0; }.file-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.voice-stage { overflow-y: auto; padding: clamp(22px, 4vw, 48px); }
.voice-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.voice-heading span { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.voice-heading small { color: var(--muted); }
.voice-controls { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) max-content max-content minmax(120px, 180px); gap: 12px; align-items: end; margin-bottom: 18px; }
.voice-controls label { font-size: 11px; }
.voice-toggle { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.voice-toggle input { width: auto; }
.range-help { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 500; }
.screen-share-stage { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(520px,100%),1fr)); gap: 14px; margin: 0 0 18px; }
.screen-share-tile { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: #050607; box-shadow: var(--shadow); }
.krit-desktop-fullscreen .screen-share-tile.desktop-fullscreen { position: fixed; z-index: 10000; inset: 0; display: grid; grid-template-rows: minmax(0,1fr); width: 100vw; height: 100vh; margin: 0; padding: 0; border: 0; border-radius: 0; background: #000; box-shadow: none; }
.krit-desktop-fullscreen .screen-share-tile.desktop-fullscreen header { display: none; }
.krit-desktop-fullscreen .screen-share-tile.desktop-fullscreen .screen-share-video { width: 100vw; height: 100vh; min-height: 0; aspect-ratio: auto; margin: 0; padding: 0; }
.krit-desktop-fullscreen .screen-share-tile.desktop-fullscreen video { width: 100vw; height: 100vh; min-height: 0; max-height: none; margin: 0; object-fit: contain; background: #000; }
.krit-desktop-fullscreen .screen-share-tile.desktop-fullscreen .screen-share-fullscreen { display: none; }
.screen-share-tile header { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; color: var(--text); background: var(--surface-2); }
.screen-share-tile header span { color: var(--muted); font-size: 12px; }
.screen-share-video { display: grid; place-items: center; aspect-ratio: 16/9; min-height: 220px; }
.screen-share-video video { display: block; width: 100%; height: 100%; max-height: 72vh; object-fit: contain; background: #000; }
.screen-share-fullscreen { position: absolute; right: 10px; bottom: 10px; min-height: 38px; padding: 8px 11px; color: var(--text); background: color-mix(in srgb,var(--sidebar) 88%,transparent); }
#screen-share-toggle.active { color: var(--green); background: var(--surface-3); }
.voice-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.voice-person { position: relative; display: grid; justify-items: center; gap: 12px; padding: 28px 18px; border: 1px solid var(--border); border-radius: 20px 20px 20px 8px; background: var(--surface-2); }
.voice-person .avatar { width: 84px; height: 84px; font-size: 31.2px; }
.voice-person > strong { font-size: 19.2px; }
.voice-person.speaking { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.participant-volume { width: 100%; font-size: 10px; }.participant-volume input { padding: 0; }
.participant-admin { display: flex; gap: 7px; }.participant-admin button { padding: 7px 10px; font-size: 11px; }
.participant-menu { position: absolute; top: 10px; right: 10px; z-index: 2; }.participant-menu summary { display: grid; place-items: center; width: 32px; height: 28px; border-radius: 9px; color: var(--brand); cursor: pointer; list-style: none; font-weight: 900; letter-spacing: 1px; }.participant-menu summary::-webkit-details-marker { display: none; }.participant-menu[open] summary,.participant-menu summary:hover { background: var(--surface-3); }.participant-menu-panel { position: absolute; top: 34px; right: 0; display: grid; gap: 10px; width: 210px; padding: 13px; border: 1px solid var(--border); border-radius: 14px 5px 14px 14px; background: var(--sidebar); box-shadow: var(--shadow); }

.member-panel { grid-area: people; padding: 18px 10px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px 22px 22px 22px; background: var(--sidebar); }
.member-panel.dm-context-hidden{visibility:hidden}
.app:has(.member-panel.dm-context-hidden){grid-template-columns:70px var(--dm-rail-width,46px) minmax(220px,260px) minmax(0,1fr) 0}
.app.dm-active{grid-template-columns:70px var(--dm-rail-width,46px) 0 minmax(0,1fr) 250px}.app.dm-active .channel-panel{display:none}.dm-profile-context{display:grid;justify-items:center;gap:8px;text-align:center}.dm-profile-context h2,.dm-profile-context p{margin:0}.dm-profile-avatar{width:76px;height:76px;font-size:22px}.dm-profile-avatar img{width:100%;height:100%;object-fit:cover}.dm-profile-presence{display:flex;align-items:center;gap:7px;color:var(--muted);text-transform:capitalize}.dm-profile-presence .presence-dot{position:static}.dm-context-actions{display:grid;gap:7px;width:100%;margin:12px 0}.dm-profile-context>small{text-align:left}
.app.dm-active:has(.member-panel.dm-context-hidden){grid-template-columns:70px var(--dm-rail-width,46px) 0 minmax(0,1fr) 0}
.mobile-primary-nav { display: none; }
html.krit-android .mobile-primary-nav { display: none !important; }
.member-panel::before { content: 'People'; display: block; margin: 4px 10px 20px; font-size: 18px; font-weight: 850; letter-spacing: -.03em; }
.member-section { margin-bottom: 20px; }
.member-section h3, .friends-launch h3 { margin: 0 9px 7px; color: #7f969e; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.member { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 13px; }
.member:hover { background: var(--surface-2); }
.member:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.member.offline { opacity: .46; }
.member .avatar { width: 40.8px; height: 40.8px; font-size: 13.2px; }
.member-info { display: grid; min-width: 0; }
.member-info strong, .member-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-info strong { font-size: 15.6px; }
.member-info small { color: var(--muted); font-size: 10px; }
.presence-dot { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: #5b6b71; }
.member-options { flex: 0 0 auto; margin-left: -5px; }
.context-menu { position: fixed; z-index: 30; display: grid; min-width: 190px; padding: 6px; border: 1px solid var(--border); border-radius: 13px 5px 13px 13px; background: var(--sidebar); box-shadow: var(--shadow); }
.context-menu button { width: 100%; padding: 9px 11px; border-radius: 8px; background: transparent; color: var(--text); text-align: left; }
.context-menu button:hover, .context-menu button:focus-visible { background: var(--surface-3); }
.context-menu button.danger { color: var(--danger); }
.presence-dot.online { background: var(--green); }.presence-dot.away { background: var(--accent); }.presence-dot.busy { background: var(--danger); }
.friends-launch > button { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 2px 8px; width: 100%; padding: 12px; color: var(--muted); background: var(--surface-2); text-align: left; }
.friends-launch > button:hover { background: var(--surface-3); }.friends-launch span { grid-row: span 2; color: var(--brand); font-size: 24px; text-align: center; }.friends-launch strong { color: var(--text); font-size: 12px; }.friends-launch small { font-size: 10px; }
.friends-dialog { width: min(620px, calc(100% - 30px)); }.friend-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }.friend-list { display: grid; gap: 8px; margin-top: 12px; }.friend-list article { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }.friend-list article .avatar { width: 42px; height: 42px; }.friend-list article > div:nth-child(2) { display: grid; min-width: 0; }.friend-list article small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }.friend-list article > div:last-child { display: flex; gap: 6px; }.friend-list article button { padding: 7px 9px; font-size: 11px; }
.new-dm-dialog { width: min(520px,calc(100% - 24px)); }.new-dm-results { display: grid; gap: 5px; max-height: min(420px,55vh); overflow-y: auto; }.new-dm-results>button { display: grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:10px; width:100%; padding:9px; color:var(--text); background:transparent; text-align:left; }.new-dm-results>button:hover,.new-dm-results>button.active { background:var(--surface-2); }.new-dm-results>button>span:nth-child(2) { display:grid; }.new-dm-results small { color:var(--muted); }.new-dm-results .presence-dot { position:static; }
.invite-link-field { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
@media (max-width: 520px) { .friend-add { grid-template-columns: 1fr; }.friend-list article { grid-template-columns: 38px 1fr; }.friend-list article > div:last-child { grid-column: 2; } }

dialog { width: min(440px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow-y: auto; color: var(--text); border: 1px solid var(--border); border-radius: 24px 24px 24px 9px; background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: #05090bc9; backdrop-filter: blur(5px); }
.image-viewer { width: min(1100px, calc(100% - 28px)); max-width: none; height: min(820px, calc(100vh - 28px)); max-height: none; overflow: hidden; border-radius: 18px; background: #080b0dcc; }
.image-viewer-shell { position: relative; display: grid; grid-template-rows: minmax(0,1fr) auto; width: 100%; height: 100%; padding: 16px; }
.image-viewer-shell > img { place-self: center; max-width: 100%; max-height: 100%; object-fit: contain; }
.image-viewer-shell footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 12px; }
.image-viewer-shell footer strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer-close { position: absolute; z-index: 2; top: 10px; right: 10px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: #111b1ee6; font-size: 25px; }
.image-viewer .download-action { padding: 8px 13px; border-radius: 10px; color: #102017; background: var(--brand); font-weight: 800; text-decoration: none; }
.gif-search-dialog { width: min(760px, calc(100% - 28px)); max-width: none; }
.gif-search-shell { min-height: min(680px, calc(100vh - 40px)); grid-template-rows: auto auto auto minmax(0,1fr) auto; }
.gif-search-results { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; overflow-y: auto; align-content: start; }
.gif-result { min-width: 0; padding: 0; overflow: hidden; border-radius: 10px; background: var(--surface-2); }
.gif-result img { display: block; width: 100%; height: 145px; object-fit: cover; }
.gif-provider-attribution { justify-self: end; color: var(--muted); font-size: 12px; text-decoration: none; }
.gif-provider-attribution img { display: block; width: 150px; height: auto; }
@media(max-width:600px){.gif-search-results{grid-template-columns:repeat(2,minmax(0,1fr))}.gif-result img{height:120px}.game-dashboard{padding:12px 8px}.game-dashboard-grid,.game-form-grid{grid-template-columns:1fr}.atlas-calendar{grid-template-columns:repeat(7,100px)}}
.dialog-card { position: relative; display: grid; gap: 14px; padding: 30px; }
.dialog-card h2 { margin-bottom: 2px; letter-spacing: -.035em; }
.dialog-close { position: absolute; top: 11px; right: 11px; background: transparent; font-size: 22px; }
.profile-card { gap: 13px; }
.settings-section { display: grid; gap: 12px; padding-top: 11px; border-top: 1px solid var(--border); }
.settings-section h3 { margin: 0; color: #c4cfd2; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.account-actions button { justify-self: start; }
.settings-note { margin: 0; font-size: 12px; }.danger-soft { color: var(--danger); }
.permission-list { display: grid; gap: 7px; }.permission-member { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 11px; background: var(--surface-2); }.permission-member label { display: flex; align-items: center; gap: 7px; }.permission-member input { width: auto; }
.channel-order-list { display: grid; gap: 7px; }
.channel-order-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid transparent; border-radius: 11px; background: var(--surface-2); cursor: grab; user-select: none; }
.channel-order-item:active { cursor: grabbing; }.channel-order-item.dragging { opacity: .45; }.channel-order-item.drag-over { border-color: var(--accent); }
.channel-order-handle { color: var(--muted); letter-spacing: -2px; }.channel-order-kind { margin-left: auto; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.profile-avatar-row { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 72px; height: 72px; font-size: 24px; }
.space-icon-preview { border-radius: 20px 20px 20px 7px; background: transparent !important; }
.space-icon-preview img { object-fit: contain; }
.profile-avatar-row > div:last-child { display: grid; gap: 7px; }
.crop-editor { display: grid; justify-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }.crop-editor h3 { justify-self: start; margin: 0; }.crop-editor canvas { width: min(260px, 100%); aspect-ratio: 1; border-radius: 22px; background: repeating-conic-gradient(#313631 0 25%, #252925 0 50%) 50% / 20px 20px; cursor: grab; touch-action: none; }.crop-editor canvas:active { cursor: grabbing; }.crop-editor label { width: min(260px, 100%); }.crop-actions { display: flex; gap: 8px; }
.file-button { display: block; padding: 8px 12px; border-radius: 10px; color: var(--text); background: var(--surface-3); cursor: pointer; }
.file-button input { display: none; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; max-width: 360px; padding: 12px 17px; border: 1px solid var(--border); border-radius: 13px; background: #0a1216f2; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.rich-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:7px;max-width:720px}.rich-gallery.compact{grid-template-columns:repeat(auto-fit,minmax(90px,1fr))}.rich-gallery figure{margin:0;min-width:0}.rich-gallery img{display:block;width:100%;max-height:420px;border-radius:10px;object-fit:cover}.rich-gallery figcaption{color:var(--muted);font-size:11px}.rich-poll button.selected,.rich-actions button.selected{outline:2px solid var(--brand)}

@media (max-width: 1100px) {
  .app { grid-template-columns:66px var(--dm-rail-width,46px) minmax(210px,238px) minmax(0,1fr);grid-template-areas:"spaces direct navigation conversation"; }
  .member-panel { display: none; }
  .app.dm-active{grid-template-columns:66px var(--dm-rail-width,46px) 0 minmax(0,1fr)}
}
@media (max-width: 740px) {
  .app { display: grid; grid-template: 66px minmax(0, 1fr) / 1fr; grid-template-areas: "spaces" "conversation"; gap: 7px; padding: 7px 7px 70px; }
  .app.dm-active,.app.dm-active:has(.member-panel.dm-context-hidden){grid-template:66px minmax(0,1fr)/minmax(0,1fr);grid-template-areas:"spaces" "conversation"}
  .utility-rail,.dm-rail { display: none; }
  .guild-rail { flex-direction: row; border-radius: 18px; padding: 8px 10px; overflow-x: auto; overflow-y: hidden; }
  .guild-group { width: auto; flex-direction: row; align-items: center; padding: 0 5px; }
  .guild-group-heading { width: auto; max-width: 90px; min-height: 40px; }
  .guild-group-items { width: auto; flex-direction: row; }
  .guild-list { flex-direction: row; width: auto; overflow-x: auto; overflow-y: hidden; }
  .brand-word { display: none; }
  .channel-panel { position: fixed; z-index: 5; left: 7px; top: 80px; bottom: 7px; width: min(300px, calc(100vw - 28px)); transform: translateX(-110%); transition: transform .2s; box-shadow: var(--shadow); }
  .channel-panel.open { transform: none; }
  .content-panel { border-radius: 18px; }
  .content-header { height: 58px; padding-inline: 13px; }
  .content-header::after { display: none; }
  .mobile-menu { display: block; }
  .messages { padding-inline: 7px; }
  .dm-inbox{width:100%;max-width:none;margin:0;padding:14px 8px}.dm-inbox>header{align-items:flex-start}.dm-inbox-row>button:first-child{grid-template-columns:38px minmax(0,1fr);min-width:0}.dm-inbox-row>button:first-child>b{grid-column:2;justify-self:start}.dm-inbox-row>.avatar{width:38px;height:38px}
  .message { grid-template-columns: 36px minmax(0, 1fr) 38px; gap: 8px; padding-inline: 7px; }
  .message .avatar { width: 36px; height: 36px; }
  .message-actions { min-width: 38px; }
  .message-form { margin: 8px 10px 12px; }
  .message-form button { min-width: 58px; }
  .format-tray{max-width:100%;overflow-x:auto}.format-tray [role=toolbar]{flex-wrap:nowrap;width:max-content}.selection-toolbar{left:7px!important;right:7px;bottom:7px;top:auto!important;overflow-x:auto}.slash-menu{left:7px!important;right:7px;bottom:76px;top:auto!important;max-height:45vh}.rich-card,.rich-callout,.rich-poll,.rich-event{max-width:100%}.rich-actions{flex-wrap:wrap}
  .voice-controls { grid-template-columns: 1fr; }
  .channel-options, .member-options { opacity: 1; }
  .mobile-primary-nav { position: fixed; z-index: 8; right: 7px; bottom: 7px; left: 7px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 56px; padding: 4px; border: 1px solid var(--border); border-radius: 17px; background: color-mix(in srgb, var(--sidebar) 96%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
  .mobile-primary-nav button { display: grid; place-items: center; align-content: center; gap: 1px; min-width: 0; min-height: 48px; padding: 3px; color: var(--muted); background: transparent; }
  .mobile-primary-nav button:hover, .mobile-primary-nav button.active { color: var(--brand); background: var(--surface-2); }
  .mobile-primary-nav button span { font-size: 17px; }
  .mobile-primary-nav button small { max-width: 100%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
.rich-reduce-motion *, .rich-reduce-motion *::before,.rich-reduce-motion *::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

#profile-dialog, #space-settings-dialog {
  width: min(880px, calc(100% - 30px));
}

.space-settings-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  margin-top: 14px;
  min-height: 480px;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.settings-tab {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.settings-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.settings-tab.active {
  background: var(--surface-3);
  color: var(--brand);
  font-weight: 750;
}

.settings-panes {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.settings-pane.hidden {
  display: none !important;
}

@media (max-width: 680px) {
  .space-settings-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: auto;
  }
  .settings-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 12px;
  }
  .settings-tab {
    width: auto;
    padding: 8px 10px;
    font-size: 12px;
  }
}
