:root {
  color-scheme: light;
  --ink: #211c18;
  --ink-soft: #665d55;
  --ink-faint: #8a8179;
  --canvas: #f5f0e8;
  --paper: #fffdf9;
  --line: rgba(53, 41, 31, 0.12);
  --line-strong: rgba(53, 41, 31, 0.22);
  --honey: #e3a51c;
  --honey-deep: #b87508;
  --honey-soft: #f8e8ba;
  --yes: #177c5a;
  --yes-soft: #dcefe7;
  --no: #b34845;
  --no-soft: #f4dfdc;
  --maybe: #80623a;
  --maybe-soft: #f3ead8;
  --shadow-soft: 0 16px 45px rgba(65, 48, 32, 0.1);
  --shadow-card: 0 30px 80px rgba(47, 35, 24, 0.18);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 22%, rgba(236, 190, 78, 0.12), transparent 30rem),
    radial-gradient(circle at 84% 38%, rgba(188, 153, 208, 0.1), transparent 32rem),
    var(--canvas);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(210, 143, 10, 0.45);
  outline-offset: 3px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--ink);
  border-radius: 0.7rem;
  transform: translateY(-180%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(190, 132, 18, 0.09);
  border-radius: 42% 58% 63% 37% / 55% 36% 64% 45%;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  inset: 2.5rem;
  border: inherit;
  border-radius: inherit;
  transform: rotate(24deg);
}

.ambient::after {
  inset: 5rem;
  transform: rotate(48deg);
}

.ambient-one {
  top: 12rem;
  left: -13rem;
}

.ambient-two {
  right: -15rem;
  bottom: 1rem;
  transform: rotate(120deg) scale(1.25);
}

