/* home screens: the driver card, the preferred car on its plinth, the last session. Every value comes from a token. */
@layer screens {
  .rtg-home-panel {
    --notch: var(--notch-top-left);
    --notch-fill: linear-gradient(135deg, var(--surface), var(--surface-low));
    --notch-stroke: var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
  }

  .rtg-home__title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0;
  }

  .rtg-home__title .display-xs { line-height: 1.3; }

  .rtg-home__driver { gap: var(--space-4); }

  .rtg-home__driver-head {
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }

  .rtg-home__hello {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
  }

  .rtg-home__greeting {
    overflow: hidden;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    line-height: 1.3;
    letter-spacing: var(--tracking-display);
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .rtg-home__flag {
    --notch: 12px;
    --notch-fill: var(--primary-container);
    --notch-stroke: var(--border-accent);
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--text-accent);
  }

  .rtg-home__flag .rtg-icon { --icon-size: 22px; }

  .rtg-home__figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    max-width: 640px;
  }

  .rtg-home__figure {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .rtg-home__figure-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--fs-xxl);
    font-weight: 500;
    letter-spacing: var(--tracking-tight);
    line-height: var(--lh-tight);
    font-variant-numeric: tabular-nums;
  }

  .rtg-home__grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
    align-items: start;
    gap: var(--gap-normal);
  }

  .rtg-home__garage { padding: var(--space-5) 0 0; gap: 0; }

  .rtg-home__garage-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-4);
    padding: 0 var(--space-5);
  }

  .rtg-home__showroom {
    position: relative;
    height: clamp(260px, 38vh, 420px);
  }

  .rtg-home__showroom > * { height: 100%; }

  .rtg-home__hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: var(--fs-xs);
  }

  .rtg-home__garage-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-2) var(--space-5) var(--space-5);
  }

  .rtg-home__message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: var(--space-5) var(--space-7);
    text-align: center;
  }

  .rtg-home__empty {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .rtg-home__session {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: calc(var(--space-2) * -1);
    padding: var(--space-2);
    border-radius: var(--radius-control);
    transition: background-color var(--duration-hover) var(--ease-standard);
  }

  @media (hover: hover) {
    .rtg-home__session:hover { background: var(--state-hover); }
  }

  .rtg-home__session:active { background: var(--state-press); }

  .rtg-home__session-head {
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }

  .rtg-home__session-outline {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
  }

  .rtg-home__session-outline > * { width: 100%; height: 100%; }

  .rtg-home__session-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
  }

  .rtg-home__best {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
  }

  .rtg-home__best-time {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--fs-xl);
    font-weight: 500;
    letter-spacing: var(--tracking-tight);
    line-height: var(--lh-tight);
    font-variant-numeric: tabular-nums;
  }

  .rtg-home__session-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px var(--space-4);
  }

  @media (max-width: 1099px) {
    .rtg-home__grid { grid-template-columns: minmax(0, 1fr); }
  }

  @media (max-width: 719px) {
    .rtg-home__greeting { font-size: var(--fs-base); }
    .rtg-home__figure-value { font-size: var(--fs-lg); }
    .rtg-home__showroom { height: 240px; }
    .rtg-home__garage-foot { flex-direction: column; align-items: stretch; }
  }
}
