:root {
  color-scheme: dark;
  --ink: #0e0f12;
  --panel: #181a20;
  --paper: #f5f0df;
  --muted: #aaa99f;
  --line: #3b3d43;
  --orange: #f26b2b;
  --green: #68d391;
  --cyan: #54c7d9;
  --yellow: #f1c453;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input { font: inherit; }

a { color: inherit; }

.site-header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(255, 255, 255, .26);
}

.wordmark {
  color: #fff;
  font-size: 20px;
  font-weight: 850;
  text-decoration: none;
}

nav { display: flex; gap: 24px; }

nav a {
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: min(760px, 88vh);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #20242b;
}

.hero > img,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero > img {
  object-fit: cover;
  object-position: center 58%;
}

.hero-shade {
  background: rgba(4, 7, 12, .44);
  box-shadow: inset 0 -260px 180px -100px rgba(4, 7, 12, .94);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 120px 0 64px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p { margin-top: 0; }

h1 {
  margin-bottom: 14px;
  color: #fff;
  font-size: clamp(58px, 10vw, 116px);
  line-height: .86;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 28px;
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 650;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: #fff;
  border-bottom: 2px solid var(--orange);
  font-weight: 800;
  text-decoration: none;
}

.collection,
.site-notes {
  padding: 84px max(20px, calc((100vw - 1180px) / 2));
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(300px, 1.1fr);
  gap: 48px;
  align-items: end;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: .95;
  letter-spacing: 0;
}

.section-intro {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.collection-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 48px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.collection-stats div {
  min-width: 0;
  padding: 22px 18px 22px 0;
}

.collection-stats div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.collection-stats strong,
.collection-stats span { display: block; }

.collection-stats strong {
  font-size: 28px;
  color: var(--yellow);
}

.collection-stats span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.catalog-toolbar {
  display: grid;
  gap: 20px;
  margin-top: 44px;
}

.toolbar-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.design-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.design-status {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.design-button,
.new-category-button,
.login-submit {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--orange);
  border-radius: 4px;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.new-category-button { display: none; }
.design-mode .new-category-button { display: inline-flex; align-items: center; }

.design-button[aria-pressed="true"],
.login-submit {
  background: var(--orange);
  color: #111318;
}

.search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 360px);
  align-items: center;
  gap: 14px;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  background: var(--panel);
  color: var(--paper);
}

.search-field input:focus { border-color: var(--cyan); }

.brand-filter {
  display: flex;
  gap: 0;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.brand-filter button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-right: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.brand-filter button:first-child { border-radius: 4px 0 0 4px; }
.brand-filter button:last-child { border-right: 1px solid var(--line); border-radius: 0 4px 4px 0; }
.brand-filter button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }

.type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
}

