﻿:root {
  color-scheme: light;
  --bg: #eef3f1;
  --panel: #ffffff;
  --soft: #f5f8f7;
  --line: #dce8e3;
  --line-strong: #bfd5cd;
  --text: #172b27;
  --muted: #667b75;
  --green: #00a884;
  --green-dark: #008069;
  --green-deep: #075e54;
  --green-ink: #063d35;
  --lime: #c9f27d;
  --bubble: #d9fdd3;
  --danger: #c94238;
  --shadow: 0 18px 46px rgba(20, 70, 59, .10);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, textarea { font: inherit; }

button {
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--soft); }
button:disabled { opacity: .5; cursor: not-allowed; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 3px solid rgba(0, 168, 132, .22);
  outline-offset: 2px;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: var(--panel);
  transition: border-color .16s ease, box-shadow .16s ease;
}

input { min-height: 48px; padding: 11px 13px; font-size: 15px; }
textarea { min-height: 150px; padding: 13px; font-size: 15px; line-height: 1.6; resize: vertical; }

input:focus, textarea:focus {
  border-color: rgba(0, 168, 132, .6);
  box-shadow: 0 0 0 4px rgba(0, 168, 132, .1);
}

.hidden { display: none !important; }

.app-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 20px 20px 36px;
}

.app-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--green-deep), var(--green-dark));
  box-shadow: 0 18px 42px rgba(0, 93, 78, .18);
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }

.brand-badge {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  background: rgba(255, 255, 255, .11);
}

.brand-badge svg { width: 31px; height: 31px; fill: rgba(255, 255, 255, .35); }
.brand-badge .brand-phone { fill: #fff; }
.brand-copy { min-width: 0; }
.brand h1 { margin: 0; font-size: 22px; line-height: 1.15; letter-spacing: -.03em; }
.brand p { margin: 3px 0 0; color: rgba(255, 255, 255, .72); font-size: 13px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
}

.status-pill.connected {
  color: var(--green-ink);
  background: var(--lime);
  border-color: rgba(201, 242, 125, .6);
}

.status-pill.connected::before {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.auth-card {
  width: min(560px, 100%);
  margin: 3vh auto 0;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 17px;
  color: var(--green-dark);
  background: #e8f7f2;
}

.auth-icon svg { width: 28px; height: 28px; fill: currentColor; }

.auth-kicker,
.eyebrow {
  margin: 0 0 7px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.auth-card h2,
.panel-title h2,
.composer-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -.035em;
}

.auth-copy { margin: 12px 0 25px; color: var(--muted); font-size: 16px; }

.auth-form { display: grid; gap: 16px; }

.field-label { display: grid; gap: 8px; color: var(--text); font-size: 14px; font-weight: 700; }

.primary-button,
.send-button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-color: var(--green);
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 28px rgba(0, 168, 132, .2);
}

.primary-button:hover:not(:disabled),
.send-button:hover:not(:disabled) {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.primary-button svg,
.send-button svg { width: 19px; height: 19px; fill: currentColor; }

.login-card {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: center;
  gap: 38px;
}

.login-steps {
  display: grid;
  gap: 13px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.login-steps li { display: flex; align-items: center; gap: 11px; }

.login-steps span {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--green-dark);
  background: #e8f7f2;
  font-size: 13px;
  font-weight: 800;
}

.qr-panel { display: grid; justify-items: center; gap: 15px; }

.qr-frame {
  width: min(310px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(18, 75, 63, .11);
}

.qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }

.login-note {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  border-color: var(--green-dark);
  color: var(--green-dark);
  background: var(--panel);
}

.secondary-button svg { width: 18px; height: 18px; fill: currentColor; }

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.contacts-card {
  position: sticky;
  top: 16px;
  height: calc(100vh - 128px);
  min-height: 650px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
}

.panel-title,
.composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title { margin-bottom: 18px; }

.step-badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #e8f7f2;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.tab {
  min-height: 46px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
}

.tab:hover { color: var(--text); background: rgba(255, 255, 255, .72); }
.tab.active { color: var(--green-dark); background: var(--panel); box-shadow: 0 5px 16px rgba(17, 71, 60, .09); }

.sync-note {
  min-height: 25px;
  padding: 10px 2px 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-wrap { position: relative; margin: 7px 0 12px; }

.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 19px;
  height: 19px;
  fill: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-wrap input {
  height: 50px;
  padding: 10px 14px 10px 43px;
  background: var(--soft);
  font-size: 14px;
}

.tab-panel { display: none; min-height: 0; flex: 1; }
.tab-panel.active { display: flex; flex-direction: column; }

.check-all {
  min-height: 46px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 11px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.check-all:hover { background: var(--soft); }
.check-all small { color: var(--muted); font-size: 11px; }

.check-all input,
.target input {
  width: 21px;
  height: 21px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--green);
  cursor: pointer;
}

.target-list,
.group-list,
.log-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.target-list { flex: 1; display: grid; align-content: start; gap: 5px; padding: 4px 1px 10px; }

.target {
  min-height: 68px;
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.target:hover { border-color: var(--line); background: var(--soft); }
.target.selected { border-color: rgba(0, 168, 132, .28); background: #eaf8f3; }

.target-text {
  min-width: 0;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.target-avatar,
.group-avatar {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 128, 105, .12);
  border-radius: 15px;
  color: var(--green-dark);
  background: #e8f7f2;
  font-size: 15px;
  font-weight: 800;
}

.target-title { min-width: 0; }
.target-name,
.group-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-phone,
.group-count {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.group-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #e8f7f2;
  font-size: 10px;
  font-weight: 750;
}

.group-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 3px 8px;
}

.group-toolbar p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }

.group-toolbar button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--green-dark);
  font-size: 12px;
}

