:root {
  --paper: #faf7f1;
  --ink: #252923;
  --pine: #254d44;
  --muted: #62675e;
  --border: #d9d3c7;
  --copper: #a06748;
  --serif: "Nanum Myeongjo","Noto Serif KR",Batang,"바탕",Georgia,serif;
  --dock: 5rem;
  color: var(--ink);
  background: var(--paper);
}
body { min-height: 100dvh; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #ac6746; outline-offset: 3px; }
.masthead, main { width: min(calc(100% - 3rem), 64rem); }
.masthead { min-height: 4.15rem; border-bottom: 1px solid var(--border); }
.brand { font: 700 1.32rem/1.1 var(--serif); letter-spacing: -.06em; }
.brand-mark { width: 1.9rem; height: 2.13rem; background: #284a40; border-color: #284a40; color: #f2ddad; }
.review-label { margin-left: auto; padding: 0 .65rem; color: var(--muted); font-size: .8rem; }
.small-button { border-color: var(--border); }
#app { max-width: 42rem; margin: 0 auto; padding: 2rem 0 calc(var(--dock) + 2rem + env(safe-area-inset-bottom)); }
.section-head { margin: 0 0 1.15rem; }
.section-head h1, dialog h2 { font-family: var(--serif); font-weight: 700; }
.section-head h1 { font-size: clamp(2.1rem, 4.4vw, 2.95rem); line-height: 1.24; letter-spacing: -.065em; }
.nav-icon { display:inline-block; position:relative; width:21px; height:17px; border:1.8px solid currentColor; }
.camera { border-radius: 4px; }
.camera::before { content:""; position:absolute; width:7px; height:3px; left:2px; top:-4px; background:currentColor; border-radius:2px 2px 0 0; }
.camera::after { content:""; position:absolute; width:6px; height:6px; border:1.6px solid; border-radius:50%; inset:2px 0 0; margin:0 auto; }
.bubble { border-radius:7px 7px 7px 1px; }
.bubble::after { content:""; position:absolute; left:3px; top:5px; width:10px; height:1.5px; background:currentColor; }
.plus { width:1.9rem; height:1.9rem; border:0; border-radius:50%; background:#f2d2aa; color:#303e32; }
.plus::before,.plus::after { content:""; position:absolute; inset:0; width:13px; height:2px; background:currentColor; margin:auto; }
.plus::after { transform:rotate(90deg); }
.tab-write { gap:.16rem; }
.memory-grid { display:grid; grid-template-columns: minmax(0,1fr); gap:2.3rem; padding:0; }
.memory { display:flex; flex-direction:column; padding:0; overflow:hidden; border:1px solid var(--border); border-radius:18px; background:#fffdfa; box-shadow:0 6px 22px #4f412008; }
.memory-head { padding:.8rem 1.15rem; display:flex; gap:.7rem; align-items:center; }
.avatar { display:grid; place-items:center; flex:0 0 2.35rem; height:2.35rem; border-radius:50%; background:#f0d9c6; border:1px solid #d8bca4; color:#5c422c; font:700 1.1rem var(--serif); }
.memory:nth-child(even) .avatar { background:#dbe7dd; color:#354e40; border-color:#bfcec0; }
.memory-byline { display:grid; gap:.05rem; }
.memory-author { font-size:.94rem; }
.memory .meta { margin:0; font-size:.78rem; }
.photo-open { cursor:zoom-in; border:0; padding:0; width:100%; display:block; background:#e6e1d7; }
.memory img, .memory video { display:block; width:100%; height:auto; aspect-ratio: 3/2; max-height:65svh; object-fit:cover; border-radius:0; background:#ece8df; }
.memory video { object-fit:contain; }
.memory p.caption { padding:.95rem 1.15rem .75rem; font-family:var(--serif); font-size:clamp(1.07rem, 2vw, 1.28rem); line-height:1.65; letter-spacing:-.032em; }
.memory > .small-button { align-self:flex-start; margin:.5rem 1rem; }
.reaction-row { display:flex; gap:.48rem; padding:.15rem 1rem .55rem; }
.reaction-row button { display:inline-flex; align-items:center; gap:.4rem; min-width:48px; min-height:44px; padding:.35rem .5rem; background:transparent; border:0; color:#414d44; font-size:.9rem; }
.reaction-row button[aria-pressed="true"] { color:#994939; }
.chat-card { display:flex; flex-direction:column; border:1px solid var(--border); border-radius:1.1rem; background:#eeeee5; overflow:hidden; }
.message-list { height:clamp(12rem,calc(100dvh - 24rem),36rem); min-height:0; gap:.68rem; padding:1rem; overscroll-behavior-y:contain; }
.chat-day { align-self:center; padding:.28rem .75rem; border:1px solid #ced2c3; color:#556250; background:#e4e7da; border-radius:2rem; font-size:.8rem; }
.message { display:flex; align-items:flex-start; flex-direction:column; gap:.17rem; }
.message.mine { align-items:flex-end; }
.message-author { font-size:.82rem; font-weight:650; }
.message p { border:0; padding:.65rem .9rem; color:#222e26; background:#fffefa; border-radius:.18rem 1rem 1rem 1rem; }
.message.mine p { color:#fff; background:#2c5448; border-radius:1rem .18rem 1rem 1rem; }
.message .message-time { margin:0 .18rem; color:#5d685e; font-size:.75rem; }
.composer, .comment-composer { background:#fffdfa; padding:.6rem; display:flex; align-items:center; gap:.5rem; }
.composer textarea,.comment-input { min-width:0; flex:1; resize:none; font-size:1rem; background:#f7f6ef; border-color:#d7d9ce; }
.primary,.comment-submit { color:white; background:var(--pine); min-height:44px; border:0; border-radius:.7rem; padding:.6rem .9rem; }
.connection { font-size:.82rem; color:var(--pine); }
.chat-notice { display:flex; align-items:center; width:100%; min-height:48px; gap:.65rem; margin:.25rem 0 .7rem; padding:.6rem .85rem; text-align:left; background:#f2e6d2; border:1px solid #ddcbb3; color:#543f29; border-radius:.75rem; }
.notice-mark { font-weight:750; flex:none; font-size:.85rem; }
.notice-summary { flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.notice-chevron { font-size:1.25rem; }
dialog { color:var(--ink); background:#fffdf9; max-height:calc(var(--visible-height,100dvh) - 1rem); overflow:auto; }
.notice-dialog-head, .comment-sheet-head { display:flex; justify-content:space-between; align-items:center; gap:.5rem; }
.notice-actions { margin-top:1.25rem; display:flex; gap:.55rem; justify-content:flex-end; flex-wrap:wrap; }
.notice-body, .comment-body { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; margin:.5rem 0; }
.notice-byline,.notice-feedback,.comment-byline time { font-size:.83rem; color:var(--muted); }
.comment-sheet[open] { display:flex; flex-direction:column; gap:.8rem; }
.comment-list { min-height:0; max-height:45dvh; overflow:auto; }
.comment-item { padding:.75rem 0; border-bottom:1px solid var(--border); }
.comment-byline { display:flex; align-items:center; gap:.6rem; }
.comment-empty { color:var(--muted); margin:1rem 0; }
.comment-close,.viewer-close { min-height:44px; min-width:48px; padding:.3rem .7rem; border:1px solid var(--border); border-radius:.6rem; color:inherit; background:transparent; }
.comment-composer { border-top:1px solid var(--border); padding:.65rem 0 0; }
.photo-viewer[open] { display:flex; flex-direction:column; width:100vw; max-width:100vw; height:var(--visible-height,100dvh); max-height:100dvh; inset:0; margin:auto; padding: max(.65rem,env(safe-area-inset-top)) 1rem max(1rem,env(safe-area-inset-bottom)); border:0; border-radius:0; background:#181e1a; color:#fffdf6; }
.viewer-bar { display:flex; justify-content:flex-end; }
.viewer-close { border-color:#68756b; }
.viewer-image { flex:1; min-height:0; width:100%; object-fit:contain; }
.viewer-caption { text-align:center; padding:.8rem; font:1.05rem/1.55 var(--serif); }
@media(max-width:700px) {
  :root { --dock:4.15rem; }
  .masthead,main { width:calc(100% - 2rem); }
  .masthead { min-height:3.6rem; padding-top:env(safe-area-inset-top); }
  .brand { font-size:1.1rem; }
  #account-name { display:none; }
  .review-label { font-size:.75rem; padding:0; }
  .small-button { padding:.4rem .62rem; }
  #app { padding-top:1.15rem; }
  .memory-grid { gap:1.5rem; }
  .memory { border-radius:13px; }
  .memory-head { padding:.7rem .85rem; }
  .memory img { aspect-ratio:4/4.3; max-height:54svh; }
  .memory p.caption { padding:.85rem .9rem .4rem; }
  .reaction-row { padding-left:.42rem; padding-bottom:.3rem; }
  .section-head { margin-bottom:.75rem; }
  dialog:not(.photo-viewer)[open] { width:min(100%,33rem); max-width:100%; inset:auto 0 0; margin:0 auto; padding:1.15rem 1rem max(1.25rem,env(safe-area-inset-bottom)); border-radius:1.3rem 1.3rem 0 0; }
  .comment-list { max-height:42dvh; }
}
@media (prefers-reduced-motion:no-preference) {
  .reaction-like[aria-pressed=true] .fm-icon { animation:pulse .22s ease-out; }
  @keyframes pulse { 50% { transform:scale(1.15); } }
}
