/* Hayyen therapist portal. Builds on ds/tokens.css + ds/bundle.css (hy- components).
   Logical properties throughout: the app shell is RTL (Arabic); the sign-in screens can also run LTR. */

body { margin: 0; background: var(--bg-canvas); color: var(--fg-default); }
html[lang="ar"] body, .portal { font-family: "Tajawal", "Noto Sans", system-ui, sans-serif; }
html[lang="en"] body { font-family: "Noto Sans", system-ui, sans-serif; }
a { color: var(--fg-brand); }
a:hover { color: var(--bg-brand-hover); }
button, input, select, textarea { font-family: inherit; }
[tabindex="-1"]:focus { outline: none; }
.hy-input { box-sizing: border-box; }

/* ---------- App shell ---------- */
.portal { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; background: var(--bg-canvas); }
.portal-main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1200px; box-sizing: border-box; }
.portal-main--wide { max-width: 1400px; }

.portal-sidebar { flex: 1 1 240px; max-width: 272px; width: auto; display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; box-sizing: border-box; background: var(--bg-surface); position: sticky; top: 0; align-self: flex-start; min-height: 100vh; max-height: 100vh; overflow-y: auto; }
.portal-sidebar__top { display: flex; align-items: center; justify-content: space-between; }
.portal-sidebar .hy-sidebar__brand { padding: 0 8px 12px; text-decoration: none; color: var(--fg-default); }
.portal-sidebar__toggle { display: none; }
.portal-sidebar__body { display: flex; flex-direction: column; gap: 2px; }
.portal-sidebar__cta { justify-content: center; margin: 0 4px 10px; min-height: 44px; }
.portal-nav { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--tint-grey-fg); }
.portal-nav:hover { background: var(--bg-brand-subtle); color: var(--brand-deep, var(--tint-violet-fg)); }
.portal-nav[aria-current="page"] { font-weight: 700; color: var(--tint-violet-fg); background: var(--tint-violet-bg); }
.portal-count { margin-inline-start: auto; min-width: 22px; padding: 0 6px; border-radius: 9999px; background: var(--bg-sunken); color: var(--fg-muted); font-size: 12px; line-height: 20px; text-align: center; }
.portal-nav[aria-current="page"] .portal-count { background: var(--bg-surface); }
.portal-sidebar__section { margin: 14px 12px 4px; font-size: 12px; font-weight: 700; color: var(--fg-muted); }
.portal-dot { width: 26px; height: 26px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.portal-nav__two { display: flex; flex-direction: column; line-height: 18px; min-width: 0; flex-grow: 1; }
.portal-nav__two > span, .portal-nav__two > b { font-size: 14px; }
.portal-nav__two small { font-size: 11px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 860px) {
  .portal-sidebar { position: static; max-width: none; flex-basis: 100%; min-height: 0; max-height: none; border-inline-end: 0; border-bottom: 1px solid var(--border-default); padding: 12px; }
  .portal-sidebar__toggle { display: inline-flex; }
  .portal-sidebar__body, .portal-me { display: none; }
  .portal-sidebar.is-open .portal-sidebar__body { display: flex; }
  .portal-sidebar.is-open .portal-me { display: block; }
  .portal-sidebar .hy-sidebar__brand { padding-bottom: 0; }
  .portal-main { padding: 20px 16px 40px; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-head h1 { margin: 0; font-size: 36px; line-height: 48px; font-weight: 700; }
.page-head p { margin: 0; font-size: 16px; line-height: 27px; color: var(--fg-muted); }
@media (max-width: 560px) { .page-head h1 { font-size: 28px; line-height: 38px; } }
.h2 { margin: 0; font-size: 24px; line-height: 34px; font-weight: 700; }
.h3 { margin: 0; font-size: 18px; line-height: 28px; font-weight: 700; }
.muted { color: var(--fg-muted); }
.small { font-size: 14px; line-height: 23px; }
.tiny { font-size: 12px; line-height: 18px; }
.back-link { align-self: flex-start; }

/* ---------- Layout helpers ---------- */
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split__main { flex: 3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.split__side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 220px), 100%), 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hy-card { min-width: 0; }
.card-link { text-decoration: none; color: inherit; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.list-row:first-of-type { border-top: 0; }
.list-row__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row__title { font-size: 16px; line-height: 24px; font-weight: 500; }
.list-row__meta { font-size: 14px; line-height: 23px; color: var(--fg-muted); }
.round-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ---------- Tabs (underline) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-default); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { min-height: 44px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: transparent; color: var(--fg-muted); font-size: 16px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--tint-violet-fg); font-weight: 700; }
.tabs--sm { border-bottom-color: var(--border-subtle); padding: 0 12px; }
.tabs--sm button { min-height: 40px; font-size: 14px; padding: 0 12px; }

/* ---------- Chips: hy-btn--sm with aria-pressed ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hy-btn.chip { background: var(--bg-surface); color: var(--fg-default); border: 1px solid var(--border-default); min-height: 36px; }
.hy-btn.chip[aria-pressed="true"] { background: var(--bg-brand-subtle); color: var(--tint-violet-fg); border-color: var(--accent); font-weight: 700; }
.hy-btn.chip:disabled { background: var(--bg-sunken); color: var(--fg-subtle); text-decoration: line-through; cursor: not-allowed; }

/* Segmented (day / week) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-sunken); }
.seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg-surface); color: var(--fg-default); font-weight: 700; box-shadow: var(--shadow-xs); }

/* ---------- Switch & radio cards ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.switch-row:first-child { border-top: 0; }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; border: 0; border-radius: 9999px; background: var(--fg-disabled); cursor: pointer; padding: 3px; display: flex; justify-content: flex-start; }
.switch::after { content: ""; width: 20px; height: 20px; border-radius: 9999px; background: var(--bg-surface); box-shadow: var(--shadow-xs); }
.switch[aria-checked="true"] { background: var(--bg-brand); justify-content: flex-end; }
.radio-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); text-align: start; cursor: pointer; width: 100%; color: inherit; }
.radio-card[aria-checked="true"] { border-color: var(--accent); background: var(--bg-brand-subtle); }
.radio-card__ring { width: 20px; height: 20px; border-radius: 9999px; border: 2px solid var(--fg-disabled); flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.radio-card[aria-checked="true"] .radio-card__ring { border-color: var(--accent); }
.radio-card[aria-checked="true"] .radio-card__ring::after { content: ""; width: 10px; height: 10px; border-radius: 9999px; background: var(--bg-brand); }
.radio-card__text { display: flex; flex-direction: column; gap: 2px; }
.radio-card__text span { font-size: 14px; color: var(--fg-muted); }

/* ---------- Notices & toast ---------- */
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 15px; line-height: 24px; flex-wrap: wrap; }
.notice > span { flex: 1 1 240px; }
.notice--warn { background: var(--status-warning-bg); color: var(--status-warning-fg); border: 1px solid var(--status-warning-border); }
.notice--danger { background: var(--status-danger-bg); color: var(--status-danger-fg); border: 1px solid var(--status-danger-border); }
.notice--info { background: var(--status-info-bg); color: var(--status-info-fg); border: 1px solid var(--status-info-border); }
.notice--success { background: var(--status-success-bg); color: var(--status-success-fg); border: 1px solid var(--status-success-border); }
.portal-toast { position: fixed; z-index: 60; bottom: 32px; inset-inline-start: 50%; transform: translateX(50%); display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; background: var(--bg-inverse); color: var(--fg-inverse); font-size: 15px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
[dir="ltr"] .portal-toast { transform: translateX(-50%); }
.hy-scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }

