@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/Nunito-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Lucky Rounded';
  src: url('assets/fonts/ZCOOLKuaiLe-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fffaf2;
  --paper-deep: #fff4e6;
  --ink: #493a42;
  --muted: #877b80;
  --line: #eee4d9;
  --coral: #ed8c78;
  --coral-deep: #dc725f;
  --butter: #ffe79b;
  --pink: #f7dfe2;
  --sage: #d9e5d4;
  --diary-paper: #edf1e7;
  --diary-line: #dce3d3;
  --lavender: #e9e3f4;
  --shadow: 0 18px 48px rgba(93, 67, 68, 0.09);
  --font-rounded: 'Nunito', 'Lucky Rounded', 'YouYuan', '幼圆', 'PingFang SC', sans-serif;
  font-family: var(--font-rounded);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 12% 7%, rgba(255, 231, 155, 0.2), transparent 30rem),
    radial-gradient(ellipse at 91% 22%, rgba(247, 223, 226, 0.25), transparent 28rem),
    var(--paper);
  color: var(--ink);
  min-width: 0;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button:disabled { cursor: wait; opacity: 0.6; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: white;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1280px, calc(100% - 64px));
  height: 82px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(219, 204, 194, 0.58);
  background: rgba(255, 250, 242, 0.89);
  backdrop-filter: blur(16px);
}

