/* Cotl Alpha — app chrome and page styles.
   Shell/topbar/sidebar and page structures carried over from the approved
   profile-home and category-page kits (ph-* / cp-* class vocabulary kept),
   adjusted for a real app: no showcase bar, real responsive breakpoints.
   Everything else comes from ../styles.css tokens + component styles. */

body { margin: 0; background: var(--surface-page); }
* { box-sizing: border-box; }

/* ---------------- App shell ---------------- */
.ph-topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface-page) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.ph-topbar__inner { max-width: 1040px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.ph-topbar__right { display: flex; align-items: center; gap: 10px; }
.ph-account { background: none; border: 0; padding: 0; cursor: pointer; border-radius: var(--radius-circle); }

.ph-shell { max-width: 1040px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 252px 1fr; gap: 34px; align-items: start; }
.ph-sidebar { position: sticky; top: 60px; align-self: start; padding: 26px 0; display: flex; flex-direction: column; gap: 22px; max-height: calc(100vh - 60px); overflow-y: auto; }
.ph-sidebar__block { padding-bottom: 4px; }
.ph-nav { display: flex; flex-direction: column; gap: 16px; }
.ph-nav__group { display: flex; flex-direction: column; gap: 2px; }
.ph-nav__label { font-family: var(--font-body); font-size: var(--text-caption); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-subtle); margin: 0 0 5px; padding: 0 9px; }
.ph-nav__item { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: var(--radius-md); text-decoration: none; color: var(--text-secondary); font-family: var(--font-body); font-size: var(--text-body-sm); transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.ph-nav__item:hover { background: var(--surface-sunken); color: var(--text-strong); }
.ph-nav__item svg { color: var(--text-muted); flex: none; }
.ph-nav__item:hover svg { color: var(--interactive-text); }
.ph-nav__item--active { background: var(--interactive-surface); color: var(--text-strong); }
.ph-nav__item--active svg { color: var(--interactive-text); }
.ph-nav__item--soon { opacity: 0.55; cursor: default; }
.ph-nav__item--soon:hover { background: none; color: var(--text-secondary); }
.ph-nav__item--soon:hover svg { color: var(--text-muted); }
.ph-nav__name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-nav__item--feature .ph-nav__name { color: var(--interactive-text); }
.ph-navtick { display: inline-flex; flex: none; margin-left: auto; }
.ph-navtick svg { display: block; }
.ph-navsoon { font-family: var(--font-body); font-size: 11px; color: var(--text-subtle); margin-left: auto; flex: none; }
.ph-sidebar__foot { display: flex; flex-direction: column; gap: 8px; padding: 16px 9px 0; border-top: 1px solid var(--border); }
.ph-sidebar__foot a, .ph-sidebar__foot span { font-family: var(--font-body); font-size: var(--text-caption); color: var(--text-muted); text-decoration: none; }
.ph-sidebar__foot a:hover { color: var(--interactive-text); text-decoration: underline; }
.ph-panel { padding: 26px 0 90px; min-width: 0; }

/* ---------------- Profile home ---------------- */
.ph-content { display: flex; flex-direction: column; gap: 34px; }
.ph-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; }
.ph-head__id { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ph-name { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-display-lg); color: var(--text-strong); margin: 0; line-height: 1.05; letter-spacing: var(--tracking-tight); }
.ph-species { font-family: var(--font-body); font-size: var(--text-body); color: var(--text-muted); margin: 0; }
.ph-head__actions { display: flex; align-items: center; gap: 8px; }

.ph-readiness { display: flex; align-items: center; gap: 24px; background: var(--wash-teal); border: 1px solid var(--interactive-line); border-radius: var(--radius-xl); padding: 24px 28px; }
.ph-readiness__lead { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-heading-md); color: var(--teal-900); margin: 0 0 6px; line-height: var(--leading-snug); }
.ph-readiness__sub { font-family: var(--font-body); font-size: var(--text-body); color: var(--teal-900); margin: 0; line-height: var(--leading-normal); opacity: 0.85; }

.ph-section-label { font-family: var(--font-body); font-size: var(--text-caption); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-subtle); margin: 0 0 12px; }
.ph-gaps__list { display: flex; flex-direction: column; gap: 12px; }

.ph-cats { display: flex; flex-direction: column; gap: 26px; }
.ph-cluster__label { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-heading-sm); color: var(--text-strong); margin: 0 0 14px; letter-spacing: var(--tracking-tight); }
.cotl-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ph-cat__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 2px; }
.ph-cat__foot > span:empty { display: none; }
.al-soon { opacity: 0.62; }
.al-soon:hover { transform: none; box-shadow: var(--shadow-sm); }
.al-soonchip { font-family: var(--font-body); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-subtle); background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px 9px; }

.ph-feature { display: flex; gap: 16px; align-items: flex-start; background: var(--surface-card); border: 1px solid var(--accent-line); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); padding: 20px 22px; }
.ph-feature__icon { width: 46px; height: 46px; border-radius: var(--radius-lg); background: var(--accent-surface); color: var(--gold-800); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ph-feature__body { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ph-feature__title { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-heading-sm); color: var(--text-strong); margin: 0; letter-spacing: var(--tracking-tight); }
.ph-feature__text { font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text-secondary); margin: 0; line-height: var(--leading-normal); max-width: 52ch; }

