/* CrushEats, the signed-in screens (M37): profile tabs, Settings rows and sheets, notifications, saved lists,
   people lists, the composer steps. Built on the same tokens as app.css (The Fig); loaded after it. */

/* ---------------------------------------------------------------- small shared pieces */
.avatar.lg { width: 56px; height: 56px; font-size: 1.4rem; }
.icon-btn.outlined { border: 1px solid var(--c-line-2); background: var(--c-card); }
.icon-btn.outlined:hover { border-color: var(--c-ink-3); }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.page-head-row > div { min-width: 0; }
.group-h { font-family: var(--f-body); font-size: var(--t-xs); font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-ink-3); margin: var(--s-5) 0 var(--s-2); }
.warn-text { color: var(--c-rose-ink); }
.btn-danger-quiet { background: transparent; border-color: var(--c-line-2); color: var(--c-rose-ink); margin-top: var(--s-3); }
.bell { position: relative; }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--c-rose); box-shadow: 0 0 0 2px var(--c-paper); }
.sidenav .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--c-rose); color: #fff; font-size: 0.75rem; font-weight: 800; display: grid; place-items: center; }
.empty-soft { background: var(--c-card); border-radius: var(--r-lg); padding: var(--s-5); text-align: center; box-shadow: var(--shadow-1); list-style: none; }
.empty-soft p { margin: 0 0 var(--s-3); color: var(--c-ink-2); }
.empty-soft.wide { grid-column: 1 / -1; }
.empty-state { text-align: center; padding: var(--s-7) var(--s-4); }
.empty-state h2 { margin: var(--s-3) 0 var(--s-2); }
.empty-state p { color: var(--c-ink-2); max-width: 34ch; margin: 0 auto var(--s-4); }
.empty-mark { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--c-blush-wash); color: var(--c-rose); }
.empty-mark svg { width: 32px; height: 32px; }
.lock-note { display: flex; align-items: center; gap: 6px; }
.lock-note svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- sheets (native <dialog>) */
.sheet { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; overflow: hidden; }
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(52, 32, 42, 0.38); }
.sheet[open] { display: grid; place-items: end center; }
.sheet-card { width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column; background: var(--c-paper); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3); overflow: hidden; animation: sheet-up .28s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: var(--s-2); padding: 8px 12px 8px 8px; border-bottom: 1px solid var(--c-line); background: var(--c-paper); }
.sheet-head h2 { font-size: 1.25rem; text-align: center; font-family: var(--f-display); }
.sheet-head > :last-child { justify-self: end; min-width: 44px; }
.sheet-body { padding: var(--s-4) var(--s-4) var(--s-5); overflow-y: auto; }
.sheet-body > :first-child { margin-top: 0; }
form.sheet-card { display: flex; }
@media (min-width: 700px) {
  .sheet[open] { place-items: center; }
  .sheet-card { border-radius: var(--r-xl); max-height: 86dvh; }
}
body:has(dialog[open]) { overflow: hidden; }

/* ---------------------------------------------------------------- Settings: grouped rows */
.me-card { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); background: var(--c-card); border-radius: var(--r-lg); box-shadow: var(--shadow-1); text-decoration: none; margin-bottom: var(--s-2); }
.me-card > span:not(.avatar) { flex: 1; min-width: 0; }
.me-card .avatar { flex: none; }
.me-card strong { display: block; font-family: var(--f-display); font-size: 1.25rem; }
.me-card > svg { color: var(--c-ink-3); width: 18px; height: 18px; }
.rows.card { padding: 0; overflow: hidden; margin-bottom: var(--s-2); }
.row-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 60px; padding: 10px var(--s-4); background: none; border: 0; border-bottom: 1px solid var(--c-line); text-align: left; text-decoration: none; cursor: pointer; color: var(--c-ink); }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--c-paper); }
.row-item > span { flex: 1; min-width: 0; display: block; }
.row-item strong { display: block; font-weight: 700; }
.row-item span span { display: block; font-size: var(--t-sm); color: var(--c-ink-3); font-weight: 400; overflow-wrap: anywhere; }
.row-item > svg { width: 18px; height: 18px; color: var(--c-ink-3); }
.row-item.danger strong { color: var(--c-rose-ink); }
.signout { margin-top: var(--s-5); }

