/* PolySpace: a 2006 profile page, rebuilt to work on 2026 phones.
   Layout: blue top bar + lighter nav strip, then a narrow left column + wide right column of bordered boxes on white.
   Palette follows the default mid-2000s profile look; school orange/green appear only as small accents. */
:root {
  color-scheme: light;
  /* page */
  --bg: #e5e5e5;            /* gray page behind the white profile */
  --bg-pattern: #ffffff;
  --bg-star: #ffffff;
  /* chrome */
  --bar: #003399;           /* classic header blue */
  --bar-dark: #35628f;      /* nav strip + box headers */
  --bar-text: #ffffff;
  --nav-link: #ffffff;
  /* content boxes */
  --card: #ffffff;
  --card-ink: #000000;
  --card-muted: #555555;
  --card-line: #6699cc;
  --head-blue: #35628f;     /* classic box header; text gets a dark shadow to stay readable */
  --head-blue-ink: #ffffff;
  --head-orange-bg: #ffcc99;
  --head-orange-ink: #a82a00; /* the old orange-red header text, a shade darker to pass contrast (4.8:1 on the peach) */
  --link: #003399;
  --link-hover: #ff6600;
  --tint: #d5e8fb;          /* light blue fill */
  --comment-who: #ffcc99;
  --comment-body: #fbe3cc;
  --count: #cc0000;
  --gray-band: #e3e3e3;
  --tint-strong: #b1d0f0;   /* detail-table labels */
  /* calls to action */
  --cta: #ffcc00;
  --cta-ink: #000000;
  --cta-edge: #c99a00;
  --sparkle-a: #ff3399;
  --sparkle-b: #6633cc;
  --sparkle-c: #0077dd;
  --placeholder-bg: #fff3a6;
  --placeholder-ink: #6b4a00;
  --online: #2fbf2f;
  --footer-ink: #555555;
  /* school accents (Poly Bears: orange & green), used sparingly */
  --school-orange: #e86a10;
  --school-green: #1f7a3a;

  --font-body: Verdana, Tahoma, Geneva, Arial, sans-serif;
  --font-head: Tahoma, Verdana, Arial, sans-serif;
  --fs: 13px;
  --fs-small: 12px;
  --fs-head: 12px;
  --gutter: 16px;
  --tap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  /* repeating pattern: small stars over a faint diagonal check */
  color: var(--card-ink);
  font-family: var(--font-body);
  font-size: var(--fs);
  line-height: 1.45;
}

img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--cta); color: var(--cta-ink); padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* placeholder text from config.js still marked TODO */
.ph {
  background: var(--placeholder-bg);
  color: var(--placeholder-ink);
  border: 1px dashed var(--placeholder-ink);
  padding: 0 3px;
  font-weight: bold;
  white-space: normal;
}