.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 0 3.2vw;
  background: rgba(245, 240, 232, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.72rem;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  color: #2d1f0d;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), transparent 45%),
    linear-gradient(135deg, #f4cf76, #d8940c);
  border: 1px solid rgba(109, 68, 4, 0.18);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 7px 16px rgba(160, 103, 8, 0.18);
  font-family: var(--serif);
  font-size: 1.36rem;
  font-weight: 700;
}

.brand-mark svg {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 21px;
  color: rgba(94, 57, 5, 0.28);
  fill: currentColor;
  stroke: none;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 0.3rem;
  color: var(--ink-faint);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.view-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0.42rem 0.86rem;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.nav-button.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 3px 12px rgba(59, 44, 30, 0.1);
}

.nav-count {
  display: grid;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  place-items: center;
  color: var(--ink-soft);
  background: rgba(38, 30, 23, 0.07);
  border-radius: 999px;
  font-size: 0.68rem;
}

.nav-button.is-active .nav-count {
  color: #684004;
  background: var(--honey-soft);
}

.save-status {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 0.48rem;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 600;
}

.save-dot {
  width: 7px;
  height: 7px;
  background: var(--yes);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(23, 124, 90, 0.1);
}

.save-status.has-error .save-dot {
  background: var(--no);
  box-shadow: 0 0 0 4px rgba(179, 72, 69, 0.1);
}

.app-view {
  display: none;
  width: min(1480px, 100%);
  min-height: calc(100vh - 78px);
  margin: 0 auto;
}

.app-view.is-active {
  display: block;
}

.sorter-view {
  padding: 1.2rem clamp(1rem, 3vw, 3rem) 3rem;
}

.progress-shell {
  display: grid;
  grid-template-columns: auto minmax(8rem, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  max-width: 1080px;
  min-height: 44px;
  margin: 0 auto 1rem;
}

.progress-copy {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: max-content;
}

.progress-copy span {
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-copy strong {
  font-size: 0.74rem;
}

.progress-track {
  position: relative;
  height: 5px;
  overflow: hidden;
  background: rgba(56, 42, 29, 0.1);
  border-radius: 999px;
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #b96e08, #edb938);
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(218, 153, 25, 0.32);
  transition: width 320ms ease;
}

.text-button {
  padding: 0.35rem 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.72rem;
  font-weight: 650;
}

.text-button:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.sorter-layout {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(340px, 520px) minmax(180px, 230px);
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 3.4rem);
}

.side-panel {
  align-self: center;
}

.eyebrow {
  display: block;
  color: #9a650e;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.guide-panel h1,
.inventory-heading h1 {
  margin: 0.62rem 0 0.8rem;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 3vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.guide-panel > p {
  max-width: 22rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.65;
}

.gesture-guide {
  display: grid;
  gap: 0.78rem;
  margin: 1.65rem 0 1.5rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.gesture-guide > div {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.keycap {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  box-shadow: 0 2px 0 rgba(69, 51, 35, 0.08);
  font-size: 0.88rem;
}

.gesture-guide span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.gesture-guide strong {
  font-size: 0.74rem;
}

.gesture-guide small {
  color: var(--ink-faint);
  font-size: 0.64rem;
}

.guide-panel .privacy-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-faint);
  font-size: 0.66rem;
  font-weight: 650;
}

.privacy-note svg {
  width: 14px;
}

.deck-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
}

.card-deck {
  position: relative;
  display: grid;
  width: min(100%, 430px);
  height: min(65vh, 660px);
  min-height: 490px;
  place-items: center;
  isolation: isolate;
}

.deck-shadow {
  position: absolute;
  inset: 0.9rem;
  z-index: -2;
  background: #e9dfd2;
  border: 1px solid rgba(52, 38, 25, 0.09);
  border-radius: 1.75rem;
  box-shadow: var(--shadow-soft);
}

.deck-shadow-back {
  transform: translateY(11px) rotate(2.5deg) scale(0.965);
}

.deck-shadow-front {
  z-index: -1;
  background: #f8f3ec;
  transform: translateY(5px) rotate(-1.5deg) scale(0.984);
}

.swipe-card {
  --drag-x: 0px;
  --drag-y: 0px;
  --drag-rotate: 0deg;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(59, 44, 30, 0.12);
  border-radius: 1.65rem;
  box-shadow: var(--shadow-card);
  cursor: grab;
  transform: translate3d(var(--drag-x), var(--drag-y), 0) rotate(var(--drag-rotate));
  transform-origin: 50% 88%;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
}

.swipe-card.is-dragging {
  cursor: grabbing;
  transition: none;
}

.swipe-card.is-snapping {
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.swipe-card.is-flying-left {
  animation: fly-left 300ms cubic-bezier(0.36, 0, 0.66, -0.08) forwards;
}

.swipe-card.is-flying-right {
  animation: fly-right 300ms cubic-bezier(0.36, 0, 0.66, -0.08) forwards;
}

.swipe-card.is-flying-down {
  animation: fly-down 300ms cubic-bezier(0.36, 0, 0.66, -0.08) forwards;
}

@keyframes fly-left {
  to {
    opacity: 0;
    transform: translate3d(-115vw, 5vh, 0) rotate(-18deg);
  }
}

@keyframes fly-right {
  to {
    opacity: 0;
    transform: translate3d(115vw, 5vh, 0) rotate(18deg);
  }
}

@keyframes fly-down {
  to {
    opacity: 0;
    transform: translate3d(0, 80vh, 0) rotate(2deg);
  }
}

.card-image-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(223, 202, 172, 0.34), rgba(242, 232, 218, 0.7)),
    #eee6dc;
}

.card-image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 -24px 35px rgba(34, 25, 17, 0.05);
}

.card-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.swipe-card.is-loading .card-image-frame img {
  opacity: 0;
}

.image-skeleton {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  background: #ebe3d9;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.image-skeleton span {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.6) 48%, transparent 64%);
  animation: shimmer 1.35s linear infinite;
  transform: translateX(-100%);
}

.swipe-card:not(.is-loading) .image-skeleton {
  opacity: 0;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.image-error {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.4rem;
  padding: 2rem;
  color: var(--ink-soft);
  background: #eee6dc;
  text-align: center;
}

.image-error strong {
  font-family: var(--serif);
  font-size: 1.3rem;
}

.image-error span {
  font-size: 0.72rem;
}

.card-meta {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.86rem 1.05rem 0.9rem 1.15rem;
  background: rgba(255, 253, 249, 0.98);
  border-top: 1px solid var(--line);
}

.collection-badge {
  display: inline-block;
  margin-bottom: 0.28rem;
  color: #99650f;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-meta h2 {
  max-width: 280px;
  margin: 0;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-position {
  flex: 0 0 auto;
  padding: 0.44rem 0.58rem;
  color: var(--ink-faint);
  background: #f2ece4;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
}

.decision-stamp {
  position: absolute;
  z-index: 5;
  top: 1.3rem;
  padding: 0.54rem 0.72rem;
  opacity: 0;
  background: rgba(255, 255, 255, 0.87);
  border: 3px solid currentColor;
  border-radius: 0.55rem;
  box-shadow: 0 8px 26px rgba(31, 25, 19, 0.17);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  pointer-events: none;
}

.stamp-no {
  right: 1.25rem;
  color: var(--no);
  transform: rotate(8deg);
}

.stamp-yes {
  left: 1.25rem;
  color: var(--yes);
  transform: rotate(-8deg);
}

.stamp-maybe {
  left: 50%;
  color: var(--maybe);
  transform: translateX(-50%) rotate(-2deg);
}

.completion-card {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2.5rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(242, 196, 87, 0.24), transparent 15rem),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.65rem;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.completion-mark {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 1.5rem;
  place-items: center;
  color: #875607;
  background: linear-gradient(145deg, #f8e6b3, #e4ac35);
  border: 1px solid rgba(124, 78, 6, 0.16);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(188, 125, 14, 0.19);
}

.completion-mark svg {
  width: 34px;
  stroke-width: 2.7;
}

.completion-card h2 {
  max-width: 20rem;
  margin: 0.6rem 0 0.7rem;
  font-family: var(--serif);
  font-size: 2.45rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.completion-card p {
  max-width: 19rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.55;
}

.completion-stats {
  display: flex;
  gap: 2.4rem;
  margin: 1.55rem 0;
}

.completion-stats span {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  color: var(--ink-faint);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.completion-stats strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  border-radius: 0.8rem;
  font-size: 0.75rem;
  font-weight: 750;
}

.primary-button {
  color: #fffaf0;
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 0 8px 18px rgba(34, 27, 21, 0.14);
}

.primary-button:hover {
  background: #3b3028;
}

.secondary-button {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
}

.danger-button {
  color: white;
  background: var(--no);
  border: 1px solid var(--no);
}

.decision-controls {
  display: grid;
  grid-template-columns: 1fr 0.78fr 0.95fr 1fr;
  width: min(100%, 430px);
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.image-notes {
  width: min(100%, 405px);
  margin-top: 0.72rem;
  padding: 0.78rem 0.85rem 0.66rem;
  background: rgba(255, 253, 249, 0.78);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 7px 18px rgba(58, 43, 29, 0.05);
}

.notes-heading,
.notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.notes-heading {
  margin-bottom: 0.55rem;
}

.notes-heading label {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.65rem;
  font-weight: 800;
}

.notes-heading label svg {
  width: 14px;
  color: #a16a0c;
}

.notes-heading > span {
  color: var(--ink-faint);
  font-size: 0.54rem;
  font-weight: 700;
}

.notes-heading > span.is-saving {
  color: #9a650e;
}

.notes-heading > span.is-saved {
  color: var(--yes);
}

.image-notes textarea,
.note-editor textarea {
  display: block;
  width: 100%;
  resize: vertical;
  color: var(--ink);
  background: rgba(247, 242, 234, 0.78);
  border: 1px solid rgba(53, 41, 31, 0.11);
  border-radius: 0.72rem;
  outline: none;
  line-height: 1.5;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.image-notes textarea {
  min-height: 68px;
  max-height: 180px;
  padding: 0.62rem 0.68rem;
  font-size: 0.68rem;
}

.image-notes textarea::placeholder,
.note-editor textarea::placeholder {
  color: #9b9289;
}

.image-notes textarea:focus,
.note-editor textarea:focus {
  background: white;
  border-color: rgba(184, 116, 8, 0.38);
  box-shadow: 0 0 0 3px rgba(227, 165, 28, 0.09);
}

.notes-footer {
  margin-top: 0.42rem;
  color: var(--ink-faint);
  font-size: 0.51rem;
}

.notes-footer b {
  color: inherit;
  font-weight: 750;
}

.decision-button {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 0.42rem;
  min-height: 55px;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 253, 249, 0.8);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 7px 18px rgba(58, 43, 29, 0.06);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.decision-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(58, 43, 29, 0.11);
}

.decision-button svg {
  grid-row: 1 / span 2;
  width: 22px;
  stroke-width: 2.2;
}

.decision-button span {
  align-self: end;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.decision-button small {
  align-self: start;
  margin-top: 0.18rem;
  color: var(--ink-faint);
  font-size: 0.52rem;
  line-height: 1;
}

.decision-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.no-button {
  color: var(--no);
}

.no-button:hover:not(:disabled) {
  background: var(--no-soft);
  border-color: rgba(179, 72, 69, 0.24);
}

.yes-button {
  color: var(--yes);
}

.yes-button:hover:not(:disabled) {
  background: var(--yes-soft);
  border-color: rgba(23, 124, 90, 0.24);
}

.maybe-button {
  color: var(--maybe);
}

.maybe-button:hover:not(:disabled) {
  background: var(--maybe-soft);
  border-color: rgba(128, 98, 58, 0.24);
}

.undo-button {
  color: var(--ink-soft);
}

.session-panel {
  padding: 1.05rem;
  background: rgba(255, 253, 249, 0.58);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.session-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.1rem 0.82rem;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-faint);
  font-size: 0.54rem;
  font-weight: 700;
}

.live-pill i {
  width: 5px;
  height: 5px;
  background: var(--yes);
  border-radius: 50%;
}

.stat-stack {
  display: grid;
  gap: 0.42rem;
}

.stat-stack button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 57px;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(53, 41, 31, 0.08);
  border-radius: 0.82rem;
  text-align: left;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.stat-stack button:hover {
  background: white;
  transform: translateX(2px);
}

.stat-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  font-weight: 850;
}

.yes-stat {
  color: var(--yes);
  background: var(--yes-soft);
}

.no-stat {
  color: var(--no);
  background: var(--no-soft);
}

.maybe-stat {
  color: var(--maybe);
  background: var(--maybe-soft);
}

.left-stat {
  color: #98620b;
  background: var(--honey-soft);
}

.stat-stack button > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat-stack small {
  color: var(--ink-faint);
  font-size: 0.54rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-stack strong {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1;
}

.stat-stack svg {
  width: 14px;
  color: var(--ink-faint);
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.7rem;
  padding: 0.9rem 0.75rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.35), transparent),
    var(--honey-soft);
  border: 1px solid rgba(153, 101, 15, 0.12);
  border-radius: 0.82rem;
}

.source-card span {
  color: #99650f;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.source-card strong {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.source-card small {
  color: #765c31;
  font-size: 0.58rem;
}

.inventory-view {
  padding: clamp(2rem, 4vw, 4.2rem) clamp(1rem, 4vw, 4.2rem) 5rem;
}

.inventory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
}

.inventory-heading h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(2.35rem, 4vw, 4rem);
}

.inventory-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.inventory-summary {
  display: flex;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255, 253, 249, 0.64);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
}

.inventory-summary button {
  display: flex;
  min-width: 94px;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.85rem 1.1rem;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  text-align: left;
}

.inventory-summary button:last-child {
  border-right: 0;
}

.inventory-summary button:hover {
  background: rgba(255, 255, 255, 0.7);
}

.inventory-summary small {
  color: var(--ink-faint);
  font-size: 0.58rem;
  font-weight: 750;
  text-transform: uppercase;
}

.inventory-summary strong {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
}

.inventory-toolbar {
  position: sticky;
  z-index: 20;
  top: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  background: rgba(245, 240, 232, 0.91);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-tabs button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.48rem 0.78rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
}

.filter-tabs button span {
  display: grid;
  min-width: 1.28rem;
  height: 1.28rem;
  place-items: center;
  padding: 0 0.25rem;
  background: rgba(49, 38, 28, 0.07);
  border-radius: 999px;
  font-size: 0.55rem;
}

.filter-tabs button.is-active {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  box-shadow: 0 4px 12px rgba(56, 42, 29, 0.08);
}

.search-field {
  display: flex;
  width: min(260px, 35vw);
  min-height: 40px;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.75rem;
  background: rgba(255, 253, 249, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search-field:focus-within {
  background: white;
  border-color: rgba(184, 116, 8, 0.35);
  box-shadow: 0 0 0 3px rgba(227, 165, 28, 0.09);
}

.search-field svg {
  width: 16px;
  flex: 0 0 auto;
  color: var(--ink-faint);
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.68rem;
}

.search-field input::placeholder {
  color: var(--ink-faint);
}

.inventory-results-meta {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0 0.7rem;
}

.inventory-results-meta p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.64rem;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.inventory-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  box-shadow: 0 8px 25px rgba(59, 44, 30, 0.06);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.inventory-card:hover {
  z-index: 2;
  border-color: var(--line-strong);
  box-shadow: 0 15px 35px rgba(59, 44, 30, 0.12);
  transform: translateY(-3px);
}

.inventory-card[data-status="yes"] {
  border-color: rgba(23, 124, 90, 0.22);
}

.inventory-card[data-status="no"] {
  border-color: rgba(179, 72, 69, 0.19);
}

.inventory-card[data-status="maybe"] {
  border-color: rgba(128, 98, 58, 0.22);
}

.inventory-image {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #e9e0d5;
}

.inventory-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.inventory-card:hover .inventory-image img {
  transform: scale(1.018);
}

.inventory-status {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: flex;
  min-height: 25px;
  align-items: center;
  gap: 0.28rem;
  padding: 0.27rem 0.48rem;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid rgba(52, 40, 29, 0.11);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(39, 30, 22, 0.1);
  font-size: 0.52rem;
  font-weight: 800;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.inventory-card[data-status="yes"] .inventory-status {
  color: var(--yes);
  background: rgba(229, 246, 239, 0.9);
}

.inventory-card[data-status="no"] .inventory-status {
  color: var(--no);
  background: rgba(250, 231, 229, 0.9);
}

.inventory-card[data-status="maybe"] .inventory-status {
  color: var(--maybe);
  background: rgba(246, 237, 219, 0.92);
}

.inventory-status i {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}

.inventory-card-body {
  padding: 0.75rem;
}

.inventory-card-copy {
  min-width: 0;
  margin-bottom: 0.66rem;
}

.inventory-card-copy span {
  display: block;
  margin-bottom: 0.18rem;
  color: #9a650e;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inventory-card-copy h2 {
  margin: 0;
  overflow: hidden;
  font-size: 0.64rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-note-button {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.52rem;
  padding: 0.42rem 0.5rem;
  color: var(--ink-faint);
  background: #f6f0e8;
  border: 1px solid rgba(53, 41, 31, 0.07);
  border-radius: 0.58rem;
  text-align: left;
}

.inventory-note-button:hover {
  color: var(--ink);
  background: white;
  border-color: var(--line);
}

.inventory-note-button.has-note {
  color: #72500f;
  background: #faf0d3;
  border-color: rgba(154, 101, 14, 0.13);
}

.inventory-note-button svg {
  width: 13px;
  flex: 0 0 auto;
}

.inventory-note-button span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.51rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-decision-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.28rem;
  padding-top: 0.62rem;
  border-top: 1px solid var(--line);
}

.mini-decision-controls button {
  display: flex;
  min-width: 0;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  padding: 0.25rem;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.52rem;
  font-weight: 750;
}

.mini-decision-controls button:hover {
  background: rgba(51, 40, 30, 0.05);
}

.mini-decision-controls button[data-set-choice="no"] {
  color: var(--no);
}

.mini-decision-controls button[data-set-choice="yes"] {
  color: var(--yes);
}

.mini-decision-controls button[data-set-choice="maybe"] {
  color: var(--maybe);
}

.inventory-card[data-status="no"] button[data-set-choice="no"] {
  background: var(--no-soft);
  border-color: rgba(179, 72, 69, 0.14);
}

.inventory-card[data-status="yes"] button[data-set-choice="yes"] {
  background: var(--yes-soft);
  border-color: rgba(23, 124, 90, 0.14);
}

.inventory-card[data-status="maybe"] button[data-set-choice="maybe"] {
  background: var(--maybe-soft);
  border-color: rgba(128, 98, 58, 0.14);
}

.inventory-card[data-status="unsorted"] button[data-set-choice="unset"] {
  color: #8d5a08;
  background: var(--honey-soft);
  border-color: rgba(154, 101, 14, 0.12);
}

.empty-inventory {
  display: flex;
  min-height: 340px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 3rem;
  text-align: center;
}

.empty-inventory > span {
  color: #a27835;
  font-family: var(--serif);
  font-size: 3rem;
}

.empty-inventory h2 {
  margin: 0.4rem 0;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 500;
}

.empty-inventory p {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.utility-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 3.2vw;
  background: rgba(237, 230, 219, 0.72);
  border-top: 1px solid var(--line);
}

.utility-footer > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.utility-footer strong {
  font-family: var(--serif);
  font-size: 0.85rem;
}

.utility-footer span {
  color: var(--ink-faint);
  font-size: 0.57rem;
}

.utility-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.utility-actions button,
.utility-actions a {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 0.36rem;
  padding: 0.4rem 0.62rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  font-size: 0.61rem;
  font-weight: 700;
  text-decoration: none;
}

.utility-actions button:hover,
.utility-actions a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
}

.utility-actions svg {
  width: 14px;
}

.visitor-dialog form,
.owner-login form {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.visitor-dialog form label,
.owner-login form label {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
}

.visitor-dialog input,
.owner-login input {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.8rem;
  color: var(--ink);
  background: #fbf8f2;
  border: 1px solid var(--line-strong);
  border-radius: 0.72rem;
  outline: none;
}

.visitor-dialog input:focus,
.owner-login input:focus {
  background: white;
  border-color: rgba(184, 116, 8, 0.48);
  box-shadow: 0 0 0 3px rgba(227, 165, 28, 0.1);
}

.visitor-dialog .primary-button {
  width: 100%;
  margin-top: 0.2rem;
}

.form-feedback {
  min-height: 1.1em;
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.65rem;
}

.form-feedback.has-error {
  color: var(--no);
}

.admin-page {
  min-height: 100vh;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 4vw;
  background: rgba(245, 240, 232, 0.9);
  border-bottom: 1px solid var(--line);
}

.admin-brand {
  text-decoration: none;
}

.admin-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.admin-hero {
  max-width: 720px;
  margin-bottom: 2rem;
}

.admin-hero h1 {
  margin: 0.4rem 0 0.65rem;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.admin-hero p,
.owner-login p {
  color: var(--ink-soft);
  line-height: 1.65;
}

.owner-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 2rem;
  padding: 2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-soft);
}

.owner-login h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
}

.owner-login > div p {
  margin-bottom: 0;
}

.owner-login form {
  margin: 0;
}

.owner-login form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 253, 249, 0.8);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.admin-summary,
.admin-actions,
.visitor-counts {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-summary span,
.visitor-counts button {
  display: flex;
  min-width: 64px;
  flex-direction: column;
  padding: 0.55rem 0.75rem;
  color: var(--ink);
  background: #f7f0e4;
  border: 1px solid transparent;
  border-radius: 0.72rem;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.visitor-counts button:hover {
  background: #fff8e9;
  border-color: rgba(184, 116, 8, 0.28);
  transform: translateY(-1px);
}

.admin-summary small,
.visitor-counts small {
  color: var(--ink-faint);
  font-size: 0.55rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-summary strong,
.visitor-counts strong {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.admin-actions .search-field {
  min-width: 250px;
}

.admin-results-meta {
  margin: 1rem 0;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.visitor-results-list {
  display: grid;
  gap: 1rem;
}

.visitor-result-card {
  padding: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  box-shadow: 0 12px 30px rgba(65, 48, 32, 0.07);
}

.visitor-result-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.visitor-result-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.55rem;
}

.visitor-result-heading span {
  color: var(--ink-faint);
  font-size: 0.62rem;
}

.visitor-counts {
  margin: 1rem 0;
}

.visitor-result-card details {
  border-top: 1px solid var(--line);
}

.visitor-result-card summary {
  padding: 0.9rem 0 0.2rem;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.visitor-decision-filters {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem 0 0;
}

.visitor-decision-filters button {
  padding: 0.42rem 0.65rem;
  color: var(--ink-soft);
  background: #f7f1e8;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 750;
}

.visitor-decision-filters button.is-active {
  color: #5b3904;
  background: var(--honey-soft);
  border-color: rgba(184, 116, 8, 0.28);
}

.visitor-decision-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.8rem 0 1rem;
}

.visitor-decision-grid > p {
  grid-column: 1 / -1;
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.visitor-decision-card {
  overflow: hidden;
  color: var(--ink);
  background: #f8f3eb;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.visitor-decision-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(58, 43, 29, 0.12);
}

.visitor-decision-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.visitor-decision-card > div {
  padding: 0.58rem;
}

.visitor-decision-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.63rem;
}

.visitor-decision-card small {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.18rem 0.38rem;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 800;
}

.visitor-decision-card .decision-yes {
  color: var(--yes);
  background: var(--yes-soft);
}

.visitor-decision-card .decision-no {
  color: var(--no);
  background: var(--no-soft);
}

.visitor-decision-card .decision-maybe {
  color: var(--maybe);
  background: var(--maybe-soft);
}

.visitor-decision-card p {
  display: -webkit-box;
  margin: 0.45rem 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.58rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.visitor-note-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.visitor-note-list article {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.65rem;
  background: #f8f3eb;
  border-radius: 0.8rem;
}

.visitor-note-list img {
  width: 72px;
  height: 88px;
  object-fit: cover;
  border-radius: 0.55rem;
}

.visitor-note-list strong,
.visitor-note-list small {
  display: block;
  overflow-wrap: anywhere;
}

.visitor-note-list strong {
  font-size: 0.7rem;
}

.visitor-note-list small {
  margin-top: 0.18rem;
  color: var(--honey-deep);
  font-size: 0.56rem;
  font-weight: 800;
}

.visitor-note-list p {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.app-dialog {
  width: min(440px, calc(100vw - 2rem));
  padding: 2rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  box-shadow: 0 30px 100px rgba(37, 28, 20, 0.28);
}

.app-dialog::backdrop {
  background: rgba(42, 33, 26, 0.4);
  backdrop-filter: blur(5px);
}

.note-dialog {
  width: min(880px, calc(100vw - 2rem));
  max-height: min(820px, calc(100dvh - 2rem));
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  box-shadow: 0 30px 100px rgba(37, 28, 20, 0.3);
}

.note-dialog::backdrop {
  background: rgba(42, 33, 26, 0.46);
  backdrop-filter: blur(6px);
}

.note-dialog-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1fr);
  min-height: 560px;
}

.note-preview {
  min-height: 0;
  overflow: hidden;
  background: #eae1d7;
}

.note-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-editor {
  display: flex;
  min-width: 0;
  justify-content: center;
  flex-direction: column;
  padding: 2.3rem;
}

.note-editor h2 {
  margin: 0.55rem 2rem 1.35rem 0;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-editor > label {
  margin-bottom: 0.48rem;
  font-size: 0.68rem;
  font-weight: 800;
}

.note-editor textarea {
  min-height: 220px;
  max-height: 390px;
  padding: 0.8rem;
  font-size: 0.75rem;
}

.note-editor .primary-button {
  align-self: flex-end;
  min-width: 104px;
  margin-top: 1.2rem;
}

.dialog-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink-soft);
  background: #f2ece4;
  border: 0;
  border-radius: 50%;
  font-size: 1.2rem;
}

.dialog-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  place-items: center;
  color: #875607;
  background: var(--honey-soft);
  border-radius: 0.9rem;
  font-size: 1.25rem;
}

.warning-icon {
  color: var(--no);
  background: var(--no-soft);
}

.app-dialog h2 {
  margin: 0.55rem 0 0.7rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.app-dialog > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.6;
}

.help-steps {
  display: grid;
  gap: 0.72rem;
  margin: 1.4rem 0;
}

.help-steps > div {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem;
  background: #f7f2ea;
  border: 1px solid rgba(52, 40, 29, 0.07);
  border-radius: 0.8rem;
}

.help-steps > div > strong {
  color: #ad7518;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
}

.help-steps span {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.help-steps b {
  font-size: 0.69rem;
}

.help-steps small {
  color: var(--ink-soft);
  font-size: 0.62rem;
}

.dialog-primary {
  width: 100%;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.toast-region {
  position: fixed;
  z-index: 500;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  max-width: min(360px, calc(100vw - 2rem));
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  color: #fffaf3;
  background: rgba(37, 29, 23, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0.8rem;
  box-shadow: 0 12px 30px rgba(35, 27, 21, 0.2);
  font-size: 0.68rem;
  font-weight: 650;
  animation: toast-in 220ms ease both;
}

.toast::before {
  content: "✓";
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: #261d15;
  background: #f0c65f;
  border-radius: 50%;
  font-size: 0.62rem;
}

.toast.is-error::before {
  content: "!";
  color: white;
  background: var(--no);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.noscript-message {
  position: fixed;
  z-index: 1000;
  inset: auto 1rem 1rem;
  padding: 1rem;
  color: white;
  background: var(--no);
  border-radius: 0.8rem;
  text-align: center;
}

@media (max-width: 1080px) {
  .sorter-layout {
    grid-template-columns: minmax(170px, 210px) minmax(340px, 470px);
  }

  .session-panel {
    display: none;
  }

  .inventory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    min-height: 66px;
    padding: 0 0.85rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-copy {
    display: none;
  }

  .view-nav {
    justify-self: center;
  }

  .nav-button {
    min-height: 35px;
    padding: 0.35rem 0.62rem;
    font-size: 0.72rem;
  }

  .save-status {
    width: 38px;
    justify-content: center;
  }

  .save-status span:last-child {
    display: none;
  }

  .app-view {
    min-height: calc(100vh - 66px);
  }

  .sorter-view {
    padding: 0.8rem 0.8rem 2rem;
  }

  .progress-shell {
    grid-template-columns: auto 1fr;
    gap: 0.8rem;
    margin-bottom: 0.65rem;
  }

  .progress-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.14rem;
  }

  .progress-copy span {
    display: none;
  }

  .progress-shell .text-button {
    display: none;
  }

  .sorter-layout {
    display: block;
  }

  .guide-panel {
    display: none;
  }

  .card-deck {
    width: min(100%, 400px);
    height: min(65dvh, 620px);
    min-height: 430px;
  }

  .card-meta {
    min-height: 66px;
    padding: 0.7rem 0.85rem;
  }

  .card-meta h2 {
    max-width: 220px;
    font-size: 0.74rem;
  }

  .decision-controls {
    width: min(100%, 390px);
    margin-top: 0.85rem;
  }

  .image-notes {
    width: min(100%, 390px);
  }

  .decision-button {
    min-height: 51px;
    border-radius: 0.9rem;
  }

  .decision-button small {
    display: none;
  }

  .decision-button svg {
    grid-row: auto;
  }

  .inventory-view {
    padding: 2rem 0.9rem 4rem;
  }

  .inventory-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 1.4rem;
    padding-bottom: 1.4rem;
  }

  .inventory-heading h1 {
    font-size: 2.55rem;
  }

  .inventory-summary {
    width: 100%;
  }

  .inventory-summary button {
    min-width: 0;
    flex: 1;
  }

  .inventory-toolbar {
    top: 66px;
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 0.75rem;
    padding: 0.8rem 0;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tabs button {
    flex: 0 0 auto;
  }

  .search-field {
    width: 100%;
  }

  .inventory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .inventory-card-body {
    padding: 0.58rem;
  }

  .utility-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 1rem;
  }

  .utility-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .utility-actions button,
  .utility-actions a {
    justify-content: center;
    background: rgba(255, 255, 255, 0.38);
    border-color: var(--line);
  }

  .admin-topbar {
    min-height: 66px;
    padding: 0 1rem;
  }

  .admin-main {
    width: min(100% - 1.2rem, 1180px);
    padding-top: 2rem;
  }

  .owner-login,
  .admin-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .owner-login {
    display: grid;
    padding: 1.25rem;
  }

  .admin-toolbar,
  .admin-actions {
    display: grid;
  }

  .admin-summary,
  .visitor-counts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-actions .search-field {
    min-width: 0;
  }

  .visitor-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .visitor-note-list {
    grid-template-columns: 1fr;
  }

  .visitor-decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visitor-decision-filters {
    overflow-x: auto;
  }

  .note-dialog {
    padding: 0;
  }

  .note-dialog-layout {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
  }

  .note-preview {
    min-height: 230px;
    max-height: 38dvh;
  }

  .note-preview img {
    object-fit: contain;
  }

  .note-editor {
    padding: 1.35rem;
  }

  .note-editor h2 {
    margin-bottom: 0.9rem;
    font-size: 1.4rem;
  }

  .note-editor textarea {
    min-height: 150px;
  }
}

@media (max-width: 480px) {
  .sorter-view {
    padding-right: 0.55rem;
    padding-left: 0.55rem;
  }

  .progress-shell {
    padding: 0 0.25rem;
  }

  .card-deck {
    width: min(100%, 355px);
    height: min(62dvh, 560px);
    min-height: 390px;
  }

  .deck-shadow {
    inset: 0.65rem;
    border-radius: 1.4rem;
  }

  .swipe-card,
  .completion-card {
    border-radius: 1.35rem;
  }

  .collection-badge {
    font-size: 0.47rem;
  }

  .card-meta h2 {
    max-width: 190px;
    font-size: 0.68rem;
  }

  .decision-controls {
    gap: 0.5rem;
  }

  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-summary button {
    padding: 0.7rem 0.75rem;
  }

  .inventory-card-copy h2 {
    font-size: 0.59rem;
  }

  .app-dialog {
    padding: 1.5rem;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  .topbar {
    min-height: 66px;
  }

  .sorter-view {
    padding-top: 0.65rem;
  }

  .progress-shell {
    margin-bottom: 0.55rem;
  }

  .card-deck {
    height: min(65vh, 540px);
    min-height: 450px;
  }

  .decision-controls {
    margin-top: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
