:root {
    --panel: #ffffff;
    --sidebar: #fbfbfd;
    --border: #e5e5ea;
    --text: #111111;
    --muted: #6e6e73;
    --blue: #0a84ff;
    --blue-dark: #0070e8;
    --gray-bubble: #e9e9eb;
    --nudge-bg: #fff7db;
    --nudge-border: #f0d677;
    --nudge-resolved-bg: #e8eaee;
    --nudge-resolved-border: #c5cad4;
    --nudge-resolved-text: #5c616a;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(to bottom, #ececf1, #f7f7fa);
    color: var(--text);
}

#app {
    min-height: 100%;
    height: 100%;
}

button,
input {
    font: inherit;
}

.app-shell {
    box-sizing: border-box;
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-shell .app-frame {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    width: min(1200px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.login-screen {
    flex: 1 1 0%;
    min-height: 0;
    display: grid;
    place-items: center;
}

.login-card,
.empty-card {
    width: min(460px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.app-frame {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 340px 1fr;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    align-self: stretch;
    box-shadow: var(--shadow);
}

.app-frame > .sidebar,
.app-frame > .chat-panel {
    min-height: 0;
}

.sidebar {
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    align-self: stretch;
}

.sidebar-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px 12px;
}

.sidebar-title-row h1 {
    flex: 1;
    min-width: 0;
    margin: 0;
    line-height: 1.15;
}

.sidebar-title-row .ghost-button {
    flex-shrink: 0;
}

.sidebar-chats-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    flex: 1 1 0%;
    align-self: stretch;
    overflow: hidden;
    background: #ffffff;
}

.chat-panel > .settings-page {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
}

.chat-panel > .no-chat-selected {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
}

.sidebar-brand h1,
.chat-header h2,
.login-card h1,
.empty-card h2 {
    margin: 0;
    line-height: 1.15;
}

.mini-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.subtle {
    color: var(--muted);
    line-height: 1.5;
}

.new-chat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 14px;
}

.section-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--muted);
}

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

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.list-header--chats {
    flex-wrap: wrap;
    align-items: center;
}

.list-header h2 {
    margin: 0;
    font-size: 1rem;
}

.chat-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    background: #f0f0f5;
    border-radius: 999px;
}

.chat-filter button {
    border: none;
    border-radius: 999px;
    padding: 6px 7px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.62rem;
    cursor: pointer;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    max-width: 104px;
    hyphens: auto;
}

.chat-filter button:hover {
    color: var(--text);
}

