    :root {
      --bg: #0a0a0a;
      --fg: #33ff33;
      --fg-dim: #1a8c1a;
      --fg-bright: #66ff66;
      --accent: #ff6600;
      --accent2: #ffcc00;
      --border: #1a4d1a;
      --border-bright: #33ff33;
      --input-bg: #050f05;
      --overlay: rgba(0, 10, 0, 0.92);
      --scanline: rgba(0, 0, 0, 0.15);
      --glow: 0 0 8px rgba(51, 255, 51, 0.4);
      --glow-strong: 0 0 20px rgba(51, 255, 51, 0.7);
      --font-main: 'Share Tech Mono', monospace;
      --font-display: 'VT323', monospace;
      --font-size: 14px;
    }

    [data-theme="amber"] {
      --bg: #0d0800;
      --fg: #ffb000;
      --fg-dim: #7a5500;
      --fg-bright: #ffd066;
      --accent: #ff6600;
      --accent2: #ff3300;
      --border: #3d2800;
      --border-bright: #ffb000;
      --input-bg: #080500;
      --glow: 0 0 8px rgba(255, 176, 0, 0.4);
      --glow-strong: 0 0 20px rgba(255, 176, 0, 0.7);
    }

    [data-theme="c64"] {
      --bg: #3a30c0;
      --fg: #7869f0;
      --fg-dim: #5248b0;
      --fg-bright: #a090ff;
      --accent: #ffffff;
      --accent2: #d0c0ff;
      --border: #5248b0;
      --border-bright: #a090ff;
      --input-bg: #2a20a0;
      --glow: 0 0 0px transparent;
      --glow-strong: 0 0 0 transparent;
    }

    [data-theme="matrix"] {
      --bg: #000000;
      --fg: #00ff41;
      --fg-dim: #006616;
      --fg-bright: #80ff80;
      --accent: #ffffff;
      --accent2: #00ccff;
      --border: #003300;
      --border-bright: #00ff41;
      --input-bg: #000500;
      --glow: 0 0 10px rgba(0, 255, 65, 0.5);
      --glow-strong: 0 0 25px rgba(0, 255, 65, 0.9);
    }

    [data-theme="ice"] {
      --bg: #020812;
      --fg: #00cfff;
      --fg-dim: #005577;
      --fg-bright: #66e5ff;
      --accent: #ff0088;
      --accent2: #ff88ff;
      --border: #003355;
      --border-bright: #00cfff;
      --input-bg: #010510;
      --glow: 0 0 8px rgba(0, 207, 255, 0.4);
      --glow-strong: 0 0 20px rgba(0, 207, 255, 0.7);
    }

    [data-theme="paper"] {
      --bg: #f5f0e8;
      --fg: #1a1a0a;
      --fg-dim: #666650;
      --fg-bright: #000000;
      --accent: #8b0000;
      --accent2: #005580;
      --border: #c8c0a0;
      --border-bright: #1a1a0a;
      --input-bg: #ece7d8;
      --overlay: rgba(245, 240, 232, 0.95);
      --glow: none;
      --glow-strong: none;
      --scanline: transparent;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html {
      height: 100%;
      overflow: hidden;
    }

    body {
      background: var(--bg);
      color: var(--fg);
      font-family: var(--font-main);
      font-size: var(--font-size);
      height: 100%;
      overflow: hidden;
      position: relative;
      cursor: default;
      line-height: 1.5;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background: repeating-linear-gradient(0deg, var(--scanline) 0px, var(--scanline) 1px, transparent 1px, transparent 3px);
      pointer-events: none;
      z-index: 9999;
    }

    body::after {
      content: '';
      position: fixed;
      inset: 0;
      background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.6) 100%);
      pointer-events: none;
      z-index: 9998;
    }

    @keyframes blink {

      0%,
      100% {
        opacity: 1
      }

      50% {
        opacity: 0
      }
    }

    @keyframes flicker {
      0% {
        opacity: 1
      }

      92% {
        opacity: 1
      }

      93% {
        opacity: 0.9
      }

      94% {
        opacity: 1
      }

      97% {
        opacity: 0.95
      }

      100% {
        opacity: 1
      }
    }

    @keyframes scanIn {
      from {
        transform: translateY(-6px);
        opacity: 0
      }

      to {
        transform: translateY(0);
        opacity: 1
      }
    }

    @keyframes fadeIn {
      from {
        opacity: 0
      }

      to {
        opacity: 1
      }
    }

    @keyframes pulse {

      0%,
      100% {
        text-shadow: var(--glow)
      }

      50% {
        text-shadow: var(--glow-strong)
      }
    }

    @keyframes slideRight {
      from {
        transform: translateX(-12px);
        opacity: 0
      }

      to {
        transform: translateX(0);
        opacity: 1
      }
    }

    @keyframes eqBar {

      0%,
      100% {
        height: 4px
      }

      50% {
        height: 20px
      }
    }

    #app {
      display: grid;
      grid-template-rows: auto 1fr auto;
      height: 100vh;
      max-height: 100vh;
      overflow: hidden;
      animation: flicker 8s infinite;
    }

    #topbar {
      border-bottom: 1px solid var(--border-bright);
      padding: 4px 12px;
      display: flex;
      align-items: center;
      gap: 16px;
      background: var(--bg);
      box-shadow: 0 1px 0 var(--border-bright), var(--glow);
      flex-shrink: 0;
      z-index: 100;
    }

    #topbar .logo {
      font-family: var(--font-display);
      font-size: 26px;
      color: var(--fg-bright);
      text-shadow: var(--glow-strong);
      letter-spacing: 2px;
      white-space: nowrap;
      animation: pulse 4s ease-in-out infinite;
    }

    #topbar .logo span {
      color: var(--accent);
    }

    #nav-links {
      display: flex;
      gap: 0;
      flex-wrap: wrap;
      flex: 1;
    }

    .nav-btn {
      background: none;
      border: none;
      color: var(--fg-dim);
      font-family: var(--font-main);
      font-size: 13px;
      padding: 2px 10px;
      cursor: pointer;
      border-right: 1px solid var(--border);
      transition: color 0.1s, background 0.1s;
      white-space: nowrap;
    }

    .nav-btn:hover,
    .nav-btn.active {
      color: var(--fg-bright);
      background: var(--input-bg);
      text-shadow: var(--glow);
    }

    .nav-btn.active {
      border-bottom: 1px solid var(--fg-bright);
    }

    .nav-btn .badge {
      display: inline-block;
      background: var(--accent);
      color: var(--bg);
      font-size: 10px;
      padding: 0 4px;
      margin-left: 4px;
      border-radius: 2px;
    }

    #topbar-right {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-left: auto;
      white-space: nowrap;
    }

    #topbar-right .username {
      color: var(--accent2);
      font-size: 13px;
      cursor: pointer;
    }

    #topbar-right .username:hover {
      text-shadow: var(--glow-strong);
    }

    .btn-sm {
      background: none;
      border: 1px solid var(--border);
      color: var(--fg-dim);
      font-family: var(--font-main);
      font-size: 12px;
      padding: 2px 8px;
      cursor: pointer;
      transition: all 0.1s;
    }

    .btn-sm:hover {
      border-color: var(--fg);
      color: var(--fg);
    }

    #clock {
      color: var(--fg-dim);
      font-size: 12px;
    }

    #main {
      display: grid;
      grid-template-columns: 200px 1fr 180px;
      overflow: hidden;
      height: 100%;
    }

    #sidebar-left,
    #sidebar-right {
      border-right: 1px solid var(--border);
      overflow-y: auto;
      padding: 8px;
      scrollbar-width: thin;
      scrollbar-color: var(--fg-dim) var(--bg);
    }

    #sidebar-right {
      border-right: none;
      border-left: 1px solid var(--border);
    }

    #content {
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: var(--fg-dim) var(--bg);
    }

    .panel-title {
      font-family: var(--font-display);
      font-size: 18px;
      color: var(--fg-bright);
      border-bottom: 1px solid var(--border);
      padding-bottom: 4px;
      margin-bottom: 8px;
      letter-spacing: 1px;
    }

    #statusbar {
      border-top: 1px solid var(--border-bright);
      padding: 2px 12px;
      display: flex;
      gap: 16px;
      font-size: 11px;
      color: var(--fg-dim);
      flex-shrink: 0;
      background: var(--input-bg);
    }

    #statusbar .status-item {
      display: flex;
      gap: 4px;
      align-items: center;
    }

    #statusbar .status-item .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--fg-dim);
      display: inline-block;
    }

    #statusbar .status-item .dot.online {
      background: var(--fg-bright);
      box-shadow: 0 0 4px var(--fg-bright);
    }

    #statusbar kbd {
      border: 1px solid var(--border);
      padding: 0 4px;
      font-family: var(--font-main);
      font-size: 10px;
      color: var(--fg-dim);
    }

    /* AUTH */
    #auth-screen {
      position: fixed;
      inset: 0;
      background: var(--bg);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      flex-direction: column;
      gap: 24px;
    }

    .auth-box {
      border: 1px solid var(--border-bright);
      padding: 32px 40px;
      width: 420px;
      box-shadow: var(--glow-strong);
      animation: scanIn 0.4s ease-out;
    }

    .auth-logo {
      font-family: var(--font-display);
      font-size: 52px;
      text-align: center;
      color: var(--fg-bright);
      text-shadow: var(--glow-strong);
      animation: pulse 3s ease-in-out infinite;
      margin-bottom: 4px;
    }

    .auth-sub {
      text-align: center;
      color: var(--fg-dim);
      font-size: 12px;
      margin-bottom: 24px;
      letter-spacing: 2px;
    }

    .auth-tabs {
      display: flex;
      margin-bottom: 20px;
      border-bottom: 1px solid var(--border);
    }

    .auth-tab {
      flex: 1;
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      color: var(--fg-dim);
      font-family: var(--font-main);
      font-size: 13px;
      padding: 6px;
      cursor: pointer;
      transition: all 0.1s;
    }

    .auth-tab.active {
      color: var(--fg-bright);
      border-bottom-color: var(--fg-bright);
    }

    .form-group {
      margin-bottom: 14px;
    }

    .form-group label {
      display: block;
      color: var(--fg-dim);
      font-size: 12px;
      margin-bottom: 4px;
    }

    .form-group input {
      width: 100%;
      background: var(--input-bg);
      border: 1px solid var(--border);
      border-radius: 0;
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 14px;
      padding: 6px 10px;
      outline: none;
      transition: border-color 0.1s;
    }

    .form-group input:focus {
      border-color: var(--fg-bright);
      box-shadow: var(--glow);
    }

    .btn-primary {
      width: 100%;
      background: var(--fg-dim);
      border: 1px solid var(--fg-bright);
      color: var(--bg);
      font-family: var(--font-main);
      font-size: 15px;
      padding: 8px;
      cursor: pointer;
      transition: all 0.1s;
      letter-spacing: 1px;
    }

    .btn-primary:hover {
      background: var(--fg-bright);
      box-shadow: var(--glow-strong);
    }

    .auth-error {
      color: var(--accent);
      font-size: 12px;
      margin-top: 8px;
      min-height: 16px;
      text-align: center;
    }

    /* FEED */
    .feed-controls {
      display: flex;
      gap: 0;
      border-bottom: 1px solid var(--border);
      padding: 0 12px;
      background: var(--input-bg);
      position: sticky;
      top: 0;
      z-index: 10;
    }

    .feed-tab {
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      color: var(--fg-dim);
      font-family: var(--font-main);
      font-size: 13px;
      padding: 8px 14px;
      cursor: pointer;
      transition: all 0.1s;
    }

    .feed-tab.active {
      color: var(--fg-bright);
      border-bottom-color: var(--fg-bright);
    }

    .feed-tab:hover {
      color: var(--fg);
    }

    .compose-area {
      border-bottom: 1px solid var(--border);
      padding: 12px;
      background: var(--input-bg);
    }

    .compose-area textarea {
      width: 100%;
      background: var(--bg);
      border: 1px solid var(--border);
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 14px;
      padding: 8px;
      resize: none;
      outline: none;
      height: 70px;
      transition: border-color 0.1s;
    }

    .compose-area textarea:focus {
      border-color: var(--fg-bright);
      box-shadow: var(--glow);
    }

    .compose-bottom {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 6px;
    }

    .compose-bottom .char-count {
      font-size: 11px;
      color: var(--fg-dim);
    }

    .compose-bottom .char-count.warn {
      color: var(--accent);
    }

    .topics-input {
      background: var(--bg);
      border: 1px solid var(--border);
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 12px;
      padding: 4px 8px;
      outline: none;
      width: 180px;
    }

    .topics-input:focus {
      border-color: var(--fg-bright);
    }

    .btn-post {
      background: none;
      border: 1px solid var(--fg-bright);
      color: var(--fg-bright);
      font-family: var(--font-main);
      font-size: 13px;
      padding: 4px 16px;
      cursor: pointer;
      transition: all 0.1s;
      text-shadow: var(--glow);
    }

    .btn-post:hover {
      background: var(--fg-bright);
      color: var(--bg);
    }

    .post {
      border-bottom: 1px solid var(--border);
      padding: 10px 14px;
      animation: scanIn 0.2s ease-out;
      cursor: pointer;
      transition: background 0.1s;
      position: relative;
    }

    .post:hover,
    .post.selected {
      background: var(--input-bg);
    }

    .post.selected::before {
      content: '▶';
      position: absolute;
      left: 2px;
      top: 12px;
      color: var(--fg-bright);
      font-size: 10px;
    }

    .post-header {
      display: flex;
      gap: 8px;
      align-items: baseline;
      margin-bottom: 4px;
    }

    .post-author {
      color: var(--accent2);
      font-size: 13px;
      cursor: pointer;
      font-weight: bold;
    }

    .post-author:hover {
      text-shadow: var(--glow-strong);
      text-decoration: underline;
    }

    .post-time {
      color: var(--fg-dim);
      font-size: 11px;
    }

    .post-body {
      color: var(--fg);
      line-height: 1.5;
      word-break: break-word;
    }

    .post-body .mention {
      color: var(--accent2);
      cursor: pointer;
    }

    .post-body .mention:hover {
      text-decoration: underline;
    }

    .post-body .hashtag {
      color: var(--fg-bright);
      cursor: pointer;
    }

    .post-body .hashtag:hover {
      text-decoration: underline;
    }

    .post-body a {
      color: var(--fg-dim);
      font-size: 12px;
    }

    .post-topics {
      margin-top: 6px;
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .topic-tag {
      font-size: 11px;
      color: var(--fg-dim);
      border: 1px solid var(--border);
      padding: 1px 6px;
      cursor: pointer;
      transition: all 0.1s;
    }

    .topic-tag:hover {
      color: var(--fg-bright);
      border-color: var(--fg-bright);
    }

    .post-actions {
      display: flex;
      gap: 14px;
      margin-top: 6px;
      opacity: 0;
      transition: opacity 0.1s;
    }

    .post:hover .post-actions {
      opacity: 1;
    }

    .post-action {
      background: none;
      border: none;
      color: var(--fg-dim);
      font-family: var(--font-main);
      font-size: 11px;
      cursor: pointer;
      padding: 0;
      transition: color 0.1s;
    }

    .post-action:hover {
      color: var(--fg-bright);
    }

    .post-action.bookmarked {
      color: var(--accent2);
    }

    /* MUSIC FEED — grid cards + bottom player */
    @keyframes eqBar {

      0%,
      100% {
        height: 4px
      }

      50% {
        height: 20px
      }
    }

    .eq-bar {
      width: 3px;
      background: var(--fg-bright);
      border-radius: 1px;
      animation: eqBar 0.7s ease-in-out infinite;
      opacity: 0.8;
    }

    .eq-bar:nth-child(2) {
      animation-delay: 0.12s;
    }

    .eq-bar:nth-child(3) {
      animation-delay: 0.24s;
    }

    .eq-bar:nth-child(4) {
      animation-delay: 0.08s;
    }

    .eq-bar:nth-child(5) {
      animation-delay: 0.18s;
    }

    .eq-bar.paused {
      animation-play-state: paused;
    }

    .music-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
      gap: 10px;
      padding: 14px;
    }

    .music-card {
      border: 1px solid var(--border);
      cursor: pointer;
      transition: border-color 0.15s, box-shadow 0.15s;
      position: relative;
      animation: scanIn 0.2s ease-out;
      background: var(--input-bg);
    }

    .music-card:hover {
      border-color: var(--fg-bright);
      box-shadow: var(--glow);
    }

    .music-card.playing {
      border-color: var(--accent2);
      box-shadow: 0 0 14px rgba(255, 204, 0, 0.35);
    }

    .music-card-thumb {
      position: relative;
      width: 100%;
      aspect-ratio: 16/9;
      overflow: hidden;
      background: #000;
    }

    .music-card-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transition: opacity 0.2s;
    }

    .music-card:hover .music-card-thumb img,
    .music-card.playing .music-card-thumb img {
      opacity: 0.7;
    }

    .music-card-overlay {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.2s;
      background: rgba(0, 0, 0, 0.25);
    }

    .music-card:hover .music-card-overlay,
    .music-card.playing .music-card-overlay {
      opacity: 1;
    }

    .play-btn {
      width: 42px;
      height: 42px;
      border: 2px solid var(--fg-bright);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--fg-bright);
      font-size: 17px;
      background: rgba(0, 0, 0, 0.65);
      transition: all 0.12s;
    }

    .music-card.playing .play-btn {
      background: var(--accent2);
      border-color: var(--accent2);
      color: var(--bg);
    }

    .now-playing-badge {
      position: absolute;
      top: 5px;
      right: 5px;
      background: var(--accent2);
      color: var(--bg);
      font-size: 9px;
      padding: 2px 5px;
      letter-spacing: 1px;
      display: none;
    }

    .music-card.playing .now-playing-badge {
      display: block;
    }

    .music-card-eq {
      position: absolute;
      bottom: 6px;
      left: 6px;
      display: none;
      align-items: flex-end;
      gap: 2px;
      height: 14px;
    }

    .music-card.playing .music-card-eq {
      display: flex;
    }

    .music-card-info {
      padding: 7px 9px 9px;
    }

    .music-card-caption {
      color: var(--fg);
      font-size: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 3px;
      line-height: 1.3;
    }

    .music-card-author {
      color: var(--accent2);
      font-size: 11px;
      cursor: pointer;
    }

    .music-card-author:hover {
      text-decoration: underline;
    }

    /* BOTTOM PLAYER BAR */
    #bottom-player {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      height: 58px;
      background: var(--input-bg);
      border-top: 2px solid var(--border-bright);
      display: none;
      align-items: center;
      gap: 14px;
      padding: 0 16px;
      z-index: 5000;
      box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.6);
    }

    #bottom-player.visible {
      display: flex;
    }

    .player-thumb {
      width: 40px;
      height: 40px;
      object-fit: cover;
      border: 1px solid var(--border);
      flex-shrink: 0;
    }

    .player-info {
      flex: 1;
      min-width: 0;
    }

    .player-caption {
      color: var(--fg-bright);
      font-size: 13px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.2;
    }

    .player-author {
      color: var(--fg-dim);
      font-size: 11px;
    }

    .player-controls {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .player-btn {
      background: none;
      border: 1px solid var(--border);
      color: var(--fg-dim);
      font-family: var(--font-main);
      font-size: 15px;
      width: 30px;
      height: 30px;
      cursor: pointer;
      transition: all 0.1s;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .player-btn:hover {
      border-color: var(--fg-bright);
      color: var(--fg-bright);
    }

    .player-btn.main-play {
      width: 36px;
      height: 36px;
      border-color: var(--fg-bright);
      color: var(--fg-bright);
    }

    .player-btn.main-play:hover {
      background: var(--fg-bright);
      color: var(--bg);
    }

    .player-eq {
      display: flex;
      align-items: flex-end;
      gap: 2px;
      height: 16px;
      margin: 0 4px;
    }

    .player-close {
      margin-left: auto;
      color: var(--fg-dim);
      font-size: 14px;
    }

    #yt-hidden {
      position: fixed;
      top: -9999px;
      left: -9999px;
      width: 1px;
      height: 1px;
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
    }

    #app.has-player #content {
      padding-bottom: 60px;
    }

    /* CHAT */
    #chat-view {
      display: grid;
      grid-template-columns: 160px 1fr;
      height: 100%;
      overflow: hidden;
    }

    .room-list {
      border-right: 1px solid var(--border);
      overflow-y: auto;
      padding: 8px 0;
    }

    .room-item {
      padding: 6px 12px;
      cursor: pointer;
      color: var(--fg-dim);
      font-size: 13px;
      transition: all 0.1s;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .room-item:hover,
    .room-item.active {
      background: var(--input-bg);
      color: var(--fg-bright);
    }

    .room-content {
      display: flex;
      flex-direction: column;
      height: 100%;
      overflow: hidden;
    }

    .room-header {
      padding: 8px 14px;
      border-bottom: 1px solid var(--border);
      background: var(--input-bg);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-shrink: 0;
    }

    .room-header .room-name {
      font-family: var(--font-display);
      font-size: 20px;
      color: var(--fg-bright);
      text-shadow: var(--glow);
    }

    .room-header .online-count {
      font-size: 11px;
      color: var(--fg-dim);
    }

    .messages {
      flex: 1;
      overflow-y: auto;
      padding: 8px 14px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      scrollbar-width: thin;
      scrollbar-color: var(--fg-dim) var(--bg);
    }

    .message {
      font-size: 13px;
      line-height: 1.5;
      animation: scanIn 0.15s ease-out;
      word-break: break-word;
    }

    .message .msg-time {
      color: var(--fg-dim);
      font-size: 11px;
    }

    .message .msg-author {
      color: var(--accent2);
      cursor: pointer;
    }

    .message .msg-author:hover {
      text-decoration: underline;
    }

    .message .msg-body {
      color: var(--fg);
    }

    .message.system {
      color: var(--fg-dim);
      font-style: italic;
    }

    .chat-input-area {
      border-top: 1px solid var(--border);
      padding: 8px 14px;
      display: flex;
      gap: 8px;
      flex-shrink: 0;
      background: var(--input-bg);
    }

    .chat-prompt {
      color: var(--fg-bright);
      font-size: 14px;
      padding-top: 1px;
    }

    .chat-input {
      flex: 1;
      background: none;
      border: none;
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 14px;
      outline: none;
      caret-color: var(--fg-bright);
    }

    /* MAIL - completely rewritten */
    #mail-view {
      display: grid;
      grid-template-columns: 200px 1fr;
      height: 100%;
      overflow: hidden;
    }

    .mail-sidebar {
      border-right: 1px solid var(--border);
      overflow-y: auto;
      padding: 8px 0;
    }

    .mail-folder {
      padding: 6px 12px;
      cursor: pointer;
      color: var(--fg-dim);
      font-size: 13px;
      transition: all 0.1s;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .mail-folder:hover,
    .mail-folder.active {
      background: var(--input-bg);
      color: var(--fg-bright);
    }

    .mail-folder .unread-count {
      margin-left: auto;
      color: var(--accent);
      font-size: 11px;
    }

    .mail-compose-btn {
      width: 100%;
      background: none;
      border: 1px solid var(--border-bright);
      color: var(--fg-bright);
      font-family: var(--font-main);
      font-size: 13px;
      padding: 6px;
      cursor: pointer;
      margin-bottom: 8px;
      transition: all 0.1s;
    }

    .mail-compose-btn:hover {
      background: var(--fg-dim);
      color: var(--bg);
    }

    .mail-content {
      display: flex;
      flex-direction: column;
      height: 100%;
      overflow: hidden;
    }

    .mail-list {
      flex: 1;
      overflow-y: auto;
    }

    .mail-item {
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background 0.1s;
    }

    .mail-item:hover {
      background: var(--input-bg);
    }

    .mail-item.unread .mail-item-subject {
      color: var(--fg-bright);
      font-weight: bold;
    }

    .mail-item-subject {
      color: var(--fg);
      font-size: 13px;
    }

    .mail-item-meta {
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      color: var(--fg-dim);
      margin-top: 2px;
    }

    .mail-item-preview {
      font-size: 12px;
      color: var(--fg-dim);
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .mail-read-view {
      height: 100%;
      overflow-y: auto;
      padding: 20px;
    }

    .mail-read-header {
      border-bottom: 1px solid var(--border);
      margin-bottom: 16px;
      padding-bottom: 12px;
    }

    .mail-read-header h2 {
      font-family: var(--font-display);
      font-size: 22px;
      color: var(--fg-bright);
      margin-bottom: 8px;
    }

    .mail-read-meta {
      color: var(--fg-dim);
      font-size: 12px;
    }

    .mail-read-body {
      color: var(--fg);
      line-height: 1.7;
      white-space: pre-wrap;
    }

    .mail-compose-form {
      padding: 20px;
      overflow-y: auto;
      height: 100%;
    }

    .mail-compose-form .form-group {
      margin-bottom: 12px;
    }

    .mail-compose-form textarea {
      width: 100%;
      background: var(--input-bg);
      border: 1px solid var(--border);
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 14px;
      padding: 8px;
      resize: vertical;
      outline: none;
      min-height: 200px;
    }

    .mail-compose-form textarea:focus {
      border-color: var(--fg-bright);
    }

    .mail-compose-form input {
      width: 100%;
      background: var(--input-bg);
      border: 1px solid var(--border);
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 14px;
      padding: 6px 8px;
      outline: none;
    }

    .mail-compose-form input:focus {
      border-color: var(--fg-bright);
    }

    .mail-compose-form label {
      display: block;
      color: var(--fg-dim);
      font-size: 12px;
      margin-bottom: 4px;
    }

    .mail-status {
      font-size: 11px;
      padding: 4px 14px;
      color: var(--fg-dim);
      border-bottom: 1px solid var(--border);
      background: var(--input-bg);
    }

    .mail-status.ok {
      color: var(--fg-bright);
    }

    .mail-status.err {
      color: var(--accent);
    }

    /* NOTES */
    #notes-view {
      display: grid;
      grid-template-columns: 220px 1fr;
      height: 100%;
      overflow: hidden;
    }

    .notes-list {
      border-right: 1px solid var(--border);
      overflow-y: auto;
    }

    .note-item {
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background 0.1s;
    }

    .note-item:hover,
    .note-item.active {
      background: var(--input-bg);
    }

    .note-item-title {
      color: var(--fg);
      font-size: 13px;
    }

    .note-item-preview {
      color: var(--fg-dim);
      font-size: 11px;
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .note-item-date {
      color: var(--fg-dim);
      font-size: 10px;
      margin-top: 2px;
    }

    .notes-editor {
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .notes-toolbar {
      padding: 8px 14px;
      border-bottom: 1px solid var(--border);
      display: flex;
      gap: 8px;
      align-items: center;
      background: var(--input-bg);
      flex-shrink: 0;
    }

    .notes-title-input {
      flex: 1;
      background: none;
      border: none;
      border-bottom: 1px solid var(--border);
      color: var(--fg-bright);
      font-family: var(--font-display);
      font-size: 22px;
      outline: none;
      padding: 2px 4px;
    }

    .notes-title-input:focus {
      border-bottom-color: var(--fg-bright);
    }

    .notes-textarea {
      flex: 1;
      background: var(--bg);
      border: none;
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 14px;
      padding: 16px;
      resize: none;
      outline: none;
      line-height: 1.7;
    }

    /* PROFILE */
    .profile-view {
      padding: 20px;
      max-width: 600px;
      margin: 0 auto;
    }

    .profile-header {
      border: 1px solid var(--border);
      padding: 20px;
      margin-bottom: 16px;
      background: var(--input-bg);
      position: relative;
    }

    .profile-avatar {
      font-family: var(--font-display);
      font-size: 60px;
      color: var(--fg-bright);
      text-shadow: var(--glow-strong);
      line-height: 1;
      margin-bottom: 8px;
    }

    .profile-username {
      font-family: var(--font-display);
      font-size: 28px;
      color: var(--accent2);
      text-shadow: var(--glow);
    }

    .profile-bio {
      color: var(--fg);
      margin: 8px 0;
      line-height: 1.5;
    }

    .profile-stats {
      display: flex;
      gap: 20px;
      margin-top: 12px;
      font-size: 12px;
      color: var(--fg-dim);
    }

    .profile-actions {
      margin-top: 12px;
      display: flex;
      gap: 8px;
    }

    .profile-joined {
      position: absolute;
      top: 12px;
      right: 16px;
      font-size: 11px;
      color: var(--fg-dim);
    }

    .btn-follow {
      background: none;
      border: 1px solid var(--fg-bright);
      color: var(--fg-bright);
      font-family: var(--font-main);
      font-size: 12px;
      padding: 4px 14px;
      cursor: pointer;
      transition: all 0.1s;
    }

    .btn-follow:hover {
      background: var(--fg-bright);
      color: var(--bg);
    }

    .btn-follow.following {
      border-color: var(--fg-dim);
      color: var(--fg-dim);
    }

    .btn-poke {
      background: none;
      border: 1px solid var(--accent);
      color: var(--accent);
      font-family: var(--font-main);
      font-size: 12px;
      padding: 4px 14px;
      cursor: pointer;
      transition: all 0.1s;
    }

    .btn-poke:hover {
      background: var(--accent);
      color: var(--bg);
    }

    /* TOPICS */
    .topics-grid {
      padding: 16px;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .topic-card {
      border: 1px solid var(--border);
      padding: 10px 14px;
      cursor: pointer;
      transition: all 0.1s;
      min-width: 140px;
      animation: scanIn 0.2s ease-out;
    }

    .topic-card:hover {
      border-color: var(--fg-bright);
      box-shadow: var(--glow);
    }

    .topic-card-name {
      color: var(--fg-bright);
      font-size: 15px;
    }

    .topic-card-count {
      color: var(--fg-dim);
      font-size: 11px;
      margin-top: 2px;
    }

    /* SETTINGS */
    .settings-view {
      padding: 20px;
      max-width: 500px;
    }

    .settings-section {
      margin-bottom: 24px;
    }

    .settings-section h3 {
      font-family: var(--font-display);
      font-size: 20px;
      color: var(--fg-bright);
      margin-bottom: 12px;
      border-bottom: 1px solid var(--border);
      padding-bottom: 4px;
    }

    .theme-grid {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .theme-card {
      border: 2px solid transparent;
      padding: 8px 12px;
      cursor: pointer;
      font-size: 12px;
      transition: all 0.1s;
      font-family: var(--font-main);
    }

    .theme-card.active {
      border-color: var(--fg-bright);
    }

    .theme-card:hover {
      border-color: var(--fg-dim);
    }

    .settings-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      font-size: 13px;
    }

    .settings-row label {
      color: var(--fg);
    }

    .toggle {
      appearance: none;
      width: 40px;
      height: 18px;
      border: 1px solid var(--border-bright);
      background: var(--bg);
      cursor: pointer;
      position: relative;
      transition: background 0.2s;
    }

    .toggle:checked {
      background: var(--fg-dim);
    }

    .toggle::after {
      content: '';
      position: absolute;
      left: 2px;
      top: 2px;
      width: 12px;
      height: 12px;
      background: var(--fg-bright);
      transition: transform 0.2s;
    }

    .toggle:checked::after {
      transform: translateX(22px);
    }

    .settings-input {
      background: var(--input-bg);
      border: 1px solid var(--border);
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 13px;
      padding: 4px 8px;
      outline: none;
      width: 200px;
    }

    .settings-input:focus {
      border-color: var(--fg-bright);
    }

    /* SIDEBAR */
    .sidebar-section {
      margin-bottom: 16px;
    }

    .online-user {
      font-size: 12px;
      color: var(--fg-dim);
      padding: 2px 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .online-user:hover {
      color: var(--fg-bright);
    }

    .online-user .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--fg-bright);
      display: inline-block;
    }

    .trending-topic {
      font-size: 12px;
      color: var(--fg-dim);
      padding: 3px 4px;
      cursor: pointer;
      transition: color 0.1s;
    }

    .trending-topic:hover {
      color: var(--fg-bright);
    }

    .trending-topic .count {
      float: right;
      color: var(--fg-dim);
      font-size: 10px;
    }

    .notification-item {
      font-size: 12px;
      color: var(--fg-dim);
      padding: 4px 4px;
      border-bottom: 1px solid var(--border);
      animation: slideRight 0.2s ease-out;
    }

    .notification-item .notif-type {
      color: var(--accent);
    }

    .notification-item .notif-from {
      color: var(--accent2);
      cursor: pointer;
    }

    /* OVERLAYS */
    #help-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: var(--overlay);
      z-index: 500;
      align-items: center;
      justify-content: center;
    }

    #help-overlay.show {
      display: flex;
    }

    .help-box {
      border: 1px solid var(--border-bright);
      padding: 24px 32px;
      width: 500px;
      background: var(--bg);
      box-shadow: var(--glow-strong);
      animation: fadeIn 0.2s;
    }

    .help-box h2 {
      font-family: var(--font-display);
      font-size: 28px;
      color: var(--fg-bright);
      margin-bottom: 16px;
    }

    .help-shortcuts {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px 16px;
    }

    .shortcut-row {
      display: flex;
      gap: 8px;
      font-size: 13px;
      align-items: center;
    }

    .shortcut-row kbd {
      border: 1px solid var(--border-bright);
      padding: 1px 6px;
      font-family: var(--font-main);
      font-size: 11px;
      color: var(--fg-bright);
      min-width: 28px;
      text-align: center;
    }

    .shortcut-row span {
      color: var(--fg-dim);
    }

    .help-close {
      margin-top: 20px;
      text-align: right;
    }

    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: var(--overlay);
      z-index: 400;
      align-items: center;
      justify-content: center;
    }

    .modal-overlay.show {
      display: flex;
    }

    .modal-box {
      border: 1px solid var(--border-bright);
      padding: 24px;
      min-width: 340px;
      background: var(--bg);
      box-shadow: var(--glow-strong);
      animation: fadeIn 0.2s;
    }

    .modal-box h3 {
      font-family: var(--font-display);
      font-size: 24px;
      color: var(--fg-bright);
      margin-bottom: 16px;
    }

    #search-overlay {
      display: none;
      position: fixed;
      top: 50px;
      left: 50%;
      transform: translateX(-50%);
      width: 500px;
      z-index: 300;
      background: var(--bg);
      border: 1px solid var(--border-bright);
      box-shadow: var(--glow-strong);
    }

    #search-overlay.show {
      display: block;
    }

    #search-input-main {
      width: 100%;
      background: var(--input-bg);
      border: none;
      border-bottom: 1px solid var(--border);
      color: var(--fg);
      font-family: var(--font-main);
      font-size: 16px;
      padding: 10px 14px;
      outline: none;
    }

    .search-results {
      max-height: 400px;
      overflow-y: auto;
    }

    .search-result {
      padding: 8px 14px;
      cursor: pointer;
      border-bottom: 1px solid var(--border);
      transition: background 0.1s;
    }

    .search-result:hover {
      background: var(--input-bg);
    }

    .search-result .result-type {
      font-size: 10px;
      color: var(--fg-dim);
      letter-spacing: 1px;
    }

    .search-result .result-main {
      font-size: 13px;
      color: var(--fg);
      margin-top: 2px;
    }

    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: var(--fg-dim);
    }

    .empty-state .empty-icon {
      font-size: 48px;
      margin-bottom: 12px;
    }

    .empty-state h3 {
      font-family: var(--font-display);
      font-size: 24px;
      color: var(--fg-dim);
      margin-bottom: 8px;
    }

    .loading {
      text-align: center;
      padding: 30px;
      color: var(--fg-dim);
      font-size: 13px;
    }

    .loading::after {
      content: '...';
      animation: blink 1.5s step-end infinite;
    }

    .text-accent {
      color: var(--accent);
    }

    .text-accent2 {
      color: var(--accent2);
    }

    .text-dim {
      color: var(--fg-dim);
    }

    .text-bright {
      color: var(--fg-bright);
    }

    .glow {
      text-shadow: var(--glow);
    }

    .hidden {
      display: none !important;
    }

    ::-webkit-scrollbar {
      width: 6px;
    }

    ::-webkit-scrollbar-track {
      background: var(--bg);
    }

    ::-webkit-scrollbar-thumb {
      background: var(--border);
    }

    ::-webkit-scrollbar-thumb:hover {
      background: var(--fg-dim);
    }

    ::selection {
      background: var(--fg-dim);
      color: var(--bg);
    }

    @media(max-width:768px) {
      #main {
        grid-template-columns: 1fr;
      }

      #sidebar-left,
      #sidebar-right {
        display: none;
      }

      .auth-box {
        width: 95vw;
        padding: 20px;
      }

      #search-overlay {
        width: 95vw;
      }
    }
