:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #e9eef6;
  --text: #182033;
  --muted: #687386;
  --faint: #8b95a6;
  --line: #dce3ed;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #12a56b;
  --red: #dc4c4c;
  --shadow: 0 12px 28px rgba(28, 39, 61, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition:
    transform 150ms var(--ease),
    background 160ms var(--ease),
    color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    opacity 160ms var(--ease);
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  width: min(100%, 420px);
  max-width: 100%;
  min-height: 100vh;
  overflow-x: clip;
  margin: 0 auto;
  padding: 10px 16px calc(92px + var(--safe-bottom));
  background: var(--bg);
}

body.locked .app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

body.locked .topNav,
body.locked .screen,
body.locked .tabBar {
  display: none !important;
}

body.locked #authNotice {
  width: min(100%, 360px);
  display: grid !important;
  margin: 0;
  text-align: center;
}

.topNav {
  min-height: 42px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.app.detailMode .topNav {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 50;
  width: min(100%, 420px);
  min-height: calc(54px + var(--safe-top));
  margin: 0;
  padding: calc(10px + var(--safe-top)) 16px 8px;
  border-bottom: 1px solid rgba(220, 227, 237, 0.76);
  background: rgba(238, 242, 247, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 20px rgba(28, 39, 61, 0.08);
  transform: translateX(-50%);
}

.app.detailMode [data-screen="detail"] {
  padding-top: calc(56px + var(--safe-top));
}

.topAction,
.circleAction {
  border: 0;
  background: transparent;
  color: var(--blue);
}

.topAction {
  justify-self: start;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(28, 39, 61, 0.08);
}

.topAction svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.35;
}

.circleAction {
  justify-self: end;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 7px 18px rgba(28, 39, 61, 0.07);
}

.circleAction:hover {
  border-color: rgba(37, 99, 235, 0.24);
  background: #e7efff;
  box-shadow: 0 9px 22px rgba(37, 99, 235, 0.12);
}

.circleAction svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
  transform-origin: center;
}

.topAction:hover {
  background: #e7efff;
}

.circleAction.loading svg {
  animation: refresh-spin 900ms linear infinite;
  will-change: transform;
}

