:root {
    --bg: #f2efe8;
    --panel: rgba(255, 250, 240, 0.92);
    --panel-strong: #fffdf8;
    --ink: #1f1a17;
    --muted: #706458;
    --line: rgba(60, 40, 20, 0.12);
    --accent: #ba4a00;
    --accent-deep: #7e2c00;
    --customer-bubble: linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(255, 236, 221, 0.96));
    --customer-border: rgba(186, 74, 0, 0.2);
    --admin-bubble: linear-gradient(155deg, rgba(235, 255, 249, 0.98), rgba(203, 241, 228, 0.95));
    --admin-border: rgba(31, 93, 79, 0.26);
    --shadow: 0 18px 60px rgba(75, 49, 19, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(245, 188, 122, 0.55), transparent 26%),
        radial-gradient(circle at bottom right, rgba(97, 156, 132, 0.28), transparent 30%),
        linear-gradient(145deg, #f8f4ed 0%, #efe7db 52%, #e5dccf 100%);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow: hidden;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.brand {
    padding: 24px;
    border-radius: 24px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.45)),
        linear-gradient(135deg, rgba(186, 74, 0, 0.12), rgba(31, 93, 79, 0.08));
}

.brand-mark,
.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-deep);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.brand h1,
.chat-header h1,
.sidebar-head h2 {
    margin: 0;
    font-size: 32px;
    line-height: 1.08;
}

.brand-note,
.subtle {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 16px;
    align-content: center;
}

.login-form label,
.composer-main {
    display: grid;
    gap: 8px;
}

.login-form span {
    font-size: 14px;
    color: var(--muted);
}

input,
textarea,
button {
    font: inherit;
}

.login-form input,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    outline: none;
}

.login-form input:focus,
textarea:focus {
    border-color: rgba(186, 74, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(186, 74, 0, 0.1);
}

button {
    border: none;
    border-radius: 16px;
    cursor: pointer;
}

.login-form button,
.primary-btn {
    padding: 14px 18px;
    color: #fffaf4;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.secondary-link {
    display: inline-flex;
    justify-content: center;
    color: var(--accent-deep);
    text-decoration: none;
    font-size: 14px;
}

.secondary-link:hover {
    text-decoration: underline;
}

.ghost-btn {
    padding: 10px 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
}

.ghost-btn.is-active {
    border-color: rgba(31, 93, 79, 0.34);
    background: rgba(203, 241, 228, 0.74);
    color: #1f5d4f;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    color: #8a2f00;
    background: rgba(186, 74, 0, 0.12);
}

.app-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    display: grid;
    grid-template-rows: auto auto 1fr;
    min-height: 0;
    border-right: 1px solid var(--line);
    background: rgba(255, 251, 245, 0.72);
    backdrop-filter: blur(8px);
    padding: 24px 18px;
    overflow: hidden;
}

.sidebar-hidden {
    display: none;
}

.sidebar-head,
.chat-header,
.composer-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.conversation-search-field {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.conversation-search-field span {
    font-size: 13px;
    color: var(--muted);
}

.conversation-search-field input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    outline: none;
}

.conversation-search-field input:focus {
    border-color: rgba(186, 74, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(186, 74, 0, 0.1);
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
}

.conversation-item {
    display: grid;
    grid-template-rows: auto auto;
    gap: 6px;
    flex: 0 0 auto;
    padding: 12px 13px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.66);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    text-align: left;
}

.conversation-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.conversation-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.conversation-tag {
    max-width: 100%;
    overflow: hidden;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(31, 93, 79, 0.1);
    color: #1f5d4f;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-badge {
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #d93025;
    font-size: 11px;
    font-weight: 700;
}

.conversation-item:hover,
.conversation-item.active {
    transform: translateY(-1px);
    border-color: rgba(186, 74, 0, 0.24);
    background: rgba(255, 255, 255, 0.96);
}

.conversation-item h3,
.conversation-item p {
    margin: 0;
}