.type-filter legend {
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.type-filter label {
  display: inline-flex;
  min-width: 38px;
  min-height: 34px;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.type-filter label span {
  font-size: 17px;
  line-height: 1;
}

.type-filter label:has(input:checked) {
  border-color: var(--cyan);
  background: rgba(84, 199, 217, .12);
  color: var(--paper);
}

.type-filter input {
  accent-color: var(--cyan);
}

.result-count {
  min-height: 20px;
  margin: 24px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.computer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.machine-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.machine-card:hover,
.machine-card:focus-within {
  border-color: var(--orange);
  transform: translateY(-2px);
}

.machine-card > button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.design-mode .machine-card {
  position: relative;
  cursor: grab;
  border-color: rgba(255, 177, 92, .55);
}

.design-mode .machine-card:active { cursor: grabbing; }
.design-mode .machine-card.is-dragging {
  opacity: .42;
  border-color: var(--yellow);
}

.design-mode .machine-card > button { pointer-events: auto; }

.design-controls {
  position: static;
  display: grid;
  gap: 4px;
  margin: 0 12px 12px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 4px;
  background: rgba(12, 13, 16, .9);
}

.control-row {
  display: grid;
  grid-template-columns: 32px 32px 32px;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.order-controls { grid-template-columns: 32px 32px 32px 46px; }

.framing-controls { grid-template-columns: 46px 32px 32px 32px; }

.cover-controls,
.framing-controls,
.merge-controls {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.framing-value {
  display: grid;
  height: 32px;
  place-items: center;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 850;
}

.drag-handle {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--paper);
  font-size: 17px;
  line-height: 1;
}

.cover-position {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 850;
}

.merge-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--orange);
  font-size: 18px;
  font-weight: 850;
}

.design-controls button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #22252b;
  color: var(--paper);
  cursor: pointer;
}

.design-controls button:hover,
.design-controls button:focus-visible { border-color: var(--orange); }

.design-controls button:disabled {
  opacity: .32;
  cursor: default;
}

.category-type-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.category-type-control select {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
  background: #22252b;
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.category-type-control select:focus {
  border-color: var(--cyan);
}

.design-controls .auto-order-button {
  width: 46px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 850;
}

.design-controls .classify-button,
.design-controls .manage-photos-button,
.design-controls .rename-category-button {
  width: 100%;
  min-height: 32px;
  height: auto;
  padding: 6px 8px;
  border-color: var(--orange);
  color: var(--yellow);
  font-size: 11px;
  font-weight: 850;
}

.design-controls .rename-category-button {
  border-color: var(--cyan);
  color: var(--cyan);
}

.design-controls .manage-photos-button {
  border-color: var(--orange);
  color: var(--yellow);
}

.machine-card figure {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  background: #d7d6cf;
}

.machine-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  transform-origin: 50% 50%;
  transform: translate(var(--cover-pan-x, 0%), var(--cover-pan-y, 0%)) rotate(var(--photo-rotation, 0deg)) scale(var(--cover-zoom, 1));
  transition: transform 240ms ease;
}

.design-mode .machine-card figure {
  cursor: move;
  touch-action: none;
  user-select: none;
}

.design-mode .machine-card figure.is-panning { cursor: grabbing; }

.design-mode .machine-card figure.is-panning img { transition: none; }

.rotatable-photo[data-rotation="90"],
.rotatable-photo[data-rotation="270"] {
  object-fit: contain;
  transform: rotate(var(--photo-rotation));
}

.machine-card .rotatable-photo[data-rotation="90"],
.machine-card .rotatable-photo[data-rotation="270"] {
  transform: translate(var(--cover-pan-x, 0%), var(--cover-pan-y, 0%)) rotate(var(--photo-rotation)) scale(var(--cover-zoom, 1));
}

.machine-card .rotatable-photo[data-rotation="90"],
.machine-card .rotatable-photo[data-rotation="270"],
.gallery-thumbs .rotatable-photo[data-rotation="90"],
.gallery-thumbs .rotatable-photo[data-rotation="270"],
.classification-photo .rotatable-photo[data-rotation="90"],
.classification-photo .rotatable-photo[data-rotation="270"] {
  inset: auto;
  top: -16.666%;
  left: 12.5%;
  width: 75%;
  height: 133.333%;
}

.empty-cover {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 20px;
  color: #555952;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.machine-card:hover img {
  transform: translate(var(--cover-pan-x, 0%), var(--cover-pan-y, 0%)) rotate(var(--photo-rotation, 0deg)) scale(calc(var(--cover-zoom, 1) * 1.025));
}
.machine-card:hover .rotatable-photo[data-rotation="90"],
.machine-card:hover .rotatable-photo[data-rotation="270"] {
  transform: translate(var(--cover-pan-x, 0%), var(--cover-pan-y, 0%)) rotate(var(--photo-rotation)) scale(calc(var(--cover-zoom, 1) * 1.025));
}

.machine-meta {
  display: block;
  padding: 14px 16px 14px 0;
}

.machine-brand,
.machine-model,
.machine-count { padding-left: 18px; }

.machine-brand {
  display: block;
  margin-bottom: 5px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.machine-model {
  display: block;
  min-height: 44px;
  font-size: 17px;
  line-height: 1.25;
}

.machine-count {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.machine-type {
  display: inline-flex;
  margin: 8px 0 0 18px;
  padding: 3px 7px;
  border: 1px solid rgba(84, 199, 217, .5);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.machine-properties {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0 16px 0 18px;
}

.machine-properties div {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: baseline;
}

.machine-properties dt {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.machine-properties dd {
  min-width: 0;
  margin: 0;
  color: var(--paper);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 46px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-notes {
  background: #eef0e7;
  color: #14161a;
}

.site-notes .eyebrow { color: #b54314; }
.site-notes .section-intro { color: #555952; }

.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.notes-grid article {
  min-height: 150px;
  padding-top: 18px;
  border-top: 4px solid #14161a;
}

.notes-grid article:nth-child(2) { border-color: #b54314; }
.notes-grid article:nth-child(3) { border-color: #137480; }
.notes-grid article:nth-child(4) { border-color: #267347; }
.notes-grid strong { font-size: 17px; }
.notes-grid p { margin-top: 12px; color: #555952; line-height: 1.5; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px max(20px, calc((100vw - 1180px) / 2));
  color: var(--muted);
  font-size: 13px;
}

footer span:first-child { color: var(--paper); font-weight: 850; }

.machine-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid #4b4d54;
  border-radius: 6px;
  background: #13151a;
  color: var(--paper);
}

.machine-dialog::backdrop { background: rgba(0, 0, 0, .78); }

.login-dialog,
.category-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #4b4d54;
  border-radius: 6px;
  background: #13151a;
  color: var(--paper);
}

.login-dialog::backdrop,
.category-dialog::backdrop { background: rgba(0, 0, 0, .78); }
.login-dialog form,
.category-dialog form { position: relative; padding: 38px 30px 30px; }
.login-dialog h2,
.category-dialog h2 { margin-bottom: 28px; font-size: 34px; }
.login-dialog label,
.category-dialog label { display: grid; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 13px; font-weight: 750; }
.login-dialog input,
.category-dialog input,
.category-dialog select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  background: var(--panel);
  color: var(--paper);
}
.login-dialog input:focus,
.category-dialog input:focus,
.category-dialog select:focus { border-color: var(--cyan); }
.login-error { min-height: 20px; margin: 14px 0; color: var(--orange); font-size: 13px; }
.login-submit { width: 100%; }
.category-properties {
  margin: 22px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.category-properties legend {
  padding: 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
}
.category-property-list {
  display: grid;
  gap: 10px;
}
.category-property-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: end;
}
.category-property-row label {
  margin-top: 0;
}
.category-property-row button,
.category-property-add {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #22252b;
  color: var(--paper);
  cursor: pointer;
}
.category-property-row button {
  width: 34px;
  padding: 0;
  color: var(--orange);
  font-size: 18px;
}
.category-property-add {
  width: 100%;
  margin-top: 12px;
  color: var(--cyan);
  font-weight: 850;
}
.category-property-row button:hover,
.category-property-row button:focus-visible,
.category-property-add:hover,
.category-property-add:focus-visible {
  border-color: var(--orange);
}
.category-submit { width: 100%; min-height: 44px; margin-top: 24px; background: var(--orange); color: #111; font-weight: 850; }

.classification-preview-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #4b4d54;
  border-radius: 6px;
  background: #13151a;
  color: var(--paper);
}
.classification-preview-dialog::backdrop { background: rgba(0, 0, 0, .82); }
.classification-preview-dialog figure {
  position: relative;
  min-height: min(72vh, 760px);
  margin: 0;
  overflow: hidden;
  background: #d7d6cf;
}
.classification-preview-dialog img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  transform-origin: 50% 50%;
}
.classification-preview-dialog p { margin: 0; padding: 12px 18px; color: var(--muted); font-size: 12px; }

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 4px;
  background: rgba(12, 13, 16, .86);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.dialog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr);
}

.dialog-gallery {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  background: #0b0c0f;
}

.dialog-gallery figure {
  position: relative;
  min-height: 520px;
  margin: 0;
  background: #d7d6cf;
}

.dialog-gallery figure img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; transform-origin: 50% 50%; }

.gallery-nav {
  position: absolute;
  top: calc(50% - 58px);
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 4px;
  background: rgba(8, 9, 12, .78);
  color: #fff;
  cursor: pointer;
}

.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery-thumbs {
  display: flex;
  gap: 7px;
  min-height: 86px;
  padding: 10px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.gallery-thumbs button {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
  height: 66px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 3px;
  background: #22252b;
  cursor: pointer;
}

.gallery-thumbs button[aria-current="true"] { border-color: var(--orange); }
.gallery-thumbs img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; transform-origin: 50% 50%; }

.dialog-copy { padding: 54px 32px 32px; }
.dialog-copy h2 { font-size: clamp(34px, 5vw, 54px); }
.dialog-copy dl { margin: 34px 0; border-top: 1px solid var(--line); }
.dialog-copy dl div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.dialog-copy dt { color: var(--muted); }
.dialog-copy dd { margin: 0; text-align: right; }
.dialog-copy .dialog-properties {
  margin-top: -12px;
  border-top: 1px solid var(--line);
}
.dialog-copy .dialog-properties dd {
  max-width: 58%;
  overflow-wrap: anywhere;
}
.dialog-copy > p:last-child { color: var(--muted); line-height: 1.55; }

.classification-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid #4b4d54;
  border-radius: 6px;
  background: #13151a;
  color: var(--paper);
}

.classification-dialog::backdrop { background: rgba(0, 0, 0, .78); }
.classification-dialog form { display: grid; grid-template-rows: auto auto minmax(220px, 1fr) auto; max-height: calc(100vh - 34px); }

.classification-header {
  position: relative;
  padding: 28px 72px 20px 28px;
  border-bottom: 1px solid var(--line);
}

.classification-header h2 { margin-top: 5px; font-size: 30px; }

.classification-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
}

.classification-toolbar label,
.classification-target > label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.classification-target { display: grid; gap: 6px; }
.classification-target-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.classification-toolbar input,
.classification-toolbar select {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  background: var(--panel);
  color: var(--paper);
}
.classification-toolbar input:focus,
.classification-toolbar select:focus { border-color: var(--cyan); }
.classification-target-control button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--cyan);
  border-radius: 4px;
  background: transparent;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.classification-target-control button:hover,
.classification-target-control button:focus-visible { background: var(--cyan); color: var(--ink); }

.classification-selection-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: center;
}
.classification-selection-actions strong { grid-column: 1 / -1; color: var(--cyan); font-size: 12px; text-align: right; }
.classification-selection-actions button { min-height: 42px; padding: 0 12px; }

