/* PG&E brand, internal audience (pge-design skill): Aptos, white page, PG&E Blue for big
   shapes, Blueberry and Ocean for headings and text, Gold for the one main action.
   Flat: no gradients, shadows or glows. Corners 2-4px. Accents used: Blueberry (headings), Ocean (links, focus, hover).
   Logos keep clear space of half their width from rules, bands and other content. */
:root {
  --pge-blue: #00A5DF;
  --pge-gold: #F2A900;
  --pge-gray: #5B6770;
  --pge-ocean: #007FA3;
  --pge-blueberry: #003C71;
  --pge-light-gray: #F2F4F5;
  --pge-gray-25: #D6D9DB;
  --pge-gray-50: #ADB3B8;

  --bg: #FFFFFF;
  --card: #FFFFFF;
  --panel: var(--pge-light-gray);
  --ink: #000000;
  --muted: var(--pge-gray);
  --line: var(--pge-gray-25);
  --line-strong: var(--pge-gray-50);
  --gold: var(--pge-gold);
  --navy: var(--pge-blueberry);
  --head: var(--pge-blueberry);
  --link: var(--pge-ocean);
  --sans: Aptos, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);
  --radius: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.4; letter-spacing: -0.015em; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.025em; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }

/* A PG&E Blue band across the top of every screen page */
body::before { content: ""; display: block; height: 8px; background: var(--pge-blue); }
.brand { padding: 28px 0 4px; }
.logo { width: 52px; height: auto; display: block; }

/* Hero: centered on phones, flush left beside the portrait on wider screens */
.hero { text-align: center; padding: 24px 0 8px; }
.portrait {
  width: 136px; height: 136px; margin: 0 auto 16px; border-radius: 50%;
  border: 4px solid var(--gold);
  background: var(--pge-blueberry); color: #fff; display: grid; place-items: center;
  font-weight: 500; font-size: 46px; overflow: hidden; letter-spacing: 0;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { color: var(--head); font-weight: 500; font-size: 18px; letter-spacing: -0.02em; }
.hero h1 { color: var(--head); font-size: clamp(40px, 8vw, 60px); line-height: 1; margin: 6px 0 8px; }
.span { color: var(--muted); font-size: 18px; }
@media (min-width: 700px) {
  .wrap > .hero { display: grid; grid-template-columns: 136px 1fr; column-gap: 28px; align-items: center; text-align: left; padding-top: 28px; }
  .wrap > .hero .portrait { margin: 0; grid-row: span 3; }
  .wrap > .hero .highlights, .wrap > .hero > .timeline { grid-column: 1 / -1; text-align: left; }
}

.timeline { list-style: none; padding: 0; margin: 24px auto 8px; max-width: 520px; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; }
.timeline li:last-child { border-bottom: 0; }
.timeline b { color: var(--head); font-weight: 700; }
.timeline b:empty::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 0 2px 4px; background: var(--head); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.highlights { margin-top: 20px; }
.highlights summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); color: var(--head); cursor: pointer; font-weight: 500; list-style: none; }
.highlights summary::-webkit-details-marker { display: none; }
.highlights summary::after { content: "›"; margin-left: 10px; font-size: 20px; line-height: 1; transition: transform .15s; }
.highlights[open] summary::after { transform: rotate(90deg); }
.highlights .timeline { margin: 12px 0 0; }