/* ---------------------------------------------------------------- profile */
.stats { gap: var(--s-6); }
a.stat { text-decoration: none; }
a.stat:hover strong { color: var(--c-rose-ink); }
.person-actions { align-items: center; }
.person-actions .btn { min-width: 0; }
.person-actions .btn-primary, .person-actions .btn-block-inline { flex: 0 1 auto; }
.person-actions .grow .btn { width: 100%; }
.taste-line { margin: 0 0 var(--s-4); padding: 10px 0; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); font-size: var(--t-sm); }
.taste-line a { font-weight: 700; color: var(--c-basil-ink); }
.top5-list .t-note, .crush-list .t-note { display: block; margin-top: 4px; font-size: var(--t-xs); color: var(--c-ink-2); line-height: 1.35; }
.top5-list .t-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 700px) { .top5-list { grid-auto-columns: 30%; } }
.ptabs { display: flex; border-bottom: 1px solid var(--c-line); margin: var(--s-5) -16px var(--s-3); padding: 0 16px; }
.ptabs a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 var(--s-2); text-decoration: none; color: var(--c-ink-3); font-weight: 700; font-size: var(--t-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ptabs a svg { width: 18px; height: 18px; }
.ptabs a[aria-current="page"] { color: var(--c-ink); border-color: var(--c-rose); }
.ptabs.two { margin-top: 0; }
@media (min-width: 1000px) { .ptabs { margin-left: 0; margin-right: 0; padding: 0; } }
.crush-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.crush-list a { display: flex; gap: var(--s-3); padding: 10px; background: var(--c-card); border-radius: var(--r-md); box-shadow: var(--shadow-1); text-decoration: none; }
.crush-list img, .crush-list .img-ph { width: 76px; height: 76px; border-radius: var(--r-sm); object-fit: cover; flex: none; background: var(--c-blush-wash); }
.crush-list .t { min-width: 0; }
.crush-list .t strong { display: block; font-family: var(--f-display); font-size: 1.1rem; line-height: 1.2; }
.crush-list .t > span { font-size: var(--t-sm); color: var(--c-ink-3); }
.crush-list .t .t-note { color: var(--c-ink-2); }
.crush-list .t-note b { color: var(--c-rose-ink); }
.place-rows { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: grid; gap: var(--s-2); }
.place-rows li { display: flex; align-items: center; gap: var(--s-2); background: var(--c-card); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding-right: 8px; }
.place-rows a { flex: 1; display: flex; align-items: center; gap: var(--s-3); padding: 12px 14px; text-decoration: none; min-width: 0; }
.place-rows a > svg { color: var(--c-basil); }
.place-rows strong { display: block; }
.place-rows a span span { font-size: var(--t-sm); color: var(--c-ink-3); }

/* people lists */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.people li { display: flex; align-items: center; gap: var(--s-3); padding: 10px 12px; background: var(--c-card); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.people .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s-3); text-decoration: none; }
.people .who strong { display: block; }
.people .btn[aria-pressed="true"] { background: var(--c-pistachio-wash); border-color: var(--c-basil); color: var(--c-basil-ink); }
.people .empty-soft { display: block; }

/* ---------------------------------------------------------------- notifications */
.soft-ask { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; background: var(--c-card); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s-3) var(--s-4); font-size: var(--t-sm); margin-bottom: var(--s-4); }
.soft-ask > span { flex: 1 1 220px; }
.note-group { margin-bottom: var(--s-4); }
.note-day { font-family: var(--f-body); font-size: var(--t-xs); font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-ink-3); margin: var(--s-4) 0 var(--s-2); }
.notes.card.flush { padding: 0; overflow: hidden; }
.notes li { padding: 0; }
.notes li.unread { font-weight: 400; background: color-mix(in srgb, var(--c-blush-wash) 60%, #fff); }
.note-link { display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: 12px var(--s-4); text-decoration: none; }
.note-link:hover { background: var(--c-paper); }
.notes li.unread .note-link:hover { background: var(--c-blush-wash); }
.notes .ico { background: transparent; }
.notes .ico .avatar { width: 40px; height: 40px; }
.notes li:not(:has(.avatar)) .ico { background: var(--c-pistachio-wash); }
.note-text { flex: 1; min-width: 0; font-size: 0.9375rem; line-height: 1.4; }
.note-text strong { font-weight: 700; }
.note-text .when { display: block; margin-top: 2px; }
.note-link .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c-rose); }