.brand { display: inline-flex; align-items: center; gap: 9px; min-width: 190px; }
.brand-mark { display: grid; flex: 0 0 auto; width: 52px; height: 52px; place-items: center; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-name { display: block; font-family: var(--font-rounded); font-size: 22px; font-weight: 900; letter-spacing: -0.9px; line-height: 1.05; white-space: nowrap; }
.brand-name i { color: var(--coral-deep); font-style: normal; font-weight: 700; }
.brand-subtitle { color: #a18b80; font-size: 12px; letter-spacing: 1.4px; line-height: 1.2; white-space: nowrap; }

.main-nav { display: flex; align-items: center; gap: 36px; height: 100%; }
.nav-link { position: relative; display: inline-flex; align-items: center; height: 100%; color: #82747a; font-size: 13px; font-weight: 700; transition: color 160ms ease; }
.nav-link:hover, .nav-link.is-current { color: var(--ink); }
.nav-link.is-current::after { position: absolute; right: 0; bottom: 19px; left: 0; height: 2px; border-radius: 2px; background: var(--coral); content: ''; }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; min-width: 220px; }
.demo-chip { display: inline-flex; align-items: center; gap: 7px; color: #8b7d7c; font-size: 11px; font-weight: 700; white-space: nowrap; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: #85a77e; box-shadow: 0 0 0 3px rgba(133, 167, 126, 0.14); }
.account-button { border: 1px solid #e6d8ce; border-radius: 999px; padding: 10px 17px; background: rgba(255, 255, 255, 0.66); cursor: pointer; font-size: 12px; font-weight: 800; transition: border 160ms ease, background 160ms ease, transform 160ms ease; }
.account-button:hover { transform: translateY(-1px); border-color: #e7afa3; background: #fff; }

.album-summary { padding-top: 28px; padding-bottom: 24px; scroll-margin-top: 110px; }
.album-summary[data-cache-pending] .album-meta { visibility: hidden; }
.eyebrow { margin: 0 0 15px; color: #aa8180; font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 800; letter-spacing: 1.9px; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1, h2 { color: var(--ink); }
.album-meta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 17px 22px; border: 1px solid #efdfd0; border-radius: 22px; background: linear-gradient(115deg, #fffdf7, #fff4e8); box-shadow: 0 5px 22px #b7937110; }
.album-total { display: flex; align-items: center; gap: 12px; }
.album-total > img { flex: 0 0 auto; width: 40px; height: 40px; }
.album-stats { display: flex; align-items: center; gap: 24px; }
.album-stats p { display: flex; align-items: baseline; gap: 7px; margin: 0; color: #927d76; font-size: 13px; }
.album-stats strong { color: var(--coral-deep); font-size: 28px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.checkin-button { flex: 0 0 auto; min-height: 42px; padding: 9px 17px; border: 1px solid #e4816d; border-radius: 999px; background: var(--coral); color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 12px #db776220; cursor: pointer; transition: background 150ms ease; }
.checkin-button:hover { background: var(--coral-deep); }
.checkin-button:focus-visible { outline: 3px solid #ed8c786b; outline-offset: 3px; }
.checkin-button.is-complete { border-color: #ccd9c1; background: #e7eddf; color: #627859; box-shadow: none; }
.checkin-button:disabled { opacity: 1; cursor: default; }
.checkin-button[aria-busy="true"] { cursor: wait; }
.album-updated { display: flex; align-items: center; gap: 10px; margin: 0; color: #aa978c; font-size: 12px; text-align: right; }
.album-updated strong { padding: 6px 11px; border-radius: 999px; background: #ecf1e6; color: #7b8d69; font-size: 12px; font-weight: 700; }

.latest-section { padding-top: 16px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading :is(h1, h2) { margin: 0; font-family: var(--font-rounded); font-size: clamp(24px, 3vw, 31px); font-weight: 900; letter-spacing: -0.8px; line-height: 1.25; }
.heading-paw { display: inline-block; color: var(--coral); font-size: 17px; transform: rotate(-18deg); }

.featured-entry { display: grid; grid-template-columns: 1.08fr 0.92fr; min-height: 390px; margin-top: 21px; overflow: hidden; border: 1px solid var(--diary-line); border-radius: 27px; background: var(--diary-paper); box-shadow: var(--shadow); }
.featured-photo { position: relative; min-height: 390px; overflow: hidden; background: #f5d59a; }
.featured-photo > img { width: 100%; height: 100%; min-height: 390px; object-fit: cover; transition: transform 500ms cubic-bezier(0.2, 0.6, 0.25, 1); }
@media (hover: hover) and (pointer: fine) {
  .featured-entry:hover .featured-photo > img { transform: scale(1.025); }
}
.photo-label { position: absolute; top: 12px; left: 12px; width: 88px; height: 88px; pointer-events: none; }
.photo-label img { width: 100%; height: 100%; }
.photo-label span { color: var(--coral-deep); }
.featured-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: clamp(28px, 4.2vw, 50px); background: var(--diary-paper); }
#latest-heading { scroll-margin-top: 100px; }
.featured-date { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #aa8b87; font-size: 11px; font-weight: 800; letter-spacing: 0.4px; }
.featured-date::before { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); content: ''; }
.featured-copy h3 { margin: 0 0 12px; color: #514149; font-family: var(--font-rounded); font-size: clamp(23px, 2.7vw, 32px); font-weight: 900; letter-spacing: -0.9px; line-height: 1.3; }
.featured-copy > p { margin: 0; color: #85797d; font-size: 13px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.featured-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 28px; padding-top: 17px; border-top: 1px solid var(--diary-line); }
.entry-byline { display: inline-flex; flex: 1; align-items: center; gap: 9px; min-width: 0; color: #87777d; font-size: 12px; font-weight: 700; }
.entry-reactions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.entry-nickname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiny-avatar { flex: 0 0 auto; width: 29px; height: 29px; object-fit: cover; border-radius: 50%; background: #fff3e3; }
.like-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; min-width: 64px; min-height: 36px; padding: 5px 11px; border: 1px solid #efded5; border-radius: 999px; background: #fffaf5; color: #bc9188; cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
.like-icon { width: 21px; height: 21px; background: currentColor; mask: url('assets/heart.svg') center / contain no-repeat; -webkit-mask: url('assets/heart.svg') center / contain no-repeat; }
.like-count { font-family: var(--font-rounded); font-size: 13px; font-weight: 800; }
.like-button.is-liked { border-color: #f1b7ab; background: #fce5dd; color: #d1766a; }
.bowl-button { border-color: #f0d5b2; background: #fff6e9; color: #d2964f; }
.bowl-button.is-liked { border-color: #e7ba7e; background: #ffe7c5; color: #c17d2e; }
.bowl-button .like-icon { mask-image: url('assets/pet-bowl.svg'); -webkit-mask-image: url('assets/pet-bowl.svg'); }
.reaction-feedback { position: fixed; z-index: 30; left: 0; top: 0; width: max-content; max-width: calc(100vw - 20px); padding: 7px 11px; border: 1px solid #f0d3cb; border-radius: 12px; background: #fff8f3; color: #cb7d76; box-shadow: 0 5px 15px #80564c14; font-size: 12px; font-weight: 800; line-height: 1.4; white-space: nowrap; pointer-events: none; transform: translate(-50%, -100%); }
.reaction-feedback.is-bowl { border-color: #efd6b5; background: #fff6e6; color: #c28b3e; }
.like-button:focus-visible { outline: 3px solid #ed8c786b; outline-offset: 3px; }
.like-button:disabled { opacity: 0.55; cursor: wait; }
.like-button[aria-busy="true"] { cursor: wait; }
.like-count { min-width: 1ch; font-variant-numeric: tabular-nums; }
.memory-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; }
.memory-footer .entry-byline { gap: 6px; font-size: 11px; }
.memory-footer .tiny-avatar { width: 24px; height: 24px; }
.memory-footer .like-button { min-width: 54px; min-height: 31px; gap: 4px; padding: 4px 8px; }
.memory-footer .like-icon { width: 19px; height: 19px; }

.memory-section { padding-top: 68px; }
.memory-heading { margin-bottom: 21px; }
.heading-sparkle { display: inline-block; margin-left: 4px; color: #e5b54f; font-size: 18px; transform: rotate(10deg); }
.photo-count { padding-bottom: 5px; color: #9b8d91; font-size: 11px; font-weight: 700; }
.memory-grid { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 40px) / 3); align-items: stretch; gap: 20px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #e6d0c0 transparent; padding: 4px 0 18px; }
.memory-grid:focus-visible { outline: 2px solid var(--coral); outline-offset: 6px; border-radius: 21px; }
.memory-card { --memory-paper: var(--diary-paper); --memory-line: var(--diary-line); display: flex; flex-direction: column; min-width: 0; overflow: hidden; scroll-snap-align: start; border: 1px solid var(--memory-line); border-radius: 21px; background: var(--memory-paper); box-shadow: 0 9px 18px rgba(93, 67, 68, 0.04); transition: transform 180ms ease, box-shadow 180ms ease; }
.memory-card:nth-child(even) { --memory-paper: #f7eee7; --memory-line: #eadcd1; }
@media (hover: hover) and (pointer: fine) {
  .memory-card:hover { transform: translateY(-3px); box-shadow: 0 15px 34px rgba(93, 67, 68, 0.09); }
}
/* A definite ratio box avoids percentage-height / flex sizing cycles in Safari. */
.memory-photo { position: relative; width: 100%; height: 0; padding-top: 75%; flex: 0 0 auto; overflow: hidden; background: #f6e4d2; }
.memory-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 450ms ease; }
@media (hover: hover) and (pointer: fine) {
  .memory-card:hover .memory-photo > img { transform: scale(1.04); }
}
.photo-retry { position: absolute; z-index: 1; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 9px 14px; border: 1px solid #e5c7b9; border-radius: 999px; background: #fffdf9; color: #795d57; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.photo-retry:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.has-photo-error > img { object-fit: contain; }
.memory-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 19px 18px; background: var(--memory-paper); }
.memory-controls { display: flex; gap: 6px; padding-bottom: 0; }
.memory-arrow { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 13px; background: transparent; color: #ae7b68; cursor: pointer; }
.memory-arrow svg { display: block; width: 38px; height: 38px; }
.memory-arrow .arrow-line { stroke-width: 2.7; }
.memory-arrow .cat-outline, .memory-arrow .cat-cheek { display: block; }
.memory-arrow:hover { background: #ffefe3; }
.memory-arrow:focus-visible { outline: 3px solid #ed8c786b; outline-offset: 3px; }
.memory-arrow:disabled { cursor: default; opacity: .4; }
.memory-date { margin-bottom: 10px; color: #b48e88; font-size: 10px; font-weight: 800; }
.memory-copy h3 { margin: 0 0 8px; color: #5c4a51; font-family: var(--font-rounded); font-size: 16px; font-weight: 900; line-height: 1.45; }
.memory-copy p { margin: 0; color: #8b7f83; font-size: 11px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-paw { align-self: flex-end; margin-top: 11px; color: #d99a91; font-size: 13px; }
.empty-message { padding: 34px 20px; border: 1px dashed #e8d8ce; border-radius: 18px; color: #938387; text-align: center; font-size: 13px; }

.about-section { padding-top: 84px; }
.about-card { position: relative; display: grid; grid-template-columns: 1fr 0.8fr; align-items: center; min-height: 300px; overflow: hidden; border: 1px solid #eadfd7; border-radius: 28px; background: #f2efe7; }
.about-card::before { position: absolute; top: -85px; right: 23%; width: 220px; height: 220px; border: 1px dashed rgba(167, 149, 126, 0.34); border-radius: 50%; content: ''; }
.about-copy { position: relative; z-index: 1; padding: 43px 22px 43px 48px; }
.about-copy .eyebrow { margin-bottom: 13px; }
.about-copy h2 { margin: 0 0 12px; font-family: var(--font-rounded); font-size: clamp(25px, 3.3vw, 36px); font-weight: 900; letter-spacing: -1px; line-height: 1.25; }
.about-copy > p:not(.eyebrow) { max-width: 480px; margin-bottom: 18px; color: #83777b; font-size: 12px; line-height: 1.9; }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.about-tags span { padding: 8px 11px; border: 1px solid rgba(220, 207, 192, 0.8); border-radius: 999px; background: rgba(255, 255, 255, 0.55); color: #77676d; font-size: 10px; font-weight: 700; }
.about-doodle { position: relative; align-self: stretch; min-height: 290px; }
.about-doodle img { position: absolute; right: 4%; bottom: -6%; width: min(96%, 370px); max-height: 310px; object-fit: contain; }
.doodle-star { position: absolute; z-index: 1; color: #dda955; }
.star-one { top: 19%; left: 16%; font-size: 25px; }
.star-two { top: 33%; right: 9%; color: #d99191; font-size: 26px; }
.doodle-note { position: absolute; z-index: 2; right: 5%; bottom: 16%; padding: 9px 13px; border: 1px solid rgba(237, 219, 195, 0.8); border-radius: 999px; background: #fff9e9; color: #9c7568; font-size: 10px; font-weight: 800; transform: rotate(-4deg); }

.add-section { padding-top: 54px; padding-bottom: 60px; }
.add-card { display: flex; align-items: center; gap: 19px; padding: 22px 27px; border: 1px dashed #e6c9bc; border-radius: 21px; background: rgba(255, 245, 234, 0.62); }
.add-icon { display: grid; flex: 0 0 auto; width: 43px; height: 43px; place-items: center; border: 1px solid #f0d3c5; border-radius: 14px; background: #fffaf4; color: var(--coral-deep); font-size: 24px; }
.add-icon img { display: block; width: 35px; height: 35px; }
.add-copy { flex: 1; }
.add-copy .eyebrow { margin-bottom: 4px; font-size: 9px; }
.add-copy h2 { margin: 0 0 3px; font-family: var(--font-rounded); font-size: 17px; font-weight: 900; }
.add-copy > p:not(.eyebrow) { margin: 0; color: #93868a; font-size: 11px; }
.add-card > .button { flex: 0 0 auto; width: max-content; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 0 19px; border: 0; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 800; transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .account-button:focus-visible, .auth-tab:focus-visible, .dialog-close:focus-visible { outline: 3px solid rgba(237, 140, 120, 0.42); outline-offset: 3px; }
.button-coral { background: var(--coral); color: white; box-shadow: 0 7px 17px rgba(220, 114, 95, 0.2); }
.button-coral:hover { background: var(--coral-deep); box-shadow: 0 10px 22px rgba(220, 114, 95, 0.25); }
.button-dark { background: #59464f; color: white; }
.button-dark:hover { background: #463740; }

.site-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; min-height: 88px; border-top: 1px solid #eadfd5; }
.footer-brand { min-width: auto; }
.footer-brand .brand-mark { width: 34px; height: 34px; }
.footer-brand .brand-name { font-size: 18px; }
.site-footer > p { margin: 0; color: #a09294; font-size: 10px; text-align: center; }
.site-footer > p span { color: #da8b8e; }
.back-top { justify-self: end; color: #9a8586; font-size: 10px; font-weight: 700; }
.back-top:hover { color: var(--coral-deep); }

.dialog { width: min(460px, calc(100% - 32px)); max-width: none; max-height: min(90vh, 780px); padding: 0; overflow: visible; border: 0; border-radius: 25px; background: transparent; color: var(--ink); }
.dialog::backdrop { background: rgba(55, 41, 47, 0.36); backdrop-filter: blur(4px); }
.dialog-card { position: relative; max-height: min(90vh, 780px); overflow: auto; padding: 34px 38px 28px; border: 1px solid #f2e5da; border-radius: 25px; background: #fffdf9; box-shadow: 0 25px 90px rgba(54, 39, 46, 0.25); }
.dialog-close { position: absolute; top: 16px; right: 16px; display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: #f7eee7; color: #7f6e74; cursor: pointer; font-size: 24px; line-height: 1; }
@media (hover: hover) and (pointer: fine) {
  .dialog-close:hover { background: #f3dfd8; }
}
.dialog [data-dialog-focus]:focus { outline: none; }
.dialog-paw { display: grid; width: 45px; height: 45px; margin-bottom: 18px; place-items: center; border-radius: 15px; background: #fff0c8; font-size: 23px; }
.dialog-card .eyebrow { margin-bottom: 8px; }
.dialog-card h2 { margin: 0 0 8px; font-family: var(--font-rounded); font-size: 24px; font-weight: 900; letter-spacing: -0.6px; }
.dialog-lede { margin-bottom: 20px; color: #96888c; font-size: 12px; line-height: 1.7; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 20px; padding: 4px; border-radius: 12px; background: #f5eee7; }
.auth-tab { min-height: 37px; border: 0; border-radius: 9px; background: transparent; color: #96888c; cursor: pointer; font-size: 12px; font-weight: 800; }
.auth-tab.is-active { background: white; color: #59464f; box-shadow: 0 2px 8px rgba(81, 61, 62, 0.08); }
.field-label { display: block; margin: 13px 0 7px; color: #6e5d64; font-size: 11px; font-weight: 800; }
.text-input { display: block; width: 100%; min-height: 45px; padding: 12px 14px; border: 1px solid #eadfd6; border-radius: 12px; outline: 0; background: #fff; color: var(--ink); font-size: 12px; transition: border-color 150ms ease, box-shadow 150ms ease; }
.text-input::placeholder { color: #b4a8aa; }
.text-input:focus { border-color: #e7a798; box-shadow: 0 0 0 3px rgba(237, 140, 120, 0.12); }
.form-submit { width: 100%; margin-top: 19px; }
.form-feedback { min-height: 18px; margin: 8px 0 0; color: #b67869; font-size: 11px; line-height: 1.55; }
.compose-card { --compose-preview-size: clamp(132px, calc(90vh - 500px), 240px); display: flex; flex-direction: column; padding: 28px 32px 20px; overflow: hidden; }
@supports (height: 100dvh) {
  .compose-card { --compose-preview-size: clamp(132px, calc(90dvh - 500px), 240px); }
}
.compose-card > .eyebrow, .compose-card > h2, .compose-card > .dialog-lede { flex: 0 0 auto; }
.compose-card > .dialog-lede { margin-bottom: 8px; }
#compose-form { flex: 0 1 auto; min-height: 0; padding: 3px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
#compose-form::-webkit-scrollbar { display: none; }
.compose-footer { flex: 0 0 auto; }
.compose-footer .form-feedback { min-height: 36px; text-align: center; }
.compose-card .upload-drop { width: min(100%, var(--compose-preview-size)); margin: 10px auto 14px; }
.upload-drop { position: relative; display: grid; width: 100%; aspect-ratio: 1; min-height: 0; margin: 20px 0 17px; overflow: hidden; place-items: center; border: 1px dashed #dfbfb0; border-radius: 22px; background: #fff8ee; cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.upload-drop:hover, .upload-drop:focus-within { border-color: var(--coral); background: #fff3e6; }
.upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-placeholder { display: grid; justify-items: center; gap: 7px; color: #78666a; }
.upload-cloud { display: grid; width: 58px; height: 58px; margin-bottom: 3px; place-items: center; border-radius: 20px; background: #fffdf8; box-shadow: 0 3px 12px rgba(102, 74, 68, 0.06); transform: rotate(-6deg); }
.upload-placeholder strong { font-size: 11px; }
.upload-placeholder small { color: #ad9da0; font-size: 9px; }
.upload-preview { position: absolute; inset: 0; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.caption-input { height: 112px; min-height: 112px; resize: none; overflow: auto; line-height: 1.7; }
.compose-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-count { color: #a79791; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.optional-label { color: #aa9da0; font-weight: 500; }
.compose-actions { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.compose-hint { color: #a6999b; font-size: 9px; }
.compose-actions .button { flex: 0 0 auto; }
.toast { position: fixed; z-index: 100; inset: auto; top: calc(env(safe-area-inset-top, 0px) + 16px); left: 50%; width: max-content; max-width: min(480px, calc(100vw - 32px)); margin: 0; padding: 13px 20px; border: 1px solid #ffffff1c; border-radius: 14px; background: #2d292b; color: #fffaf5; box-shadow: 0 8px 28px #251e2533; font-size: 13px; font-weight: 700; line-height: 1.6; text-align: center; overflow-wrap: anywhere; opacity: 0; pointer-events: none; transform: translate(-50%, -10px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast::backdrop { background: transparent; pointer-events: none; }

.logout-button, .inline-button { padding: 8px; border: 0; background: transparent; color: var(--coral-deep); font-size: 12px; cursor: pointer; }
.logout-button:focus-visible, .inline-button:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
.album-status { margin-top: 20px; padding: 22px; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.album-status .inline-button { margin-left: 8px; }
.album-empty { display: grid; justify-items: center; margin-top: 21px; padding: 28px 20px 34px; border: 1px dashed #e6c9bc; border-radius: 27px; background: #fff8ef; text-align: center; }
.album-empty img { width: min(220px, 60%); margin-bottom: 12px; }
.album-empty h3 { margin: 0 0 10px; font-size: 22px; }
.album-empty p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.load-more-wrap { display: flex; justify-content: center; margin-top: 24px; }
.form-feedback { overflow-wrap: anywhere; }
.header-actions { gap: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.account-button.is-avatar { display: inline-flex; align-items: center; gap: 8px; min-width: 0; width: auto; max-width: 210px; height: 48px; padding: 3px 14px 3px 3px; border: 1px solid #edd8c8; border-radius: 999px; background: #fffdf8; box-shadow: 0 4px 13px #9e706212; transition: transform 160ms ease, box-shadow 160ms ease; }
.account-button.is-avatar:hover { transform: translateY(-2px); box-shadow: 0 6px 16px #9e706225; }
.account-button.is-avatar img { flex: 0 0 auto; width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
.account-nickname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #806962; font-size: 13px; }
.profile-dialog { width: min(440px, calc(100% - 32px)); }
.profile-card { padding: 26px 34px 20px; }
.profile-intro { text-align: center; }
.profile-avatar { width: 64px; height: 64px; margin: 0 auto 12px; border: 4px solid white; border-radius: 50%; box-shadow: 0 6px 18px #b0806c1f; }
.profile-avatar-picker { position: relative; display: inline-flex; flex-direction: column; align-items: center; margin-bottom: 12px; cursor: pointer; }
.profile-avatar-picker .profile-avatar { margin-bottom: 5px; object-fit: cover; }
.avatar-edit-icon { position: absolute; right: -2px; top: 42px; display: grid; place-items: center; width: 24px; height: 24px; border: 3px solid #fffdf9; border-radius: 50%; background: var(--coral); color: white; font-size: 18px; line-height: 1; }
.avatar-edit-label { color: #b48d7d; font-size: 11px; }
.profile-avatar-picker:focus-within { outline: 3px solid #ed8c786b; outline-offset: 5px; border-radius: 12px; }
.profile-avatar-picker:has(input:disabled) { opacity: 0.6; cursor: wait; }
.profile-intro .eyebrow { color: #b59384; font-size: 9px; }
.profile-intro .dialog-lede { margin-bottom: 10px; }
.profile-fields { min-width: 0; padding: 0; margin: 0; border: 0; }
.profile-fields:disabled { opacity: 0.7; }
.profile-fields .field-label { margin-top: 12px; font-size: 12px; }
.profile-fields .text-input { font-size: 14px; }
.profile-select { appearance: auto; cursor: pointer; }
.field-hint { margin: 5px 0 0; color: #a59695; font-size: 11px; line-height: 1.6; }
.profile-fields .text-input[readonly] { background: #f6f0e9; color: #88736c; cursor: default; border-style: dashed; }
.profile-feedback { min-height: 18px; margin-top: 12px; }
.profile-feedback.is-success { color: #668b73; }
.profile-card .form-submit { margin-top: 6px; min-height: 44px; font-size: 13px; }
.profile-retry { padding-left: 0; }
.profile-signout { margin-top: 12px; padding-top: 5px; border-top: 1px solid #eee4d9; text-align: center; }
.profile-signout .logout-button { font-size: 12px; color: #a28b86; }
@media (min-width: 651px) {
  .main-nav { position: absolute; left: 50%; transform: translateX(-50%); }
  .album-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; }
  .album-total { justify-self: start; }
  .album-stats { justify-self: center; }
  .album-updated { justify-self: end; }
}

/* manipulation keeps scrolling and taps, while disabling double-tap zoom. */
@media (max-width: 650px), (pointer: coarse) {
  *, *::before, *::after { touch-action: manipulation; }
}

@media (max-width: 650px) {
  .account-button.is-avatar { max-width: 164px; height: 42px; padding: 3px 10px 3px 3px; }
  .account-button.is-avatar img { width: 34px; height: 34px; }
  .account-nickname { font-size: 12px; }
  .profile-card { padding: 28px 24px 20px; }
  .profile-avatar { width: 64px; height: 64px; margin-bottom: 12px; }
  .profile-card .text-input { font-size: 16px; }
}

@media (max-width: 900px) {
  .shell { width: min(100% - 44px, 720px); }
  .site-header { width: calc(100% - 44px); height: 74px; }
  .brand { min-width: auto; }
  .main-nav { gap: 21px; }
  .header-actions { min-width: auto; }
  .demo-chip { display: none; }
  .featured-entry { min-height: 340px; }
  .featured-photo, .featured-photo > img { min-height: 340px; }
  .memory-grid { grid-auto-columns: calc((100% - 20px) / 2); }
  .memory-copy { padding: 16px 14px; }
}

@media (max-width: 650px) {
  .shell { width: calc(100% - 36px); }
  .site-header { width: calc(100% - 36px); height: 67px; }
  .brand { flex: 0 0 auto; gap: 7px; }
  .brand-mark { width: 43px; height: 43px; }
  .brand-name { font-size: 18px; }
  .brand-subtitle { font-size: 10px; letter-spacing: 1px; }
  .main-nav { display: none; }
  .header-actions { flex: 0 1 auto; min-width: 0; margin-left: auto; padding-left: 12px; }
  .header-actions .account-button.is-avatar { width: auto; max-width: 164px; }
  .account-button { padding: 9px 13px; font-size: 11px; }

  .album-summary { padding-top: 16px; padding-bottom: 12px; }
  .album-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px 8px; padding: 13px 14px; border-radius: 18px; }
  .album-stats { grid-column: 1 / -1; grid-row: 1; flex-direction: row; align-items: center; gap: 0; margin: 0; padding-bottom: 10px; border-bottom: 1px solid #efdfd0; }
  .album-stats p { flex: 1; justify-content: center; gap: 6px; font-size: 11px; }
  .album-stats p + p { border-left: 1px solid #e8d9cd; }
  .album-stats strong { font-size: 24px; }
  .album-total { grid-column: 1; grid-row: 2; gap: 7px; min-width: 0; }
  .album-total > img { width: 29px; height: 29px; }
  .checkin-button { min-height: 34px; padding: 6px 11px; font-size: 11px; }
  .album-updated { grid-column: 2; grid-row: 2; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 9px; line-height: 1.2; }
  .album-updated strong { padding: 4px 8px; font-size: 10px; }
  .eyebrow { margin-bottom: 12px; font-size: 9px; letter-spacing: 1.6px; }

  .latest-section { padding-top: 13px; }
  .section-heading :is(h1, h2) { font-size: 25px; }
  .featured-entry { grid-template-columns: 1fr; margin-top: 16px; border-radius: 21px; }
  .featured-photo { min-height: unset; aspect-ratio: 1.18 / 1; }
  .featured-photo > img { min-height: unset; }
  .photo-label { top: 8px; left: 8px; width: 72px; height: 72px; }
  .featured-copy { padding: 23px 22px 20px; }
  .featured-date { margin-bottom: 11px; font-size: 10px; }
  .featured-copy h3 { margin-bottom: 8px; font-size: 24px; }
  .featured-copy > p { font-size: 12px; }
  .featured-footer { margin-top: 19px; padding-top: 13px; }

  .memory-section { padding-top: 32px; }
  .memory-heading { align-items: end; margin-bottom: 15px; }
  .memory-heading > div:first-child { min-width: 0; }
  .memory-heading .eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  .memory-controls { gap: 6px; padding-bottom: 0; }
  .memory-arrow { width: 38px; height: 38px; border: 0; border-radius: 13px; background: transparent; color: #ae7b68; }
  .memory-arrow svg { width: 38px; height: 38px; }
  .memory-arrow .cat-outline, .memory-arrow .cat-cheek { display: block; }
  .memory-arrow .arrow-line { stroke-width: 2.7; transform: none; }
  .memory-arrow:hover { background: #ffefe3; }
  .memory-arrow:disabled { opacity: .4; }
  .memory-heading .section-heading h2, .memory-heading h2 { font-size: 23px; }
  .photo-count { padding-bottom: 2px; font-size: 9px; }
  .memory-grid { grid-auto-columns: 84%; gap: 13px; }
  .memory-card { border-radius: 17px; }
  .memory-copy { padding: 13px 14px; }
  .memory-date { margin-bottom: 7px; font-size: 9px; }
  .memory-copy h3 { margin-bottom: 5px; font-size: 14px; }
  .memory-copy p { font-size: 10px; }
  .memory-paw { margin-top: 6px; font-size: 11px; }

  .about-section { padding-top: 59px; }
  .about-card { grid-template-columns: 1fr; min-height: 0; border-radius: 22px; }
  .about-copy { padding: 29px 24px 0; }
  .about-copy h2 { font-size: 28px; }
  .about-copy > p:not(.eyebrow) { margin-bottom: 14px; font-size: 11px; }
  .about-tags { gap: 6px; }
  .about-tags span { padding: 7px 9px; font-size: 9px; }
  .about-doodle { min-height: 220px; }
  .about-doodle img { right: 8%; bottom: -7%; width: 78%; max-height: 245px; }
  .star-one { top: 17%; left: 16%; }
  .star-two { top: 15%; right: 10%; }
  .doodle-note { right: 11%; bottom: 13%; }

  .add-section { padding-top: 24px; padding-bottom: 28px; }
  .add-card { align-items: flex-start; gap: 12px; padding: 17px 14px; border-radius: 17px; }
  .add-icon { width: 37px; height: 37px; border-radius: 12px; font-size: 20px; }
  .add-icon img { width: 31px; height: 31px; }
  .add-copy { padding-top: 2px; }
  .add-copy h2 { font-size: 14px; }
  .add-copy > p:not(.eyebrow) { font-size: 9px; line-height: 1.55; }
  .add-card > .button { align-self: center; min-height: 37px; gap: 5px; padding-inline: 12px; font-size: 10px; white-space: nowrap; }

  .site-footer { display: grid; grid-template-columns: 1fr auto; gap: 14px; min-height: 74px; padding-block: 20px; }
  .footer-brand { grid-column: 1; grid-row: 1; }
  .footer-brand .brand-mark { width: 29px; height: 29px; }
  .footer-brand .brand-name { font-size: 16px; }
  .site-footer > p { grid-column: 1 / -1; grid-row: 2; max-width: none; font-size: 10px; line-height: 1.6; }
  .back-top { grid-column: 2; grid-row: 1; font-size: 10px; white-space: nowrap; }
  .dialog-card { padding: 31px 24px 23px; }
  .dialog-card h2 { padding-right: 10px; font-size: 21px; }
  .dialog, .dialog-card { max-height: calc(100dvh - 32px); }
  .dialog :is(input, textarea, select) { font-size: 16px; }
  .compose-card { padding: 26px 22px 20px; }
  .compose-card .caption-input { height: 96px; min-height: 96px; }
  .upload-drop { border-radius: 19px; }
}

/* Author-only controls float above the card; the menu uses a top-layer popover. */
.featured-entry, .memory-card { position: relative; }
.entry-manage { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; width: 40px; height: 40px; padding: 5px; place-items: center; border: 1px solid #ead8c9; border-radius: 14px; background: #fffbf3f5; box-shadow: 0 3px 12px #72554216; cursor: pointer; }
.entry-manage img { width: 28px; height: 28px; }
.entry-manage:disabled { cursor: wait; opacity: .6; }
.entry-manage:focus-visible, .entry-menu button:focus-visible, .delete-cancel:focus-visible { outline: 3px solid #ed8c786b; outline-offset: 3px; }
@media (min-width: 651px) and (hover: hover) and (pointer: fine) {
  .entry-manage { opacity: 0; pointer-events: none; transition: opacity 140ms ease; }
  :is(.featured-entry, .memory-card):is(:hover, :focus-within) .entry-manage,
  .entry-manage[aria-expanded="true"] { opacity: 1; pointer-events: auto; }
}
.entry-menu { position: fixed; inset: auto; z-index: 40; width: 202px; max-width: calc(100vw - 24px); margin: 0; padding: 9px; overflow: visible; border: 1px solid #ecddce; border-radius: 18px; background: #fffdf7; color: var(--ink); box-shadow: 0 12px 32px #6e4e4424, 0 2px 6px #6e4e4409; }
.entry-menu[hidden], .entry-menu button[hidden] { display: none; }
.entry-menu::backdrop { background: transparent; }
.entry-menu-title { margin: 2px 8px 7px; padding-bottom: 8px; border-bottom: 1px dashed #ecded1; color: #a18b7e; font-size: 11px; font-weight: 800; }
.entry-menu-title span { color: #dc9a8c; }
.entry-menu button { display: flex; width: 100%; min-height: 43px; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 11px; background: transparent; color: #795f56; cursor: pointer; text-align: left; font-size: 13px; font-weight: 800; }
.entry-menu button img { flex: 0 0 22px; width: 22px; height: 22px; object-fit: contain; }
.entry-menu button[data-photo-action="delete"] { color: #ae7266; }
.menu-plus { margin-left: auto; color: #d78379; font-size: 12px; }
.bowl-plus { color: #d69a50; }
@media (hover: hover) and (pointer: fine) {
  .entry-menu button:hover { background: #f7eee5; }
}
.delete-card { text-align: center; scrollbar-width: none; }
.delete-card::-webkit-scrollbar { display: none; }
.delete-illustration { display: grid; width: 72px; height: 72px; margin: 0 auto 14px; place-items: center; border-radius: 25px; background: #f8eddf; transform: rotate(-6deg); }
.delete-card h2 { font-size: 23px; }
.delete-card .dialog-lede { margin-bottom: 19px; }
.delete-photo { display: flex; align-items: center; gap: 13px; margin: 0 0 22px; padding: 10px; border: 1px solid #e5e8db; border-radius: 17px; background: #f1f3e9; text-align: left; }
#delete-photo-preview { position: relative; flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden; border-radius: 11px; }
#delete-photo-preview > img { display: block; width: 100%; height: 100%; object-fit: cover; }
#delete-photo-preview .photo-retry { display: none; }
#delete-photo-name { margin: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 800; }
.delete-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.delete-actions .button { min-height: 44px; padding: 10px 12px; font-size: 13px; }
.delete-cancel { border: 1px solid #e6dacd; background: #faf5ec; color: #958171; box-shadow: none; }
.delete-feedback { min-height: 18px; margin: 11px 0 0; color: #a49287; font-size: 11px; }
@media (max-width: 650px) {
  .entry-manage { top: 10px; right: 10px; }
  .delete-card h2 { padding: 0; font-size: 21px; }
}

/* Keep editable controls above mobile browsers' focus-zoom threshold, including landscape. */
@media (max-width: 650px), (pointer: coarse) {
  input, textarea, select { font-size: 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
