:root {
  --table: #e4f3ea;
  --daylight: #f7fbf8;
  --graphite: #2c3331;
  --muted: #5d6a66;
  --tile: #fbfefc;
  --mat: #ffffff;
  --mint: #8fcbb3;
  --action: #2f5d52;
  --action_ink: #f3fff8;
  --warn: #f4e4c4;
  --warn_edge: #8a6a2b;
  --focus: #1f7a64;
  --slot: rgba(47, 93, 82, 0.14);
  --shadow: 0 10px 28px rgba(44, 51, 49, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--graphite);
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  line-height: 1.45;
  background-color: var(--table);
  background-image:
    radial-gradient(1200px 520px at 50% -80px, var(--daylight), transparent 70%),
    linear-gradient(rgba(47, 93, 82, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 93, 82, 0.07) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

[hidden] {
  display: none !important;
}

.table_surface {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.1rem 4.5rem;
}

.site_header {
  margin-bottom: 1.5rem;
  padding: 0.2rem 0.15rem 1.2rem;
  border-bottom: 2px solid var(--graphite);
}

.kicker {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 38rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
}

.status_message {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--warn_edge);
  background: var(--warn);
  border-radius: 12px;
}

.file_input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.drop_stage {
  position: relative;
  min-height: 22rem;
  padding: 1.5rem;
  border: 2px dashed rgba(44, 51, 49, 0.45);
  border-radius: 22px;
  background: rgba(251, 254, 252, 0.62);
  cursor: pointer;
  overflow: hidden;
}

.drop_stage.is_compact {
  min-height: 8.5rem;
  margin-bottom: 1rem;
}

.drop_stage.is_dragging {
  border-color: var(--action);
  background: rgba(143, 203, 179, 0.28);
}

.ghost_slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  height: 100%;
  min-height: 18rem;
  pointer-events: none;
}

.drop_stage.is_compact .ghost_slots {
  display: none;
}

.ghost_slots span {
  display: block;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(232, 244, 237, 0.35));
  box-shadow: inset 0 0 0 1px var(--slot);
}

.drop_stage_copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.4rem;
  pointer-events: none;
}

.drop_stage_title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.drop_stage_hint {
  margin: 0.45rem 0 1rem;
  max-width: 26rem;
  color: var(--muted);
}

.choose_file_button {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--graphite);
  color: var(--daylight);
  font-weight: 600;
  cursor: pointer;
}

.roll_tray {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 1fr) auto;
  gap: 1.1rem 1.4rem;
  align-items: start;
  margin: 0 0 1.15rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: var(--graphite);
  color: var(--daylight);
  box-shadow: var(--shadow);
}

.field_header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.field_label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.field_value,
.color_row span {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.field_note {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: #c5d5ce;
}

.color_row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--mint);
}

input[type="color"] {
  width: 2.75rem;
  height: 2.2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.action_row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-self: end;
}

.primary_button,
.tile_download,
.ghost_button {
  min-height: 2.75rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.primary_button,
.tile_download {
  background: var(--mint);
  color: var(--graphite);
}

.ghost_button {
  background: transparent;
  color: var(--daylight);
  box-shadow: inset 0 0 0 1.5px #8aa198;
}

.photo_roll {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
}

.photo_tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--tile);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.photo_mat {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background:
    linear-gradient(45deg, #d7e8de 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #d7e8de 25%, transparent 25%) 0 8px / 16px 16px,
    var(--mat);
}

.photo_mat.is_waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
}

.photo_meta {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem 1.05rem;
}

.photo_name {
  margin: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo_readout {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.photo_error {
  margin: 0;
  color: #8a3b2b;
}

.about_block {
  max-width: 40rem;
  margin: 2.2rem 0 0;
  color: var(--muted);
}

.about_block p {
  margin: 0 0 0.8rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.drop_stage:focus-visible,
.choose_file_button:focus-visible,
.primary_button:focus-visible,
.ghost_button:focus-visible,
.tile_download:focus-visible,
input[type="range"]:focus-visible,
input[type="color"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .roll_tray {
    grid-template-columns: 1fr;
  }

  .photo_roll {
    grid-template-columns: 1fr;
  }

  .drop_stage {
    min-height: 18rem;
  }
}

@media (max-width: 520px) {
  .table_surface {
    padding: 1.15rem 0.8rem 3.5rem;
  }

  .ghost_slots {
    grid-template-columns: 1fr;
  }
}
