/*
 * The Home of the installed app (includes/app-home.php): a student's dashboard, a tutor's day, a visitor's front door.
 * Sent only to the people who get that Home (index.php, tutor/index.php). One design system with the rest of the site — ink, cream, gold, the site's own type — and
 * the app's conventions: big tap targets (≥ 44 px, the main button 52), text never under 12 px, one primary button per card, rows that are one tap from done.
 * Layout is a single column that fits a 320 px phone and stays readable (640 px) on anything wider.
 */

.ah { padding: 104px 0 36px; }                         /* in a browser tab the site's own header floats over the top of the page: clear it */
.tutor-wrap .ah { padding-top: 10px; }                  /* the tutor portal has its own frame */
@media (max-width: 899.98px) { html.is-app .ah { padding-top: 10px; } }   /* a phone's app bar sits above the page already; the installed DESKTOP window (wider than this) has no app bar, so the site's header still floats over the top and must be cleared */
.ah-wrap { max-width: 640px; margin-inline: auto; padding-inline: 16px; }
.tutor-wrap .ah-wrap { padding-inline: 0; }

/* ---- greeting + search */
.ah-head { margin: 4px 2px 14px; }
.ah-date { margin: 0 0 4px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.ah-head h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.65rem, 6.6vw, 2.2rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink-900); overflow-wrap: anywhere; }
.ah-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 1rem; line-height: 1.45; }
.ah-search { display: flex; align-items: center; gap: 10px; height: 52px; margin: 0 0 18px; padding: 0 18px; border: 1px solid var(--border-color); border-radius: var(--radius-pill); background: var(--white); color: var(--text-muted); box-shadow: 0 8px 20px -14px rgba(20,23,42,0.35); }
.ah-search:focus-within { border-color: var(--ink-900); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nova-gold-400) 45%, transparent); }
.ah-search svg { flex: 0 0 auto; }
.ah-search input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: 1rem; color: var(--ink-900); }
.ah-search input::placeholder { color: var(--text-muted); }
.ah-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 22px; padding: 0; list-style: none; }
.ah-chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-color); border-radius: var(--radius-pill); background: var(--white); color: var(--ink-900); font-size: 0.95rem; font-weight: 600; }
.ah-chips a:active { background: var(--paper-alt); }

/* ---- the one thing that is happening next */
.ah-next { position: relative; margin: 0 0 18px; padding: 20px 20px 18px; border-radius: 24px; background: var(--ink-900); color: var(--white); box-shadow: 0 20px 38px -24px rgba(13,15,26,0.75); }
.ah-next.is-live { box-shadow: 0 0 0 2px #34D399, 0 20px 38px -24px rgba(13,15,26,0.75); }
.ah-next-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 10px; min-height: 28px; margin: 0 0 12px; }
.ah-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--nova-gold-300); }
.ah-pulse { width: 9px; height: 9px; border-radius: 50%; background: #34D399; animation: ah-pulse 1.8s ease-out infinite; }
@keyframes ah-pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); } 100% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } }
.ah-next .cd-pill, .ah-cd { background: rgba(255,255,255,0.14); color: var(--white); font-size: 0.82rem; padding: 4px 12px; }
.ah-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--nova-gold-400); color: var(--ink-900); font-size: 0.78rem; font-weight: 700; }
.ah-next-title { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; line-height: 1.2; color: var(--white); overflow-wrap: anywhere; }
.ah-next-title a { display: block; padding-block: 8px; margin-block: -8px; color: inherit; text-decoration: none; }   /* the title is a link: a finger-sized target without moving anything */
.ah-next-meta { margin: 0 0 14px; font-size: 0.95rem; color: rgba(255,255,255,0.74); }
.ah-next-who { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 0.95rem; color: rgba(255,255,255,0.86); }
.ah-next-who .avatar-initials { width: 32px; height: 32px; font-size: 0.8rem; }
.ah-next-who b { color: var(--white); }
.ah-next-when { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 6px; font-size: 0.95rem; line-height: 1.45; color: rgba(255,255,255,0.9); }
.ah-next-when svg { flex: 0 0 auto; margin-top: 3px; color: var(--nova-gold-300); }
.ah-next-when a { color: var(--nova-gold-300); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ah-next-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.ah-join { flex: 1 1 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: var(--radius-pill); background: var(--nova-gold-400); color: var(--ink-900); font-size: 1.02rem; font-weight: 700; text-decoration: none; transition: transform 0.12s, background-color 0.2s; }
.ah-join:active { transform: scale(0.97); background: var(--nova-gold-300); }
.ah-join.is-plain { background: var(--white); }
.ah-join[aria-disabled="true"] { background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.62); pointer-events: none; }
.ah-ghost { flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 20px; border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius-pill); color: var(--white); font-weight: 600; text-decoration: none; }
.ah-ghost:active { background: rgba(255,255,255,0.1); }
.ah-icon-btn { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.13); color: var(--white); }
.ah-icon-btn:active { background: rgba(255,255,255,0.24); }
.ah-join-hint { margin: 10px 2px 0; font-size: 0.85rem; color: rgba(255,255,255,0.66); }
.ah-join-hint[hidden] { display: none; }
.ah-empty { padding-bottom: 20px; }
.ah-empty .ah-next-title { margin-top: 10px; }

