:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #292e2a;
  --muted: #676c64;
  --line: #e2e3db;
  --green: #355744;
  --soft: #e9eee7;
  --white: #fff;
  --red: #a3322b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.45 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
body:has(dialog[open]) {
  overflow: hidden;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: none;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #64836b;
  outline-offset: 3px;
}
button:hover:not(:disabled) {
  filter: brightness(0.95);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.glyph {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.primary,
.secondary {
  min-height: 40px;
  border-radius: 7px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 550;
}
.primary {
  color: #fff;
  background: var(--green);
}
.secondary {
  border: 1px solid var(--line);
  background: var(--white);
}
.text-button {
  padding: 5px 0;
  min-height: 32px;
  color: var(--muted);
  font-size: 13px;
}
.icon-button {
  width: 40px;
  height: 40px;
  padding: 9px;
  flex: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button:hover {
  background: #00000008;
}
label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  border: 1px solid #ccd1c7;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}
textarea {
  resize: vertical;
  line-height: 1.55;
}
select {
  min-height: 42px;
}
input::placeholder,
textarea::placeholder {
  color: #7d8179;
}
p {
  margin: 0 0 12px;
}
.quiet {
  color: var(--muted);
  font-size: 12px;
}
.error {
  color: var(--red);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.error:empty {
  display: none;
}
.error:not(:empty) {
  margin: 12px 0;
}
.login {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.welcome {
  width: 100%;
  max-width: 360px;
}
.welcome h1 {
  font:
    normal 43px/1.1 Georgia,
    serif;
  letter-spacing: -1.5px;
  margin: 0 0 36px;
}
.welcome .primary {
  width: 100%;
  justify-content: space-between;
  margin-top: 14px;
  min-height: 46px;
}
.welcome input {
  height: 48px;
}
.boot {
  height: 100svh;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 10px 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  margin: 0;
  font:
    25px/1.1 Georgia,
    serif;
  letter-spacing: -0.7px;
  white-space: nowrap;
}
.site-header nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.site-header nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 14px;
  min-height: 42px;
}
.site-header nav a.active {
  color: var(--green);
  background: var(--soft);
}
.site-header nav a:hover {
  background: #e9eee799;
}
.collection {
  padding: 5px;
  min-height: calc(100svh - 68px);
}
.heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 9px 13px;
  min-height: 58px;
}
.heading h1 {
  font-size: 19px;
  font-weight: 500;
  margin: 0;
  flex: 1;
}
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: flex-start;
}
.card {
  position: relative;
  flex: none;
  min-width: 0;
  background: #e9e7e0;
  overflow: hidden;
}
.photo-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.photo-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.photo-button:hover:not(:disabled) {
  filter: none;
}
.photo-button:hover img {
  filter: brightness(1.05);
}
.note-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  height: 32px;
  min-width: 34px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #faf9f6ee;
  color: #355744;
  box-shadow: 0 1px 6px #0002;
  font-size: 12px;
  backdrop-filter: blur(6px);
}
.note-badge .glyph {
  width: 16px;
  height: 16px;
}
.note-badge:not(.has-notes) {
  opacity: 0;
  pointer-events: none;
}
.card:hover .note-badge,
.card:focus-within .note-badge {
  opacity: 1;
  pointer-events: auto;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px 8px;
  padding: 0 8px;
}
.album-card .photo-button {
  height: 235px;
  background: #e9e7e0;
  border-radius: 3px;
}
.album-card h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 9px 0 1px;
}
.album-card .quiet {
  font-size: 12px;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 24px;
  padding: 12px;
}
.person-card button {
  width: 100%;
  flex-direction: column;
  padding: 0;
  gap: 8px;
}
.person-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}
.person-card span {
  font-size: 13px;
}
.empty {
  padding: 60px 15px;
  text-align: center;
  color: var(--muted);
}
#scroll-sentinel {
  height: 1px;
}
.page-loading {
  text-align: center;
  padding: 12px;
}
.spinner {
  width: 20px;
  height: 20px;
  display: inline-block;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.page-feedback {
  text-align: center;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 12px 18px;
  box-shadow: 0 4px 20px #0002;
  width: max-content;
  max-width: calc(100vw - 28px);
  font-size: 14px;
}
dialog {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop {
  background: #1117139c;
  backdrop-filter: blur(4px);
}
#viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #181a18;
  color: #edeee9;
}
.viewer-top {
  background: #181a18;
  height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px 4px 16px;
  border-bottom: 1px solid #ffffff0a;
}
.photo-position {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #c9cdc6;
}
.photo-position .glyph {
  width: 16px;
  height: 16px;
}
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.viewer-notes {
  height: 36px;
  font-size: 13px;
  color: #d0d4ce;
}
.viewer-notes .glyph {
  width: 17px;
  height: 17px;
}
.viewer-notes[aria-expanded="true"] {
  color: #aab1a7;
  background: #181a18;
}
.viewer-top .icon-button:hover {
  background: #ffffff12;
}
.viewer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  transition: grid-template-columns 0.28s ease;
  height: calc(100% - 48px);
  overflow: hidden;
}
.viewer-body.with-notes {
  grid-template-columns: minmax(0, 1fr) 340px;
}
.photo-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.photo-stage:focus {
  /* The photo canvas receives navigation keys; buttons retain Tab outlines. */
  outline: none;
}
#photo-image {
  position: absolute;
  inset: 0;
}
#photo-image > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 50%;
  background: #15191499;
  color: #fff;
  border: 1px solid #ffffff40;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px #0002;
  transition: background 0.2s;
}
.arrow:hover:not(:disabled) {
  background: #151914df;
  filter: none;
}
.arrow:disabled {
  opacity: 0.2;
}
.arrow .glyph {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}
.prev {
  left: 12px;
}
.next {
  right: 12px;
}
#notes-panel {
  overflow: hidden;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.28s ease,
    visibility 0s 0.28s;
}
.with-notes #notes-panel {
  transform: translateX(0);
  visibility: visible;
  transition:
    transform 0.28s ease,
    visibility 0s;
}
.notes-sheet {
  height: 100%;
  width: 340px;
  overflow: auto;
  padding: 0 16px 18px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.notes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  position: sticky;
  top: 0;
  background: var(--paper);
  padding: 13px 0 10px;
  z-index: 1;
  border-bottom: 1px solid var(--line);
}
.notes-heading h2 {
  font-size: 14px;
  font-weight: 550;
  margin: 0;
}
.notes-heading h2 span {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}
.notes-heading .text-button {
  font-size: 11px;
  gap: 2px;
  min-height: 28px;
}
.notes-heading .glyph {
  width: 14px;
  height: 14px;
}
.note {
  padding: 16px;
  margin: 14px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.note p {
  font:
    17px/1.6 Georgia,
    "Times New Roman",
    serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 12px;
}
.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.note-meta .icon-button {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 4px;
}
.note-meta .glyph {
  width: 17px;
  height: 17px;
}
#note-form {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--line);
}
#note-list:empty + #note-form {
  margin-top: 0;
  border-top: 0;
}
#note-form label {
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 9px;
}
#note-text {
  font:
    15px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  border: 1px solid #b8c1b3;
  background: #fff;
  border-radius: 6px;
  padding: 12px;
  min-height: 150px;
  max-height: 45svh;
}
.note-signature {
  margin-top: 18px;
}
#note-author {
  font-size: 15px;
  border: 1px solid #b8c1b3;
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
}
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.form-actions .primary {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 13px;
}
.form-actions .text-button {
  min-height: 40px;
  font-size: 13px;
}
.form-actions .glyph {
  width: 18px;
  height: 18px;
}
.photo-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.photo-loading .spinner {
  border-color: #ffffff30;
  border-top-color: #fff;
}
.photo-error {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: #181a18e8;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  width: max-content;
  max-width: calc(100% - 32px);
}
.photo-error button {
  color: var(--ink);
}
#upload-progress {
  white-space: pre-line;
}
.recording {
  color: var(--red);
}
#record-status:not(:empty) {
  display: block;
  margin-top: 8px;
}
.voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.voice-player button {
  height: 32px;
  min-height: 32px;
  width: 32px;
  padding: 7px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green);
  flex: none;
}
.voice-player .quiet {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
audio:not([controls]) {
  display: none !important;
}
#audio-draft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
#audio-draft .icon-button {
  width: 30px;
  height: 30px;
}
.small-dialog,
.upload-dialog {
  width: 440px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 15px 80px #0003;
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.dialog-top h2 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.4px;
  margin: 0;
}
.dialog-top .icon-button {
  margin-right: -8px;
}
.small-dialog input {
  margin-bottom: 18px;
}
.upload-dialog {
  width: 700px;
  padding: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.upload-destination {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.upload-destination label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.upload-destination select {
  flex: 1;
}
.drop-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  border: 1.5px dashed #aebba9;
  border-radius: 8px;
  padding: 26px 16px;
  background: #eef1e930;
  text-align: center;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.drop-zone > .glyph {
  width: 28px;
  height: 28px;
  color: var(--green);
  margin-bottom: 4px;
}
.drop-zone strong {
  font-size: 17px;
  font-weight: 500;
}
.drop-zone span {
  font-size: 13px;
  color: var(--green);
}
.drop-zone small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.drop-zone.drag-over {
  background: var(--soft);
  border-color: var(--green);
}
.upload-dialog:has(.upload-item) .drop-zone {
  padding: 14px;
}
.upload-dialog:has(.upload-item) .drop-zone > .glyph,
.upload-dialog:has(.upload-item) .drop-zone small {
  display: none;
}
#upload-results {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  max-height: 38dvh;
  overflow: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  min-height: 72px;
}
.upload-thumb {
  width: 60px;
  height: 54px;
  flex: none;
  object-fit: contain;
  border-radius: 3px;
  background: #e9e7e0;
}
.upload-file-info {
  flex: 1;
  min-width: 0;
}
.upload-file-info strong {
  font-size: 13px;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-file-info span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.upload-item[data-state="error"] .upload-file-info span,
.upload-item[data-state="invalid"] .upload-file-info span {
  color: var(--red);
}
.upload-item[data-state="warning"] .upload-file-info span {
  color: #855c1d;
}
.upload-item[data-state="done"] .upload-file-info span,
.upload-item[data-state="duplicate"] .upload-file-info span {
  color: var(--green);
}
.upload-item > .glyph {
  margin: 0 10px;
  color: var(--green);
}
.upload-item[data-state="error"] > .glyph,
.upload-item[data-state="invalid"] > .glyph {
  color: var(--red);
}
.upload-item .icon-button {
  width: 34px;
  height: 34px;
}
.upload-footer {
  padding-top: 16px;
}
.upload-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  font-size: 13px;
}
.upload-summary .text-button {
  font-size: 11px;
}
progress {
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  accent-color: var(--green);
  margin: 10px 0 18px;
}
progress::-webkit-progress-bar {
  background: var(--line);
}
progress::-webkit-progress-value {
  background: var(--green);
  transition: width 0.15s;
}
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
#upload-notice:not(:empty) {
  padding: 8px 0 0;
}
#global-drop {
  position: fixed;
  inset: 8px;
  z-index: 50;
  border: 2px dashed var(--green);
  border-radius: 10px;
  background: #faf9f6f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 22px;
  pointer-events: none;
}
#global-drop .glyph {
  width: 42px;
  height: 42px;
}
@media (max-width: 760px) {
  .site-header {
    gap: 12px;
    padding: 9px 12px;
    flex-wrap: wrap;
    min-height: 98px;
  }
  .wordmark {
    margin: 0;
    font-size: 23px;
  }
  .site-header nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin: 0;
  }
  .site-header nav a {
    flex: 1;
    justify-content: center;
    padding: 6px 9px;
    min-height: 36px;
  }
  .site-header > #upload-open {
    margin-left: auto;
    font-size: 12px;
    min-height: 36px;
    padding: 8px 10px;
  }
  .collection {
    padding: 3px;
  }
  .grid {
    gap: 3px;
  }
  .heading {
    padding: 5px 5px 10px;
  }
  .heading h1 {
    font-size: 17px;
  }
  .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 6px;
    padding: 3px;
  }
  .album-card .photo-button {
    height: 190px;
  }
  .people-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 14px;
    padding: 12px;
  }
  .note-badge {
    right: 5px;
    bottom: 5px;
    min-width: 30px;
    height: 28px;
    padding: 4px 6px;
  }
  .viewer-body.with-notes {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
  .notes-sheet {
    width: 280px;
    padding: 0 13px 14px;
  }
  .prev {
    left: 8px;
  }
  .next {
    right: 8px;
  }
  .arrow {
    width: 40px;
    height: 40px;
    padding: 9px;
  }
  .upload-dialog {
    padding: 18px;
  }
  .drop-zone small {
    max-width: 230px;
  }
  .upload-actions > .primary {
    flex: 1;
  }
  .upload-actions > .secondary {
    font-size: 12px;
  }
  .upload-summary {
    align-items: flex-start;
  }
  .upload-summary #upload-progress {
    max-width: 65%;
  }
  .upload-item {
    gap: 9px;
  }
  .upload-thumb {
    width: 48px;
    height: 48px;
  }
  .dialog-top h2 {
    font-size: 20px;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .viewer-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 0;
    transition: grid-template-rows 0.28s ease;
  }
  .viewer-body.with-notes {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 55%);
  }
  .notes-sheet {
    width: 100%;
    padding: 0 16px 16px;
  }
  .notes-heading {
    padding: 8px 0 6px;
  }
  .notes-heading .text-button {
    font-size: 12px;
  }
  .notes-heading h2 {
    font-size: 14px;
  }
  #note-form {
    padding-top: 20px;
  }
  #note-text {
    min-height: 140px;
  }

  #notes-panel {
    border-top: 1px solid var(--line);
  }
  .note {
    padding: 14px;
  }
  .viewer-top {
    padding-left: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
