:root {
  --ink: #263e35;
  --paper: #f8f5ef;
  --line: #dcded4;
  --muted: #65736a;
  --gold: #aa8050;
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
footer {
  max-width: 1180px;
  margin: auto;
  padding: 28px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header {
  border-bottom: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  color: inherit;
  font:
    27px Georgia,
    serif;
  letter-spacing: -1px;
}
.brand i {
  font-weight: 400;
}
.brand span {
  display: block;
  font: 8px sans-serif;
  letter-spacing: 2.6px;
  margin-top: 8px;
}
main {
  max-width: 1108px;
  margin: 0 auto;
  padding: 66px 28px;
  min-height: 75vh;
}
#welcome {
  max-width: 520px;
  margin: auto;
}
h1 {
  font-family: Georgia, "Hiragino Mincho ProN", serif;
  font-size: 46px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: 1px;
  margin: 18px 0 24px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
}
.lead {
  font-size: 14px;
  line-height: 2.2;
  color: var(--muted);
  margin-bottom: 36px;
}
form {
  display: grid;
  gap: 18px;
}
label {
  font-size: 13px;
  font-weight: 500;
  display: grid;
  gap: 9px;
}
input {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  font-size: 16px;
  color: var(--ink);
}
button,
.primary,
.secondary {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 20px;
  background: #fffefa;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 46px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.primary span {
  margin-left: auto;
}
.quiet {
  background: transparent;
  border: 0;
}
.note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
  margin: 20px 0;
}
details {
  margin: 24px 0;
  font-size: 12px;
}
details form {
  margin-top: 16px;
}
.intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.counts {
  display: grid;
  grid-template-columns: auto auto;
  gap: 3px 16px;
  text-align: center;
}
.counts strong {
  font: 32px Georgia;
  grid-row: 1;
}
.counts span {
  font-size: 10px;
}
.actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.file-button:focus-within {
  outline: 3px solid var(--gold);
}
.filters {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin: 20px 0;
}
.filters button {
  border: 0;
  background: transparent;
  font-size: 13px;
}
.filters [aria-pressed="true"] {
  background: #e5eadf;
}
.filters .quiet {
  margin-left: auto;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.card {
  border: 0;
  padding: 0;
  background: #eeeee6;
  display: block;
  overflow: hidden;
  text-align: left;
  min-width: 0;
}
.card img {
  width: 100%;
  height: 235px;
  object-fit: cover;
  display: block;
}
.card p {
  padding: 0 14px;
  font-size: 12px;
}
.empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.notice,
.upload-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 12px 0;
  font-size: 13px;
}
.upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-wrap: anywhere;
}
.upload-row span {
  flex: 1;
}
.upload-row progress {
  width: 90px;
}
.hidden {
  display: none !important;
}
footer {
  border-top: 1px solid var(--line);
  font: 16px Georgia;
}
footer span {
  font: 11px sans-serif;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 16px 24px;
  background: var(--ink);
  color: white;
  border-radius: 10px;
  max-width: 90vw;
  width: max-content;
  z-index: 10;
  font-size: 14px;
}
dialog {
  border: 0;
  border-radius: 12px;
  padding: 22px;
  max-width: min(720px, 94vw);
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop {
  background: #172b24b0;
}
dialog img {
  display: block;
  max-height: 65vh;
  max-width: 100%;
  margin: 12px auto;
}
.danger {
  color: #ac3c31;
}
.recovery-code {
  overflow-wrap: anywhere;
  background: white;
  padding: 16px;
  user-select: all;
}
#admin-panel {
  max-width: 560px;
  margin: auto;
}
@media (max-width: 700px) {
  header,
  footer {
    padding: 22px;
  }
  main {
    padding: 38px 20px;
  }
  h1 {
    font-size: 34px;
  }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .card img {
    height: 180px;
  }
  .intro {
    align-items: flex-start;
  }
  .intro > p {
    max-width: 160px;
    line-height: 1.8;
  }
  .actions {
    gap: 8px;
  }
  .actions label {
    flex: 1;
    padding: 14px 8px;
    font-size: 12px;
  }
  .filters {
    gap: 0;
  }
  .filters button {
    padding: 12px 10px;
  }
  .counts {
    gap: 3px 10px;
  }
  .counts strong {
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button:hover,
  .file-button:hover {
    filter: brightness(0.94);
  }
}