.conversation-item p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.chat-panel {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 0;
    height: 100vh;
    padding: 24px;
    gap: 18px;
    overflow: hidden;
}

.app-shell.embedded-support .chat-panel {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100dvh;
    padding: 12px;
    gap: 12px;
    overflow: hidden;
}

.app-shell.embedded-support {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.app-shell.embedded-support .chat-header {
    display: none;
}

.app-shell.embedded-support .message-stage {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

.app-shell.embedded-support .message-list {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.app-shell.embedded-support .composer {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
    padding: 10px;
}

.app-shell.embedded-support .composer textarea {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    resize: none;
    overflow-y: auto;
}

.app-shell.embedded-support .composer-actions {
    gap: 0;
}

.app-shell.embedded-support .composer-actions .upload-field,
.app-shell.embedded-support #screenshot-button {
    display: none !important;
}

.chat-header {
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.auto-reply-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(430px, 100%);
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid rgba(31, 93, 79, 0.26);
    border-radius: 16px;
    background: rgba(235, 255, 249, 0.84);
}

.auto-reply-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.auto-reply-kicker {
    color: #1f5d4f;
    font-size: 11px;
    font-weight: 700;
}

.auto-reply-copy strong {
    font-size: 14px;
    line-height: 1.15;
}

.auto-reply-copy p {
    max-width: 240px;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auto-reply-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.auto-reply-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid rgba(60, 40, 20, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
}

.auto-reply-switch-track {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: rgba(112, 100, 88, 0.3);
    transition: background 0.16s ease;
}

.auto-reply-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 26, 23, 0.18);
    transition: transform 0.16s ease;
}

.auto-reply-switch.is-active {
    border-color: rgba(31, 93, 79, 0.34);
    color: #1f5d4f;
}

.auto-reply-switch.is-active .auto-reply-switch-track {
    background: #1f5d4f;
}

.auto-reply-switch.is-active .auto-reply-switch-thumb {
    transform: translateX(16px);
}

.auto-reply-edit {
    min-height: 38px;
    border-radius: 14px;
}

.header-menu {
    position: relative;
}

.app-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.header-menu-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
}

.header-menu-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--ink);
}

.header-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    width: min(320px, 82vw);
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 252, 247, 0.98);
    box-shadow: 0 18px 40px rgba(51, 35, 16, 0.14);
    backdrop-filter: blur(12px);
}

.header-menu-panel[hidden] {
    display: none;
}

.menu-action-list {
    display: grid;
    gap: 8px;
}

.admin-toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    max-width: 100%;
    margin-top: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.admin-toolbar .ghost-btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.menu-search-field {
    display: grid;
    gap: 8px;
}

.menu-search-field span {
    font-size: 13px;
    color: var(--muted);
}

.menu-search-field input {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
}

.menu-search-field input:disabled {
    color: var(--muted);
    background: rgba(239, 233, 224, 0.82);
    cursor: not-allowed;
}

.menu-logout-form {
    margin: 0;
}

.menu-action-btn {
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.header-menu-panel .admin-toolbar {
    margin-top: 0;
    overflow: visible;
    padding-bottom: 0;
    display: grid;
    gap: 8px;
}

.header-menu-panel .admin-toolbar .ghost-btn,
.menu-action-list .ghost-btn {
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 12px;
    justify-content: flex-start;
    white-space: normal;
}

.message-stage {
    position: relative;
    min-height: 0;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 250, 243, 0.86)),
        repeating-linear-gradient(
            0deg,
            rgba(186, 74, 0, 0.02),
            rgba(186, 74, 0, 0.02) 24px,
            transparent 24px,
            transparent 48px
        );
    box-shadow: var(--shadow);
    overscroll-behavior: contain;
}

.message {
    max-width: min(72%, 560px);
    padding: 10px 12px;
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow: 0 10px 24px rgba(51, 35, 16, 0.08);
}

.message.pending {
    opacity: 0.82;
}

.message.mine {
    margin-left: auto;
    background: var(--admin-bubble);
    border: 1px solid var(--admin-border);
}

