/* A calm, photo-led introduction: warm neutrals, one rose accent, short feedback.
   Authenticated product only. Legacy sources and guest entry keep their layout. */
/* Structural placeholders contain no account/profile data and are replaced after authentication. */
body[data-loading="true"] .app-shell { display: grid; }
body[data-loading="true"] .workspace { grid-column: 2; }
.loading-shell { width: 100%; max-width: 440px; margin: auto; }
.loading-toolbar { display: flex; justify-content: space-between; gap: 24px; height: 64px; padding-top: 12px; }
.loading-toolbar span, .loading-lines span, .loading-chat-list span, .loading-thread span, .loading-thread > div, .loading-rooms span { display: block; height: 14px; border-radius: 8px; background: var(--line); }
.loading-toolbar span { width: 32%; }
.loading-portrait { height: 500px; border-radius: 20px; background: var(--line); }
.loading-lines { display: grid; gap: 12px; padding-top: 20px; }
.loading-lines span:nth-child(1) { width: 55%; height: 23px; }
.loading-lines span:nth-child(2) { width: 80%; }
.loading-lines span:nth-child(3) { width: 65%; }
.loading-chat { max-width: 960px; }
.loading-chat > div { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
.loading-chat-list, .loading-rooms { display: grid; gap: 24px; }
.loading-chat-list span, .loading-rooms span { height: 72px; }
.loading-thread { display: grid; gap: 24px; padding-top: 32px; }
.loading-thread span { width: 65%; height: 40px; }
.loading-thread span:nth-child(2) { margin-left: auto; }
.loading-thread > div { height: 48px; margin-top: 180px; }
@media (max-width: 767px) {
  body[data-loading="true"] .app-shell { display: block; }
  body[data-loading="true"] .topbar { height: 56px; }
  body[data-loading="true"] #main { padding-top: 4px; }
  .loading-portrait { height: clamp(240px, calc(100dvh - 428px), 430px); }
  .loading-chat > div { grid-template-columns: minmax(0, 1fr); }
  .loading-chat-list { display: none; }
}
body[data-authenticated="true"] .primary { background: var(--accent); color: var(--on-accent); }
body[data-authenticated="true"] .primary:hover { background: var(--accent); filter: brightness(.95); }
body[data-authenticated="true"] .primary,
body[data-authenticated="true"] .secondary,
body[data-authenticated="true"] .danger,
body[data-authenticated="true"] input,
body[data-authenticated="true"] select,
body[data-authenticated="true"] textarea { border-radius: 12px; }
body[data-authenticated="true"] input:not([type="checkbox"]):not([type="radio"]),
body[data-authenticated="true"] select,
body[data-authenticated="true"] textarea,
body[data-authenticated="true"] .secondary { border-color: var(--control-line); }
body[data-authenticated="true"] .toast button { color: var(--toast-action); }
body[data-authenticated="true"] .save-photo { width: 44px; height: 44px; top: 10px; right: 10px; }
body[data-authenticated="true"] .save-photo svg { width: 19px; height: 19px; }
body[data-authenticated="true"] .nav-link { border-radius: 12px; }
body[data-authenticated="true"] .nav-link.active { color: var(--accent); }
body[data-authenticated="true"] dialog:not(.lightbox) { border-radius: 20px; }
body[data-authenticated="true"] .topbar { background: var(--surface); }
body[data-authenticated="true"] .page-heading h1 { font-size: 28px; line-height: 1.35; letter-spacing: -.025em; }
body[data-authenticated="true"] .page-heading p { word-break: keep-all; }
body[data-authenticated="true"] .primary,
body[data-authenticated="true"] .secondary,
.gallery-controls button,
.expression-options span { transition: background-color 180ms ease, color 180ms ease, transform 180ms ease; }
body[data-authenticated="true"] .primary:not(:disabled):active,
body[data-authenticated="true"] .secondary:not(:disabled):active,
.gallery-controls button:not(:disabled):active,
.expression-options label:active span { transform: scale(.98); }

/* Discovery composition: the person leads; room tools live beside or below them. */
body[data-authenticated="true"][data-route="browse"] .browse-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 920px; margin: 0 auto 22px; }
body[data-authenticated="true"][data-route="browse"] .browse-heading h1 { font-size: 22px; line-height: 1.4; }
.browse-heading > h1 { min-width: 0; }
.browse-heading > div { display: flex; align-items: center; gap: 8px; flex: none; }
.browse-heading .browse-quota { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.browse-heading .browse-quota strong { color: var(--accent); font-weight: 650; }
body[data-authenticated="true"] .browse-layout { display: grid; grid-template-columns: 170px minmax(320px, 440px) minmax(170px, 200px); gap: 28px; justify-content: center; align-items: start; }
.browse-tools { min-width: 0; }
.browse-tools .toolbar { display: grid; gap: 12px; margin: 0 0 24px; }
.browse-tools .scope-select { width: 100%; max-width: none; min-width: 0; min-height: 44px; font-size: 12px; }
.browse-tools .toolbar-actions { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; }
.browse-tools .filter-button { width: auto; flex: 1; min-width: 0; min-height: 44px; padding-inline: 2px; gap: 4px; font-size: 12px; white-space: nowrap; }
.browse-tools .toolbar-actions .icon-button { width: 44px; height: 44px; }
.browse-tools .active-filters { gap: 6px; margin-bottom: 20px; }
.browse-tools .active-filter { max-width: 100%; }
.browse-tools .deck-toolbar { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 18px; }
.browse-tools .deck-toolbar .result-count { margin: 0; font-size: 12px; }
.browse-tools .deck-toolbar button { min-height: 44px; font-size: 12px; }
.today-overview { margin-bottom: 12px; border-block: 1px solid var(--line); }
.today-overview > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; padding: 8px 0; cursor: pointer; list-style: none; font-size: 13px; font-weight: 650; }
.today-overview > summary::-webkit-details-marker { display: none; }
.today-overview > summary::after { content: none; }
.today-overview[open] > summary > svg { transform: rotate(180deg); }
.today-overview > summary:focus-visible, .discovery-story > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.today-overview > summary > span { min-width: 0; }
.today-overview > summary strong { color: var(--accent); margin-left: auto; }
.today-overview > summary > svg { width: 16px; height: 16px; color: var(--muted); }
.today-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 8px 0 18px; }
.today-stats > * { min-width: 0; }
.today-stats > button { text-align: left; border-radius: 8px; padding: 6px 0; min-height: 64px; }
.today-stats > button > span { display: block; font-size: 12px; color: var(--muted); word-break: keep-all; }
.today-stats small, .today-stats dt { display: block; font-size: 12px; color: var(--muted); }
.today-stats strong, .today-stats dd { display: block; font-size: 20px; line-height: 1.5; font-weight: 650; margin: 4px 0 0; }
.today-overview > p { font-size: 12px; color: var(--muted); padding-bottom: 16px; line-height: 1.7; word-break: keep-all; }
.browse-tools .today-overview > summary { display: grid; grid-template-columns: minmax(0, 1fr) 16px; gap: 4px 8px; padding-block: 14px; }
.browse-tools .today-overview > summary strong { grid-row: 2; grid-column: 1; margin-left: 0; font-size: 12px; }
.browse-tools .today-overview > summary > svg { grid-row: 1 / 3; grid-column: 2; }
.browse-tools .today-stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding-bottom: 12px; }
.browse-tools .today-stats > button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 0; }
.browse-tools .today-stats strong { margin: 0; font-size: 17px; }
body[data-authenticated="true"] .discovery-card { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 440px; gap: 0; margin-inline: auto; }
body[data-authenticated="true"] .discovery-photo { order: 0; position: relative; min-width: 0; isolation: isolate; }
.has-next .discovery-photo::before { content: ""; position: absolute; inset: 5px -2px -7px 4px; z-index: -1; border: 1px solid var(--line); border-radius: 22px; background: var(--soft); box-shadow: 0 3px 10px #3e132814; transform: rotate(1.5deg); pointer-events: none; }
/* Rotate only the portrait: the mobile action group stays fixed to the viewport. */
body[data-authenticated="true"] .discovery-photo .photo-frame { transform: rotate(-1.2deg); box-shadow: var(--shadow); }
.photo-frame { position: relative; overflow: hidden; border-radius: 20px; background: var(--soft); isolation: isolate; }
.photo-frame > button:first-child { position: relative; display: block; width: 100%; padding: 0; aspect-ratio: 4 / 5; overflow: hidden; border-radius: inherit; }
.photo-frame > button:first-child:focus-visible { outline: 3px solid var(--focus); outline-offset: -6px; }
.photo-frame > button:first-child > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body[data-authenticated="true"] .discovery-photo .photo-frame > button:first-child { aspect-ratio: 4 / 5; max-height: 500px; }
.photo-position { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; color: #fff; background: #252025d9; pointer-events: none; z-index: 1; }
.gallery-controls { position: absolute; left: 9px; right: 9px; bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; z-index: 1; }
.gallery-controls button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #252025b3; pointer-events: auto; }
.gallery-controls button:disabled { opacity: .4; }
.gallery-controls button:hover:not(:disabled) { background: #252025c9; }
.gallery-controls button svg { width: 16px; height: 16px; }
.photo-caption { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
body[data-authenticated="true"] .discovery-copy { display: flex; flex-direction: column; gap: 6px; padding: 13px 2px 0; order: 1; }
.discovery-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
body[data-authenticated="true"] .discovery-copy h2 { font-size: 26px; line-height: 1.3; letter-spacing: -.025em; word-break: keep-all; overflow-wrap: anywhere; }
body[data-authenticated="true"] .discovery-copy .birth-line { margin-top: 0; font-size: 13px; color: var(--muted); }
body[data-authenticated="true"] .discovery-copy .connection { margin: 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
body[data-authenticated="true"] .discovery-intro { font-size: 15px; line-height: 1.75; font-weight: 500; padding-block: 3px; word-break: keep-all; }
body[data-authenticated="true"] .discovery-copy .text-tags { color: var(--muted); font-size: 12px; gap: 6px 11px; line-height: 1.7; }
body[data-authenticated="true"] .discovery-copy .profile-facts { color: var(--muted); font-size: 13px; gap: 4px 12px; line-height: 1.6; }
body[data-authenticated="true"] .profile-facts > span { min-width: 0; max-width: 100%; word-break: keep-all; overflow-wrap: anywhere; }
body[data-authenticated="true"] .profile-facts svg { flex: 0 0 15px; }
body[data-authenticated="true"] .friend-intro-quote { margin: 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 0; }
body[data-authenticated="true"] .friend-intro-quote p { font-size: 14px; line-height: 1.75; margin-block: 7px; word-break: keep-all; }
.discovery-story { min-width: 0; border-top: 1px solid var(--line); margin-top: 2px; }
.discovery-story > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; color: var(--muted); font-size: 12px; cursor: pointer; list-style: none; }
.discovery-story > summary::-webkit-details-marker { display: none; }
.discovery-story > summary svg { width: 15px; height: 15px; }
.discovery-story[open] > summary svg { transform: rotate(180deg); }
.discovery-story > :not(summary) { margin-bottom: 16px; }
.discovery-story .expression-list { margin-top: 18px; }
.discovery-story .discovery-status { margin-bottom: 10px; }
body[data-authenticated="true"] .discovery-detail { min-height: 44px; font-size: 12px; color: var(--muted); }
body[data-authenticated="true"] .discovery-actions { grid-template-columns: repeat(2, 68px); justify-content: center; padding-top: 8px; gap: 8px 28px; }
body[data-authenticated="true"] .discovery-actions > button:not(.deck-next) { width: 68px; height: 68px; min-height: 68px; padding: 7px 4px; border-radius: 50%; flex-direction: column; gap: 3px; font-size: 11px; line-height: 1.35; white-space: normal; word-break: keep-all; }
body[data-authenticated="true"] .discovery-actions .deck-next { min-height: 44px; padding-block: 7px; border: 0; color: var(--muted); background: transparent; font-weight: 500; }
body[data-authenticated="true"] .discovery-actions .deck-next:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
body[data-authenticated="true"] .discovery-actions .primary svg { width: 21px; height: 21px; }
body[data-authenticated="true"] .right-rail { min-width: 0; padding-top: 5px; }
body[data-authenticated="true"] .right-rail .rail-heading h2 { font-size: 13px; }
body[data-authenticated="true"] .right-rail .rail-note { font-size: 12px; line-height: 1.7; }
body[data-authenticated="true"] .right-rail .rail-section { padding-bottom: 22px; margin-bottom: 22px; }

.expression-list { display: grid; gap: 12px; margin: 0; }
.expression-list > div { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; }
.expression-list dt { font-size: 13px; color: var(--muted); }
.expression-list dd { font-size: 14px; font-weight: 550; margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
.expression-fields { margin: 20px 0 0; padding: 0; border: 0; min-width: 0; }
.expression-fields > fieldset { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
.expression-fields > fieldset:last-child { margin-bottom: 0; }
.expression-fields legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 650; }
.expression-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.expression-options label { position: relative; display: block; margin: 0; cursor: pointer; min-width: 0; }
.expression-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.expression-options span { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 11px 9px; border: 1px solid var(--control-line, var(--line)); border-radius: 12px; background: var(--surface); font-size: 13px; line-height: 1.6; text-align: center; word-break: keep-all; }
.expression-options span svg { width: 17px; height: 17px; }
.expression-options input:checked + span { background: var(--soft); border-color: var(--accent); color: var(--accent); }
.expression-options input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.expression-options input:disabled + span { opacity: .6; cursor: not-allowed; }
.expression-clear { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; font-size: 12px; color: var(--muted); }
#expressionCount { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

body[data-authenticated="true"] .profile-editor .page-heading { margin-bottom: 26px; }
body[data-authenticated="true"] .editor-back-row { margin-bottom: 16px; }
body[data-authenticated="true"] .editor-back { min-height: 44px; }
body[data-authenticated="true"] .editor-grid { grid-template-columns: 300px minmax(0, 1fr); gap: 40px; }
body[data-authenticated="true"] .editor-fields { gap: 30px; }
body[data-authenticated="true"] .form-section { padding-bottom: 28px; }
body[data-authenticated="true"] .form-section h2 { font-size: 18px; margin-bottom: 18px; }
body[data-authenticated="true"] .upload-grid { gap: 16px 12px; }
.photo-entry { min-width: 0; }
.photo-entry-image { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 16px; background: var(--soft); }
.photo-entry-image > button:first-child { width: 100%; height: 100%; padding: 0; }
.photo-entry-image img { width: 100%; height: 100%; object-fit: cover; }
.photo-entry > label { margin-top: 9px; color: var(--muted); font-size: 12px; font-weight: 500; }
.photo-entry > input { font-size: 12px; padding: 9px 10px; min-height: 44px; }
.photo-entry .upload-actions { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-top: 5px; }
.photo-entry .upload-actions button { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 44px; padding: 8px 2px; border-radius: 8px; font-size: 11px; color: var(--muted); background: transparent; }
.photo-entry .upload-actions button svg { width: 14px; height: 14px; }
.photo-entry .upload-actions button.main-photo { color: var(--accent); background: var(--soft); }
.photo-entry .upload-actions button:hover { background: var(--soft); }
body[data-authenticated="true"] .upload-add { border-radius: 16px; min-height: 44px; }
body[data-authenticated="true"] .tag-checkbox { border-radius: 10px; min-height: 44px; }
body[data-authenticated="true"] .editor-save-bar { padding-top: 22px; }

body[data-authenticated="true"] .dialog-profile { width: 960px; }
body[data-authenticated="true"] .profile-media { padding: 24px; background: transparent; gap: 13px; }
body[data-authenticated="true"] .profile-main-photo { border-radius: 20px; width: 100%; }
body[data-authenticated="true"] .profile-thumbs button { width: 64px; height: 76px; border-radius: 10px; }
body[data-authenticated="true"] .profile-description { gap: 25px; padding: 28px 28px 24px; }
body[data-authenticated="true"] .profile-description h2 { font-size: 28px; letter-spacing: -.025em; word-break: keep-all; }
.profile-section { min-width: 0; padding-top: 22px; border-top: 1px solid var(--line); }
.profile-section h3 { margin-bottom: 14px; font-size: 16px; }
.profile-section > p { font-size: 14px; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; }
.photo-stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
.photo-stories figure { margin: 0; min-width: 0; }
.photo-stories figure > button { display: block; width: 100%; padding: 0; }
.photo-stories figure > button.selected { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 14px; }
.photo-stories img { aspect-ratio: 4 / 5; border-radius: 14px; object-fit: cover; }
.photo-stories figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
.profile-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: auto; padding-top: 16px; }
.profile-detail-actions > * { min-width: 0; }
.profile-detail-actions .deck-next, .profile-detail-actions [data-action="detail-next"] { grid-column: 1 / -1; }
.profile-detail-actions button { min-height: 46px; padding-inline: 10px; font-size: 13px; }
.profile-detail-actions > .field-note { grid-column: 1 / -1; }

.room-progress { display: grid; gap: 10px; min-width: 0; }
.room-progress-label { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; font-size: 12px; color: var(--muted); }
.room-progress-label strong { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.room-progress > span { font-size: 12px; line-height: 1.7; color: var(--muted); word-break: keep-all; }
.room-progress progress { display: block; width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; overflow: hidden; background: var(--soft); accent-color: var(--accent); }
.room-progress progress::-webkit-progress-bar { background: var(--soft); border-radius: 3px; }
.room-progress progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.room-progress progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
body[data-authenticated="true"] .room-item { border-radius: 18px; box-shadow: none; }
body[data-authenticated="true"] .match-portraits img { border-radius: 18px; }
body[data-authenticated="true"] .match-portraits figure { animation-duration: 220ms; }
body[data-authenticated="true"] .match-portraits figure:last-child { animation-delay: 70ms; }
body[data-authenticated="true"] .match-heart { animation-duration: 220ms; animation-delay: 70ms; color: var(--accent); }
body[data-authenticated="true"] .match-heading h3 { font-size: 24px; }

@media (max-width: 1200px) {
  body[data-authenticated="true"] .editor-grid { grid-template-columns: 250px minmax(0, 1fr); gap: 28px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  body[data-authenticated="true"] .browse-layout { display: grid; grid-template-columns: 150px minmax(0, 460px); gap: 24px; justify-content: center; }
  body[data-authenticated="true"] .right-rail { display: none; }
  body[data-authenticated="true"] .discovery-photo .photo-frame > button:first-child { max-height: 480px; }
}
@media (min-width: 1024px) {
  body[data-authenticated="true"] .right-rail { display: block; }
  body[data-authenticated="true"][data-route="browse"] #main { padding-inline: 28px; }
}
@media (max-width: 767px) {
  body[data-authenticated="true"][data-route="browse"] .topbar { height: 56px; gap: 8px; }
  body[data-authenticated="true"][data-route="browse"] .app-brand { font-size: 16px; }
  body[data-authenticated="true"][data-route="browse"] .feedback-trigger { font-size: 10px; }
  body[data-authenticated="true"][data-route="browse"] #main { padding-top: 4px; padding-bottom: calc(246px + env(safe-area-inset-bottom)); }
  body[data-authenticated="true"] .page-heading h1 { font-size: 23px; }
  body[data-authenticated="true"][data-route="browse"] .browse-heading { margin-bottom: 2px; }
  body[data-authenticated="true"][data-route="browse"] .browse-heading h1 { font-size: 16px; }
  .browse-heading > div { gap: 2px; }
  .browse-heading .browse-quota { font-size: 11px; }
  body[data-authenticated="true"] .page-heading p { font-size: 12px; line-height: 1.65; margin-top: 5px; }
  body[data-authenticated="true"] .browse-layout { display: flex; flex-direction: column; gap: 0; }
  .browse-tools { display: contents; }
  .browse-tools .toolbar { order: -2; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin: 0 0 2px; min-height: 44px; }
  .browse-tools .scope-select { min-height: 40px; font-size: 12px; max-width: 210px; flex: 1; }
  .browse-tools .toolbar-actions [data-action="tutorial-start"] { color: var(--muted); }
  .browse-tools .toolbar-actions [data-action="tutorial-start"] svg { width: 18px; height: 18px; }
  .browse-tools .toolbar-actions { display: flex; flex: none; align-items: center; gap: 4px; }
  .browse-tools .filter-button { min-height: 40px; padding: 6px 8px; background: transparent; border-color: transparent; }
  .browse-tools .toolbar-actions .icon-button { width: 44px; height: 44px; }
  .browse-tools .active-filters { order: -1; width: 100%; margin-bottom: 9px; }
  body[data-authenticated="true"] .discovery-section { order: 0; width: 100%; }
  .browse-tools .today-overview { order: 1; width: 100%; margin-top: 24px; margin-bottom: 0; }
  .browse-tools .today-overview > summary { display: flex; padding-block: 10px; min-height: 44px; font-size: 12px; gap: 10px; }
  .browse-tools .today-overview > summary strong { margin-left: auto; font-size: 12px; }
  .browse-tools .today-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .browse-tools .today-stats > button { display: block; min-height: 64px; }
  .browse-tools .today-stats strong { margin-top: 4px; font-size: 18px; }
  .browse-tools .deck-toolbar { order: 2; width: 100%; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; margin-top: 7px; }
  body[data-authenticated="true"] .discovery-card { display: flex; width: 100%; max-width: 420px; gap: 0; }
  body[data-authenticated="true"] .discovery-photo .photo-frame > button:first-child { height: clamp(240px, calc(100dvh - 428px), 430px); aspect-ratio: auto; max-height: none; }
  body[data-authenticated="true"] .discovery-copy { display: flex; flex-direction: column; gap: 6px; padding: 13px 2px 0; order: 1; }
  body[data-authenticated="true"] .discovery-copy > * { order: initial; }
  body[data-authenticated="true"] .discovery-copy .connection,
  body[data-authenticated="true"] .discovery-copy h2,
  body[data-authenticated="true"] .discovery-copy .birth-line { order: initial; }
  body[data-authenticated="true"] .discovery-copy h2 { font-size: 24px; }
  body[data-authenticated="true"] .discovery-copy .birth-line { font-size: 12px; }
  body[data-authenticated="true"] .discovery-copy .profile-facts { font-size: 12px; line-height: 1.65; }
  body[data-authenticated="true"] .discovery-copy .text-tags { font-size: 12px; line-height: 1.6; }
  body[data-authenticated="true"] .discovery-intro { font-size: 15px; padding: 0; }
  body[data-authenticated="true"] .discovery-actions { left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); padding: 6px 18px 4px; margin: 0; background: var(--surface); border-top: 1px solid var(--line); gap: 4px 28px; }
  body[data-authenticated="true"] .discovery-actions .deck-next { min-height: 44px; padding: 7px 12px; }
  body[data-authenticated="true"][data-route="browse"] .toast { bottom: calc(190px + env(safe-area-inset-bottom)); }
  body[data-authenticated="true"] .nav-link { border-radius: 0; }
  body[data-authenticated="true"] .editor-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  body[data-authenticated="true"] .editor-grid > aside { max-width: none; }
  body[data-authenticated="true"] .upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .photo-entry .upload-actions button { font-size: 12px; }
  .photo-entry .upload-actions button svg { display: block; }
  body[data-authenticated="true"] .form-section h2 { font-size: 17px; }
  body[data-authenticated="true"] .editor-save-bar { padding: 10px 18px; }
  body[data-authenticated="true"] .editor-save-bar .editor-save { min-height: 48px; }
  body[data-authenticated="true"] .profile-editor { padding-bottom: 80px; }
  body[data-authenticated="true"] .dialog-profile { width: 100%; border-radius: 0; }
  body[data-authenticated="true"] .profile-media { padding: 16px 20px 8px; }
  body[data-authenticated="true"] .profile-main-photo { max-height: none; }
  body[data-authenticated="true"] .profile-description { gap: 24px; padding: 22px 20px 0; }
  .profile-detail-actions { position: sticky; bottom: 0; z-index: 2; margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .profile-detail-actions .deck-next { min-height: 44px; }
  .profile-section { padding-top: 22px; }
  body[data-authenticated="true"] .match-heading h3 { font-size: 22px; }
}
@media (max-width: 360px) {
  .today-stats { gap: 8px; }
  .today-stats small, .today-stats dt { font-size: 11px; }
  .photo-entry .upload-actions button { font-size: 11px; gap: 2px; }
  .photo-entry .upload-actions button svg { width: 12px; height: 12px; }
  .expression-options span { padding-inline: 7px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-authenticated="true"] .primary,
  body[data-authenticated="true"] .secondary,
  .gallery-controls button,
  .expression-options span { transition: none; }
  body[data-authenticated="true"] .primary:not(:disabled):active,
  body[data-authenticated="true"] .secondary:not(:disabled):active,
  .gallery-controls button:not(:disabled):active,
  .expression-options label:active span { transform: none; }
  body[data-authenticated="true"] .match-portraits figure,
  body[data-authenticated="true"] .match-heart { animation: none; }
}

/* Member introductions and direct messages. */
.introduction-lists { display: grid; gap: 2px; margin: 4px 0 12px; }
.introduction-lists .link-button { min-height: 44px; justify-content: flex-start; gap: 6px; padding: 6px 9px; border-radius: 9px; text-align: left; line-height: 1.4; }
.introduction-lists .link-button[aria-pressed="true"] { color: var(--accent); background: var(--soft); }
.introduction-lists svg { width: 15px; height: 15px; flex: none; }
.introduction-lists small { color: var(--muted); font-size: 11px; }
.intro-link-short { display: none; }
.browse-tools .toolbar:has(.introduction-lists) .toolbar-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; }
.browse-tools .today-overview > summary > svg { margin-left: auto; }
.browse-tools .introduction-help { min-height: 44px; margin-top: 4px; padding-inline: 0; align-self: flex-start; }
.browse-tools .deck-toolbar:has(.result-count:empty) { display: none; }

body[data-authenticated="true"] .discovery-card .discovery-actions > .primary,
body[data-authenticated="true"] .profile-detail-actions > .primary { grid-column: 1 / -1; }
body[data-authenticated="true"] .discovery-card .discovery-actions .deck-next,
body[data-authenticated="true"] .profile-detail-actions .deck-next { grid-column: auto; }
body[data-authenticated="true"] .discovery-card .discovery-actions > button:only-of-type,
body[data-authenticated="true"] .profile-detail-actions > button:only-of-type { grid-column: 1 / -1; }
.deck-action-note { grid-column: 1 / -1; margin: 0; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; word-break: keep-all; }

.introduction-subpage { max-width: 720px; margin-inline: auto; }
.list-back { min-height: 44px; text-align: left; }
.list-back svg { width: 16px; height: 16px; }
.saved-screen h2 { margin: 0 0 5px; font-size: 20px; }
.introduction-profile-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
body[data-authenticated="true"] .introduction-profile-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; min-width: 0; padding: 8px 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.intro-profile-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 16px; align-items: center; gap: 10px; min-width: 0; min-height: 58px; padding: 4px; border-radius: 10px; text-align: left; }
.intro-profile-row:hover { background: var(--soft); }
.intro-profile-row img { display: block; width: 48px; height: 52px; object-fit: cover; border-radius: 9px; background: var(--soft); }
.intro-profile-row strong, .intro-profile-row small, .intro-row-detail { display: block; overflow-wrap: anywhere; }
.intro-profile-row strong { font-size: 15px; }
.intro-profile-row small, .intro-row-detail { color: var(--muted); font-size: 12px; line-height: 1.55; }
.intro-profile-row svg { width: 16px; height: 16px; color: var(--muted); }
.introduction-profile-list .intro-row-action { min-height: 44px; padding: 6px 9px; font-size: 12px; word-break: keep-all; }
.passed-list .courage-action, .passed-list .courage-used { grid-column: 1 / -1; }
.passed-list .courage-action { margin-top: 4px; padding: 0; border: 0; }
.passed-list .courage-action > strong, .passed-list .courage-action > p { display: none; }
.passed-list .courage-action > button { width: auto; }

.chat-operator-list { padding: 0 0 10px; margin-bottom: 9px; border-bottom: 1px solid var(--line); }
.chat-operator-list .operator-entry { min-height: 66px; }
.chat-list .member-chat-list-heading { padding: 4px 12px; margin: 0; color: var(--muted); font-size: 12px; }
.chat-member-rows .empty-state { padding: 20px 12px; }
.chat-list-status { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
body[data-authenticated="true"] .chat-header > .back-chat { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; }
body[data-authenticated="true"] .composer .composer-row > .composer-add-photo { background: var(--surface); color: var(--ink); border: 1px solid var(--control-line); }
.member-thread-empty { color: var(--muted); margin: auto; text-align: center; font-size: 13px; }
.operator-conversation header h1 { font-size: clamp(16px, 4vw, 21px); line-height: 1.35; word-break: keep-all; }
.operator-conversation header .operator-verified { font-size: 11px; }
.operator-conversation header .icon-button { flex: 0 0 44px; width: 44px; height: 44px; }
.operator-thread-state, .operator-thread-error { padding: 20px 16px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.operator-thread-error .secondary { min-height: 44px; margin-top: 8px; }

@media (max-width: 767px) {
  .browse-tools .toolbar:has(.introduction-lists) .toolbar-actions { display: flex; align-items: center; gap: 2px; }
  .browse-tools .toolbar:has(.introduction-lists) .scope-select { min-width: 80px; }
  .browse-tools .toolbar:has(.introduction-lists) .filter-button { min-width: 44px; min-height: 44px; padding-inline: 4px; }
  .introduction-lists { display: flex; gap: 2px; margin: 0; }
  .introduction-lists .link-button { justify-content: center; min-width: 44px; gap: 4px; font-size: 12px; padding-inline: 4px; }
  .introduction-lists :is(svg, small, .intro-link-full), .browse-tools .browse-filter-label { display: none; }
  .intro-link-short { display: inline; }
  body[data-authenticated="true"] .browse-tools .deck-toolbar { order: 1; margin: 12px 0 0; }
  body[data-authenticated="true"] .browse-tools .today-overview { order: 2; }
  .browse-tools .introduction-help { order: 3; }
  body[data-authenticated="true"] .discovery-card .discovery-actions { position: var(--intro-actions-position, fixed); order: -1; gap: 4px 8px; padding-bottom: 6px; }
  #main:has(.active-filters, .invitation-context) .discovery-card { --intro-actions-position: static; }
  body[data-authenticated="true"] .discovery-card .discovery-actions > button { min-height: 44px; padding-block: 7px; }
  body[data-authenticated="true"] .discovery-card .discovery-actions > .primary { min-height: 46px; }
  body[data-authenticated="true"][data-route="browse"] #main:has(.browse-layout):not(:has(.discovery-actions)) { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 767px) and (max-height: 630px) {
  .discovery-card { --intro-actions-position: static; }
}
