/* =========================================================
   Banana Ops — Telegram Mini App
   Dark-green, music-app-inspired ops dashboard.
   ========================================================= */

:root {
  /* Brand palette (do NOT inherit Telegram themeParams) */
  --bg-base: #0b2b1f;
  --bg-grad-top: #0e3b28;
  --bg-grad-bottom: #071a12;

  --accent: #34d17a;        /* green */
  --accent-blue: #5fb0f0;   /* secondary blue */
  --kpi: #ffd23f;           /* banana yellow */

  --text: #ffffff;
  --text-secondary: #9db8ac;
  --text-muted: #cfe3da;

  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-bg-hover: rgba(255, 255, 255, 0.08);

  /* Glassmorphism tokens (interactive elements) */
  --glass-bg: rgba(255, 255, 255, 0.09);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(14px) saturate(140%);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.15);

  /* Radii */
  --r-big: 24px;
  --r-small: 18px;
  --r-pill: 999px;

  /* Status colors */
  --status-green: #34d17a;
  --status-amber: #ffd23f;
  --status-red: #ff6b6b;

  --maxw: 430px;
  --bottomnav-h: 88px;

  /* Safe-area insets.
     These are overwritten at runtime by app.js using Telegram's
     safeAreaInset + contentSafeAreaInset. The values below are the
     fallback used in a plain browser or older Telegram clients. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(120% 80% at 50% 0%, var(--bg-grad-top) 0%, var(--bg-base) 45%, var(--bg-grad-bottom) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------- Inline SVG icons ----------------
   Self-contained icons replace the old Tabler webfont. They size to the
   parent font-size (1em) and inherit currentColor, matching where the font
   glyphs used to render. */
svg.ic,
.bottomnav__btn svg,
.topbar .icon-btn svg,
.feature-card__icon svg,
.metric-card__cta svg,
.kpi-pill svg,
.preview-badge svg,
.chip svg,
.alert-row__chevron svg {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex: 0 0 auto;
}

/* The feature-card icon circle is ~42px; size its glyph so it sits centered
   and clearly visible (not tiny) inside the circle. */
.feature-card__icon {
  font-size: 22px;
}

/* Accessibility helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* App container — mobile-first, centered.
   Top padding uses max() of the JS-supplied Telegram safe-top and the
   CSS env() inset so the greeting clears the notch / Telegram controls
   even in true fullscreen where those float over the webview. */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding:
    calc(max(var(--safe-top), env(safe-area-inset-top, 0px)) + 12px)
    18px
    calc(var(--bottomnav-h) + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px)) + 24px);
}

/* ---------------- Top bar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  margin-bottom: 14px;
}

.topbar__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.topbar__back[hidden] {
  display: none;
}

/* ---------------- Greeting ---------------- */
.greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.greeting__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.greeting__hello {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 500;
}

.greeting__name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  /* Glassy banana-tinted pill */
  background: rgba(255, 210, 63, 0.18);
  border: 1px solid rgba(255, 210, 63, 0.45);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--kpi);
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--glass-highlight), 0 6px 18px rgba(255, 210, 63, 0.18);
  white-space: nowrap;
}

/* Fallback when backdrop-filter is unsupported → solid tinted pill */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .kpi-pill {
    background: rgba(255, 210, 63, 0.9);
    color: #1a1300;
    border-color: rgba(255, 210, 63, 0.9);
  }
}

/* ---------------- Filter chips ---------------- */
.chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 20px;
  padding-bottom: 2px;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  /* Glass (inactive) */
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:active {
  transform: scale(0.95);
}

.chip.is-active {
  /* Solid white = active */
  background: #ffffff;
  color: #0b2b1f;
  border-color: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .chip {
    background: rgba(255, 255, 255, 0.12);
  }
}

/* ---------------- View / sections ---------------- */
.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section__title {
  font-size: 19px;
  font-weight: 700;
}

.section__link {
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

/* ---------------- Large metric cards ---------------- */
.metric-card {
  position: relative;
  border-radius: var(--r-big);
  padding: 22px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid var(--card-border);
  transition: transform 0.12s ease;
}

.metric-card:active {
  transform: scale(0.985);
}

.metric-card--green {
  background:
    radial-gradient(140% 120% at 88% 8%, rgba(60, 220, 135, 0.45) 0%, rgba(60, 220, 135, 0) 55%),
    linear-gradient(135deg, #1a6b47 0%, #0e3b28 100%);
  box-shadow: var(--glass-highlight);
}

.metric-card--blue {
  background:
    radial-gradient(140% 120% at 88% 8%, rgba(95, 176, 240, 0.45) 0%, rgba(95, 176, 240, 0) 55%),
    linear-gradient(135deg, #1d4f7a 0%, #10314d 100%);
  box-shadow: var(--glass-highlight);
}

.metric-card__metric {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.metric-card__title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
}

.metric-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card__sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.metric-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  /* Glassy "Открыть" button */
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight);
  padding: 7px 13px;
  border-radius: var(--r-pill);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .metric-card__cta {
    background: rgba(0, 0, 0, 0.28);
  }
}

/* ---------------- Small feature cards (Сводка) ---------------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.feature-card {
  border-radius: var(--r-small);
  /* Glass card */
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.feature-card:active {
  transform: scale(0.97);
  background: var(--glass-bg-strong);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .feature-card {
    background: rgba(255, 255, 255, 0.07);
  }
}

.feature-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  /* Glass icon circle with subtle green tint */
  background: rgba(52, 209, 122, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--glass-highlight);
  color: var(--accent);
}

