/* Hayyen components. Plain CSS on top of tokens.css; every colour, space and radius is a token.
   Arabic-first: layout uses logical properties (inline-start/end) so the same markup works in RTL and LTR.
   Class prefix: hy-. No JavaScript is required to render any component. */

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 27px;
  color: var(--fg-default);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
}
:lang(en), [lang|="en"] { font-family: var(--font-latin); }
*, *::before, *::after { box-sizing: border-box; }
.hy-num { font-variant-numeric: tabular-nums; }
.hy-muted { color: var(--fg-muted); }
.hy-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.hy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.hy-icon { width: var(--size-icon); height: var(--size-icon); flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.hy-icon--sm { width: var(--size-icon-sm); height: var(--size-icon-sm); }
.hy-icon--lg { width: var(--size-icon-lg); height: var(--size-icon-lg); }
[dir="rtl"] .hy-icon--dir { transform: scaleX(-1); }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.hy-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; } }

/* ---------- Button ---------- */
.hy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--size-touch); padding-inline: var(--space-5);
  border: 1px solid transparent; border-radius: var(--radius-md);
  font: inherit; font-size: 16px; line-height: 20px; font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 120ms cubic-bezier(.2,0,0,1), border-color 120ms, color 120ms;
}
.hy-btn--primary { background: var(--bg-brand); color: var(--fg-on-brand); }
.hy-btn--primary:hover { background: var(--bg-brand-hover); }
.hy-btn--primary:active { background: var(--bg-brand-active); }
.hy-btn--secondary { background: var(--bg-surface); color: var(--fg-brand); border-color: var(--border-strong); }
.hy-btn--secondary:hover { background: var(--bg-brand-subtle); border-color: var(--border-brand); }
.hy-btn--ghost { background: transparent; color: var(--fg-brand); }
.hy-btn--ghost:hover { background: var(--bg-brand-subtle); }
.hy-btn--danger { background: var(--status-danger-solid); color: var(--status-danger-on-solid); }
.hy-btn--sm { min-height: var(--size-touch-portal); padding-inline: var(--space-4); font-size: 14px; border-radius: var(--radius-sm); }
.hy-btn--block { display: flex; width: 100%; }
.hy-btn--icon { padding-inline: 0; width: var(--size-touch); }
.hy-btn--icon.hy-btn--sm { width: var(--size-touch-portal); }
.hy-btn[disabled], .hy-btn[aria-disabled="true"] { background: var(--bg-sunken); color: var(--fg-disabled); border-color: transparent; cursor: not-allowed; }