/* ---------------------------------------------------------------- saved lists */
.list-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.list-cards a, .list-cards button { display: grid; gap: 2px; width: 100%; text-align: left; text-decoration: none; background: transparent; border: 0; padding: 0; cursor: pointer; color: inherit; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--c-blush-wash); margin-bottom: 8px; box-shadow: var(--shadow-1); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.mosaic svg { grid-column: 1 / -1; grid-row: 1 / -1; place-self: center; width: 32px; height: 32px; color: var(--c-basil); }
.mosaic-1 img { grid-column: 1 / -1; grid-row: 1 / -1; }
.mosaic-2 img { grid-row: 1 / -1; }
.mosaic-3 img:first-child { grid-row: 1 / -1; }
.list-cards .name { font-weight: 700; }
.list-cards .meta { font-size: var(--t-sm); color: var(--c-ink-3); }
.list-cards .new-list button { aspect-ratio: 1; align-content: center; justify-items: center; border: 1.5px dashed var(--c-rose); border-radius: var(--r-md); color: var(--c-rose-ink); font-weight: 700; background: var(--c-card); gap: 6px; }
.list-cards .new-list svg { width: 28px; height: 28px; }
@media (min-width: 700px) { .list-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.saved-tile { position: relative; }
.saved-tile form { position: absolute; top: 6px; right: 6px; }
.remove-chip { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(250, 247, 245, 0.95); color: var(--c-ink); cursor: pointer; box-shadow: var(--shadow-1); }
.remove-chip svg { width: 14px; height: 14px; }

.taste-label { font-size: var(--t-xs); font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-basil-ink); }
.stat strong { font-family: var(--f-body); font-weight: 700; font-size: 1.25rem; }

