:root {
  color-scheme: light;
  font: 13px Arial, Helvetica, sans-serif;
  color: #141414;
  background: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid #222; outline-offset: 2px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.layout {
  width: min(82.6%, 1473px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1200px) clamp(148px, 11.2vw, 200px);
  gap: clamp(18px, 1.2vw, 24px);
  align-items: start;
  padding: clamp(44px, 4.7vw, 84px) 0 40px;
}
.entry { padding-top: clamp(46px, 5.3vw, 94px); }
.photo { margin: 0 0 4px; }
.photo button {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
}
.photo img { display: block; width: 100%; height: auto; }
.sidebar { position: sticky; top: 20px; z-index: 1; background: #fff; font-size: 10px; }
.month-bar, .days { display: grid; align-items: center; }
.month-bar { grid-template-columns: 1fr 5fr 1fr; }
.days { grid-template-columns: repeat(7, 1fr); }
.month-bar button, .days button, .add-photo {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.month-bar button, .days button { min-height: 16px; }
.month-label { position: relative; text-align: center; font-weight: bold; }
.month-label input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.month-label:focus-within { outline: 1px solid #222; outline-offset: 2px; }
.month-label input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  cursor: pointer;
}
.days button { color: #757575; }
.days button:disabled { opacity: 1; }
.days button.has-photos { color: #181818; font-weight: bold; }
.month-bar button:not(:disabled):hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.add-photo { display: block; margin: 10px 0 0 auto; min-height: 28px; padding-inline: 6px; }
.add-photo:hover { background: #f5f5f5; }
.empty { margin: 0; padding: 16px 0; color: #666; font-size: 11px; }
dialog {
  width: min(420px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid #ddd;
  background: #fff;
  color: #141414;
}
dialog::backdrop { background: rgb(0 0 0 / .65); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font-size: 17px; }
.close { width: 28px; height: 28px; padding: 0; border: 0; background: none; font-size: 20px; }
form label { display: block; margin: 12px 0; }
form input { display: block; width: 100%; border: 1px solid #ddd; padding: 8px; margin-top: 4px; }
.upload { border: 0; background: #141414; color: #fff; padding: 8px 12px; }
#upload-status:empty, #full-caption:empty { display: none; }
#viewer { width: fit-content; max-width: 95vw; padding: 10px; }
#viewer img { display: block; max-width: 100%; max-height: 80vh; object-fit: contain; }
#full-caption { margin: 8px 0 0; }
@media (max-width: 640px) {
  .layout { width: calc(100% - 28px); display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding-top: 20px; }
  .sidebar { top: 0; order: -1; width: 100%; padding: 8px 0 4px max(0px, 100% - 196px); }
  .month-bar button, .days button { min-height: 26px; }
  .entry { padding-top: 0; }
}
