:root {
  color: #1c1c1c;
  background: #f4f1ea;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 18px;
  line-height: 1.4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
}

.top {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1c1c1c;
}

.top a.home {
  display: block;
  line-height: 0;
}

.top a.home img {
  width: 120px;
  height: 120px;
  display: block;
}

.top form.logout {
  margin: 0;
  align-self: center;
}

.top form.logout button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #f4f1ea;
  font: 600 15px/1 system-ui, sans-serif;
  cursor: pointer;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

body.web main {
  max-width: 1100px;
}

.web-top {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.web-top > h1 {
  flex: 1;
}

.gallery-wrap {
  flex: 1;
  min-width: 0;
}

.day-block {
  margin: 0 0 32px;
}

.day-block h2,
.week-title {
  margin: 0 0 12px;
  font-size: 22px;
}

details.month {
  margin: 0 0 22px;
  border-top: 1px solid #1c1c1c;
}

details.month > summary {
  cursor: pointer;
  padding: 14px 0;
  font: 700 26px/1.2 "Iowan Old Style", Palatino, Georgia, serif;
}

.week-title {
  margin-top: 8px;
  font: 600 16px/1.3 system-ui, sans-serif;
}

.entries h3.month-name {
  margin: 22px 0 8px;
  font: 600 18px/1.3 system-ui, sans-serif;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #ddd;
}

a.stat-link {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 180px;
  min-height: 64px;
  padding: 16px 22px;
  background: #1c1c1c;
  color: #f4f1ea;
  text-decoration: none;
  font: 600 18px/1.2 system-ui, sans-serif;
}

.kinds {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}

.kinds a {
  flex: 1;
  padding: 10px 6px;
  border: 1px solid #1c1c1c;
  color: inherit;
  text-align: center;
  text-decoration: none;
  font: 600 14px/1.2 system-ui, sans-serif;
}

.kinds a.on {
  background: #1c1c1c;
  color: #f4f1ea;
}

body.web .kinds {
  max-width: 720px;
  margin-bottom: 22px;
}

.entries {
  position: relative;
}

.entries > nav.periods {
  position: absolute;
  top: 10px;
  right: 0;
  z-index: 1;
  width: max-content;
  max-width: none;
  margin: 0;
}

.entries > nav.periods a {
  flex: 0 0 auto;
  min-width: 72px;
}

.entries details.month:first-of-type > summary {
  padding-right: 430px;
}

td[data-field] {
  cursor: text;
  min-width: 72px;
}

td[data-field]:focus {
  outline: 1px solid #1c1c1c;
  background: #fff;
}

.icons {
  white-space: nowrap;
}

.icons form {
  display: inline;
}

.sheet td select {
  width: 100%;
  min-width: 88px;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
}

button.icon.retry {
  font: 700 18px/1 system-ui, sans-serif;
}

button.icon {
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: #1c1c1c;
  cursor: pointer;
}

button.icon.del {
  color: #8a3b2a;
}

button.icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.pop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: rgba(20, 16, 12, 0.82);
}

.pop[hidden] {
  display: none;
}

.pop img {
  max-width: min(920px, 100%);
  max-height: 100%;
  background: #fff;
}

.pop-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: #f4f1ea;
  color: #1c1c1c;
  font: 28px/1 system-ui, sans-serif;
  cursor: pointer;
}

.pies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  gap: 28px;
  margin: 8px 0 28px;
}

.rank {
  max-width: 480px;
  margin: 0 0 36px;
}

.rank h2,
.pies h2 {
  margin: 0 0 12px;
  font: 600 16px/1.2 system-ui, sans-serif;
}

.rank ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: place;
}

.rank li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #e4ddd0;
  font: 16px/1.3 system-ui, sans-serif;
}

.rank li::before {
  counter-increment: place;
  content: counter(place);
  width: 1.5em;
  font-weight: 600;
}

.rank li span {
  flex: 1;
}

.rank li b {
  font-weight: 600;
}

.pie {
  width: 168px;
  height: 168px;
  border-radius: 50%;
}

.legend {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font: 14px/1.4 system-ui, sans-serif;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}

.legend i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

a.action {
  display: inline-block;
  margin: 6px 8px 0 0;
  color: #1c1c1c;
  font: 600 14px/1 system-ui, sans-serif;
}

.edit label {
  display: block;
  margin: 0 0 12px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}

.edit input,
.edit select {
  display: block;
  width: 100%;
  max-width: 420px;
  min-height: 40px;
  margin-top: 4px;
  font: 16px system-ui, sans-serif;
}

.edit img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  background: #ddd;
}

.edit button.primary {
  min-width: 180px;
}

h1 {
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 18px;
}

h2 {
  font-size: 18px;
  margin: 28px 0 10px;
}

h2 a { color: inherit; }

.banner {
  margin: 0 0 16px;
  padding: 8px 10px;
  background: #efe4c4;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}

.plus {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 12px auto 8px;
  border: 0;
  border-radius: 50%;
  background: #1c1c1c;
  color: #f4f1ea;
  font-size: 64px;
  line-height: 1;
  cursor: pointer;
}

.composer { margin-top: 12px; }

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.previews img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #ddd;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

button.primary,
button.secondary,
label.secondary {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 0;
  font: 600 17px/1 system-ui, sans-serif;
  cursor: pointer;
}

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
}

button.primary { background: #1c1c1c; color: #f4f1ea; }
button.secondary,
label.secondary { background: transparent; color: #1c1c1c; border: 1px solid #1c1c1c; }
button:disabled { opacity: 0.45; }

.mode-banner {
  margin: 0 0 16px;
  padding: 8px 12px;
  background: #efe4c4;
}

.hint, .empty, .done, .meta {
  font-family: system-ui, sans-serif;
  font-size: 15px;
}

.done { font-size: 20px; }

.sale, .item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 10px;
  padding: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.thumbs {
  display: flex;
  gap: 6px;
}

.thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: #ddd;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}

.filters select {
  display: block;
  margin-top: 4px;
  min-width: 180px;
  min-height: 36px;
  font: 15px system-ui, sans-serif;
}

.sheet {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}

.sheet th,
.sheet td {
  border: 1px solid #d9d3c7;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.sheet th {
  background: #efe4c4;
  font-weight: 600;
}

.sheet th a {
  color: inherit;
  text-decoration: none;
}

.sheet tbody tr:nth-child(even) td {
  background: #faf8f3;
}

.sheet tbody tr.purchase td {
  border-top: 3px solid #1c1c1c;
}

.sheet tbody tr.day-start td {
  border-top: 36px solid #f4f1ea;
}

.sheet a {
  color: inherit;
}

button.text {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid #8a3b2a;
  background: transparent;
  color: #8a3b2a;
  font: 600 14px/1 system-ui, sans-serif;
  cursor: pointer;
}

.shot figcaption {
  margin-top: 4px;
  color: #6b5e48;
  font: 600 13px/1.2 system-ui, sans-serif;
}

.shot form {
  margin-top: 6px;
}

.sale em, .item em {
  font-style: normal;
  color: #6b5e48;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}
