.jp-editor {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line, #d8d7c9);
}
.jp-editor-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.jp-editor-head strong { font-size: 14px; }
.jp-count, .jp-hint { color: var(--soft); font-size: 12px; }
.jp-hint { display: block; margin-top: 5px; }
.jp-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--mist);
  color: var(--accent);
  padding: 5px 10px;
  margin: 0 0 0 auto;
  min-height: 34px;
  font-size: 13px;
  font-weight: 600;
}
.jp-picker:focus-within { outline: 3px solid #c87b42; outline-offset: 2px; }
.jp-picker.jp-disabled { opacity: .55; }
.jp-picker input.jp-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.jp-alert { display: block; font-size: 12px; color: #f3b293; }
.jp-alert:not(:empty) { margin: 7px 0; }
.jp-edit-grid, .jp-gallery {
  display: grid;
  align-items: start;
  gap: 6px;
  margin-top: 9px;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
}
.jp-edit-grid:empty { display: none; }
.jp-gallery {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  max-width: 800px;
  gap: 8px;
}
.jp-tile, .jp-edit-cell {
  position: relative;
  height: auto;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--shore);
  overflow: hidden;
  padding: 0;
}
.jp-tile { cursor: zoom-in; }
.jp-edit-cell { border: 1px solid var(--line); border-radius: 5px; }
.jp-edit-cell img, .jp-tile img { display: block; width: 100%; height: 100%; object-fit: cover; font-size: 10px; }
.jp-edit-cell .jp-remove {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 24px;
  height: 24px;
  padding: 0;
  color: #fff;
  background: var(--deep-sea);
  font: 18px/1 system-ui, sans-serif;
}
.album-day {align-self: stretch; min-inline-size: 0}
.album-day h2 {font-size: 20px; font-weight: 700; line-height: 1; margin-block: 0 -1px; color: #c4c4c4}
[data-theme="day"] .album-day h2 {color: #818181}
.jp-album {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}
.jp-album-place {
  position: absolute;
  inset: auto auto 2px 2px;
  max-width: calc(100% - 4px);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  background: transparent;
  color: var(--album-photo-ink, #fff);
  font-size: 11px;
  font-weight: 650;
}
.jp-album-place[data-ink="dark"] {color: #000}
@media (max-width: 520px) {
  .jp-album {grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px}
}
html:has(.jp-viewer[open]) {overflow: hidden; overscroll-behavior: none}
dialog.jp-viewer {
  position: fixed;
  inset: 0;
  width: min(1220px, calc(100vw - 32px));
  height: min(910px, calc(100vh - 32px));
  height: min(910px, calc(100dvh - 32px));
  max-height: none;
  max-width: none;
  padding: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--route);
  border-radius: 10px;
  background: var(--deep-sea);
  color: var(--ink);
  font-family: inherit;
  box-shadow: 0 16px 80px #14271ba0;
}
.jp-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.jp-viewer::backdrop { background: #172a34df; }
.jp-view-head, .jp-view-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--white);
}
.jp-view-head {display: grid; grid-template-columns: minmax(0,1fr) auto}
.jp-view-caption {display: grid; min-width: 0}
.jp-view-note {
  min-block-size: 44px;
  align-content: center;
  padding: 0;
  text-align: start;
}
.jp-view-note:hover strong {text-decoration: underline; text-underline-offset: .18em}
.jp-view-caption strong, .jp-view-caption small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jp-view-caption small { font-size: 12px; color: var(--soft); }
.jp-viewer .jp-button {
  min-height: 38px;
  padding: 5px 14px;
  background: var(--control);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}
.jp-view-footer {justify-content: center; min-width: 0}
.jp-view-footer .jp-step { font-size: 23px; line-height: 1; min-width: 42px; }
.jp-view-footer .jp-position { min-width: 55px; text-align: center; font-variant-numeric: tabular-nums; }
.jp-view-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--deep-sea);
  min-height: 0;
  min-width: 0;
  overscroll-behavior: contain;
}
.jp-view-image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  cursor: zoom-in;
}
.jp-view-stage.jp-actual { display: block; overflow: auto; overscroll-behavior: contain; }
.jp-actual .jp-view-image {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: auto;
  object-fit: initial;
  cursor: zoom-out;
}
.jp-view-error { padding: 18px; text-align: center; }
@media (max-width: 620px), (max-height: 500px) and (pointer: coarse) {
  dialog.jp-viewer {
    width: 100%; height: 100vh; height: 100dvh;
    max-width: 100%; max-height: 100dvh;
    border: 0; border-radius: 0;
  }
  .jp-view-head, .jp-view-footer {
    gap: 8px;
    padding: 5px max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left));
  }
  .jp-view-head {padding-top: max(5px, env(safe-area-inset-top))}
  .jp-view-footer {padding-bottom: max(5px, env(safe-area-inset-bottom))}
  .jp-viewer .jp-button {min-width: 44px; min-height: 44px; padding-inline: 8px}
  .jp-view-footer .jp-position {min-width: 36px; font-size: 12px}
  .jp-view-stage:not(.jp-actual) {touch-action: pan-y pinch-zoom}
}
@media (max-width: 620px) {
  .jp-gallery {grid-template-columns: repeat(auto-fill,minmax(77px,1fr)); gap: 5px}
}
@media (pointer: coarse) {
  .jp-picker, .jp-viewer .jp-button { min-height: 44px; }
  .jp-edit-cell .jp-remove { width: 32px; height: 32px; }
}