.message.other {
    border: 1px solid var(--customer-border);
    background: var(--customer-bubble);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--muted);
}

.message-meta-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.message-action-btn {
    padding: 2px 6px;
    border: none;
    border-radius: 999px;
    background: rgba(60, 40, 20, 0.08);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
}

.message-action-btn:hover {
    background: rgba(186, 74, 0, 0.18);
    color: var(--accent-deep);
}

.message-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
    font-size: 14px;
}

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

.message-image {
    display: block;
    max-width: min(180px, 100%);
    max-height: 200px;
    margin-top: 8px;
    border-radius: 14px;
    object-fit: cover;
    cursor: zoom-in;
}

.message-audio,
.message-video {
    display: block;
    width: min(280px, 100%);
    margin-top: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
}

.message-video {
    max-height: min(260px, 42vh);
    object-fit: contain;
}

.message-video-wrap {
    display: grid;
    gap: 8px;
    max-width: min(280px, 100%);
}

.message-file {
    display: grid;
    gap: 4px;
    width: min(300px, 100%);
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    text-decoration: none;
}

.message-file-label {
    font-size: 11px;
    color: var(--muted);
}

.message-status {
    margin-top: 8px;
    font-size: 11px;
    color: var(--muted);
}

.message.recalled .message-text {
    color: var(--muted);
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: var(--muted);
    text-align: center;
}

