/* The same warm paper and sage as the camera. Photos keep their original shape. */
.memory-box-dialog.app-sheet,.memory-detail-dialog.app-sheet {
  width:min(580px,100%);
  height:min(94dvh,850px);
  max-height:calc(100dvh - max(8px,env(safe-area-inset-top)));
  padding:0;
  overflow:hidden;
  background:var(--app-paper,#f8f5ee);
}
.memory-box-dialog.app-sheet .sheet-handle,.memory-detail-dialog.app-sheet .sheet-handle {
  flex-basis:19px;
}
.memory-box-dialog .memory-box-header {
  display:flex;
  flex:0 0 auto;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:5px 20px 14px;
}
.memory-box-header>div {
  min-width:0;
}
.memory-box-header .eyebrow {
  color:#7c8671;
  font-size:10px;
  letter-spacing:.3px;
  line-height:1.7;
}
.memory-box-header h2 {
  font-family:var(--serif);
  font-size:26px;
  font-weight:400;
  line-height:1.45;
  letter-spacing:-.8px;
  margin:7px 0 0;
}
.memory-box-header p {
  font-size:11px;
  color:#78836e;
  line-height:1.8;
  margin:8px 0 0;
  word-break:keep-all;
}
.memory-box-header>.icon-button {
  width:44px;
  height:44px;
  margin:-1px -6px 0 0;
  background:#eeeee5;
  color:#65715a;
}
.memory-box-overview {
  flex:0 0 auto;
  padding:0 20px 12px;
}
.memory-box-summary {
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:3px 10px;
  padding:10px 0 12px;
  border-top:1px solid #e1e4d7;
  color:#697b59;
  font-size:10px;
  line-height:1.7;
}
.memory-box-summary>span:last-child {
  color:#8b937f;
  font-size:9px;
}
.memory-box-tabs {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px;
  padding:4px;
  border-radius:13px;
  background:#eceee3;
}
.memory-box-tabs button {
  min-width:0;
  min-height:44px;
  padding:9px 5px;
  border-radius:10px;
  color:#7b8870;
  font-size:12px;
  line-height:1.5;
  transition:background .18s,color .18s,box-shadow .18s;
}
.memory-box-tabs button[aria-pressed=true] {
  background:#fffdf7;
  color:#4c663f;
  box-shadow:0 2px 7px #3e492311;
  font-weight:600;
}
.memory-box-dialog .memory-box-scroll {
  padding:0 20px max(22px,env(safe-area-inset-bottom));
  border-top:1px solid #e7e7dc;
}
.memory-box-status,.memory-save-status {
  font-size:11px;
  color:#6e805f;
  line-height:1.8;
  margin:10px 0;
  overflow-wrap:anywhere;
}
.memory-box-status:empty {
  display:none;
}
.memory-box-status.is-error,.memory-save-status.is-error {
  color:#8d4d42;
}
.memory-box-empty {
  text-align:center;
  padding:35px 18px 29px;
  margin:18px 0 0;
  border:1px solid #e0e3d5;
  border-radius:21px;
  background:#f0f0e6;
}
.memory-empty-symbol {
  display:grid;
  place-items:center;
  width:56px;
  height:56px;
  margin:0 auto 20px;
  border-radius:18px;
  background:#e4e9d9;
  color:#7a8d66;
}
.memory-empty-symbol svg {
  width:25px;
  height:25px;
}
.memory-box-empty h3 {
  font-family:var(--serif);
  font-size:20px;
  font-weight:400;
  line-height:1.6;
  letter-spacing:-.6px;
  margin:0 0 10px;
  word-break:keep-all;
}
.memory-box-empty p {
  max-width:290px;
  font-size:11px;
  line-height:1.95;
  color:#7e8a71;
  margin:0 auto 20px;
  word-break:keep-all;
}
.memory-box-empty .outline-button {
  width:100%;
  min-height:48px;
  border-color:#cbd4bc;
  border-radius:13px;
  background:#fffdf7;
  font-size:12px;
}
.memory-month>h3 {
  display:flex;
  align-items:center;
  gap:12px;
  font-family:var(--serif);
  font-size:17px;
  font-weight:400;
  color:#667a55;
  letter-spacing:-.3px;
  margin:22px 0 13px;
}
.memory-month>h3::after {
  content:'';
  height:1px;
  background:#e2e5d8;
  flex:1;
}
.memory-photo-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:15px 12px;
  margin:0;
  padding:0;
  list-style:none;
}
.memory-photo-grid>li {
  min-width:0;
}
.memory-photo-card {
  position:relative;
  display:block;
  width:100%;
  min-height:44px;
  padding:7px 7px 0;
  overflow:hidden;
  border:1px solid #e5e3d7;
  border-radius:12px;
  background:#fffdf7;
  box-shadow:0 3px 10px #35422a08;
  text-align:left;
  transition:transform .18s,border-color .18s,box-shadow .18s;
}
.memory-photo-card>img {
  display:block;
  width:100%;
  aspect-ratio:3/4;
  padding:7px;
  object-fit:contain;
  border-radius:6px;
  background:#eae8dc;
}
.memory-photo-card.is-favorite::after {
  content:'즐겨찾기';
  position:absolute;
  top:13px;
  right:12px;
  padding:4px 7px;
  border:1px solid #fffdf78c;
  border-radius:15px;
  color:#fffdf4;
  background:#526747d9;
  font:9px/1.5 var(--sans);
}
.memory-card-copy {
  display:block;
  min-width:0;
  padding:10px 4px 12px;
}
.memory-card-copy strong {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  font-family:var(--serif);
  font-size:14px;
  font-weight:400;
  color:#4d6042;
  line-height:1.65;
  word-break:keep-all;
  overflow-wrap:anywhere;
}
.memory-card-copy small {
  display:block;
  font-size:9px;
  color:#8c987d;
  line-height:1.8;
  margin-top:5px;
}
.memory-storage-note {
  color:#65735b;
  font-size:11px;
  line-height:1.9;
  margin:22px 0 0;
  padding:14px 0 0;
  border-top:1px solid #e3e5d8;
  word-break:keep-all;
  overflow-wrap:anywhere;
}
/* The image and download controls stay still while the story scrolls. */
.memory-detail-dialog.app-sheet {
  width:min(470px,100%);
  height:min(96dvh,860px);
}
.memory-detail-dialog .memory-detail-header {
  display:flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0 14px 10px;
  margin:0;
}
.memory-detail-header .eyebrow {
  color:#7a876c;
  font-size:11px;
  line-height:1.7;
  letter-spacing:.2px;
  text-align:center;
}
.memory-detail-header .icon-button {
  width:44px;
  height:44px;
  color:#67775b;
  background:#eeeee4;
}
.memory-detail-preview {
  display:flex;
  flex:0 0 clamp(180px,41dvh,350px);
  height:clamp(180px,41dvh,350px);
  align-items:center;
  justify-content:center;
  min-height:0;
  margin:0 20px;
  padding:14px;
  border-radius:18px;
  background:#eae8dc;
}
.memory-detail-image {
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  margin:0;
  border-radius:2px;
  object-fit:contain;
  box-shadow:0 5px 15px #35402c1a;
}
.memory-detail-dialog .memory-detail-story {
  padding:18px 20px 20px;
}
.memory-detail-copy {
  margin:0;
  overflow-wrap:anywhere;
}
.memory-detail-copy>span:first-child {
  font-family:monospace;
  color:#8b987c;
  font-size:10px;
  line-height:1.6;
  letter-spacing:.8px;
}
.memory-detail-copy h2 {
  font-family:var(--serif);
  font-size:22px;
  font-weight:400;
  line-height:1.5;
  letter-spacing:-.6px;
  margin:7px 0 9px;
}
.memory-detail-copy p {
  font-family:var(--serif);
  font-size:15px;
  line-height:1.85;
  color:#677c55;
  white-space:pre-wrap;
  margin:0 0 11px;
}
.memory-detail-copy>span:last-child {
  color:#8b967e;
  font-size:10px;
  line-height:1.7;
}
.memory-detail-story .memory-storage-note {
  margin-top:16px;
  padding-top:11px;
}
.memory-detail-dialog .memory-detail-actions {
  display:flex;
  flex:0 0 auto;
  flex-direction:column;
  gap:7px;
  padding:12px 20px max(12px,env(safe-area-inset-bottom));
  margin:0;
  border-top:1px solid #e0e4d6;
  background:#faf8f1;
}
.memory-detail-actions button {
  min-width:0;
  min-height:44px;
  line-height:1.6;
}
.memory-detail-actions>.primary-button {
  min-height:49px;
  border-radius:14px;
  background:#5a7050;
  color:#fffdf4;
  font-size:13px;
}
.memory-detail-secondary {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.memory-detail-secondary .outline-button {
  padding:8px 5px;
  border:1px solid #dce2d0;
  border-radius:12px;
  background:#f2f3e9;
  color:#6b7e5b;
  font-size:11px;
}
.memory-detail-secondary .outline-button[aria-pressed=true] {
  border-color:#b3c39f;
  background:#e4ebd8;
  color:#4c683b;
}
.memory-detail-secondary .text-link {
  margin:0;
  padding:8px 4px;
  border-radius:12px;
  color:#8b8c77;
  font-size:11px;
  text-decoration:none;
}
.memory-danger-button {
  min-height:44px;
  padding:9px 10px;
  border:1px solid #d9bdb3;
  border-radius:12px;
  color:#945546;
  font-size:11px;
  line-height:1.7;
  background:#f8eee8;
}
.memory-delete-confirm {
  padding:14px;
  margin-top:14px;
  border:1px solid #e4c9bc;
  border-radius:14px;
  background:#f5eae2;
  color:#855343;
}
.memory-delete-confirm strong {
  font-size:13px;
  font-weight:500;
  line-height:1.7;
}
.memory-delete-confirm p {
  font-size:11px;
  line-height:1.9;
  margin:7px 0 14px;
}
.memory-delete-confirm>div {
  display:grid;
  grid-template-columns:1fr 1.3fr;
  gap:7px;
}
.memory-delete-confirm .outline-button {
  min-height:44px;
  padding:8px;
  border-radius:12px;
  background:#fffdf7;
  font-size:12px;
}
.memory-save-status {
  margin:9px 1px 0;
}
.memory-save-status:not(.is-error) {
  color:#71845f;
}
@media(hover:hover) and (pointer:fine) {
  .memory-photo-card:hover {
    border-color:#bdc9ad;
    transform:translateY(-2px);
    box-shadow:0 6px 15px #35422a10;
  }
}
@media(max-width:359px) {
  .memory-box-dialog .memory-box-header {
    padding-inline:16px;
  }
  .memory-box-header h2 {
    font-size:24px;
  }
  .memory-box-header p {
    font-size:10px;
  }
  .memory-box-overview {
    padding-inline:16px;
    padding-bottom:10px;
  }
  .memory-box-summary {
    gap:2px;
    font-size:9px;
  }
  .memory-box-summary>span:last-child {
    font-size:8px;
  }
  .memory-box-tabs button {
    font-size:11px;
  }
  .memory-box-dialog .memory-box-scroll {
    padding-inline:16px;
  }
  .memory-box-empty {
    padding:26px 13px 22px;
  }
  .memory-box-empty h3 {
    font-size:18px;
  }
  .memory-photo-grid {
    gap:12px 9px;
  }
  .memory-photo-card {
    padding:5px 5px 0;
  }
  .memory-photo-card>img {
    padding:5px;
  }
  .memory-card-copy {
    padding:9px 3px 10px;
  }
  .memory-card-copy strong {
    font-size:13px;
  }
  .memory-card-copy small {
    font-size:8px;
  }
  .memory-detail-preview {
    margin-inline:16px;
    padding:11px;
  }
  .memory-detail-dialog .memory-detail-story {
    padding:14px 16px 16px;
  }
  .memory-detail-copy h2 {
    font-size:20px;
  }
  .memory-detail-copy p {
    font-size:14px;
  }
  .memory-detail-dialog .memory-detail-actions {
    padding-inline:16px;
  }
  .memory-detail-secondary .outline-button,.memory-detail-secondary .text-link,.memory-detail-secondary .memory-danger-button {
    font-size:10px;
  }
}
@media(min-width:760px) {
  .memory-box-dialog.app-sheet,.memory-detail-dialog.app-sheet {
    max-width:calc(100vw - 48px);
    max-height:calc(100dvh - 48px);
  }
  .memory-box-dialog .memory-box-header {
    padding-inline:26px;
  }
  .memory-box-overview,.memory-box-dialog .memory-box-scroll {
    padding-inline:26px;
  }
  .memory-photo-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-height:560px) and (orientation:landscape) {
  .memory-box-dialog.app-sheet,.memory-detail-dialog.app-sheet {
    width:min(680px,100%);
    height:calc(100dvh - 8px);
    max-height:calc(100dvh - 8px);
  }
  .memory-box-dialog.app-sheet .sheet-handle,.memory-detail-dialog.app-sheet .sheet-handle {
    flex-basis:13px;
  }
  .memory-box-dialog .memory-box-header {
    padding-top:0;
    padding-bottom:7px;
    align-items:center;
  }
  .memory-box-header .eyebrow,.memory-box-header p {
    display:none;
  }
  .memory-box-header h2 {
    margin:0;
    font-size:23px;
  }
  .memory-box-overview {
    padding-bottom:9px;
  }
  .memory-box-summary {
    padding-block:6px;
  }
  .memory-photo-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .memory-box-empty {
    padding-block:22px;
  }
  .memory-detail-dialog.app-sheet[open] {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-rows:13px 48px minmax(0,1fr) auto;
  }
  .memory-detail-dialog>.sheet-handle {
    grid-column:1/-1;
    grid-row:1;
  }
  .memory-detail-dialog .memory-detail-header {
    grid-column:1/-1;
    grid-row:2;
    padding-bottom:4px;
  }
  .memory-detail-preview {
    grid-column:1;
    grid-row:3/5;
    height:auto;
    min-height:0;
    margin:4px 10px 14px 20px;
    padding:12px;
  }
  .memory-detail-dialog .memory-detail-story {
    grid-column:2;
    grid-row:3;
    padding:7px 20px 10px 10px;
  }
  .memory-detail-copy h2 {
    font-size:19px;
    margin-block:5px 7px;
  }
  .memory-detail-copy p {
    font-size:13px;
  }
  .memory-detail-dialog .memory-detail-actions {
    grid-column:2;
    grid-row:4;
    padding:9px 20px max(9px,env(safe-area-inset-bottom)) 10px;
  }
  .memory-detail-actions>.primary-button {
    min-height:46px;
  }
  .memory-detail-secondary .outline-button,.memory-detail-secondary .text-link,.memory-detail-secondary .memory-danger-button {
    font-size:10px;
  }
}
@media(prefers-reduced-motion:reduce) {
  .memory-photo-card,.memory-box-tabs button {
    transition:none;
  }
  .memory-photo-card:hover {
    transform:none;
  }
}
@media(forced-colors:active) {
  .memory-box-tabs button[aria-pressed=true],.memory-detail-secondary .outline-button[aria-pressed=true] {
    outline:2px solid Highlight;
    outline-offset:-3px;
  }
  .memory-photo-card.is-favorite::after {
    border:1px solid ButtonText;
    background:Canvas;
    color:CanvasText;
  }
}
