@layer components {
  .card {
    background: var(--white);
    border-radius: var(--radius-card);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .card--bordered { border: 1px solid var(--line); padding: 24px; gap: 8px; }
  .card--flush { padding: 8px 0; gap: 0; }

  .card--dark {
    background: var(--ink);
    color: var(--white);
    padding: 32px;
    gap: 10px;
  }
  .card--dark .eyebrow { color: var(--brand-light); }
  .card__meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; color: var(--line-strong); }

  .card--soft { background: var(--soft); }

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

  .stat {
    background: var(--white);
    border-radius: var(--radius-card);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--ink);
    text-decoration: none;
  }
  .stat--soft { background: var(--soft); }
  .stat__label, .stat__caption { font-size: 13px; color: var(--muted); }
  .stat__value { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.2; }
  a.stat:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }

  /* Bordered row inside a card: to-dos, tasks, materials */
  .item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-option);
    color: var(--ink);
    text-decoration: none;
  }
  a.item:hover { border-color: var(--line-strong); color: var(--ink); }
  .item__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .item__title { font-size: 15px; font-weight: 600; }
  .item__meta { font-size: 13px; color: var(--muted); }

  /* Flash / confirmation notice */
  .flash {
    max-width: 1040px;
    margin: 24px auto 0;
    padding: 14px 18px;
    border-radius: var(--radius-option);
    background: var(--ink);
    color: var(--white);
    font-size: 15px;
  }
  .flash--alert { background: var(--danger-bg); color: var(--danger-fg); font-weight: 600; }
  .flashes { padding: 0 24px; }
  /* Same width as the page's container: mentor screens are wider. */
  .app--mentor .flash { max-width: 1132px; }

  .notice { padding: 14px 18px; border-radius: var(--radius-option); font-size: 15px; }
  .notice--error { background: var(--danger-bg); color: var(--danger-fg); font-weight: 600; }

  .success-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--action-soft);
    color: var(--action);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .success-icon svg { width: 26px; height: 26px; }
}