.jump-latest {
    position: absolute;
    right: 22px;
    bottom: 18px;
    padding: 10px 14px;
    color: #fffaf4;
    background: linear-gradient(135deg, #1f5d4f 0%, #114338 100%);
    box-shadow: 0 14px 30px rgba(17, 67, 56, 0.24);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.jump-latest.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.composer textarea {
    min-height: 72px;
    resize: vertical;
}

.composer-main {
    min-width: 0;
}

.quick-reply-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.quick-reply-chip {
    max-width: 220px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-field {
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    flex: 0 0 auto;
}

.upload-field input {
    display: none;
}

.upload-inline {
    min-height: 48px;
    justify-content: center;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.primary-btn.icon-btn svg {
    fill: currentColor;
}

.upload-field.icon-btn svg {
    fill: var(--ink);
}

.composer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    justify-content: flex-end;
}

.composer-actions .primary-btn,
.composer-actions .upload-inline {
    min-width: 76px;
    min-height: 42px;
    justify-content: center;
    width: 76px;
}

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(18, 15, 12, 0.84);
}

.image-viewer[hidden] {
    display: none;
}

.image-viewer-image {
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 14px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(32, 24, 16, 0.36);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-panel {
    width: min(680px, 96vw);
    max-height: min(720px, 88vh);
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 252, 247, 0.98);
    box-shadow: 0 24px 70px rgba(51, 35, 16, 0.22);
}

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

.modal-head h2 {
    margin: 0;
    font-size: 18px;
}

.modal-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.favorite-list {
    display: grid;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.favorite-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
}

.favorite-card p {
    margin: 0;
}

.favorite-thumb-button {
    display: block;
    width: fit-content;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.favorite-thumb {
    display: block;
    max-width: min(180px, 100%);
    max-height: 150px;
    border-radius: 12px;
    object-fit: cover;
}

.favorite-meta {
    color: var(--muted);
    font-size: 12px;
}

.favorite-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-reply-modal-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.quick-reply-editor-list {
    display: grid;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.quick-reply-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
}

.quick-reply-editor-row textarea {
    width: 100%;
    min-height: 52px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    line-height: 1.45;
    background: #fff;
}

.quick-reply-editor-empty {
    display: grid;
    place-items: center;
    min-height: 120px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
}

.quick-reply-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.notice-modal-panel {
    grid-template-rows: auto 1fr auto;
}

.notice-editor-field {
    display: grid;
    gap: 8px;
    min-height: 0;
}

.notice-editor-field span {
    color: var(--muted);
    font-size: 0.88rem;
}

.notice-editor-field textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    line-height: 1.5;
    background: #fff;
}

.notice-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 900px) {
    .login-panel,
    .app-shell {
        grid-template-columns: 1fr;
    }

    body {
        overflow: auto;
    }

    .app-shell {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--line);
        overflow: visible;
    }

    .chat-panel {
        height: 100vh;
        padding: 12px;
        gap: 10px;
        overflow: hidden;
    }

    .chat-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 16px;
    }

    .chat-header h1 {
        font-size: 16px;
        line-height: 1.2;
    }

    .chat-header .subtle {
        display: none;
    }

    .chat-header .eyebrow {
        display: none;
    }

    .chat-header > div:first-child {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .chat-header > div:first-child h1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-actions {
        gap: 6px;
        flex: 0 0 auto;
        flex-wrap: wrap;
    }

    .auto-reply-panel {
        order: 3;
        width: 100%;
        max-width: none;
        min-height: 44px;
        padding: 7px 8px;
        border-radius: 14px;
    }

    .auto-reply-copy p {
        max-width: 34vw;
    }

    .auto-reply-switch,
    .auto-reply-edit {
        min-height: 34px;
        padding: 6px 8px;
        border-radius: 12px;
    }

    .auto-reply-switch-track {
        width: 34px;
        height: 20px;
    }

    .auto-reply-switch-thumb {
        width: 14px;
        height: 14px;
    }

    .auto-reply-switch.is-active .auto-reply-switch-thumb {
        transform: translateX(14px);
    }

    .header-menu-panel {
        width: min(240px, calc(100vw - 28px));
        padding: 12px;
        border-radius: 16px;
    }

    .admin-toolbar {
        margin-top: 2px;
    }

    .admin-toolbar .ghost-btn {
        flex: 0 0 auto;
    }

    .ghost-btn {
        padding: 6px 10px;
        border-radius: 12px;
        white-space: nowrap;
    }

    .message-stage {
        min-height: 0;
    }

    .message-list {
        padding: 10px;
        border-radius: 20px;
    }

    .message {
        max-width: 88%;
        padding: 9px 10px;
        border-radius: 16px;
    }

    .message-text {
        font-size: 13px;
        line-height: 1.4;
    }

    .message-image {
        max-width: min(116px, 100%);
        max-height: 136px;
        border-radius: 12px;
    }

    .message-audio,
    .message-video {
        width: min(180px, 58vw, 100%);
        border-radius: 12px;
    }

    .message-video {
        max-height: min(160px, 28vh);
    }

    .message-video-wrap {
        max-width: min(180px, 58vw, 100%);
    }

    .composer {
        padding: 10px;
        border-radius: 18px;
        grid-template-columns: minmax(0, 1fr) 68px;
        gap: 8px;
        align-items: stretch;
    }

    .composer textarea {
        min-height: 56px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    .quick-reply-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .quick-reply-chip {
        flex: 0 0 auto;
        max-width: 160px;
    }

    .quick-reply-editor-row {
        grid-template-columns: 1fr;
    }

    .quick-reply-editor-row .ghost-btn {
        justify-self: end;
    }

    .quick-reply-modal-actions {
        justify-content: stretch;
    }

    .quick-reply-modal-actions .ghost-btn,
    .quick-reply-modal-actions .primary-btn {
        flex: 1 1 auto;
    }

    .upload-field {
        padding: 8px 10px;
        border-radius: 12px;
        flex: 0 0 auto;
    }

    .upload-inline {
        min-height: 42px;
    }

    .composer-actions {
        gap: 8px;
        justify-content: flex-end;
        flex-direction: column;
        flex-wrap: nowrap;
        overflow: visible;
        align-items: stretch;
    }

    .composer-actions .primary-btn,
    .composer-actions .upload-inline {
        min-width: 68px;
        width: 68px;
        min-height: 42px;
        padding: 6px 8px;
    }

    .image-viewer-image {
        max-width: 96vw;
        max-height: 82vh;
        border-radius: 14px;
    }

    .image-viewer {
        padding: 12px;
    }

    .message {
        max-width: 88%;
    }
}