/* ---------- Input ---------- */
.hy-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.hy-field__label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--fg-default); }
.hy-field__help { font-size: 14px; line-height: 20px; color: var(--fg-muted); }
.hy-input {
  width: 100%; min-height: var(--size-touch); padding: var(--space-3) var(--space-4);
  font: inherit; color: var(--fg-default); background: var(--bg-surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.hy-input::placeholder { color: var(--fg-subtle); }
.hy-input:hover { border-color: var(--fg-muted); }
.hy-input:focus { outline: 2px solid var(--border-focus); outline-offset: 0; border-color: var(--border-focus); }
textarea.hy-input { min-height: 112px; resize: vertical; }
.hy-field--error .hy-input { border-color: var(--status-danger-solid); }
.hy-field--error .hy-field__help { color: var(--status-danger-fg); display: flex; gap: var(--space-1); align-items: center; }
.hy-input[disabled] { background: var(--bg-sunken); color: var(--fg-disabled); }

/* ---------- Card ---------- */
.hy-card {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
}
.hy-card--interactive { cursor: pointer; transition: box-shadow 200ms, border-color 200ms; text-decoration: none; color: inherit; }
.hy-card--interactive:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.hy-card--selected { border: 2px solid var(--border-brand); background: var(--bg-brand-subtle); }
.hy-card__title { margin: 0; font-size: 20px; line-height: 30px; font-weight: 700; }
.hy-card__meta { margin: 0; font-size: 14px; line-height: 23px; color: var(--fg-muted); }

/* ---------- Badge ---------- */
.hy-badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 2px var(--space-2); border-radius: var(--radius-full);
  font-size: 12px; line-height: 18px; font-weight: 700; white-space: nowrap;
  background: var(--bg-sunken); color: var(--fg-muted);
}
.hy-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hy-badge--plain::before { display: none; }
.hy-badge--brand { background: var(--bg-brand-muted); color: var(--fg-on-brand-subtle); }
.hy-badge--success { background: var(--status-success-bg); color: var(--status-success-fg); }
.hy-badge--warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.hy-badge--danger { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.hy-badge--info { background: var(--status-info-bg); color: var(--status-info-fg); }

/* ---------- Avatar ---------- */
.hy-avatar {
  width: var(--size-avatar); height: var(--size-avatar); flex: none;
  border-radius: var(--radius-full); display: inline-grid; place-items: center;
  background: var(--bg-brand-muted); color: var(--fg-on-brand-subtle);
  font-weight: 700; font-size: 16px; line-height: 1; overflow: hidden;
}
.hy-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hy-avatar--sm { width: 32px; height: 32px; font-size: 13px; }
.hy-avatar--lg { width: 64px; height: 64px; font-size: 24px; }
.hy-avatar--therapist { background: var(--bg-sunken); color: var(--fg-default); box-shadow: inset 0 0 0 1px var(--border-default); }
.hy-avatar-group { display: inline-flex; }
.hy-avatar-group .hy-avatar { box-shadow: 0 0 0 2px var(--bg-surface); }
.hy-avatar-group .hy-avatar + .hy-avatar { margin-inline-start: calc(var(--space-2) * -1); }

/* ---------- Navigation ---------- */
.hy-topbar {
  display: flex; align-items: center; gap: var(--space-2);
  min-height: 56px; padding-inline: var(--space-2);
  background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
}
.hy-topbar__title { flex: 1; margin: 0; font-size: 18px; line-height: 28px; font-weight: 700; text-align: center; }
.hy-tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bg-surface); border-top: 1px solid var(--border-subtle);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.hy-tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; color: var(--fg-muted); text-decoration: none;
  font-size: 12px; line-height: 16px; font-weight: 500;
}
.hy-tabbar__item[aria-current="page"] { color: var(--fg-brand); font-weight: 700; }
.hy-tabbar__item[aria-current="page"] .hy-tabbar__pill { background: var(--bg-brand-muted); }
.hy-tabbar__pill { display: grid; place-items: center; width: 56px; height: 32px; border-radius: var(--radius-full); }
.hy-sidebar {
  display: flex; flex-direction: column; gap: var(--space-1);
  width: 248px; padding: var(--space-4) var(--space-3);
  background: var(--bg-surface); border-inline-end: 1px solid var(--border-default);
}
.hy-sidebar__brand { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3) var(--space-5); }
.hy-sidebar__brand img { height: 32px; width: auto; }
.hy-sidebar__section { padding: var(--space-4) var(--space-3) var(--space-1); font-size: 12px; line-height: 16px; font-weight: 700; color: var(--fg-muted); }
.hy-sidebar__item {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--size-touch-portal); padding-inline: var(--space-3);
  border-radius: var(--radius-sm); color: var(--fg-muted); text-decoration: none; font-size: 14px; font-weight: 500;
}
.hy-sidebar__item:hover { background: var(--bg-sunken); color: var(--fg-default); }
.hy-sidebar__item[aria-current="page"] { background: var(--bg-brand-subtle); color: var(--fg-on-brand-subtle); font-weight: 700; }
.hy-sidebar__count { margin-inline-start: auto; font-size: 12px; color: var(--fg-muted); }

/* ---------- Modal and bottom sheet ---------- */
.hy-scrim { position: absolute; inset: 0; background: var(--bg-scrim); display: grid; place-items: center; padding: var(--space-4); }
.hy-scrim--sheet { place-items: end stretch; padding: 0; }
.hy-modal {
  width: min(480px, 100%); background: var(--bg-surface-raised); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4);
}
.hy-modal__title { margin: 0; font-size: 24px; line-height: 34px; font-weight: 700; }
.hy-modal__body { margin: 0; color: var(--fg-muted); }
.hy-modal__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: flex-end; }
.hy-sheet {
  background: var(--bg-surface-raised); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg); padding: var(--space-3) var(--space-4) var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.hy-sheet__grip { width: 40px; height: 4px; border-radius: var(--radius-full); background: var(--border-default); align-self: center; }

/* ---------- Empty state ---------- */
.hy-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-8) var(--space-4); }
.hy-empty__art { width: 72px; height: 72px; border-radius: var(--radius-full); background: var(--bg-brand-subtle); color: var(--fg-brand); display: grid; place-items: center; }
.hy-empty__title { margin: 0; font-size: 20px; line-height: 30px; font-weight: 700; }
.hy-empty__body { margin: 0; max-width: 36ch; color: var(--fg-muted); }