.group-toolbar button svg { width: 16px; height: 16px; fill: currentColor; }

.group-list { flex: 1; display: grid; align-content: start; gap: 7px; padding: 2px 1px 10px; }

.group {
  min-height: 68px;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
}

.group:hover { background: var(--soft); }
.group.selected { border-color: rgba(0, 168, 132, .3); background: #eaf8f3; }
.group-details { min-width: 0; }
.group-actions { display: flex; gap: 5px; }

.mini-button {
  min-height: 42px;
  padding: 6px 8px;
  color: var(--green-dark);
  font-size: 11px;
}

.mini-button.danger { color: var(--danger); }

.editor {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}

.editor summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.editor summary::-webkit-details-marker { display: none; }
.editor summary::before { content: "+"; margin-right: 9px; font-size: 20px; line-height: 1; }
.editor[open] summary::before { content: "-"; }
.editor form { display: grid; gap: 13px; padding: 4px 13px 13px; }

.field-help,
.phone-preview {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.field-help code {
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--green-dark);
  background: #e8f7f2;
  font-family: inherit;
  font-weight: 700;
}

.phone-preview.invalid { color: var(--danger); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.form-actions button {
  min-height: 42px;
  padding: 8px 13px;
  border-color: var(--green);
  color: #fff;
  background: var(--green);
  font-size: 13px;
}

.form-actions button:hover { background: var(--green-dark); }
.form-actions #group-cancel { border-color: var(--line); color: var(--muted); background: var(--panel); }

.selection-footer {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(0, 168, 132, .17);
  border-radius: 14px;
  background: #eef9f5;
}

.selection-footer strong,
.selection-footer small { display: block; }
.selection-footer strong { font-size: 14px; }
.selection-footer small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.selection-footer button {
  min-height: 42px;
  padding: 7px 11px;
  color: var(--green-dark);
  font-size: 12px;
}

.composer-card { overflow: hidden; }

.composer-header {
  min-height: 82px;
  padding: 18px 21px;
  border-bottom: 1px solid var(--line);
}

.step-guide {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.step-guide strong {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--green-dark);
  background: #e8f7f2;
  font-size: 11px;
}

.step-guide span { width: 14px; height: 1px; background: var(--line-strong); }

.send-form {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.message-wrap { position: relative; }

.format-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
  background: var(--soft);
}

.format-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 15px;
}

.format-button:hover,
.format-button.active { color: var(--green-dark); background: var(--panel); }
.format-button.italic { font-style: italic; }
.format-button.strike { text-decoration: line-through; }
.format-button.code { font-family: Consolas, monospace; font-size: 12px; }
.format-button.emoji-button { margin-left: auto; font-size: 12px; }

.emoji-picker {
  position: absolute;
  z-index: 5;
  right: 7px;
  top: 54px;
  width: min(310px, calc(100% - 14px));
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: 0 18px 38px rgba(20, 70, 59, .15);
}

.emoji-picker button {
  min-width: 0;
  min-height: 35px;
  padding: 3px;
  border: 0;
  background: transparent;
  font-size: 19px;
}

.message-bubble {
  position: relative;
  min-height: 300px;
  padding: 21px;
  border: 1px solid rgba(0, 128, 105, .1);
  border-radius: 0 0 18px 18px;
  background: var(--bubble);
}

.message-bubble::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 0;
  width: 18px;
  height: 18px;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  background: var(--bubble);
}