/* ---------- Case: sessions accordion ---------- */
.ses-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ses { border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface); overflow: hidden; }
.ses[data-open="true"] { border-color: var(--accent-soft); }
.ses__head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: var(--bg-surface); text-align: start; cursor: pointer; color: inherit; }
.ses[data-open="true"] .ses__head { background: var(--bg-brand-subtle); }
.ses__date { width: 48px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ses__date b { font-size: 20px; }
.ses__date span { font-size: 12px; color: var(--fg-muted); }
.ses__main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ses__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ses__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--fg-muted); }
.ses__meta .hy-row { gap: 4px; }
.ses__chev { transition: transform 160ms; flex-shrink: 0; }
.ses[data-open="true"] .ses__chev { transform: rotate(180deg); }
.ses__body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border-subtle); }
.ses dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.ses dt { font-size: 12px; color: var(--fg-muted); }
.ses dd { margin: 0; font-weight: 500; display: flex; flex-direction: column; gap: 6px; }
.note-block { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; background: var(--bg-canvas); }
.note-block > span { font-size: 13px; font-weight: 700; color: var(--fg-muted); }
.note-block p { margin: 0; line-height: 27px; }
.note-block--private { background: var(--bg-sunken); border: 1px dashed var(--border-default); }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comments li { display: flex; gap: 10px; align-items: flex-start; }
.comments__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.comments__head span:last-child { color: var(--fg-muted); font-size: 12px; }
.comments p { margin: 4px 0 0; line-height: 26px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1 1 auto; min-height: 44px; padding-top: 8px; resize: vertical; }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; position: relative; grid-template-columns: 64px repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: 52px repeat(16, 32px); min-width: 560px; }
.cal-head { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 10px; margin: 0 2px 4px; font-size: 13px; color: var(--fg-default); }
.cal-head b { font-size: 18px; }
.cal-head[data-today="true"] { background: var(--bg-brand-subtle); color: var(--accent); }
.cal-hour { font-size: 12px; color: var(--fg-muted); padding-top: 2px; border-top: 1px solid var(--border-subtle); }
.cal-line { border-top: 1px solid var(--border-subtle); }
.cal-ev { margin: 2px; border-radius: 8px; border: 1px solid; padding: 4px 8px; text-align: start; display: flex; flex-direction: column; gap: 1px; overflow: hidden; cursor: pointer; font-size: 13px; line-height: 17px; min-width: 0; }
.cal-ev b { font-size: 13px; }
.cal-ev span { font-size: 12px; opacity: .9; }
.cal-ev[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--fg-muted); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1px solid; }