/* Chat */
.chat { background: var(--panel); border-top: 4px solid var(--pge-blue); border-radius: var(--radius); padding: 20px 16px; margin-top: 28px; }
.log { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; animation: pop .25s ease-out; }
.bubble.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.bubble.me { background: var(--navy); color: #fff; align-self: flex-end; }
.bubble.me .thumbs { display: flex; gap: 6px; margin-top: 6px; }
.bubble.me .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 2px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.input { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.input input[type=text], .input textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.input textarea { min-height: 140px; resize: vertical; }
.input input:focus, .input textarea:focus, .login input:focus { outline: 2px solid var(--link); outline-offset: 1px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { min-height: 44px; padding: 10px 18px; border-radius: var(--radius); border: 2px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; font-weight: 700; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #000; }
.btn.gold::after { content: " »"; }
.btn:hover:not(:disabled) { background: var(--link); border-color: var(--link); color: #fff; }
.btn.gold:hover:not(:disabled) { background: var(--gold); border-color: var(--navy); color: #000; }
.btn:focus-visible, .chip:focus-visible, .tabs button:focus-visible, .highlights summary:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { min-height: 44px; padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: #fff; cursor: pointer; }
.chip:hover { border-color: var(--link); color: var(--link); }
.err { color: #000; font-weight: 700; }
.err:not(:empty) { border-left: 4px solid var(--gold); padding-left: 10px; }
.count { color: var(--muted); font-size: 14px; text-align: right; }

.picks { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { position: relative; width: 88px; height: 88px; }
.pick img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.pick button { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; }
.file-label { display: inline-flex; align-items: center; justify-content: center; }
.file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; }

.closed { text-align: center; padding: 24px; color: var(--muted); }
.demo { background: var(--panel); color: #000; text-align: center; padding: 8px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media print { body::before { display: none; } }
@media (prefers-reduced-motion: reduce) { .confetti, .bubble { animation: none; } .confetti { display: none; } }

/* Book page */
.bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.bar .left { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.bar .logo { width: 32px; }
.tabs { display: flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.tabs button { min-height: 40px; padding: 6px 16px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; font-weight: 500; }
.tabs button:last-child { border-right: 0; }
.tabs button[aria-selected=true] { background: var(--navy); color: #fff; }
.login { max-width: 360px; margin: 64px auto; display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.login h1 { color: var(--head); margin: 8px 0; }
.login input { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); }

.review { display: grid; gap: 12px; }
.rcard { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--pge-blue); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; }
.rcard.hidden { opacity: .5; border-top-color: var(--line-strong); }
.rcard strong { color: var(--head); font-weight: 500; font-size: 20px; }
.rcard .meta { color: var(--muted); }
.rcard .photos { display: flex; gap: 8px; flex-wrap: wrap; }
.rcard .photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 2px; }
.stats { color: var(--muted); }

.page { min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 24px 16px 96px; background: var(--panel); }
.leaf { width: min(860px, 100%); background: #fff; border-top: 8px solid var(--pge-blue); border-radius: var(--radius); padding: clamp(28px, 5vw, 48px); display: grid; gap: 20px; }
.leaf .logo { justify-self: start; margin-bottom: 8px; }
.leaf .who { color: var(--head); font-weight: 500; font-size: clamp(26px, 4vw, 36px); line-height: 1.05; letter-spacing: -0.025em; }
.leaf .meta { color: var(--muted); margin-top: 4px; }
.leaf .msg { font-size: clamp(19px, 2.4vw, 22px); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.leaf .memory { border-left: 4px solid var(--gold); padding-left: 16px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.leaf .photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.leaf .photos img { width: 100%; max-height: 420px; object-fit: contain; background: var(--panel); border-radius: 2px; }
.cover { text-align: center; }
.cover h1 { color: var(--head); font-size: clamp(40px, 7vw, 60px); line-height: 1; margin: 6px 0 8px; }
.cover .span { margin: 0; }
.cover .portrait { margin-top: 8px; }
.nav { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px; }
.nav span { min-width: 64px; text-align: center; color: var(--muted); }

.wall { columns: 3 220px; column-gap: 12px; padding: 16px; }
.wall figure { break-inside: avoid; margin: 0 0 12px; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.wall figcaption { padding: 8px 12px; color: var(--muted); }

/* Slideshow: a Blueberry field (the brand's dark band), white text, Gold names, reverse logo */
.show { position: fixed; inset: 0; background: var(--pge-blueberry); color: #fff; z-index: 30; display: grid; place-items: center; padding: 6vh 6vw; }
.show::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 10px; background: var(--pge-blue); }
.show .show-logo { position: fixed; top: 48px; left: 32px; width: 56px; height: auto; }
.show .slide { display: grid; gap: 3vh; grid-template-columns: 1fr; align-items: center; width: 100%; max-width: 1400px; animation: pop .6s ease-out; }
.show .slide.with-photo { grid-template-columns: 1fr 1fr; }
.show img:not(.show-logo) { max-height: 80vh; width: 100%; object-fit: contain; border-radius: 2px; }
.show .msg { font-size: clamp(22px, 2.8vw, 42px); line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: hidden; }
.show .title { font-weight: 500; font-size: clamp(48px, 8vw, 112px); line-height: 1; letter-spacing: -0.03em; }
.show .who { color: var(--gold); font-weight: 700; font-size: clamp(20px, 2vw, 30px); margin-top: 2vh; }
.show .exit { position: fixed; top: 24px; right: 24px; background: transparent; border-color: #fff; color: #fff; }
@media (max-width: 700px) { .show .slide.with-photo { grid-template-columns: 1fr; } .show img:not(.show-logo) { max-height: 40vh; } }