/* ---------------- Category page ---------------- */
.cp-page { display: flex; flex-direction: column; gap: 22px; }
.cp-back { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text-muted); text-decoration: none; padding: 6px 0; }
.cp-back:hover { color: var(--interactive-text); text-decoration: underline; }
.cp-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cp-titlebar__text { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; min-width: 0; }
.cp-title { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-display-md); color: var(--text-strong); margin: 0; line-height: var(--leading-snug); letter-spacing: var(--tracking-tight); text-wrap: pretty; }
.cp-intro { font-family: var(--font-body); font-size: var(--text-body); color: var(--text-secondary); line-height: var(--leading-normal); margin: -6px 0 0; max-width: 56ch; }
.cp-sections { display: flex; flex-direction: column; gap: 16px; }

.cp-headextra { display: inline-flex; align-items: center; gap: 10px; }
.cp-edit { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 8px 10px; margin: -8px -10px; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text-muted); transition: color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard); }
.cp-edit:hover { color: var(--interactive-text); background: var(--surface-sunken); }
.cp-edit:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.cp-editrows { display: flex; flex-direction: column; gap: 14px; }
.cp-editrows + .cp-editrows { margin-top: 14px; }
.cp-editslot { display: grid; grid-template-columns: 104px 1fr auto; gap: 8px; align-items: start; }
.cp-editcontact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cp-editcontact__note { grid-column: 1 / -1; }
.cp-editblock { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-page); }
.cp-editblock__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-editrule { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: start; }
.cp-remove { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-body); font-size: var(--text-caption); color: var(--text-subtle); }
.cp-remove:hover { color: var(--rose-700, #a34); background: var(--surface-sunken); }
.cp-addslot { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: none; border: 0; padding: 8px 0; cursor: pointer; font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--interactive-text); }
.cp-addslot:hover { color: var(--interactive-hover); text-decoration: underline; }
.cp-editfoot { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.cp-slots, .cp-rules, .cp-contacts { display: flex; flex-direction: column; }
.al-seg { display: inline-flex; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.al-seg button { font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text-muted); background: none; border: 0; border-radius: var(--radius-pill); padding: 7px 14px; cursor: pointer; min-height: 36px; }
.al-seg button:hover { color: var(--text-primary); }
.al-seg button.on { background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-sm); }

.cp-editpair { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; align-items: start; }
.cp-value-big { font-family: var(--font-body); font-size: var(--text-body-lg); color: var(--text-strong); }
.cp-medmust { margin-top: 10px; }
.cp-medmedia { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.cp-photocell { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: 240px; }
.cp-phototile { width: 96px; height: 96px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-sunken); display: inline-flex; align-items: center; justify-content: center; font-size: 34px; }
.cp-phototile--img { object-fit: cover; }
.cp-phototile--sm { width: 72px; height: 72px; }
.cp-photoinvite { margin: 0; font-family: var(--font-body); font-size: var(--text-caption); color: var(--text-subtle); line-height: var(--leading-normal); }
.cp-medlink { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--interactive-text); text-decoration: none; padding: 8px 0; }
.cp-medlink:hover { color: var(--interactive-hover); text-decoration: underline; }
.cp-mededitmedia { display: flex; align-items: center; gap: 12px; }
.cp-medstrength { flex: none; }
.al-privnote { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text-muted); margin: -8px 0 0; }
.al-privnote svg { color: var(--text-subtle); flex: none; }

