:root {
  color-scheme: dark;
  font-family: "Segoe UI", sans-serif;
  background: #141210;
  color: #f4efe8;
}

body {
  margin: 0;
}

main {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

body.signed-in main {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
}

h1, h2, h3 {
  font-weight: 600;
  margin: 0 0 0.5rem;
}

h2 {
  margin-top: 0.25rem;
}

h3 {
  margin-top: 1.25rem;
  font-size: 1rem;
}

label {
  display: block;
  margin: 0.75rem 0;
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea, button {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  margin-top: 0.25rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid #3a342c;
  border-radius: 0.4rem;
  background: #1e1a17;
  color: inherit;
}

button {
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 0.4rem;
  background: #c4553a;
  color: #fff;
  font-weight: 600;
}

button:disabled {
  opacity: 0.55;
}

button[hidden], img[hidden], section[hidden], a[hidden], nav[hidden], canvas[hidden] {
  display: none;
}

.quiet {
  color: #b7aa9c;
  margin: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

#who {
  flex: 1 1 8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row button {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.thumbs, .pick {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.6rem 0 0;
  padding: 0;
}

.thumbs li, .pick label {
  margin: 0;
  min-width: 0;
}

.thumbs img, .pick img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.35rem;
  background: #2a241f;
  display: block;
}

.thumbs .remove, .thumbs .shot {
  width: 100%;
}

.thumbs .remove {
  margin-top: 0.35rem;
  padding: 0.55rem 0.2rem;
  background: #2a241f;
  color: #f4efe8;
  font-size: 0.85rem;
}

.thumbs .shot {
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0.35rem;
}

.thumbs .shot[aria-pressed="true"] img,
.pick label:has(input:checked) img {
  outline: 3px solid #c4553a;
  outline-offset: -3px;
}

.thumbs .empty, .pick .empty {
  grid-column: 1 / -1;
  color: #b7aa9c;
}

.pick label {
  position: relative;
  display: block;
}

.pick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pick .kind {
  position: absolute;
  left: 0.25rem;
  bottom: 0.25rem;
  max-width: calc(100% - 0.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.12rem 0.35rem;
  border-radius: 0.2rem;
  pointer-events: none;
}

.tools, .stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.tools button, .stamps button {
  width: auto;
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: #2a241f;
  color: #f4efe8;
}

.tools button[aria-pressed="true"], .stamps button[aria-pressed="true"] {
  background: #c4553a;
  color: #fff;
}

#editor {
  width: 100%;
  height: auto;
  margin-top: 0.85rem;
  border-radius: 0.4rem;
  touch-action: none;
  background: #2a241f;
}

#result {
  width: 100%;
  height: auto;
  border-radius: 0.4rem;
  margin-top: 0.5rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.result-actions button, .result-actions a {
  width: auto;
  margin-top: 0.5rem;
  white-space: nowrap;
}

.result-actions a {
  color: #f0c7a2;
  font-weight: 600;
  padding: 0.8rem 0.2rem;
}

#status {
  min-height: 1.2rem;
  margin: 0.75rem 0;
  color: #f0c7a2;
}

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: #1e1a17;
  border-top: 1px solid #3a342c;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 2;
}

.tabs button {
  width: 100%;
  margin: 0;
  border-radius: 0;
  background: transparent;
  color: #b7aa9c;
  padding: 0.9rem 0.15rem;
  font-size: 0.75rem;
}

.tabs button[aria-current="page"] {
  background: #c4553a;
  color: #fff;
}