.rich-message {
  min-height: 255px;
  outline: none;
  color: var(--text);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.72;
  overflow-y: auto;
}

.rich-message:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.rich-message blockquote {
  margin: 10px 0;
  padding: 7px 13px;
  border-left: 4px solid var(--green);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, .32);
}

.rich-message pre,
.rich-message code {
  border-radius: 7px;
  background: rgba(255, 255, 255, .5);
  font-family: Consolas, monospace;
}

.rich-message pre { padding: 11px; overflow-x: auto; }
.rich-message code { padding: 2px 5px; }
.rich-message pre code { padding: 0; background: transparent; }
.rich-message ul, .rich-message ol { padding-left: 25px; }

.file-label {
  min-height: 67px;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--soft);
  cursor: pointer;
}

.file-label:hover { border-color: var(--line-strong); background: #edf5f2; }

.file-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--green-dark);
  background: #dff3ec;
}

.file-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.file-copy strong, .file-copy small { display: block; }
.file-copy strong { font-size: 14px; }
.file-copy small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.file-label input { display: none; }

.browse-pill {
  padding: 8px 11px;
  border: 1px solid rgba(0, 128, 105, .17);
  border-radius: 10px;
  color: var(--green-dark);
  background: var(--panel);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.file-preview { min-height: 0; color: var(--green-dark); font-size: 13px; font-weight: 700; }

.delivery-panel,
.history-section {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--soft);
}

.delivery-panel summary,
.history-section > summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border-radius: 14px;
  cursor: pointer;
  list-style: none;
}

.delivery-panel summary::-webkit-details-marker,
.history-section > summary::-webkit-details-marker { display: none; }

.delivery-panel summary > span,
.history-section > summary > span { min-width: 0; }
.delivery-panel summary strong,
.history-section > summary strong { display: block; font-size: 14px; }
.delivery-panel summary small,
.history-section > summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.delivery-panel summary > svg,
.history-section > summary > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: var(--green-dark);
  transition: transform .15s ease;
}

.delivery-panel[open] summary > svg,
.history-section[open] > summary > svg { transform: rotate(180deg); }

.delivery-content {
  display: grid;
  gap: 13px;
  padding: 2px 15px 15px;
}

.delay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.delay-option {
  min-height: 61px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
}

.delay-option:has(input:checked) {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, .08);
}

.delay-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-ui {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  transition: all .2s ease;
}

.delay-option:has(input:checked) .radio-ui {
  border-color: var(--green);
  background: var(--green);
}

.delay-option:has(input:checked) .radio-ui::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.delay-copy strong,
.delay-copy small { display: block; }
.delay-copy strong { font-size: 13px; }
.delay-copy small { margin-top: 1px; color: var(--muted); font-size: 11px; }

.custom-delay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.custom-delay label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.custom-delay input { min-height: 42px; font-size: 14px; }

.eta-estimate {
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--green-dark);
  background: #e8f7f2;
  font-size: 13px;
  font-weight: 700;
}

