* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; min-height: 100%; }
html { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; background: var(--background); color: var(--text); -webkit-text-size-adjust: 100%; }
body { line-height: 1.5; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, input, textarea, fieldset { margin: 0; }
button { cursor: pointer; }
button, a, input, textarea { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--focus); }
button:disabled { cursor: not-allowed; opacity: .48; }
button, a { touch-action: manipulation; }
button { color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button svg, a svg { pointer-events: none; }
svg.icon { width: 21px; height: 21px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
::selection { background: var(--accent-border); color: var(--text); }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -70px; left: 16px; z-index: 100; padding: 12px 20px; border-radius: 10px; background: var(--accent); color: var(--on-accent); }
.skip-link:focus { top: 12px; }
.noscript-notice { position: fixed; z-index: 80; margin: 0; padding: 16px; inset: auto 0 0; background: var(--danger-soft); color: var(--danger); text-align: center; }
.app-shell { display: grid; grid-template-columns: 294px minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { display: flex; flex-direction: column; position: relative; min-height: 0; background: var(--sidebar); border-right: 1px solid var(--border); }
.brand { display: flex; gap: 11px; align-items: center; min-height: 96px; padding: 22px 27px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-name { font-size: 27px; font-weight: 760; letter-spacing: -1.1px; line-height: 1.15; }
.brand-dot { color: var(--accent); }
.brand-name small { display: block; margin-top: 5px; font-size: 10px; font-weight: 450; letter-spacing: .15px; color: var(--text-secondary); }
.sidebar-content { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 16px 17px 0; }
.new-conversation-button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid var(--accent-border); border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 12px; transition: background .2s, transform .2s; }
.new-conversation-button:not(:disabled):hover { background: var(--accent-border); transform: translateY(-1px); }
.new-conversation-button .icon { width: 18px; height: 18px; }
.new-conversation-button .new-button-sparkle { margin-left: auto; width: 15px; height: 15px; opacity: .65; }
.sidebar-search { display: flex; gap: 9px; align-items: center; padding: 10px 11px; margin: 22px 0 27px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-muted); }
.sidebar-search .icon { width: 16px; height: 16px; }
.sidebar-search input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; color: var(--text); font-size: 12px; }
.sidebar-search:focus-within { border-color: var(--focus); }
kbd { font-family: inherit; font-size: 10px; }
.sidebar-search kbd { white-space: nowrap; font-size: 9px; border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; }
.section-heading { display: flex; align-items: center; gap: 9px; padding: 0 10px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: 10px; font-weight: 650; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); }
.count-badge { display: inline-grid; place-items: center; min-width: 19px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--border); color: var(--text-secondary); font-size: 10px; }
.conversation-nav { overflow-y: auto; min-height: 0; padding: 2px; margin: -2px; }
.conversation-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.conversation-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 13px 10px; text-align: left; border: 1px solid transparent; border-radius: 11px; background: transparent; transition: background .15s, border-color .15s; }
.conversation-item:hover { background: var(--surface-hover); }
.conversation-item.active { background: var(--accent-soft); border-color: var(--accent-border); }
.conversation-avatar { display: grid; place-items: center; flex-shrink: 0; width: 39px; height: 39px; border-radius: 12px; }
.conversation-avatar .icon { width: 19px; height: 19px; }
.color-violet { background: var(--violet-background); color: var(--violet-text); }
.color-amber { background: var(--amber-background); color: var(--amber-text); }
.color-blue { background: var(--blue-background); color: var(--blue-text); }
.color-mint { background: var(--mint-background); color: var(--mint-text); }
.color-rose { background: var(--rose-background); color: var(--rose-text); }
.conversation-item-text { min-width: 0; flex: 1; }
.conversation-item-top { display: flex; align-items: center; gap: 8px; }
.conversation-item-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text); }
.conversation-item.active .conversation-item-title { color: var(--accent-text); }
.conversation-item-time { margin-left: auto; flex-shrink: 0; color: var(--text-muted); font-size: 9px; }
.conversation-item.active .conversation-item-time { color: var(--text-secondary); }
.conversation-item-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; font-size: 10px; color: var(--text-secondary); }
.sidebar-empty { padding: 10px; font-size: 12px; color: var(--text-secondary); }
.sidebar-loading { padding: 10px; display: grid; gap: 13px; }
.sidebar-loading span { display: block; height: 52px; border-radius: 10px; background: var(--border); animation: pulse 1.4s infinite alternate; }
.sidebar-bottom { padding: 22px 22px 0; }
.little-note { position: relative; padding: 17px 16px 14px; border-radius: 13px; background: var(--note-background); }
.note-doodle { display: block; color: var(--accent-text); margin-bottom: 9px; }
.note-doodle .icon { height: 24px; width: 24px; transform: rotate(-9deg); }
.little-note strong { display: block; max-width: 170px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.little-note p { margin: 6px 0 4px; max-width: 190px; font-size: 10px; line-height: 1.8; color: var(--text-secondary); }
.note-line { display: block; margin: 9px 0 1px auto; width: 42px; height: 6px; border-bottom: 2px solid var(--note-line); border-radius: 50%; transform: rotate(-7deg); }
.sidebar-footer { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; }
.user-profile-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 57px; margin-top: 15px; padding: 8px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); text-align: left; }
.user-profile-button:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--accent-border); }
.user-avatar { display: grid; place-items: center; flex-shrink: 0; width: 33px; height: 33px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 650; }
.user-profile-text { min-width: 0; flex: 1; }
.user-profile-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.user-profile-text small { display: block; margin-top: 2px; color: var(--text-secondary); font-size: 9px; }
.user-profile-button > .icon { width: 17px; height: 17px; color: var(--text-secondary); }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.connection-state.connected .status-dot { background: var(--success); }
.connection-state.disconnected .status-dot { background: var(--danger); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; padding: 7px; border: 0; border-radius: 9px; color: var(--text-secondary); background: transparent; transition: color .15s, background .15s; }
.icon-button:hover:not(:disabled), .icon-button[aria-expanded="true"] { color: var(--accent-text); background: var(--accent-soft); text-decoration: none; }
.small-icon { width: 28px; height: 28px; padding: 5px; }
.small-icon .icon { width: 17px; height: 17px; }
.sidebar-close, .mobile-menu { display: none; }
.workspace { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--canvas); }
.conversation-header { display: flex; align-items: center; gap: 12px; min-height: 92px; flex-shrink: 0; padding: 19px 36px; border-bottom: 1px solid var(--border); background: var(--background); }
.header-avatar { width: 43px; height: 43px; border-radius: 13px; }
.header-titles { min-width: 0; }
.header-titles h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; letter-spacing: -.2px; font-weight: 650; }
.header-titles p { margin: 4px 0 0; font-size: 10px; color: var(--text-secondary); }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.workspace-badge { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; margin-right: 15px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-secondary); font-size: 10px; white-space: nowrap; }
.workspace-badge span { height: 5px; width: 5px; border-radius: 50%; background: var(--success); }
.header-divider { height: 21px; width: 1px; margin: 0 10px; background: var(--border); }
.theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: block; }
.menu-anchor { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 9px); z-index: 15; min-width: 225px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-floating); }
.dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px; text-align: left; border: 0; border-radius: 7px; background: transparent; font-size: 12px; }
.dropdown-menu button:hover { background: var(--surface-hover); }
.dropdown-menu .icon { width: 17px; height: 17px; color: var(--text-secondary); }
.dropdown-menu hr { margin: 5px; border: 0; border-top: 1px solid var(--border); }
.danger-text, .dropdown-menu .danger-text .icon { color: var(--danger); }
.message-search-panel { display: flex; align-items: center; gap: 12px; padding: 11px 36px; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); }
.message-search-panel input { min-width: 0; flex: 1; padding: 6px 0; border: 0; background: transparent; color: var(--text); outline: 0; font-size: 12px; }
.message-search-panel:focus-within { box-shadow: inset 0 -1px var(--accent); }
.search-result-count { white-space: nowrap; font-size: 10px; }
.conversation-body { position: relative; display: flex; flex: 1; flex-direction: column; min-height: 0; }
.message-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 24px 40px; scroll-behavior: smooth; overscroll-behavior: contain; }
.message-scroll:focus-visible { outline-offset: -5px; }
.welcome-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 10px 0 25px; text-align: center; animation: fade-up .4s ease both; }
.welcome-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 9px; font-weight: 550; letter-spacing: 1.7px; text-transform: uppercase; }
.welcome-kicker span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.welcome-illustration { width: 276px; height: auto; margin: 15px 0 9px; opacity: var(--illustration-opacity); }
.welcome-state h2 { margin: 0; font-size: clamp(29px, 3vw, 41px); line-height: 1.2; letter-spacing: -1.55px; font-weight: 650; }
.welcome-state h2 span { color: var(--accent-text); }
.welcome-description { margin: 17px 0 0; font-size: 12px; line-height: 1.85; color: var(--text-secondary); }
.welcome-features { display: flex; gap: 21px; margin-top: 23px; }
.welcome-features > span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 10px; }
.welcome-features .icon { width: 15px; height: 15px; color: var(--accent-text); }
.starter-suggestions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 32px; }
.starter-suggestions > span { margin-right: 4px; color: var(--text-muted); font-size: 10px; }
.starter-suggestions button { display: inline-flex; align-items: center; gap: 15px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 10px; color: var(--text-secondary); transition: background .15s, border-color .15s; }
.starter-suggestions button:hover { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-text); }
.starter-suggestions button span { color: var(--text-muted); font-size: 15px; }
.composer-area { flex-shrink: 0; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 42px 23px; }
.composer { border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.composer fieldset { min-width: 0; border: 0; padding: 0; }
.composer textarea { display: block; resize: none; width: 100%; max-height: 170px; min-height: 66px; padding: 20px 21px 10px; border: 0; border-radius: 16px 16px 0 0; background: transparent; color: var(--text); outline: none; font-size: 12px; line-height: 1.7; }
.composer-toolbar { display: flex; align-items: center; gap: 8px; padding: 5px 12px 12px 15px; }
.composer-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.attachment-trigger { display: inline-flex; align-items: center; gap: 7px; padding: 7px 5px; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); font-size: 10px; }
.attachment-trigger .icon { width: 17px; height: 17px; }
.attachment-trigger:hover { color: var(--accent-text); background: var(--accent-soft); }
.toolbar-divider { width: 1px; height: 15px; margin: 0 3px; background: var(--border); }
.composer-tools .icon-button { height: 30px; width: 30px; padding: 5px; }
.composer-tools .icon-button .icon { height: 19px; width: 19px; }
.composer-media-hint { margin-left: 5px; font-size: 9px; white-space: nowrap; color: var(--text-muted); }
.send-button { display: inline-flex; align-items: center; justify-content: center; gap: 15px; min-height: 36px; margin-left: auto; padding: 8px 13px; border: 0; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; transition: background .2s, transform .2s; }
.send-button .icon { height: 16px; width: 16px; }
.send-button:disabled { opacity: .65; }
.send-button:not(:disabled):hover { background: var(--accent-hover); transform: translateY(-1px); }
.composer-help { display: flex; justify-content: space-between; gap: 15px; padding: 11px 3px 0; color: var(--text-muted); font-size: 9px; }
.composer-help kbd { font-size: inherit; }
.mobile-keyboard-hint { display: none; }
.help-dot { margin: 0 6px; }
.character-count { margin-left: auto; color: var(--text-secondary); font-size: 9px; white-space: nowrap; }
.character-count:not([hidden]) + .send-button { margin-left: 2px; }
.composer-status { padding: 0 5px; color: var(--danger); font-size: 11px; }
.composer-status:not(:empty) { padding-bottom: 10px; }
.composer-status.is-progress { color: var(--text-secondary); }
.emoji-anchor { position: relative; }
.emoji-picker { position: absolute; left: -20px; bottom: calc(100% + 18px); z-index: 15; width: 304px; max-width: calc(100vw - 38px); padding: 14px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-floating); }
.emoji-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.emoji-heading strong { font-size: 12px; font-weight: 600; }
.emoji-search-label { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); color: var(--text-muted); }
.emoji-search-label .icon { width: 15px; height: 15px; }
.emoji-search-label input { width: 100%; min-width: 0; outline: 0; border: 0; background: transparent; color: var(--text); font-size: 11px; }
.emoji-search-label:focus-within { border-color: var(--accent); }
.emoji-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; max-height: 220px; margin-top: 12px; overflow-y: auto; }
.emoji-grid button { display: grid; place-items: center; padding: 4px 0; min-height: 34px; border: 0; border-radius: 7px; background: transparent; font-size: 22px; }
.emoji-grid button:hover { background: var(--accent-soft); }
.emoji-grid p { grid-column: 1 / -1; font-size: 11px; color: var(--text-secondary); }
.emoji-tip { margin: 12px 0 0; color: var(--text-muted); font-size: 9px; }
.attachment-previews { display: flex; gap: 9px; flex-wrap: wrap; padding: 15px 16px 0; }
.attachment-preview { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 210px; padding: 7px 30px 7px 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.attachment-preview-thumb { display: grid; place-items: center; width: 37px; height: 37px; flex-shrink: 0; border-radius: 6px; object-fit: cover; background: var(--accent-soft); color: var(--accent-text); }
.attachment-preview-label { min-width: 0; }
.attachment-preview-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; font-size: 10px; }
.attachment-preview-size { display: block; font-size: 9px; color: var(--text-secondary); }
.attachment-preview .remove-attachment { position: absolute; right: 4px; top: 4px; width: 23px; height: 23px; padding: 4px; }
.attachment-preview .remove-attachment .icon { height: 14px; width: 14px; }
.messages { display: flex; flex-direction: column; width: 100%; max-width: 875px; margin: 0 auto; }
.date-divider { display: flex; align-items: center; gap: 15px; margin: 15px 0 29px; color: var(--text-muted); font-size: 10px; }
.date-divider::before, .date-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.message { display: flex; align-items: flex-end; flex-direction: column; margin: 0 0 22px 35px; animation: fade-up .2s ease both; }
.message.is-other { align-items: flex-start; margin: 0 35px 22px 0; }
.message.is-other .message-bubble { border-radius: 15px 15px 15px 4px; background: var(--surface); border-color: var(--border); }
.message-author { margin: 0 3px 6px; color: var(--text-secondary); font-size: 10px; font-weight: 600; overflow-wrap: anywhere; }
.message-author small { margin-left: 6px; font-size: 9px; font-weight: 400; }
.message-bubble { min-width: 80px; max-width: min(100%, 640px); padding: 13px 17px; border: 1px solid var(--message-border); border-radius: 15px 15px 4px 15px; background: var(--message); }
.message-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; }
.message-text a { text-decoration: underline; text-underline-offset: 2px; }
.message-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 9px; color: var(--text-muted); }
.message-meta .icon { height: 13px; width: 13px; color: var(--success); }
.message-edited { font-style: italic; }
.message-actions { display: inline-flex; gap: 2px; margin-left: 4px; }
.message-action { width: 26px; height: 26px; padding: 5px; }
.message-meta .message-action .icon { width: 14px; height: 14px; color: inherit; }
.message-action[data-message-action="delete"]:hover { background: var(--danger-soft); color: var(--danger); }
.message-edit-text { resize: vertical; min-height: 145px; max-height: 45vh; line-height: 1.8; }
.app-dialog .field-help { margin-top: 8px; font-size: 10px; }
.message-delete-preview { max-height: 150px; overflow: auto; margin: 0; padding: 12px 15px; border-left: 3px solid var(--accent-border); border-radius: 0 8px 8px 0; background: var(--surface-soft); color: var(--text-secondary); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.invitation-panel { padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.invitation-panel h3 { margin: 0; font-size: 13px; }
.invitation-panel p { margin-bottom: 14px; font-size: 11px; }
.invitation-panel .icon, #logout-button .icon { width: 16px; height: 16px; }
.invitation-result { margin-top: 17px; }
.invitation-result .text-field { font-family: ui-monospace, monospace; font-size: 12px; background: var(--surface); }
.invitation-result > button { margin-top: 9px; }
.message-attachments { display: flex; flex-direction: column; gap: 9px; max-width: 100%; }
.message-attachments + .message-text { margin-top: 11px; }
.media-card { margin: 0; min-width: 0; max-width: min(100%, 420px); overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.image-open { display: block; max-width: 100%; padding: 0; border: 0; background: transparent; }
.media-image { display: block; max-width: 100%; width: auto; max-height: 320px; min-height: 80px; object-fit: contain; }
.image-fallback { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px; color: var(--text-secondary); font-size: 11px; }
.media-card video { display: block; width: 100%; max-height: 320px; background: var(--lightbox-background); }
.media-card audio { display: block; width: 100%; height: 42px; padding: 0 5px 4px; }
.audio-card { width: 345px; }
.media-caption { display: flex; align-items: center; gap: 9px; padding: 9px 11px; }
.media-caption > span { min-width: 0; flex: 1; }
.media-name { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-size { display: block; margin-top: 1px; color: var(--text-secondary); font-size: 9px; }
.media-caption .icon { width: 17px; height: 17px; }
.file-card { display: flex; align-items: center; gap: 11px; width: 330px; max-width: 100%; padding: 11px 12px; color: var(--text); }
.file-card:hover { text-decoration: none; background: var(--surface-soft); }
.file-icon { display: grid; place-items: center; flex-shrink: 0; width: 37px; height: 41px; border-radius: 8px; color: var(--accent-text); background: var(--accent-soft); }
.file-details { min-width: 0; flex: 1; }
.file-card > .icon { color: var(--text-secondary); width: 17px; height: 17px; }
.no-results { text-align: center; padding: 70px 10px; color: var(--text-secondary); font-size: 12px; }
.scroll-bottom-button { position: absolute; z-index: 5; bottom: 174px; left: 50%; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow-floating); color: var(--text-secondary); font-size: 10px; transform: translateX(-50%); }
.scroll-bottom-button .icon { width: 15px; height: 15px; }
.drop-overlay { position: absolute; z-index: 25; inset: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; padding: 20px; text-align: center; border: 2px dashed var(--accent); border-radius: 18px; background: var(--drop-background); color: var(--accent-text); pointer-events: none; }
.drop-overlay strong { font-size: 23px; font-weight: 600; }
.drop-overlay > span:last-child { font-size: 12px; }
.drop-icon { display: grid; place-items: center; width: 80px; height: 80px; margin-bottom: 7px; border-radius: 23px; background: var(--accent-soft); }
.drop-icon .icon { width: 35px; height: 35px; }
.initial-loading, .empty-space, .error-state { display: flex; align-items: center; justify-content: center; min-height: 100%; flex-direction: column; padding: 30px; text-align: center; }
.initial-loading p { font-size: 12px; color: var(--text-secondary); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 2px solid var(--accent-border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.empty-icon { display: grid; place-items: center; width: 65px; height: 65px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-text); }
.empty-icon .icon { height: 29px; width: 29px; }
.empty-space h2, .error-state h2 { font-size: 24px; letter-spacing: -.7px; margin: 20px 0 0; }
.empty-space p, .error-state p { max-width: 400px; margin: 12px 0 23px; color: var(--text-secondary); font-size: 12px; line-height: 1.8; }
.app-dialog { width: min(465px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 29px; border: 1px solid var(--border); border-radius: 21px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-floating); }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(4px); }
dialog[open] { animation: fade-up .2s ease; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 13px; color: var(--accent-text); background: var(--accent-soft); }
.app-dialog h2 { margin: 0; font-size: 22px; line-height: 1.3; letter-spacing: -.6px; font-weight: 650; }
.app-dialog p { margin: 10px 0 23px; color: var(--text-secondary); font-size: 12px; line-height: 1.8; }
.field-label { display: block; font-size: 11px; font-weight: 550; margin-bottom: 7px; }
.text-field { width: 100%; padding: 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface-soft); color: var(--text); font-size: 12px; }
.text-field:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
.conversation-customization { border: 0; margin-top: 23px; padding: 0; }
.conversation-customization legend { font-size: 11px; margin-bottom: 10px; }
.icon-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-label { position: relative; display: flex; }
.choice-label input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.choice-label > span { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-secondary); background: var(--surface-soft); }
.choice-label input:checked + span { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent); }
.choice-label input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }
.choice-label .icon { width: 18px; height: 18px; }
.color-choices { display: flex; gap: 11px; margin-top: 16px; }
.choice-label.color-choice > span { width: 25px; height: 25px; border-radius: 50%; border: 3px solid var(--surface); outline: 1px solid var(--border); }
.choice-label.color-choice input:checked + span { outline: 2px solid var(--accent); }
.color-choice .color-violet { background: var(--violet-text); }
.color-choice .color-amber { background: var(--amber-text); }
.color-choice .color-blue { background: var(--blue-text); }
.color-choice .color-mint { background: var(--mint-text); }
.color-choice .color-rose { background: var(--rose-text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 29px; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 14px; min-height: 40px; border-radius: 9px; border: 1px solid transparent; font-size: 11px; font-weight: 550; }
.primary-button { background: var(--accent); color: var(--on-accent); }
.primary-button:hover:not(:disabled) { background: var(--accent-hover); }
.primary-button .icon { width: 16px; height: 16px; }
.secondary-button { background: var(--surface); color: var(--text-secondary); border-color: var(--border); }
.secondary-button:hover { background: var(--surface-hover); }
.danger-button { background: var(--danger); color: var(--background); }
.danger-button:hover:not(:disabled) { background: var(--danger-hover); }
.danger-surface { background: var(--danger-soft); color: var(--danger); }
.app-dialog .form-error { padding: 10px; margin: 13px 0 0; border-radius: 7px; background: var(--danger-soft); color: var(--danger); font-size: 11px; }
.about-dialog { width: min(500px, calc(100% - 32px)); }
.about-detail { display: flex; gap: 13px; margin-top: 18px; }
.about-detail > .icon { color: var(--accent-text); margin-top: 2px; width: 19px; height: 19px; }
.about-detail p { margin: 0; font-size: 11px; }
.about-detail strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 12px; font-weight: 600; }
.lightbox { width: min(1200px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); border: 0; border-radius: 14px; padding: 0; background: var(--lightbox-background); color: var(--lightbox-text); }
.lightbox::backdrop { background: var(--lightbox-background); }
.lightbox-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 15px; }
.lightbox-toolbar > span { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox .icon-button { color: var(--lightbox-text); }
.lightbox > img { display: block; max-width: 100%; max-height: calc(100dvh - 110px); margin: 0 auto; object-fit: contain; }
.toast-container { position: fixed; z-index: 100; bottom: 22px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 12px 18px; margin-top: 8px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-floating); font-size: 12px; animation: fade-up .2s ease; }
.toast .icon { width: 17px; height: 17px; color: var(--success); }
.toast.error .icon { color: var(--danger); }

