/* Globe app: profile, relation path, photos, crop step, viewer, switches and small shared pieces. */
.p-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px var(--gutter) 0; }
.p-photo { position: relative; border-radius: 50%; transition: transform 160ms var(--ease); }
.p-photo:active { transform: scale(0.97); }
.p-photo .av-xl { box-shadow: 0 0 0 0.5px rgba(30, 45, 65, 0.1) inset, var(--shadow-1); }
.p-photo-badge { position: absolute; right: 2px; bottom: 2px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--bg); }
.p-photo-badge .ph { font-size: 18px; }
.p-add { margin-top: 6px; font-size: var(--s-sub); }
.p-name { margin-top: 8px; max-width: 22ch; }
.p-photo + .p-name { margin-top: 16px; }
.p-alt { margin-top: 4px; color: var(--label-2); }
.p-rel { margin-top: 10px; color: var(--accent); max-width: 34ch; }
.p-life { margin-top: 6px; color: var(--label-2); }
.p-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 24px var(--gutter) 0; }
.act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; border-radius: var(--rad-cell); background: var(--cell); color: var(--accent); font-size: var(--s-sub); line-height: var(--l-sub); font-weight: 600; text-decoration: none; transition: transform 160ms var(--ease), background-color 120ms ease, opacity 160ms ease; }
.act .ph { font-size: 24px; }
.act-primary { background: var(--accent); color: var(--accent-ink); }
.act:active:not(:disabled) { transform: scale(0.97); }
.act:disabled { background: var(--cell); color: var(--label-3); }
@media (hover: hover) { .act:hover:not(:disabled) { background: var(--cell-hover); } .act-primary:hover:not(:disabled) { background: var(--accent-hover); } }
.rel-sentence .row-title { font-weight: 400; line-height: 24px; }
.sub-title { margin: 20px 4px 8px; color: var(--label); }
.path .row { --inset: 68px; }
.path .path-step::after { content: ""; position: absolute; left: 35px; width: 2px; background: var(--accent); opacity: 0.35; top: 50px; bottom: -10px; z-index: 1; }
.path .path-step.is-end::after { display: none; }
.path .path-step.is-start .av, .path .path-step.is-end .av { box-shadow: 0 0 0 2px var(--cell), 0 0 0 4px var(--accent); }
.row.is-former .row-sub { color: var(--label-2); }
.contact-row { gap: 8px; }
.icon-btn.tint { background: var(--accent-soft); }
.icon-btn.tint .ph { font-size: 20px; }
.danger-text, .btn.danger-text { color: var(--danger); }
.with-icon, .row.plain:has(.row-icon) { --inset: 68px; }
.ink-av { flex: none; display: grid; }
.ink-av .av { box-shadow: 0 0 0 2px var(--cell), 0 0 0 4px var(--c); }
:root[data-scheme="dark"] .ink-av .av { --av-rw: 0px; }
.try { display: flex; flex-wrap: wrap; gap: 8px; }
.row.is-active { background: var(--cell-press); }