/* ---------------------------------------------------------------- the composer */
body.is-compose .compose-bar { position: static; padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; display: grid; gap: var(--s-2); margin-top: var(--s-5); }
body.is-compose .column { padding-bottom: calc(env(safe-area-inset-bottom) + 40px); }
body.is-compose .compose-bar .btn { margin: 0; min-height: 50px; }
.compose-top { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-3); min-height: 44px; }
.compose-top h1 { font-size: 1.5rem; text-align: center; grid-column: 2; }
.compose-top .linkish { grid-column: 1; justify-self: start; text-decoration: none; color: var(--c-ink-2); font-weight: 600; }
.compose-top .step-count { display: none; }
.steps-bar { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 var(--s-4); padding: 0; }
.steps-bar li { height: 3px; border-radius: 3px; background: var(--c-line-2); }
.steps-bar li.on { background: var(--c-ink); }
.step-h { font-family: var(--f-body); font-size: var(--t-xs); font-weight: 800; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-ink-3); margin: 0 0 var(--s-3); }
.step-count-line { font-size: var(--t-sm); color: var(--c-ink-3); }
.compose .dropzone { padding: var(--s-7) var(--s-4); }
.cover-preview { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 5; max-height: 52svh; margin: 0 auto var(--s-3); background: var(--c-blush-wash); box-shadow: var(--shadow-1); }
.cover-preview[hidden] { display: none; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-tag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(250, 247, 245, 0.95); font-size: 0.75rem; font-weight: 800; }
.tray-item::after { content: none !important; }
.tray-item .num { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(250, 247, 245, 0.95); font-size: 0.6875rem; font-weight: 800; }
.tray-tools-bar { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-2) 0; }
.tray-tools-bar[hidden] { display: none; }
.tray-tools-bar .chip[disabled] { opacity: 0.4; }
.tray-tools-bar .chip { cursor: pointer; }
.compose .step-1 .tray { grid-auto-columns: 84px; }
.compose .field-where input { padding-left: 14px; }
.suggest { top: calc(100% - 20px); max-height: 60svh; overflow-y: auto; }
.suggest button { padding: 10px 12px; }
.suggest mark { background: var(--c-blush-wash); color: inherit; border-radius: 3px; }
.suggest em { display: block; font-style: normal; font-size: var(--t-xs); color: var(--c-rose-ink); font-weight: 600; margin-top: 2px; }
.dish-tiles { margin-top: var(--s-3); }
.dish-tiles-row { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.dish-tile { border: 0; padding: 0; background: var(--c-card); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-1); text-align: left; cursor: pointer; }
.dish-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.dish-tile span { display: block; padding: 4px 8px 6px; font-size: var(--t-xs); font-weight: 700; line-height: 1.2; }
.crush-card { border: 1.5px solid var(--c-ink); border-radius: var(--r-lg); padding: var(--s-4); background: var(--c-card); margin-bottom: var(--s-3); }
.crush-toggle { display: flex !important; align-items: center; justify-content: space-between; gap: var(--s-3); margin: 0 !important; cursor: pointer; }
.crush-toggle > span { display: block; }
.crush-toggle strong { display: block; font-size: 1rem; }
.crush-toggle .small { font-weight: 400; display: block; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 30px; padding: 0; border-radius: 30px; background: var(--c-line-2); border: 0; position: relative; cursor: pointer; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s var(--ease); }
input.switch:checked { background: var(--c-rose); }
input.switch:checked::after { transform: translateX(22px); }
input.switch:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.crush-how { margin-top: var(--s-2); border-top: 1px solid var(--c-line); }
.crush-how[hidden] { display: none; }
.count { float: right; font-weight: 400; font-size: var(--t-xs); color: var(--c-ink-3); }
.compose textarea { width: 100%; }
.chips-field { border: 0; padding: 0; margin: var(--s-3) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chips-field legend.label { width: 100%; padding: 0; }
.draft-save { margin-top: var(--s-3); }
.held-banner strong { display: block; }
@media (max-width: 999px) {
  .compose[data-stepped] .step { display: none; }
  .compose[data-stepped] .step.on { display: block; }
  .compose[data-stepped] .steps-23 { display: contents; }
  .compose-top .step-count { display: block; grid-column: 1 / -1; grid-row: 2; text-align: center; font-size: var(--t-sm); color: var(--c-ink-3); }
  .compose-top #step-back { grid-column: 1; }
  .compose-top .linkish[hidden] { display: none; }
}
@media (min-width: 1000px) {
  body.is-compose .shell { grid-template-columns: var(--w-nav) minmax(0, 940px); }
  body.is-compose .rail { display: none; }
  body.is-compose .column { max-width: 940px; }
  .compose-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
  .compose-grid .step-1 { position: sticky; top: var(--s-4); }
  .steps-23 .step { background: var(--c-card); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s-5); margin-bottom: var(--s-4); }
  .steps-bar { display: none; }
  .compose-top { grid-template-columns: 1fr; }
  .compose-top h1 { text-align: left; grid-column: 1; font-size: 2.125rem; }
  #compose-cancel { display: none; }
  body.is-compose .compose-bar { grid-template-columns: 1fr 1fr; max-width: 480px; margin-left: auto; }
  body.is-compose .compose-bar .btn { width: auto; }
}
/* the preview sheet: the post the way it will read */
.preview-post { background: var(--c-card); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; padding-bottom: var(--s-4); }
.pv-media { position: relative; aspect-ratio: 4 / 5; max-height: 46svh; width: 100%; background: var(--c-blush-wash); display: grid; place-items: center; font-weight: 700; }
.pv-media img { width: 100%; height: 100%; object-fit: cover; }
.pv-count { position: absolute; top: 10px; right: 10px; padding: 2px 9px; border-radius: var(--r-pill); background: rgba(52,32,42,.7); color: #fff; font-size: 0.75rem; font-weight: 700; }
.preview-post > :not(.pv-media) { margin-left: var(--s-4); margin-right: var(--s-4); }
.pv-place { display: flex; align-items: center; gap: 6px; margin-top: var(--s-3); margin-bottom: 0; color: var(--c-ink-2); font-size: var(--t-sm); font-weight: 600; }
.pv-place svg { width: 16px; height: 16px; }
.pv-dish { font-size: 1.5rem; margin: 4px var(--s-4) 4px; }
.pv-caption { margin-top: var(--s-2); white-space: pre-wrap; }
.pv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-top: var(--s-4); position: sticky; bottom: 0; padding: var(--s-2) 0; background: var(--c-paper); }
.compose .tray-add label { height: auto; aspect-ratio: 4 / 5; width: 84px; }
.held-banner { margin-bottom: var(--s-3); }

/* a post you just made */
.just-posted { display: flex; gap: var(--s-3); align-items: flex-start; background: var(--c-card); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s-4); margin-bottom: var(--s-4); border-left: 4px solid var(--c-basil); }
.just-posted.held { border-left-color: var(--c-butter); }
.just-posted > svg { width: 28px; height: 28px; color: var(--c-basil); margin-top: 2px; }
.just-posted.held > svg { color: var(--c-ink-2); }
.just-posted strong { display: block; font-family: var(--f-display); font-size: 1.25rem; }
.just-posted p { margin: 2px 0 var(--s-2); font-size: var(--t-sm); color: var(--c-ink-2); }
.held-note { background: var(--c-butter); border-radius: var(--r-md); padding: 10px 14px; font-size: var(--t-sm); }
/* retest 2026-10-17 (CrushEats minors): the composer's step "Back" and a saved list's "Remove from this list" are full
   44 x 44 px tap targets on a phone */
.compose-top .linkish { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; }
.remove-chip { width: 44px; height: 44px; }
.place-rows form .btn-small { min-width: 44px; min-height: 44px; }
