
      :root {
        --bg: #f6f1e8;
        --card: rgba(255, 255, 255, 0.82);
        --card-strong: rgba(255, 255, 255, 0.92);
        --line: rgba(34, 43, 51, 0.1);
        --text: #1f2933;
        --muted: #66737d;
        --accent: #0f766e;
        --accent-dark: #115e59;
        --self: #dff6f3;
        --system: #f4efe8;
        --shadow: 0 18px 50px rgba(60, 48, 35, 0.12);
      }

      * {
        box-sizing: border-box;
      }

      html,
      body {
        margin: 0;
        min-height: 100%;
      }

      body {
        min-height: 100dvh;
        font-family: "Avenir Next", "Segoe UI", sans-serif;
        color: var(--text);
        background:
          radial-gradient(circle at top left, rgba(15, 118, 110, 0.15), transparent 30%),
          radial-gradient(circle at top right, rgba(201, 138, 45, 0.12), transparent 28%),
          linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
      }

      a {
        color: var(--accent-dark);
      }

      button,
      input {
        font: inherit;
      }

      button {
        cursor: pointer;
      }

      .hidden {
        display: none !important;
      }

      .clipboard-fallback {
        position: fixed;
        opacity: 0;
        pointer-events: none;
      }

      .screen {
        min-height: 100dvh;
        padding: 20px;
      }

      .center {
        display: grid;
        place-items: center;
      }

      .card {
        width: min(100%, 480px);
        padding: 28px;
        border: 1px solid var(--line);
        border-radius: 24px;
        background: var(--card);
        backdrop-filter: blur(16px);
        box-shadow: var(--shadow);
      }

      .kicker {
        margin: 0 0 10px;
        color: var(--accent-dark);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
      }

      h1,
      h2,
      p {
        margin: 0;
      }

      .title {
        font-size: clamp(32px, 6vw, 48px);
        line-height: 0.95;
        letter-spacing: -0.04em;
      }

      .copy {
        margin-top: 14px;
        color: var(--muted);
        line-height: 1.6;
      }

      .stack {
        display: grid;
        gap: 12px;
        margin-top: 20px;
      }

      .row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 12px;
      }

      .input,
      .button {
        min-height: 52px;
        border-radius: 16px;
      }

      .input {
        width: 100%;
        padding: 0 16px;
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.9);
        color: var(--text);
      }

      textarea.input {
        min-height: 52px;
        max-height: 180px;
        padding: 14px 16px;
        resize: none;
        overflow-y: auto;
        line-height: 1.5;
      }

      .button {
        border: 0;
        padding: 0 18px;
        font-weight: 700;
      }

      .button-primary {
        color: white;
        background: linear-gradient(135deg, var(--accent), #2563eb);
      }

      .button-secondary {
        color: var(--text);
        background: rgba(255, 255, 255, 0.86);
        border: 1px solid var(--line);
      }

      .button:disabled,
      .input:disabled {
        opacity: 0.65;
        cursor: not-allowed;
      }

      .chat-app {
        min-height: 100dvh;
        padding: 16px;
      }

      .chat-shell {
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 16px;
        height: calc(100dvh - 32px);
        transition: grid-template-columns 160ms ease;
      }

      .chat-shell.sidebar-collapsed {
        grid-template-columns: 64px minmax(0, 1fr);
      }

      .sidebar,
      .main {
        min-height: 0;
        border: 1px solid var(--line);
        border-radius: 24px;
        background: var(--card);
        backdrop-filter: blur(16px);
        box-shadow: var(--shadow);
      }

      .sidebar {
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        overflow: hidden;
      }

      .sidebar-content {
        display: flex;
        flex: 1;
        min-height: 0;
        flex-direction: column;
        gap: 16px;
      }

      .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: flex-start;
        min-height: 34px;
        padding: 7px 12px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.8);
        color: var(--accent-dark);
        font: inherit;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
      }

      .chat-shell.sidebar-collapsed .sidebar {
        align-items: center;
        padding: 14px 10px;
      }

      .chat-shell.sidebar-collapsed .sidebar-content {
        display: none;
      }

      .chat-shell.sidebar-collapsed .sidebar-toggle {
        min-height: 104px;
        padding: 10px 6px;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
      }

      .room-pill {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 0 14px;
        border-radius: 999px;
        background: rgba(15, 118, 110, 0.1);
        color: var(--accent-dark);
        font-weight: 700;
      }

      .notification-toggle {
        display: inline-flex;
        margin-top: 10px;
        padding: 6px 10px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--muted);
        font: inherit;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
      }

      .notification-toggle.is-on {
        border-color: rgba(15, 118, 110, 0.36);
        background: rgba(15, 118, 110, 0.14);
        color: var(--accent-dark);
        box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
      }

      .roster {
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
        overflow: auto;
      }

      .roster p {
        margin: 0;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.8);
        color: var(--muted);
      }

      .main {
        display: flex;
        flex-direction: column;
        min-width: 0;
        overflow: hidden;
      }

      .main-header {
        padding: 22px 22px 14px;
        border-bottom: 1px solid rgba(34, 43, 51, 0.06);
      }

      .main-title {
        font-size: clamp(26px, 4vw, 40px);
        line-height: 1;
        letter-spacing: -0.04em;
      }

      .main-subtitle {
        margin-top: 8px;
        color: var(--muted);
        line-height: 1.5;
      }

      .chatlog {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 18px 22px;
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .spacer {
        flex: 1 0 40px;
      }

      .message {
        max-width: min(720px, 100%);
        padding: 12px 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--card-strong);
        line-height: 1.55;
        word-break: break-word;
      }

      .message-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 6px;
      }

      .message-meta,
      .message-actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
      }

      .message-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .message-time,
      .message-edited {
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
      }

      .message.deleted {
        opacity: 0.76;
      }

      .message-body > *:first-child {
        margin-top: 0;
      }

      .message-body > *:last-child {
        margin-bottom: 0;
      }

      .message-reply {
        display: grid;
        gap: 2px;
        margin-bottom: 8px;
        padding: 8px 10px;
        border-left: 3px solid var(--accent);
        border-radius: 8px;
        background: rgba(15, 118, 110, 0.08);
        text-align: left;
      }

      .message-reply-author {
        color: var(--accent-dark);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }

      .message-reply-text {
        color: var(--muted);
        font-size: 13px;
      }

      .message.self {
        align-self: flex-end;
        background: var(--self);
      }

      .message.system {
        align-self: center;
        background: var(--system);
        color: var(--muted);
        text-align: center;
      }

      .message-name {
        display: block;
        color: var(--accent-dark);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }

      .copy-button {
        flex: 0 0 auto;
        min-height: 28px;
        padding: 0 10px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.88);
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
      }

      .copy-button:hover {
        color: var(--accent-dark);
      }

      .message-body p,
      .message-body ul,
      .message-body ol,
      .message-body pre,
      .message-body blockquote {
        margin: 0 0 10px;
      }

      .message-body ul,
      .message-body ol {
        padding-left: 20px;
      }

      .message-body code {
        padding: 1px 6px;
        border-radius: 8px;
        background: rgba(15, 23, 42, 0.08);
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
        font-size: 0.92em;
      }

      .message-body pre {
        padding: 10px 12px;
        border-radius: 12px;
        overflow-x: auto;
        background: rgba(15, 23, 42, 0.07);
      }

      .message-body pre code {
        padding: 0;
        background: transparent;
      }

      .message-body blockquote {
        padding-left: 12px;
        border-left: 3px solid rgba(15, 118, 110, 0.35);
        color: var(--muted);
      }

      .message-body img.chat-image {
        display: block;
        width: min(100%, 460px);
        border-radius: 14px;
      }

      .composer {
        padding: 14px;
        border-top: 1px solid rgba(34, 43, 51, 0.06);
      }

      .reply-preview {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
        padding: 10px 12px;
        border-left: 3px solid var(--accent);
        border-radius: 14px;
        background: rgba(16, 185, 129, 0.1);
      }

      .reply-preview-content {
        min-width: 0;
      }

      .reply-preview-author {
        color: var(--ink);
        font-size: 13px;
        font-weight: 800;
      }

      .reply-preview-text {
        overflow: hidden;
        color: var(--muted);
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .reply-cancel {
        border: 0;
        background: transparent;
        color: var(--muted);
        cursor: pointer;
        font: inherit;
        font-weight: 800;
      }

      .composer-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 12px;
      }

      .status {
        min-height: 20px;
        margin-top: 10px;
        color: #b45309;
        font-size: 14px;
      }

      .composer-status {
        min-height: 20px;
        margin-top: 10px;
        color: var(--muted);
        font-size: 14px;
      }

      .modal {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: grid;
        place-items: center;
        padding: 20px;
        background: rgba(24, 33, 41, 0.38);
        backdrop-filter: blur(8px);
      }

      .modal-card {
        width: min(100%, 420px);
        padding: 22px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: var(--shadow);
      }

      .modal-title {
        font-size: 24px;
        line-height: 1.05;
        letter-spacing: -0.03em;
      }

      .modal-copy {
        margin-top: 12px;
        color: var(--muted);
        line-height: 1.6;
      }

      .modal-actions {
        display: grid;
        gap: 10px;
        margin-top: 18px;
      }

      @media (max-width: 820px) {
        .chat-shell {
          grid-template-columns: 1fr;
          height: auto;
          min-height: calc(100dvh - 32px);
        }

        .chat-shell.sidebar-collapsed {
          grid-template-columns: 1fr;
        }

        .sidebar {
          order: 2;
        }

        .chat-shell.sidebar-collapsed .sidebar {
          align-items: stretch;
          padding: 12px;
        }

        .chat-shell.sidebar-collapsed .sidebar-toggle {
          min-height: 38px;
          width: 100%;
          padding: 8px 12px;
          writing-mode: horizontal-tb;
          transform: none;
        }

        .main {
          order: 1;
          min-height: 65dvh;
        }

        .roster {
          flex-direction: row;
          flex-wrap: wrap;
        }
      }

      @media (max-width: 560px) {
        .screen,
        .chat-app {
          padding: 12px;
        }

        .card,
        .sidebar,
        .main {
          border-radius: 20px;
        }

        .card {
          padding: 22px;
        }

        .row,
        .composer-form {
          grid-template-columns: 1fr;
        }

        .button {
          width: 100%;
        }

        .chatlog {
          padding: 14px;
        }

        .main-header {
          padding: 18px 14px 12px;
        }
      }
