:root {
  color-scheme: light;
  --ink: #141414;
  --ink-2: #282828;
  --paper: #f5f5f2;
  --paper-2: #e9e9e4;
  --white: #ffffff;
  --mint: #d7d7d1;
  --mint-dark: #353535;
  --coral: #111111;
  --yellow: #deded8;
  --muted: #737373;
  --line: rgba(20, 20, 20, .11);
  --glass: rgba(255, 255, 255, .76);
  --field: rgba(255, 255, 255, .84);
  --conversation: #eeeeea;
  --rail-bg: #0b0b0b;
  --rail-fg: #f4f4f1;
  --shadow: 0 22px 60px rgba(0, 0, 0, .11);
  --radius: 20px;
  --font: "Aptos", "Trebuchet MS", sans-serif;
  --display: "Century Gothic", "Aptos Display", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f2ef;
  --ink-2: #e5e5e2;
  --paper: #090909;
  --paper-2: #121212;
  --white: #191919;
  --mint: #363634;
  --mint-dark: #c6c6c1;
  --coral: #f2f2ef;
  --yellow: #343431;
  --muted: #969696;
  --line: rgba(255, 255, 255, .12);
  --glass: rgba(20, 20, 20, .82);
  --field: rgba(28, 28, 28, .9);
  --conversation: #0d0d0d;
  --rail-bg: #050505;
  --rail-fg: #f4f4f1;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  text-rendering: optimizeLegibility;
  transition: color .25s ease, background-color .25s ease;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rail button:focus-visible, .auth-story a:focus-visible { outline-color: #f4f4f1; }
.hidden { display: none !important; }

.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .7; animation: drift 16s ease-in-out infinite alternate; }
.ambient i:nth-child(1) { width: 34vw; height: 34vw; left: -12vw; top: -16vw; background: rgba(119, 228, 200, .22); }
.ambient i:nth-child(2) { width: 26vw; height: 26vw; right: -8vw; bottom: -9vw; background: rgba(255, 119, 95, .14); animation-delay: -6s; }
.ambient i:nth-child(3) { width: 15vw; height: 15vw; left: 46vw; top: 22vh; border: 1px solid rgba(7, 27, 34, .08); animation-delay: -10s; }

.brand { display: inline-flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; letter-spacing: .26em; font: 800 17px var(--display); }
.brand-mark { position: relative; display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid currentColor; border-radius: 50%; }
.brand-mark::after { content: ""; position: absolute; width: 50px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-bottom-color: transparent; border-radius: 50%; transform: rotate(-24deg); }
.brand-mark i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 13px -9px 0 -2px var(--mint); }
.eyebrow, .kicker { color: var(--mint-dark); font-size: 10px; font-weight: 900; letter-spacing: .2em; }

.auth { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(430px, .95fr); width: 100%; height: 100dvh; min-height: 100%; overflow-y: auto; }
.auth-story { position: relative; display: flex; min-height: 100vh; padding: clamp(32px, 5vw, 74px); flex-direction: column; justify-content: space-between; overflow: hidden; color: var(--white); background: var(--ink); }
.auth-story::before { content: ""; position: absolute; width: 50vw; height: 50vw; right: -22vw; top: 5vh; border: 1px solid rgba(119, 228, 200, .19); border-radius: 50%; box-shadow: 0 0 0 65px rgba(119, 228, 200, .03), 0 0 0 130px rgba(119, 228, 200, .02); }
.auth-story::after { content: ""; position: absolute; width: 3px; height: 3px; top: 19%; left: 24%; border-radius: 50%; background: var(--white); box-shadow: 150px 80px 0 rgba(255,255,255,.8), 310px 12px 0 var(--mint), 420px 210px 0 var(--coral), 90px 340px 0 rgba(255,255,255,.5), 360px 430px 0 rgba(255,255,255,.5); }
.brand--hero { position: relative; z-index: 2; }
.story-copy { position: relative; z-index: 2; max-width: 650px; }
.story-copy h1 { margin: 18px 0 24px; font: 700 clamp(45px, 6.2vw, 92px)/.96 var(--display); letter-spacing: -.07em; }
.story-copy h1 em { color: var(--mint); font-family: Georgia, serif; font-weight: 400; }
.story-copy > p:last-child { max-width: 520px; margin: 0; color: rgba(255,253,247,.62); font-size: 17px; line-height: 1.65; }
.signal-card { position: relative; z-index: 2; display: flex; width: fit-content; min-width: 310px; padding: 15px 18px; align-items: center; gap: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.06); backdrop-filter: blur(12px); }
.signal-card div { display: flex; flex-direction: column; }
.signal-card b { font-size: 13px; }
.signal-card small { margin-top: 3px; color: rgba(255,255,255,.48); }
.signal-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(119,228,200,.5); animation: pulse 2s infinite; }
.signal-bars { display: flex; margin-left: auto; align-items: end; gap: 3px; }
.signal-bars i { display: block; width: 3px; background: var(--mint); border-radius: 3px; }
.signal-bars i:nth-child(1) { height: 7px; }.signal-bars i:nth-child(2) { height: 12px; }.signal-bars i:nth-child(3) { height: 17px; }