/* ---- shortcuts */
.ah-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.ah-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 88px; padding: 14px 6px 12px; border: 1px solid var(--border-color); border-radius: 18px; background: var(--white); color: var(--ink-900); text-align: center; }
.ah-tile > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--paper-alt); }
.ah-tile b { font-size: 0.82rem; font-weight: 600; line-height: 1.25; }
.ah-tile:active { background: var(--paper-alt); }

/* ---- numbers (tutor) */
.ah-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.ah-kpi { display: grid; gap: 2px; align-content: start; min-height: 88px; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: 18px; background: var(--white); color: var(--ink-900); }
.ah-kpi b { font-family: var(--font-display); font-size: 1.65rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ah-kpi b i { font-style: normal; font-size: 1rem; color: var(--nova-gold-500); }
.ah-kpi span { font-size: 0.86rem; line-height: 1.3; color: var(--text-muted); }
.ah-kpi:active { background: var(--paper-alt); }

/* ---- sections and rows */
.ah-sec { margin: 0 0 24px; }
.ah-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.ah-sec-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--ink-900); }
.ah-sec-head a { font-size: 0.9rem; font-weight: 600; color: var(--ink-900); text-decoration: underline; text-underline-offset: 3px; }
.ah-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ah-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 18px; background: var(--white); color: var(--ink-900); text-decoration: none; transition: background-color 0.15s; }
.ah-row:active { background: var(--paper-alt); }
.ah-ico { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--ink-900); color: var(--nova-gold-300); }
.ah-row.is-gold .ah-ico { background: var(--nova-gold-400); color: var(--ink-900); }
.ah-row.is-danger .ah-ico { background: #B91C1C; color: var(--white); }
.ah-row-t { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.ah-row-t b { font-size: 0.98rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ah-row-t small { font-size: 0.86rem; line-height: 1.35; color: var(--text-muted); overflow-wrap: anywhere; }
.ah-row-t small.ah-when { color: var(--ink-700, #3A3F58); }
.ah-chev { flex: 0 0 auto; color: var(--text-muted); }
.ah-badge, .ah-price { flex: 0 0 auto; font-size: 0.95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ah-price.is-trail { padding: 3px 10px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--color-success) 14%, var(--white)); color: #065F46; font-size: 0.8rem; }
.ah-date-leaf { display: grid; flex: 0 0 auto; align-content: center; justify-items: center; width: 48px; height: 52px; border-radius: 12px; background: var(--paper-alt); line-height: 1; }
.ah-date-leaf i { font-style: normal; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.ah-date-leaf b { margin-top: 3px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--ink-900); }
.ah-date-leaf.is-flex { color: var(--text-muted); }
.ah-calm { display: flex; align-items: center; gap: 10px; margin: 0; padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--color-success) 11%, var(--white)); color: #065F46; font-weight: 600; font-size: 0.95rem; }
.ah-calm svg { flex: 0 0 auto; }

/* ---- book again: a grid of faces, never a carousel */
.ah-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 12px 10px; margin: 0; padding: 0; list-style: none; }
.ah-people a { display: grid; justify-items: center; gap: 6px; padding: 4px 2px; color: var(--ink-900); text-align: center; }
.ah-people .avatar-initials { width: 56px; height: 56px; font-size: 1.1rem; }
.ah-people span { max-width: 100%; font-size: 0.85rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }

/* ---- the visitor's front door */
.ah-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ah-steps li { display: flex; align-items: flex-start; gap: 14px; padding: 14px; border: 1px solid var(--border-color); border-radius: 18px; background: var(--white); }
.ah-steps li > span { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--nova-gold-400); color: var(--ink-900); font-weight: 700; }
.ah-steps b { display: block; font-size: 0.98rem; }
.ah-steps small { display: block; margin-top: 2px; font-size: 0.88rem; line-height: 1.4; color: var(--text-muted); }
.ah-cta { margin: 0 0 8px; padding: 20px; border-radius: 24px; background: var(--ink-900); color: var(--white); }
.ah-cta h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--white); }
.ah-cta p { margin: 0; color: rgba(255,255,255,0.78); font-size: 0.95rem; line-height: 1.45; }

/* ---- the tutor's "are students finding me" line */
.ah-listed { display: flex; align-items: flex-start; gap: 8px; margin: 4px 2px 0; font-size: 0.88rem; line-height: 1.45; color: var(--text-muted); }
.ah-listed svg { flex: 0 0 auto; margin-top: 3px; }
.ah-listed a { font-weight: 600; color: var(--ink-900); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 480px) { .ah-wrap { padding-inline: 20px; } .tutor-wrap .ah-wrap { padding-inline: 0; } }
@media (prefers-reduced-motion: reduce) { .ah-pulse { animation: none; } .ah-join { transition: none; } }
