:root {
  color-scheme: light;
  --page: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-soft: #f7f9fc;
  --text: #142033;
  --muted: #69758a;
  --border: #dfe5ee;
  --accent: #0a8f68;
  --accent-strong: #057354;
  --accent-soft: #e4f6ef;
  --blue: #2f6fed;
  --blue-soft: #eaf0ff;
  --warning: #b97800;
  --warning-soft: #fff2d7;
  --danger: #c53f4f;
  --danger-soft: #fdecef;
  --shadow: 0 16px 44px rgba(27, 44, 71, 0.08);
  --radius: 22px;
  --radius-small: 14px;
  --meter-gradient: linear-gradient(90deg, #14936e 0%, #14936e 66%, #e2a124 83%, #d84b59 100%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #08101d;
  --surface: rgba(15, 27, 45, 0.92);
  --surface-solid: #0f1b2d;
  --surface-soft: #132238;
  --text: #edf3fb;
  --muted: #9aa9bd;
  --border: #26374d;
  --accent: #45c79c;
  --accent-strong: #68dbb4;
  --accent-soft: #113a32;
  --blue: #78a5ff;
  --blue-soft: #182d54;
  --warning: #f1b74f;
  --warning-soft: #3b2d12;
  --danger: #ff7e8b;
  --danger-soft: #431e27;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #08101d;
    --surface: rgba(15, 27, 45, 0.92);
    --surface-solid: #0f1b2d;
    --surface-soft: #132238;
    --text: #edf3fb;
    --muted: #9aa9bd;
    --border: #26374d;
    --accent: #45c79c;
    --accent-strong: #68dbb4;
    --accent-soft: #113a32;
    --blue: #78a5ff;
    --blue-soft: #182d54;
    --warning: #f1b74f;
    --warning-soft: #3b2d12;
    --danger: #ff7e8b;
    --danger-soft: #431e27;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28rem),
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--blue) 9%, transparent), transparent 24rem),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 52%, transparent);
  outline-offset: 2px;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 3vw, 44px) 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #075c48);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 1px 0 0;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(20, 32, 51, 0.05);
  font-size: 0.86rem;
  font-weight: 750;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 14%, transparent);
}

.status-pill[data-state="online"] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.status-pill[data-state="online"] {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 27%, var(--border));
}

.status-pill[data-state="connecting"] .status-dot,
.status-pill[data-state="warning"] .status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 15%, transparent);
  animation: pulse 1.4s infinite;
}

.status-pill[data-state="error"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 15%, transparent);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface-soft);
}

.icon-button svg,
.primary-button svg,
.empty-state svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 20px;
  align-items: stretch;
}

.card {
  border: 1px solid color-mix(in srgb, var(--border) 94%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.now-card,
.activity-card {
  min-height: 480px;
  padding: clamp(20px, 2.4vw, 30px);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.card-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.16rem, 2vw, 1.42rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.77rem;
  font-weight: 800;
  white-space: nowrap;
}

.live-badge[data-state="active"] {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--danger) 28%, transparent);
}

.call-panel {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 170px;
  margin: 26px 0 24px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--surface-soft), var(--surface-solid));
  overflow: hidden;
  position: relative;
}

.call-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  pointer-events: none;
}

.call-panel[data-state="active"] {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}

.call-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.call-visual span {
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
}

.call-panel[data-state="active"] .call-visual span {
  opacity: 1;
  animation: waveform 0.9s ease-in-out infinite alternate;
}

.call-panel[data-state="active"] .call-visual span:nth-child(2) { animation-delay: -0.24s; }
.call-panel[data-state="active"] .call-visual span:nth-child(3) { animation-delay: -0.48s; }
.call-panel[data-state="active"] .call-visual span:nth-child(4) { animation-delay: -0.16s; }
.call-panel[data-state="active"] .call-visual span:nth-child(5) { animation-delay: -0.36s; }

.call-details {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(105px, 0.8fr);
  gap: 24px;
  position: relative;
  z-index: 1;
}

