/* A calm, photo-led introduction: warm neutrals, one rose accent, short feedback.
   Authenticated product only. Legacy sources and guest entry keep their layout. */
body[data-authenticated="true"] {
  --bg: #fffafc;
  --surface: #fff;
  --ink: #292129;
  --muted: #70626b;
  --line: #ecdee4;
  --control-line: #9a8690;
  --soft: #fff0f5;
  --accent: #b82a60;
  --on-accent: #fff;
  --green: var(--accent);
  --bright: #ffdbe8;
  --danger: #b02e40;
  --focus: #a32656;
  --shadow: 0 6px 28px #3e132814;
  --toast-action: #ffcadc;
  color-scheme: light;
}
html[data-theme="dark"] body[data-authenticated="true"] {
  --bg: #1d181c;
  --surface: #282126;
  --ink: #fbf4f7;
  --muted: #c5b5be;
  --line: #4b3c44;
  --control-line: #83717b;
  --soft: #38252f;
  --accent: #f292b9;
  --on-accent: #3a1224;
  --bright: #edabc5;
  --danger: #fa97a5;
  --focus: #ffa7ca;
  --shadow: 0 6px 24px #0002;
  --toast-action: #a02556;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body[data-authenticated="true"] {
    --bg: #1d181c; --surface: #282126; --ink: #fbf4f7; --muted: #c5b5be;
    --line: #4b3c44; --control-line: #83717b; --soft: #38252f; --accent: #f292b9; --on-accent: #3a1224;
    --bright: #edabc5; --danger: #fa97a5; --focus: #ffa7ca; --shadow: 0 6px 24px #0002; --toast-action: #a02556;
    color-scheme: dark;
  }
}
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 5px -6px; z-index: -1; border-radius: 22px; background: var(--soft); box-shadow: 0 2px 8px #3e132810; transform: rotate(1deg); pointer-events: none; }
.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-copy .incoming-hint { font-size: 12px; line-height: 1.65; 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 { padding-top: 8px; gap: 8px; }
body[data-authenticated="true"] .discovery-actions button { min-height: 52px; font-size: 14px; }
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"] #main { padding-top: 10px; padding-bottom: calc(228px + 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: 18px; }
  .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: 12px; width: 100%; margin: 0 0 9px; 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 - 448px), 410px); aspect-ratio: auto; max-height: none; }
  .has-next .discovery-photo::before { inset: 5px 5px -5px; }
  body[data-authenticated="true"] .discovery-copy { display: flex; flex-direction: column; gap: 8px; 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: 10px 18px 5px; margin: 0; background: var(--surface); border-top: 1px solid var(--line); gap: 4px 8px; }
  body[data-authenticated="true"] .discovery-actions button { min-height: 50px; padding: 10px 8px; }
  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; }
}