.feature-card__icon--blue {
  background: rgba(95, 176, 240, 0.18);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--accent-blue);
}

.feature-card__title {
  font-size: 15px;
  font-weight: 700;
}

.feature-card__sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ---------------- Alert row ---------------- */
.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-small);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.alert-row:active {
  transform: scale(0.985);
  background: var(--card-bg-hover);
}

.alert-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.alert-row__label {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.alert-row__chevron {
  color: var(--text-secondary);
  font-size: 18px;
}

/* status dot/text helpers */
.dot--green { background: var(--status-green); }
.dot--amber { background: var(--status-amber); }
.dot--red   { background: var(--status-red); }
.txt--green { color: var(--status-green); }
.txt--amber { color: var(--status-amber); }
.txt--red   { color: var(--status-red); }

/* ---------------- Generic list rows ---------------- */
.list-card {
  border-radius: var(--r-small);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
}

.list-row:last-child {
  border-bottom: none;
}

.list-row__main {
  flex: 1;
  min-width: 0;
}

.list-row__title {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row__sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.list-row__value {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------------- Stat tiles (2-up) ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-tile {
  border-radius: var(--r-small);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 16px;
}

.stat-tile__value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stat-tile__value--kpi { color: var(--kpi); }
.stat-tile__value--green { color: var(--accent); }
.stat-tile__value--blue { color: var(--accent-blue); }

.stat-tile__label {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------------- Progress bar ---------------- */
.bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 8px;
}

.bar__fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.bar__fill--blue { background: var(--accent-blue); }

/* ---------------- Funnel / pipeline ---------------- */
.funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
}

.funnel-row:last-child { border-bottom: none; }

.funnel-row__stage {
  font-size: 14px;
  font-weight: 600;
  width: 110px;
  flex: 0 0 auto;
}

.funnel-row__track {
  flex: 1;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.funnel-row__bar {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent) 0%, #1e9a5c 100%);
  min-width: 22px;
}

.funnel-row__count {
  font-size: 14px;
  font-weight: 700;
  width: 34px;
  text-align: right;
  flex: 0 0 auto;
}

/* ---------------- Bottom nav (floating pill) ---------------- */
.bottomnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px)));
  width: min(calc(var(--maxw) - 60px), calc(100vw - 60px));
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 64px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  /* Frosted glass dock */
  background: rgba(10, 32, 24, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), 0 12px 30px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .bottomnav {
    background: rgba(10, 32, 24, 0.92);
  }
}

.bottomnav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.bottomnav__btn:active {
  transform: scale(0.9);
}

.bottomnav__btn.is-active {
  color: var(--accent);
  background: rgba(52, 209, 122, 0.14);
}

/* ---------------- Preview badge ---------------- */
.preview-badge {
  position: fixed;
  top: calc(max(var(--safe-top), env(safe-area-inset-top, 0px)) + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 210, 63, 0.16);
  border: 1px solid rgba(255, 210, 63, 0.35);
  color: var(--kpi);
  font-size: 11.5px;
  font-weight: 700;
  z-index: 100;
  pointer-events: none;
}

.preview-badge[hidden] { display: none; }

/* ---------------- Skeletons ---------------- */
.skeleton-block {
  height: 132px;
  border-radius: var(--r-big);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 37%,
    rgba(255, 255, 255, 0.05) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Empty / error state */
.empty-state {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 32px 12px;
}

/* =========================================================
   Compose UI — FAB + bottom sheet (data entry: text + voice)
   ========================================================= */

/* Floating action button — sits ABOVE the bottom nav, bottom-right. */
.compose-fab {
  position: fixed;
  right: 18px;
  /* Clear the floating nav (64px tall, 16px gap) + safe-bottom. */
  bottom: calc(64px + 16px + 14px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px)));
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  /* Glassy green-tinted button */
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(52, 209, 122, 0.55) 0%, rgba(52, 209, 122, 0.18) 60%),
    rgba(10, 32, 24, 0.55);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight), 0 10px 26px rgba(0, 0, 0, 0.42);
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
  z-index: 60;
  transition: transform 0.12s ease, background 0.15s ease;
}