/* ---------- Auth (split screen) ---------- */
.auth { min-height: 100vh; box-sizing: border-box; display: flex; flex-wrap: wrap; background: var(--bg-highlight); color: var(--fg-default); }
.auth__main { flex: 1 1 520px; min-width: 0; box-sizing: border-box; padding: 48px 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.auth__top img { display: block; height: 48px; width: auto; }
.auth__form { width: 100%; max-width: 440px; align-self: center; display: flex; flex-direction: column; gap: 16px; }
.auth__form--wide { max-width: 480px; }
.auth__head { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.auth__badge { padding: 2px 12px; border-radius: 9999px; background: var(--tint-violet-bg); color: var(--tint-violet-fg); font-size: 14px; line-height: 20px; font-weight: 500; }
.auth__head h1 { margin: 0; font-size: 36px; line-height: 48px; font-weight: 700; }
.auth__head p { margin: 0; font-size: 16px; line-height: 27px; color: var(--fg-muted); }
.auth-field { display: flex; flex-direction: column; gap: 8px; }
.auth-field label { font-size: 14px; line-height: 20px; font-weight: 500; }
.auth-input { box-sizing: border-box; width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--fg-subtle); border-radius: 8px; background: var(--bg-surface); color: var(--fg-default); font-size: 16px; box-shadow: 0 1px 2px 0 rgb(27 7 62 / .06); }
.auth-input:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.auth-input[dir="ltr"] { font-family: "Noto Sans", system-ui, sans-serif; text-align: start; }
.auth-pass { position: relative; display: flex; }
.auth-pass .auth-input { padding-inline-end: 48px; }
.auth-pass button { position: absolute; inset-inline-end: 2px; top: 2px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--fg-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; }
.auth-submit { min-height: 44px; border: 0; border-radius: 8px; background: var(--bg-brand); color: var(--fg-on-brand); font-size: 16px; line-height: 24px; font-weight: 700; cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.auth-submit:hover { background: var(--bg-brand-hover); color: var(--fg-on-brand); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--fg-muted); font-size: 14px; }
.auth-or::before, .auth-or::after { content: ""; flex-grow: 1; height: 1px; background: var(--border-default); }
.auth-social { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-social button { min-height: 44px; border: 1px solid var(--fg-subtle); border-radius: 8px; background: var(--bg-surface); color: var(--fg-default); font-family: "Noto Sans", system-ui, sans-serif; font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: not-allowed; opacity: .75; }
.auth-social button.is-dark { border-color: #040707; background: #040707; color: var(--fg-on-brand); }
.auth-foot { margin: 0; text-align: center; font-size: 14px; line-height: 23px; color: var(--fg-muted); }
.auth-foot a { font-weight: 700; text-decoration: none; }
.auth-help { margin: 0; font-size: 12px; line-height: 18px; color: var(--fg-muted); }
.auth-help a { text-decoration: none; font-weight: 500; }
.auth-error { padding: 10px 12px; border: 1px solid var(--status-danger-border); border-radius: 8px; background: var(--status-danger-bg); color: var(--status-danger-fg); font-size: 14px; line-height: 23px; }
.auth-ok { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--status-success-border); border-radius: 8px; background: var(--tint-green-bg); color: var(--tint-green-fg); font-size: 14px; line-height: 23px; font-weight: 500; }
.auth__aside { flex: 1 1 560px; min-width: 0; min-height: 420px; box-sizing: border-box; padding: 16px; display: flex; }
.auth__panel { position: relative; flex-grow: 1; border-radius: 32px; overflow: hidden; background: var(--tint-violet-bg); display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; }
.auth__panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.auth__slogan { position: relative; align-self: center; width: 100%; max-width: 440px; box-sizing: border-box; background: var(--bg-surface); border-radius: 24px; padding: 20px 24px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth__dots { display: flex; gap: 6px; }
.auth__dots span { width: 8px; height: 8px; border-radius: 9999px; background: var(--border-default); transition: width 280ms, background 280ms; }
.auth__dots span.is-on { width: 24px; background: var(--bg-brand); }
.auth__dots span.is-past { background: var(--accent-soft); }
.auth__slogan p { margin: 0; min-height: 60px; display: flex; align-items: center; text-align: center; font-size: 20px; line-height: 30px; font-weight: 500; transition: opacity 280ms; }
.lang-btn { min-height: 40px; padding: 0 12px; border: 1px solid var(--border-default); border-radius: 8px; background: var(--bg-surface); color: var(--fg-default); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.lang-btn[lang="en"] { font-family: "Noto Sans", system-ui, sans-serif; }
.lang-btn[lang="ar"] { font-family: "Tajawal", system-ui, sans-serif; }
@media (max-width: 640px) { .auth__main { padding: 24px 16px; } .auth__aside { display: none; } }

/* ---------- Blazor error bar ---------- */
#blazor-error-ui { display: none; position: fixed; inset-inline: 0; bottom: 0; z-index: 1000; padding: 12px 20px; background: var(--status-warning-bg); color: var(--status-warning-fg); box-shadow: var(--shadow-lg); }
#blazor-error-ui .reload { margin-inline-start: 8px; font-weight: 700; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; inset-inline-end: 16px; top: 10px; }

/* ---------- Menus (<details> in the static sidebar; also used inside pages) ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__chev { margin-inline-start: auto; transition: transform 160ms; }
.menu[open] .menu__chev { transform: rotate(180deg); }
.menu__panel { position: absolute; z-index: 40; inset-inline: 4px; top: calc(100% + 4px); display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); box-shadow: var(--shadow-lg); }
.menu__panel--up { top: auto; bottom: calc(100% + 6px); }
.menu__panel--end { inset-inline: auto 0; min-width: 220px; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--tint-grey-fg); font-size: 14px; font-weight: 500; text-align: start; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.menu__item:hover, .menu__item:focus-visible { background: var(--bg-brand-subtle); color: var(--tint-violet-fg); }
.menu__item[aria-current="page"] { background: var(--tint-violet-bg); color: var(--tint-violet-fg); font-weight: 700; }
.menu__item--quiet { color: var(--fg-muted); font-weight: 400; }
.menu__item--link { color: var(--fg-brand); font-size: 13px; }
.menu__item--danger { color: var(--status-danger-fg); }
.menu__sep { margin: 4px 6px; border: 0; border-top: 1px solid var(--border-subtle); }
.menu form { margin: 0; }
.portal-new { margin: 0 4px 10px; }
.portal-new > summary { display: flex; width: 100%; box-sizing: border-box; margin: 0; }
.portal-me { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.portal-me__summary { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.portal-me__summary:hover, .portal-me[open] .portal-me__summary { background: var(--bg-brand-subtle); }
.portal-nav__pin { margin-inline-start: auto; color: var(--accent-soft); flex-shrink: 0; }

/* ---------- Child file ---------- */
.child-head { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px; }
.child-head__text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.child-head__text h1 { margin: 0; font-size: 30px; line-height: 40px; }
.child-head__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.child-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--fg-muted); }
.child-facts b { color: var(--fg-default); font-weight: 500; }
.child-facts span { margin-inline-end: 4px; }
.pin-btn[aria-pressed="true"] { color: var(--tint-violet-fg); background: var(--tint-violet-bg); border-color: var(--accent-soft); }
.empty-feature { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.empty-feature .round-icon { background: var(--tint-violet-bg); color: var(--tint-violet-fg); }

/* ---------- Today: customizable ---------- */
.today-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.today-widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 24px; align-items: start; }
.today-widgets > .hy-card { gap: 12px; }
.customize { border: 2px solid var(--accent-soft); background: var(--bg-highlight); gap: 20px; }
.customize__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px 32px; }
.customize__group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.customize__group h3 { margin: 0; font-size: 16px; }
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.order-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-surface); }
.order-list li[data-off="true"] { opacity: .6; }
.order-list li > span { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.order-list li small { color: var(--fg-muted); font-size: 12px; }
.hy-btn.chip .chip__n { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 9999px; background: var(--bg-brand); color: var(--fg-on-brand); font-size: 11px; }

/* ---------- Dark theme details (colours themselves come from the tokens) ---------- */
:root[data-theme="dark"] img[src*="logo"] { filter: brightness(0) invert(0.93); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) img[src*="logo"] { filter: brightness(0) invert(0.93); } }