.classification-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 10px;
  padding: 20px 28px;
  overflow-y: auto;
}

.classification-photo {
  position: relative;
  display: grid;
  grid-template-rows: auto 28px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #22252b;
  cursor: pointer;
}
.classification-photo.is-selected { border-color: var(--orange); }
.classification-photo input { position: absolute; z-index: 1; top: 7px; left: 7px; width: 20px; height: 20px; accent-color: var(--orange); }
.classification-image-frame { position: relative; display: grid; aspect-ratio: 4 / 3; overflow: hidden; place-items: center; background: #d7d6cf; }
.classification-photo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; transform-origin: 50% 50%; }
.classification-photo .rotatable-photo[data-rotation="90"],
.classification-photo .rotatable-photo[data-rotation="270"],
.gallery-thumbs .rotatable-photo[data-rotation="90"],
.gallery-thumbs .rotatable-photo[data-rotation="270"] { object-fit: contain; }
.classification-filename { overflow: hidden; padding: 6px 7px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.classification-rotate {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}
.classification-rotate button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 3px;
  background: rgba(12, 13, 16, .88);
  color: var(--paper);
  font-size: 18px;
  cursor: pointer;
}
.classification-rotate button:hover,
.classification-rotate button:focus-visible { border-color: var(--orange); color: var(--yellow); }
.classification-rotate .classification-delete-button:hover,
.classification-rotate .classification-delete-button:focus-visible { border-color: #ff765f; color: #ff9a86; }
.trash-icon {
  position: relative;
  display: block;
  width: 12px;
  height: 14px;
  margin: 3px auto 0;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}
.trash-icon::before {
  position: absolute;
  top: -5px;
  left: -3px;
  width: 14px;
  height: 2px;
  background: currentColor;
  content: "";
}
.trash-icon::after {
  position: absolute;
  top: -8px;
  left: 2px;
  width: 5px;
  height: 3px;
  border: 2px solid currentColor;
  border-bottom: 0;
  content: "";
}
.zoom-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  margin: 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.zoom-icon::after {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}
.classification-empty { padding: 50px 28px; color: var(--muted); text-align: center; }

.classification-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 16px 28px 20px;
  border-top: 1px solid var(--line);
}
.classification-history-wrap { display: grid; gap: 8px; }
.classification-undo { min-height: 40px; }
.classification-history { display: grid; gap: 3px; margin: 0; padding: 0; color: var(--muted); font-size: 11px; list-style: none; }
.classification-submit { min-height: 44px; background: var(--orange); color: #111; font-weight: 850; }
.classification-submit:disabled,
.classification-undo:disabled { opacity: .38; cursor: default; }

@media (max-width: 920px) {
  .computer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-gallery figure { min-height: 0; aspect-ratio: 16 / 10; }
  .classification-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .site-header { min-height: 56px; }
  nav { gap: 14px; }
  nav a { font-size: 12px; }
  .hero { min-height: 78vh; }
  .hero-content { padding-bottom: 42px; }
  .collection, .site-notes { padding-top: 62px; padding-bottom: 62px; }
  .section-heading { grid-template-columns: 1fr; gap: 22px; }
  .collection-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-stats div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .collection-stats div:nth-child(4) { border-top: 1px solid var(--line); }
  .toolbar-top { align-items: stretch; flex-direction: column; }
  .design-actions { justify-content: space-between; }
  .computer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .machine-meta { padding: 12px 13px 12px 0; }
  .machine-brand,
  .machine-model,
  .machine-count { padding-left: 14px; }
  .machine-properties { padding: 0 13px 0 14px; }
  .machine-model { min-height: 40px; font-size: 15px; }
  .notes-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
  .classification-toolbar { grid-template-columns: 1fr; }
  .classification-target-control { grid-template-columns: 1fr; }
  .classification-preview-dialog figure { min-height: 64vh; }
  .classification-selection-actions { grid-template-columns: 1fr 1fr; }
  .classification-selection-actions strong { text-align: left; }
  .classification-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .classification-footer { align-items: stretch; flex-direction: column-reverse; }
  .classification-submit { width: 100%; }
  .category-property-row { grid-template-columns: 1fr 34px; }
  .category-property-row label { grid-column: 1 / 2; }
  .category-property-row button {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    align-self: center;
  }
}

@media (max-width: 390px) {
  .computer-grid { grid-template-columns: 1fr; }
  .search-field { grid-template-columns: 1fr; gap: 7px; }
  .classification-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
