:root {
  color-scheme: dark;
  --bg: #1d1e1d;
  --sidebar: #242524;
  --surface: #2d2e2d;
  --surface-2: #333433;
  --surface-3: #3a3b3a;
  --border: #424442;
  --border-soft: #383a38;
  --text: #eeeeee;
  --muted: #9fa09f;
  --blue: #0a84ff;
  --green: #30d158;
  --violet: #6c7cff;
  --orange: #ffb35c;
  --red: #ff6961;
  --radius: 16px;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: inherit; }
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.muted { color: var(--muted); }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--bg); }
.auth-card { width: min(460px, 100%); padding: 34px; box-shadow: var(--shadow); }
.auth-logo, .brand { display: flex; align-items: center; gap: 12px; font-size: 19px; }
.brand > div { display: grid; gap: 1px; }
.lexora-logo { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.auth-copy { margin: 38px 0 26px; }
.auth-copy h1 { margin: 7px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.8px; }
.page-intro { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.eyebrow, .section-label { color: var(--muted); font-weight: 750; letter-spacing: .09em; font-size: 11px; }
.form-grid { display: grid; gap: 14px; }
.form-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
input { width: 100%; color: var(--text); background: #242524; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; outline: none; }
input:focus { border-color: var(--border); box-shadow: none; }
.password-hint { color: var(--muted); font-size: 11px; }
.error { min-height: 18px; color: var(--red); font-size: 12px; margin: 12px 0 0; }

.button { border: 1px solid #4a4c4a; border-radius: 10px; background: #343534; padding: 9px 14px; font-weight: 650; cursor: pointer; transition: .16s ease; }
.button:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.button:disabled { cursor: default; opacity: .56; }
.button.primary { background: var(--blue); border-color: transparent; color: white; }
.button.danger, .icon-button.danger { color: #ff8580; border-color: rgba(255,105,97,.45); background: rgba(255,105,97,.06); }
.button.ghost { border-color: transparent; background: transparent; color: var(--blue); }
.button.large { padding: 12px; }
.button.small { padding: 6px 10px; font-size: 12px; }
.icon-button { border: 1px solid transparent; background: transparent; border-radius: 9px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.07); }
.icon-button.save { color: var(--green); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 16px 16px; background: var(--sidebar); border-right: 1px solid var(--border); }
.brand { min-height: 52px; padding: 0 12px 16px; font-size: 18px; }
.brand strong, .auth-logo strong { font-weight: 700; letter-spacing: -.25px; }
.brand span { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
#nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { width: 100%; min-height: 43px; border: 0; background: transparent; color: #e8e8e8; border-radius: 10px; padding: 10px 13px; display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 520; cursor: pointer; text-align: left; transition: background-color .15s ease, color .15s ease; }
.nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon { width: 20px; height: 20px; flex: 0 0 20px; color: #a9aaa9; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: color .15s ease; }
.sparkles-icon { stroke-width: 1.7; }
.nav-item:hover { background: rgba(255,255,255,.055); }
.nav-item.active { background: #0a64d8; color: white; font-weight: 650; }
.nav-item.active .nav-icon { color: var(--orange); }
.nav-item:focus-visible { outline: 2px solid rgba(10,132,255,.8); outline-offset: 2px; }
.nav-section { margin: 20px 13px 8px; padding-top: 17px; border-top: 1px solid var(--border); }
.nav-section span { font-size: 9px; font-weight: 760; letter-spacing: .12em; color: #737573; }
.sidebar-account { margin-top: auto; min-height: 66px; padding: 10px 11px; display: flex; align-items: center; gap: 10px; background: #303130; border: 1px solid #454745; border-radius: 13px; }
.avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; color: white; font-weight: 750; font-size: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.avatar.large { width: 48px; height: 48px; font-size: 20px; }
.account-copy { min-width: 0; flex: 1; display: grid; gap: 6px; }
.account-copy strong { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-limit { width: 100%; height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.10); }
.account-limit i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--blue); transition: width .2s ease; }
.logout-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.workspace { min-width: 0; }
.app-shell.chat-page { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.chat-page .workspace { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.chat-page .topbar { flex: 0 0 auto; }
.chat-page .content { width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { min-height: 92px; display: flex; align-items: end; padding: 20px 36px 17px; border-bottom: 1px solid var(--border-soft); }
.topbar h1 { margin: 3px 0 0; font-size: 27px; letter-spacing: -.6px; }
.content { width: 100%; padding: 28px 36px 48px; max-width: 1500px; margin: 0 auto; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.card-header h2, .chat-head h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.25px; }
.card-pad { padding: 22px; }
.stack { display: grid; gap: 18px; align-content: start; }
.ui-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { min-height: 104px; display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: #b6b7b6; font-weight: 700; }
.stat-icon .ui-icon { width: 19px; height: 19px; }
.stat-card div { display: grid; gap: 2px; }
.stat-card strong { font-size: 23px; line-height: 1; }
.stat-card strong small { font-size: 12px; color: var(--muted); margin-left: 3px; }
.stat-card div > span { font-size: 12px; color: var(--muted); }

.heatmap-card { padding: 24px; }
.legend { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.legend i { width: 10px; height: 10px; background: #3a3c3a; border-radius: 2px; }.legend .l1 { background: #24552f; }.legend .l2 { background: #26843c; }.legend .l3 { background: #2bab48; }.legend .l4 { background: var(--green); }
.heatmap-wrap { display: grid; grid-template-columns: 24px minmax(676px, 1fr); gap: 8px; margin: 22px 0 20px; overflow-x: auto; padding: 3px 3px 7px; }
.weekday-labels { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; padding: 3px 0; font-size: 9px; color: var(--muted); }
.weekday-labels span { display: flex; align-items: center; }
.weekday-labels span:nth-child(1) { grid-row: 1; }.weekday-labels span:nth-child(2) { grid-row: 3; }.weekday-labels span:nth-child(3) { grid-row: 5; }.weekday-labels span:nth-child(4) { grid-row: 7; }
.heatmap-grid { display: grid; grid-template-columns: repeat(40, minmax(13px, 26px)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; justify-content: space-between; gap: 4px; padding: 3px; }
.heat-cell { width: 100%; min-width: 13px; aspect-ratio: 1; border: 0; border-radius: 3px; background: #3a3c3a; cursor: pointer; padding: 0; }
.heat-cell:hover, .heat-cell.selected { outline: 2px solid rgba(255,255,255,.72); outline-offset: 1px; }.heat-cell.level-1 { background: #24552f; }.heat-cell.level-2 { background: #26843c; }.heat-cell.level-3 { background: #2bab48; }.heat-cell.level-4 { background: var(--green); }
.heatmap-footer { min-height: 38px; border-top: 1px solid var(--border); padding-top: 17px; display: flex; align-items: center; gap: 25px; color: var(--muted); font-size: 12px; }
.heatmap-footer strong { color: var(--text); }
.heatmap-footer > span { display: inline-flex; align-items: center; gap: 6px; }
.heatmap-footer .ui-icon { width: 14px; height: 14px; }

.history-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding-left: 13px; }
.search-box.filtered { border-color: rgba(10,132,255,.4); }
.search-box input { min-width: 0; flex: 1; border: 0; background: transparent; box-shadow: none; padding-left: 0; }
.search-box .ui-icon { width: 15px; height: 15px; }
.history-filter-trigger { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; margin-right: 3px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.history-filter-trigger:hover { color: var(--text); background: rgba(255,255,255,.06); }
.history-filter-trigger.active { color: var(--blue); }
.history-filter-trigger .ui-icon { width: 17px; height: 17px; }
.result-count { color: var(--muted); font-size: 12px; }
.history-feed { display: grid; gap: 9px; }
.history-section-title { margin: 13px 0 2px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.history-section-title:first-child { margin-top: 3px; }
.history-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.history-text { margin: 0; color: var(--text); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-player { --audio-progress: 0%; height: 44px; margin-top: 8px; padding: 6px 10px 6px 8px; display: flex; align-items: center; gap: 8px; border-radius: 11px; background: rgba(255,255,255,.035); }
.player-toggle { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 9px; color: var(--blue); background: rgba(10,132,255,.14); cursor: pointer; }
.player-toggle:hover { background: rgba(10,132,255,.23); }.player-toggle:disabled { opacity: .58; cursor: wait; }.player-toggle.loading .ui-icon { animation: spin .7s linear infinite; }
.player-toggle .ui-icon { width: 14px; height: 14px; fill: currentColor; stroke-width: 1.4; }
.waveform { position: relative; flex: 1; height: 28px; overflow: hidden; cursor: pointer; border-radius: 5px; outline: none; }
.waveform:focus-visible { box-shadow: 0 0 0 2px rgba(10,132,255,.55); }
.waveform-base, .waveform-progress { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.waveform-progress { clip-path: inset(0 calc(100% - var(--audio-progress)) 0 0); color: var(--blue); }
.waveform i { flex: 1 1 1px; min-width: 1px; border-radius: 999px; background: currentColor; color: #656765; }
.waveform-progress i { color: var(--blue); }
.history-player audio { display: none; }
.history-meta { min-height: 36px; margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.history-app-icon { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: linear-gradient(145deg, #f2f2f2, #a9aaab); color: #242524; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); font-size: 13px; line-height: 1; }
.history-app-icon img { width: 100%; height: 100%; display: block; object-fit: cover; }
.history-chip { min-height: 24px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid rgba(255,255,255,.07); border-radius: 999px; background: rgba(255,255,255,.055); color: var(--muted); font-size: 10px; white-space: nowrap; }
.history-chip .ui-icon { width: 12px; height: 12px; }
.history-chip.green { color: var(--green); border-color: rgba(48,209,88,.13); background: rgba(48,209,88,.09); }
.history-chip.blue { color: var(--blue); border-color: rgba(10,132,255,.15); background: rgba(10,132,255,.09); }
.history-meta-spacer { flex: 1; }
.history-action { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.history-action:hover { color: var(--text); background: rgba(255,255,255,.07); }.history-action.destructive { color: var(--red); }.history-action.destructive:hover { background: rgba(255,105,97,.1); }
.history-action .ui-icon { width: 15px; height: 15px; }

.history-filter-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 26px; overflow-y: auto; background: rgba(10,11,10,.72); backdrop-filter: blur(5px); }
.history-filter-dialog { width: min(480px, 100%); max-height: calc(100vh - 52px); overflow-y: auto; padding: 18px; border: 1px solid #555755; border-radius: 22px; background: #282928; box-shadow: 0 30px 90px rgba(0,0,0,.58); }
.history-filter-head { display: flex; align-items: center; gap: 14px; }
.history-filter-head > div { flex: 1; }
.history-filter-head h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.35px; }
.history-filter-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: rgba(10,132,255,.17); }
.history-filter-icon .ui-icon { width: 19px; height: 19px; stroke-width: 2.2; }
.history-filter-close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.history-filter-close:hover { color: var(--text); background: rgba(255,255,255,.06); }
.history-filter-fields { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.history-filter-fields label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.history-filter-fields select { width: 100%; height: 40px; padding: 0 32px 0 11px; border: 1px solid #505250; border-radius: 9px; outline: none; color: var(--text); background: #343534; font: inherit; font-size: 12px; font-weight: 600; color-scheme: dark; }
.history-filter-fields select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,132,255,.14); }
.history-date-toggle { width: max-content; display: flex; align-items: center; gap: 11px; margin: 17px 0 11px; font-size: 12px; font-weight: 650; cursor: pointer; }
.history-date-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.history-date-toggle i { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #555755; transition: background .16s ease; }
.history-date-toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #f2f2f2; transition: transform .16s ease; }
.history-date-toggle input:checked + i { background: var(--blue); }
.history-date-toggle input:checked + i::after { transform: translateX(18px); }
.filter-calendar { padding: 13px; border: 1px solid #484a48; border-radius: 13px; background: #303130; }
.filter-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.filter-calendar-head strong { font-size: 14px; }
.filter-calendar-head > div { display: flex; align-items: center; gap: 8px; }
.calendar-nav, .calendar-today { height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.055); cursor: pointer; }
.calendar-nav { width: 30px; }
.calendar-nav .ui-icon { width: 13px; height: 13px; }
.calendar-today { padding: 0 10px; color: var(--blue); font-size: 12px; font-weight: 650; background: rgba(10,132,255,.1); }
.calendar-nav:hover, .calendar-today:hover { filter: brightness(1.2); }
.filter-calendar-weekdays, .filter-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.filter-calendar-weekdays { margin: 13px 0 5px; color: var(--muted); font-size: 10px; font-weight: 650; text-align: center; }
.filter-calendar-day { width: 27px; height: 27px; justify-self: center; border: 0; border-radius: 50%; background: transparent; color: var(--text); font-size: 11px; cursor: pointer; }
.filter-calendar-day:hover { background: rgba(255,255,255,.08); }
.filter-calendar-day.outside { color: #676967; }
.filter-calendar-day.today { box-shadow: inset 0 0 0 1px rgba(10,132,255,.72); }
.filter-calendar-day.selected { color: white; background: var(--blue); box-shadow: none; font-weight: 750; }
.history-filter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.history-filter-actions button { min-height: 38px; border: 0; border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.04); cursor: pointer; font-size: 12px; font-weight: 650; }
.history-filter-actions button:hover { filter: brightness(1.18); }
.history-filter-actions .apply { border: 1px solid #505250; color: var(--text); background: #373837; }
.chat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: rgba(10,132,255,.14); }
.chat-icon .ui-icon { width: 16px; height: 16px; }
.chat-row small { color: var(--muted); font-size: 10px; }
.model-pill, .status-pill, .count-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: rgba(255,255,255,.07); color: #b9bab9; font-size: 10px; font-weight: 700; }
.detail-stats, .friend-stats, .chart-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.detail-stats div, .friend-stats div { display: grid; gap: 4px; padding: 14px; text-align: center; border-right: 1px solid var(--border); }.detail-stats div:last-child, .friend-stats div:last-child { border: 0; }.detail-stats strong, .friend-stats strong { font-size: 16px; }.detail-stats span, .friend-stats span { color: var(--muted); font-size: 10px; }
.meta-list { margin: 18px 0; display: grid; }.meta-list div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); font-size: 12px; }.meta-list span { color: var(--muted); }.meta-list strong { text-align: right; }

.read-only-note, .subscription-note { padding: 13px 16px; border: 1px solid rgba(10,132,255,.26); background: rgba(10,132,255,.08); border-radius: 12px; color: #b7d9ff; font-size: 12px; margin-bottom: 16px; }
.read-only-note { display: flex; align-items: center; gap: 8px; }
.read-only-note .ui-icon { width: 16px; height: 16px; }
.chat-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.chat-list { min-height: 0; overflow-x: hidden; overflow-y: auto; }.chat-row { width: 100%; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 14px; text-align: left; cursor: pointer; }.chat-row:hover, .chat-row.active { background: rgba(10,132,255,.09); }.chat-row span:last-child { min-width: 0; display: grid; gap: 5px; }.chat-row strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.chat-view { min-height: 0; padding: 22px; display: flex; flex-direction: column; overflow: hidden; }.chat-head { flex: 0 0 auto; display: flex; align-items: start; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 18px; }.messages { flex: 1; min-height: 0; display: grid; align-content: start; gap: 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; margin-top: 4px; padding: 18px 5px 4px 0; }.messages:focus-visible { outline: 2px solid rgba(10,132,255,.7); outline-offset: -2px; border-radius: 8px; }.message { max-width: 82%; min-width: 0; }.message.user { justify-self: end; }.message > span { display: block; color: var(--muted); font-size: 10px; margin: 0 8px 5px; }.message-content { overflow-wrap: anywhere; padding: 13px 15px; background: #383938; border-radius: 14px 14px 14px 4px; line-height: 1.55; font-size: 13px; }.message.user .message-content { background: var(--blue); border-radius: 14px 14px 4px 14px; }.message small { display: block; color: #777; font-size: 9px; margin: 5px 8px 0; }.message.user small { text-align: right; }
.message-content > :first-child { margin-top: 0; }.message-content > :last-child { margin-bottom: 0; }.message-content p { margin: 0 0 10px; }.message-content h1, .message-content h2, .message-content h3, .message-content h4 { margin: 14px 0 7px; line-height: 1.25; }.message-content h1 { font-size: 1.35em; }.message-content h2 { font-size: 1.22em; }.message-content h3, .message-content h4 { font-size: 1.1em; }.message-content ul, .message-content ol { margin: 8px 0; padding-left: 22px; }.message-content li + li { margin-top: 4px; }.message-content blockquote { margin: 9px 0; padding: 3px 0 3px 11px; border-left: 3px solid rgba(255,255,255,.3); color: #d0d1d0; }.message-content code { padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.24); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }.message-content pre { max-width: 100%; overflow-x: auto; margin: 10px 0; padding: 12px; border-radius: 9px; background: rgba(0,0,0,.3); }.message-content pre code { padding: 0; background: transparent; }.message-content a { color: #9dceff; text-decoration: underline; text-underline-offset: 2px; }.message-content hr { border: 0; border-top: 1px solid rgba(255,255,255,.2); margin: 13px 0; }.message-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }.message-content th, .message-content td { border: 1px solid rgba(255,255,255,.2); padding: 6px 8px; text-align: left; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }.plan-card { min-height: 460px; padding: 24px; display: flex; flex-direction: column; }.plan-card.current { outline: 2px solid var(--violet); outline-offset: -2px; }.plan-head { display: flex; align-items: center; justify-content: space-between; }.plan-head h2 { margin: 0; font-size: 20px; }.plan-head span { color: var(--violet); background: rgba(108,124,255,.15); border-radius: 999px; padding: 5px 10px; font-size: 10px; font-weight: 750; }.price { font-size: 42px; font-weight: 750; margin: 28px 0 20px; letter-spacing: -1.5px; }.price small { font-size: 13px; color: var(--muted); letter-spacing: 0; }.plan-card ul { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 14px; }.plan-card li { color: var(--blue); font-weight: 800; }.plan-card li span { color: var(--text); font-size: 13px; margin-left: 9px; font-weight: 550; }.plan-card.violet li { color: var(--violet); }.plan-card.green li { color: var(--green); }.plan-button { margin-top: auto; color: white; border: 0; }.plan-card.blue .plan-button { background: var(--blue); }.plan-card.violet .plan-button { background: var(--violet); }.plan-card.green .plan-button { background: var(--green); }.subscription-note { margin: 18px 0 0; display: grid; gap: 3px; }.subscription-note span { color: var(--muted); }

.friend-layout { width: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; align-items: start; }.friend-layout > * { min-width: 0; }.inline-form { display: flex; gap: 10px; margin-top: 18px; }.inline-form input { flex: 1; min-width: 0; }.rows { margin-top: 14px; }.list-row { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; border: 0; border-top: 1px solid var(--border-soft); background: transparent; padding: 12px 0; text-align: left; }.list-row > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }.list-row strong, .list-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.list-row span { color: var(--muted); font-size: 10px; }.friend-item { cursor: pointer; }.friend-item:hover, .friend-item.active { color: var(--blue); }.row-actions { display: flex; gap: 6px; align-items: center; }.request-label { display: block; margin-top: 23px; }.settings-list { margin-top: 18px; }.setting-row { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border-soft); cursor: pointer; }.setting-row > span { display: grid; gap: 4px; }.setting-row small { color: var(--muted); }.setting-row input { position: absolute; left: 0; top: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }.setting-row i { width: 38px; height: 22px; background: #555; border-radius: 999px; position: relative; transition: .2s; }.setting-row i:after { content: ''; position: absolute; width: 18px; height: 18px; top: 2px; left: 2px; border-radius: 50%; background: white; transition: .2s; }.setting-row input:checked + i { background: var(--green); }.setting-row input:checked + i:after { transform: translateX(16px); }.profile-title { display: flex; align-items: center; gap: 12px; }.profile-title > div:nth-child(2) { flex: 1; }.profile-title h2 { margin: 0 0 3px; }.friend-stats { margin-top: 22px; }

.devices-card { overflow: hidden; }.device-list { border-top: 1px solid var(--border-soft); }.device-row { min-height: 76px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 13px 22px; border-bottom: 1px solid var(--border-soft); }.device-row:last-child { border-bottom: 0; }.device-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(10,132,255,.13); color: var(--blue); font-size: 17px; }.device-copy { min-width: 0; display: grid; gap: 5px; }.device-copy > span { font-size: 11px; color: var(--muted); }.device-name { width: max-content; max-width: 100%; display: flex; align-items: center; gap: 7px; }.device-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.rename-pencil { opacity: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; transition: .15s; }.device-name:hover .rename-pencil, .rename-pencil:focus { opacity: 1; }.device-actions { display: flex; align-items: center; gap: 12px; }.current-device { min-height: 34px; display: inline-flex; align-items: center; background: rgba(48,209,88,.12); color: var(--green); border-radius: 9px; padding: 0 12px; font-size: 12px; font-weight: 750; white-space: nowrap; }.device-rename { display: flex; align-items: center; gap: 4px; max-width: 480px; }.device-rename input { height: 36px; }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }.period-control { display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }.period-control span { color: var(--muted); font-size: 11px; padding: 0 7px; }.period-control button { border: 0; background: transparent; border-radius: 8px; color: var(--muted); padding: 7px 10px; font-size: 11px; cursor: pointer; }.period-control button.active { color: white; background: #4a4b4a; }.updated-at { color: var(--muted); font-size: 10px; }.admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }.admin-metric { display: flex; gap: 14px; padding: 18px; }.admin-metric > span { width: 39px; height: 39px; border-radius: 11px; background: rgba(255,255,255,.06); display: grid; place-items: center; }.admin-metric > span .ui-icon { width: 18px; height: 18px; }.admin-metric div { display: grid; gap: 3px; }.admin-metric small, .admin-metric em { color: var(--muted); font-size: 10px; font-style: normal; }.admin-metric strong { font-size: 20px; }.admin-metric.blue > span { background: rgba(10,132,255,.14); }.admin-metric.green > span { background: rgba(48,209,88,.14); }.admin-metric.violet > span { background: rgba(108,124,255,.14); }.admin-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 18px; margin-top: 18px; }.analytics-card, .technical-card { padding: 22px; }.bar-chart { height: 190px; display: flex; align-items: end; gap: 4px; padding: 24px 0 10px; border-bottom: 1px solid var(--border); }.bar-column { flex: 1; min-width: 3px; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 6px; }.bar-column i { display: block; width: min(14px, 72%); min-height: 3px; background: linear-gradient(var(--blue), #4469ca); border-radius: 4px 4px 1px 1px; }.bar-column span { color: #777; font-size: 7px; }.chart-summary { margin-top: 18px; border: 0; }.chart-summary span { display: grid; text-align: center; gap: 3px; color: var(--muted); font-size: 10px; }.chart-summary strong { color: var(--text); font-size: 15px; }.status-pill.green { color: var(--green); background: rgba(48,209,88,.12); }.status-pill.blue { color: #7dbfff; background: rgba(10,132,255,.12); }.status-pill.orange { color: var(--orange); background: rgba(255,176,46,.12); }.users-label { display: block; margin: 28px 0 10px; }.admin-users { overflow: hidden; }.admin-user-head, .admin-user-row { display: grid; grid-template-columns: minmax(260px, 1fr) 100px 100px 110px; align-items: center; gap: 14px; padding: 12px 18px; }.admin-user-head { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; }.admin-user-row { border-top: 1px solid var(--border-soft); font-size: 11px; }.admin-user-row > span:first-child { display: grid; gap: 3px; }.admin-user-row small { color: var(--muted); }.spinner { width: 24px; height: 24px; border: 2px solid #555; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }

.empty-state { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); text-align: center; padding: 30px; }.empty-state > span { font-size: 30px; }.empty-state .empty-icon { width: 30px; height: 30px; margin-bottom: 6px; }.empty-state h3, .empty-state p { margin: 0; }.empty-state p { font-size: 12px; max-width: 300px; line-height: 1.5; }.empty-state.compact { min-height: 90px; padding: 16px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; color: white; background: #393a39; border: 1px solid #555; border-radius: 11px; padding: 11px 16px; box-shadow: var(--shadow); font-size: 12px; transition: .2s ease; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .stats-grid, .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .friend-layout { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }.plan-card { min-height: 360px; }.admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }.app-shell.chat-page { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }.chat-page .sidebar { flex: 0 0 auto; }.chat-page .workspace { flex: 1; height: auto; min-height: 0; }.chat-page .content { min-height: 0; overflow: hidden; }.sidebar { position: static; height: auto; padding: 14px; }.brand { padding-bottom: 12px; }#nav { display: grid; grid-template-columns: repeat(3, 1fr); }.nav-item { justify-content: center; padding: 9px; }.nav-item span { display: none; }.nav-icon { width: 20px; height: 20px; flex-basis: 20px; }.nav-section { display: none !important; }.sidebar-account { margin-top: 12px; }.topbar { min-height: 84px; padding: 20px 18px 15px; }.content { padding: 18px; }.stats-grid, .admin-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }.stat-card { padding: 13px; min-height: 85px; }.heatmap-card { padding: 17px; }.heatmap-footer { flex-wrap: wrap; gap: 12px; }.history-toolbar { align-items: stretch; }.result-count { display: none; }.history-filter-backdrop { align-items: start; padding: 12px; }.history-filter-dialog { max-height: calc(100vh - 24px); padding: 16px; border-radius: 19px; }.history-filter-fields { grid-template-columns: 1fr; }.filter-calendar { padding: 12px 6px; }.filter-calendar-day { width: 27px; height: 27px; }.chat-layout { display: flex; flex-direction: column; min-height: 0; }.chat-list { max-height: 220px; margin-bottom: 0; }.chat-page .chat-list { flex: 0 1 28%; }.chat-view { flex: 1; min-height: 0; }.friend-layout { display: block; }.friend-layout > div + div { margin-top: 16px; }.device-row { grid-template-columns: 38px minmax(0, 1fr); }.device-actions { grid-column: 2; }.admin-user-head, .admin-user-row { grid-template-columns: minmax(180px, 1fr) 70px 70px; }.admin-user-head span:last-child, .admin-user-row > span:last-child { display: none; }
}