.compose-fab:active {
  transform: scale(0.92);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .compose-fab {
    background: linear-gradient(135deg, #1a6b47 0%, #0e3b28 100%);
  }
}

/* Backdrop behind the sheet */
.compose-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 16, 11, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 90;
}
.compose-backdrop.is-open {
  opacity: 1;
}
.compose-backdrop[hidden] {
  display: none;
}

/* Bottom sheet — glass, dark-green, slides up */
.compose-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 18px
    calc(20px + max(var(--safe-bottom), env(safe-area-inset-bottom, 0px)));
  border-top-left-radius: var(--r-big);
  border-top-right-radius: var(--r-big);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(14, 59, 40, 0.96) 0%, rgba(7, 26, 18, 0.97) 100%);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight), 0 -12px 40px rgba(0, 0, 0, 0.5);
  z-index: 95;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 86vh;
  overflow-y: auto;
}
.compose-sheet.is-open {
  transform: translate(-50%, 0);
}
.compose-sheet[hidden] {
  display: none;
}

.compose-sheet__grip {
  width: 40px;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.22);
  margin: 2px auto 4px;
  flex: 0 0 auto;
}

.compose-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compose-sheet__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.compose-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, color 0.15s ease;
}
.compose-iconbtn:active {
  transform: scale(0.9);
}
.compose-iconbtn:disabled {
  opacity: 0.5;
  cursor: default;
}

.compose-iconbtn--mic {
  color: var(--accent);
  background: rgba(52, 209, 122, 0.16);
}
.compose-iconbtn--mic.is-recording {
  color: #fff;
  background: var(--status-red);
  border-color: var(--status-red);
  animation: composePulse 1.2s ease infinite;
}

@keyframes composePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255, 107, 107, 0); }
}

/* Multiline text input */
.compose-input {
  width: 100%;
  resize: vertical;
  min-height: 64px;
  max-height: 40vh;
  padding: 14px 16px;
  border-radius: var(--r-small);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
}
.compose-input::placeholder {
  color: var(--text-secondary);
}
.compose-input:focus {
  border-color: rgba(52, 209, 122, 0.6);
  background: var(--glass-bg-strong);
}
.compose-input:disabled {
  opacity: 0.6;
}

/* Actions row */
.compose-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compose-send {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, #2bb56e 0%, #1a6b47 100%);
  box-shadow: var(--glass-highlight), 0 6px 18px rgba(52, 209, 122, 0.25);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.compose-send:active {
  transform: scale(0.97);
}
.compose-send:disabled {
  opacity: 0.55;
  cursor: default;
}
.compose-send svg {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
  flex: 0 0 auto;
}

/* Recording banner */
.compose-rec {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-small);
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.12);
}
.compose-rec[hidden] {
  display: none;
}
.compose-rec__pulse {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--status-red);
  animation: composePulse 1.2s ease infinite;
}
.compose-rec__label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.compose-rec__stop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--status-red);
  background: var(--status-red);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.compose-rec__stop:active {
  transform: scale(0.95);
}
.compose-rec__stop svg {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

/* Status / messages / confirm / results */
.compose-status:empty {
  display: none;
}

.compose-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-small);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-size: 14px;
  line-height: 1.4;
}
.compose-msg--error {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
  color: var(--text);
}
.compose-msg--info {
  border-color: rgba(52, 209, 122, 0.35);
  background: rgba(52, 209, 122, 0.1);
}
.compose-msg__icon {
  flex: 0 0 auto;
  font-size: 18px;
  margin-top: 1px;
}
.compose-msg--error .compose-msg__icon {
  color: var(--status-red);
}
.compose-msg--info .compose-msg__icon {
  color: var(--accent);
}
.compose-msg__text {
  flex: 1;
}

.compose-spin {
  display: inline-flex;
  animation: composeSpin 0.9s linear infinite;
}
@keyframes composeSpin {
  to { transform: rotate(360deg); }
}

/* Confirmation card */
.compose-confirm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-small);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight);
}
.compose-confirm__summary {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.compose-confirm__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compose-action {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.compose-action__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.compose-action__text {
  flex: 1;
}
.compose-action__risk {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.compose-confirm__btns {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}
.compose-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.compose-btn:active {
  transform: scale(0.97);
}
.compose-btn--primary {
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, #2bb56e 0%, #1a6b47 100%);
  box-shadow: var(--glass-highlight), 0 6px 18px rgba(52, 209, 122, 0.25);
  color: #fff;
}
.compose-btn--ghost {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-muted);
}

/* Execute results */
.compose-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compose-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-small);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-size: 13.5px;
  line-height: 1.4;
}
.compose-result__icon {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 17px;
  margin-top: 1px;
}
.compose-result.is-fail .compose-result__icon {
  color: var(--status-red);
}
.compose-result__text {
  flex: 1;
}
.compose-result__link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.compose-result__link:active {
  opacity: 0.7;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
