:root {
    --background: #f3f6fb;
    --primary: #356be7;
    --primary-hover: #2558cb;
    --primary-soft: #edf3ff;
    --foreground: #23334d;
    --muted-foreground: #718098;
    --border: #e8edf4;
    --chat-background: #f7f9fc;
    --outgoing: #eaf1ff;
}

:root.dark {
    --background: #101827;
    --primary: #85acff;
    --primary-hover: #adc7ff;
    --primary-soft: #233454;
    --foreground: #e3eaf7;
    --muted-foreground: #a0adc3;
    --border: #2a374d;
    --card: #172235;
    --chat-background: #111c2d;
    --outgoing: #233858;
}

.dropline-app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.skip-link { position: fixed; top: -80px; inset-inline-start: 16px; z-index: 100; padding: 10px 16px; background: var(--card); border: 1px solid var(--primary); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.dropline-header { height: 88px; flex: 0 0 88px; display: flex; align-items: center; gap: 24px; padding: 0 36px; }
.dropline-brand { display: flex; align-items: center; gap: 12px; }
.dropline-mark { width: 43px; height: 43px; display: grid; place-items: center; background: #356be7; color: white; border-radius: 14px; box-shadow: 0 5px 12px #356be724; }
.dropline-brand strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.dropline-brand small { color: var(--muted-foreground); font-size: 11px; }
.dropline-organization { color: var(--muted-foreground); font-size: 12px; border-inline-start: 1px solid var(--border-strong); padding-inline-start: 24px; }
.dropline-account { display: flex; align-items: center; gap: 16px; margin-inline-start: auto; }
.account-trigger { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.account-name { font-size: 13px; }
.dropline-account .dropdown-menu { left: 0; right: auto; z-index: 50; }
.dropline-main { flex: 1; min-height: 0; padding: 0 28px 26px; }
.messenger { height: 100%; min-height: 0; display: grid; grid-template-columns: 330px minmax(0, 1fr); background: var(--card); border: 1px solid var(--border); border-radius: 19px; overflow: hidden; box-shadow: 0 8px 40px #1e365b05; }
.conversation-sidebar { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--border); background: var(--card); }
.conversation-sidebar__heading { display: flex; justify-content: space-between; align-items: center; padding: 27px 24px 18px; }
.section-eyebrow { font-size: 11px; color: var(--muted-foreground); }
.conversation-sidebar h1 { font-size: 23px; letter-spacing: -.7px; margin: 4px 0 0; line-height: 1.5; }
.conversation-sidebar .new-conversation { margin: 0 22px 21px; min-height: 44px; border-radius: 10px; font-size: 13px; }
.conversation-search { display: flex; align-items: center; gap: 9px; margin: 0 22px 15px; padding: 0 12px; min-height: 43px; border-radius: 10px; background: var(--chat-background); color: var(--muted-foreground); border: 1px solid transparent; }
.conversation-search:focus-within { border-color: var(--primary); }
.conversation-search input { min-width: 0; width: 100%; outline: none; border: 0; background: transparent; font-size: 11px; height: 42px; }
.conversation-search input::placeholder { color: var(--muted-foreground); opacity: 1; }
.conversation-filters { display: flex; gap: 6px; padding: 0 22px 18px; border-bottom: 1px solid var(--border); }
.conversation-filters button { flex: 1; padding: 7px 9px; border-radius: 8px; background: transparent; font-size: 12px; color: var(--muted-foreground); cursor: pointer; }
.conversation-filters button:hover { background: var(--chat-background); }
.conversation-filters button.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; padding: 9px; scrollbar-width: thin; }
.conversation-row { width: 100%; display: flex; gap: 11px; align-items: center; padding: 15px 12px; text-align: start; border-radius: 11px; background: transparent; cursor: pointer; margin-bottom: 3px; transition: background .15s; }
.conversation-row:hover { background: var(--chat-background); }
.conversation-row.is-selected { background: var(--primary-soft); }
.conversation-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 16px; background: #ecedf8; color: #6969aa; font-size: 14px; font-weight: 600; }
.conversation-row:nth-of-type(3n + 2) .conversation-avatar { background: #e5f3ed; color: #45816b; }
.conversation-row:nth-of-type(3n + 3) .conversation-avatar { background: #fff0e5; color: #a67a4f; }
.dark .conversation-avatar { background: #323754; color: #c4c4ee; }
.dark .conversation-row:nth-of-type(3n + 2) .conversation-avatar { background: #233f3c; color: #acdac7; }
.dark .conversation-row:nth-of-type(3n + 3) .conversation-avatar { background: #473c36; color: #e9caad; }
.conversation-row__copy { display: block; min-width: 0; flex: 1; }
.conversation-row__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.conversation-row__title strong { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-row__title time { font-size: 9px; color: var(--muted-foreground); white-space: nowrap; }
.conversation-row__preview { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted-foreground); }
.conversation-row__preview > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.conversation-sidebar__footer { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px 10px; color: var(--muted-foreground); border-top: 1px solid var(--border); font-size: 10px; }
.conversation-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--chat-background); }
.conversation-header { display: flex; align-items: center; gap: 13px; padding: 17px 27px; min-height: 82px; flex-shrink: 0; background: var(--card); border-bottom: 1px solid var(--border); }
.conversation-header__copy { flex: 1; min-width: 0; }
.conversation-header h2 { margin: 0 0 3px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-header p { color: var(--muted-foreground); margin: 0; font-size: 11px; text-align: right; overflow-wrap: anywhere; }
.conversation-header .conversation-avatar--new { background: var(--primary-soft); color: var(--primary); }
.conversation-back { display: none; }
.conversation-history { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 32px; scrollbar-width: thin; display: flex; flex-direction: column; align-items: stretch; }
.conversation-date { text-align: center; margin: 8px 0 22px; font-size: 10px; color: var(--muted-foreground); }
.conversation-date span { display: inline-block; background: var(--card); border: 1px solid var(--border); padding: 4px 13px; border-radius: 20px; }
.file-message { width: min(460px, 88%); flex-shrink: 0; padding: 14px; border: 1px solid var(--border); border-radius: 15px; margin-bottom: 18px; background: var(--card); }
.file-message--outgoing { align-self: flex-start; background: var(--outgoing); border-color: transparent; border-bottom-right-radius: 4px; }
.file-message--incoming { align-self: flex-end; border-bottom-left-radius: 4px; }
.file-message__sender { display: block; color: var(--primary); font-size: 10px; font-weight: 600; margin: 0 1px 9px; }
.file-message__text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.9; margin: 0 1px 12px; text-align: start; }
.attachment-card { display: flex; align-items: center; gap: 11px; padding: 12px; min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 7px; }
.attachment-icon { width: 43px; min-height: 49px; flex-shrink: 0; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--primary-soft); color: var(--primary); }
.attachment-icon small { font-size: 8px; max-width: 39px; overflow: hidden; }
.attachment-copy { min-width: 0; flex: 1; }
.attachment-copy strong { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-size: 12px; font-weight: 500; text-align: start; }
.attachment-copy small { display: block; width: fit-content; color: var(--muted-foreground); font-size: 10px; margin-top: 6px; }
.attachment-download { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--primary); font-size: 9px; padding: 6px; border-radius: 7px; flex-shrink: 0; }
.attachment-download:hover { background: var(--primary-soft); }
.file-message__meta { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 9px; padding: 5px 1px 0; }
.message-status { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); }
.revoke-button { font-size: 9px; background: transparent; color: var(--muted-foreground); margin-inline-start: auto; cursor: pointer; padding: 4px; border-radius: 4px; }
.revoke-button:hover { color: var(--danger); background: var(--danger-soft); }
.transfer-composer { flex-shrink: 0; margin: 0; background: var(--card); padding: 17px 24px 12px; border-top: 1px solid var(--border); }
.recipient-field { display: flex; align-items: center; gap: 15px; border: 1px solid var(--border); padding: 12px 15px; border-radius: 10px; margin-bottom: 15px; }
.recipient-field label { display: flex; gap: 7px; align-items: center; font-size: 12px; white-space: nowrap; }
.recipient-field input { min-width: 0; flex: 1; outline: 0; border: 0; background: transparent; font-size: 12px; }
.recipient-field:focus-within { border-color: var(--primary); box-shadow: var(--focus-ring); }
.composer-controls { display: flex; align-items: center; gap: 12px; }
.attach-button { position: relative; display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 7px; height: 46px; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; color: var(--primary); cursor: pointer; font-size: 11px; overflow: hidden; }
.attach-button:hover { background: var(--primary-soft); }
.attach-button input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; cursor: pointer; }
.attach-button:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.attach-button.is-disabled { opacity: .5; }
.composer-controls textarea { flex: 1; min-width: 0; height: 46px; max-height: 100px; background: var(--chat-background); border: 1px solid var(--border); border-radius: 10px; padding: 12px; resize: vertical; font-size: 12px; outline: none; }
.composer-controls textarea:focus { border-color: var(--primary); }
.send-button { min-height: 46px; border-radius: 10px; font-size: 12px; gap: 8px; white-space: nowrap; }
.composer-hint { display: flex; justify-content: space-between; gap: 10px; padding-top: 9px; font-size: 9px; color: var(--muted-foreground); }
.staged-files { display: grid; gap: 7px; max-height: 175px; overflow-y: auto; margin-bottom: 12px; }
.staged-file { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; }
.staged-file__icon { color: var(--primary); }
.staged-file > div { min-width: 0; flex: 1; }
.staged-file strong { display: block; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.staged-file small { display: block; color: var(--muted-foreground); font-size: 10px; margin-top: 3px; }
.staged-file > .icon { color: var(--primary); }
.transfer-progress { display: flex; align-items: center; gap: 9px; font-size: 11px; margin: 10px 0; color: var(--primary); }
.transfer-progress progress { flex: 1; min-width: 40px; height: 5px; accent-color: var(--primary); }
.composer-error { display: flex; gap: 8px; color: var(--danger); background: var(--danger-soft); font-size: 12px; padding: 12px; margin-bottom: 12px; border-radius: 8px; }
.composer-error .icon { flex-shrink: 0; }
.messenger-error { display: grid; justify-items: center; text-align: center; color: var(--danger); font-size: 12px; padding: 20px; }
.messenger-error p, .message-error p { margin: 8px 0; }
.message-error { color: var(--danger); font-size: 12px; }
.messenger-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 24px; color: var(--muted-foreground); font-size: 12px; flex-shrink: 0; }
.load-more { display: block; flex-shrink: 0; width: fit-content; margin: 12px auto; color: var(--primary); font-size: 11px; background: var(--card); border: 1px solid var(--border); padding: 8px 17px; border-radius: 20px; cursor: pointer; }
.list-empty { text-align: center; padding: 40px 18px; color: var(--muted-foreground); }
.list-empty > .icon { margin: 0 auto 15px; opacity: .7; }
.list-empty strong { display: block; font-size: 13px; font-weight: 500; color: var(--foreground); }
.list-empty p { font-size: 11px; line-height: 1.9; margin: 9px 0 0; }
.muted-copy { color: var(--muted-foreground); font-size: 11px; }
.messenger-welcome { display: flex; flex: 1; flex-direction: column; justify-content: center; align-items: center; padding: 35px; text-align: center; overflow-y: auto; }
.welcome-eyebrow { font-size: 11px; letter-spacing: 1px; color: var(--muted-foreground); margin-bottom: 18px; }
.welcome-illustration { width: 230px; height: 180px; position: relative; margin-bottom: 22px; flex-shrink: 0; }
.welcome-orbit { position: absolute; width: 166px; height: 166px; inset: 4px 30px; border: 1px dashed #bdcfea; border-radius: 50%; }
.welcome-file { position: absolute; width: 82px; height: 103px; border: 1px solid var(--border); background: var(--card); border-radius: 14px; padding: 16px; color: var(--primary); box-shadow: 0 12px 25px #2a4c8510; }
.welcome-file--back { top: 30px; left: 35px; transform: rotate(-13deg); color: #7d95a9; }
.welcome-file--front { top: 54px; left: 108px; transform: rotate(10deg); }
.welcome-file i { display: block; height: 3px; margin-top: 9px; background: var(--border); border-radius: 2px; }
.welcome-file i:last-child { width: 65%; margin-top: 5px; }
.welcome-send { position: absolute; bottom: 7px; left: 74px; display: grid; place-items: center; width: 46px; height: 46px; background: #356be7; color: white; border-radius: 15px; border: 4px solid var(--chat-background); }
.messenger-welcome h2 { font-size: clamp(23px, 2.4vw, 34px); letter-spacing: -1px; line-height: 1.8; margin: 0 0 13px; font-weight: 600; }
.messenger-welcome h2 span { color: var(--primary); }
.messenger-welcome p { font-size: 12px; line-height: 2; color: var(--muted-foreground); margin-bottom: 25px; }
.messenger-welcome .button { min-height: 44px; border-radius: 10px; font-size: 12px; padding-inline: 24px; }
.welcome-steps { display: flex; gap: 25px; margin-top: 45px; color: var(--muted-foreground); font-size: 10px; }
.welcome-steps span { display: flex; align-items: center; gap: 7px; }
.welcome-steps b { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--border-strong); border-radius: 50%; font-size: 9px; font-weight: 400; }
.new-transfer-intro { display: flex; flex: 1; min-height: 100px; flex-direction: column; align-items: center; justify-content: center; padding: 28px; overflow: auto; text-align: center; }
.intro-symbol { background: var(--primary-soft); color: var(--primary); width: 80px; height: 80px; border-radius: 25px; display: grid; place-items: center; margin-bottom: 24px; flex-shrink: 0; }
.new-transfer-intro h2 { font-size: 23px; margin-bottom: 10px; }
.new-transfer-intro p { color: var(--muted-foreground); font-size: 12px; line-height: 2; margin: 0; }
.transfer-composer--new { margin: 0 28px 28px; border: 1px solid var(--border); border-radius: 13px; padding: 20px; }
.dropline-app button:disabled { cursor: not-allowed; }
.dropline-app :is(button, a, summary):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.dropline-auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.dropline-auth__header { display: flex; align-items: center; justify-content: space-between; padding: 28px 36px; }
.dropline-auth__main { display: grid; flex: 1; align-items: center; justify-items: center; padding: 30px 20px; }
.dropline-auth .auth-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: 0 12px 40px #24375808; }
.dropline-auth .auth-card__header h1 { font-size: 23px; margin: 0 0 13px; letter-spacing: -.6px; }
.dropline-auth .auth-card__header p { font-size: 13px; line-height: 2; }
.dropline-auth .field label { font-size: 12px; }
.dropline-auth .input-with-icon { min-height: 48px; padding-inline: 12px; gap: 9px; }
.dropline-auth .input-with-icon input { font-size: 12px; }
.dropline-auth .button { min-height: 46px; font-size: 13px; }
.dropline-auth > footer { padding: 25px; text-align: center; color: var(--muted-foreground); font-size: 11px; }

@media (min-width: 1500px) {
    .dropline-main { width: 100%; max-width: 1600px; margin-inline: auto; }
    .dropline-header { width: 100%; max-width: 1600px; margin-inline: auto; }
    .messenger { grid-template-columns: 355px minmax(0, 1fr); }
}

@media (max-width: 1000px) {
    .dropline-header { padding-inline: 22px; }
    .dropline-main { padding: 0 16px 16px; }
    .messenger { grid-template-columns: 290px minmax(0, 1fr); }
    .conversation-history { padding: 18px; }
    .file-message { width: 95%; }
    .transfer-composer { padding-inline: 15px; }
    .attach-button span { display: none; }
    .transfer-composer--new { margin: 0 16px 16px; }
    .welcome-steps { gap: 13px; }
}

@media (max-width: 720px) {
    .dropline-header { height: 70px; flex-basis: 70px; padding: 0 17px; gap: 12px; background: var(--card); border-bottom: 1px solid var(--border); }
    .dropline-brand { gap: 9px; }
    .dropline-brand strong { font-size: 17px; }
    .dropline-brand small { font-size: 9px; }
    .dropline-mark { width: 35px; height: 35px; border-radius: 11px; }
    .dropline-organization, .account-name { display: none; }
    .dropline-account { gap: 9px; }
    .dropline-main { padding: 0; }
    .messenger { display: flex; border: none; border-radius: 0; }
    .conversation-sidebar { width: 100%; border: 0; }
    .conversation-sidebar__heading { padding-top: 20px; }
    .conversation-sidebar__footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .conversation-row { padding-block: 16px; }
    .conversation-row__title strong { font-size: 14px; }
    .conversation-row__preview { font-size: 12px; }
    .conversation-panel { display: none; width: 100%; }
    .messenger--conversation-open .conversation-sidebar { display: none; }
    .messenger--conversation-open .conversation-panel { display: flex; }
    .conversation-header { min-height: 74px; padding: 12px 14px; gap: 9px; }
    .conversation-back { display: grid; }
    .conversation-header .conversation-avatar { width: 38px; height: 38px; flex-basis: 38px; border-radius: 13px; }
    .conversation-header h2 { font-size: 14px; }
    .conversation-history { padding: 12px 14px; }
    .file-message { width: min(430px, 94%); padding: 11px; }
    .attachment-card { padding: 9px; gap: 8px; }
    .attachment-copy strong { font-size: 11px; }
    .transfer-composer { padding: 12px 12px max(10px, env(safe-area-inset-bottom)); }
    .composer-controls { gap: 7px; }
    .attach-button { width: 41px; padding: 0; height: 44px; }
    .composer-controls textarea { padding: 11px 9px; height: 44px; font-size: 12px; }
    .send-button { min-height: 44px; padding: 0 11px; }
    .send-button span { display: none; }
    .composer-hint { font-size: 8px; }
    .recipient-field { padding: 11px; gap: 9px; }
    .recipient-field input { font-size: 11px; }
    .new-transfer-intro { padding: 22px 16px; }
    .new-transfer-intro h2 { font-size: 20px; }
    .intro-symbol { width: 62px; height: 62px; border-radius: 20px; margin-bottom: 18px; }
    .transfer-composer--new { margin: 0 12px 15px; padding: 14px; }
    .staged-files { max-height: 140px; }
}

@media (max-height: 650px) {
    .welcome-illustration { height: 135px; transform: scale(.8); margin: -10px 0 4px; }
    .welcome-eyebrow { display: none; }
    .welcome-steps { margin-top: 20px; }
    .messenger-welcome { padding: 20px; }
    .messenger-welcome h2 { font-size: 23px; }
    .new-transfer-intro .intro-symbol { display: none; }
    .new-transfer-intro { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .dropline-app *, .dropline-app *::before, .dropline-app *::after { scroll-behavior: auto; transition: none; }
}
