/* v267 — Dashboard: owned access first, empty categories out of the way. */
[data-dash267="hide"] { display: none !important; }

.dash267-loading { margin: 0 0 1.4rem; color: var(--ink-soft, #626760); font-size: .95rem; }

.dash267-grid {
  display: grid; gap: 1rem; align-items: start; margin: 0 0 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.dash267-grid[data-count="1"] { grid-template-columns: minmax(0, 760px); }
.dash267-grid[data-count="0"] { display: none; }
.dash267-grid > section.dashboard-materials {
  margin: 0; min-width: 0;
  padding: 1.2rem 1.3rem 1.3rem;
  border: 1px solid var(--line, #dedfd8); border-radius: 14px; background: #fff;
}
.dash267-grid > section .dashboard-materials__head { margin: 0 0 .6rem; }
.dash267-grid > section .dashboard-materials__head h2 { margin: .2rem 0 0; }
.dash267-grid > section .continue-card,
.dash267-grid > section [data-dashboard-training] .continue-card,
.dash267-grid > section[data-dashboard-family] .continue-card { margin: 0; padding: 0; background: transparent; }

/* owned books need room side by side, so the materials card takes the full row */
.dash267-grid > #materials { grid-column: 1 / -1; }

/* Family card */
.dash267-status { margin: 0; font-family: inherit; font-size: .98rem; letter-spacing: normal; text-transform: none; }
.dash267-status[data-kind="trial"] { color: #2f5148; font-weight: 600; }
[data-dashboard-family][data-dash267-pending] { border-color: rgba(201, 111, 80, .5); border-top: 4px solid var(--terracotta, #d97757); }
.dash267-next {
  display: grid; gap: .15rem; margin: .35rem 0 .2rem; padding: .65rem .85rem;
  border-left: 4px solid var(--terracotta, #d97757); border-radius: 6px; background: rgba(217, 119, 87, .08);
}
.dash267-next strong { font-size: 1.02rem; }
.dash267-next span { font-size: .9rem; color: #5b4238; }

/* nothing owned yet */
.dash267-empty { margin: 0 0 1.6rem; padding: 1.2rem 1.3rem; border: 1px solid var(--line, #dedfd8); border-radius: 14px; background: #fff; }
.dash267-empty h2 { margin: 0 0 .35rem; font-size: 1.2rem; }
.dash267-empty p { margin: 0; color: var(--ink-soft, #626760); max-width: 60ch; }

/* discovery, below owned access */
.dash267-explore { margin: 1.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line, #dedfd8); }
.dash267-explore h2 { margin: 0 0 .5rem; font-size: .95rem; font-weight: 600; color: var(--ink-soft, #626760); }
.dash267-explore ul { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; padding: 0; list-style: none; }
.dash267-explore a { display: inline-flex; min-height: 44px; align-items: center; }

/* Below the two-column breakpoint the sidebar stacked above the content and pushed owned
   access out of the first screen; it now follows the content. */
@media (max-width: 1079px) {
  .dashboard-sidebar { order: 2; }
}

/* narrow phones: keep the primary action of the first card inside the first screen */
@media (max-width: 560px) {
  .dashboard-shell { padding-top: 1.1rem; }
  .dashboard-welcome { margin-bottom: 1rem; gap: .6rem; }
  .dashboard-welcome h1 { font-size: clamp(1.9rem, 9vw, 2.3rem); }
  .dash267-grid > section.dashboard-materials { padding: 1rem 1rem 1.1rem; }
  .dash267-grid > section .dashboard-materials__head { margin-bottom: .4rem; }
  .dash267-status { line-height: 1.4; }
  .dash267-next { margin: .2rem 0 0; padding: .5rem .75rem; }
  .dash267-next span { line-height: 1.4; }
}

/* v280 — выравнивание карточек верхнего ряда.
   Было: align-items:start, поэтому карточка с лишней строкой текста становилась выше соседней,
   а кнопки оказывались на разной высоте. Стало: карточки тянутся на высоту ряда,
   содержимое — колонка, последний блок прижат вниз, поэтому CTA стоят на одной линии.
   Текст при этом не сокращается. */
.dash267-grid { align-items: stretch; }
.dash267-grid > section.dashboard-materials { display: flex; flex-direction: column; }
.dash267-grid > section.dashboard-materials > .dashboard-materials__head { flex: 0 0 auto; }
.dash267-grid > section.dashboard-materials > :last-child { flex: 1 1 auto; display: flex; flex-direction: column; }
.dash267-grid > section.dashboard-materials > :last-child > :last-child { margin-top: auto; }
/* карточка на всю строку выравнивать не нужно — она в ряду одна */
.dash267-grid > #materials > :last-child > :last-child { margin-top: 0; }
