:root {
  --bg: #f8fafc;
  --surface: rgba(255,255,255,.88);
  --surface-solid: #fff;
  --surface-2: #f2f5f8;
  --text: #121417;
  --muted: #68717c;
  --line: #dde3e9;
  --accent: #76b900;
  --accent-strong: #5f9800;
  --accent-soft: rgba(118,185,0,.13);
  --blue: #4285f4;
  --danger: #d93025;
  --shadow: 0 18px 55px rgba(20,28,38,.09);
  --radius: 22px;
  --radius-sm: 13px;
  --code: #12151a;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #080a0c;
  --surface: rgba(20,23,27,.88);
  --surface-solid: #14171b;
  --surface-2: #1b1f24;
  --text: #f3f5f7;
  --muted: #9aa3ad;
  --line: #2d333a;
  --accent-soft: rgba(118,185,0,.17);
  --shadow: 0 20px 65px rgba(0,0,0,.34);
  --code: #090b0e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 999px; filter: blur(80px); opacity: .22; pointer-events: none; z-index: -1; }
.ambient-one { width: 380px; height: 380px; background: var(--accent); top: -180px; right: -110px; }
.ambient-two { width: 320px; height: 320px; background: var(--blue); bottom: -190px; left: -150px; opacity: .10; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 0 34px; background: color-mix(in srgb, var(--bg) 83%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); backdrop-filter: blur(20px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; width: max-content; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; background: var(--accent); color: #0a0d08; border-radius: 12px 4px 12px 4px; font-weight: 900; letter-spacing: -1px; box-shadow: 0 8px 22px rgba(118,185,0,.27); }
.brand-mark.large { width: 52px; height: 52px; margin: 0 auto 15px; font-size: 18px; }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-size: 16px; letter-spacing: -.2px; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: 1.2px; margin-top: 4px; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 5px 18px rgba(15,23,42,.04); }
.nav-button { border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 9px 17px; font-weight: 650; display: flex; gap: 8px; align-items: center; transition: .2s ease; }
.nav-button:hover { color: var(--text); background: var(--surface-2); }
.nav-button.active { color: var(--text); background: var(--surface-solid); box-shadow: 0 3px 12px rgba(15,23,42,.10); }
.nav-icon { color: var(--accent-strong); font-weight: 900; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 9px; position: relative; }
.icon-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 40px; height: 40px; border-radius: 13px; display: inline-grid; place-items: center; transition: .2s; }
.icon-button:hover, .secondary:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-1px); }
.primary, .secondary, .danger { border: 0; border-radius: 13px; min-height: 46px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-weight: 750; transition: transform .2s, box-shadow .2s, background .2s; }
.primary { background: var(--accent); color: #0b1006; box-shadow: 0 8px 22px rgba(118,185,0,.2); }
.primary:hover { background: #83ca05; transform: translateY(-1px); box-shadow: 0 11px 28px rgba(118,185,0,.28); }
.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.compact { min-height: 39px; padding: 0 15px; border-radius: 11px; font-size: 13px; }
.full { width: 100%; }
.user-chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; min-height: 43px; padding: 4px 12px 4px 5px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.avatar { width: 33px; height: 33px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; }
.popover { position: absolute; top: 52px; right: 0; min-width: 180px; border: 1px solid var(--line); border-radius: 14px; padding: 6px; background: var(--surface-solid); box-shadow: var(--shadow); }
.popover button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: 10px 12px; border-radius: 9px; }
.popover button:hover { background: var(--surface-2); }
.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 80px; }
.view { display: none; animation: fade .28s ease; }
.view.active { display: block; }
/* Select the requested route before app.js starts, preventing Home/Share from flashing on deep links. */
html:not(.app-ready) .view { display: none !important; animation: none; }
html:not(.app-ready)[data-initial-view="share"] #shareView,
html:not(.app-ready)[data-initial-view="chat"] #chatView,
html:not(.app-ready)[data-initial-view="playhd"] #playhdView,
html:not(.app-ready)[data-initial-view="paste"] #pasteView,
html:not(.app-ready)[data-initial-view="admin"] #adminView { display: block !important; }
html:not(.app-ready)[data-initial-view="chat"] .nav-button[data-view="chat"],
html:not(.app-ready)[data-initial-view="playhd"] .nav-button[data-view="playhd"],
html:not(.app-ready)[data-initial-view="share"] .nav-button[data-view="share"],
html:not(.app-ready)[data-initial-view="paste"] .nav-button[data-view="share"] { color: var(--text); background: var(--surface-solid); box-shadow: 0 3px 12px rgba(15,23,42,.10); }
html:not(.app-ready)[data-initial-view="paste"] .paste-result-card { min-height: 520px; }
@keyframes fade { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.hero { min-height: 310px; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 28px 5%; }
.eyebrow, .section-kicker { color: var(--accent-strong); font-size: 11px; font-weight: 850; letter-spacing: 1.7px; }
.hero h1, .section-heading h1 { margin: 15px 0 14px; font-size: clamp(38px, 5vw, 68px); letter-spacing: -3.7px; line-height: .98; }
.hero h1 span { color: var(--muted); font-weight: 500; }
.hero p, .section-heading p { color: var(--muted); max-width: 620px; font-size: 17px; }
.hero-orbit { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; position: relative; background: radial-gradient(circle, var(--accent-soft), transparent 65%); }
.hero-orbit::before, .hero-orbit::after { content: ""; position: absolute; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); }
.hero-orbit::before { inset: 17px; }.hero-orbit::after { inset: 42px; }
.hero-orbit span { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 22px; background: var(--surface-solid); box-shadow: var(--shadow); font-weight: 900; font-size: 23px; color: var(--accent-strong); z-index: 1; transform: rotate(-4deg); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.card { border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(16px); border-radius: var(--radius); box-shadow: var(--shadow); }
.editor-card, .generator-grid .card, .list-card { padding: 28px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.card-header h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.8px; }
.status-pill { background: var(--accent-soft); color: var(--accent-strong); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 800; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .2px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); color: var(--text); background: var(--surface-solid); border-radius: var(--radius-sm); outline: none; padding: 13px 14px; transition: border .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { resize: vertical; }
.form-row.two { display: grid; grid-template-columns: 1fr 220px; gap: 15px; margin-bottom: 15px; }
.code-input, .paste-code, .output-code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
#pasteContent { min-height: 285px; line-height: 1.6; tab-size: 2; }
.form-footer { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-top: 16px; }
.expiry-label { width: 190px; }
.side-card { padding: 28px; display: flex; flex-direction: column; }
.feature-icon, .gate-icon { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-size: 24px; font-weight: 900; }
.side-card h3, .chat-info h3 { font-size: 22px; margin: 20px 0 10px; }
.feature-list { list-style: none; padding: 0; margin: 10px 0 25px; display: grid; gap: 14px; color: var(--muted); font-size: 14px; }
.feature-list span { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 900; }
.mini-stat { margin-top: auto; border-top: 1px solid var(--line); padding-top: 17px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }.mini-stat strong { color: var(--text); }
.list-card { margin-top: 20px; }
.item-list { display: grid; gap: 8px; }
.list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; border: 1px solid var(--line); background: var(--surface-solid); padding: 13px 15px; border-radius: 13px; }
.list-item a { color: var(--text); font-weight: 750; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.list-item a:hover { color: var(--accent-strong); }
.list-item span { color: var(--muted); font-size: 12px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin: 25px 0 35px; }
.section-heading h1 { font-size: clamp(38px, 5vw, 60px); }
.presence { display: flex; align-items: center; gap: 7px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); padding: 10px 14px; border-radius: 999px; white-space: nowrap; }.presence-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); margin-right: 4px; }
.auth-gate { padding: 70px 25px; display: grid; place-items: center; text-align: center; }.auth-gate h2 { margin: 18px 0 5px; }.auth-gate p { color: var(--muted); margin: 0 0 20px; }
.chat-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.chat-sidebar { min-height: 640px; padding: 18px; display: flex; flex-direction: column; gap: 20px; overflow: hidden; }
.chat-sidebar-section { display: grid; gap: 10px; }
.online-section { min-height: 0; flex: 1; }
.online-heading { display: flex; align-items: center; justify-content: space-between; }
.online-heading > span:last-child { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 850; }
.conversation-button, .online-user { width: 100%; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 14px; padding: 10px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; transition: .18s ease; }
.conversation-button { grid-template-columns: 38px minmax(0, 1fr); }
.conversation-button:hover, .online-user:hover { background: var(--surface-2); border-color: var(--line); }
.online-user:disabled { cursor: default; }
.online-user.self-user:hover { background: transparent; border-color: transparent; }
.conversation-button.active, .online-user.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.conversation-button > span:nth-child(2), .online-user > span:nth-child(2) { min-width: 0; display: grid; }
.conversation-button strong, .online-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conversation-button small, .online-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.conversation-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 850; font-size: 12px; position: relative; }
.global-avatar { background: var(--accent); color: #10150a; font-size: 18px; }
.online-user .conversation-avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface-solid); }
.online-users { min-height: 80px; max-height: 410px; overflow-y: auto; display: grid; align-content: start; gap: 3px; padding-right: 2px; }
.online-empty { color: var(--muted); font-size: 12px; padding: 14px 10px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.unread-badge { min-width: 21px; height: 21px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: #10150a; font-size: 10px; font-weight: 900; }
.private-chat-note { margin: auto 4px 2px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.chat-card { min-height: 640px; overflow: hidden; display: flex; flex-direction: column; }
.conversation-header { min-height: 86px; padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--surface-solid); }
.conversation-header h2 { margin: 2px 0 0; font-size: 19px; }
.conversation-header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.messages { flex: 1; height: 404px; overflow-y: auto; padding: 25px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.message { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 11px; align-items: start; }
.message.own-message .message-text { background: var(--accent-soft); border-radius: 14px 4px 14px 14px; }
.message-body { min-width: 0; }
.message-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }.message-head strong { font-size: 13px; }.message-head time { color: var(--muted); font-size: 10px; }.admin-badge { color: var(--accent-strong); font-size: 9px; font-weight: 850; letter-spacing: .7px; }
.message-text { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--text); background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 11px 13px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.55; width: fit-content; max-width: 100%; }
.message-image { max-width: min(480px, 100%); max-height: 360px; border-radius: 14px; border: 1px solid var(--line); display: block; object-fit: contain; background: var(--surface-2); }
.message-tools { opacity: 0; display: flex; gap: 2px; }.message:hover .message-tools, .message:focus-within .message-tools { opacity: 1; }.message-tools button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }.message-tools button:hover { background: var(--surface-2); color: var(--text); }.message-tools button:last-child:not(:first-child) { color: var(--danger); }
.composer-shell { border-top: 1px solid var(--line); padding: 16px; background: var(--surface-solid); }.composer-shell.dragging { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.composer-shell textarea { min-height: 70px; max-height: 180px; resize: none; border: 0; padding: 8px; box-shadow: none; background: transparent; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }.composer-actions > div { display: flex; align-items: center; gap: 9px; }.composer-hint { color: var(--muted); font-size: 11px; }
.image-preview { padding: 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; margin-bottom: 8px; }.image-preview img { height: 70px; max-width: 130px; object-fit: cover; border-radius: 8px; vertical-align: middle; }.image-preview button { margin-left: 10px; }
.generator-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; }.generator-form { display: grid; gap: 15px; }.code-input.small { min-height: 210px; }.output-card { display: flex; flex-direction: column; }.output-code, .paste-code { margin: 0; border-radius: 15px; background: var(--code); color: #e6edf3; padding: 20px; overflow: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.62; font-size: 12px; }.output-code { flex: 1; min-height: 455px; }.output-meta { color: var(--muted); display: flex; justify-content: space-between; font-size: 10px; margin-top: 13px; }
.paste-page-heading { margin-bottom: 18px; }.paste-result-card { padding: 28px; }.paste-result-header h1 { margin: 5px 0; font-size: 30px; }.paste-result-header p { color: var(--muted); font-size: 12px; }.button-cluster { display: flex; gap: 8px; flex-wrap: wrap; }.paste-code { min-height: 430px; white-space: pre; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }.stat-card span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }.stat-card strong { display: block; font-size: 32px; margin-top: 4px; }
.admin-users { display: grid; gap: 8px; }.admin-user { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px auto; align-items: center; gap: 15px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-solid); }.admin-user small { color: var(--muted); }.role-pill { width: max-content; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; font-weight: 800; padding: 5px 8px; text-transform: uppercase; }
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(6,8,10,.62); backdrop-filter: blur(12px); }.modal { width: min(430px, 100%); border: 1px solid var(--line); border-radius: 25px; background: var(--surface-solid); box-shadow: 0 30px 90px rgba(0,0,0,.3); padding: 30px; position: relative; text-align: center; }.modal h2 { margin: 0; font-size: 28px; }.modal > p { color: var(--muted); font-size: 13px; }.modal-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; background: var(--surface-2); color: var(--text); border-radius: 10px; font-size: 20px; }.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 13px; margin: 22px 0; }.auth-tabs button { border: 0; border-radius: 10px; background: transparent; color: var(--muted); padding: 10px; font-weight: 750; }.auth-tabs button.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 3px 12px rgba(15,23,42,.08); }.auth-form { display: grid; gap: 14px; text-align: left; }.optional { font-weight: 500; }.form-error { background: rgba(217,48,37,.10); color: var(--danger) !important; border-radius: 10px; padding: 9px; }.toast-container { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: grid; gap: 9px; }.toast { max-width: 360px; background: var(--text); color: var(--bg); border-radius: 13px; padding: 12px 15px; box-shadow: var(--shadow); font-size: 13px; animation: toastIn .25s ease; }.toast.error { background: var(--danger); color: white; }@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }
.empty-state { padding: 25px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 13px; }
@media (max-width: 900px) { .topbar { grid-template-columns: 1fr auto; padding: 0 18px; }.main-nav { position: fixed; z-index: 40; bottom: 14px; left: 50%; transform: translateX(-50%); box-shadow: 0 12px 35px rgba(0,0,0,.2); }.brand-copy small { display: none; }.workspace-grid, .chat-layout, .generator-grid { grid-template-columns: 1fr; }.hero-orbit { display: none; }.hero { padding-inline: 0; }.side-card { display: none; }.chat-sidebar { min-height: auto; }.online-users { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); max-height: 210px; }.private-chat-note { margin-top: 0; }.stats-grid { grid-template-columns: 1fr 1fr; }.admin-user { grid-template-columns: 1fr auto; }.admin-user > :nth-child(2), .admin-user > :nth-child(3) { display: none; }.page-shell { padding-bottom: 110px; } }
@media (max-width: 600px) { .topbar { height: 66px; }.brand-copy { display: none; }.header-actions { gap: 5px; }.nav-button { padding: 9px 12px; font-size: 12px; }.page-shell { width: min(100% - 24px, 1180px); padding-top: 25px; }.hero { min-height: 260px; }.hero h1, .section-heading h1 { letter-spacing: -2.4px; }.form-row.two { grid-template-columns: 1fr; }.form-footer, .section-heading, .paste-result-header { align-items: stretch; flex-direction: column; }.expiry-label { width: 100%; }.form-footer .primary { width: 100%; }.editor-card, .generator-grid .card, .list-card, .paste-result-card { padding: 19px; }.card-header { flex-direction: column; }.button-cluster > button { flex: 1; }.composer-hint { display: none; }.messages { padding: 16px; }.message { grid-template-columns: 34px minmax(0,1fr) auto; }.stats-grid { grid-template-columns: 1fr 1fr; }.list-item { grid-template-columns: minmax(0,1fr) auto; }.list-item span:nth-child(2) { display: none; } }
button:disabled { cursor: not-allowed; opacity: .58; transform: none !important; box-shadow: none !important; }