.refreshStatus {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.notice {
  display: grid;
  gap: 4px;
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notice span {
  color: var(--muted);
  font-size: 14px;
}

.screen {
  animation: fadeIn 180ms var(--ease) both;
}

.summaryPanel,
.generationPanel,
.filterPanel,
.batchPanel,
.profilePanel,
.leadRow,
.detailHero,
.scoreCard,
.infoCards,
.timelineCard,
.textCard,
.formCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summaryPanel {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin: 0;
}

.overviewGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(118px, 0.75fr);
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}

.screen,
.generationPanel,
.overviewGrid,
.summaryPanel,
.filterPanel,
.infoCards,
.timelineCard,
.textCard,
.socialCard,
.copyCard {
  min-width: 0;
  max-width: 100%;
}

.overviewGrid > *,
.summaryHeader > *,
.socialHeader > * {
  min-width: 0;
}

.summaryHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.summaryHeader strong {
  display: block;
  font-size: 18px;
  line-height: 24px;
}

.summaryHeader span,
.readyMetric span,
.readyMetric small,
.sectionLabel {
  color: var(--muted);
  font-size: 12px;
}

.readyMetric {
  min-width: 56px;
  text-align: right;
}

.readyMetric strong {
  display: block;
  color: var(--green);
  font-size: 18px;
  line-height: 24px;
}

.readyMetric small {
  display: block;
  margin-top: 1px;
}

.sectionLabel {
  font-weight: 850;
  text-transform: uppercase;
}

.statusFilters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.statusFiltersDetails {
  padding-top: 2px;
  animation: slideFadeIn 160ms var(--ease) both;
}

.statusFilters button {
  min-width: 0;
  min-height: 46px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 4px 2px;
}

.statusFilters button strong {
  color: var(--text);
  font-size: 16px;
  line-height: 20px;
}

.statusFilters button span {
  overflow: hidden;
  max-width: 100%;
  font-size: 9px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusFilters button.active {
  border-color: rgba(37, 99, 235, 0.28);
  background: #e7efff;
  color: var(--blue-dark);
}

.statusDetailsToggle {
  min-width: 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 7px 9px;
  text-align: left;
}

.statusDetailsToggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  justify-self: center;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms var(--ease);
}

.statusDetailsToggle.active {
  border-color: rgba(37, 99, 235, 0.22);
  background: #eef5ff;
  color: var(--blue-dark);
}

.statusDetailsToggle.active::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.statusDetailsToggle span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusDetailsToggle strong {
  min-width: 26px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 3px 7px;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
}

.generationPanel,
.filterPanel,
.profilePanel,
.logsPanel,
.batchPanel {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.teamPanel {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.teamList {
  display: grid;
  gap: 8px;
}

.teamList article {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.teamList article div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.teamList article span,
.teamList article p {
  color: var(--muted);
  font-size: 12px;
}

.teamList article p {
  margin: 0;
}

.logsList {
  display: grid;
  gap: 8px;
}

.logsControls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.logsFilter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.logsFilter button,
.logDetailsButton {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.logsFilter button.active,
.logDetailsButton {
  border-color: rgba(37, 99, 235, 0.28);
  background: #e7efff;
  color: var(--blue-dark);
}

#logsSearchInput {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 10px;
}

.logsList article {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.logHeader {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.logHeader div {
  display: grid;
  gap: 2px;
}

.logHeader small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.logsList strong {
  font-size: 13px;
}

.logsList span,
.logsList p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.logsList pre {
  max-height: 180px;
  overflow: auto;
  margin: 2px 0 0;
  padding: 8px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.logDetailsButton {
  justify-self: start;
  min-height: 30px;
}

.overviewGrid .filterPanel {
  align-content: start;
  margin: 0;
}

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

.generateGrid button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  padding: 7px 6px;
  text-align: center;
}

.generateGrid button span,
.generateGrid button {
  font-size: 12px;
  font-weight: 900;
}

.generateGrid button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.generateGrid button:hover {
  background: var(--surface-3);
}

.targetField {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.targetField span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.targetField input {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.generationProgress {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 7px;
  background: #e7efff;
}

.progressHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.progressHeader strong,
.progressHeader span {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.progressTrack {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
}

.progressTrack span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 220ms var(--ease);
}

.generationProgress p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batchHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.batchHeader strong,
.batchHeader span {
  display: block;
}

.batchHeader strong {
  font-size: 17px;
  line-height: 22px;
}

.titleWithInfo {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.infoTip {
  position: relative;
  width: 17px;
  height: 17px;
  display: inline-grid !important;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.26);
  border-radius: 999px;
  background: #e7efff;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  outline: 0;
  cursor: help;
}

.infoTip:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: min(270px, calc(100vw - 48px));
  display: block !important;
  padding: 9px 10px;
  border: 1px solid rgba(24, 32, 51, 0.1);
  border-radius: 7px;
  background: #182033;
  color: white !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 16px;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 4px);
  transition:
    opacity 140ms var(--ease),
    transform 140ms var(--ease);
}

.tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 8px;
  height: 8px;
  background: #182033;
  transform: translate(-50%, -4px) rotate(45deg);
}

.infoTip:hover .tooltip,
.infoTip:focus .tooltip,
.infoTip:focus-within .tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.batchHeader span,
.batchMeta,
.batchPanel p {
  color: var(--muted);
  font-size: 12px;
}

.batchPill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e7efff;
  color: var(--blue-dark) !important;
  padding: 5px 9px;
  font-weight: 900;
}

.batchMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.batchActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.batchActions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.batchActions button:first-child {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--blue);
  color: white;
}

.batchPanel p {
  margin: 0;
  line-height: 17px;
}

.profilePanel p,
.memberMessage {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.activityGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.activityGrid div {
  min-width: 0;
  padding: 9px 6px;
  border-radius: 7px;
  background: var(--surface-2);
  text-align: center;
}

.activityGrid strong,
.activityGrid span {
  display: block;
}

.activityGrid strong {
  font-size: 17px;
  line-height: 22px;
}

.activityGrid span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memberForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.addLeadPanel {
  gap: 0;
  margin-bottom: 12px;
  padding: 0 14px 14px;
}

.memberForm input,
.memberForm select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 10px;
}

.memberForm button,
.memberActions button {
  min-height: 40px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 7px;
  background: #e7efff;
  color: var(--blue-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.memberActions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px !important;
  margin-top: 3px;
}

.memberActions .dangerText {
  border-color: rgba(220, 76, 76, 0.22);
  background: #fff0f0;
  color: var(--red);
}

.modeSwitch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.modeSwitch button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.modeSwitch button.active {
  border-color: rgba(37, 99, 235, 0.28);
  background: #e7efff;
  color: var(--blue-dark);
}

.searchField {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--faint);
  box-shadow: var(--shadow);
}

.searchField:focus-within {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.searchField svg {
  width: 19px;
  height: 19px;
}

.searchField input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.leadList {
  display: grid;
  gap: 9px;
}

.leadRow {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.leadRow:hover {
  background: var(--surface-2);
}

.leadMain {
  min-width: 0;
}

.leadMain strong,
.leadMain span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leadMain strong {
  font-size: 15px;
  line-height: 20px;
}

.leadMain span {
  color: var(--muted);
  font-size: 13px;
}

.leadScore {
  min-width: 58px;
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.emptyList {
  min-height: 132px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.detailHero,
.scoreCard,
.textCard,
.formCard {
  padding: 16px;
  margin-bottom: 12px;
}

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

.detailHero h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 30px;
}

.statusBadge {
  display: inline-flex;
  border-radius: 999px;
  background: #e7efff;
  color: var(--blue-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.scoreCard {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.scoreCard strong {
  font-size: 32px;
}

.scoreCard span,
.infoCards span,
.formCard span,
.textCard p,
.textCard pre {
  color: var(--muted);
}

.infoCards {
  overflow: hidden;
  margin-bottom: 12px;
}

.infoCards div {
  padding: 14px 16px;
}

.infoCards div + div,
.formCard label + label {
  border-top: 1px solid var(--line);
}

.infoCards span,
.formCard span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.infoCards p {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.detailLink {
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.35);
  text-underline-offset: 3px;
}

.detailLink:hover {
  color: var(--blue);
  text-decoration-color: currentColor;
}

.socialCard {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.socialHeader > div span,
.socialHeader > div strong {
  display: block;
}

.socialHeader > div span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.socialHeader > div strong {
  font-size: 16px;
}

.telegramButton {
  max-width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  background: #229ed9;
  color: white;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  overflow-wrap: anywhere;
  box-shadow: 0 9px 20px rgba(34, 158, 217, 0.22);
}

.telegramButton svg {
  width: 18px;
  height: 18px;
}

.socialLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.socialLinks:empty {
  display: none;
}

.socialLinks a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.socialLinks a:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: #e7efff;
  color: var(--blue-dark);
}

.textCard h3 {
  margin: 0 0 8px;
}

.timelineCard {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px;
}

.timelineCard h3 {
  margin: 0;
  font-size: 16px;
}

.leadTimeline {
  display: grid;
  gap: 8px;
}

.leadTimeline article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.leadTimeline article div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.leadTimeline strong {
  font-size: 13px;
}

.leadTimeline span,
.leadTimeline p,
.timelineEmpty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.textCard p,
.textCard pre {
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  white-space: pre-wrap;
}

.draftContent {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.copyCard {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.copyCardHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.copyCardHeader h3 {
  margin: 0;
  font-size: 15px;
}

.copyCardHeader button {
  min-width: 72px;
  min-height: 34px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 7px;
  background: #e7efff;
  color: var(--blue-dark);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.copyCard p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 21px;
  white-space: pre-wrap;
}

@media (max-width: 360px) {
  .overviewGrid {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 8px;
  }

  .summaryPanel,
  .overviewGrid .filterPanel {
    padding: 10px;
  }

  .summaryHeader {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .telegramButton {
    width: 100%;
    justify-content: center;
  }
}

.actionGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.actionGrid button,
.rejectGrid button,
.crmGrid button,
.primaryButton {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  background: var(--blue);
  color: white;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
}

.actionGrid button:nth-child(1),
.actionGrid button:nth-child(2),
.rejectGrid button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.actionGrid .danger {
  background: var(--red);
  box-shadow: 0 10px 22px rgba(220, 76, 76, 0.16);
}

.rejectPanel,
.crmPanel {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.restorePanel {
  display: grid;
  margin-bottom: 12px;
}

.restorePanel button {
  min-height: 46px;
  border: 1px solid rgba(18, 165, 107, 0.28);
  border-radius: 7px;
  background: #e9f9f2;
  color: #08784c;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.rejectGrid,
.crmGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rejectGrid button,
.crmGrid button {
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  font-size: 12px;
}

.rejectGrid button {
  color: var(--red);
}

.rejectGrid button:active {
  background: var(--red);
  color: white;
  box-shadow: 0 10px 22px rgba(220, 76, 76, 0.16);
}

.crmGrid button {
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: #edf4ff;
  color: #1d4ed8;
  box-shadow: var(--shadow);
}

.crmGrid button[data-crm-action="won"] {
  border-color: rgba(18, 165, 107, 0.28);
  background: #e9f9f2;
  color: #08784c;
}

.crmGrid button[data-crm-action="lost"] {
  border-color: rgba(220, 76, 76, 0.24);
  background: #fff0f0;
  color: var(--red);
}

.crmGrid button:active {
  transform: translateY(1px);
}

.rejectOtherForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
}

.rejectOtherForm input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 0 10px;
}

.rejectOtherForm button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: var(--red);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.formCard {
  display: grid;
  gap: 0;
}

.formCard label {
  display: grid;
  gap: 6px;
  padding: 12px 0;
}

input,
select,
textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
}

textarea {
  resize: vertical;
}

.primaryButton {
  margin-top: 14px;
}

.tabBar {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100%, 420px);
  height: calc(72px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px 10px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.tab {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 10px;
  min-width: 0;
}

.tab.active {
  color: var(--blue);
}

.tab svg {
  width: 23px;
  height: 23px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