/* The emotional map */
.cp-map { display: flex; flex-direction: column; gap: 38px; max-width: 620px; padding-top: 8px; }
.cp-mapblock { display: flex; flex-direction: column; gap: 12px; }
.cp-mapblock__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cp-mapq { font-family: var(--font-display); font-style: italic; font-weight: var(--weight-regular); font-size: var(--text-heading-md); color: var(--interactive-text); margin: 0; line-height: var(--leading-snug); }
.cp-mapq--empty { color: var(--text-muted); }
.cp-mapanswer { font-family: var(--font-display); font-weight: var(--weight-regular); font-size: var(--text-body-lg); color: var(--text-primary); line-height: var(--leading-relaxed); margin: 0; text-wrap: pretty; white-space: pre-wrap; }
.cp-mapempty { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.cp-mapinvite { font-family: var(--font-body); font-size: var(--text-body); color: var(--text-subtle); line-height: var(--leading-normal); margin: 0; max-width: 46ch; }
.cp-mapedit { display: flex; flex-direction: column; gap: 10px; }

/* ---------------- Setup / onboarding (first run) ---------------- */
.al-setup { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface-page); }
.al-setup__card { width: 520px; max-width: 100%; display: flex; flex-direction: column; gap: 22px; }
.al-obtop { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.al-dots { display: inline-flex; gap: 7px; align-items: center; }
.al-dot { width: 8px; height: 8px; border-radius: var(--radius-circle); background: var(--border); transition: background var(--duration-fast) var(--ease-standard); }
.al-dot--on { background: var(--interactive-text); }
.al-dot--done { background: var(--interactive-line); }
.al-setup__lead--prompt { font-style: italic; font-weight: var(--weight-regular); color: var(--interactive-text); font-size: var(--text-heading-lg); }
.al-photorow { display: flex; align-items: center; gap: 14px; }
.al-obfoot { display: flex; align-items: center; justify-content: space-between; }
.al-quiet { background: none; border: 0; padding: 8px 0; cursor: pointer; font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text-muted); align-self: flex-start; }
.al-quiet:hover { color: var(--interactive-text); text-decoration: underline; }
.al-notecallout { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.al-notecallout .al-quiet { padding: 0; flex: none; }
.al-setup__lead { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-display-md); color: var(--text-strong); margin: 14px 0 0; line-height: var(--leading-snug); letter-spacing: var(--tracking-tight); text-wrap: pretty; }
.al-setup__sub { font-family: var(--font-body); font-size: var(--text-body); color: var(--text-secondary); margin: -10px 0 0; line-height: var(--leading-normal); }
.al-setup__form { display: flex; flex-direction: column; gap: 16px; }
.al-setup__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.al-setup__foot { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.al-setup__note { font-family: var(--font-body); font-size: var(--text-caption); color: var(--text-subtle); margin: 0; line-height: var(--leading-normal); }

/* ---------------- Share overlay + management ---------------- */
.al-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: color-mix(in srgb, var(--navy-900, #1c2b3a) 42%, transparent); }
.al-overlay__panel { width: 660px; max-width: 100%; max-height: calc(100vh - 48px); overflow-y: auto; border-radius: var(--radius-xl); background: var(--surface-card); box-shadow: var(--shadow-lg); }
.al-shares { display: flex; flex-direction: column; gap: 12px; }
.al-shares__list { display: flex; flex-direction: column; gap: 10px; }
.al-shares__empty { padding: 8px 0 0; }

/* ---------------- Recipient guide ---------------- */
.gd-page { max-width: 760px; margin: 0 auto; padding: 34px 20px 90px; display: flex; flex-direction: column; gap: 26px; }
.gd-hero { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); padding: 30px 32px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.gd-hero__pet { display: flex; align-items: center; gap: 16px; align-self: stretch; }
.gd-hero__pet > div { flex: 1; min-width: 0; }
.gd-hero__name { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-display-md); color: var(--text-strong); margin: 0; line-height: 1.1; letter-spacing: var(--tracking-tight); }
.gd-hero__species { font-family: var(--font-body); font-size: var(--text-body); color: var(--text-muted); margin: 2px 0 0; }
.gd-hero__lead { font-family: var(--font-display); font-size: var(--text-heading-sm); font-weight: var(--weight-regular); color: var(--text-primary); margin: 0; line-height: var(--leading-relaxed); text-wrap: pretty; }
.gd-hero__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gd-hero__for { font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text-muted); margin: 0; }
.gd-cat { display: flex; flex-direction: column; gap: 14px; }
.gd-cat__head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 12px; }
.gd-cat__title { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-heading-lg); color: var(--text-strong); margin: 0; letter-spacing: var(--tracking-tight); }
.gd-cat__updated { font-family: var(--font-body); font-size: var(--text-caption); color: var(--text-subtle); flex: none; }
.gd-foot { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding-top: 16px; border-top: 1px solid var(--border); }
.gd-foot p { font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--text-muted); margin: 0; line-height: var(--leading-normal); max-width: 52ch; }
.gd-error { max-width: 460px; margin: 18vh auto 0; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .ph-shell { grid-template-columns: 1fr; gap: 0; padding: 0 18px; }
  .ph-sidebar { display: none; }
  .ph-panel { padding: 20px 0 70px; }
  .ph-content { gap: 28px; }
  .ph-head { grid-template-columns: auto 1fr; grid-template-areas: "avatar id" "actions actions"; row-gap: 18px; }
  .ph-head > .cotl-avatar { grid-area: avatar; }
  .ph-head__id { grid-area: id; }
  .ph-head__actions { grid-area: actions; }
  .ph-head__actions .cotl-btn--primary { flex: 1; }
  .ph-name { font-size: var(--text-display-md); }
  .ph-readiness { gap: 18px; padding: 20px; }
  .ph-readiness__lead { font-size: var(--text-heading-sm); }
  .ph-readiness__sub { font-size: var(--text-body-sm); }
  .cotl-cat-grid { grid-template-columns: 1fr; }
  .cp-title { font-size: var(--text-heading-lg); }
  .cp-editpair { grid-template-columns: 1fr; }
  .cp-editslot { grid-template-columns: 1fr; }
  .cp-editrule { grid-template-columns: 1fr; }
  .cp-editcontact { grid-template-columns: 1fr; }
  .al-setup__row { grid-template-columns: 1fr; }
  .al-overlay { padding: 0; align-items: stretch; }
  .al-overlay__panel { width: 100%; max-height: 100vh; border-radius: 0; }
  .gd-hero { padding: 22px 20px; }
}