/* ---------- Progress bar (shared) ---------- */
.hy-bar { height: 8px; border-radius: var(--radius-full); background: var(--roadmap-track); overflow: hidden; }
.hy-bar__fill { height: 100%; border-radius: inherit; background: var(--bg-brand); }
.hy-bar__fill--done { background: var(--roadmap-done); }

/* ---------- Milestone roadmap ---------- */
.hy-roadmap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hy-roadmap__step { position: relative; display: grid; grid-template-columns: var(--size-roadmap-point) 1fr; column-gap: var(--space-4); padding-bottom: var(--space-6); }
.hy-roadmap__step:last-child { padding-bottom: 0; }
/* the track runs from this point's centre to the next point */
.hy-roadmap__step::before {
  content: ""; position: absolute; inset-inline-start: calc(var(--size-roadmap-point) / 2 - 2px);
  top: var(--size-roadmap-point); bottom: 0; width: 4px; border-radius: var(--radius-full); background: var(--roadmap-track);
}
.hy-roadmap__step:last-child::before { display: none; }
.hy-roadmap__step--done::before { background: var(--roadmap-done); }
.hy-roadmap__point {
  width: var(--size-roadmap-point); height: var(--size-roadmap-point); border-radius: var(--radius-full);
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: var(--bg-surface); color: var(--fg-muted); border: 2px solid var(--roadmap-upcoming);
  position: relative; z-index: 1;
}
.hy-roadmap__step--done .hy-roadmap__point { background: var(--roadmap-done); border-color: var(--roadmap-done); color: var(--status-success-on-solid); }
.hy-roadmap__step--current .hy-roadmap__point { background: var(--roadmap-current); border-color: var(--roadmap-current); color: var(--fg-on-brand); box-shadow: 0 0 0 6px var(--roadmap-current-halo); }
.hy-roadmap__body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; padding-top: var(--space-1); }
.hy-roadmap__title { margin: 0; font-size: 18px; line-height: 28px; font-weight: 700; }
.hy-roadmap__step--upcoming .hy-roadmap__title { color: var(--fg-muted); font-weight: 500; }
.hy-roadmap__meta { margin: 0; font-size: 14px; line-height: 23px; color: var(--fg-muted); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: center; }
.hy-roadmap__step--current .hy-roadmap__body { background: var(--bg-brand-subtle); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-top: calc(var(--space-2) * -1); }
/* compact horizontal variant for card headers and portal tables */
.hy-roadmap-mini { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; }
.hy-roadmap-mini li { display: flex; align-items: center; flex: 1; }
.hy-roadmap-mini li:last-child { flex: none; }
.hy-roadmap-mini li::after { content: ""; flex: 1; height: 3px; background: var(--roadmap-track); margin-inline: 2px; border-radius: var(--radius-full); }
.hy-roadmap-mini li:last-child::after { display: none; }
.hy-roadmap-mini .is-done::after { background: var(--roadmap-done); }
.hy-roadmap-mini i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--roadmap-upcoming); background: var(--bg-surface); flex: none; }
.hy-roadmap-mini .is-done i { background: var(--roadmap-done); border-color: var(--roadmap-done); }
.hy-roadmap-mini .is-current i { width: 16px; height: 16px; background: var(--roadmap-current); border-color: var(--roadmap-current); box-shadow: 0 0 0 3px var(--roadmap-current-halo); }

/* ---------- Session card ---------- */
.hy-session { display: grid; grid-template-columns: 56px 1fr; gap: var(--space-4); align-items: start; }
.hy-session__date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 64px; border-radius: var(--radius-md); background: var(--bg-brand-subtle); color: var(--fg-on-brand-subtle);
}
.hy-session__day { font-size: 22px; line-height: 26px; font-weight: 800; }
.hy-session__month { font-size: 12px; line-height: 16px; font-weight: 500; }
.hy-session--past .hy-session__date { background: var(--bg-sunken); color: var(--fg-muted); }
.hy-session__main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.hy-session__top { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: space-between; }
.hy-session__title { margin: 0; font-size: 18px; line-height: 28px; font-weight: 700; }
.hy-session__meta { margin: 0; font-size: 14px; line-height: 23px; color: var(--fg-muted); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.hy-session__meta span { display: inline-flex; align-items: center; gap: var(--space-1); }
.hy-session__note { margin: var(--space-2) 0 0; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--bg-sunken); font-size: 14px; line-height: 23px; }