/* photos */
.ph-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; }
.ph-tile { position: relative; aspect-ratio: 1; border-radius: var(--rad-thumb); overflow: hidden; background: var(--fill); transition: transform 160ms var(--ease), opacity 160ms ease; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; }
.ph-tile.is-profile { box-shadow: 0 0 0 2px var(--accent) inset; }
.ph-tile.is-profile img { border-radius: 6px; padding: 2px; }
.ph-star { position: absolute; left: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.ph-star .ph { font-size: 15px; }
.ph-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--accent); font-size: var(--s-foot); line-height: var(--l-foot); font-weight: 600; padding: 4px; text-align: center; }
.ph-add .ph { font-size: 24px; }
.ph-add:disabled { color: var(--label-3); }
.ph-tile:active:not(:disabled) { transform: scale(0.96); }
.ph-tile.is-held { opacity: 0.7; }
@media (hover: hover) { .ph-tile:hover:not(:disabled) { opacity: 0.88; } }
.ph-tile:focus-visible { outline-offset: 2px; }
@media (min-width: 380px) { .ph-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* crop step */
.crop { padding: 4px var(--gutter) 0; }
.crop-stage { width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1; border-radius: var(--rad-cell); overflow: hidden; background: #0d0f12; touch-action: none; cursor: move; }
.crop-stage canvas { display: block; }
.crop-stage:focus-visible { outline-offset: 3px; }
.crop-tools { display: flex; align-items: center; gap: 12px; max-width: 420px; margin: 16px auto 0; }
.crop-zoom { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.crop-tools .rot { flex: none; padding: 0 14px; }
.crop-zoom input { flex: 1; min-width: 0; width: 100%; height: 44px; accent-color: var(--accent); }
.crop-opt { max-width: 420px; margin: 16px auto 0; }
.switch-row { cursor: pointer; }
.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 51px; height: 44px; margin: 0; background: none; cursor: pointer; }
.switch::before { content: ""; position: absolute; left: 0; top: 6.5px; width: 51px; height: 31px; border-radius: 999px; background: var(--fill-strong); transition: background-color 200ms ease; }
.switch::after { content: ""; position: absolute; left: 2px; top: 8.5px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 260ms var(--ease); }
.switch:checked::before { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.crop-err { max-width: 420px; margin: 12px auto 0; color: var(--danger); font-size: var(--s-sub); line-height: var(--l-sub); }
.crop-err:empty { display: none; }
.modal-crop .footnote, .modal-crop .crop-err { margin-left: auto; margin-right: auto; max-width: 420px; }
.viewer { margin: 0 var(--gutter); border-radius: var(--rad-cell); overflow: hidden; background: #0d0f12; }
.viewer img { width: 100%; max-height: 62vh; object-fit: contain; }
.viewer-actions { display: grid; gap: 10px; margin: 16px var(--gutter) 0; }
.modal-tall .modal-sheet { height: calc(100% - 24px - var(--safe-t)); }
@media (min-width: 700px) { .modal-tall .modal-sheet { height: min(780px, calc(100vh - 48px)); } }
.modal .view { padding-top: 0; }
.modal .group:first-child { margin-top: 8px; }

/* a phone sheet at half (a profile chosen with the globe still above it): a compact card with the portrait beside the
   name, so the name, what they are to you and Contact are in view without a pull; pulled up to full, the header is
   the big centred one again, with the branch and Change photo */
/* the bloom stays round the portrait and fades out inside the card, so it has no edge */
:root[data-layout="sheet"][data-detent="half"] .p-head { display: grid; grid-template-columns: 80px minmax(0, 1fr); column-gap: 16px; align-items: center;
  justify-items: start; min-height: 120px; text-align: left; padding: 20px var(--gutter) 12px; }
:root[data-layout="sheet"][data-detent="half"] .p-head[class*="hue-"] { margin-top: 0; background: radial-gradient(circle 58px at calc(var(--gutter) + 40px) 60px,
  color-mix(in oklab, var(--c) 22%, transparent), color-mix(in oklab, var(--c) 9%, transparent) 55%, transparent 100%) no-repeat; }
:root[data-layout="sheet"][data-detent="half"] .p-head.hue-f { background: radial-gradient(circle 58px at calc(var(--gutter) + 40px) 60px, var(--atmo), transparent 100%) no-repeat; }
:root[data-layout="sheet"][data-detent="half"] .p-head > * { grid-column: 2; }
:root[data-layout="sheet"][data-detent="half"] .p-head > .p-photo { grid-column: 1; grid-row: 1 / span 4; align-self: start; }
:root[data-layout="sheet"][data-detent="half"] .p-head .av-xl { width: 80px; height: 80px; font-size: 28px; }
:root[data-layout="sheet"][data-detent="half"] .p-head .p-photo-badge { width: 30px; height: 30px; right: -2px; bottom: -2px; }
:root[data-layout="sheet"][data-detent="half"] .p-head .p-name { margin-top: 0; max-width: none; }
:root[data-layout="sheet"][data-detent="half"] .p-head .p-rel { margin-top: 4px; }
:root[data-layout="sheet"][data-detent="half"] .p-head .p-life { margin-top: 2px; }
:root[data-layout="sheet"][data-detent="half"] .p-head .p-add, :root[data-layout="sheet"][data-detent="half"] .p-head .p-branch,
:root[data-layout="sheet"][data-detent="half"] .p-head .me-tag.on-portrait { display: none; }
:root[data-layout="sheet"][data-detent="half"] .p-actions { margin-top: 12px; }