/* ---------- List search ---------- */
.list-search { position: relative; flex: 1 1 240px; max-width: 420px; min-width: 0; }
.list-search .hy-input { width: 100%; padding-inline: 40px 36px; }
.list-search__icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-subtle); pointer-events: none; }
.list-search__clear { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.list-search__clear:hover { background: var(--bg-sunken); }
.list-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search-empty { margin: 0; padding: 16px 0; color: var(--fg-muted); }

/* ---------- Hayyen Network ---------- */
.nmap { position: relative; height: 520px; border-radius: 20px; overflow: hidden; border: 1px solid var(--border-default); background: var(--map-land); }
.nmap svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.nmap__pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; }
.nmap__dot { border-radius: 9999px; background: var(--bg-surface); color: var(--tint-violet-fg); border: 3px solid var(--accent); box-shadow: var(--shadow-md); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.nmap__pin[aria-pressed="true"] .nmap__dot { background: var(--bg-brand); color: var(--fg-on-brand); }
.nmap__pin--me .nmap__dot { border-style: dashed; }
.nmap__stem { width: 3px; height: 8px; background: var(--accent); }
.nmap__name { margin-top: 2px; padding: 1px 6px; border-radius: 6px; background: var(--bg-surface); color: var(--fg-default); font-size: 11px; font-weight: 700; white-space: nowrap; }
.net-card { gap: 10px; cursor: pointer; }
.net-card[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.net-card__head { display: flex; gap: 12px; align-items: flex-start; }
.net-card__who { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* ---------- Family demo: a phone running the family's app (routine and goal builders, Library) ---------- */
.play-scrim { background: var(--bg-scrim); overflow-y: auto; align-items: flex-start; }
.play { margin: auto; display: flex; gap: 24px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; max-width: 780px; }
.play__side { flex: 1 1 240px; max-width: 320px; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 20px; background: var(--bg-surface-raised); box-shadow: var(--shadow-xl); }
.phone { flex: 0 0 auto; width: 360px; max-width: 100%; height: min(720px, calc(100dvh - 48px)); min-height: 540px; padding: 10px; border-radius: 44px; background: var(--phone-frame); box-shadow: var(--shadow-xl); }
.phone__screen { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 34px; background: var(--bg-canvas); color: var(--fg-default); }
.phone__status { flex-shrink: 0; display: flex; justify-content: space-between; padding: 10px 24px 4px; font-size: 12px; font-weight: 700; color: var(--fg-muted); }
.phone__bar { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 4px 10px; border-bottom: 1px solid var(--border-subtle); }
.phone__bar > b { flex: 1; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.phone__foot { flex-shrink: 0; display: flex; gap: 8px; padding: 12px 16px 18px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface); }
.phone__home { background: var(--bg-sunken); }
.phone__ghost { flex-shrink: 0; height: 110px; border-radius: 16px; background: var(--bg-surface); opacity: .7; }
.phone__card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface); color: inherit; font: inherit; }
.phone__sheet { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; max-height: 82%; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 22px; border-radius: 24px 24px 0 0; background: var(--bg-surface-raised); box-shadow: 0 -8px 24px rgb(0 0 0 / .18); }
.phone__sheet::before { content: ""; align-self: center; width: 40px; height: 4px; border-radius: 9999px; background: var(--border-strong); }
.phone__toast { align-self: center; padding: 10px 14px; border-radius: 12px; background: var(--bg-inverse); color: var(--fg-inverse); font-size: 13px; text-align: center; }
.phone__why { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 0; border-radius: 12px; background: var(--status-warning-bg); color: var(--status-warning-fg); font: inherit; text-align: start; cursor: pointer; }
.phone__outline, .phone__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.phone__outline li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg-surface); font-size: 14px; }
.phone__timer { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; border-radius: 16px; background: var(--bg-brand-subtle); text-align: center; }
.phone__timer > b { font-size: 44px; line-height: 1; color: var(--tint-violet-fg); }
.phone__quote { margin: 0; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-inline-start: 3px solid var(--accent); border-radius: 8px; background: var(--bg-surface); font-size: 14px; line-height: 22px; }
.phone__step { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface); color: inherit; font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.phone__num { flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 9999px; background: var(--tint-violet-bg); color: var(--tint-violet-fg); font-size: 12px; font-weight: 700; }
.phone__detail { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 4px; padding-inline-start: 44px; }
.phone .hy-field__label { font-size: 15px; }
@media (max-width: 720px) { .play__side { max-width: none; } .phone { width: 100%; height: min(680px, calc(100dvh - 32px)); } }

/* ---------- Routine and goal builders ---------- */
.step-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface); }
.step-card__head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step-card__head .seg { margin-inline-end: auto; }
.step-num { flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9999px; background: var(--tint-violet-bg); color: var(--tint-violet-fg); font-weight: 700; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flow li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.flow li > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone__error { flex-shrink: 0; margin: 0; padding: 8px 16px; background: var(--status-danger-bg); color: var(--status-danger-fg); font-size: 13px; }
.step-card__head--title { flex-wrap: nowrap; }
@media (max-width: 560px) { .step-card__head--title { flex-wrap: wrap; } .step-card__head--title > .hy-input { order: 9; flex-basis: 100% !important; } }