/* ---------- Agenda (therapist day) ---------- */
.hy-agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hy-agenda__slot { display: grid; grid-template-columns: 64px 1fr; gap: var(--space-4); min-height: 64px; border-top: 1px solid var(--border-subtle); padding-block: var(--space-2); }
.hy-agenda__time { font-size: 14px; line-height: 23px; color: var(--fg-muted); font-variant-numeric: tabular-nums; padding-top: var(--space-1); }
.hy-agenda__event {
  display: flex; align-items: center; gap: var(--space-3); min-width: 0;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  background: var(--bg-brand-subtle); color: var(--fg-on-brand-subtle);
}
.hy-agenda__event::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bg-brand); flex: none; }
.hy-agenda__event--done { background: var(--bg-sunken); color: var(--fg-muted); }
.hy-agenda__event--done::before { background: var(--roadmap-done); }
.hy-agenda__event--cancelled { background: transparent; color: var(--fg-muted); border: 1px dashed var(--border-strong); }
.hy-agenda__event--cancelled::before { background: var(--border-strong); }
.hy-agenda__event--cancelled .hy-agenda__who { text-decoration: line-through; }
.hy-agenda__who { font-weight: 700; font-size: 14px; line-height: 20px; }
.hy-agenda__what { font-size: 12px; line-height: 18px; }
.hy-agenda__free { font-size: 14px; color: var(--fg-subtle); padding-top: var(--space-1); }
.hy-agenda__now { position: relative; }
.hy-agenda__now::after { content: ""; position: absolute; inset-inline: 0; top: -1px; height: 2px; background: var(--status-danger-solid); }

/* ---------- Attachment ---------- */
.hy-attach { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); min-width: 0; }
.hy-attach__icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; background: var(--bg-sunken); color: var(--fg-muted); }
.hy-attach__icon--pdf { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.hy-attach__icon--video { background: var(--status-info-bg); color: var(--status-info-fg); }
.hy-attach__icon--audio { background: var(--bg-brand-subtle); color: var(--fg-brand); }
.hy-attach__icon--image { background: var(--status-success-bg); color: var(--status-success-fg); }
.hy-attach__body { flex: 1; min-width: 0; }
.hy-attach__name { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hy-attach__meta { margin: 0; font-size: 12px; line-height: 18px; color: var(--fg-muted); }
.hy-attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); }
.hy-attach-thumb { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-sunken); display: grid; place-items: center; color: var(--fg-muted); }
.hy-attach-thumb__tag { position: absolute; inset-inline-start: var(--space-1); bottom: var(--space-1); padding: 0 var(--space-1); border-radius: var(--radius-xs); background: var(--bg-inverse); color: var(--fg-inverse); font-size: 12px; line-height: 18px; }
.hy-attach-drop { border: 2px dashed var(--border-strong); border-radius: var(--radius-md); padding: var(--space-5); text-align: center; color: var(--fg-muted); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }

/* ---------- Progress summary ---------- */
.hy-progress { display: flex; align-items: center; gap: var(--space-5); }
.hy-ring { width: 112px; height: 112px; flex: none; position: relative; }
.hy-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
[dir="rtl"] .hy-ring svg { transform: rotate(-90deg) scaleY(-1); }
.hy-ring__track { stroke: var(--roadmap-track); fill: none; }
.hy-ring__fill { stroke: var(--bg-brand); fill: none; stroke-linecap: round; }
.hy-ring__label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 18px; line-height: 1; }
.hy-ring__label small { display: block; font-size: 12px; font-weight: 500; color: var(--fg-muted); margin-top: 4px; }
.hy-progress__list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.hy-progress__item { display: flex; flex-direction: column; gap: var(--space-1); }
.hy-progress__head { display: flex; justify-content: space-between; gap: var(--space-2); font-size: 14px; line-height: 20px; }
.hy-progress__head b { font-weight: 500; }
.hy-stat { display: flex; flex-direction: column; gap: 2px; }
.hy-stat__value { font-size: 30px; line-height: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hy-stat__label { font-size: 14px; line-height: 20px; color: var(--fg-muted); }

/* ---------- Achievement ---------- */
.hy-achievement { display: flex; gap: var(--space-4); align-items: flex-start; padding: var(--space-5); border-radius: var(--radius-lg); background: var(--achievement-bg); }
.hy-achievement__badge { width: 56px; height: 56px; flex: none; border-radius: var(--radius-full); background: var(--bg-surface); display: grid; place-items: center; color: var(--achievement-accent); box-shadow: var(--shadow-sm); }
.hy-achievement__badge svg { fill: currentColor; stroke: none; width: 28px; height: 28px; }
.hy-achievement__body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.hy-achievement__kicker { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--fg-brand); }
.hy-achievement__title { margin: 0; font-size: 20px; line-height: 30px; font-weight: 700; }
.hy-achievement__text { margin: 0; font-size: 16px; line-height: 27px; color: var(--fg-muted); }