.detail-block {
  min-width: 0;
}

.detail-block strong,
.detail-block span {
  display: block;
}

.detail-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-block strong {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-block > span:last-child {
  overflow: hidden;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination-block {
  padding-left: 22px;
  border-left: 1px solid var(--border);
}

.meter-block {
  margin-bottom: 25px;
}

.meter-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.meter-heading strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.meter {
  position: relative;
  height: 15px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 72%, transparent);
  overflow: hidden;
}

.meter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--meter-gradient);
  opacity: 0.21;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--meter-gradient);
  transition: width 80ms linear;
}

.meter-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 21px;
  border-radius: 4px;
  background: var(--surface-solid);
  box-shadow: 0 0 0 2px rgba(20, 32, 51, 0.28);
  transform: translate(-2px, -50%);
  transition: left 80ms linear;
}

.meter-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}

.primary-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 45px;
  padding: 0 18px;
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button:active,
.secondary-button:active,
.group-button:active {
  transform: translateY(1px);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 9px 21px color-mix(in srgb, var(--accent) 22%, transparent);
}

.primary-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.primary-button[data-active="true"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: none;
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.secondary-button:hover {
  border-color: color-mix(in srgb, var(--muted) 45%, var(--border));
}

.audio-note {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.activity-card {
  display: flex;
  flex-direction: column;
}

.activity-heading {
  margin-bottom: 18px;
}

.text-button {
  padding: 5px 2px;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.activity-list {
  min-height: 0;
  max-height: 385px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 300px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  margin-bottom: 13px;
  color: var(--accent);
}

.empty-state strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.95rem;
}

.empty-state span {
  max-width: 250px;
  font-size: 0.78rem;
}

.activity-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
}

.activity-item:first-child {
  padding-top: 4px;
}

.activity-item:last-child {
  border-bottom: 0;
}

.event-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.77rem;
  font-weight: 900;
}

.activity-item[data-type="error"] .event-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.activity-item[data-type="warning"] .event-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.event-copy > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.event-copy strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-copy time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.69rem;
  font-variant-numeric: tabular-nums;
}

.event-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 15%, transparent);
}

.groups-card {
  margin-top: 20px;
  padding: clamp(20px, 2.4vw, 30px);
}

.groups-heading {
  margin-bottom: 18px;
}

.mobile-select-wrap {
  display: none;
}

.group-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.3fr 1.2fr;
  gap: 22px;
}

.group-category h3 {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.group-category:first-child .group-buttons {
  grid-template-columns: 1fr;
}

.group-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.group-button:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface-soft));
}

.group-button[data-active="true"] {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--border));
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}

.group-button strong {
  flex: 0 0 auto;
  min-width: 42px;
  color: var(--text);
  font-size: 0.91rem;
  font-variant-numeric: tabular-nums;
}

.group-button span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-button[data-active="true"] strong,
.group-button[data-active="true"] span {
  color: var(--accent-strong);
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--border);
}

.info-strip > div {
  min-width: 0;
  padding: 14px 18px;
  background: var(--surface);
}

.info-label,
.info-strip strong {
  display: block;
}

.info-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-strip strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.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;
}