@layer components {
  .empty { align-items: flex-start; }

  /* Student header on the ficha */
  .profile { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
  .profile__who { display: flex; align-items: center; gap: 18px; flex: 1 1 360px; min-width: 0; }
  .profile__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .profile__name { font-size: 28px; line-height: 1.2; letter-spacing: -0.5px; overflow-wrap: anywhere; }
  .profile__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--muted); }
  .profile__side { display: flex; flex-direction: column; gap: 8px; min-width: 220px; flex: 0 1 260px; }

  .dot--done { background: var(--action); }

  /* Small e-mail preview on the sign-up form */
  .mail-preview { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
  .mail-preview__meta { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
  .mail-preview__meta strong { color: var(--ink); }
  .mail-preview__brand { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; background: var(--ink); font-size: 12px; color: #BDBAB4; }
  .mail-preview__logo { font-size: 20px; font-weight: 700; color: var(--white); }
  .mail-preview__body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
  .mail-preview__title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.3; }
  .mail-preview__text { font-size: 14px; line-height: 1.6; color: var(--body); }
  .mail-preview__pix { background: var(--ink); color: var(--white); border-radius: var(--radius-option); padding: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
  .mail-preview__amount { font-size: 20px; font-weight: 700; white-space: nowrap; }
  .mail-preview__key { font-family: var(--font-mono); font-size: 12px; background: #262624; border-radius: 6px; padding: 10px; word-break: break-all; }
  .mail-preview__note { font-size: 13px; line-height: 1.5; color: var(--line-strong); }
  .mail-preview__note:empty { display: none; }
  .mail-preview__paid { background: var(--action-soft); color: var(--action-dark); border-radius: var(--radius-option); padding: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; }
  .mail-preview__paid strong { font-size: 15px; }
  .mail-preview__pix[hidden], .mail-preview__paid[hidden] { display: none; }
}

@layer components {
  /* Dashboard "next session" card */
  .card--hero { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
  .card--hero__title { font-size: 28px; line-height: 1.2; letter-spacing: -0.5px; }
  .card--hero__aside { max-width: 280px; font-size: 14px; line-height: 1.55; color: var(--line-strong); }

  .onboarding { padding: 36px; gap: 24px; }
  .onboarding__title { font-size: 28px; line-height: 1.2; letter-spacing: -0.5px; }

  /* Mentee journey: 8 sessions */
  .journey { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
  .journey__step { display: flex; align-items: center; gap: 14px; min-height: 40px; font-size: 14px; color: var(--muted); }
  .journey__dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: var(--line-strong); }
  .journey__number { width: 24px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
  .journey__step--done { color: var(--body); }
  .journey__step--done .journey__dot { background: var(--action); }
  .journey__step--next { font-weight: 700; color: var(--ink); }
  .journey__step--next .journey__dot { background: var(--white); border: 2px solid var(--action); }

  /* Key/value rows on the ficha */
  .facts { display: flex; flex-wrap: wrap; gap: 16px 32px; }
  .fact { display: flex; flex-direction: column; gap: 4px; }
  .fact__label { font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
  .fact__value { font-size: 15px; line-height: 1.6; color: var(--body); white-space: pre-line; }
}

@layer components {
  /* Screens (login, mentee dashboard) use the action color for the dark card eyebrow. */
  .card--hero .eyebrow { font-size: 13px; color: var(--action); }
}

@layer components {
  .session-head { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 32px; }
  .session-head__title { font-size: 30px; line-height: 1.2; letter-spacing: -0.6px; }

  .agenda { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
  .agenda li { display: flex; gap: 14px; font-size: 15px; line-height: 1.55; color: var(--body); }
  .agenda__number { width: 20px; flex-shrink: 0; padding-top: 2px; font-family: var(--font-mono); font-size: 13px; color: var(--action); }

  .checks { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
  .checks li { display: flex; gap: 12px; font-size: 15px; line-height: 1.5; color: var(--body); }
  .checks .icon { margin-top: 2px; color: var(--action); }

  .file-row--link { text-decoration: none; min-height: 52px; }
  .file-row--link:hover { border-color: var(--line-strong); }

  /* Card grids: always 2 per row, same height in a row; a lone card keeps half the width. */
  .library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
  .library > * { min-width: 0; }
  @media (max-width: 720px) { .library { grid-template-columns: minmax(0, 1fr); } }
  .library__card { min-height: 200px; display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--white); color: var(--ink); text-decoration: none; }
  a.library__card:hover { border-color: var(--line-strong); color: var(--ink); }
  .library__card--locked { background: transparent; border-style: dashed; border-color: #BDBAB4; }
  .library__title { font-size: 17px; font-weight: 700; line-height: 1.35; }
  .library__meta { margin-top: auto; font-size: 13px; color: var(--muted); }

  .search { position: relative; flex: 0 1 280px; }
  .search__icon { position: absolute; left: 14px; top: 15px; color: var(--muted); }
  .search .search__input { padding-left: 42px; }
}

@layer components {
  .recent { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-option); color: var(--ink); text-decoration: none; }
  .recent:hover { border-color: var(--line-strong); color: var(--ink); }
  .recent__title { font-size: 15px; font-weight: 600; }
}

@layer components {
  .focus__title { font-size: 15px; font-weight: 600; color: var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dots { display: flex; gap: 4px; }
  .dots__item { flex: 1; height: 8px; border-radius: 4px; background: var(--line-strong); }
  .dots__item--done { background: var(--action); }
  .dots__item--here { background: var(--ink); }
  .answer { padding: 32px; gap: 22px; }
  .answer__question { padding: 0; margin-bottom: 18px; font-size: 22px; font-weight: 700; line-height: 1.35; letter-spacing: -0.3px; }
  .submit-bar { position: sticky; bottom: 0; margin: 32px -24px -56px; background: var(--white); border-top: 1px solid var(--line); }
  .submit-bar__inner { max-width: 672px; margin: 0 auto; padding: 16px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
  .submit-bar form { display: contents; }
  .tag--dark { background: #3A3936; color: var(--white); }
  dialog.modal { width: min(560px, calc(100% - 32px)); padding: 28px; border: 0; border-radius: var(--radius-card); }
  dialog.modal::backdrop { background: rgb(21 21 21 / 0.5); }
}

@layer components {
  .result summary { list-style: none; width: fit-content; }
  .result summary::-webkit-details-marker { display: none; }
  .result[open] summary { background: var(--soft); }
  .score { display: flex; align-items: center; gap: 14px; font-size: 14px; }
  .score__tag { width: 140px; flex-shrink: 0; }
  .score__bar { flex: 1; }
  .score__value { width: 44px; text-align: right; font-size: 13px; }
  .score-answer { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
  .score-answer > :first-child { flex: 0 1 320px; }
  .score-answer--right { color: var(--action-dark); }
  .score-answer--wrong { color: var(--danger-fg); }
}

@layer components {
  .agenda-row { color: var(--ink); text-decoration: none; }
  .agenda-row:hover { background: var(--soft); color: var(--ink); }
  .agenda-row__when { width: 64px; flex-shrink: 0; display: flex; flex-direction: column; }
}

@layer components {
  /* Mentor home */
  .dash-hero {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: stretch;
    gap: 24px;
    padding: 32px;
    background: var(--ink);
    color: var(--white);
  }
  .dash-hero__greeting { flex: 1 1 320px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
  .dash-hero__date { font-family: var(--font-mono); font-size: 13px; color: var(--action); }
  .dash-hero__title { font-size: 34px; line-height: 1.15; letter-spacing: -0.8px; }
  .dash-hero__summary { font-size: 15px; color: var(--line-strong); }

  .dash-next {
    flex: 0 1 380px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    border: 1px solid #3A3936;
    border-radius: var(--radius-card-sm);
    background: #1F1F1E;
  }
  .dash-next__label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: #BDBAB4; }
  .dash-next__when { font-size: 15px; font-weight: 600; }
  .dash-next__who { font-size: 13px; color: var(--line-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-next__title { font-size: 17px; font-weight: 700; line-height: 1.35; }

  .avatar--sm { width: 32px; height: 32px; font-size: 12px; }
  .avatar-stack { display: inline-flex; flex-shrink: 0; }
  .avatar-stack .avatar { box-shadow: 0 0 0 2px var(--white); }
  .avatar-stack .avatar + .avatar { margin-left: -10px; }
  .dash-hero .avatar-stack .avatar { box-shadow: 0 0 0 2px #1F1F1E; }

  .dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .dash-stat {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon label" "value value" "caption caption";
    align-items: center;
    gap: 10px 10px;
    padding: 20px;
    border-radius: var(--radius-card);
    background: var(--white);
    color: var(--ink);
    text-decoration: none;
  }
  .dash-stat:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .dash-stat__icon { grid-area: icon; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--soft); color: var(--body); }
  .dash-stat__label { grid-area: label; font-size: 13px; color: var(--muted); }
  .dash-stat__value { grid-area: value; font-size: 30px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.1; }
  .dash-stat__caption { grid-area: caption; font-size: 13px; color: var(--muted); }
  .dash-stat--alert .dash-stat__icon { background: var(--warning-bg); color: var(--warning-fg); }
  .dash-stat--alert .dash-stat__caption { color: var(--warning-fg); font-weight: 600; }

  .dash-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .dash-panel { padding: 0; gap: 0; }
  .dash-panel__head { padding: 22px 24px 14px; }

  .dash-day { display: flex; flex-direction: column; padding: 0 12px 12px; }
  .dash-day__label { padding: 10px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
  .dash-entry { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius-option); color: var(--ink); text-decoration: none; }
  .dash-entry:hover { background: var(--soft); color: var(--ink); }
  .dash-entry__time { width: 52px; flex-shrink: 0; display: flex; flex-direction: column; font-size: 15px; }
  .dash-entry__end { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
  .dash-entry .badge { align-self: center; margin-left: auto; }

  .dash-task { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-option); color: var(--ink); text-decoration: none; }
  .dash-task:hover { border-color: var(--line-strong); color: var(--ink); }
  .dash-task__icon { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--soft); color: var(--body); }
  .dash-task--attention .dash-task__icon { background: var(--danger-bg); color: var(--danger-fg); }
  .dash-task--pending .dash-task__icon { background: var(--warning-bg); color: var(--warning-fg); }
  .dash-task__go { margin-left: auto; color: var(--placeholder); }

  .dash-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 24px 36px; text-align: center; }
  .dash-empty__icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--soft); color: var(--muted); }

  @media (max-width: 960px) {
    .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-columns { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 520px) {
    .dash-stats { grid-template-columns: minmax(0, 1fr); }
    .dash-hero { padding: 24px; }
    .dash-hero__title { font-size: 28px; }
  }
}
