/* Find My Page product UI, not a brand proposal.
   FMP-1r makeover. Loaded after tokens.css, styles.css, styles-v2.css, and app.css.
   Gigi (Nov 19, spec-addendum-v2): "no conflict, not reviewed". These values are a product-UI proposal only.
   Shipped by FMP-9r (copied from Uma's FMP-1r folder; only this comment changed).

   This file (1) replaces the :root colour tokens from tokens.css with the
   Paper default, and (2) refines shared layout, type, header, panels,
   buttons, and public-link rules from styles.css / styles-v2.css / app.css.
   It does not delete those files. Admin pages stay on these shared rules.

   Profile themes are in themes.css and must be applied only on .public-shell
   or .preview-frame, not on the product chrome.
*/

:root {
  /* Find My Page product UI, not a brand proposal. Paper default. */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;

  --leading-tight: 1.25;
  --leading-body: 1.5;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem; /* was 0.75rem in tokens.css */
  --radius-full: 9999px;

  --focus-width: 3px;
  --focus-offset: 2px;
  --min-target: 2.75rem;

  --color-bg: #F3F0E8;
  --color-surface: #FFFCF6;
  --color-ink: #1A1814;
  --color-muted: #4A453C;
  --color-border: #5A554C;
  --color-accent: #1540A0;
  --color-accent-hover: #123585;
  --color-on-accent: #FFFFFF;
  --color-error: #8B1515;
  --color-error-bg: #F8E8E4;
  --color-stub-bg: #EDE6D6;
  --color-stub-ink: #4A3C1A;
  --color-stub-border: #8A7437;
  --color-focus: #1540A0;
  --color-disabled-bg: #E4DFD4;
  --color-disabled-ink: #4A453C;
  --color-avatar: #3D3A34;
  --color-on-avatar: #FFFFFF;
}

/* Replaces the paid-stub token block in tokens.css for product pages.
   Existing users stored as paid-stub map to the Ink profile theme (themes.css).
   Product chrome no longer uses .theme-paid-stub. */
.theme-paid-stub {
  /* Intentionally left to inherit :root. Do not restyle the editor or header. */
}

/* Replaces body rules in styles.css — same font and size, warmer Paper ground. */
body {
  background-color: var(--color-bg);
  color: var(--color-ink);
}

/* Replaces h1 in styles.css with slightly more space below. */
h1 {
  margin-bottom: var(--space-4);
}

/* New: lead sentence on home and message pages. Uses existing type tokens. */
.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  max-width: 32rem;
}

/* Replaces .site-header / .site-header-inner in styles.css: a little more air, a calmer bar. */
.site-header {
  background-color: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
}

.site-header-inner {
  padding-block: var(--space-5);
  gap: var(--space-4);
}

/* Replaces .wrap padding in styles.css. */
.wrap {
  padding-block: var(--space-6) var(--space-8);
}

