:root {
  color-scheme: light;
  --ink: #23302b;
  --muted: #68736e;
  --forest: #315d4c;
  --forest-dark: #24483a;
  --sage: #dce7df;
  --cream: #f7f5f0;
  --paper: #fffefa;
  --line: #deded7;
  --terracotta: #c77758;
  --shadow: 0 18px 45px rgba(48, 63, 56, 0.08);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); min-width: 320px; }
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 6% 20%, rgba(208, 224, 212, 0.48), transparent 24rem),
    radial-gradient(circle at 92% 36%, rgba(240, 218, 199, 0.36), transparent 25rem),
    linear-gradient(180deg, #fbfaf7 0, var(--cream) 42rem);
}

.app-shell { min-height: 100vh; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(430px, 0.95fr); background: var(--paper); }
.login-brand-panel { position: relative; overflow: hidden; color: #f9fbf8; background: linear-gradient(145deg, #244b3c 0%, #315f4e 58%, #3a6b59 100%); }
.login-brand-panel::before, .login-brand-panel::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); }
.login-brand-panel::before { width: 34rem; height: 34rem; left: -17rem; bottom: -17rem; }
.login-brand-panel::after { width: 24rem; height: 24rem; right: -12rem; top: -12rem; }
.login-brand-content { min-height: 100vh; position: relative; z-index: 1; display: flex; flex-direction: column; padding: clamp(32px, 6vw, 76px); }
.brand-light { color: white; }
.brand-light .brand-mark svg { fill: #f8fbf8; }
.brand-light .brand-heart { fill: var(--forest); }
.brand-light small { color: rgba(255,255,255,.64); }
.login-quote { margin: auto 0 34px; }
.quote-mark { display: block; font-family: "Newsreader", serif; color: #e2ad81; font-size: 4.5rem; line-height: .5; margin-bottom: 18px; }
.login-quote h1 { font-family: "Newsreader", serif; font-size: clamp(2.6rem, 4.3vw, 4.7rem); line-height: .99; letter-spacing: -.035em; font-weight: 500; margin: 0 0 24px; }
.login-quote p { color: rgba(255,255,255,.7); font-size: 1rem; line-height: 1.7; max-width: 31rem; }
.memory-window { width: min(100%, 530px); height: 190px; border-radius: 90px 90px 16px 16px; position: relative; overflow: hidden; background: linear-gradient(#b8d0c9 0 58%, #92aa9f 58%); border: 8px solid rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 24px 50px rgba(12,30,23,.22); }
.window-sun { position: absolute; width: 38px; height: 38px; border-radius: 50%; background: #efc189; left: 20%; top: 23%; box-shadow: 0 0 30px rgba(239,193,137,.48); }
.window-cloud { position: absolute; width: 56px; height: 13px; border-radius: 18px; background: rgba(255,255,255,.48); }
.window-cloud::before, .window-cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.window-cloud::before { width: 24px; height: 24px; left: 12px; top: -12px; }
.window-cloud::after { width: 18px; height: 18px; right: 7px; top: -7px; }
.cloud-one { left: 43%; top: 26%; }.cloud-two { right: 12%; top: 42%; transform: scale(.7); opacity: .7; }
.window-mountain { position: absolute; bottom: -52px; transform: rotate(45deg); border-radius: 18px; }
.mountain-back { width: 180px; height: 180px; right: 5%; background: #668575; }
.mountain-front { width: 230px; height: 230px; left: 8%; bottom: -130px; background: #466b59; }
.window-family { position: absolute; bottom: 21px; width: 15px; height: 44px; border-radius: 10px 10px 5px 5px; background: #243c32; box-shadow: 0 -10px 0 -1px #243c32; }
.family-one { left: 46%; height: 48px; }.family-two { left: 51%; height: 39px; }.family-three { left: 55%; height: 31px; }
.login-privacy { margin-top: 25px; color: rgba(255,255,255,.67); font-size: .84rem; display: flex; align-items: center; gap: 9px; }
.login-privacy span { color: #dfac81; font-size: .7rem; }
.login-form-panel { display: grid; place-items: center; padding: 42px clamp(28px, 7vw, 105px); background: linear-gradient(145deg, #fffefa, #f8f6f1); }
.login-form { width: min(100%, 440px); }
.login-form > h2 { font-family: "Newsreader", serif; font-weight: 600; font-size: 2.25rem; margin: 8px 0 12px; letter-spacing: -.02em; }
.login-form > p { color: var(--muted); line-height: 1.65; margin: 0 0 33px; font-size: .92rem; }
.form-field { display: grid; gap: 8px; margin-bottom: 18px; color: #46544d; font-size: .84rem; font-weight: 600; }
.form-field > span:first-child { display: flex; justify-content: space-between; }
.form-field em { font-style: normal; color: #929995; font-weight: 400; }
.form-field input { width: 100%; height: 50px; border: 1px solid #d7dbd7; border-radius: 9px; background: white; color: var(--ink); padding: 0 14px; outline: none; font-size: .9rem; transition: .2s; }
.form-field input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(49,93,76,.1); }
.password-wrap { position: relative; display: block !important; }
.password-wrap input { padding-right: 64px; }
.password-wrap button { position: absolute; right: 8px; top: 8px; height: 34px; padding: 0 8px; border: 0; background: transparent; color: var(--forest); font-size: .73rem; font-weight: 600; cursor: pointer; }
.login-options { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 25px; font-size: .75rem; }
.login-options label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.login-options input { accent-color: var(--forest); width: 16px; height: 16px; }
.login-options button { border: 0; background: none; color: var(--forest); font-weight: 600; cursor: pointer; }
.login-button { width: 100%; min-height: 52px; font-size: .9rem; }
.invite-note { display: flex; gap: 10px; align-items: center; margin-top: 25px; padding: 14px; border-radius: 10px; background: #edf2ee; color: #68756e; font-size: .75rem; line-height: 1.5; }
.invite-note svg { width: 20px; flex: 0 0 auto; fill: none; stroke: var(--forest); stroke-width: 1.5; }
.topbar {
  height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(24px, 5vw, 80px);
  border-bottom: 1px solid rgba(49, 93, 76, 0.1);
  background: rgba(251, 250, 247, 0.82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; width: max-content; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; }
.brand-mark svg { width: 40px; fill: var(--forest); }
.brand-mark .brand-heart { fill: #fffefa; }
.brand strong { display: block; font-family: "Newsreader", serif; font-size: 1.24rem; line-height: 1; }
.brand small { display: block; margin-top: 4px; font-size: 0.71rem; color: var(--muted); letter-spacing: 0.02em; }

.main-nav { display: flex; gap: 34px; height: 84px; align-items: center; }
.main-nav a { position: relative; color: #65706b; text-decoration: none; font-size: 0.82rem; font-weight: 600; height: 100%; display: flex; align-items: center; gap: 7px; }
.main-nav a > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.main-nav a:hover, .main-nav a.active { color: var(--forest); }
.main-nav a.active::after { content: ""; position: absolute; height: 2px; width: 100%; bottom: 0; background: var(--forest); border-radius: 3px; }

.account-area { justify-self: end; position: relative; }
.family-switcher { border: 1px solid #d8dcd7; background: rgba(255, 255, 255, 0.76); border-radius: 27px; min-height: 50px; padding: 5px 11px 5px 6px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.family-switcher:hover { border-color: #b5c4bc; background: white; }
.family-switcher > svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.family-switcher[aria-expanded="true"] { border-color: #aebdb5; background: white; box-shadow: 0 6px 18px rgba(35,53,44,.1); }
.family-switcher[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-avatar { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(145deg,#9d6654,#c98569); font-family: "Newsreader",serif; font-size: 1rem; font-weight: 600; }
.account-copy { min-width: 0; text-align: left; line-height: 1.15; }
.account-copy strong { display: block; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .73rem; }
.account-copy small { display: block; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #89928d; font-size: .62rem; margin-top: 3px; }
.account-chevron { transition: transform .2s ease; }
.account-menu { position: absolute; z-index: 80; right: 0; top: calc(100% + 10px); width: min(340px, calc(100vw - 24px)); border: 1px solid rgba(52,75,64,.14); border-radius: 16px; background: rgba(255,254,250,.98); box-shadow: 0 22px 60px rgba(27,45,36,.19); overflow: hidden; animation: menuIn .2s ease both; backdrop-filter: blur(18px); }
.account-menu-header { display: flex; align-items: center; gap: 12px; padding: 18px; }
.menu-avatar { width: 43px; height: 43px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(145deg,#9d6654,#c98569); font-family: "Newsreader",serif; font-size: 1.05rem; }
.account-menu-header strong { display: block; font-family: "Newsreader",serif; font-size: 1rem; }
.account-menu-header span:last-child { display: block; color: #818a85; margin-top: 3px; font-size: .68rem; }
.account-menu-family { margin: 0 14px 9px; border-radius: 9px; padding: 10px 12px; background: #edf2ee; }
.account-menu-family span { display: block; color: #88918c; font-size: .62rem; }
.account-menu-family strong { display: block; color: var(--forest); margin-top: 2px; font-size: .73rem; }
.account-menu-actions { padding: 6px 8px; border-top: 1px solid #e8e9e3; }
.account-menu-actions button { width: 100%; border: 0; border-radius: 9px; padding: 10px; background: transparent; display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 9px; text-align: left; cursor: pointer; }
.account-menu-actions button:hover { background: #f2f4f0; }
.account-menu-actions svg { width: 20px; fill: none; stroke: var(--forest); stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.account-menu-actions strong { display: block; font-size: .72rem; }
.account-menu-actions small { display: block; color: #8a928e; margin-top: 2px; font-size: .61rem; }
.logout-button { width: 100%; border: 0; border-top: 1px solid #e8e9e3; background: transparent; color: #a25045; min-height: 48px; padding: 0 18px; display: flex; align-items: center; gap: 10px; font-size: .72rem; font-weight: 600; cursor: pointer; }
.logout-button:hover { background: #fbf1ee; }
.logout-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0 80px; }
.app-view[hidden] { display: none !important; }
.content-view { min-height: calc(100vh - 236px); animation: rise .35s ease both; }
.content-header { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 38px; }
.content-header h1 { font-family: "Newsreader", serif; font-size: clamp(2.7rem, 5vw, 4.3rem); line-height: 1; font-weight: 500; letter-spacing: -.035em; margin: 14px 0 10px; }
.content-header p { color: var(--muted); margin: 0; font-size: .9rem; }
.view-message { min-height: 350px; border: 1px dashed #cbd2cd; border-radius: 18px; background: rgba(255,254,250,.7); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 35px; color: var(--muted); }
.view-message strong { color: var(--ink); font-family: "Newsreader", serif; font-size: 1.35rem; margin: 12px 0 5px; }
.view-message p { max-width: 520px; line-height: 1.6; font-size: .82rem; }
.view-message .primary-button, .view-message .secondary-button { margin-top: 10px; }
.loading-ring { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #d9e2dc; border-top-color: var(--forest); animation: spin .85s linear infinite; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: #e7eee9; color: var(--forest); font-family: "Newsreader", serif; font-size: 2rem; }
.timeline-groups { display: grid; gap: 40px; }
.timeline-toolbar { display:flex; align-items:center; gap:8px; margin:-18px 0 28px; padding:8px; width:max-content; max-width:100%; border:1px solid rgba(65,84,75,.13); border-radius:999px; background:rgba(255,254,250,.84); box-shadow:0 8px 24px rgba(42,58,50,.06); }
.timeline-toolbar span { width:1px; align-self:stretch; background:#dfe5e1; margin:0 3px; }
.timeline-toolbar button { min-height:36px; border:0; border-radius:999px; padding:0 14px; background:transparent; color:var(--muted); font:inherit; font-size:.72rem; font-weight:700; cursor:pointer; }
.timeline-toolbar button.active { background:var(--forest); color:white; box-shadow:0 5px 14px rgba(23,85,69,.2); }
.timeline-year-filters { display:flex; align-items:center; gap:9px; margin:-14px 0 30px; overflow-x:auto; padding:4px 2px 9px; scrollbar-width:thin; }
.timeline-year-filters[hidden] { display:none; }
.timeline-year-filters > strong { flex:0 0 auto; margin-right:5px; color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; }
.timeline-year-filters button { flex:0 0 auto; min-width:98px; border:1px solid rgba(65,84,75,.16); border-radius:14px; padding:9px 13px; background:rgba(255,254,250,.88); color:var(--forest); text-align:left; font:inherit; cursor:pointer; transition:.2s ease; }
.timeline-year-filters button:hover { transform:translateY(-1px); border-color:rgba(23,107,91,.4); }
.timeline-year-filters button.active { background:linear-gradient(135deg,var(--forest),#2a7e6d); color:white; border-color:transparent; box-shadow:0 8px 20px rgba(23,85,69,.18); }
.timeline-year-filters button span { display:block; font-family:"Newsreader",serif; font-size:1.05rem; font-weight:700; }
.timeline-year-filters button small { display:block; margin-top:2px; color:inherit; opacity:.7; font-size:.61rem; }
.load-more-wrap { display: flex; justify-content: center; padding: 26px 0 8px; }
.load-more-button { min-width: 210px; min-height: 44px; }
.timeline-group-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 15px; }
.timeline-group-header h2 { margin: 0; font-family: "Newsreader", serif; font-size: 1.65rem; font-weight: 600; }
.timeline-group-header span { color: #8a938e; font-size: .72rem; }
.memory-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.memory-grid.compact { grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; }
.memory-grid.compact .memory-card { border-radius:9px; }
.memory-grid.compact .memory-card-copy { left:9px; right:9px; bottom:8px; }
.memory-grid.compact .memory-card-copy strong { font-size:.67rem; }
.memory-grid.compact .memory-card-copy span { display:none; }
.memory-card { border: 0; padding: 0; background: #e6ebe7; border-radius: 13px; overflow: hidden; position: relative; aspect-ratio: 1 / 1.12; cursor: pointer; text-align: left; box-shadow: 0 7px 20px rgba(42,58,50,.07); }
.memory-card img, .memory-card video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.memory-card .media-unavailable, .album-cover .media-unavailable { background: linear-gradient(145deg,#dfe9e2,#f0e8df); }
.memory-card:hover img, .memory-card:hover video { transform: scale(1.035); }
.memory-card::after { content: ""; position: absolute; inset: 48% 0 0; background: linear-gradient(transparent, rgba(19,31,26,.7)); pointer-events: none; }
.memory-card-copy { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 13px; color: white; }
.memory-card-copy strong { display: block; font-size: .78rem; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memory-card-copy span { display: block; margin-top: 3px; color: rgba(255,255,255,.77); font-size: .65rem; }
.video-pill { position: absolute; z-index: 2; right: 10px; top: 10px; border-radius: 20px; padding: 5px 8px; color: white; background: rgba(21,34,28,.68); font-size: .62rem; }
.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.album-card { border: 1px solid rgba(65,84,75,.13); border-radius: 17px; background: var(--paper); padding: 12px; box-shadow: var(--shadow); cursor: pointer; text-align: left; transition: transform .2s ease, box-shadow .2s ease; }
.album-card:hover { transform: translateY(-2px); box-shadow: 0 22px 50px rgba(48,63,56,.12); }
.album-cover { height: 220px; border-radius: 11px; overflow: hidden; background: #dde6e0; position: relative; }
.album-cover img, .album-cover video { width: 100%; height: 100%; object-fit: cover; }
.album-cover.empty { display: grid; place-items: center; background: linear-gradient(145deg,#dfe9e2,#f0e8df); }
.album-cover.empty svg { width: 48px; fill: none; stroke: var(--forest); stroke-width: 1.2; opacity: .55; }
.album-card-copy { padding: 14px 5px 5px; }
.album-card-copy strong { display: block; font-family: "Newsreader", serif; font-size: 1.18rem; }
.album-card-copy span { display: block; color: var(--muted); margin-top: 5px; font-size: .71rem; }
.album-actions { display:flex; flex-wrap:wrap; gap:8px; padding:0 5px 8px; }
.album-actions button { min-height:36px; border-radius:999px; border:1px solid #d5ddd8; padding:0 13px; background:#fff; color:var(--forest); font:inherit; font-size:.72rem; font-weight:700; cursor:pointer; }
.album-actions .album-play { background:var(--terracotta); color:#fff; border-color:transparent; }
.album-actions .album-upload { background:var(--forest); color:#fff; border-color:transparent; }
.album-actions .album-icon { width:36px; min-width:36px; padding:0; }
.album-actions .album-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.danger-button { color:#a64036 !important; border-color:#e6bcb7 !important; background:#fff8f7 !important; }
.role-badge { display:inline-flex !important; width:max-content; margin-top:5px; border-radius:999px; padding:3px 8px; background:#e4eee8; color:var(--forest) !important; font-size:.58rem !important; font-weight:700; }
.lightbox { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(12,20,16,.92); padding: 54px 24px 24px; }
.lightbox[hidden] { display: none; }
.lightbox img, .lightbox video { max-width: min(1100px, 94vw); max-height: 78vh; object-fit: contain; border-radius: 9px; }
.lightbox-close { position: absolute; right: 22px; top: 18px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: white; font-size: 1.4rem; cursor: pointer; }
.lightbox-caption { color: white; margin-top: 14px; text-align: center; max-width: 700px; }
.lightbox-caption strong { display: block; font-family: "Newsreader",serif; font-size: 1.2rem; }
.lightbox-caption span { color: rgba(255,255,255,.68); font-size: .75rem; }
.lightbox-actions { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:9px; margin-top:14px; }
.lightbox-actions button, .lightbox-actions a { min-height:40px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; border:1px solid rgba(255,255,255,.28); background:rgba(255,255,255,.1); color:#fff; padding:0 15px; font:inherit; font-size:.72rem; text-decoration:none; cursor:pointer; }
.lightbox.slideshow img { animation:kenburns 5s ease-in-out both; }
.lightbox.slideshow .lightbox-caption strong { font-size:1.55rem; }
.hero { text-align: center; max-width: 800px; margin: 0 auto 42px; animation: rise 0.55s ease both; }
.eyebrow { color: var(--forest); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.73rem; font-weight: 700; display: inline-flex; align-items: center; gap: 9px; }
.eyebrow span { width: 18px; height: 1px; background: var(--terracotta); }
.hero h1 { font-family: "Newsreader", Georgia, serif; font-size: clamp(2.6rem, 5.5vw, 4.7rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.035em; margin: 20px 0 18px; }
.hero p { color: var(--muted); max-width: 630px; margin: 0 auto; font-size: 0.98rem; line-height: 1.75; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.82fr); gap: 24px; align-items: stretch; }
.upload-card, .guide-card, .queue-section { background: rgba(255, 254, 250, 0.92); border: 1px solid rgba(71, 92, 82, 0.14); border-radius: 22px; box-shadow: var(--shadow); }
.upload-card { padding: 15px; animation: rise 0.55s 0.08s ease both; }
.destination-section { padding: 15px 15px 23px; }
.section-step { display: flex; align-items: center; gap: 12px; }
.section-step > span { width: 29px; height: 29px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--forest); font-family: "Newsreader", serif; font-size: .95rem; }
.section-step strong { display: block; font-family: "Newsreader", serif; font-size: 1.08rem; }
.section-step small { display: block; color: var(--muted); margin-top: 2px; font-size: .71rem; }
.upload-step { margin: 0 15px 14px; padding-top: 19px; border-top: 1px solid #e5e6df; }
.album-picker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 16px; }
.album-select-wrap { min-height: 59px; position:relative; display: grid; grid-template-columns: 40px minmax(0,1fr) 18px; align-items: center; gap: 11px; border: 1px solid #daddd8; border-radius: 10px; background: #fff; padding: 7px 13px; cursor: pointer; }
.album-select-wrap:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(49,93,76,.08); }
.album-folder { width: 37px; height: 37px; border-radius: 9px; display: grid; place-items: center; background: #e7eee9; }
.album-folder svg, .summary-icon svg, .modal-icon svg { width: 21px; fill: none; stroke: var(--forest); stroke-width: 1.6; stroke-linejoin: round; }
.album-select-copy { min-width: 0; }
.album-select-copy small { display: block; color: #8c9490; font-size: .64rem; margin-bottom: 2px; }
.album-select-copy select { display:block; width:100%; min-height:28px; margin:0; border:0; outline:0; background:#fff; color:var(--ink); font:inherit; font-size:.82rem; font-weight:600; cursor:pointer; }
.select-chevron { width: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; pointer-events:none; }
.secondary-button { min-height: 46px; border: 1px solid #ccd3ce; background: #fff; color: var(--forest); border-radius: 9px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .78rem; font-weight: 600; cursor: pointer; }
.secondary-button:hover { border-color: var(--forest); background: #f5f8f5; }
.secondary-button span { font-size: 1.15rem; font-weight: 400; }
.dropzone { min-height: 390px; border: 1.5px dashed #aebdb5; border-radius: 15px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px; text-align: center; cursor: pointer; transition: 0.22s ease; outline: none; background: linear-gradient(145deg, rgba(251, 252, 248, 0.7), rgba(246, 249, 244, 0.35)); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover { border-color: var(--forest); background: #f5f9f4; transform: translateY(-1px); }
.dropzone.dragover { box-shadow: inset 0 0 0 4px rgba(49, 93, 76, 0.07); }
.upload-illustration { width: 98px; height: 76px; position: relative; margin-bottom: 18px; }
.photo-card { position: absolute; width: 58px; height: 55px; border: 2px solid var(--forest); border-radius: 8px; background: var(--paper); }
.photo-card-back { left: 16px; top: 4px; transform: rotate(-8deg); opacity: 0.35; }
.photo-card-front { left: 23px; top: 8px; display: grid; place-items: center; }
.photo-card-front svg { width: 42px; fill: none; stroke: var(--forest); stroke-width: 2; }
.upload-plus { position: absolute; right: 5px; bottom: 2px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--terracotta); border: 3px solid var(--paper); font-size: 1.25rem; line-height: 1; box-shadow: 0 4px 12px rgba(140, 73, 51, 0.22); }
.dropzone h2 { font-family: "Newsreader", serif; font-size: 1.55rem; margin: 0 0 7px; font-weight: 600; }
.dropzone > p { margin: 0 0 23px; color: var(--muted); font-size: 0.84rem; }
.primary-button { border: 0; background: var(--forest); color: white; min-height: 48px; border-radius: 9px; padding: 0 21px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 0.84rem; font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px rgba(49, 93, 76, 0.18); transition: 0.2s ease; }
.primary-button:hover { background: var(--forest-dark); transform: translateY(-1px); box-shadow: 0 11px 24px rgba(49, 93, 76, 0.25); }
.primary-button:disabled { opacity: 0.6; cursor: wait; transform: none; }
.primary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.file-hint { display: flex; align-items: center; gap: 12px; color: #87908c; font-size: 0.68rem; margin-top: 19px; }
.file-hint i { width: 3px; height: 3px; background: #aeb5b1; border-radius: 50%; }
.privacy-note { min-height: 65px; display: flex; align-items: center; justify-content: center; gap: 11px; color: #65706b; padding: 14px 20px 0; font-size: 0.72rem; line-height: 1.55; }
.privacy-note strong { color: #4c5c54; font-weight: 600; }
.privacy-icon { width: 29px; height: 29px; flex: 0 0 auto; border-radius: 50%; background: #e7eee9; display: grid; place-items: center; }
.privacy-icon svg { width: 16px; fill: none; stroke: var(--forest); stroke-width: 1.6; }

.guide-card { padding: 30px 27px 24px; display: flex; flex-direction: column; animation: rise 0.55s 0.14s ease both; }
.guide-heading { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 24px; border-bottom: 1px solid #e6e7e1; }
.spark { color: var(--terracotta); font-size: 1.25rem; padding-top: 2px; }
.overline { display: block; text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.12em; color: #8b918e; font-weight: 700; margin-bottom: 5px; }
.guide-heading h2, .queue-heading h2 { margin: 0; font-family: "Newsreader", serif; font-size: 1.25rem; font-weight: 600; }
.guide-list { list-style: none; padding: 7px 0 0; margin: 0; }
.guide-list li { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 16px 0; }
.step-icon { width: 39px; height: 39px; border-radius: 10px; display: grid; place-items: center; background: #e4ece6; }
.step-icon svg { width: 21px; fill: none; stroke: var(--forest); stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.caption-icon { background: #f3e7df; }
.caption-icon svg { stroke: #a9624d; }
.people-icon { background: #e9e6ee; }
.people-icon svg { stroke: #70657f; }
.guide-list strong { display: block; font-size: 0.79rem; margin: 1px 0 5px; }
.guide-list p { color: var(--muted); font-size: 0.69rem; line-height: 1.55; margin: 0; }
.today-card { margin-top: auto; background: #f0eee6; border-radius: 13px; min-height: 73px; display: flex; align-items: center; gap: 13px; padding: 11px; overflow: hidden; }
.today-card > div:last-child span { display: block; font-size: 0.65rem; color: #7b807c; margin-bottom: 3px; }
.today-card strong { display: block; font-family: "Newsreader", serif; font-size: 0.88rem; line-height: 1.25; }
.today-visual { width: 72px; height: 51px; flex: 0 0 auto; background: #d6e1dc; border-radius: 9px; position: relative; overflow: hidden; }
.sun { position: absolute; width: 13px; height: 13px; background: #e1a96d; border-radius: 50%; left: 13px; top: 9px; }
.hill { position: absolute; border-radius: 60% 60% 0 0; }
.hill-back { width: 60px; height: 35px; background: #8ba497; right: -9px; bottom: -10px; transform: rotate(-8deg); }
.hill-front { width: 65px; height: 32px; background: #5b796b; left: -14px; bottom: -13px; transform: rotate(8deg); }

.queue-section { margin-top: 28px; padding: 28px; animation: rise 0.35s ease both; }
.queue-heading { display: flex; justify-content: space-between; align-items: end; padding-bottom: 20px; border-bottom: 1px solid #e5e6df; }
.text-button { background: none; border: 0; color: #9a5e4a; font-size: 0.75rem; font-weight: 600; cursor: pointer; padding: 7px; }
.file-list { display: grid; gap: 11px; padding: 18px 0; }
.file-row { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; gap: 15px; align-items: center; padding: 10px; border: 1px solid #e5e6df; border-radius: 12px; background: #fbfbf8; }
.file-preview { width: 66px; height: 58px; border-radius: 8px; overflow: hidden; background: #e8ece8; display: grid; place-items: center; position: relative; }
.file-preview img, .file-preview video { width: 100%; height: 100%; object-fit: cover; }
.file-preview .video-badge { position: absolute; width: 23px; height: 23px; display: grid; place-items: center; background: rgba(28, 40, 34, 0.72); border-radius: 50%; color: white; font-size: 0.55rem; }
.file-info { min-width: 0; }
.file-info strong { display: block; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { margin-top: 5px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #858d89; font-size: 0.67rem; }
.file-meta i { width: 3px; height: 3px; border-radius: 50%; background: #b5bbb7; }
.progress-track { height: 4px; background: #e1e7e2; border-radius: 4px; margin-top: 9px; overflow: hidden; display: none; }
.file-row.uploading .progress-track, .file-row.complete .progress-track { display: block; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--forest); border-radius: inherit; transition: width 0.2s ease; }
.upload-detail { display: none; justify-content: space-between; gap: 12px; margin-top: 6px; color: #858d89; font-size: .62rem; }
.file-row.uploading .upload-detail, .file-row.complete .upload-detail { display: flex; }
.file-actions { display: flex; align-items: center; gap: 8px; }
.file-action { border: 0; background: transparent; color: #828b87; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.file-action:hover { background: #f0eee9; color: #9a5e4a; }
.file-action svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.file-status { color: var(--forest); font-size: 0.69rem; font-weight: 600; display: none; }
.cancel-upload { display: none; border: 1px solid #d5dcd7; border-radius: 999px; background: white; color: #77584b; padding: 6px 10px; font: inherit; font-size: .65rem; cursor: pointer; }
.file-row.uploading .cancel-upload { display: inline-flex; }
.file-row.uploading .file-action, .file-row.complete .file-action { display: none; }
.file-row.uploading .file-status, .file-row.complete .file-status, .file-row.cancelled .file-status { display: block; }
.file-row.cancelled { opacity: .72; }
.memory-details { padding: 21px 0; border-top: 1px solid #e5e6df; }
.detail-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(250px,.75fr); gap: 16px; margin-top: 16px; }
.story-field { position: relative; display: block; }
.story-field > span { display: block; font-size: .75rem; font-weight: 600; margin-bottom: 7px; }
.story-field textarea { width: 100%; min-height: 92px; resize: vertical; border: 1px solid #d9ddd8; border-radius: 10px; background: #fff; color: var(--ink); padding: 12px 14px 25px; outline: none; font: inherit; font-size: .8rem; line-height: 1.5; }
.story-field textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(49,93,76,.08); }
.story-field > small { position: absolute; right: 10px; bottom: 9px; color: #969d99; font-size: .65rem; }
.destination-summary { min-height: 116px; border-radius: 11px; background: #f0f4f0; display: flex; align-items: center; gap: 12px; padding: 16px; }
.summary-icon { width: 41px; height: 41px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; background: white; }
.destination-summary small, .destination-summary span:last-child { display: block; color: #7c8781; font-size: .66rem; }
.destination-summary strong { display: block; margin: 4px 0; font-family: "Newsreader", serif; font-size: 1rem; }
.queue-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e5e6df; padding-top: 20px; }
.queue-summary { display: flex; gap: 16px; color: var(--muted); font-size: 0.75rem; }
.queue-summary span:first-child { color: var(--ink); font-weight: 600; }
.upload-button { min-width: 190px; }

footer { min-height: 82px; border-top: 1px solid rgba(49, 93, 76, 0.1); display: flex; justify-content: center; align-items: center; gap: 10px; color: #8a918d; font-size: 0.68rem; }
footer span:first-child { font-family: "Newsreader", serif; color: #68766f; font-size: 0.85rem; }
.footer-dot { width: 3px; height: 3px; background: #aeb4b0; border-radius: 50%; }
.toast { position: fixed; right: 28px; bottom: 28px; z-index: 50; display: flex; align-items: center; gap: 11px; background: #253d32; color: white; border-radius: 11px; padding: 14px 18px; font-size: 0.78rem; box-shadow: 0 15px 35px rgba(25, 43, 35, 0.25); transform: translateY(30px); opacity: 0; pointer-events: none; transition: 0.3s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #dce9e1; color: var(--forest); font-weight: 700; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(24,37,31,.53); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(100%, 510px); position: relative; background: var(--paper); border-radius: 18px; padding: 34px; box-shadow: 0 30px 90px rgba(20,35,28,.28); animation: rise .25s ease both; }
.modal-close { position: absolute; right: 16px; top: 15px; border: 0; background: #f0f1ed; color: #65716b; border-radius: 50%; width: 32px; height: 32px; font-size: 1.25rem; cursor: pointer; }
.modal-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: #e5eee8; margin-bottom: 18px; }
.modal-card h2 { font-family: "Newsreader", serif; font-size: 1.65rem; margin: 7px 0 8px; }
.modal-card > p { color: var(--muted); line-height: 1.55; font-size: .8rem; margin: 0 0 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 25px; }
.profile-modal-icon svg { fill: none; stroke: var(--forest); }
.readonly-field input { background: #f1f2ee; color: #7a837f; cursor: not-allowed; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-5px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes kenburns { from { transform:scale(1); } to { transform:scale(1.06); } }

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 330px; }
  .login-brand-content { min-height: 330px; padding: 30px; }
  .login-quote { margin: auto 0 0; }
  .login-quote h1 { font-size: 2.7rem; margin-bottom: 8px; }
  .login-quote p, .memory-window, .login-privacy { display: none; }
  .login-form-panel { min-height: calc(100vh - 330px); padding: 45px 28px; }
  .topbar { grid-template-columns: 1fr auto; height: 72px; }
  .main-nav { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: 10px; height: 60px; display: grid; grid-template-columns: repeat(3,1fr); gap: 0; padding: 0 8px; border: 1px solid rgba(49,93,76,.16); border-radius: 16px; background: rgba(255,254,250,.94); box-shadow: 0 12px 35px rgba(35,52,44,.18); backdrop-filter: blur(16px); }
  .main-nav a { height: 60px; font-size: .72rem; }
  .main-nav a.active::after { bottom: 6px; width: 28px; }
  .family-label { display: none; }
  .account-copy { display: none; }
  .family-switcher { min-height: 46px; padding-right: 8px; }
  .account-avatar { width: 34px; height: 34px; }
  .account-menu { position: fixed; top: 75px; right: 12px; }
  main { padding-top: 48px; }
  .upload-layout { grid-template-columns: 1fr; }
  .memory-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .memory-grid.compact { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .album-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .guide-card { min-height: 420px; }
  footer { padding-bottom: 78px; }
}

@media (max-width: 560px) {
  .login-brand-panel { min-height: 245px; }
  .login-brand-content { min-height: 245px; padding: 24px; }
  .login-quote h1 { font-size: 2.25rem; }
  .login-form-panel { min-height: calc(100vh - 245px); padding: 36px 22px; align-items: start; }
  .login-form > h2 { font-size: 1.8rem; }
  .topbar { padding: 0 18px; }
  .brand small { display: none; }
  main { width: min(100% - 24px, 1180px); padding-top: 38px; }
  .hero { margin-bottom: 30px; }
  .content-header { align-items: stretch; flex-direction: column; }
  .content-header .primary-button { width: 100%; }
  .memory-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .memory-grid.compact { grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
  .timeline-toolbar { width:100%; overflow-x:auto; border-radius:14px; margin-top:-18px; }
  .timeline-toolbar button { flex:0 0 auto; }
  .album-grid { grid-template-columns: 1fr; }
  .album-cover { height: 245px; }
  .hero h1 { font-size: clamp(2.35rem, 12vw, 3.5rem); }
  .hero p { font-size: 0.86rem; }
  .dropzone { min-height: 355px; padding: 24px 14px; }
  .album-picker-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .file-hint { flex-direction: column; gap: 5px; }
  .file-hint i { display: none; }
  .privacy-note { align-items: flex-start; }
  .guide-card { padding: 25px 20px 20px; }
  .queue-section { padding: 20px 14px; }
  .file-row { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; }
  .file-preview { width: 56px; height: 53px; }
  .queue-footer { align-items: stretch; flex-direction: column; gap: 17px; }
  .queue-summary { justify-content: space-between; }
  .upload-button { width: 100%; }
  .modal-card { padding: 28px 20px 22px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
  footer { padding: 20px; text-align: center; }
}

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