/* ---------- friend request banner ---------- */
/* Hidden before first paint for visitors who already denied it (see the inline script in index.html). */
.fr-closed .friend-request { display: none; }
.friend-request {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  justify-content: center;
  background: linear-gradient(#fffbe0, #ffefa0);
  border-bottom: 2px solid var(--cta-edge);
  padding: 8px var(--gutter);
  font-size: 12px;
  color: var(--card-ink);
}
.fr-icon { font-size: 16px; }
.fr-actions { display: flex; gap: 8px; }
.fr-btn {
  font: inherit; font-weight: bold; cursor: pointer;
  border: 1px solid var(--card-line); border-radius: 2px;
  background: var(--card); color: var(--link);
  padding: 4px 12px; text-decoration: none; min-height: 32px;
  display: inline-flex; align-items: center;
}
.fr-approve { background: var(--bar); color: var(--head-blue-ink); border-color: var(--bar); } /* white on the dark header blue: 10.9:1 */
.fr-approve:hover { color: var(--head-blue-ink); background: #002266; }

/* ---------- top bar ---------- */
.topbar { background: var(--bar); color: var(--bar-text); }
.topbar-inner {
  max-width: 820px; margin: 0 auto; padding: 12px var(--gutter) 10px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
}
.wordmark {
  text-decoration: none; color: var(--bar-text);
  font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 30px; letter-spacing: -1px;
  line-height: 1; display: inline-flex; align-items: baseline; flex-wrap: wrap;
}
.wordmark:hover { color: var(--bar-text); }
.wm-icon { align-self: center; margin-right: 6px; display: inline-flex; }
.wm-icon svg { fill: #ffffff; display: block; }
.wm-word { color: #ffffff; text-transform: lowercase; letter-spacing: -1.5px; }
.wm-at { font-size: 0.92em; letter-spacing: -1px; }
.wm-com { font-size: 0.62em; letter-spacing: -0.5px; margin-left: 1px; }
.wm-tag {
  flex-basis: 100%; font-family: var(--font-body); font-weight: normal; font-size: 10px; letter-spacing: 0;
  color: #ccddff; margin-top: 3px;
}
.fake-search { display: flex; align-items: center; gap: 4px; font-size: 11px; flex: 1 1 auto; justify-content: center; }
.fs-label { font-weight: bold; }
.fs-box { background: #fff; border: 1px solid #7f9db9; width: 170px; height: 20px; }
.fs-btn { background: #f0f0f0; color: #000; border: 1px solid #7f9db9; padding: 2px 6px; }
.top-links { margin: 0; font-size: 10px; color: #ffffff; }
.top-links a { color: #ffffff; }

.navbar { background: var(--bar-dark); padding: 4px var(--gutter); }
.navbar ul {
  list-style: none; margin: 0 auto; padding: 0; max-width: 820px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0;
  font-size: 11px; font-weight: bold;
}
.navbar li:not(:last-child)::after { content: "|"; color: #000; padding: 0 6px; font-weight: normal; }
.navbar a { color: #ffffff; text-decoration: none; text-shadow: 0 0 4px #003399, 0 0 2px #003399; }
.navbar a:hover { text-decoration: underline; color: #ffffff; }
.navbar .nav-special a { color: #ffff33; }

/* ---------- page ---------- */
.page { max-width: 820px; margin: 0 auto; padding: 10px var(--gutter) 24px; background: var(--card); }

.skip-nostalgia { margin: 0 0 8px; text-align: right; font-weight: bold; font-size: 12px; }
.skip-nostalgia a { color: var(--link); }

.profile-title { margin: 6px 0 12px; text-align: center; font-family: var(--font-head); line-height: 1.2; text-wrap: balance; }
.sparkle {
  display: inline-block;
  font-size: clamp(24px, 6vw, 40px);
  font-weight: bold;
  background: linear-gradient(90deg, var(--sparkle-a), var(--sparkle-b), var(--sparkle-c), var(--sparkle-b), var(--sparkle-a));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  /* Stepped like an old sparkle GIF: 2 repaints a second instead of 60. A smooth gradient-text
     animation kept a phone's main thread about half busy just sitting on the page (lab, 4x CPU). */
  animation: shimmer 4s steps(8) infinite;
}
.offscreen { animation-play-state: paused !important; }
.profile-sub { display: block; color: var(--card-ink); font-size: clamp(14px, 3.5vw, 18px); margin-top: 4px; }
@keyframes shimmer { to { background-position: 300% 0; } }

/* ---------- RSVP strips (top + bottom) ---------- */
.rsvp-strip {
  background: var(--card);
  border: 3px double var(--cta-edge);
  padding: 10px 12px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.rsvp-strip-text { margin: 0; font-size: 12px; min-width: 0; flex: 1 1 260px; }
.rsvp-strip-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rsvp-strip-bottom { margin: 12px 0 0; }

.btn-pay {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 8px 16px;
  background: linear-gradient(#ffe066, var(--cta));
  color: var(--cta-ink);
  border: 2px solid var(--cta-edge); border-radius: 4px;
  font: bold 14px var(--font-head); text-decoration: none; cursor: pointer;
  box-shadow: 0 2px 0 var(--cta-edge);
  text-align: center;
}
.btn-pay:hover { color: var(--cta-ink); background: var(--cta); }
.btn-pay:active { transform: translateY(1px); box-shadow: none; }
.btn-pay-big { width: 100%; font-size: 16px; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 8px 14px;
  background: var(--tint); color: var(--link);
  border: 1px solid var(--card-line); border-radius: 4px;
  font: bold 12px var(--font-body); text-decoration: none; cursor: pointer;
  text-align: center;
}
.btn-ghost:hover { color: var(--link-hover); }

/* ---------- two-column profile ---------- */
.profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; align-items: start; }
.col-left, .col-right { display: grid; gap: 12px; min-width: 0; }

.card { background: var(--card); border: 1px solid var(--card-line); padding: 8px; min-width: 0; }
.card > p:last-child, .card > ul:last-child { margin-bottom: 0; }

.box-head {
  margin: -8px -8px 8px; padding: 4px 8px;
  font: bold var(--fs-head) var(--font-head);
}
.box-head.blue { background: var(--head-blue); color: var(--head-blue-ink); text-shadow: 0 1px 1px rgba(0, 20, 70, 0.75); }
.box-head.orange { background: var(--head-orange-bg); color: var(--head-orange-ink); font-size: 13px; }
/* left-column boxes: 2px light-blue frame; right-column orange sections: no frame */
.col-left > .card:not(.profile-card) { border: 2px solid var(--card-line); }
.col-right > .card:has(> .box-head.orange) { border: 0; padding-inline: 0; }
.col-right > .card:has(> .box-head.orange) > .box-head { margin-inline: 0; }
.col-right > .card:has(> .box-head.orange) > :not(.box-head) { margin-inline: 6px; }
.profile-card { border: 0; padding: 0; }

/* profile card */
.profile-name { margin: 0 0 6px; font: bold 16px var(--font-head); }
.profile-top { display: flex; gap: 10px; }
.profile-pic {
  flex: 0 0 120px; height: 150px;
  background: linear-gradient(160deg, var(--head-blue), var(--bar-dark));
  border: 1px solid var(--bar-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #ffffff; text-align: center; padding: 6px;
}
.pp-mascot { font: bold 13px var(--font-head); }
.pp-mascot .ph { font-size: 10px; }
.pp-year { font: bold 40px "Arial Black", Arial, sans-serif; color: var(--cta); line-height: 1; }
.profile-stats { min-width: 0; font-size: var(--fs); }
.profile-stats p { margin: 0 0 6px; }
.quote { font-style: italic; }
.online { display: flex; align-items: center; gap: 4px; font-weight: bold; color: #1e7a1e; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--online); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } } /* opacity runs on the compositor; visibility forced a repaint */
.view-my { margin: 8px 0 0; }

/* contact box */
.contact-box { background: var(--card); }
.contact-grid { gap: 6px 10px; padding: 2px 4px; }
.profile-pic { border-bottom: 4px solid var(--school-green); }
.pp-mascot { color: #ffffff; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cbtn {
  display: flex; align-items: center; gap: 5px;
  min-height: 28px; padding: 2px 0;
  background: none; border: 0;
  font: bold 10px var(--font-body); color: var(--link); text-decoration: none; cursor: pointer; text-align: left;
}
.cbtn:hover { color: var(--link-hover); }
.toast { margin: 6px 0 0; min-height: 1.4em; font-weight: bold; color: var(--head-orange-ink); }
.toast:empty { display: none; }

.url-text { margin: 0; word-break: break-all; }

/* player: small gray 2006-style profile song bar */
.player {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(#5a5a5a, #2b2b2b); border: 1px solid #000; padding: 4px; border-radius: 2px;
}
.p-play {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 3px; cursor: pointer;
  background: linear-gradient(#8a8a8a, #444); border: 1px solid #111;
  display: flex; align-items: center; justify-content: center;
}
.p-play:hover { background: linear-gradient(#a0a0a0, #555); }
.pp-tri { width: 0; height: 0; border-left: 13px solid #9f9; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
.p-main { flex: 1 1 auto; min-width: 0; background: #000; border: 1px inset #666; padding: 3px 5px; }
.marquee { margin: 0; overflow: hidden; white-space: nowrap; font: 11px "Courier New", monospace; color: #9f9; }
.marquee-inner { display: inline-block; padding-left: 100%; animation: marquee 12s linear infinite; will-change: transform; }
.marquee .ph { background: transparent; color: #ff9; border-color: #ff9; }
@keyframes marquee { to { transform: translateX(-100%); } }
.player-bar { height: 4px; background: #333; margin-top: 3px; }
.player-bar span { display: block; width: 0; height: 100%; background: #9f9; }
.player-bar span { transition: width .5s linear; }
.player.playing .pp-tri { width: 12px; height: 16px; border: 0; margin: 0; border-left: 4px solid #9f9; border-right: 4px solid #9f9; }
.p-time { flex: 0 0 auto; color: #9f9; font: 11px "Courier New", monospace; }
.player-note { margin: 6px 0 0; font-size: 10px; color: var(--card-muted); }

/* key/value tables */
.kv { width: 100%; border-collapse: separate; border-spacing: 2px; }
.kv th { background: var(--tint-strong); color: var(--link); text-align: left; vertical-align: top; width: 32%; padding: 4px; font-weight: bold; }
.kv td { background: var(--tint); padding: 4px; }

/* visitor counter */
.counter-box {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  color: var(--card-ink); font-weight: bold; padding: 4px;
}
.counter-digits { display: inline-flex; gap: 2px; }
.counter-digits span {
  background: #000; color: #39ff14; font: bold 16px "Courier New", monospace;
  padding: 2px 4px; border: 1px solid #555; font-variant-numeric: tabular-nums;
}

/* right column */
.extended { text-align: center; border: 1px solid #000; padding: 12px 8px; }
.extended-text { margin: 0; font: bold 17px var(--font-head); color: var(--head-orange-ink); }

.bulletins { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bulletins li { border-bottom: 1px dotted var(--card-line); padding-bottom: 8px; }
.bulletins li:last-child { border-bottom: 0; padding-bottom: 0; }
.b-subject { margin: 0 0 2px; font-weight: bold; color: var(--link); }
.b-body { margin: 0; }
.linklike { font: inherit; color: var(--link); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

.blurbs h3 { margin: 4px 0; font-size: 12px; color: var(--head-orange-ink); }
.blurbs p { margin: 0 0 8px; }

/* RSVP main box */
.rsvp-box { border: 3px solid var(--cta-edge); padding: 10px; }
.rsvp-head { background: var(--cta); color: var(--cta-ink); font-size: 16px; margin: -10px -10px 10px; padding: 8px 10px; text-align: center; }
.rsvp-body { display: grid; gap: 12px; }
.rsvp-steps { display: grid; gap: 12px; }
.step h3 { margin: 0 0 8px; font-size: 13px; }
.field { display: grid; gap: 3px; margin-bottom: 8px; }
.field label { font-weight: bold; }
.req { color: #b00000; }
.opt { font-weight: normal; color: var(--card-muted); }
.field input {
  font: 16px var(--font-body); /* 16px stops iOS zooming on focus */
  padding: 8px; min-height: 44px; width: 100%;
  border: 1px solid #7a9cc6; border-radius: 0; background: #fff; color: var(--card-ink);
}
.field input:focus { border-color: var(--link); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit-row { display: grid; gap: 8px; }
.form-error { margin: 0 0 8px; color: #b00000; font-weight: bold; }
.form-error:empty { display: none; }
.form-ok { background: #e7f7e7; border: 1px solid #2f8f2f; color: #1d5e1d; padding: 8px; font-weight: bold; margin: 8px 0 0; }
.pay-note { color: var(--card-muted); margin: 8px 0 0; }
.pay-unset { background: var(--placeholder-bg); color: var(--placeholder-ink); padding: 6px; margin: 8px 0 0; font-weight: bold; }
.deposit-info { background: var(--tint); border: 1px solid var(--card-line); padding: 8px; }
.deposit-info h3 { margin: 0 0 4px; font-size: 12px; }
.deposit-info p { margin: 0 0 4px; }

/* Top 8 */
.friend-count { margin: 0 0 4px; font-size: 12px; font-weight: bold; }
.count { color: var(--count); }
.top8-label { margin: 0 0 6px; font-weight: bold; color: var(--head-orange-ink); }
.top8 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.top8 li { display: grid; justify-items: center; align-content: start; gap: 3px; text-align: center; }
.t8-pic {
  width: 100%; max-width: 90px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: var(--tint); border: 1px solid var(--card-line);
}
.t8-tom { padding: 0; overflow: hidden; }
.t8-tom img { width: 100%; height: 100%; display: block; }
.t8-name { font-weight: bold; color: var(--link); font-size: 10px; }
.view-all { text-align: right; margin: 8px 0 0; }

/* gallery */
.pics-sub { margin: 0 0 6px; }
.under-construction {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  background: #000; color: var(--cta); font: bold 11px var(--font-head); padding: 4px;
}
.uc-stripe {
  flex: 1 1 0; min-width: 20px; height: 14px;
  background: repeating-linear-gradient(45deg, var(--cta) 0 8px, #000 8px 16px);
}
.uc-text { text-align: center; flex: 0 1 auto; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gallery button {
  display: grid; gap: 3px; width: 100%; padding: 4px; cursor: pointer;
  background: var(--card); border: 1px solid var(--card-line); font: inherit; color: var(--card-ink); text-align: center;
}
.gallery button:hover { border-color: var(--link-hover); }
.gallery img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; background: var(--tint); }
.g-ph {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: repeating-linear-gradient(135deg, var(--tint) 0 10px, #f4f8fc 10px 20px);
  color: var(--card-muted); font-size: 22px;
}
.g-ph small { font-size: 9px; }
.g-cap { font-size: 10px; color: var(--link); font-weight: bold; }

/* comments */
.comment-count { margin: 0 0 2px; font-weight: bold; }
.comment-disclaimer { margin: 0 0 8px; color: var(--card-muted); font-style: italic; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.comment { display: grid; grid-template-columns: 120px minmax(0, 1fr); background: var(--comment-body); }
.c-who { padding: 6px; text-align: center; display: grid; justify-items: center; gap: 4px; align-content: start; background: var(--comment-who); }
.c-avatar {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; border: 1px solid var(--card-line);
}
.c-name { font-weight: bold; color: var(--link); font-size: 10px; overflow-wrap: anywhere; }
.c-body { padding: 6px 8px; min-width: 0; }
.c-date { margin: 0 0 4px; font-weight: bold; color: var(--card-muted); font-size: 10px; }
.c-text { margin: 0; font-size: 12px; overflow-wrap: anywhere; }

/* footer */
.footer {
  max-width: 820px; margin: 0 auto; padding: 12px var(--gutter) 24px;
  text-align: center; color: var(--footer-ink); font-size: 10px;
  background: var(--card);
}
.footer-links { list-style: none; margin: 0 0 10px; padding: 8px; background: var(--gray-band); display: flex; flex-wrap: wrap; justify-content: center; font-size: 11px; }
.footer-links li:not(:last-child)::after { content: "|"; padding: 0 6px; color: #000; }
.footer p { margin: 0 0 8px; }
.footer a { color: var(--link); }
.disclaimer { margin-inline: auto !important; font-size: 10px; }
.copyright { font-size: 10px; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.88);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.lb-figure { margin: 0; max-width: min(900px, 100%); display: grid; gap: 8px; justify-items: center; }
.lb-img img { max-height: 78vh; width: auto; max-width: 100%; border: 4px solid #fff; }
.lb-img .g-ph { width: min(70vw, 360px); border: 4px solid #fff; }
.lightbox figcaption { color: #fff; font-size: 13px; font-weight: bold; }
.lb-close, .lb-nav {
  background: var(--card); color: var(--card-ink); border: 2px solid var(--card-line);
  font: bold 28px/1 Arial, sans-serif; width: var(--tap); height: var(--tap); cursor: pointer; flex: 0 0 auto;
}
.lb-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --fs: 15px; --fs-small: 13px; --fs-head: 15px; }
  .profile { grid-template-columns: minmax(0, 1fr); }
  .fake-search { display: none; }
  .wordmark { font-size: 26px; }
  .navbar ul { font-size: 13px; }
  .top-links { display: none; }
  .navbar a { display: inline-block; padding: 6px 0; }
  .navbar li:not(:last-child)::after { padding: 0 5px; }
  .skip-nostalgia { text-align: center; font-size: 15px; }
  .rsvp-strip-text { font-size: 15px; }
  .rsvp-strip-actions { width: 100%; }
  .rsvp-strip-actions a { flex: 1 1 100%; }
  .btn-ghost { font-size: 14px; }
  .profile-stats, .kv { font-size: 14px; }
  .cbtn { font-size: 13px; min-height: 44px; }
  .t8-name, .g-cap, .c-name, .c-date { font-size: 12px; }
  .c-text { font-size: 15px; }
  .comment { grid-template-columns: 80px minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer { font-size: 13px; }
  .disclaimer, .copyright { font-size: 12px; }
  .friend-request { font-size: 14px; }
  .lb-nav { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .lb-prev { left: 16px; }
  .lb-next { right: 16px; }
}
@media (max-width: 760px) {
  /* phones: one column, and pull the RSVP form + good stuff up, push the profile trivia down */
  .profile { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .friend-count, .top8-label, .comment-count { font-size: 15px; }
  .col-left, .col-right { display: contents; }
  .profile-card { order: 1; }
  .extended { display: none; }
  #rsvp { order: 2; }
  #about { order: 3; }
  #bulletins { order: 4; }
  #now-playing { order: 5; }
  #top-hits { order: 8; }
  #friends { order: 6; }
  #pics { order: 7; }
  #comments { order: 8; }
  .contact-box { order: 9; }
  #invite { order: 9; }
  .url-box { order: 10; }
  .profile .card:not([id]):not(.profile-card):not(.contact-box):not(.url-box):not(.extended) { order: 11; }
  .counter-box { order: 12; }
  .rsvp-strip-bottom { order: 13; margin: 0; }
  .profile-pic { flex-basis: 100px; height: 130px; }
}

/* ---------- reduced motion: no shimmer, blink, or marquee ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .marquee { white-space: normal; }
  .marquee-inner { padding-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- success / cancel pages ---------- */
.status-page { max-width: 560px; padding-top: 24px; }
.status-page .card { font-size: 13px; }
.status-page h1.box-head { font-size: 16px; margin-bottom: 12px; }
.status-big { font-size: 15px; font-weight: bold; }
.status-foot { color: var(--footer-ink); text-align: center; margin-top: 16px; }
.status-foot .ph { color: var(--placeholder-ink); }
@media (max-width: 760px) { .status-page .card { font-size: 15px; } }

/* ---------- real comments ---------- */
.comments-sub { margin: 8px 0 6px; font-weight: bold; color: var(--head-orange-ink); }
#real-comment-list { margin-bottom: 8px; }
.c-initial { font: bold 26px var(--font-head); color: #ffffff; background: var(--head-blue); }
.comment-form-card { margin-top: 12px; }
.field textarea {
  font: 16px var(--font-body); padding: 8px; width: 100%; resize: vertical;
  border: 1px solid #7a9cc6; border-radius: 0; background: #fff; color: var(--card-ink);
}
.char-count { justify-self: end; font-size: 11px; color: var(--card-muted); }
.c-photo { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--card-line); display: block; }
.c-preview { max-width: 120px; max-height: 120px; border: 1px solid var(--card-line); margin-top: 6px; }
.field input[type=file] { min-height: 0; padding: 6px 0; border: 0; font-size: 14px; }
.gallery-more-row { text-align: center; margin: 10px 0 0; }
.lb-img img { height: auto; }
.lb-figure { width: 100%; }
.lb-img { width: 100%; display: flex; justify-content: center; }
/* Size the photo from its known proportions (--ar, set in main.js) before it downloads, so the viewer
   doesn't jump when it arrives. The grid thumbnail shows underneath as an instant low-res preview. */
.lb-img img { width: min(100%, calc(78vh * var(--ar, 1.5))); max-width: 100%; max-height: 78vh; aspect-ratio: var(--ar, auto); object-fit: contain; background: #fff center / contain no-repeat; }
.profile-pic { padding: 6px; overflow: hidden; background: #fff; }
.profile-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.faq { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 4px; }
.faq li { border: 0; padding: 0; }
.top8 a { display: grid; justify-items: center; gap: 3px; text-decoration: none; width: 100%; }
.top8 a:hover .t8-name { text-decoration: underline; }
.t8-pic img { width: 100%; height: 100%; display: block; }
.t8-pic:has(img) { padding: 0; overflow: hidden; }
.c-avatar-pic { overflow: hidden; padding: 0; }
.c-avatar-pic img { width: 100%; height: 100%; display: block; }
.t8-name { overflow-wrap: anywhere; }
.top8 a { grid-template-rows: minmax(2.6em, auto) auto; }
.top8 .t8-name { align-self: end; }
.invite-box p { margin: 0 0 6px; }
.invite-share { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-bottom: 8px; }
.invite-or { margin-top: 4px; }
.invite-note { margin: 6px 0 0 !important; font-size: 10px; }
#invite-form .field input { min-height: 36px; padding: 5px 6px; font-size: 14px; }
@media (max-width: 760px) { #invite-form .field input { font-size: 16px; min-height: 44px; } .invite-note { font-size: 12px; } }

/* gallery: show the whole photo, centered, like a 2006 photo album page */
.gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gallery img { aspect-ratio: 4 / 3; object-fit: contain; object-position: center; background: #f1f1f1; }
.g-ph { aspect-ratio: 4 / 3; }
.album-title { margin: 0 0 6px; font-weight: bold; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Top Hits of 2007 ---------- */
.hits-note { margin: 6px 0; font-size: 11px; }
.hits-list { margin: 0; padding-left: 26px; font-size: 11px; }
.hits-list li { padding: 3px 0; border-bottom: 1px dotted var(--card-line); }
.hits-list li:last-child { border-bottom: 0; }
.th-song { font-weight: bold; }
.th-artist { color: #555; }
.th-artist::before { content: "\2013\00a0"; }

@media (prefers-reduced-motion: reduce) { .player-bar span { transition: none; } }

/* ---------- desktop polish: keep forms and buttons at 2006 proportions on big screens ----------
   Phones keep the 16px / 44px+ sizes above (iOS zoom and thumb targets); a mouse doesn't need them. */
@media (min-width: 761px) {
  .field input { font-size: 13px; min-height: 32px; padding: 5px 7px; }
  #invite-form .field input { min-height: 26px; padding: 3px 5px; font-size: 12px; }
  #invite-form .field { margin-bottom: 6px; }
  #invite-form .btn-ghost { min-height: 30px; padding: 4px 14px; font-size: 11px; }
  .btn-pay-big { min-height: 44px; }
  .submit-row .btn-ghost { min-height: 36px; }
  .c-text { line-height: 1.5; }
}

/* Launch hierarchy: concise facts and reliable actions before profile trivia. */
.quote-label { font-size: 12px; color: var(--card-muted); margin-bottom: 4px; }
.profile-stats .quote { margin-top: 0; }
.contact-grid { grid-template-columns: minmax(0, 1fr); }
.contact-grid a { overflow-wrap: anywhere; min-height: 48px; }
.card { scroll-margin-top: 16px; }
.rsvp-body p { line-height: 1.6; }
@media (max-width: 760px) {
  :root { --gutter: 12px; }
  body { line-height: 1.6; }
  .navbar a { min-height: 44px; padding: 10px 6px; }
  .navbar li:not(:last-child)::after { display: none; }
  .profile { gap: 20px; }
  #rsvp { order: 0; margin-bottom: 20px; }
  .profile-card { order: -1; margin-bottom: 20px; }
  main > .rsvp-strip { display: none; }
  .contact-box { order: 1; }
  #bulletins { order: 2; }
  #about { order: 4; }
  .card { padding-bottom: 12px; }
  .kv th { width: 30%; }
  .kv td { overflow-wrap: anywhere; }
  .profile-top { align-items: flex-start; }
  .profile-stats { min-width: 0; }
  .rsvp-strip { padding: 14px; gap: 14px; }
  .box-head { padding: 10px 12px; }
}

.navbar a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 6px; }
@media (max-width: 760px) { .hits-list { font-size: 14px; line-height: 1.6; } .faq { gap: 12px; } }

summary { cursor: pointer; min-height: 44px; display: list-item; padding-block: 10px; }
.contact-status { color: var(--card-muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 760px) { .friend-request { display: none; } .skip-nostalgia { display: none; } }

/* Edited profile snapshots, framed like a MySpace Top 8. */
.t8-profile { display: grid; gap: 7px; width: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; font: inherit; text-align: center; }
.top8 .t8-pic { max-width: none; padding: 3px; border: 1px solid #6699cc; background: white; box-shadow: 1px 1px 0 #c6d8ec; }
.top8 .t8-pic img { object-fit: cover; width: 100%; height: 100%; }
.top8 .t8-name { font-size: 12px; line-height: 1.4; }
.t8-profile:hover .t8-pic { border-color: var(--link); box-shadow: 0 0 0 2px var(--tint); }
#friends .top8 { gap: 16px 10px; }
@media (max-width: 520px) {
  #friends .top8 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .top8 .t8-name { font-size: 14px; }
}

.t8-pic.is-sideways img { transform: rotate(-90deg); }
.lb-photo { width: min(100%, calc(78vh * var(--ar, 1.5))); aspect-ratio: var(--ar, 1.5); position: relative; max-height: 78vh; background: white; }
.lb-photo img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; aspect-ratio: auto; object-fit: contain; }
.lb-photo.is-sideways img { position: absolute; left: 50%; top: 50%; width: calc(100% / var(--ar)); height: calc(100% * var(--ar)); transform: translate(-50%, -50%) rotate(-90deg); }

.g-photo { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #f1f1f1; }
.g-photo img { width: 100%; height: 100%; }
.g-photo.is-sideways img { position: absolute; left: 50%; top: 50%; width: 75%; height: 133.333%; aspect-ratio: auto; transform: translate(-50%, -50%) rotate(-90deg); }

.top8 .t8-name { overflow-wrap: anywhere; }
/* The Stripe container is full width on small screens; native fields remain readable. */
#embedded-deposit input:not([type="checkbox"]), #embedded-deposit select { width: 100%; max-width: 28rem; min-height: 44px; font: inherit; box-sizing: border-box; }
#embedded-deposit input[type="checkbox"] { width: 20px; height: 20px; vertical-align: middle; }
#embedded-deposit button, #deposit-back { min-height: 44px; }
#deposit-back { display: inline-block; padding: 12px 0; }
#deposit-back[hidden] { display: none; }
#stripe-checkout { width: 100%; }
#deposit-message { overflow-wrap: anywhere; }

/* One compact contact/invite block retains the early mobile contact position. */
.contact-box .invite-share { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0 0; }
.contact-box .invite-share .cbtn { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) { .contact-box#invite { order: 1; } }

/* Moderated wall text and report controls stay within narrow comment columns. */
.c-who, .c-body { min-width: 0; }
.c-name, .c-text, .c-body summary { overflow-wrap: anywhere; }
.c-body textarea { display: block; width: 100%; max-width: 100%; box-sizing: border-box; }

/* One-level wall threads keep full-width reply forms on narrow phones. */
.wall-replies { grid-column: 1 / -1; list-style: none; margin: 6px 0 0 12px; padding: 0 0 0 8px; border-left: 2px solid var(--card-line); display: grid; gap: 3px; min-width: 0; }
.wall-replies .comment { grid-template-columns: 80px minmax(0, 1fr); }
.reply-context { font-size: 12px; color: var(--card-muted); margin: 6px 0; overflow-wrap: anywhere; }
.reply-controls { grid-column: 1 / -1; padding: 8px; min-width: 0; }
.reply-controls summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; width: fit-content; color: var(--link); font-weight: bold; }
.reply-controls form { margin: 8px 0; }
@media (max-width: 480px) {
  .wall-replies { margin-left: 4px; padding-left: 4px; }
  .wall-replies .comment { grid-template-columns: 64px minmax(0, 1fr); }
}

.wall-avatar { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--card-line); }
.avatar-choice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-memory { font-size: 12px; color: var(--card-muted); overflow-wrap: anywhere; }

/* Wall uploads use their existing stored image, independently of the gallery viewer. */
.wall-photo-open { display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.wall-photo-open .c-photo { display: block; margin: 0; }
.wall-photo-open:focus-visible, .wall-photo-dialog button:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.wall-photo-dialog { box-sizing: border-box; width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 16px; border: 2px solid var(--card-line); overflow: auto; color: var(--card-ink); background: var(--card); }
.wall-photo-dialog::backdrop { background: rgba(0, 0, 0, .8); }
.wall-photo-dialog h2 { margin: 0 0 12px; font-size: 16px; overflow-wrap: anywhere; }
.wall-photo-dialog button { min-height: 44px; margin-bottom: 12px; }
.wall-photo-dialog img { display: block; max-width: 100%; max-height: calc(100dvh - 160px); width: auto; height: auto; object-fit: contain; margin: 0 auto; }
.wall-photo-dialog img[hidden] { display: none; }

.preset-options [aria-pressed=true]{outline:2px solid var(--link)}
.preset-more.btn-ghost{width:36px;min-height:36px;padding:0;flex:0 0 36px}