/* Connexion : le formulaire PHP reste fonctionnel sans JavaScript. */
.auth-page { min-height: 100vh; min-height: 100dvh; background: var(--sidebar); }
.auth-header { display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; }
.auth-header .brand { padding-left: 0; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 450px); align-items: center; gap: 70px; max-width: 1060px; padding: 40px 30px; margin: 15px auto; }
.auth-introduction { text-align: center; }
.auth-introduction .welcome-kicker { font-size: 8px; letter-spacing: 1.2px; }
.auth-introduction .welcome-illustration { display: block; width: 290px; max-width: 100%; margin: 25px auto 18px; }
.auth-introduction h2 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -1.2px; line-height: 1.25; font-weight: 650; }
.auth-introduction h2 span { color: var(--accent-text); }
.auth-introduction > p { color: var(--text-secondary); font-size: 12px; line-height: 1.9; }
.auth-introduction .welcome-features { justify-content: center; }
.auth-card { padding: 30px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.auth-tabs { display: flex; gap: 5px; padding: 4px; margin-bottom: 28px; border-radius: 10px; background: var(--surface-soft); }
.auth-tabs a { flex: 1; padding: 9px; text-align: center; border-radius: 7px; color: var(--text-secondary); font-size: 11px; font-weight: 550; }
.auth-tabs a[aria-current] { background: var(--accent-soft); color: var(--accent-text); }
.auth-tabs a:hover { text-decoration: none; background: var(--surface-hover); }
.auth-step { display: block; margin-bottom: 18px; color: var(--accent-text); font-size: 10px; }
.auth-card h1 { margin: 0; font-size: 24px; line-height: 1.3; letter-spacing: -.7px; }
.auth-description { color: var(--text-secondary); font-size: 12px; line-height: 1.8; margin: 10px 0 25px; }
.auth-form .field-label { margin-top: 19px; }
.auth-form .text-field { font-size: 14px; }
.field-help { margin: 7px 0 14px; color: var(--text-secondary); font-size: 10px; line-height: 1.7; }
.password-field { position: relative; }
.password-field .text-field { padding-right: 70px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 7px; border: 0; border-radius: 5px; background: transparent; color: var(--accent-text); font-size: 10px; }
.password-toggle:hover { background: var(--accent-soft); }
.auth-submit { width: 100%; margin-top: 25px; min-height: 45px; font-size: 12px; }
.auth-notice { padding: 15px; border: 1px solid var(--accent-border); border-radius: 11px; background: var(--accent-soft); color: var(--text); font-size: 11px; line-height: 1.8; }
.auth-notice strong { font-size: 12px; }
.auth-notice p { margin: 8px 0; }
.auth-notice code { overflow-wrap: anywhere; font-size: 10px; }
.auth-notice .primary-button, .auth-notice .secondary-button { margin-top: 8px; }
.auth-error { margin-bottom: 20px; border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.auth-footer-note { display: flex; align-items: flex-start; gap: 7px; margin: 25px 0 0; padding-top: 17px; border-top: 1px solid var(--border); font-size: 10px; line-height: 1.7; color: var(--text-secondary); }
.auth-footer-note .icon { width: 15px; height: 15px; margin-top: 2px; }
.auth-page-footer { padding: 20px; text-align: center; color: var(--text-muted); font-size: 10px; }
@media (max-width: 850px) {
  .auth-layout { gap: 30px; padding: 25px; }
  .auth-introduction h2 { font-size: 28px; }
  .auth-introduction .welcome-kicker { line-height: 1.8; }
}
@media (max-width: 650px) {
  .auth-header { padding: 0 22px; }
  .auth-header .brand { min-height: 88px; padding-right: 0; }
  .auth-layout { display: block; max-width: 475px; margin-top: 0; padding: 10px 18px 20px; }
  .auth-introduction { display: none; }
  .auth-card { padding: 25px 22px; }
  .auth-form .text-field { font-size: 16px; }
  .auth-card h1 { font-size: 23px; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { opacity: .4; } }
@keyframes fade-up { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (min-width: 1500px) {
  .app-shell { grid-template-columns: 315px minmax(0, 1fr); }
  .sidebar-content { padding-right: 23px; padding-left: 23px; }
  .welcome-illustration { width: 310px; }
  .welcome-state h2 { font-size: 44px; }
}
@media (max-height: 780px) and (min-width: 761px) {
  .welcome-illustration { width: 225px; margin: 8px 0 4px; }
  .welcome-state h2 { font-size: 34px; }
  .welcome-description { margin-top: 12px; }
  .welcome-features { margin-top: 16px; }
  .starter-suggestions { margin-top: 21px; }
  .little-note { padding: 13px; }
  .little-note p { line-height: 1.6; }
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 268px minmax(0, 1fr); }
  .sidebar-content { padding-left: 13px; padding-right: 13px; }
  .brand { padding-left: 24px; }
  .conversation-header { padding-left: 24px; padding-right: 24px; }
  .workspace-badge { display: none; }
  .composer-area { padding-left: 28px; padding-right: 28px; }
  .composer-media-hint { display: none; }
  .message-scroll { padding-left: 28px; padding-right: 28px; }
  .starter-suggestions > span { width: 100%; margin: 0 0 3px; }
}
@media (max-width: 760px) {
  .app-shell { display: flex; }
  .workspace { width: 100%; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; width: min(310px, calc(100vw - 50px)); transform: translateX(-100%); visibility: hidden; transition: transform .22s, visibility .22s; box-shadow: var(--shadow-floating); }
  body.sidebar-open .sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop { display: block; position: fixed; z-index: 35; inset: 0; padding: 0; border: 0; background: var(--overlay); }
  .sidebar-close { display: flex; position: absolute; top: 24px; right: 10px; }
  .sidebar-content { padding: 12px 17px 0; }
  .brand { padding-left: 24px; }
  .mobile-menu { display: flex; margin-left: -6px; }
  .conversation-header { min-height: 78px; padding: 14px 17px; gap: 10px; }
  .header-avatar { width: 35px; height: 35px; border-radius: 11px; }
  .header-avatar .icon { width: 17px; height: 17px; }
  .header-titles { flex: 1; }
  .header-titles h1 { font-size: 13px; }
  .header-titles p { font-size: 9px; }
  .header-actions { gap: 0; }
  .header-actions > .icon-button, .header-actions .menu-anchor > .icon-button { height: 32px; width: 32px; padding: 6px; }
  .header-actions .icon { width: 19px; height: 19px; }
  .header-divider { margin: 0 5px; }
  .composer-area { padding: 0 18px max(14px, env(safe-area-inset-bottom)); }
  .message-scroll { padding: 20px 20px; }
  .welcome-state { padding: 15px 0 25px; }
  .welcome-illustration { width: 245px; margin: 13px 0 10px; }
  .welcome-state h2 { font-size: 37px; }
  .welcome-description { font-size: 12px; }
  .starter-suggestions { margin-top: 25px; }
  .welcome-kicker { font-size: 8px; }
  .composer textarea { font-size: 16px; min-height: 66px; padding: 15px 15px 8px; }
  .composer-toolbar { padding: 3px 10px 10px; }
  .composer-help { font-size: 9px; }
  .desktop-keyboard-hint { display: none; }
  .mobile-keyboard-hint { display: inline; }
  #upload-limit { white-space: nowrap; }
  .message-search-panel { padding: 8px 20px; }
  .message-search-panel input { font-size: 16px; }
  .message { margin-left: 10px; }
  .message.is-other { margin-right: 10px; margin-left: 0; }
  .message-bubble { padding: 11px 13px; }
  .message-text { font-size: 14px; }
  .emoji-picker { position: fixed; left: 18px; bottom: 150px; }
  .sidebar-search input, .text-field, .emoji-search-label input { font-size: 16px; }
  .app-dialog { padding: 24px; }
}
@media (max-width: 430px) {
  .header-titles h1 { max-width: 150px; }
  .header-avatar, .header-divider { display: none; }
  .header-titles p { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .conversation-header { gap: 7px; }
  .composer-help > span:first-child { max-width: 230px; }
  .composer-help #upload-limit { font-size: 8px; }
  .welcome-state h2 { font-size: 34px; }
  .welcome-description { font-size: 11px; }
  .welcome-features { gap: 16px; }
  .welcome-illustration { width: 225px; }
  .welcome-features > span { font-size: 9px; }
  .composer-area { padding-left: 12px; padding-right: 12px; }
  .dialog-actions { flex-wrap: wrap; }
  .audio-card, .file-card { width: 270px; }
}
@media (max-height: 690px) and (max-width: 760px) {
  .welcome-illustration { width: 165px; margin: 5px 0; }
  .welcome-state h2 { font-size: 28px; }
  .welcome-description { margin-top: 10px; }
  .welcome-features { margin-top: 14px; }
  .starter-suggestions { margin-top: 17px; }
  .little-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
