/*
 * Início — porta de prototype/styles/dashboard.css (desenho do dashboard desktop), escopada
 * com CSS nesting. Regras de shell, reset e diálogo saíram (agora são do app shell e dos
 * componentes); o resto foi mantido para preservar o visual de referência.
 */
.view-inicio {
  height: 100%;

  .dashboard {
    display: grid;
    grid-template-columns: minmax(0, 641fr) minmax(0, 1054fr);
    gap: var(--space-panel);
    min-width: 0;
    min-height: 0;
  }

  .welcome {
    position: relative;
    min-width: 0;
    min-height: 0;
    isolation: isolate;
  }

  .welcome__shape {
    position: absolute;
    top: 20.825%;
    left: 0;
    width: 100%;
    height: 65.67%;
    /* O shape acompanha a coluna, sem margens internas por proporção do SVG. */
    object-fit: fill;
    filter: drop-shadow(var(--shadow-welcome));
  }

  .welcome__doctor {
    position: absolute;
    bottom: -.52%;
    left: -6.553%;
    width: 101.56%;
    height: 102.784%;
    object-fit: contain;
    object-position: left bottom;
    pointer-events: none;
  }

  .quick-actions {
    position: absolute;
    top: 4.639%;
    right: 0;
    z-index: 1;
    display: grid;
    gap: var(--space-quick-actions);
    width: 48.05%;
  }

  .action {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.3vw, 25px);
    min-width: 0;
    height: clamp(56px, 8.333vh, 90px);
    padding: clamp(6px, .52vw, 10px);
    border: var(--border-surface);
    border-radius: var(--radius-panel);
    color: white;
    box-shadow: var(--shadow-surface);
    font-family: var(--font-display);
    font-size: var(--font-action);
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background-color var(--duration-fast) ease;
  }

  @media (hover: hover) {
    .action:hover {
      transform: translateY(-3px);
      background-color: #0186ce;
      box-shadow: 0 8px 18px rgb(1 134 206 / 25%);
    }

    .action--primary:hover .action__icon {
      content: url('../../assets/icons/consultation-hover.svg');
    }

    .action--secondary:hover .action__icon {
      content: url('../../assets/icons/upload-hover.svg');
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .action:hover {
      transform: none;
    }
  }

  .action--primary {
    background: var(--color-primary);
  }

  .action--secondary {
    background: var(--color-secondary);
  }

  .action__icon {
    flex: 0 0 auto;
    width: clamp(30px, 3.646vw, 70px);
    height: auto;
    max-height: 100%;
  }

  .surface {
    min-width: 0;
    min-height: 0;
    background: var(--color-surface);
    border: var(--border-surface);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-surface);
  }

  .welcome__panel {
    position: absolute;
    top: 52.474%;
    left: 20.749%;
    width: 74.883%;
  }

  /*
   * Painel de jornadas [design-system/painel-jornadas.svg, 480 × 231].
   * --pu = 1px do desenho, relativo à largura do painel: tudo escala junto.
   * As etapas têm largura e texto fixos; as que não cabem são cortadas pela borda do card.
   */
  .welcome__panel {
    container-type: inline-size;
    --pu: calc(100cqw / 480);
  }

  .journey-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-items: start;
    min-width: 0;
    padding: calc(23 * var(--pu)) calc(17 * var(--pu)) 0 calc(15 * var(--pu));
    overflow: hidden;
    border: 1px solid #fff;
    border-radius: calc(12 * var(--pu));
    background: rgb(251 243 243 / 95%);
    box-shadow: var(--shadow-surface);
    backdrop-filter: blur(6px);
  }

  .journey-card__title {
    margin: 0 0 calc(10 * var(--pu));
    color: #3b3f5c;
    font: 700 calc(20 * var(--pu)) / 1.2 var(--font-display);
  }

  .journey-card__summary {
    display: grid;
    grid-template-columns: calc(48 * var(--pu)) calc(120 * var(--pu)) minmax(0, 1fr);
    column-gap: calc(8 * var(--pu));
    align-items: center;
    min-width: 0;
    height: calc(50 * var(--pu));
    padding: calc(1 * var(--pu)) calc(12 * var(--pu)) calc(1 * var(--pu)) calc(1 * var(--pu));
    border-radius: calc(10 * var(--pu));
    background: #fff;
  }

  .journey-card__doctor-avatar {
    width: calc(48 * var(--pu));
    aspect-ratio: 1;
    border: 1px solid #fff;
    border-radius: calc(10 * var(--pu));
    background-color: #00c0ba;
    background-repeat: no-repeat;
  }

  .journey-card__doctor,
  .journey-card__description {
    min-width: 0;
    margin: 0;
  }

  .journey-card__doctor {
    display: grid;
    color: #f84d64;
    font: 500 calc(14 * var(--pu)) / 1.3 var(--font-display);
  }

  .journey-card__doctor strong {
    color: #3b3f5c;
    font-size: calc(16 * var(--pu));
    font-weight: 700;
  }

  .journey-card__doctor strong,
  .journey-card__doctor span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .journey-card__description {
    display: -webkit-box;
    overflow: hidden;
    color: #3b3f5c;
    font: 400 calc(15 * var(--pu)) / 1.2 var(--font-body);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .journey-card__timeline {
    display: flex;
    min-width: 0;
    margin: calc(12 * var(--pu)) 0 0 calc(-9.5 * var(--pu));
    padding: 0;
    list-style: none;
  }

  .journey-step {
    position: relative;
    display: flex;
    flex: 0 0 calc(105.25 * var(--pu));
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Ligação até a próxima etapa: rosa, ou verde quando as duas já foram feitas. */
  .journey-step:not(:last-child)::after {
    position: absolute;
    top: calc(19 * var(--pu));
    left: calc(50% + 20 * var(--pu));
    width: calc(100% - 40 * var(--pu));
    height: calc(2 * var(--pu));
    background: #e16697;
    content: '';
  }

  .journey-step--complete:has(+ .journey-step--complete)::after {
    background: #00c4b8;
  }

  .journey-step__marker {
    display: grid;
    width: calc(40 * var(--pu));
    height: calc(40 * var(--pu));
    place-items: center;
    border: 1px solid #e16697;
    border-radius: 50%;
    color: #fff;
  }

  .journey-step__marker::before {
    grid-area: 1 / 1;
    width: calc(32 * var(--pu));
    height: calc(32 * var(--pu));
    box-sizing: border-box;
    border: 1px solid #ccf3f1;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(0 199 183 / 25%), rgb(0 133 207 / 25%));
    content: '';
  }

  .journey-step__marker svg {
    grid-area: 1 / 1;
    position: relative;
    width: calc(18 * var(--pu));
    height: calc(18 * var(--pu));
  }

  .journey-step time {
    display: block;
    color: #e16697;
    font: 600 calc(15 * var(--pu)) / 1.2 var(--font-display);
    white-space: nowrap;
  }

  .journey-step > span:last-child {
    display: block;
    max-width: calc(100 * var(--pu));
    margin-top: calc(4 * var(--pu));
    color: #66719f;
    font: 400 calc(12 * var(--pu)) / 1.25 var(--font-body);
  }

  .journey-step--complete .journey-step__marker {
    border-color: #00c4b8;
  }

  .journey-step--complete .journey-step__marker::before {
    border: 0;
    background: #00c0ba;
  }

  .journey-step--complete time {
    color: #f84d64;
  }

  .journey-step--complete > span:last-child {
    color: #004c72;
  }

  .dashboard-panels {
    display: grid;
    grid-template-rows: minmax(0, 257fr) minmax(0, 507fr) minmax(0, 138fr);
    gap: var(--space-panel-vertical);
    min-width: 0;
    min-height: 0;
  }

  .dashboard-panels__top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* alinhado com Atividade física e Rotinas */
    gap: var(--space-panel);
    min-height: 0;
  }

  .panel-group {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(8px, 1.019vh, 11px);
    min-width: 0;
    min-height: 0;
  }

  .panel-heading {
    display: flex;
    align-items: center;
    gap: clamp(8px, .78125vw, 15px);
    min-width: 0;
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
  }

  .panel-heading img {
    flex: 0 0 auto;
    width: clamp(20px, 1.5625vw, 30px);
    height: clamp(23px, 3.148vh, 34px);
  }

  .panel-slot {
    width: 100%;
    height: 100%;
    border-radius: 22px;
  }

  /* ——— Evoluções de saúde [design-system/painel-evolucao-de-saude.svg] ———————————
     Medidas em px do desenho (painel de 1054 × 467). --h e --v convertem px do desenho
     na largura e na altura do painel; --pu (o menor dos dois) dá tamanho a textos,
     bolinhas e raios, para nada deformar quando a proporção do painel muda. */
  .evo-panel {
    --h: calc(100cqw / 1054);
    --v: calc(100cqh / 467);
    --pu: min(var(--h), var(--v));
    position: relative;
    container-type: size;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 1px solid white;
    border-radius: var(--radius-panel);
    background: linear-gradient(112deg, rgb(0 196 183 / 10%), rgb(0 134 206 / 10%));
  }

  /* Coluna da sanfona: 341 px a 21 px da borda; a barra de rolagem fica na calha à direita. */
  .evo-panel__list {
    position: absolute;
    top: calc(18 * var(--v));
    bottom: calc(16 * var(--v));
    left: calc(21 * var(--h));
    display: flex;
    flex-direction: column;
    gap: calc(7 * var(--pu));
    width: calc(341 * var(--h) + 22px); /* 341 de conteúdo + 8 de respiro + 14 da barra de rolagem */
    padding-right: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .evo-item {
    flex: none;
    border: 1px solid #f6eeee;
    border-radius: calc(8 * var(--pu));
    background: white;
  }

  .evo-item__heading {
    margin: 0;
    font: inherit;
  }

  .evo-item__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(12 * var(--pu));
    width: 100%;
    min-height: calc(51 * var(--pu));
    padding: calc(6 * var(--pu)) calc(12 * var(--pu)) calc(6 * var(--pu)) calc(17 * var(--pu));
    border: 0;
    border-radius: calc(8 * var(--pu));
    background: none;
    color: #003d60;
    font: 700 max(12px, calc(16 * var(--pu))) / 1.2 var(--font-display);
    text-align: left;
    cursor: pointer;
  }

  .evo-item--piora .evo-item__trigger {
    color: #60003d;
  }

  .evo-item__trigger:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
  }

  .evo-item__chevron {
    flex: none;
    width: calc(25 * var(--pu));
    height: calc(25 * var(--pu));
    fill: #f95067;
    transition: transform .3s ease, fill .3s ease;
  }

  .evo-item.is-open .evo-item__chevron {
    fill: #00a2c3;
    transform: rotate(180deg);
  }

  /* Abre e fecha animando a altura: a linha da grade vai de 0fr a 1fr. */
  .evo-item__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s ease;
  }

  .evo-item.is-open .evo-item__panel {
    grid-template-rows: 1fr;
  }

  .evo-item__inner {
    min-height: 0;
    overflow: hidden;
  }

  .evo-item__body {
    display: grid;
    gap: calc(9 * var(--pu));
    padding: calc(5 * var(--pu)) calc(10 * var(--pu)) calc(12 * var(--pu));
  }

  .evo-value {
    display: grid;
    grid-template-columns: calc(90 * var(--pu)) minmax(calc(42 * var(--pu)), max-content) minmax(0, 1fr) auto;
    align-items: baseline;
    align-content: center;
    min-height: calc(49 * var(--pu));
    padding: 0 calc(11 * var(--pu)) 0 calc(17 * var(--pu));
    border-radius: calc(15 * var(--pu));
    background: #f1f9fe;
    color: #3b3f5c;
    font: 400 max(11px, calc(15 * var(--pu))) / 1 var(--font-body);
    white-space: nowrap;
  }

  .evo-value strong {
    padding-right: calc(4 * var(--pu));
    font: 700 max(14px, calc(20 * var(--pu))) / 1 var(--font-display);
  }

  .evo-value__status {
    justify-self: end;
    display: inline-grid;
    place-items: center;
    min-height: calc(29 * var(--pu));
    padding: 0 calc(12 * var(--pu));
    border-radius: calc(9 * var(--pu));
    background: #fe6378;
    color: white;
  }

  .evo-value__status--dentro {
    background: #f95067;
  }

  .evo-item__message {
    display: flex;
    align-items: center;
    min-height: calc(66 * var(--pu));
    margin: 0;
    padding: calc(14 * var(--pu)) calc(18 * var(--pu)) calc(14 * var(--pu)) calc(23 * var(--pu));
    border-radius: calc(15 * var(--pu));
    background: linear-gradient(101deg, #01c7b7, #0186ce);
    color: white;
    font: 700 max(11px, calc(13 * var(--pu))) / 1.3 var(--font-body);
    letter-spacing: -.03em;
  }

  .evo-item__message--alerta {
    background: linear-gradient(101deg, #ff667a, #f5004a);
  }

  /* Gráfico: área de plotagem do desenho, de x 415 a 997 e de y 22 a 450. */
  .evo-panel__chart {
    position: absolute;
    top: calc(22 * var(--v));
    left: calc(415 * var(--h));
    width: calc(582 * var(--h));
    height: calc(428 * var(--v));
  }

  .evo-chart {
    position: absolute;
    inset: 0;
    animation: evo-chart-in .25s ease both;
  }

  @keyframes evo-chart-in {
    from { opacity: 0; }
  }

  .evo-chart__year {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: rgb(239 252 251 / 70%);
  }

  .evo-chart__band {
    position: absolute;
    right: 0;
    left: 0;
    background: linear-gradient(103deg, rgb(0 197 183 / 10%), rgb(1 134 205 / 10%));
  }

  /* Linha do valor médio de referência: o meio da faixa do laudo. */
  .evo-chart__mid {
    position: absolute;
    right: calc(-3 * var(--pu));
    left: calc(-3 * var(--pu));
    height: calc(6 * var(--pu));
    border-radius: 99px;
    background: rgb(255 255 255 / 55%);
    translate: 0 -50%;
  }

  .evo-chart__label {
    position: absolute;
    left: calc(595 * var(--h));
    color: #01c4b8;
    font: 600 max(10px, calc(13 * var(--pu))) / 1 var(--font-body);
    translate: 0 -50%;
  }

  .evo-chart__label--mid {
    color: #0197c7;
  }

  .evo-chart__line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
  }

  .evo-chart__line path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }

  .evo-chart__halo {
    stroke: #effcfb;
    stroke-width: calc(18 * var(--pu));
  }

  .evo-chart__seg {
    stroke: #ffb7b4;
    stroke-width: calc(8 * var(--pu));
  }

  .evo-chart__seg.is-in {
    stroke: #01c5b8;
  }

  /* Etiqueta de ano e mês, de pé, sobre a bolinha do mês do exame. */
  .evo-tag {
    position: absolute;
    bottom: calc(15 * var(--v));
    display: grid;
    place-items: center;
    width: calc(21 * var(--pu));
    height: calc(55 * var(--v));
    margin-left: calc(-10.5 * var(--pu));
    border-radius: calc(9 * var(--pu));
    background: #01a8c2;
    color: white;
    font: 700 max(8.5px, calc(11.5 * var(--pu))) / 1 var(--font-body);
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  .evo-months {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(var(--slots), minmax(0, 1fr));
    align-items: end;
    justify-items: center;
    height: calc(12 * var(--pu));
  }

  .evo-months i {
    width: min(calc(12 * var(--pu)), 80%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: white;
  }

  .evo-months i.is-on {
    background: #01a8c2;
  }

  /* Bolinha do exame. A área de toque tem 29 px; o ponto em si, 13 (19 com halo nas pontas). */
  .evo-point {
    --dot: #fc5d73;
    --r: 6.5;
    position: absolute;
    z-index: 2;
    width: calc(29 * var(--pu));
    height: calc(29 * var(--pu));
    margin: calc(-14.5 * var(--pu)) 0 0 calc(-14.5 * var(--pu));
    border-radius: 50%;
    outline: none;
  }

  .evo-point.is-in {
    --dot: #01c4b8;
  }

  .evo-point--big {
    --r: 9.5;
  }

  .evo-point::before {
    content: '';
    position: absolute;
    inset: 0;
    width: calc(2 * var(--r) * var(--pu));
    height: calc(2 * var(--r) * var(--pu));
    margin: auto;
    border-radius: 50%;
    background: var(--dot);
    transition: scale .15s ease;
  }

  .evo-point--big::before {
    box-shadow: 0 0 0 calc(5 * var(--pu)) #effcfb;
  }

  .evo-point {
    cursor: pointer;
  }

  .evo-point.is-pinned {
    z-index: 3;
  }

  .evo-point:hover,
  .evo-point:focus-visible {
    z-index: 4;
  }

  .evo-point:hover::before,
  .evo-point:focus-visible::before {
    scale: 1.15;
  }

  .evo-point:focus-visible::after {
    content: '';
    position: absolute;
    inset: calc(-3 * var(--pu));
    border: 2px solid var(--color-focus);
    border-radius: 50%;
  }

  .evo-point__value {
    position: absolute;
    bottom: calc(50% + 14 * var(--pu));
    left: 50%;
    display: grid;
    place-items: center;
    min-width: calc(34 * var(--pu));
    height: max(13px, calc(16 * var(--pu)));
    padding: 0 calc(3 * var(--pu));
    border-radius: calc(5 * var(--pu));
    background: #effcfb;
    color: #f5004a;
    font: 700 max(10px, calc(13.5 * var(--pu))) / 1 var(--font-body);
    white-space: nowrap;
    translate: -50% 0;
  }

  .evo-point--big .evo-point__value {
    bottom: calc(50% + 17.5 * var(--pu));
  }

  .evo-point.is-in .evo-point__value {
    color: #3b3f5c;
  }

  /* Balão ao passar o mouse ou focar: dia e mês, distância até a faixa do laudo e peso. */
  .evo-tip {
    position: absolute;
    top: calc(50% + 48.5 * var(--pu));
    left: 50%;
    display: grid;
    justify-items: center;
    gap: calc(5 * var(--pu));
    min-width: calc(61 * var(--pu));
    padding: calc(6 * var(--pu)) calc(8 * var(--pu)) calc(7 * var(--pu));
    border-radius: calc(10 * var(--pu));
    background: linear-gradient(#ff667a, #f84c64);
    color: white;
    font: 600 max(11px, calc(14 * var(--pu))) / 1 var(--font-body);
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    translate: -50% 0;
    transition: opacity .15s ease, visibility .15s;
  }

  .evo-tip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 1px;
    height: calc((48.5 - var(--r)) * var(--pu));
    background: #fc5d73;
    translate: -50% 0;
  }

  .evo-tip--above {
    top: auto;
    bottom: calc(50% + 48.5 * var(--pu));
  }

  .evo-tip--above::before {
    top: 100%;
    bottom: auto;
  }

  .evo-point.is-in .evo-tip {
    background: linear-gradient(#01c7b7, #0186ce);
  }

  .evo-point.is-in .evo-tip::before {
    background: #01c4b8;
  }

  .evo-point:hover .evo-tip,
  .evo-point:focus-visible .evo-tip,
  .evo-point.is-pinned .evo-tip {
    opacity: 1;
    visibility: visible;
  }

  .evo-tip__date {
    line-height: .93;
  }

  .evo-tip__diff {
    display: grid;
    place-items: center;
    min-width: calc(45 * var(--pu));
    height: max(16px, calc(22 * var(--pu)));
    padding: 0 calc(6 * var(--pu));
    border: 1px solid #ff99a7;
    border-radius: calc(8 * var(--pu));
    background: #f5004a;
  }

  .evo-point.is-in .evo-tip__diff {
    border-color: #7bdef2;
    background: #0197c7;
  }

  @media (prefers-reduced-motion: reduce) {
    .evo-item__panel,
    .evo-item__chevron,
    .evo-tip {
      transition: none;
    }

    .evo-chart {
      animation: none;
    }
  }

  .dashboard-panels__bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-panel);
    min-height: 0;
  }

  /*
   * Painel "Atividade física" [design-system/painel-atividade-fisica.svg, 505 × 138].
   * A grade decide largura e altura, então há duas réguas: --h (1px do desenho na largura)
   * e --v (na altura) posicionam; --pu, a menor das duas, dá o tamanho de texto, botão e ícone.
   */
  .activity-panel {
    position: relative;
    container-type: size;
    --h: calc(100cqw / 505);
    --v: calc(100cqh / 138);
    --pu: min(var(--h), var(--v));
    --activity-bg: linear-gradient(103deg, #ff0048, #ff667b 80%);
    min-width: 0;
    min-height: 0;
    z-index: 1;
    overflow: visible; /* a corredora e o botão + passam das bordas do painel */
    border: 1px solid #fff;
    border-radius: var(--radius-panel);
    background: var(--activity-bg);
    box-shadow: 2px 2px 4px rgb(218 52 99 / 10%);
    color: #fff;
  }

  .activity-panel__title {
    position: absolute;
    top: calc(13 * var(--v));
    left: calc(26 * var(--h));
    margin: 0;
    font: 700 calc(20 * var(--pu)) / 1.2 var(--font-display);
  }

  .activity-panel__add {
    position: absolute;
    right: calc(-14 * var(--pu));
    bottom: calc(-14 * var(--pu));
    z-index: 1;
    display: grid;
    width: calc(41 * var(--pu));
    aspect-ratio: 1;
    place-items: center;
    padding: 0;
    border: 1px solid #ff99a7;
    border-radius: calc(15 * var(--pu));
    background: #f5004a;
    color: #fff;
    cursor: pointer;
    transition: background var(--duration-fast) ease, transform var(--duration-fast) ease;
  }

  .activity-panel__add:hover {
    background: #d8003f;
  }

  .activity-panel__add:active {
    transform: scale(.96);
  }

  .activity-panel__add svg {
    width: calc(18.75 * var(--pu));
    height: calc(18.75 * var(--pu));
  }

  .activity-panel__chart {
    position: absolute;
    bottom: calc(42 * var(--v));
    left: calc(26 * var(--h) + 10px); /* 1º ponto 10px à direita; os outros se redistribuem até o fim */
    width: calc(342 * var(--h) - 10px);
    height: calc(22 * var(--v));
    overflow: visible;
  }

  /* Valores sobre/sob cada ponto: mesma caixa do gráfico, em % para acompanhar a escala */
  .activity-panel__values {
    position: absolute;
    bottom: calc(42 * var(--v));
    left: calc(26 * var(--h) + 10px);
    width: calc(342 * var(--h) - 10px);
    height: calc(22 * var(--v));
    margin: 0;
    padding: 0;
    list-style: none;
    pointer-events: none;
  }

  .activity-panel__values li {
    position: absolute;
    width: 0;
    height: 0;
  }

  .activity-panel__val {
    position: absolute;
    left: 0;
    translate: -50% 0;
    font: 600 12px / 1 var(--font-body);
    white-space: nowrap;
  }

  /* só os números; as unidades aparecem ao passar o mouse sobre o painel */
  .activity-panel__unit {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    vertical-align: top;
    opacity: 0;
    transition: max-width var(--duration-fast) ease, opacity var(--duration-fast) ease;
  }

  .activity-panel:hover .activity-panel__unit {
    max-width: 3em;
    opacity: 1;
  }

  /* ponto com selo (troféu no melhor dia, polegar para baixo nos dias zerados): o ponto some (a <path> fica transparente só para manter o tooltip) */
  .activity-panel__chart path.has-badge {
    stroke: transparent;
  }

  /*
   * O círculo de fundo repete o degradê do painel inteiro, deslocado para a posição do troféu
   * (--fx/--fy = fração do ponto no gráfico), então some no fundo e só apara as linhas.
   */
  .activity-panel__badge {
    --d: 28px;
    --x0: calc(26 * var(--h) + 10px + var(--fx) * (342 * var(--h) - 10px) - var(--d) / 2);
    --y0: calc(100cqh - 64 * var(--v) + var(--fy) * 22 * var(--v) - var(--d) / 2);
    position: absolute;
    left: 0;
    top: 0;
    box-sizing: border-box;
    width: var(--d);
    height: var(--d);
    padding: 5px;
    translate: -50% -50%;
    border-radius: 50%;
    background: var(--activity-bg) calc(-1 * var(--x0)) calc(-1 * var(--y0)) / 100cqw 100cqh no-repeat;
    color: #fff;
  }

  .activity-panel__values li.has-badge .activity-panel__val--up { bottom: calc(8 * var(--pu) + 3px); }
  .activity-panel__values li.has-badge .activity-panel__val--down { top: calc(8 * var(--pu) + 3px); }

  .activity-panel__val--up { bottom: calc(8 * var(--pu)); }
  .activity-panel__val--down { top: calc(8 * var(--pu)); }

  .activity-panel__chart polyline {
    fill: none;
    stroke: rgb(255 255 255 / 65%);
    stroke-width: calc(3 * var(--pu));
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .activity-panel__chart path {
    stroke: #fff;
    stroke-width: calc(10 * var(--pu));
    stroke-linecap: round;
  }

  .activity-panel__empty {
    position: absolute;
    bottom: calc(34 * var(--v));
    left: calc(26 * var(--h));
    max-width: calc(330 * var(--h));
    margin: 0;
    font: 500 calc(14 * var(--pu)) / 1.3 var(--font-body);
    opacity: .92;
  }

  .activity-panel__icon {
    position: absolute;
    right: calc(30 * var(--h));
    bottom: calc(-16 * var(--v));
    width: auto;
    height: calc(185 * var(--v)); /* ~130% da altura: passa da borda de cima e de baixo */
    pointer-events: none;
  }



  /*
   * Painel "Rotinas de saúde" [design-system/painel-rotinas-de-saude.svg, 507 × 138].
   * Mesmas réguas do painel de atividade: --h e --v posicionam, --pu dá tamanho.
   */
  .routines-panel {
    position: relative;
    container-type: size;
    --h: calc(100cqw / 507);
    --v: calc(100cqh / 138);
    --pu: min(var(--h), var(--v));
    min-width: 0;
    min-height: 0;
    border: 1px solid #fff;
    border-radius: var(--radius-panel);
    background: linear-gradient(105deg, #01c4b8, #0087cd);
    box-shadow: 2px 2px 4px rgb(218 52 99 / 10%);
    color: #fff;
  }

  .routines-panel__header {
    position: absolute;
    top: calc(12 * var(--v));
    left: calc(16 * var(--h));
    display: flex;
    align-items: center;
    gap: calc(10 * var(--pu));
  }

  .routines-panel__title {
    margin: 0;
    font: 700 calc(20 * var(--pu)) / 1.2 var(--font-display);
  }

  .routines-panel__add {
    display: grid;
    width: calc(26 * var(--pu));
    aspect-ratio: 1;
    place-items: center;
    padding: 0;
    border: 1px solid #7bdef2;
    border-radius: calc(9 * var(--pu));
    background: rgb(255 255 255 / 12%);
    color: #fff;
    cursor: pointer;
    transition: background var(--duration-fast) ease;
  }

  .routines-panel__add:hover {
    background: rgb(255 255 255 / 25%);
  }

  .routines-panel__add .icon,
  .routines-panel__add svg {
    width: calc(16 * var(--pu));
    height: calc(16 * var(--pu));
    stroke-width: 3;
  }

  .routines-panel__list {
    position: absolute;
    top: calc(46 * var(--v));
    right: calc(14 * var(--h));
    bottom: calc(15 * var(--v));
    left: calc(15 * var(--h));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: calc(10 * var(--h));
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* Mais de 3: a faixa rola de lado e a 4ª aparece pela metade; o respiro de cima é do selo "!". */
  .routines-panel__list--scroll {
    top: calc(46 * var(--v) - 17 * var(--pu));
    grid-template-columns: none;
    grid-auto-columns: 30%;
    grid-auto-flow: column;
    padding-top: calc(17 * var(--pu));
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .routines-panel__list--scroll > li {
    scroll-snap-align: start;
  }

  .routines-panel__list > li {
    position: relative;
    min-width: 0;
  }

  .routine-tile {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(8 * var(--v));
    padding: 0 calc(8 * var(--pu));
    border: 1px solid #7bdef2;
    border-radius: calc(15 * var(--pu));
    background: transparent;
    color: #fff;
    font: 600 calc(16 * var(--pu)) / 1.2 var(--font-display);
    cursor: pointer;
    transition: background var(--duration-fast) ease;
  }

  .routine-tile:hover,
  .routine-tile:focus-visible {
    background: rgb(255 255 255 / 25%);
  }

  .routine-tile__name {
    display: flex;
    max-width: 100%;
    align-items: center;
    gap: calc(6 * var(--pu));
  }

  .routine-tile__name > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .routine-tile__name svg {
    flex: none;
    width: auto;
    height: calc(24 * var(--pu));
  }

  .routine-tile__name svg[viewBox="0 0 27 27"] {
    height: calc(27 * var(--pu));
  }

  .routine-tile__name .icon {
    width: calc(24 * var(--pu));
  }

  .routine-tile__status {
    white-space: nowrap;
  }

  .routine-tile__badge {
    position: absolute;
    top: calc(-16.5 * var(--pu));
    right: calc(-7 * var(--pu));
    display: grid;
    width: calc(33 * var(--pu));
    height: calc(33 * var(--pu));
    place-items: center;
    border: 1px solid #ff9e7b;
    border-radius: calc(13 * var(--pu));
    background: #e65800;
    font: 800 calc(24 * var(--pu)) / 1 var(--font-display);
  }

  .routine-tile--suggestion {
    border-style: dashed;
    border-color: rgb(255 255 255 / 55%);
    opacity: .8;
  }

  .routine-tile--suggestion:hover {
    opacity: 1;
  }

  @media (max-width: 1200px) {
    .action {
      gap: 8px;
      border-radius: 18px;
    }
  
    .panel-heading {
      padding-right: 8px;
    }
  }

  /* Ajustes do app: grade ocupa a área principal e listas com rolagem própria. */
  .dashboard {
    height: 100%;
  }

  .panel-slot {
    overflow: hidden;
  }

  .dash-scroll {
    --dash-pad: clamp(10px, .833vw, 16px);
    height: 100%;
    padding: 0 0 0 var(--dash-pad);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* A calha da barra absorve o antigo respiro da direita (--dash-pad): o conteúdo não muda de
     lugar e o polegar fica centralizado entre o fim das linhas e a borda do painel. */
  .dash-scroll::-webkit-scrollbar {
    width: calc(14px + var(--dash-pad));
  }

  /* borda igual nos 4 lados mantém as pontas redondas; a margem vertical compensa a borda maior */
  .dash-scroll::-webkit-scrollbar-track,
  .dash-scroll::-webkit-scrollbar-thumb {
    border-width: calc(4px + var(--dash-pad) / 2);
  }

  .dash-scroll::-webkit-scrollbar-track:vertical {
    margin-block: calc(10px - var(--dash-pad) / 2);
  }

  .journey-card {
    color: inherit;
    text-decoration: none;
  }

  .journey-card:hover {
    box-shadow: 0 6px 18px rgb(59 63 92 / 12%);
  }

  .action {
    border: 1px solid white;
    text-align: left;
  }

}

/* Títulos dos painéis de atividade e rotinas levam à tela própria. */
.panel-link {
  color: inherit;
  text-decoration: none;
}

.panel-link:hover,
.panel-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