/* ---------- Case list ---------- */
.hy-cases { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); overflow: hidden; }
.hy-case { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border-subtle); color: inherit; text-decoration: none; }
.hy-case:first-child { border-top: 0; }
.hy-case:hover { background: var(--bg-canvas); }
.hy-case__name { margin: 0; font-weight: 700; font-size: 16px; line-height: 24px; }
.hy-case__sub { margin: 0; font-size: 12px; line-height: 18px; color: var(--fg-muted); }
.hy-case__goal { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; font-size: 14px; line-height: 20px; }
.hy-case__goal span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hy-case__next { font-size: 14px; line-height: 20px; }
.hy-case__next small { display: block; font-size: 12px; color: var(--fg-muted); }
@media (max-width: 720px) {
  .hy-case { grid-template-columns: auto 1fr auto; }
  .hy-case__goal, .hy-case__next { grid-column: 2 / -1; }
}

/* ---------- Data table ---------- */
.hy-table-wrap { overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); }
.hy-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.hy-table th { text-align: start; font-weight: 700; font-size: 12px; line-height: 16px; color: var(--fg-muted); background: var(--bg-canvas); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); white-space: nowrap; }
.hy-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.hy-table tr:last-child td { border-bottom: 0; }
.hy-table tbody tr:hover { background: var(--bg-canvas); }
.hy-table .is-num { text-align: end; font-variant-numeric: tabular-nums; }
.hy-table__who { display: flex; align-items: center; gap: var(--space-3); }
.hy-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }

/* ---------- Plan card ---------- */
.hy-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); align-items: stretch; }
.hy-plan { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-xl); border: 1px solid var(--border-default); background: var(--bg-surface); }
.hy-plan--featured { border: 2px solid var(--border-brand); box-shadow: var(--shadow-md); }
.hy-plan__name { margin: 0; font-size: 20px; line-height: 30px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.hy-plan__price { display: flex; align-items: baseline; gap: var(--space-1); }
.hy-plan__amount { font-size: 36px; line-height: 48px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hy-plan__period { font-size: 14px; color: var(--fg-muted); }
.hy-plan__desc { margin: 0; font-size: 14px; line-height: 23px; color: var(--fg-muted); }
.hy-plan__features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: 14px; line-height: 23px; flex: 1; }
.hy-plan__features li { display: flex; gap: var(--space-2); align-items: flex-start; }
.hy-plan__features svg { color: var(--status-success-fg); margin-top: 2px; }

/* ---------- Logo swap by theme ---------- */
.hy-logo--on-dark { display: none; }
[data-theme="dark"] .hy-logo--on-light { display: none; }
[data-theme="dark"] .hy-logo--on-dark { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .hy-logo--on-light { display: none; } :root:not([data-theme]) .hy-logo--on-dark { display: inline; } }

/* ---------- Slogan (loading and progress lines) ---------- */
.hy-slogan-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-5); padding: var(--space-8) var(--space-4); text-align: center; }
.hy-slogan-dots { display: flex; align-items: center; gap: var(--space-2); }
.hy-slogan-dots i { width: 12px; height: 12px; border-radius: var(--radius-full); border: 2px solid var(--roadmap-upcoming); background: var(--bg-surface); animation: hy-step 1.8s cubic-bezier(.2,0,0,1) infinite; }
.hy-slogan-dots i:nth-child(2) { animation-delay: .3s; }
.hy-slogan-dots i:nth-child(3) { animation-delay: .6s; }
.hy-slogan-dots i:nth-child(4) { animation-delay: .9s; }
@keyframes hy-step { 0%, 15% { background: var(--bg-surface); border-color: var(--roadmap-upcoming); } 35%, 75% { background: var(--roadmap-current); border-color: var(--roadmap-current); } 100% { background: var(--bg-surface); border-color: var(--roadmap-upcoming); } }
.hy-slogan { margin: 0; max-width: 32ch; font-size: 18px; line-height: 30px; color: var(--fg-muted); min-height: 60px; transition: opacity 280ms cubic-bezier(.2,0,0,1); }
.hy-slogan.is-out { opacity: 0; }
.hy-slogan--inline { min-height: 0; font-size: 14px; line-height: 23px; max-width: none; }
.hy-slogan--header { min-height: 0; font-size: 16px; line-height: 27px; color: var(--fg-brand); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .hy-slogan-dots i { animation: none; } .hy-slogan-dots i:first-child { background: var(--roadmap-current); border-color: var(--roadmap-current); } }
