.dialog { width: min(530px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; overscroll-behavior: contain; color: var(--text); background: #111f25; border: 1px solid #344a52; border-radius: 18px; padding: 22px; box-shadow: 0 25px 110px #000b; }
.dialog::backdrop { background: #03090ccf; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.dialog-head h2 { font-size: clamp(1.33rem, 4vw, 1.65rem); overflow-wrap: anywhere; }
.icon-button { padding: 7px; min-height: 35px; background: #203039; color: var(--text); }
.form { display: grid; gap: 11px; }
.form + .text-button, .auth-switch + .text-button { margin-top: 12px; }
.form-message { color: #ffc4ad; font-size: .91rem; margin-block: 1px 5px; }
.form-message:empty { display: none; }
.field { display: grid; gap: 5px; min-width: 0; font-size: .91rem; font-weight: 620; }
.field small { color: var(--muted); font-weight: 450; font-size: .82rem; }
.field input, .field select, .field textarea, .sort select { min-height: 41px; width: 100%; min-width: 0; padding: 8px 10px; color: var(--text); background: #0e1a20; border: 1px solid #334b54; border-radius: 8px; }
.field textarea { min-height: 90px; resize: vertical; }
select { appearance: none; padding-right: 32px !important; background-image: linear-gradient(45deg, transparent 50%, #b4cece 50%), linear-gradient(135deg, #b4cece 50%, transparent 50%) !important; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50% !important; background-size: 5px 5px !important; background-repeat: no-repeat !important; }
.checkbox { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; }
.checkbox input { margin: 0; flex-shrink: 0; width: 15px; height: 15px; accent-color: var(--accent); }
.phone { display: flex; gap: 8px; align-items: center; }
.dial { padding: 8px; border: 1px solid var(--line); border-radius: 7px; white-space: nowrap; }
.submit { justify-self: stretch; margin-top: 2px; }
.social, .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.social { margin-top: 15px; }
.callback-address { display: block; overflow-wrap: anywhere; color: var(--accent-strong); }
.auth-switch { margin-top: 14px; color: var(--muted); font-size: .91rem; }
.quote { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.quote dd { margin: 0; text-align: right; font-weight: 700; }
.dashboard { display: grid; gap: 15px; }
.dashboard h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin-top: 4px; }
.dashboard h2 { font-size: 1.25rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 15px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; display: grid; align-content: start; gap: 10px; min-width: 0; }
.balance { background: linear-gradient(120deg, #173731, #13232a); }
.balance > strong { color: var(--accent-strong); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; }
.records { padding: 0; margin: 0; list-style: none; }
.records li { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.records li > span:last-child { flex-shrink: 0; text-align: right; }
.staff { max-width: 800px; }

@media (max-width: 660px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dialog { padding: 16px; }
  .records li { flex-wrap: wrap; }
}

.chat-history { display: grid; gap: 8px; max-height: 48vh; overflow-y: auto; margin: 0; padding: 10px 0; list-style: none; }
.chat-message { justify-self: start; width: fit-content; max-width: 90%; padding: 8px 13px; background: #182b34; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.chat-message.mine { justify-self: end; background: #12392e; }
.chat-message p { white-space: pre-wrap; }
.chat-attachment { margin: 5px 0; }
.chat-attachment audio { max-width: 100%; }
.support-image { display: block; max-width: 100%; max-height: 280px; border-radius: 8px; }
.chat-tools, .call-bar { display: grid; gap: 8px; }
.chat-tools input[type="file"] { width: 100%; }
.call-bar:empty { display: none; }
.voice-waveform { display: block; width: min(100%, 280px); height: 32px; border-radius: 6px; background: #12282a; }