.chat-filter button.active {
    background: #ffffff;
    color: var(--blue);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-list li + li {
    margin-top: 8px;
}

.chat-list-row-wrap {
    display: flex;
    align-items: stretch;
    gap: 6px;
    overflow: visible;
    padding: 2px 0;
}

.chat-list-row-wrap .chat-row {
    flex: 1;
    min-width: 0;
}

.chat-sidebar-nudge {
    flex-shrink: 0;
    width: 44px;
    border: 1px solid #d8d8e0;
    border-radius: 14px;
    background: #fafafa;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    color: inherit;
    transform-origin: center center;
    backface-visibility: hidden;
    position: relative;
    z-index: 1;
}

.chat-sidebar-nudge:hover:not(:disabled) {
    background: #f0f0f3;
    border-color: #c8c8d2;
    animation: nudge-hover-wiggle 1s ease-in-out 1;
    animation-delay: 1.5s;
    z-index: 2;
}

.chat-sidebar-nudge:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.chat-sidebar-nudge--undo {
    background: var(--nudge-bg);
    border: 1px solid var(--nudge-border);
}

.chat-sidebar-nudge--undo:hover:not(:disabled) {
    background: #fff3cf;
}

.chat-row {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    padding: 12px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

a.chat-row:not(.chat-row--active):hover {
    background: #f0f0f5;
}

a.chat-row.chat-row--active {
    border-color: #c2c2cc;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

a.chat-row.chat-row--active:hover {
    background: #f2f2f4;
    border-color: #b0b0bc;
}

.chat-title {
    font-weight: 600;
    color: var(--text);
}

a.chat-row.chat-row--active .chat-title {
    color: var(--blue);
}

.chat-preview {
    color: var(--muted);
    font-size: 0.92rem;
}

.chat-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 24px 24px;
    border-bottom: 1px solid var(--border);
    gap: 2px;
}

.chat-header-title-row {
    position: relative;
    width: 100%;
    min-width: 0;
}

.chat-header-title {
    margin: 0;
    width: 100%;
    min-width: 0;
    line-height: 1.2;
    font-size: 1.95rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.chat-header-title-row--has-nudge .chat-header-title {
    padding-right: min(236px, 50vw);
}

.chat-nudge-status {
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 0;
    z-index: 1;
    padding: 8px 12px;
    border-radius: 14px;
    background: var(--nudge-bg);
    border: 1px solid var(--nudge-border);
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.35;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: min(220px, 48vw);
    text-align: right;
    align-items: flex-end;
    box-sizing: border-box;
}

.chat-nudge-status--pop {
    animation: nudge-balloon-pop 420ms cubic-bezier(0.16, 0.85, 0.28, 1.3);
    transform-origin: right bottom;
}

.chat-nudge-status--pop-out {
    animation: nudge-balloon-pop-out 260ms ease-in forwards;
    transform-origin: right bottom;
}

.chat-nudge-status-head {
    display: block;
}

.chat-nudge-status-emoji {
    margin-right: 6px;
}

.chat-nudge-status-remaining {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
}

.chat-nudge-status-remaining--urgent {
    color: #c41e3a;
}

.messages-area {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 24px;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at top, rgba(10, 132, 255, 0.04), transparent 26%),
        #ffffff;
}

.message-row {
    display: flex;
    margin-bottom: 16px;
}

.message-row.own {
    justify-content: flex-end;
}

.message-row.other {
    justify-content: flex-start;
}

.message-row.nudge {
    justify-content: center;
}

.message-row.join {
    justify-content: center;
}

.chat-join-bubble {
    background: transparent;
    border: none;
    text-align: center;
}

.chat-join-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--muted);
    font-weight: 500;
}

.chat-join-meta {
    margin: 4px 0 0;
    font-size: 0.72rem;
    color: var(--muted);
    opacity: 0.85;
}

.message-bubble {
    max-width: min(70%, 480px);
    border-radius: 22px;
    padding: 8px 18px 7px;
}

.message-bubble.own-bubble:not(.typing-indicator-bubble),
.message-bubble.other-bubble:not(.typing-indicator-bubble) {
    padding: 10px 24px 9px;
}

.message-bubble.chat-join-bubble {
    max-width: min(90%, 520px);
    padding: 6px 16px 5px;
}

.message-bubble p {
    margin: 0;
    padding: 0;
}

.own-bubble {
    background: var(--blue);
    color: white;
    border-bottom-right-radius: 8px;
}

.other-bubble {
    background: var(--gray-bubble);
    color: var(--text);
    border-bottom-left-radius: 8px;
}

.nudge-bubble {
    background: var(--nudge-bg);
    border: 1px solid var(--nudge-border);
    color: #5c4b12;
    text-align: center;
    max-width: 320px;
    padding: 9px 20px 8px;
}

.nudge-bubble.nudge-bubble--resolved {
    background: var(--nudge-resolved-bg);
    border-color: var(--nudge-resolved-border);
    color: var(--nudge-resolved-text);
}

.nudge-bubble.nudge-bubble--tap-to-read {
    cursor: pointer;
}

.nudge-bubble.nudge-bubble--tap-to-read:hover {
    filter: brightness(0.97);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.22);
}

.nudge-bubble--pop {
    animation: nudge-balloon-pop 420ms cubic-bezier(0.16, 0.85, 0.28, 1.3);
    transform-origin: center bottom;
}

.nudge-bubble--pop-out {
    animation: nudge-balloon-pop-out 260ms ease-in forwards;
    transform-origin: center bottom;
}

@keyframes nudge-balloon-pop {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.72);
    }
    58% {
        opacity: 1;
        transform: translateY(-6px) scale(1.08);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes nudge-balloon-pop-out {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-8px) scale(0.78);
    }
}

