﻿:root { color-scheme: light; font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; background: #F6F7F9; color: #1B1F24; }
body { margin: 0; min-height: 100vh; }
.account-main { margin: 0; padding: 0; max-width: none; min-height: 75vh; }
.account-main h1 { margin: 0; font-size: 17px; font-weight: 600; }
.welcome { max-width: 480px; padding: 40px 24px; }
.status, .welcome p { color: #5B6470; }
.button { display: inline-block; padding: 12px 20px; border-radius: 8px; background: #1F5FBF; color: #FFF; text-decoration: none; }
.inbox-app { display: flex; flex-direction: column; min-height: calc(100dvh - var(--dxh-h, 64px) - var(--dxf-h, 56px)); font-family: Inter, system-ui, sans-serif; background: #F6F7F9; color: #1B1F24; font-size: 14px; }
.inbox-app *, .inbox-dialog * { box-sizing: border-box; }
.inbox-app button, .inbox-app input, .inbox-app select, .inbox-app textarea, .inbox-dialog button, .inbox-dialog input, .inbox-dialog select, .inbox-dialog textarea { font: inherit; color: inherit; }
.inbox-app button, .inbox-dialog button { min-height: 40px; padding: 0 14px; border: 1px solid #CDD2D8; border-radius: 8px; background: #FFF; cursor: pointer; }
.inbox-app .primary, .inbox-dialog .primary { border: 0; background: #1F5FBF; color: #FFF; font-weight: 600; }
.inbox-app .primary:hover, .inbox-dialog .primary:hover { background: #174A94; }
.inbox-app :disabled { cursor: default; opacity: .55; }
.inbox-app :focus-visible, .inbox-dialog :focus-visible, .button:focus-visible { outline: 3px solid #1F5FBF; outline-offset: 3px; }
.inbox-app input, .inbox-app select, .inbox-app textarea, .inbox-dialog input, .inbox-dialog select, .inbox-dialog textarea { min-width: 0; min-height: 40px; border: 1px solid #CDD2D8; border-radius: 8px; padding: 0 12px; background: #FFF; }
.inbox-app textarea, .inbox-dialog textarea { padding: 10px 12px; line-height: 1.5; resize: vertical; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.inbox-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 24px; background: #FFF; border-bottom: 1px solid #E3E6EA; }
.inbox-brand { display: flex; align-items: center; gap: 10px; flex: 1 1 180px; }
.inbox-brand strong { font-size: 18px; }
.inbox-brand span { color: #5B6470; font-size: 13px; }
.search-control { flex: 2 1 240px; max-width: 480px; }
.search-control input { width: 100%; padding: 0 14px; background: #F6F7F9; }
.toolbar-actions { display: flex; justify-content: flex-end; gap: 8px; flex: 1 1 280px; }
.simulation-banner { position: sticky; top: var(--dxh-h, 0px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 24px; background: #FFF4E5; color: #6B3D00; border-bottom: 1px solid #F3D6A8; }
.simulation-banner:empty { display: none; }
.inbox-status { margin: 0; padding: 8px 24px; background: #FFF; }
.inbox-status:empty { display: none; }
.inbox-shell { display: flex; flex: 1; min-height: 0; }
.thread-list { flex: 1 1 300px; max-width: 360px; min-width: 245px; background: #FFF; border-right: 1px solid #E3E6EA; display: flex; flex-direction: column; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
.filters button { min-height: 36px; padding: 0 12px; border-radius: 18px; font-size: 13px; }
.filters .active { border-color: #1B1F24; background: #1B1F24; color: #FFF; }
.inbox-app .thread-row { display: block; width: 100%; text-align: left; padding: 14px 16px; border: 0; border-top: 1px solid #EEF0F3; border-left: 3px solid transparent; border-radius: 0; }
.inbox-app .thread-row.selected { background: #EAF1FB; border-left-color: #1F5FBF; }
.thread-title { display: flex; justify-content: space-between; gap: 8px; }
.thread-title strong { font-size: 15px; overflow-wrap: anywhere; }
.thread-title time { font-size: 12px; color: #5B6470; }
.thread-preview { font-size: 13px; color: #3D4550; margin-top: 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.thread-row .badges { margin-top: 8px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.badge.customer { background: #E6F4EA; color: #1E5E2F; }
.badge.prospect { background: #EEE8F7; color: #4B2E83; }
.badge.replied { background: #1F5FBF; color: #FFF; }
.badge.neutral { background: #F0F1F3; color: #3D4550; }
.badge.stopped { background: #FBE9E7; color: #8A1C0C; }
.load-more { margin: 12px 16px; }
.conversation { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; background: #F6F7F9; }
.conversation-header { padding: 16px 24px; background: #FFF; border-bottom: 1px solid #E3E6EA; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.message-history { flex: 1; padding: 24px; display: flex; flex-direction: column; gap: 16px; overflow: auto; min-height: 220px; max-height: 55vh; }
.message { width: fit-content; max-width: min(100%, 560px); background: #FFF; border: 1px solid #E3E6EA; border-radius: 12px; padding: 14px 16px; overflow-wrap: anywhere; }
.message.outgoing { align-self: flex-end; }
.message.incoming { align-self: flex-start; background: #EAF1FB; border-color: transparent; }
.message-meta { font-size: 13px; color: #5B6470; margin-bottom: 6px; }
.incoming .message-meta { color: #3D4550; }
.message-text { white-space: pre-wrap; line-height: 1.5; margin-top: 4px; }
.composer { padding: 16px 24px; background: #FFF; border-top: 1px solid #E3E6EA; display: flex; flex-direction: column; gap: 10px; }
.composer-fields { display: flex; flex-direction: column; gap: 10px; }
.phone-control, .phone-simulation, .composer-toggle { display: none; }
.followup-schedule { display: none; align-self: stretch; border: 1px dashed #CDD2D8; border-radius: 12px; padding: 12px 14px; background: #FFF; font-size: 13px; }
.followup-day { color: #3D4550; line-height: 1.6; }
.followup-schedule strong + .followup-day { margin-top: 6px; }
.followup-stop { margin-top: 6px; color: #5B6470; font-size: 12px; }
.template-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.composer label { font-size: 13px; color: #3D4550; }
.composer-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cost-line { flex: 1 1 280px; font-size: 13px; color: #5B6470; }
.composer-footer button { min-height: 44px; padding: 0 18px; font-size: 15px; }
.contact-panel { flex: 1 1 260px; max-width: 320px; min-width: 220px; padding: 20px; display: flex; flex-direction: column; gap: 16px; border-left: 1px solid #E3E6EA; background: #FFF; overflow-wrap: anywhere; }
.contact-panel:empty { display: none; }
.panel-label { display: block; font-size: 12px; color: #5B6470; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.contact-email { color: #3D4550; }
.contact-panel input, .contact-panel select, .contact-panel textarea { width: 100%; margin-top: 6px; }
.contact-panel textarea { font-size: 13px; padding: 8px 10px; }
.contact-panel .danger { min-height: 44px; color: #8A1C0C; border-color: #E2B4AC; }
.contact-panel .erase { min-height: 44px; border: 0; background: transparent; color: #3D4550; font-size: 13px; text-decoration: underline; }
.notes { font-size: 13px; white-space: pre-wrap; }
.notes p { margin: 4px 0 8px; }
.notes time, .muted { font-size: 13px; color: #5B6470; }
.empty { padding: 24px; color: #5B6470; }
.inbox-dialog { max-width: min(480px, calc(100vw - 32px)); width: 100%; border: 1px solid #CDD2D8; border-radius: 12px; padding: 24px; background: #FFF; color: #1B1F24; }
.inbox-dialog::backdrop { background: rgb(27 31 36 / 45%); }
.inbox-dialog form { display: flex; flex-direction: column; gap: 10px; }
.inbox-dialog h2 { font-size: 18px; margin: 0 0 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.inbox-app [hidden] { display: none; }
@media (max-width: 900px) {
  .inbox-shell { flex-wrap: wrap; }
  .thread-list { flex-basis: 250px; }
  .conversation { flex-basis: 400px; }
  .contact-panel { flex-basis: 100%; max-width: none; border-top: 1px solid #E3E6EA; }
}
@media (max-width: 600px) {
  .inbox-app { width: 100%; min-width: 0; }
  .inbox-app button, .inbox-app input, .inbox-app select, .inbox-app textarea,
  .inbox-dialog button, .inbox-dialog input, .inbox-dialog select, .inbox-dialog textarea { min-height: 44px; min-width: 44px; max-width: 100%; }
  .inbox-app input, .inbox-app select, .inbox-app textarea, .inbox-dialog input, .inbox-dialog select, .inbox-dialog textarea { font-size: 16px; }
  .inbox-toolbar, .simulation-banner, .conversation-header, .composer { padding-left: 16px; padding-right: 16px; }
  .inbox-brand, .search-control, .toolbar-actions { min-width: 0; max-width: 100%; }
  .toolbar-actions { flex-wrap: wrap; justify-content: flex-start; }
  .inbox-shell { flex-direction: column; flex-wrap: nowrap; min-width: 0; }
  .thread-list { width: 100%; min-width: 0; max-width: none; flex-basis: auto; border-right: 0; }
  .thread-row, .thread-preview, .conversation-title { min-width: 0; overflow-wrap: anywhere; }
  .thread-title time { flex-shrink: 0; }
  .conversation { display: none; flex-basis: auto; width: 100%; }
  .contact-panel { display: none; }
  .inbox-app[data-screen="conversation"] .thread-list,
  .inbox-app[data-screen="contact"] .thread-list,
  .inbox-app[data-screen="conversation"] > .inbox-toolbar,
  .inbox-app[data-screen="contact"] > .inbox-toolbar,
  .inbox-app[data-screen="conversation"] > .simulation-banner { display: none; }
  .inbox-app[data-screen="conversation"] .conversation { display: flex; height: calc(100dvh - var(--dxh-h, 64px)); min-height: 640px; }
  .inbox-app[data-screen="contact"] .contact-panel { display: flex; width: 100%; min-width: 0; }
  .conversation-header { flex-wrap: nowrap; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .conversation-title { flex: 1; }
  .conversation-title .muted { font-size: 12px; }
  .account-main .conversation-header h1 { font-size: 16px; }
  .conversation-header > .badges { display: none; }
  .inbox-app .phone-control { display: flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 44px; min-height: 44px; border: 0; padding: 0; background: transparent; }
  .inbox-app .phone-back, .inbox-app .phone-info { width: 44px; height: 44px; font-size: 28px; }
  .phone-simulation { display: block; padding: 8px 16px; background: #FFF4E5; color: #6B3D00; font-size: 13px; }
  .message-history { padding: 16px; gap: 12px; min-height: 120px; max-height: none; }
  .message.pending-followup { display: none; }
  .followup-schedule { display: block; }
  .message { max-width: min(100%, 300px); padding: 12px 14px; }
  .message-meta { font-size: 12px; margin-bottom: 4px; }
  .composer { padding-top: 12px; padding-bottom: max(20px, env(safe-area-inset-bottom)); flex-shrink: 0; }
  .composer-toggle { display: block; width: 100%; font-size: 13px; }
  .composer-options[data-expanded="false"] .composer-fields { display: none; }
  .message-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .composer-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .cost-line { flex: none; font-size: 12px; }
  .composer-footer button { min-height: 48px; }
  .dialog-actions { flex-wrap: wrap; }
}
