:root {
  color-scheme: light;
  --paper: #fcfbf8;
  --surface: #fffefa;
  --ink: #252724;
  --muted: #5e6057;
  --line: #e5e1d8;
  --olive: #343e2d;
  --green: #e9ede3;
  --cover: #f0ece2;
  --red: #883832;
  --radius: 16px;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled, [aria-busy] { cursor: progress; }
:focus-visible { outline: 2px solid #865235; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.22; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.1rem, 5vw, 3rem); font-weight: 730; letter-spacing: -.07em; }
h2 { font-size: 1.44rem; font-weight: 740; letter-spacing: -.045em; }
h3 { font-size: 1.14rem; font-weight: 730; letter-spacing: -.033em; }
small, .muted, .optional { color: var(--muted); }
small { font-size: .85rem; }
.frame { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.brand { display: inline-flex; gap: 9px; align-items: center; font-size: 1.31rem; font-weight: 820; letter-spacing: -.065em; justify-self: start; }
.brand img { border-radius: 8px; }
.header-inner nav { display: flex; gap: 33px; height: 100%; align-items: stretch; }
.header-inner nav a { position: relative; display: flex; align-items: center; padding: 0 6px; color: var(--muted); font-weight: 600; }
.header-inner nav a[aria-current] { color: var(--ink); font-weight: 740; }
.header-inner nav a[aria-current]::after { content: ""; position: absolute; bottom: -1px; height: 2px; background: var(--olive); inset-inline: 0; }
.top-upload, .header-note { justify-self: end; grid-column: 3; }
.header-note, .site-footer, .private-mark { display: inline-flex; align-items: center; gap: 8px; }
.header-note { color: var(--muted); font-size: .83rem; white-space: nowrap; }

.lock { display: inline-block; width: 10px; height: 8px; margin-top: 4px; border: 1.3px solid currentColor; border-radius: 2px; position: relative; }
.lock::before { content: ""; position: absolute; width: 5px; height: 5px; left: 1.1px; top: -6px; border: 1.3px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; }
.plus { position: relative; width: 12px; height: 12px; display: inline-block; flex: 0 0 12px; }
.plus::before, .plus::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; }
.plus::before { width: 12px; height: 1.5px; top: 5.25px; left: 0; }
.plus::after { width: 1.5px; height: 12px; top: 0; left: 5.25px; }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; padding: 8px 15px; border-radius: 8px; font-weight: 700; font-size: .91rem; white-space: nowrap; transition: background-color .16s, border-color .16s; }
.primary { color: #fff; background: var(--olive); }
.primary:hover { background: #242d1e; }
.secondary { color: var(--olive); background: var(--surface); border-color: #d9dbcf; }
.secondary:hover { background: var(--green); border-color: #b8bfb0; }
.danger { background: #f7e9e5; color: var(--red); }

.album-hero { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); background: var(--cover); border-radius: 22px; overflow: hidden; margin-top: 39px; min-height: 365px; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(30px, 5.2vw, 72px); }
.hero-copy h1 { font-size: clamp(3rem, 6vw, 5rem); line-height: 1.03; font-weight: 730; margin: 0 0 19px; word-break: keep-all; }
.hero-copy p { color: var(--muted); font-size: 1.04rem; letter-spacing: -.02em; }
.cover-image { min-width: 0; width: 100%; height: 100%; max-height: 430px; object-fit: cover; object-position: 53% 51%; }

.timeline { margin-top: 43px; }
.timeline-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timeline-heading h2 { font-size: 1.76rem; }
.month-form select { min-height: 38px; padding: 5px 9px; }
.filters { display: flex; gap: 26px; margin: 11px 0 20px; border-bottom: 1px solid var(--line); }
.filters a { display: flex; align-items: center; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 3px 11px; font-size: .94rem; }
.filters a:hover, .filters a[aria-current] { color: var(--ink); }
.filters a[aria-current] { border-color: var(--olive); font-weight: 740; }
.empty-state { min-height: 230px; padding: 28px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 7px; }
.empty-state p { color: var(--muted); font-size: .91rem; }
.empty-state .button { margin-top: 8px; }
.photo-symbol { height: 40px; width: 40px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--green); color: var(--olive); position: relative; flex-shrink: 0; margin-bottom: 5px; }
.photo-symbol::before { content: ""; width: 20px; height: 16px; border: 1.5px solid currentColor; border-radius: 4px; background: radial-gradient(circle at 28% 30%, currentColor 1.5px, transparent 2px); }
.photo-symbol::after { content: ""; position: absolute; width: 11px; height: 7px; right: 11px; bottom: 12px; background: currentColor; clip-path: polygon(0 100%, 57% 0, 100% 100%); }
.month-group { margin: 29px 0 36px; }
.month-group h3 { margin-bottom: 13px; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 21px 16px; }
.media-card { min-width: 0; display: block; border-radius: 12px; }
.card-image { aspect-ratio: 1.16; position: relative; background: var(--green); border-radius: 12px; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.media-card:hover .card-image img { transform: scale(1.035); }
.media-card:hover .media-caption { text-decoration: underline; text-underline-offset: 3px; }
.video-mark, .private-mark { position: absolute; padding: 4px 8px; border-radius: 6px; background: #20251ce8; color: white; font-size: .76rem; }
.video-mark { right: 7px; bottom: 7px; }
.private-mark { left: 7px; top: 7px; }
.media-caption, .media-date { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-caption { padding-top: 6px; font-weight: 700; }
.media-date { color: var(--muted); font-size: .83rem; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px; }
.site-footer { margin-top: 36px; padding: 16px 0 21px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }

.auth-layout { display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr); max-width: 930px; margin: 52px auto 34px; min-height: 510px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.auth-art { background: var(--cover) url("album-cover.jpg") 56% center / cover; }
.auth-card { padding: 41px clamp(24px, 5vw, 58px); align-self: center; min-width: 0; }
.auth-card h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); }
.auth-card > p { margin-top: 8px; }
.auth-card .form-stack { margin-top: 25px; }
.auth-card .form-stack .button { width: 100%; min-height: 47px; }
.auth-switch { text-align: center; font-size: .87rem; color: var(--muted); }
.auth-card > .auth-switch { margin-top: 19px; }
.auth-switch a, .back { color: var(--olive); text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }
.form-stack { display: grid; gap: 15px; }
.form-stack > label, .invite-result label { display: block; font-weight: 690; }
.form-stack :is(input:not([type="hidden"]), textarea, select), .invite-result input { width: 100%; margin-top: 5px; }
input:not([type="hidden"]), textarea, select { border: 1px solid #d7d7cb; border-radius: 8px; background: var(--surface); color: var(--ink); min-height: 44px; padding: 8px 11px; }
textarea { resize: vertical; }
.form-stack .button { justify-self: start; }
.narrow-page { max-width: 660px; margin: 43px auto 0; }
.narrow-page > .muted { margin-top: 8px; }
.back { display: inline-block; margin-bottom: 14px; font-size: .88rem; }
.panel { padding: clamp(18px, 3vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 22px 0; min-width: 0; }
.panel h2 + p { margin-top: 8px; }
.panel > p.muted + .form-stack { margin-top: 18px; }
.optional { font-size: .8rem; font-weight: 400; }
.file-picker { padding: 22px; background: #f5f5ef; border: 1px dashed #b9beb1; border-radius: 11px; display: grid !important; justify-items: center; gap: 5px; text-align: center; }
.file-picker input { max-width: 340px; font-size: .91rem; }
.file-picker small { font-weight: 400; }
.file-list { padding-left: 24px; margin: 0; overflow-wrap: anywhere; }
[data-upload-status] { white-space: pre-line; overflow-wrap: anywhere; }
.notice { margin: 14px 0; background: var(--green); padding: 9px 12px; border-radius: 8px; overflow-wrap: anywhere; }
.notice.error { background: #f8e9e4; color: var(--red); }
.detail-page { margin-top: 39px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.detail-media { background: #eeede6; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-media :is(img, video) { display: block; width: 100%; max-height: 75vh; object-fit: contain; }
.detail-info { margin: 0; display: grid; gap: 14px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person > div { min-width: 0; overflow-wrap: anywhere; }
.person small { display: block; }
.avatar { width: 37px; height: 37px; flex: 0 0 37px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: var(--olive); font-weight: 750; }
.user-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.comments { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.comments h2 { font-size: 1.12rem; }
.comment { border-radius: 8px; background: var(--paper); padding: 8px 10px; }
.comment strong { font-size: .88rem; }
.like[aria-pressed="true"] { color: #88374b; }
.delete-option summary { color: var(--red); cursor: pointer; font-size: .88rem; }
.delete-option p { margin: 8px 0; }
.invite-result { background: #eff1eb; padding: 11px; border-radius: 11px; margin: 16px 0; display: grid; gap: 8px; }
.invite-result button { justify-self: start; }
.invite-result p { color: var(--muted); font-size: .85rem; }
.family-list { list-style: none; padding: 0; margin: 12px 0 0; }
.family-list li { min-width: 0; display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.family-list li:last-child { border-bottom: 0; }
.family-list form { flex-shrink: 0; }
.panel > h3 { margin-top: 22px; }
.break-text { overflow-wrap: anywhere; min-width: 0; }
.error-page { margin-top: 54px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 820px) {
  .frame { width: calc(100% - 44px); }
  .album-hero { min-height: 290px; }
  .cover-image { max-height: 345px; }
  .hero-copy { padding: 32px; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-layout { margin-top: 34px; }
}
@media (max-width: 580px) {
  .frame { width: calc(100% - 32px); }
  .header-inner { height: 62px; grid-template-columns: auto 1fr auto; gap: 8px; }
  .header-inner nav { justify-content: center; gap: clamp(9px, 4vw, 20px); font-size: .89rem; }
  .header-inner nav a { padding-inline: 3px; }
  .brand { gap: 6px; font-size: 1.14rem; }
  .brand img { width: 28px; height: 28px; }
  .top-upload { padding: 6px 9px; gap: 5px; font-size: .8rem; min-height: 37px; }
  .top-upload .plus { scale: .85; }
  .album-hero { margin-top: 18px; grid-template-columns: 1fr; min-height: 0; border-radius: 17px; }
  .cover-image { grid-row: 1; height: clamp(155px, 53vw, 260px); }
  .hero-copy { padding: 18px 20px 20px; }
  .hero-copy h1 { font-size: clamp(2.18rem, 10vw, 3.45rem); margin-bottom: 7px; }
  .hero-copy h1 br { display: none; }
  .hero-copy p { font-size: .92rem; }
  .timeline { margin-top: 27px; }
  .timeline-heading h2 { font-size: 1.52rem; }
  .filters { margin-top: 5px; gap: 21px; }
  .empty-state { min-height: 194px; padding: 18px 12px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
  .auth-layout { grid-template-columns: 1fr; min-height: auto; margin: 19px auto 22px; border-radius: 17px; }
  .auth-art { min-height: 150px; background-position: 54% 49%; }
  .auth-card { padding: 24px 19px 28px; }
  .detail-grid { grid-template-columns: 1fr; }
  .narrow-page, .detail-page { margin-top: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Album, calendar and family workspaces */
.workspace-page { margin: 41px auto 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-switch { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 9px; background: #f0eee8; width: fit-content; }
.view-switch a { display: block; padding: 6px 12px; border-radius: 7px; color: var(--muted); font-size: .88rem; }
.view-switch a[aria-current] { background: var(--surface); color: var(--ink); font-weight: 750; box-shadow: 0 1px 2px #2222; }
.profile-tabs { margin: 18px 0 8px; }
.library-filter { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; margin: 17px 0 12px; }
.library-filter label { display: grid; gap: 3px; color: var(--muted); font-size: .8rem; font-weight: 650; min-width: 0; flex: 0 1 150px; }
.library-filter label:first-of-type { flex-basis: 205px; }
.library-filter input, .library-filter select { width: 100%; font-size: .94rem; }
.library-filter button { margin-bottom: 1px; }
.library-filter .inline-check { display: flex; align-items: center; align-self: center; gap: 6px; flex: 0 0 auto; }
.form-stack input[type="checkbox"], input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--olive); margin: 0; }
.form-stack fieldset { min-width: 0; padding: 9px 12px 12px; border: 1px solid var(--line); border-radius: 8px; }
.form-stack legend { padding-inline: 4px; }
.check-list { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; }
.check-list label { display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.feature-links { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.narrow-page > .feature-links { margin-top: 16px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list a { border-radius: 8px; background: var(--green); color: var(--olive); padding: 4px 9px; font-size: .88rem; overflow-wrap: anywhere; }
.tag-list a:hover { text-decoration: underline; }
.text-button { color: var(--red); padding: 3px 0; min-height: 28px; border: 0; background: transparent; font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; }
.event-link { width: 100%; padding: 4px 0; }
.event-unread { width: 8px; height: 8px; margin-left: auto; flex: 0 0 8px; border-radius: 50%; background: var(--olive); }
.group-settings { padding-block: 10px; border-bottom: 1px solid var(--line); }
.group-settings summary, .profile-editor summary { cursor: pointer; font-weight: 720; }
.group-settings form, .group-settings + form, .profile-editor .growth-grid { margin-top: 14px; }
.growth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.growth-grid .panel > form, .growth-grid .panel > .muted { margin-top: 12px; }
.growth-log li { align-items: start; }
.growth-log li > div { min-width: 0; overflow-wrap: anywhere; }
.growth-log small { display: block; margin-block: 2px; }
.calendar { margin-block: 18px 23px; }
.calendar .section-heading { justify-content: space-between; width: 100%; margin-bottom: 10px; flex-wrap: nowrap; }
.calendar table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.calendar th { font-weight: 650; color: var(--muted); font-size: .84rem; padding-bottom: 7px; }
.calendar td { border: 1px solid var(--line); background: var(--surface); padding: 2px; }
.calendar td a { display: block; position: relative; aspect-ratio: 1.65; overflow: hidden; border-radius: 6px; }
.calendar td a:is(:hover,[aria-current]) { background: var(--green); outline: 2px solid var(--olive); outline-offset: -2px; }
.calendar td img { width: 100%; height: 100%; object-fit: cover; }
.calendar td span { position: absolute; top: 3px; left: 4px; color: var(--ink); background: var(--surface); border-radius: 5px; padding: 0 5px; }
.calendar td small { position: absolute; bottom: 3px; right: 4px; color: white; background: #222e; border-radius: 5px; padding: 0 4px; }
.selected-day { scroll-margin-top: 16px; }
.studio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 34px; }
.studio-grid .panel { display: grid; align-content: start; gap: 8px; justify-items: start; margin: 0; }
.studio-grid .panel p { font-size: .92rem; margin-top: 0; }
.studio-grid .panel .button { margin-top: 4px; }
.studio-grid .button:disabled { cursor: default; opacity: .5; }
.memory-section { margin: 24px 0; }
.memory-section h2 { margin-bottom: 12px; }
.frame-view { margin-top: 17px; background: #272821; color: #fffefa; padding: 12px; border-radius: 14px; }
.frame-view:fullscreen { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.frame-view figure { margin: 0; }
.frame-view img { width: 100%; height: min(65vh, 620px); object-fit: contain; }
.frame-view:fullscreen img { height: 100%; max-height: calc(100vh - 100px); }
.frame-view figcaption { padding: 8px; text-align: center; overflow-wrap: anywhere; }
.frame-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 7px; }
.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 19px; }
.book-grid figure { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 12px; margin: 0; break-inside: avoid; }
.book-grid img { width: 100%; max-height: 510px; object-fit: contain; }
.book-grid figcaption { padding-top: 7px; }
@media (max-width: 680px) {
  .header-inner:has(.main-nav) { height: auto; grid-template-columns: 1fr auto; gap: 0; }
  .header-inner:has(.main-nav) > .brand { align-self: center; height: 55px; }
  .header-inner:has(.main-nav) > .top-upload { grid-column: 2; grid-row: 1; }
  .header-inner .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 2px; height: 43px; }
  .main-nav a { justify-content: center; flex: 1; }
  .workspace-page { margin-top: 25px; }
  .library-filter label, .library-filter label:first-of-type { flex: 1 1 125px; }
  .library-filter input, .library-filter select, .form-stack input, .form-stack select, .form-stack textarea { font-size: 1rem; }
  .calendar td a { aspect-ratio: 1; }
  .calendar td span, .calendar td small { font-size: .7rem; }
  .growth-grid, .studio-grid { grid-template-columns: 1fr; }
  .growth-grid > .panel + .panel { margin-top: 0; }
}
@media print {
  .site-header, .site-footer, .no-print, .notice { display: none !important; }
  body { display: block; background: white; color: black; }
  main.frame { width: 100%; }
  .workspace-page { margin: 0; }
  .book-grid { gap: 8mm; }
  .book-grid figure { border-color: #ddd; }
}
.photo-preview { min-height: 220px; display: grid; place-items: center; padding: 12px; }
.photo-preview img { max-height: min(54vh, 450px); width: auto; }
.photo-preview img.photo-crop { aspect-ratio: 1; width: min(75%, 380px); object-fit: cover; }
.photo-preview img[data-tone="mono"] { filter: grayscale(1); }
.photo-preview img[data-tone="warm"] { filter: sepia(.23); }
.photo-preview img[data-tone="soft"] { filter: contrast(.85) brightness(1.1); }
.photo-preview img[data-rotation="90"] { transform: rotate(90deg) scale(.7); }
.photo-preview img[data-rotation="180"] { transform: rotate(180deg); }
.photo-preview img[data-rotation="270"] { transform: rotate(270deg) scale(.7); }

.video-trim summary { cursor: pointer; color: var(--olive); font-weight: 680; }
.video-trim > div { margin-top: 9px; }

.push-panel .push-status { margin-top: 16px; padding: 10px 12px; border-radius: 8px; background: var(--green); }
.push-actions { margin: 12px 0 16px; }
.push-actions .button:disabled { cursor: default; opacity: .55; }