@keyframes nudge-hover-wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(-10deg);
    }
    20% {
        transform: rotate(10deg);
    }
    30% {
        transform: rotate(-8deg);
    }
    40% {
        transform: rotate(8deg);
    }
    50% {
        transform: rotate(-6deg);
    }
    60% {
        transform: rotate(6deg);
    }
    70% {
        transform: rotate(-3deg);
    }
    80% {
        transform: rotate(3deg);
    }
}

.message-text {
    margin: 0;
    line-height: 1.35;
    word-break: break-word;
}

.nudge-text {
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

.nudge-text--tap-to-read {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.message-meta {
    margin: 6px 0 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

.typing-indicator-bubble {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 58px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: typing-dot-pulse 1.1s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.18s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes typing-dot-pulse {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    50% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

.typing-indicator-bubble--other .typing-dot {
    background: #8e8e93;
}

.typing-indicator-bubble--other .typing-dot:nth-child(1) {
    animation-name: typing-dot-pulse-other-1;
}

.typing-indicator-bubble--other .typing-dot:nth-child(2) {
    animation-name: typing-dot-pulse-other-2;
}

.typing-indicator-bubble--other .typing-dot:nth-child(3) {
    animation-name: typing-dot-pulse-other-3;
}

.typing-indicator-bubble--own .typing-dot {
    background: rgba(255, 255, 255, 0.72);
}

.typing-indicator-bubble--own .typing-dot:nth-child(1) {
    animation-name: typing-dot-pulse-own-1;
}

.typing-indicator-bubble--own .typing-dot:nth-child(2) {
    animation-name: typing-dot-pulse-own-2;
}

.typing-indicator-bubble--own .typing-dot:nth-child(3) {
    animation-name: typing-dot-pulse-own-3;
}

@keyframes typing-dot-pulse-other-1 {
    0%, 100% { background: #8e8e93; opacity: 0.45; transform: translateY(0); }
    50% { background: #7fd1ff; opacity: 1; transform: translateY(-2px); }
}

@keyframes typing-dot-pulse-other-2 {
    0%, 100% { background: #8e8e93; opacity: 0.45; transform: translateY(0); }
    50% { background: #b3a6ff; opacity: 1; transform: translateY(-2px); }
}

@keyframes typing-dot-pulse-other-3 {
    0%, 100% { background: #8e8e93; opacity: 0.45; transform: translateY(0); }
    50% { background: #ffd085; opacity: 1; transform: translateY(-2px); }
}

@keyframes typing-dot-pulse-own-1 {
    0%, 100% { background: rgba(255, 255, 255, 0.72); opacity: 0.55; transform: translateY(0); }
    50% { background: #ffffff; opacity: 1; transform: translateY(-2px); }
}

@keyframes typing-dot-pulse-own-2 {
    0%, 100% { background: rgba(255, 255, 255, 0.72); opacity: 0.55; transform: translateY(0); }
    50% { background: #cfe7ff; opacity: 1; transform: translateY(-2px); }
}

@keyframes typing-dot-pulse-own-3 {
    0%, 100% { background: rgba(255, 255, 255, 0.72); opacity: 0.55; transform: translateY(0); }
    50% { background: #a8d3ff; opacity: 1; transform: translateY(-2px); }
}

.composer {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    background: #fafafc;
}

.composer-nudge-slot {
    position: relative;
    align-self: center;
}

.nudge-emoji-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.12);
}

.nudge-emoji-picker {
    position: fixed;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 45;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: min(280px, calc(100vw - 32px));
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.nudge-emoji-option {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #f2f2f7;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.nudge-emoji-option:hover {
    background: #e5e5ea;
}

.nudge-emoji-option.selected {
    outline: 2px solid var(--blue);
    outline-offset: 0;
}

.nudge-bell-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nudge-bell-row button {
    touch-action: manipulation;
    user-select: none;
}

.nudge-picker-chevron {
    width: 28px;
    height: 46px;
    border: none;
    border-radius: 12px;
    background: #e8ecf3;
    color: var(--blue);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.nudge-picker-chevron:hover {
    background: #dde4f0;
}

.nudge-picker-chevron:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.nudge-picker-chevron:disabled:hover {
    background: #e8ecf3;
}

input {
    width: 100%;
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 999px;
    padding: 12px 16px;
    outline: none;
}

input:focus {
    border-color: #b7d7ff;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.primary-button,
.ghost-button,
.ghost-icon-button {
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.primary-button:hover,
.ghost-button:hover,
.ghost-icon-button:hover {
    transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.ghost-icon-button:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.primary-button {
    background: var(--blue);
    color: white;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 600;
}

.primary-button:hover {
    background: var(--blue-dark);
}

.ghost-button {
    background: #eef5ff;
    color: var(--blue);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 600;
}

.ghost-icon-button {
    background: #eef5ff;
    color: var(--blue);
    border-radius: 999px;
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
}

.ghost-icon-button.chat-composer-nudge {
    width: 36px;
    border-radius: 14px;
    background: #fafafa;
    border: 1px solid #d8d8e0;
}

.ghost-icon-button.chat-composer-nudge:hover:not(:disabled) {
    background: #f0f0f3;
    border-color: #c8c8d2;
}

.ghost-icon-button.nudge-bell-button--undo {
    background: var(--nudge-bg);
    border: 1px solid var(--nudge-border);
}

.ghost-icon-button.nudge-bell-button--incoming {
    background: linear-gradient(145deg, #fff9e8 0%, #fff2cc 100%);
    border: 1px solid var(--nudge-border);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2);
    animation: nudge-incoming-pulse 2.2s ease-in-out infinite;
}

@keyframes nudge-incoming-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.18);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.32);
    }
}

.ghost-icon-button.nudge-bell-button--incoming:hover:not(:disabled) {
    filter: brightness(0.98);
    animation: none;
}

.chat-sidebar-nudge.nudge-sidebar-bell--incoming {
    background: linear-gradient(145deg, #fff9e8 0%, #fff2cc 100%);
    border-color: var(--nudge-border);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2);
    animation: nudge-incoming-pulse 2.2s ease-in-out infinite;
}

.chat-sidebar-nudge.nudge-sidebar-bell--incoming:hover:not(:disabled) {
    filter: brightness(0.98);
    animation: none;
}

.ghost-icon-button.nudge-bell-button--undo:hover {
    background: #fff3cf;
}

.ghost-icon-button:hover:not(:disabled) {
    animation: nudge-hover-wiggle 2s ease-in-out 1;
    animation-delay: 1.5s;
}

.empty-state,
.no-chat-selected {
    color: var(--muted);
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
}

.no-chat-selected {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.home-screen .empty-card h2 {
    color: var(--text);
    font-size: 1.45rem;
}

.home-screen .subtle strong {
    color: var(--text);
    font-weight: 600;
}

a.chat-row {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.sidebar-title-link {
    color: inherit;
    text-decoration: none;
}

.sidebar-title-link:hover {
    color: var(--blue);
}

a.sidebar-title-link.router-link-exact-active {
    color: var(--blue);
    font-weight: 600;
}

a.sidebar-link-button,
a.ghost-button.sidebar-link-button {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.chat-panel > .chat-route {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.chat-route--active {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
}

.chat-route:not(.chat-route--active) {
    display: flex;
    flex-direction: column;
}

.chat-header,
.composer {
    flex-shrink: 0;
}

.nudge-emoji-picker--inline {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    max-width: 100%;
    z-index: auto;
    box-shadow: none;
    margin-top: 8px;
    justify-content: flex-start;
}

.settings-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 22px 24px 32px;
    overflow: auto;
}

.settings-rhythm-spacer {
    visibility: hidden;
    user-select: none;
    pointer-events: none;
}

.settings-page h2 {
    margin: 4px 0 0;
    line-height: 1.15;
}

.settings-page > .settings-page-brand + .mini-label {
    margin-top: 16px;
}

.settings-lede {
    margin: 8px 0 0;
}

.settings-emoji-block {
    margin-top: 10px;
}

@media (max-width: 900px) {
    .app-frame {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: min(42vh, 360px);
        overflow-y: auto;
    }
}

@media (max-width: 640px) {
    .app-shell {
        padding: 12px;
    }

    .app-frame {
        border-radius: 22px;
    }

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

    .message-bubble {
        max-width: 85%;
    }

    .new-chat-row {
        grid-template-columns: 1fr;
    }
}