/* Replaces .panel in styles.css: same structure, slightly roomier padding. */
.panel {
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* Replaces .button in styles.css: keep 44px targets, slightly fuller padding. */
.button {
  padding: var(--space-3) var(--space-5);
}

/* Replaces .public-page in styles.css: a calmer, slightly wider column. */
.public-page {
  width: min(100%, 28rem);
  margin-inline: auto;
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

/* Replaces .public-shell min-height / padding in styles.css. */
.public-shell {
  background-color: var(--color-bg);
  color: var(--color-ink);
  min-height: 32rem;
  padding: var(--space-5) 0 var(--space-8);
}

/* Replaces .public-name in styles.css. */
.public-name {
  font-size: var(--text-2xl);
  margin-top: var(--space-4);
  letter-spacing: -0.02em;
}

/* Replaces .public-link in styles.css: larger radius, fuller hit area. */
.public-link {
  min-height: 3rem;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
}

/* Replaces .page-404 in styles.css with the same centred message layout. */
.page-404 {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  max-width: 32rem;
  margin-inline: auto;
}

/* New: theme picker in /edit. Radio group, no JavaScript.
   Whole label is the hit target (min 44px). */
.theme-picker {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 800px) {
  .theme-picker {
    grid-template-columns: 1fr 1fr;
  }
}

.theme-option {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  min-height: var(--min-target);
  padding: var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  cursor: pointer;
}

.theme-option:has(input:checked) {
  border-color: var(--color-focus);
}

.theme-option input {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 1.25rem;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--color-accent);
}

.theme-option-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.theme-option-text strong {
  font-weight: 600;
}

.theme-option-text .hint {
  color: var(--color-muted);
}

.theme-swatch {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  display: block;
  flex: 0 0 auto;
}

.theme-swatch-paper { background-color: #F3F0E8; box-shadow: inset 0 -0.55rem 0 #1540A0; }
.theme-swatch-fog   { background-color: #E8EEF2; box-shadow: inset 0 -0.55rem 0 #0E4F7A; }
.theme-swatch-clay  { background-color: #F3E6D8; box-shadow: inset 0 -0.55rem 0 #8B2E12; }
.theme-swatch-ink   { background-color: #161513; box-shadow: inset 0 -0.55rem 0 #E2C57A; }
.theme-swatch-moss  { background-color: #142018; box-shadow: inset 0 -0.55rem 0 #C5D9A0; }
.theme-swatch-lake  { background-color: #0F1C2E; box-shadow: inset 0 -0.55rem 0 #9EC4F0; }

/* New: gallery of public-page themes on the design mock. */
.theme-gallery {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 800px) {
  .theme-gallery {
    grid-template-columns: 1fr 1fr;
  }
}

.theme-gallery-item {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-surface);
}

.theme-gallery-item .preview-label {
  margin: 0;
}

/* Replaces .preview-frame overflow so the themed shell can fill the frame. */
.preview-frame .public-shell {
  min-height: 24rem;
}

/* FMP-9x: public profile footer band (Uma spec, text-only, no mark). Theme tokens only. */
/* No class on <body> (themes stay off the product chrome; FMP-9r). :has() targets only public profiles. */
body:has(> main.wrap-public) {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.wrap-public {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-block-end: 0;
  width: 100%;
}
.wrap-public > .public-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
.wrap-public > .public-shell > .public-page {
  flex: 1;
}
.profile-footer {
  background: var(--color-surface);
  border-top: 2px solid var(--color-border);
  padding: var(--space-5) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom));
  margin-top: auto;
}
.profile-footer-inner {
  width: min(100%, 28rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}
.profile-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--min-target);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-decoration: none;
}
.profile-footer-brand:hover,
.profile-footer-brand:focus-visible {
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.report-disclosure { width: 100%; }
.report-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--min-target);
  padding-inline: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-muted);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-sm);
}
.report-summary::-webkit-details-marker { display: none; }
.report-summary::after { content: "\25BE"; }
.report-disclosure[open] > .report-summary::after { content: "\25B4"; }
.report-summary:hover,
.report-disclosure[open] > .report-summary {
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.profile-footer :focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.report-form {
  margin-top: var(--space-3);
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.report-form .field { display: flex; flex-direction: column; gap: var(--space-1); }
.report-form .field label { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink); }
.report-form select {
  min-height: var(--min-target);
  width: 100%;
  font: inherit;
  color: var(--color-ink);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
}
.report-form .hint { margin: 0; font-size: var(--text-sm); color: var(--color-muted); }
.report-form .button-primary { width: 100%; min-height: var(--min-target); }
.profile-footer-status {
  margin: var(--space-3) auto 0;
  max-width: 28rem;
  font-size: var(--text-sm);
  color: var(--color-ink);
  text-align: center;
}
.report-priority-flag { color: var(--color-error); }
@media (min-width: 48rem) {
  .profile-footer-inner {
    width: min(100% - 2rem, 56rem);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }
  .report-disclosure[open] { flex-basis: 100%; }
  .report-form { max-width: 28rem; margin-inline: auto; }
  .report-form .button-primary { width: auto; }
}
.preview-frame .profile-footer { margin-top: auto; }
.preview-frame .public-shell { display: flex; flex-direction: column; }