.auth-card { align-self: center; width: min(490px, calc(100% - 64px)); margin: auto; padding: 42px; border: 1px solid rgba(255,255,255,.72); border-radius: 30px; background: rgba(255,253,247,.72); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.auth-mobile-brand { display: none; align-items: center; gap: 13px; margin-bottom: 34px; letter-spacing: .2em; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 13px; background: rgba(7,27,34,.06); }
.auth-tab { padding: 11px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 800; transition: .25s ease; }
.auth-tab.active { color: var(--ink); background: var(--white); box-shadow: 0 6px 15px rgba(7,27,34,.08); }
.auth-heading { margin: 38px 0 28px; }
.auth-heading h2 { margin: 9px 0 7px; font: 700 34px/1.1 var(--display); letter-spacing: -.045em; }
.auth-heading p { margin: 0; color: var(--muted); }
.field { display: block; margin: 0 0 18px; }
.field > span { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.field input, .field textarea, .modal input, .modal textarea, .modal select { width: 100%; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink); background: rgba(255,255,255,.7); transition: border .2s, box-shadow .2s, background .2s; }
.field input:focus, .field textarea:focus, .modal input:focus, .modal textarea:focus, .modal select:focus { border-color: var(--mint-dark); background: white; box-shadow: 0 0 0 4px rgba(30,159,136,.1); }
.input-prefix, .input-action { position: relative; }
.input-prefix b { position: absolute; z-index: 1; left: 15px; top: 50%; color: var(--mint-dark); transform: translateY(-50%); }
.input-prefix input { padding-left: 35px; }
.input-action button { position: absolute; right: 7px; top: 7px; height: calc(100% - 14px); padding: 0 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 800; }
.captcha-field { margin-top: 2px; }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; margin-bottom: 9px; gap: 8px; }
.captcha-image { position: relative; display: grid; height: 66px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #edf3eb; }
.captcha-image::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 20px rgba(7,27,34,.08); }
.captcha-image img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.captcha-image.loading { background: linear-gradient(100deg, #e8eee6 20%, #f7f9f4 40%, #e8eee6 60%); background-size: 200% 100%; animation: captchaLoad 1.2s linear infinite; }
.captcha-refresh { border: 1px solid var(--line); border-radius: 12px; color: var(--mint-dark); background: rgba(255,255,255,.65); cursor: pointer; font-size: 23px; font-weight: 700; transition: transform .25s, background .2s; }
.captcha-refresh:hover { background: var(--white); transform: rotate(35deg); }
.captcha-refresh:disabled { opacity: .45; cursor: wait; transform: none; }
.captcha-help { display: block; margin: 7px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.primary, .secondary, .danger-button { display: inline-flex; min-height: 46px; padding: 0 18px; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 13px; cursor: pointer; font-weight: 900; transition: transform .2s, box-shadow .2s, background .2s; }
.primary { color: var(--white); background: var(--ink); box-shadow: 0 12px 26px rgba(7,27,34,.2); }
.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(7,27,34,.25); }
.primary:disabled { opacity: .55; transform: none; cursor: wait; }
.secondary { border: 1px solid var(--line); background: var(--white); }
.secondary:hover { border-color: var(--mint-dark); background: #fff; }
.danger-button { color: #9b3327; background: rgba(255,119,95,.14); }
.auth-submit { width: 100%; margin-top: 4px; justify-content: space-between; }
.form-error { min-height: 18px; margin: 12px 0 0; color: #b94334; font-size: 12px; }
.auth-foot { margin: 28px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }

.app { position: relative; z-index: 2; display: grid; grid-template-columns: 82px minmax(290px, 350px) minmax(420px, 1fr); width: 100%; height: 100dvh; background: var(--paper); }
.rail { display: flex; padding: 22px 12px; flex-direction: column; align-items: center; border-right: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.52); background: var(--ink); }
.rail-logo { display: grid; padding: 0; width: 50px; height: 50px; place-items: center; border: 0; color: var(--white); background: transparent; cursor: pointer; transform: scale(.82); }
.rail-links { display: flex; width: 100%; margin: auto 0; flex-direction: column; gap: 9px; }
.rail-btn { position: relative; display: flex; height: 60px; padding: 7px 3px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 16px; color: inherit; background: transparent; cursor: pointer; transition: .25s; }
.rail-btn > span { font-size: 23px; line-height: 1; }.rail-btn small { font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.rail-btn:hover, .rail-btn.active { color: var(--mint); background: rgba(119,228,200,.1); }
.rail-btn.active::before { content: ""; position: absolute; left: -12px; width: 3px; height: 26px; border-radius: 0 3px 3px 0; background: var(--mint); }
.nav-badge { position: absolute; top: 7px; right: 9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; color: var(--ink); background: var(--coral); font-size: 9px; line-height: 16px; }
.avatar-button { position: relative; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.avatar { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 14px; color: var(--white); background: linear-gradient(145deg, var(--mint-dark), #146274); font-weight: 900; text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.presence-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border: 2px solid var(--ink); border-radius: 50%; background: var(--mint); }

.sidebar { display: flex; min-width: 0; height: 100%; flex-direction: column; border-right: 1px solid var(--line); background: rgba(255,253,247,.7); backdrop-filter: blur(18px); }
.sidebar-head { display: flex; padding: 27px 22px 16px; align-items: center; justify-content: space-between; }
.sidebar-head h2 { margin: 4px 0 0; font: 700 25px var(--display); letter-spacing: -.04em; }
.icon-button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.48); cursor: pointer; transition: .2s; }
.icon-button:hover { transform: translateY(-1px); border-color: rgba(30,159,136,.45); background: var(--white); }
.icon-button.accent { border: 0; color: var(--ink); background: var(--mint); font-size: 23px; }
.search-box { display: flex; height: 44px; margin: 0 18px 14px; padding: 0 12px; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 13px; color: var(--muted); background: rgba(7,27,34,.055); transition: .2s; }
.search-box:focus-within { border-color: rgba(30,159,136,.4); background: white; box-shadow: 0 6px 18px rgba(7,27,34,.07); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: #8a918e; background: rgba(255,255,255,.5); font-size: 9px; }
.filter-row { display: flex; padding: 0 18px 13px; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.pill { padding: 7px 11px; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; transition: .2s; }
.pill.active { border-color: var(--ink); color: var(--white); background: var(--ink); }
.sidebar-content { min-height: 0; padding: 0 10px 18px; flex: 1; overflow-y: auto; }
.sidebar-content::-webkit-scrollbar, .message-list::-webkit-scrollbar { width: 5px; }
.sidebar-content::-webkit-scrollbar-thumb, .message-list::-webkit-scrollbar-thumb { border-radius: 5px; background: rgba(7,27,34,.14); }
.section-label { display: flex; margin: 12px 10px 8px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.chat-item, .person-item { position: relative; display: flex; width: 100%; padding: 11px 10px; align-items: center; gap: 11px; border: 0; border-radius: 16px; background: transparent; text-align: left; cursor: pointer; transition: transform .18s, background .18s; animation: itemIn .36s both; }
.chat-item:hover, .person-item:hover { background: rgba(255,255,255,.72); transform: translateX(2px); }
.chat-item.active { background: var(--white); box-shadow: 0 8px 22px rgba(7,27,34,.08); }
.chat-item.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 26px; border-radius: 4px; background: var(--coral); }
.item-copy { min-width: 0; flex: 1; }
.item-top { display: flex; align-items: baseline; gap: 8px; }
.item-top b { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.item-top time { color: var(--muted); font-size: 9px; }
.item-bottom { display: flex; margin-top: 4px; align-items: center; gap: 8px; }
.item-bottom p { min-width: 0; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.unread-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; color: var(--white); background: var(--coral); font-size: 9px; font-weight: 900; line-height: 18px; text-align: center; }
.avatar-wrap { position: relative; flex: 0 0 auto; }.avatar-wrap .online-dot { position: absolute; right: -1px; bottom: 0; width: 10px; height: 10px; border: 2px solid var(--white); border-radius: 50%; background: var(--mint-dark); }
.avatar--group { color: var(--ink); background: linear-gradient(145deg, var(--yellow), var(--coral)); }
.avatar--channel { color: var(--ink); background: linear-gradient(145deg, var(--mint), #b8f2e4); }
.sidebar-profile { display: flex; padding: 14px 18px; align-items: center; gap: 10px; border-top: 1px solid var(--line); background: rgba(255,255,255,.34); }
.sidebar-profile .item-copy b { display: block; font-size: 12px; }.sidebar-profile .item-copy small { color: var(--muted); font-size: 10px; }

.conversation { position: relative; min-width: 0; min-height: 0; overflow: hidden; background-color: #edf0e8; background-image: radial-gradient(rgba(7,27,34,.045) 1px, transparent 1px); background-size: 22px 22px; }
.empty-chat { display: flex; height: 100%; padding: 30px; flex-direction: column; align-items: center; justify-content: center; text-align: center; animation: fadeUp .6s both; }
.empty-chat h2 { margin: 11px 0 8px; font: 700 29px var(--display); letter-spacing: -.05em; }.empty-chat > p:not(.eyebrow) { max-width: 370px; margin: 0 0 22px; color: var(--muted); line-height: 1.6; }
.empty-orbit { position: relative; display: grid; width: 92px; height: 92px; margin-bottom: 25px; place-items: center; border: 1px solid rgba(7,27,34,.14); border-radius: 50%; animation: float 4s ease-in-out infinite; }
.empty-orbit::before { content: ""; position: absolute; width: 116px; height: 40px; border: 2px solid var(--mint-dark); border-top-color: transparent; border-bottom-color: transparent; border-radius: 50%; transform: rotate(-24deg); }
.empty-orbit span { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); box-shadow: inset -12px -8px 0 rgba(119,228,200,.25); }.empty-orbit i { position: absolute; width: 10px; height: 10px; right: -11px; border-radius: 50%; background: var(--coral); }
.chat-view { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100%; }
.chat-head { position: relative; z-index: 3; display: flex; min-height: 78px; padding: 13px 22px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(255,253,247,.78); backdrop-filter: blur(18px); }
.mobile-back { display: none; }.chat-person { display: flex; min-width: 0; flex: 1; align-items: center; gap: 12px; }.chat-person .item-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }.chat-person .item-copy small { color: var(--muted); font-size: 10px; }.chat-actions { display: flex; gap: 8px; }
.typing-bar { min-height: 0; padding: 0 24px; color: var(--mint-dark); background: rgba(255,253,247,.68); font-size: 10px; transition: .2s; }.typing-bar:not(:empty) { height: 24px; padding-top: 4px; }
.message-list { min-height: 0; padding: 26px clamp(18px, 4vw, 54px) 14px; overflow-y: auto; scroll-behavior: smooth; }
.day-divider { display: flex; margin: 12px 0 22px; align-items: center; gap: 12px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }.day-divider::before, .day-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.message { display: flex; max-width: min(78%, 720px); margin: 0 0 10px; align-items: flex-end; gap: 8px; animation: messageIn .26s both; }
.message.mine { margin-left: auto; flex-direction: row-reverse; }
.message .avatar { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }
.bubble-wrap { min-width: 0; }.sender-name { display: block; margin: 0 0 4px 4px; color: var(--mint-dark); font-size: 10px; font-weight: 900; }
.bubble { position: relative; display: grid; min-width: 64px; padding: 10px 13px 8px; gap: 5px; border: 1px solid rgba(7,27,34,.07); border-radius: 17px 17px 17px 5px; background: var(--white); box-shadow: 0 5px 13px rgba(7,27,34,.055); }
.mine .bubble { color: var(--white); border-color: transparent; border-radius: 17px 17px 5px 17px; background: var(--ink-2); }
.bubble p { min-width: 0; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13px; line-height: 1.48; }.bubble-meta { display: flex; min-height: 12px; margin: 0; align-items: center; justify-self: end; gap: 5px; color: var(--muted); font-size: 8px; line-height: 1; white-space: nowrap; }.mine .bubble-meta { color: rgba(255,255,255,.58); }.delivery-state { letter-spacing: -.12em; }
.edited { font-style: italic; }.message-actions { display: flex; opacity: 0; gap: 3px; transform: translateY(4px); transition: .18s; }.message:hover .message-actions { opacity: 1; transform: translateY(0); }.message-actions button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.7); cursor: pointer; font-size: 11px; }
.reactions { display: flex; margin-top: 4px; flex-wrap: wrap; gap: 4px; }.reaction { padding: 3px 7px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.78); cursor: pointer; font-size: 10px; }.reaction.mine { border-color: var(--mint-dark); background: #dff8f1; }
.jump-bottom { position: absolute; right: 24px; bottom: 108px; z-index: 4; padding: 8px 12px; border: 0; border-radius: 18px; color: var(--white); background: var(--ink); box-shadow: var(--shadow); cursor: pointer; font-size: 11px; }
.composer { position: relative; z-index: 4; padding: 10px clamp(14px, 3vw, 36px) 14px; border-top: 1px solid var(--line); background: rgba(255,253,247,.86); backdrop-filter: blur(18px); }
.composer-row { display: flex; min-height: 49px; padding: 5px; align-items: flex-end; gap: 7px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: 0 8px 24px rgba(7,27,34,.06); }
.composer textarea { min-height: 37px; max-height: 130px; padding: 9px 4px 7px; flex: 1; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.45; }
.composer .icon-button { border: 0; background: transparent; }.send-button { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 12px; color: var(--ink); background: var(--mint); cursor: pointer; font-size: 20px; font-weight: 900; transition: .2s; }.send-button:hover { transform: translateY(-2px) rotate(4deg); box-shadow: 0 8px 16px rgba(30,159,136,.2); }
.composer > small { display: block; margin: 6px 3px 0; color: var(--muted); font-size: 8px; }.reply-preview { display: flex; margin-bottom: 7px; padding: 7px 10px; align-items: center; justify-content: space-between; border-left: 3px solid var(--coral); border-radius: 7px; color: var(--muted); background: var(--paper); font-size: 10px; }.reply-preview button { border: 0; background: transparent; cursor: pointer; }
.emoji-panel { position: absolute; left: clamp(14px, 3vw, 36px); bottom: 91px; display: grid; width: 240px; padding: 10px; grid-template-columns: repeat(6, 1fr); gap: 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow); animation: pop .2s both; }.emoji-panel button { padding: 6px 3px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 18px; }.emoji-panel button:hover { background: var(--paper); transform: scale(1.15); }

.details { width: 300px; height: 100%; overflow-y: auto; border-left: 1px solid var(--line); background: var(--white); animation: panelIn .3s both; }
.app:has(.details:not(.hidden)) { grid-template-columns: 82px minmax(280px, 330px) minmax(400px, 1fr) 300px; }
.details-head { display: flex; padding: 23px 20px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }.details-head h3 { margin: 0; font: 700 16px var(--display); }.details-body { padding: 25px 20px; }.details-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }.details-hero .avatar { width: 76px; height: 76px; border-radius: 24px; font-size: 25px; }.details-hero h3 { margin: 14px 0 3px; font: 700 19px var(--display); }.details-hero p { margin: 0; color: var(--muted); font-size: 11px; }.details-note { margin: 22px 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }.detail-action { display: flex; width: 100%; padding: 11px 4px; align-items: center; gap: 9px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 12px; text-align: left; }.detail-action span:last-child { margin-left: auto; color: var(--muted); }

.blank-state { display: flex; min-height: 260px; padding: 28px; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }.blank-state b { margin-bottom: 6px; color: var(--ink); font: 700 15px var(--display); }.blank-state p { max-width: 230px; margin: 0; font-size: 11px; line-height: 1.5; }
.person-actions { display: flex; margin-left: auto; gap: 5px; }.mini-button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); cursor: pointer; font-size: 9px; font-weight: 900; }.mini-button.primary-mini { border-color: var(--ink); color: var(--white); background: var(--ink); }

.modal-layer { position: fixed; z-index: 30; inset: 0; display: grid; padding: 18px; place-items: center; }.modal-backdrop { position: absolute; inset: 0; background: rgba(4,20,25,.52); backdrop-filter: blur(8px); animation: fade .2s both; }.modal { position: relative; width: min(470px, 100%); max-height: min(720px, calc(100dvh - 36px)); overflow-y: auto; border: 1px solid rgba(255,255,255,.65); border-radius: 25px; background: var(--white); box-shadow: 0 35px 90px rgba(3,18,22,.3); animation: modalIn .3s both; }.modal-head { display: flex; padding: 22px 24px 17px; align-items: start; justify-content: space-between; border-bottom: 1px solid var(--line); }.modal-head h2 { margin: 3px 0 0; font: 700 21px var(--display); letter-spacing: -.04em; }.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }.modal-body { padding: 22px 24px; }.modal-foot { display: flex; padding: 15px 24px 22px; justify-content: flex-end; gap: 9px; }.modal .field { margin-bottom: 15px; }.modal textarea { min-height: 84px; resize: vertical; }.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.type-card { padding: 14px 7px; border: 1px solid var(--line); border-radius: 12px; background: transparent; cursor: pointer; text-align: center; }.type-card b { display: block; margin-top: 5px; font-size: 10px; }.type-card.active { border-color: var(--mint-dark); background: rgba(119,228,200,.16); }.member-picks { display: flex; max-height: 165px; padding: 5px 0; flex-direction: column; gap: 5px; overflow-y: auto; }.member-pick { display: flex; padding: 8px; align-items: center; gap: 9px; border-radius: 10px; background: var(--paper); }.member-pick input { width: auto; margin-left: auto; accent-color: var(--mint-dark); }.avatar-upload { display: flex; margin-bottom: 20px; align-items: center; gap: 14px; }.avatar-upload .avatar { width: 62px; height: 62px; border-radius: 20px; font-size: 22px; }.modal-note { padding: 10px 12px; border-radius: 10px; color: var(--muted); background: var(--paper); font-size: 10px; line-height: 1.5; }
.toast-stack { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: flex; width: min(340px, calc(100% - 40px)); flex-direction: column; gap: 8px; pointer-events: none; }.toast { display: flex; padding: 13px 15px; align-items: center; gap: 10px; border-left: 3px solid var(--mint); border-radius: 12px; color: var(--white); background: var(--ink); box-shadow: var(--shadow); font-size: 11px; animation: toastIn .3s both; }.toast.error { border-left-color: var(--coral); }

@keyframes drift { to { transform: translate3d(35px, 28px, 0) scale(1.08); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(119,228,200,0); } 100% { box-shadow: 0 0 0 0 rgba(119,228,200,0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes itemIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes messageIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes panelIn { from { opacity: 0; transform: translateX(16px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes pop { from { opacity: 0; transform: translateY(5px) scale(.96); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } }
@keyframes float { 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes captchaLoad { to { background-position: -200% 0; } }
.reveal { animation: fadeUp .6s .12s both; }

@media (max-width: 1120px) {
  .app:has(.details:not(.hidden)) { grid-template-columns: 74px 300px minmax(400px, 1fr); }
  .details { position: absolute; z-index: 10; right: 0; box-shadow: -20px 0 50px rgba(7,27,34,.12); }
  .app { grid-template-columns: 74px 310px minmax(400px, 1fr); }
  .rail { padding-inline: 8px; }
}
@media (max-width: 820px) {
  .auth { display: block; overflow-y: auto; background: var(--ink); }
  .auth-story { position: fixed; inset: 0; padding: 24px; min-height: auto; }.auth-story > * { display: none; }.auth-story::before { width: 100vw; height: 100vw; right: -48vw; top: -18vw; }
  .auth-card { position: relative; width: min(480px, calc(100% - 28px)); margin: 32px auto; padding: 30px 24px; background: rgba(255,253,247,.96); }.auth-mobile-brand { display: flex; }
  .app { grid-template-columns: 66px 300px minmax(0, 1fr); }
  .rail { padding-block: 14px; }.sidebar { position: relative; z-index: 5; }.composer > small { display: none; }.composer { padding-bottom: max(11px, env(safe-area-inset-bottom)); }
}
@media (max-width: 680px) {
  .app { display: block; }.rail { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; width: 100%; height: 64px; padding: 6px 16px max(6px, env(safe-area-inset-bottom)); flex-direction: row; border: 0; border-top: 1px solid rgba(255,255,255,.1); }
  .rail-logo { display: none; }.rail-links { display: flex; margin: 0; flex: 1; flex-direction: row; justify-content: space-around; }.rail-btn { width: 70px; height: 50px; }.rail-btn.active::before { top: -6px; left: 50%; width: 24px; height: 3px; transform: translateX(-50%); border-radius: 0 0 4px 4px; }.avatar-button { margin-left: 6px; }.avatar-button .avatar { width: 37px; height: 37px; border-radius: 12px; }
  .sidebar { width: 100%; height: calc(100dvh - 64px); border: 0; }.conversation { position: fixed; z-index: 15; inset: 0 0 64px; transform: translateX(100%); transition: transform .3s cubic-bezier(.22,.8,.25,1); }.app.chat-open .conversation { transform: translateX(0); }.chat-head { min-height: 68px; padding: 10px 12px; }.mobile-back { display: grid; }.details { position: fixed; z-index: 25; inset: 0; width: 100%; }.message { max-width: 88%; }.message-list { padding-inline: 13px; }.chat-actions { gap: 4px; }.composer { padding-inline: 9px; }.sidebar-profile { display: none; }
}
@media (max-width: 420px) {
  .auth-card { margin: 14px auto; padding: 25px 19px; border-radius: 22px; }.auth-heading { margin: 30px 0 22px; }.auth-heading h2 { font-size: 29px; }.type-grid { grid-template-columns: 1fr; }.type-card { display: flex; align-items: center; justify-content: center; gap: 8px; }.type-card b { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Monochrome theme */
.ambient i { opacity: .42; filter: blur(10px); }
.ambient i:nth-child(1) { background: rgba(0, 0, 0, .07); }
.ambient i:nth-child(2) { background: rgba(255, 255, 255, .55); }
.ambient i:nth-child(3) { border-color: var(--line); }
html[data-theme="dark"] .ambient i:nth-child(1) { background: rgba(255, 255, 255, .055); }
html[data-theme="dark"] .ambient i:nth-child(2) { background: rgba(255, 255, 255, .025); }

.brand-mark i { background: currentColor; box-shadow: 13px -9px 0 -2px currentColor; }
.eyebrow, .kicker { color: var(--muted); }
.auth-story { color: #f5f5f2; background: #0a0a0a; }
.auth-story::before { border-color: rgba(255, 255, 255, .13); box-shadow: 0 0 0 65px rgba(255, 255, 255, .025), 0 0 0 130px rgba(255, 255, 255, .014); }
.auth-story::after { box-shadow: 150px 80px 0 rgba(255,255,255,.7), 310px 12px 0 rgba(255,255,255,.5), 420px 210px 0 rgba(255,255,255,.28), 90px 340px 0 rgba(255,255,255,.45), 360px 430px 0 rgba(255,255,255,.35); }
.story-copy h1 em { color: #f5f5f2; }
.story-copy > p:last-child { color: rgba(245,245,242,.58); }
.signal-card { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.055); }
.signal-pulse, .signal-bars i { background: #f5f5f2; }
.signal-pulse { box-shadow: 0 0 0 0 rgba(255,255,255,.35); }

.auth-card { border-color: var(--line); border-radius: 24px; background: var(--glass); }
.auth-topbar { display: flex; align-items: center; gap: 10px; }
.auth-topbar .auth-tabs { min-width: 0; flex: 1; }
.auth-tabs { background: rgba(20,20,20,.055); }
.auth-tab.active { background: var(--white); box-shadow: 0 5px 14px rgba(0,0,0,.07); }
html[data-theme="dark"] .auth-tabs { background: rgba(255,255,255,.07); }

.theme-switch { position: relative; width: 48px; height: 30px; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--paper-2); cursor: pointer; transition: border-color .25s, background .25s, transform .2s; }
.theme-switch:hover { transform: translateY(-1px); border-color: var(--muted); }
.theme-switch i { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .3s cubic-bezier(.22,.8,.25,1), background .25s; }
.theme-switch.is-dark i { transform: translateX(18px); }
.rail-theme { width: 44px; height: 28px; margin-bottom: 14px; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.1); }
.rail-theme i { top: 4px; left: 4px; width: 18px; height: 18px; background: var(--rail-fg); }
.rail-theme.is-dark i { transform: translateX(16px); }

.field input, .field textarea, .modal input, .modal textarea, .modal select { color: var(--ink); background: var(--field); }
.field input:focus, .field textarea:focus, .modal input:focus, .modal textarea:focus, .modal select:focus { border-color: var(--ink); background: var(--white); box-shadow: 0 0 0 4px rgba(127,127,127,.13); }
.captcha-image { background: var(--paper-2); }
.captcha-image.loading { background: linear-gradient(100deg, var(--paper-2) 20%, var(--white) 40%, var(--paper-2) 60%); background-size: 200% 100%; }
.captcha-refresh { color: var(--ink); background: var(--field); }
.primary { color: var(--white); background: var(--ink); box-shadow: 0 10px 24px rgba(0,0,0,.15); }
.primary:hover { box-shadow: 0 14px 30px rgba(0,0,0,.2); }
.secondary { color: var(--ink); background: var(--white); }
.secondary:hover { border-color: var(--ink); background: var(--white); }

.rail { color: rgba(244,244,241,.54); background: var(--rail-bg); }
.rail-logo { color: var(--rail-fg); }
.rail-btn:hover, .rail-btn.active { color: var(--rail-fg); background: rgba(255,255,255,.09); }
.rail-btn.active::before { background: var(--rail-fg); }
.nav-badge { color: #0b0b0b; background: #f4f4f1; }
.presence-dot { border-color: var(--rail-bg); background: #f4f4f1; }
.avatar { color: #f6f6f2; background: linear-gradient(145deg, #555, #222); }
.avatar--group, .avatar--channel { color: #111; background: linear-gradient(145deg, #eeeeea, #bdbdb7); }

.sidebar { background: var(--glass); }
.sidebar-profile { background: var(--glass); }
.icon-button { background: var(--field); }
.icon-button:hover { border-color: var(--ink); background: var(--white); }
.icon-button.accent, .send-button { color: var(--white); background: var(--ink); }
.search-box { background: rgba(127,127,127,.08); }
.search-box:focus-within { border-color: var(--ink); background: var(--white); box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.chat-item:hover, .person-item:hover { background: rgba(127,127,127,.08); }
.chat-item.active { background: var(--white); box-shadow: 0 8px 22px rgba(0,0,0,.07); }
.chat-item.active::before { background: var(--ink); }
.unread-badge { color: var(--white); background: var(--ink); }
.avatar-wrap .online-dot { border-color: var(--white); background: var(--ink); }

.conversation { background-color: var(--conversation); background-image: radial-gradient(var(--line) 1px, transparent 1px); }
.empty-orbit { border-color: var(--line); }
.empty-orbit span { background: var(--ink); box-shadow: inset -12px -8px 0 rgba(127,127,127,.18); }
.empty-orbit i { background: var(--ink); }
.chat-head, .typing-bar, .composer { background: var(--glass); }
.bubble { border-color: var(--line); box-shadow: 0 5px 13px rgba(0,0,0,.05); }
.mine .bubble { color: var(--white); background: var(--ink-2); }
.message-actions button, .reaction { color: var(--ink); background: var(--field); }
.reaction.mine { border-color: var(--ink); background: var(--paper-2); }
.composer-row { box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.send-button:hover { box-shadow: 0 8px 16px rgba(0,0,0,.18); }

.modal-backdrop { background: rgba(0,0,0,.58); }
.modal { border-color: var(--line); box-shadow: 0 35px 90px rgba(0,0,0,.35); }
.type-card.active { border-color: var(--ink); background: var(--paper-2); }
.member-pick { background: var(--paper); }
.member-pick input { accent-color: var(--ink); }
.toast { color: var(--white); background: var(--ink); border-left-color: var(--muted); }

html[data-theme="dark"] .auth-card { background: rgba(20,20,20,.9); }
html[data-theme="dark"] .sidebar, html[data-theme="dark"] .sidebar-profile { background: rgba(16,16,16,.88); }
html[data-theme="dark"] .chat-head, html[data-theme="dark"] .typing-bar, html[data-theme="dark"] .composer { background: rgba(17,17,17,.88); }
html[data-theme="dark"] .captcha-image::after { box-shadow: inset 0 0 20px rgba(0,0,0,.22); }
html[data-theme="dark"] .primary, html[data-theme="dark"] .mine .bubble, html[data-theme="dark"] .unread-badge, html[data-theme="dark"] .jump-bottom { color: #111; background: #f2f2ef; }
html[data-theme="dark"] .icon-button.accent, html[data-theme="dark"] .send-button { color: #111; background: #f2f2ef; }
html[data-theme="dark"] .toast { color: #111; background: #f2f2ef; }
html[data-theme="dark"] .chat-item.active { background: #202020; }

@media (max-width: 820px) {
  .auth-card { background: rgba(255,255,255,.94); }
  html[data-theme="dark"] .auth-card { background: rgba(20,20,20,.96); }
}
@media (max-width: 680px) {
  .rail-theme { width: 38px; height: 28px; margin: 0 5px 0 0; }
  .rail-theme.is-dark i { transform: translateX(10px); }
}
