:root {
  font-family: Tahoma, "Segoe UI", sans-serif;
  color: #13241e;
  background: #eef4f1;
  color-scheme: light;
  --brand-950: #062b22;
  --brand-900: #0a382c;
  --brand-800: #145342;
  --brand-700: #1d6a54;
  --brand-100: #d9f1e7;
  --brand-50: #edf8f4;
  --gold: #e5b44f;
  --surface: #ffffff;
  --surface-soft: #f5f8f7;
  --canvas: #edf3f0;
  --line: #dbe6e1;
  --text: #13241e;
  --muted: #6a7b74;
  --danger: #a7352b;
  --info: #168bd2;
  --shadow-1: 0 1px 3px #05221914;
  --shadow-2: 0 10px 30px #0522191f;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --tap: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100dvh; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #2d8b6b35; outline-offset: 2px; }
button:disabled { opacity: .55; cursor: default; }
[hidden] { display: none !important; }
svg { display: block; }

/* Login */
.startup-shell { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 18%, #245b4d 0, var(--brand-950) 46%, #071d17 100%); }
.startup-card { display: grid; justify-items: center; gap: 12px; color: #fff; text-align: center; }
.startup-card img { filter: drop-shadow(0 10px 22px #0005); }
.startup-card strong { font-size: 25px; }
.startup-card span { color: #d5e6df; font-size: 14px; }
.startup-card button { min-height: 46px; padding: 0 24px; border-radius: 15px; background: #fff; color: var(--brand-950); font-weight: 800; }
.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 22% 12%, #3a6d5a 0, transparent 32%),
    radial-gradient(circle at 82% 88%, #173f34 0, transparent 35%),
    linear-gradient(145deg, #0d3d31, var(--brand-950));
}
.card { background: #ffFFfff8; border: 1px solid #ffffff8a; box-shadow: 0 28px 80px #00181066; backdrop-filter: blur(18px); }
.login-card { width: min(430px, 100%); padding: 38px 34px 32px; border-radius: 28px; display: grid; gap: 16px; text-align: center; }
.login-card > img { margin: 0 auto 4px; filter: drop-shadow(0 8px 14px #002b1d36); }
.login-card h1 { margin: 0; color: var(--brand-950); font-size: clamp(25px, 6vw, 33px); letter-spacing: -.7px; }
.login-card p { margin: 0 0 5px; color: var(--muted); }
.login-card label { display: grid; gap: 7px; text-align: right; color: #34483f; font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; height: 52px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 14px; background: var(--surface); color: var(--text); outline: 0; transition: border-color .18s, box-shadow .18s; }
.login-card input:focus { border-color: var(--brand-700); box-shadow: 0 0 0 4px #1d6a5418; }
.password-field { display: flex; direction: ltr; gap: 7px; }
.password-field input { flex: 1; min-width: 0; direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.password-field button { min-width: 88px; height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--radius-md); background: var(--brand-50); color: var(--brand-900); font-size: 12px; font-weight: 700; }
.password-field button svg { width: 20px; height: 20px; fill: currentColor; }
.login-card > button[type="submit"] { min-height: 54px; margin-top: 4px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--brand-800), var(--brand-950)); color: #fff; font-weight: 800; box-shadow: 0 9px 20px #0a382c33; }
.error { min-height: 21px; color: var(--danger); font-size: 13px; }

/* Application shell */
.app-shell { height: 100dvh; display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); direction: ltr; overflow: hidden; }
.sidebar, .chat-panel { direction: rtl; min-width: 0; }
.sidebar { display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.chat-panel { position: relative; display: flex; flex-direction: column; background: var(--canvas); }
.topbar { min-height: 72px; display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #fffffff2; border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); z-index: 2; }
.sidebar-header { padding-inline: 12px; }
.support-identity { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.support-identity img { flex: 0 0 auto; border-radius: 11px; box-shadow: var(--shadow-1); }
.support-identity span { min-width: 0; display: grid; gap: 2px; }
.support-identity strong { font-size: 17px; }
.support-identity small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: var(--tap); height: var(--tap); min-width: var(--tap); display: grid; place-items: center; padding: 0; border-radius: 50%; background: transparent; color: #29463b; transition: background .16s, transform .12s; }
.icon-button:active { transform: scale(.94); background: var(--brand-50); }
.icon-button svg { width: 24px; height: 24px; fill: currentColor; }

/* Inbox */
.search { position: relative; padding: 11px 12px; }
.search svg { position: absolute; z-index: 1; right: 26px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; fill: #75857e; pointer-events: none; }
.search input { width: 100%; height: 46px; padding: 0 45px 0 14px; border: 1px solid transparent; border-radius: 15px; background: var(--surface-soft); color: var(--text); outline: 0; }
.search input:focus { border-color: #2c816633; background: #fff; box-shadow: 0 0 0 4px #2c81660d; }
.conversation-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.conversation { width: 100%; min-height: 82px; display: grid; gap: 7px; padding: 13px 15px; border-radius: 0; border-bottom: 1px solid #eaf0ed; background: var(--surface); color: inherit; text-align: right; transition: background .15s; }
.conversation:active, .conversation.active { background: var(--brand-50); }
.conversation-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.conversation strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.conversation p { margin: 0; display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conversation > small { color: #829089; font-size: 11px; direction: ltr; text-align: right; }
.badge { min-width: 23px; height: 23px; display: inline-grid; place-items: center; padding: 0 7px; border-radius: 12px; background: var(--brand-700); color: #fff; font-size: 11px; font-weight: 800; }

/* Conversation header */
.chat-header { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; column-gap: 4px; direction: ltr; }
.chat-header::before { content: ""; grid-column: 1; grid-row: 1; }
.chat-header .back { grid-column: 3; grid-row: 1; }
.chat-header .back svg { width: 29px; height: 29px; }
.chat-header > div { grid-column: 2; grid-row: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-align: center; direction: rtl; }
.chat-header strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 1.4; }
.chat-header small { min-height: 16px; color: var(--muted); font-size: 11px; line-height: 16px; }
.empty-state { margin: auto; max-width: 360px; padding: 28px; color: var(--muted); text-align: center; line-height: 1.9; }
.back { display: none; }

/* Messages */
.messages { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 9px; padding: 18px clamp(12px, 3vw, 30px); overscroll-behavior: contain; }
.day-divider { align-self: center; margin: 4px 0; padding: 5px 11px; border: 1px solid #ccded7; border-radius: 9px; background: #e3efec; color: #556a62; box-shadow: var(--shadow-1); font-size: 11px; }
.message { max-width: min(76%, 620px); padding: 8px 10px; border-radius: 13px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.message.support { align-self: flex-start; border-bottom-left-radius: 5px; background: #d9f4e8; }
.message.customer { align-self: flex-end; border-bottom-right-radius: 5px; }
.message.failed { outline: 1px solid #c95649; background: #fff5f3; }
.message-body + .attachment-stack { margin-top: 9px; }
.attachment-stack { display: grid; gap: 9px; }
.attachment-stack > * { margin-top: 0 !important; border: 1px solid #c7ddd4; box-shadow: 0 1px 2px #082d2412; }
.message.support .attachment-stack > * { background: #f7fcfa; }
.message.customer .attachment-stack > * { background: #f8faf9; }
.attachment-stack .media-item .attachment { background: transparent; }
.attachment-stack .local-video, .attachment-stack .local-audio, .attachment-stack .local-file { background: #f8fcfa; }
.message-meta { display: flex !important; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 4px !important; color: #74847d !important; font-size: 10px !important; direction: ltr !important; line-height: 1; }
.message-meta time { direction: ltr; font-variant-numeric: tabular-nums; }
.receipt { padding-inline-end: 2px; color: #74847d; direction: ltr; font-family: Arial, sans-serif; font-weight: 800; letter-spacing: -3px; }
.receipt.read { color: var(--info); }
.retry-send { width: 100%; margin-top: 6px; padding: 8px 4px 2px; background: transparent; color: var(--danger); text-align: right; font-size: 12px; font-weight: 700; }
.send-error-detail { margin: 8px 0 0; padding: 7px 9px; border-radius: 9px; background: #fff0ed; color: #873129; font-size: 11px; line-height: 1.6; }
.failed-actions { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.failed-actions .retry-send, .failed-actions .discard-send { width: auto; min-height: 40px; margin: 0; padding: 7px 10px; border-radius: 10px; }
.discard-send { background: transparent; color: #6f7c77; font-size: 12px; }
.queued-actions { display: flex; justify-content: flex-end; margin-top: 7px; }
.cancel-send { min-height: 40px; padding: 7px 11px; border-radius: 10px; background: #ffffff8c; color: #7b4139; font-size: 12px; font-weight: 700; }
.local-attachment { margin-top: 6px; display: flex; align-items: center; gap: 7px; color: #315c4e; font-size: 12px; }
.local-image { position: relative; display: block; width: min(320px, 100%); max-width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: #dbe7e2; }
.local-image .media-preview { display: block; width: 100%; height: 100%; max-width: 100%; max-height: none; margin: 0; border-radius: 12px; object-fit: contain; }
.local-image::after { content: "در حال ارسال…"; position: absolute; right: 8px; bottom: 8px; padding: 4px 8px; border-radius: 9px; background: #082d24c9; color: #fff; font-size: 10px; line-height: 1.4; backdrop-filter: blur(5px); }
.local-image.local-unreadable { aspect-ratio: auto; min-height: 96px; display: grid; place-items: center; padding: 15px; background: #fff0ed; color: var(--danger); text-align: center; font-size: 11px; }
.local-image.local-unreadable::after { display: none; }
.local-video, .local-audio, .local-file { min-height: 44px; padding: 8px 10px; border-radius: 12px; background: #ffffff80; }
.inline-glyph { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; }
.inline-glyph svg { width: 20px; height: 20px; fill: currentColor; }

/* Message media */
.media-item { margin-top: 7px; overflow: hidden; border-radius: 12px; overflow-anchor: none; }
.media-item + .media-item { margin-top: 6px; }
.media-item .attachment { width: 100%; min-height: 46px; display: flex; align-items: center; margin: 0; padding: 10px 12px; border-radius: 12px; background: #ffffff8c; color: var(--brand-800); text-align: right; font-size: 12px; font-weight: 700; }
.media-image { position: relative; width: min(320px, 100%); max-width: 100%; aspect-ratio: 4 / 3; background: #dbe7e2; }
.media-image .attachment { width: 100%; height: 100%; min-height: 0; justify-content: center; color: var(--muted); font-weight: 400; }
.media-item .media-preview { display: block; max-width: 100%; margin: 0; border-radius: 12px; background: #dbe7e2; }
.media-image .media-preview { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.media-voice .media-preview, .media-audio .media-preview { width: min(310px, 100%); height: 42px; border-radius: 21px; background: #ffffff8c; }
.media-video .media-preview { width: 100%; max-height: 380px; background: #101615; }
.jump-latest { position: absolute; z-index: 12; right: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); translate: 50% 0; min-height: 42px; padding: 9px 15px; border: 1px solid #c9ddd5; border-radius: 22px; background: #fff; color: var(--brand-900); box-shadow: 0 7px 24px #092f2630; font-size: 12px; font-weight: 800; }
.jump-latest[hidden] { display: none; }

/* Composer */
.composer { flex: 0 0 auto; padding: 9px 10px max(9px, env(safe-area-inset-bottom)); border-top: 1px solid #d9e4df; background: #edf3f0ee; backdrop-filter: blur(18px); }
.composer-row { min-height: 54px; display: flex; align-items: center; gap: 7px; direction: rtl; }
.composer-icon, .primary-action { width: 50px; height: 50px; min-width: 50px; display: grid; place-items: center; padding: 0; border-radius: 50%; }
.composer-icon svg, .primary-action svg { width: 26px; height: 26px; fill: currentColor; }
.attach-button { align-self: center; background: transparent; color: #38544a; }
.attach-button:active, .inline-camera:active { background: #dce8e3; }
.text-shell { min-height: 50px; flex: 1; min-width: 0; display: flex; align-items: center; padding-inline: 3px; border: 1px solid #e1e8e5; border-radius: 25px; background: #fff; box-shadow: var(--shadow-1); }
.text-shell textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 140px; resize: none; padding: 13px 9px 10px; border: 0; outline: 0; background: transparent; color: var(--text); line-height: 23px; }
.text-shell textarea::placeholder { color: #8a9892; }
.inline-camera, .inline-voice { width: 44px; height: 44px; min-width: 44px; align-self: center; display: grid; place-items: center; padding: 0; border-radius: 50%; background: transparent; color: #52665e; }
.inline-camera svg, .inline-voice svg { width: 24px; height: 24px; fill: currentColor; }
.inline-voice { color: var(--brand-700); }
.inline-voice.limit-reached { color: #9aa6a1; background: #f1f4f3; }
.primary-action { background: linear-gradient(145deg, var(--brand-800), var(--brand-950)); color: #fff; box-shadow: 0 5px 13px #092f263d; transition: transform .12s, box-shadow .12s; }
.primary-action:active { transform: scale(.94); box-shadow: 0 2px 7px #092f263d; }
.primary-action svg { fill: #fff; }

/* Pending media and recording */
.pending-files { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 9px; scroll-snap-type: x proximity; }
.pending-files:empty { display: none; }
.pending-card { position: relative; flex: 0 0 110px; height: 78px; display: grid; place-items: center; overflow: hidden; border: 1px solid #d8e3de; border-radius: 13px; background: #dfeae6; scroll-snap-align: start; }
.pending-card img { width: 100%; height: 100%; object-fit: cover; }
.pending-card small { position: absolute; inset: auto 4px 4px; max-width: 100px; padding: 3px 5px; overflow: hidden; border-radius: 6px; background: #082d24db; color: #fff; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.pending-card > button { position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: #0b1814bd; color: #fff; font-size: 20px; }
.pending-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand-800); }
.pending-icon svg { width: 30px; height: 30px; fill: currentColor; }
.pending-card > button svg { width: 18px; height: 18px; fill: currentColor; }
.upload-progress { position: absolute; inset: auto 7px 7px; height: 24px; overflow: hidden; border-radius: 12px; background: #0b2f27d9; color: #fff; direction: ltr; }.upload-progress > span { position: absolute; inset: 0 auto 0 0; background: #2f9d76; transition: width .2s; }.upload-progress small { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; font-size: 10px; direction: rtl; }
.recording-bar { min-height: 58px; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid #e2e9e6; border-radius: 18px; background: #fff; box-shadow: var(--shadow-1); direction: rtl; }
.record-cancel { min-height: 44px; padding: 8px 10px; border-radius: 12px; background: #fff2f0; color: var(--danger); font-weight: 700; }
.record-finish { min-height: 44px; padding: 9px 16px; border-radius: 12px; background: var(--brand-900); color: #fff; font-weight: 700; }
.record-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #dc3328; animation: pulse 1s infinite; }
.recording-bar time { direction: ltr; font-variant-numeric: tabular-nums; }
.record-label { flex: 1; color: var(--muted); font-size: 11px; }
.composer.is-recording .composer-row { display: none; }

/* Attachment sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: #001a116e; backdrop-filter: blur(4px); }
.attachment-sheet { width: min(570px, 100%); padding: 8px max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); border: 1px solid #ffffff99; border-radius: 26px 26px 0 0; background: #ffFFfffa; box-shadow: 0 -20px 60px #00170f35; }
.sheet-handle { width: 42px; height: 5px; margin: 3px auto 10px; border-radius: 3px; background: #c2cdc8; }
.attachment-sheet header { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.attachment-sheet header strong { flex: 1; font-size: 18px; }
.attachment-sheet header button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: var(--surface-soft); color: #3c5048; }
.attachment-sheet header svg { width: 22px; height: 22px; fill: currentColor; }
.attachment-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 11px; }
.attachment-grid button { min-height: 94px; display: grid; place-items: center; gap: 6px; padding: 10px 5px; border: 1px solid #dfe9e5; border-radius: 17px; background: linear-gradient(145deg, #f7faf9, #edf5f2); color: #173d31; font-size: 12px; font-weight: 700; transition: transform .12s, border-color .12s; }
.attachment-grid button { grid-column: span 2; }
.attachment-grid button:nth-last-child(-n + 2) { grid-column: span 3; }
.attachment-grid button:active { transform: scale(.96); border-color: #9bc7b7; }
.attachment-grid span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-100); color: var(--brand-800); }
.attachment-grid svg { width: 25px; height: 25px; fill: currentColor; }

/* System feedback */
.admin-panel { position: fixed; inset: 0; z-index: 45; overflow: auto; background: #f1f6f3; color: var(--text); }
.admin-header { position: sticky; top: 0; z-index: 2; min-height: calc(72px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: #ffffffed; backdrop-filter: blur(18px); }
.admin-header > div { flex: 1; display: grid; gap: 2px; }.admin-header strong { font-size: 20px; }.admin-header small { color: var(--muted); }
.admin-content { width: min(1120px, 100%); margin: auto; padding: 22px; display: grid; grid-template-columns: minmax(270px, 350px) 1fr; gap: 20px; align-items: start; }
.admin-create { position: sticky; top: 96px; display: grid; gap: 12px; padding: 20px; }.admin-create h2,.admin-list-title h2 { margin: 0; font-size: 18px; }
.admin-create label,.admin-dialog label { display: grid; gap: 6px; color: #33483f; font-size: 12px; font-weight: 800; }
.admin-create input,.admin-create select,.admin-dialog input { min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text); }
.admin-create > button,.admin-dialog button[type="submit"] { min-height: 50px; border-radius: 14px; background: var(--brand-900); color: #fff; font-weight: 800; }
.admin-list-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }.admin-list-title h2 { flex: 1; }.admin-list-title button { min-height: 42px; padding: 0 14px; border-radius: 12px; background: #fff; color: var(--brand-900); }
.admin-users { display: grid; gap: 10px; }.admin-user { display: grid; grid-template-columns: minmax(150px,1fr) minmax(120px,.7fr) auto; gap: 10px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-1); }
.admin-user-main { min-width: 0; display: grid; gap: 3px; }.admin-user-main strong,.admin-user-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.admin-user-main small,.admin-user-stats { color: var(--muted); font-size: 11px; }.admin-user-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }.admin-user-actions button { min-height: 40px; padding: 0 10px; border-radius: 11px; background: var(--surface-soft); color: var(--brand-900); font-weight: 700; font-size: 11px; }.admin-user.inactive { opacity: .68; }
.admin-dialog { width: min(480px,calc(100% - 26px)); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 28px 90px #00150d55; }.admin-dialog::backdrop { background: #001a1178; backdrop-filter: blur(4px); }.admin-dialog form { position: relative; display: grid; gap: 13px; padding: 24px; }.admin-dialog h2,.admin-dialog p { margin: 0; }.dialog-close { position: absolute; top: 10px; left: 10px; width: 42px; height: 42px; border-radius: 50%; background: var(--surface-soft); font-size: 25px; }.session-row { display: grid; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--line); }.session-row button { justify-self: start; padding: 7px 10px; border-radius: 9px; background: #fff0ee; color: var(--danger); }
.network-banner { position: fixed; z-index: 60; top: 0; left: 50%; translate: -50% 0; width: min(520px, 100%); padding: max(9px, env(safe-area-inset-top)) 16px 9px; border-radius: 0 0 14px 14px; background: #963c31; color: #fff; box-shadow: var(--shadow-2); text-align: center; font-size: 12px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); translate: -50% 18px; max-width: min(440px, calc(100% - 28px)); padding: 11px 17px; border: 1px solid #ffffff24; border-radius: 13px; background: #102b23ee; color: #fff; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; text-align: center; transition: opacity .2s, translate .2s; }
.toast.show { opacity: 1; translate: -50% 0; }

@keyframes pulse { 50% { opacity: .45; } }

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar, .chat-panel { height: 100dvh; }
  .chat-panel { display: none; }
  .app-shell.chat-open .sidebar { display: none; }
  .app-shell.chat-open .chat-panel { display: flex; }
  .back { display: grid; }
  .topbar { padding-top: env(safe-area-inset-top); }
  .sidebar-header { min-height: calc(68px + env(safe-area-inset-top)); padding-inline: max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-left)); }
  .chat-header { height: calc(64px + env(safe-area-inset-top)); min-height: 64px; padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
  .messages { padding: 12px 9px; scroll-padding-bottom: 12px; }
  .message { max-width: 90%; }
  .composer { padding: 9px max(9px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left)); }
  .attachment-sheet { max-height: 78dvh; overflow: auto; }
  .conversation { padding: 13px 14px; }
  .admin-content { grid-template-columns: 1fr; padding: 14px; }.admin-create { position: static; }.admin-user { grid-template-columns: 1fr; }.admin-user-actions { justify-content: flex-start; }
}

@media (max-width: 380px) {
  .composer-row { gap: 4px; }
  .composer-icon, .primary-action { width: 46px; height: 46px; min-width: 46px; }
  .inline-camera, .inline-voice { width: 40px; height: 40px; min-width: 40px; }
  .attachment-grid { gap: 8px; }
  .attachment-grid button { min-height: 88px; }
  .record-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