@keyframes waveform {
  from { height: 18px; }
  to { height: 60px; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .now-card,
  .activity-card {
    min-height: auto;
  }

  .activity-list {
    max-height: 340px;
  }

  .empty-state {
    min-height: 220px;
  }

  .group-grid {
    grid-template-columns: 1fr 1fr;
  }

  .group-category:last-child {
    grid-column: 1 / -1;
  }

  .group-category:last-child .group-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 17px 13px 18px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .subtitle {
    display: none;
  }

  .status-pill {
    min-height: 38px;
    padding: 0 11px;
  }

  .status-pill span:last-child {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .icon-button {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .now-card,
  .activity-card,
  .groups-card {
    padding: 18px;
    border-radius: 18px;
  }

  .call-panel {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 15px;
    min-height: 145px;
    margin: 20px 0;
    padding: 16px;
  }

  .call-visual {
    width: 72px;
    height: 72px;
    gap: 4px;
  }

  .call-visual span {
    width: 4px;
  }

  .call-details {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .destination-block {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 0;
    border: 0;
  }

  .destination-block .detail-label {
    display: none;
  }

  .destination-block strong {
    font-size: 0.92rem;
  }

  .destination-block > span:last-child {
    margin: 0;
    font-size: 0.75rem;
  }

  .primary-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .groups-heading {
    align-items: center;
  }

  .mobile-select-wrap {
    display: block;
  }

  #group-select {
    max-width: 175px;
    min-height: 40px;
    padding: 0 34px 0 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    background: var(--surface-soft);
    font-size: 0.78rem;
  }

  .group-grid {
    display: none;
  }

  .info-strip {
    grid-template-columns: 1fr;
  }

  footer {
    padding-top: 16px;
  }
}

@media (max-width: 420px) {
  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 0.75rem;
  }

  h1 {
    font-size: 1.32rem;
  }

  .eyebrow {
    font-size: 0.64rem;
  }

  .status-pill {
    padding: 0 9px;
    font-size: 0.75rem;
  }

  .topbar-actions {
    gap: 6px;
  }

  .call-panel {
    grid-template-columns: 1fr;
  }

  .call-visual {
    display: none;
  }

  .detail-block strong {
    font-size: 1.28rem;
  }

  .meter-scale span:nth-child(2),
  .meter-scale span:nth-child(4) {
    display: none;
  }
}

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


/* Layout compacto: escuta e atividade à esquerda, seleção à direita. */
body {
  font-size: 15px;
}

.page-shell {
  width: min(1500px, 100%);
  padding-top: 20px;
  padding-bottom: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  grid-template-areas:
    "now groups"
    "activity groups";
  gap: 16px;
  align-items: stretch;
}

.now-card {
  grid-area: now;
}

.activity-card {
  grid-area: activity;
}

.groups-card {
  grid-area: groups;
  margin-top: 0;
}

.now-card,
.activity-card,
.groups-card {
  min-height: 0;
  padding: clamp(18px, 2vw, 25px);
}

.card-heading h2 {
  font-size: clamp(1.08rem, 1.7vw, 1.32rem);
}

.call-panel {
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 20px;
  min-height: 150px;
  margin: 20px 0 18px;
  padding: 19px;
}

.call-visual {
  width: 94px;
  height: 94px;
}

.detail-block strong {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
}

.meter-block {
  margin-bottom: 18px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding-right: 16px;
  padding-left: 16px;
}

.audio-note {
  margin-top: 8px;
}

.activity-heading,
.groups-heading {
  margin-bottom: 12px;
}

.activity-list {
  max-height: 322px;
}

.empty-state {
  min-height: 220px;
}

.activity-item {
  padding: 10px 2px;
}

.event-icon {
  width: 32px;
  height: 32px;
}

.group-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.group-buttons,
.group-category:first-child .group-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.group-category h3 {
  margin-bottom: 7px;
}

.group-button {
  min-height: 49px;
  padding: 8px 10px;
}

footer {
  padding-top: 14px;
}

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "now"
      "groups"
      "activity";
  }

  .groups-card {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .dashboard-grid {
    gap: 14px;
  }

  .group-grid {
    display: none;
  }

  .call-panel {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 15px;
    min-height: 138px;
    margin: 17px 0;
    padding: 15px;
  }

  .call-visual {
    width: 70px;
    height: 70px;
  }

  .activity-list {
    max-height: 300px;
  }
}


/* Compactação adicional do painel e dos grupos — 20260731c3. */
@media (min-width: 981px) {
  .now-card {
    padding: 17px 20px;
  }

  .now-card .card-heading h2 {
    margin-top: 2px;
  }

  .now-card .live-badge {
    min-height: 28px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 0.73rem;
  }

  .now-card .call-panel {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 16px;
    min-height: 118px;
    margin: 13px 0 12px;
    padding: 13px 15px;
    border-radius: 15px;
  }

  .now-card .call-visual {
    width: 76px;
    height: 76px;
    gap: 5px;
  }

  .now-card .call-visual span {
    width: 5px;
    height: 19px;
  }

  .now-card .call-details {
    gap: 18px;
  }

  .now-card .detail-label {
    margin-bottom: 4px;
    font-size: 0.68rem;
  }

  .now-card .detail-block strong {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
  }

  .now-card .detail-block > span:last-child {
    margin-top: 4px;
    font-size: 0.8rem;
  }

  .now-card .destination-block {
    padding-left: 16px;
  }

  .now-card .meter-block {
    margin-bottom: 12px;
  }

  .now-card .meter-heading {
    margin-bottom: 5px;
    font-size: 0.78rem;
  }

  .now-card .meter {
    height: 12px;
  }

  .now-card .meter-marker {
    height: 18px;
  }

  .now-card .meter-scale {
    margin-top: 4px;
    font-size: 0.62rem;
  }

  .now-card .primary-actions {
    gap: 8px;
  }

  .now-card .primary-button,
  .now-card .secondary-button {
    min-height: 38px;
    padding-right: 13px;
    padding-left: 13px;
    border-radius: 11px;
    font-size: 0.88rem;
  }

  .now-card .primary-button svg {
    width: 18px;
    height: 18px;
  }

  .now-card .audio-note {
    margin-top: 5px;
    font-size: 0.68rem;
  }
}

@media (min-width: 681px) {
  .groups-card {
    padding: 18px 20px;
  }

  .groups-heading {
    margin-bottom: 10px;
  }

  .group-grid {
    gap: 11px;
  }

  .group-category h3 {
    margin-bottom: 5px;
    font-size: 0.67rem;
  }

  .group-buttons,
  .group-category:first-child .group-buttons {
    gap: 6px;
  }

  .group-button {
    gap: 7px;
    min-height: 40px;
    padding: 5px 8px;
    border-radius: 10px;
  }

  .group-button strong {
    min-width: 36px;
    font-size: 0.8rem;
  }

  .group-button span {
    font-size: 0.67rem;
  }
}



/* Ajuste geral de largura, scroll e apresentação móvel — 20260731c5. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

main,
.page-shell,
.dashboard-grid,
.dashboard-grid > *,
.now-card,
.activity-card,
.groups-card,
.group-category,
.group-buttons,
.event-copy,
.card-heading > div {
  min-width: 0;
}

.activity-card,
.groups-card {
  overflow: hidden;
}

.activity-list {
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.activity-list::-webkit-scrollbar {
  width: 9px;
}

.activity-list::-webkit-scrollbar-track {
  background: transparent;
}

.activity-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  background-clip: padding-box;
}

.activity-list::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 62%, transparent);
  background-clip: padding-box;
}

.event-copy > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: 10px;
}

.event-copy strong,
.event-copy p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-copy time {
  padding-right: 2px;
}

@media (min-width: 981px) {
  .now-card {
    padding: 15px 18px;
  }

  .now-card .call-panel {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 14px;
    min-height: 110px;
    margin: 11px 0;
    padding: 12px 14px;
  }

  .now-card .call-visual {
    width: 72px;
    height: 72px;
  }

  .now-card .meter-block {
    margin-bottom: 10px;
  }

  .now-card .primary-button,
  .now-card .secondary-button {
    min-height: 36px;
  }

  .activity-card {
    padding: 16px 20px 17px;
  }

  .activity-heading {
    margin-bottom: 8px;
  }

  .activity-list {
    max-height: 338px;
  }

  .activity-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 3px;
  }

  .event-icon {
    width: 31px;
    height: 31px;
    border-radius: 10px;
  }
}

@media (min-width: 681px) {
  .groups-card {
    padding: 16px 18px;
  }

  .group-grid {
    gap: 10px;
  }

  .group-buttons,
  .group-category:first-child .group-buttons {
    gap: 5px 6px;
  }

  .group-button {
    min-height: 38px;
    padding: 4px 8px;
  }

  .group-button strong {
    min-width: 34px;
    font-size: 0.78rem;
  }

  .group-button span {
    font-size: 0.66rem;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: 100%;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-right: max(11px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(11px, env(safe-area-inset-left));
  }

  .dashboard-grid {
    gap: 12px;
  }

  .now-card,
  .activity-card,
  .groups-card {
    width: 100%;
    padding: 15px;
  }

  .now-card {
    overflow: hidden;
  }

  .now-card .card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: start;
    gap: 8px;
  }

  .now-card .card-heading > div {
    min-width: 0;
  }

  .now-card .section-kicker {
    line-height: 1.35;
    white-space: nowrap;
  }

  .now-card .card-heading h2 {
    margin-top: 2px;
    font-size: clamp(1.02rem, 5.2vw, 1.2rem);
    overflow-wrap: anywhere;
  }

  .now-card .live-badge {
    min-height: 27px;
    padding: 0 9px;
    font-size: 0.7rem;
  }

  .now-card .call-panel {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    min-height: 124px;
    margin: 13px 0;
    padding: 13px;
  }

  .now-card .call-visual {
    width: 64px;
    height: 64px;
  }

  .now-card .call-details {
    gap: 9px;
  }

  .now-card .detail-block strong {
    font-size: clamp(1.12rem, 6.3vw, 1.38rem);
  }

  .now-card .detail-block > span:last-child {
    margin-top: 2px;
    font-size: 0.74rem;
  }

  .now-card .meter-block {
    margin-bottom: 11px;
  }

  .now-card .primary-button,
  .now-card .secondary-button {
    min-height: 38px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: 0.84rem;
  }

  .activity-list {
    max-height: 320px;
    padding-right: 9px;
  }

  .event-copy > div {
    gap: 7px;
  }

  .event-copy time {
    font-size: 0.65rem;
  }
}

@media (max-width: 380px) {
  .topbar {
    gap: 10px;
  }

  .status-pill span:last-child {
    max-width: 68px;
  }

  .now-card .card-heading {
    gap: 6px;
  }

  .now-card .live-badge {
    padding: 0 7px;
    font-size: 0.66rem;
  }

  .now-card .call-panel {
    grid-template-columns: 1fr;
  }

  .now-card .call-visual {
    display: none;
  }
}



/* Correção integral do cartão «A escutar» em telemóvel — 20260731c6. */
@media (max-width: 680px) {
  .now-card {
    overflow: visible;
  }

  .now-card .call-panel {
    display: block;
    min-height: 0;
    margin: 13px 0 12px;
    padding: 14px 15px;
  }

  .now-card .call-visual {
    display: none;
  }

  .now-card .call-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(78px, auto);
    align-items: start;
    gap: 14px;
    width: 100%;
  }

  .now-card .detail-block {
    min-width: 0;
    overflow: visible;
  }

  .now-card .detail-label,
  .now-card .destination-block .detail-label {
    display: block;
    margin-bottom: 4px;
  }

  .now-card .detail-block strong {
    overflow: visible;
    font-size: clamp(1.16rem, 6.2vw, 1.48rem);
    text-overflow: clip;
    white-space: nowrap;
  }

  .now-card .detail-block > span:last-child {
    overflow: visible;
    margin-top: 4px;
    font-size: 0.76rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .now-card .destination-block {
    display: block;
    padding-left: 14px;
    border-top: 0;
    border-left: 1px solid var(--border);
  }

  .now-card .destination-block strong {
    font-size: clamp(1.08rem, 5.4vw, 1.34rem);
  }

  .now-card .destination-block > span:last-child {
    margin-top: 4px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
}

@media (max-width: 340px) {
  .now-card .call-details {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .now-card .destination-block {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: baseline;
    gap: 8px;
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .now-card .destination-block .detail-label,
  .now-card .destination-block > span:last-child {
    margin: 0;
  }
}