.send-area { display: grid; gap: 10px; }

.progress-panel {
  padding: 12px;
  border: 1px solid rgba(0, 168, 132, .18);
  border-radius: 13px;
  background: #edf8f4;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
}

.progress-header span:last-child { color: var(--muted); text-align: right; }

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width .2s ease;
}

.send-button { width: 100%; }
.send-result { min-height: 20px; color: var(--green-dark); font-size: 13px; font-weight: 700; text-align: center; }

.history-content {
  display: grid;
  gap: 11px;
  padding: 1px 15px 15px;
}

.history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-actions p { margin: 0; color: var(--muted); font-size: 12px; }

.history-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--danger);
  font-size: 12px;
  white-space: nowrap;
}

.history-actions button svg { width: 16px; height: 16px; fill: currentColor; }

.log-list {
  max-height: 300px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.log {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  min-height: 49px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  font-size: 13px;
}

.log > span:first-child { min-width: 0; }
.log > span:last-child { max-width: 50%; color: var(--muted); text-align: right; }
.log.summary { border-color: rgba(0, 168, 132, .22); background: #edf8f4; }
.log.summary strong, .log-time { display: block; }
.log-time { margin-top: 2px; color: var(--muted); font-size: 11px; }
.log.failed > span:last-child { color: var(--danger); }

.empty {
  padding: 20px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(0, 128, 105, .16);
  border-radius: 13px;
  opacity: 0;
  color: var(--green-ink);
  background: var(--lime);
  box-shadow: 0 18px 42px rgba(20, 70, 59, .18);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.error { color: #fff; background: var(--danger); border-color: transparent; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(300px, 350px) minmax(0, 1fr); }
  .step-guide { display: none; }
  .delay-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .app-shell { padding: 0 0 26px; }
  .app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: 70px;
    margin-bottom: 10px;
    border-radius: 0;
    padding: 10px 13px;
  }
  .brand-badge { width: 45px; height: 45px; border-radius: 14px; }
  .brand-badge svg { width: 28px; height: 28px; }
  .brand h1 { font-size: 20px; }
  .brand p { display: none; }
  .status-pill { min-height: 38px; padding: 7px 10px; font-size: 11px; }
  .workspace { grid-template-columns: 1fr; gap: 10px; padding: 0 10px; }
  .contacts-card {
    position: static;
    height: auto;
    min-height: 0;
    padding: 16px;
  }
  .target-list, .group-list { max-height: 330px; }
  .composer-card { border-radius: 17px; }
  .composer-header { min-height: 72px; padding: 15px 16px; }
  .send-form { padding: 14px; }
  .message-bubble { min-height: 255px; padding: 17px; }
  .rich-message { min-height: 215px; }
  .auth-card { margin: 22px auto; padding: 25px; border-radius: 21px; }
  .auth-card h2, .panel-title h2, .composer-header h2 { font-size: 23px; }
  .login-card { grid-template-columns: 1fr; gap: 25px; }
  .login-steps { margin-top: 20px; }
}

@media (max-width: 520px) {
  .brand h1 { font-size: 18px; }
  .status-pill { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
  .panel-title { margin-bottom: 14px; }
  .step-badge { display: none; }
  .tab { min-height: 43px; font-size: 12px; }
  .check-all { font-size: 12px; }
  .target { min-height: 65px; }
  .target-text { grid-template-columns: 41px minmax(0, 1fr); }
  .target-avatar { width: 41px; height: 41px; border-radius: 13px; }
  .target-phone { grid-column: 2; margin-top: -7px; }
  .file-label { grid-template-columns: 42px minmax(0, 1fr); }
  .browse-pill { grid-column: 2; width: max-content; }
  .custom-delay { grid-template-columns: 1fr; }
  .history-actions { align-items: flex-start; flex-direction: column; }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

.remember-me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; user-select: none; }
.remember-me input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.logout-header-btn { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: transparent; color: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; margin-left: 8px; }
.logout-header-btn svg { width: 14px; height: 14px; }
.logout-header-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
