:root {
  --paper: #f7f5ef;
  --surface: #fff;
  --soft: #ebe9e1;
  --ink: #20231e;
  --muted: #70736b;
  --accent: #b64230;
  --green: #416b49;
  --amber: #ad7729;
  --line: #deddd6;
}
body.dark_mode {
  --paper: #171915;
  --surface: #22251f;
  --soft: #2a2e28;
  --ink: #ecece6;
  --muted: #aaada4;
  --accent: #c55b48;
  --green: #72a87b;
  --amber: #d1a253;
  --line: #393c36;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}
.topbar {
  height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font:
    500 21px "Fraunces",
    serif;
}
.topbar nav {
  display: flex;
  gap: 30px;
  margin-left: 9vw;
}
.topbar nav a {
  height: 72px;
  display: flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.topbar nav .active {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}
.profile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}
.profile span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  font-size: 11px;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 65px clamp(20px, 4vw, 64px) 110px;
}
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.page-head h1 {
  font:
    500 clamp(55px, 6vw, 82px) / 0.95 "Fraunces",
    serif;
  margin: 0 0 18px;
}
.page-head > div > p:last-child {
  color: var(--muted);
  margin: 0;
}
.page-actions {
  display: flex;
  gap: 10px;
}
.page-actions button,
.quick-form button {
  height: 44px;
  padding: 0 17px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.page-actions .secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.5fr;
  margin: 55px 0;
  border-block: 1px solid var(--line);
}
.summary > div {
  padding: 25px 2vw;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.summary > div:first-child {
  padding-left: 0;
}
.summary > div:last-child {
  border: 0;
}
.summary strong {
  font:
    500 31px "Fraunces",
    serif;
}
.summary span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.summary .value strong {
  color: var(--green);
}
.toolbar {
  display: grid;
  gap: 0;
}
.search-row {
  display: flex;
  gap: 10px;
}
.search {
  flex: 1;
  min-width: 0;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 14px inherit;
}
.filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 112px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 13px "DM Sans", sans-serif;
  cursor: pointer;
}
.filter-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.filter-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}
.filter-toggle[aria-expanded="true"] .filter-chevron {
  transform: translateY(2px) rotate(225deg);
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
}
.filters button,
.filters select {
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 12px inherit;
}
.filters button {
  cursor: pointer;
}
.filters button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.filters select.has-value {
  border-color: var(--accent);
  background-color: var(--accent);
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
.filters select {
  margin-left: auto;
}
.filters select + select {
  margin-left: 0;
}
.inventory {
  margin-top: 55px;
}
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px;
}
.section-title h2 {
  font:
    500 34px "Fraunces",
    serif;
  margin: 0;
}
.section-title span {
  color: var(--muted);
  font-size: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 28px;
}
.pantry-card {
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.pantry-card:hover,
.pantry-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 13px 32px #20231e16;
  outline: none;
}
.thumb {
  height: 190px;
  position: relative;
  overflow: hidden;
  background: var(--soft);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.65);
}
.status {
  position: absolute;
  top: 13px;
  left: 13px;
  padding: 6px 8px;
  background: var(--surface);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.status.in-stock {
  color: var(--green);
}
.status.low-stock {
  color: var(--amber);
}
.status.out-of-stock {
  color: var(--muted);
}
.card-copy {
  padding: 22px;
}
.card-copy > p {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.card-copy h3 {
  font:
    500 23px "Fraunces",
    serif;
  margin: 0;
}
.card-copy small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.card-copy > strong {
  display: block;
  margin: 22px 0 13px;
  font-size: 17px;
}
.card-copy > strong em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.card-copy > div {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  color: var(--muted);
  font-size: 10px;
}
.empty {
  text-align: center;
  padding: 70px;
}
.veil {
  display: none;
  position: fixed;
  inset: 0;
  background: #17191588;
  z-index: 40;
}
.veil.open {
  display: block;
}
.details {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(510px, 94vw);
  padding: 28px;
  background: var(--surface);
  color: var(--ink);
  z-index: 50;
  overflow: auto;
  transform: translateX(102%);
  transition: transform 0.3s;
  box-shadow: -10px 0 40px #1113;
}
.details.open {
  transform: none;
}
.close {
  float: right;
  width: 34px;
  height: 34px;
  border: 0;
  background: var(--soft);
  color: var(--ink);
  font-size: 0;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.close::before,
.close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}
.close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.detail-hero {
  height: 235px;
  margin: -28px -28px 30px;
  position: relative;
}
.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.details h2 {
  font:
    500 42px/1 "Fraunces",
    serif;
  margin: 0;
}
.brand-name {
  color: var(--muted);
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 28px 0;
  border-block: 1px solid var(--line);
}
.detail-stats div {
  display: grid;
  gap: 4px;
  padding: 17px 8px;
  border-right: 1px solid var(--line);
}
.detail-stats div:last-child {
  border: 0;
}
.detail-stats strong {
  font:
    500 16px "Fraunces",
    serif;
}
.detail-stats span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}
.detail-stats .no-history {
  color: var(--muted);
  opacity: 0.62;
}
.panel-edit {
  display: grid;
  gap: 22px;
}
.panel-edit h2,
.panel-edit h3,
.panel-edit p {
  margin: 0;
}
.panel-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.panel-edit-grid .wide {
  grid-column: 1 / -1;
}
.panel-edit .field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: default;
}
.panel-edit .field span {
  cursor: default;
  user-select: none;
}
.panel-edit input,
.panel-edit select {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  background-color: var(--paper);
  color: var(--ink);
  padding: 0 11px;
  font: 400 14px "DM Sans", sans-serif;
  text-transform: none;
}
.panel-edit-section {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.nutrient-editor {
  display: grid;
  gap: 8px;
}
.nutrient-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(75px, 0.7fr) 36px;
  gap: 7px;
}
.nutrient-edit-row button,
.add-nutrient,
.panel-edit-actions button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.add-nutrient {
  min-height: 38px;
}
.panel-edit-status {
  min-height: 18px;
  color: var(--accent);
  font-size: 12px;
}
.panel-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.panel-edit-actions button {
  min-height: 42px;
  padding: 0 18px;
}
.panel-edit-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.panel-edit-actions .delete-ingredient {
  margin-right: auto;
  border-color: #a43b30;
  color: #c95648;
}
.panel-edit-actions .delete-ingredient:hover,
.panel-edit-actions .delete-ingredient:focus-visible {
  background: #a43b30;
  color: #fff;
}
.delete-choice-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.delete-choice-dialog::backdrop {
  background: rgba(10, 12, 10, 0.68);
}
.delete-choice-dialog form {
  display: grid;
  gap: 14px;
  padding: 30px;
}
.delete-choice-dialog h2,
.delete-choice-dialog p {
  margin: 0;
}
.delete-choice-dialog h2 {
  font: 500 30px "Fraunces", serif;
}
.delete-choice-dialog form > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}
.delete-choice-dialog footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.delete-choice-dialog footer button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.delete-choice-dialog footer .danger {
  border-color: #a43b30;
  background: #a43b30;
  color: #fff;
}
.quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.quick button {
  height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.quick-form {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.7fr;
  margin: 12px 0 35px;
}
.quick-form input,
.quick-form select {
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.quick-form input[name="cost"] {
  grid-column: 1/3;
}
.quick-form button {
  height: 40px;
}
.nutrition,
.ledger {
  border-top: 1px solid var(--line);
  padding-top: 25px;
  margin-top: 25px;
}
.nutrition h3,
.ledger h3 {
  font:
    500 25px "Fraunces",
    serif;
}
.nutrition dl div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.nutrition dt {
  text-transform: capitalize;
}
.nutrition dd {
  margin: 0;
}
.nutrition small {
  color: var(--muted);
}
.ledger article {
  display: grid;
  grid-template-columns: 85px 1fr auto;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  font-size: 11px;
}
.ledger p {
  margin: 0;
}
.ledger time {
  color: var(--muted);
  font-size: 9px;
}
.tx {
  text-transform: uppercase;
  font-size: 9px;
  color: var(--green);
}
dialog {
  width: min(720px, 94vw);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 25px 80px #1115;
}
dialog::backdrop {
  background: #171915aa;
}
.import-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(680px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border-width: 0 0 0 1px;
  animation: import-panel-in 0.3s cubic-bezier(0.2, 0.72, 0.25, 1);
}
.import-panel::backdrop {
  animation: import-backdrop-in 0.25s ease;
}
.import-panel > section {
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@keyframes import-panel-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes import-backdrop-in {
  from {
    background: transparent;
  }
  to {
    background: #171915aa;
  }
}
@media (prefers-reduced-motion: reduce) {
  .import-panel,
  .import-panel::backdrop {
    animation: none;
  }
}
dialog form > header,
dialog > section {
  padding: 30px;
}
dialog form > header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
dialog h2 {
  font:
    500 36px "Fraunces",
    serif;
  margin: 0;
}
.form-grid {
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px;
}
.form-grid .field {
  display: grid;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: default;
}
.form-grid .field span {
  cursor: default;
  user-select: none;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.form-grid input,
.form-grid select {
  height: 42px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0 10px;
}
dialog form > footer {
  padding: 20px 30px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
dialog footer span {
  margin-right: auto;
  color: var(--accent);
}
dialog button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
dialog footer button:last-child {
  background: var(--accent);
  color: #fff;
}
.future-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.future-options article {
  padding: 20px;
  background: var(--soft);
}
.photo-dropzone {
  border: 1px dashed transparent;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease;
}
.photo-dropzone.dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--soft));
}
.photo-dropzone > button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.drop-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.photo-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.photo-thumbnails:empty {
  display: none;
}
.photo-thumbnails figure {
  position: relative;
  min-width: 0;
  margin: 0;
  cursor: zoom-in;
  outline: 0;
}
.photo-thumbnails figure:focus-visible img {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.photo-thumbnails img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
}
.photo-thumbnails figcaption {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-thumbnails figcaption small,
.photo-thumbnails figcaption a {
  display: block;
  margin-top: .2rem;
  font-size: .72rem;
}
.photo-thumbnails figcaption small { color: var(--muted); }
.photo-thumbnails figcaption a { color: var(--accent); }
.photo-thumbnails button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 72%, white);
  background: var(--accent);
  color: #fff;
  font-size: 0;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(90, 35, 25, 0.22);
  transition:
    transform 0.18s cubic-bezier(0.2, 0.72, 0.25, 1),
    box-shadow 0.18s ease,
    filter 0.18s ease;
}
.photo-thumbnails button::before,
.photo-thumbnails button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}
.photo-thumbnails button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.photo-thumbnails button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.photo-thumbnails button:hover,
.photo-thumbnails button:focus-visible {
  transform: translateY(-2px) scale(1.1) rotate(4deg);
  filter: brightness(1.12);
  box-shadow: 0 5px 12px rgba(90, 35, 25, 0.34);
}
.photo-thumbnails button:active {
  transform: translateY(0) scale(0.94);
}
.image-editor-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #101210;
}
.image-editor-dialog > section {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  padding: 0;
}
.image-editor-dialog header,
.image-editor-toolbar,
.image-editor-dialog footer {
  background: var(--surface);
  color: var(--ink);
}
.image-editor-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.image-editor-dialog header h2,
.image-editor-dialog header p {
  margin: 0;
}
.image-editor-dialog header h2 {
  font-size: 24px;
}
.image-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
}
.image-editor-toolbar button {
  min-width: 40px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.image-editor-toolbar output {
  min-width: 54px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.image-editor-toolbar .redact-toggle {
  margin-left: auto;
}
.image-editor-toolbar .redact-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.image-canvas-viewport {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(45deg, #171917 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(-45deg, #171917 25%, transparent 25%) 0 10px / 20px 20px,
    linear-gradient(45deg, transparent 75%, #171917 75%) 10px -10px / 20px 20px,
    linear-gradient(-45deg, transparent 75%, #171917 75%) -10px 0 / 20px 20px,
    #202320;
}
.image-editor-dialog canvas {
  display: block;
  max-width: none;
  background: #fff;
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.4);
  cursor: grab;
  touch-action: none;
}
.image-editor-dialog canvas.redacting {
  cursor: crosshair;
}
.image-editor-dialog footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}
.image-editor-dialog footer p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.image-editor-dialog footer button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.image-editor-dialog footer #applyImageRedactions {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
@media (max-width: 650px) {
  .image-editor-dialog header,
  .image-editor-toolbar,
  .image-editor-dialog footer {
    padding-inline: 14px;
  }
  .image-editor-dialog footer {
    flex-wrap: wrap;
  }
  .image-editor-dialog footer p {
    flex-basis: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .photo-thumbnails button {
    transition: none;
  }
}
.import-panel-actions {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.photo-actions {
  margin-top: 16px;
  padding-bottom: 0;
}
.ingredient-actions {
  position: sticky;
  bottom: -30px;
  z-index: 2;
  margin: 22px -30px -30px;
  padding: 16px 30px;
}
#adapterStatus {
  min-height: 1.4em;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.45;
}
.import-panel-actions button {
  min-width: 120px;
  min-height: 44px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.import-panel-actions button:disabled {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
}
.import-panel.reviewing .future-options {
  gap: 10px;
}
.import-panel.reviewing .future-options article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 12px;
}
.import-panel.reviewing .future-options article > p:not(.drop-hint),
.import-panel.reviewing .future-options article > button,
.import-panel.reviewing .drop-hint {
  display: none;
}
.import-panel.reviewing .future-options h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.import-panel.reviewing .photo-thumbnails {
  grid-template-columns: repeat(auto-fill, 52px);
  margin-top: 0;
}
.import-panel.reviewing .photo-thumbnails figcaption {
  display: none;
}
.import-panel.reviewing .photo-thumbnails button {
  width: 21px;
  height: 21px;
}
.import-panel.reviewing .photo-thumbnails button::before,
.import-panel.reviewing .photo-thumbnails button::after {
  width: 11px;
}
.import-results {
  margin-top: 24px;
}
.photo-quality-warnings {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--ink);
}
.photo-quality-warnings strong {
  color: var(--accent);
}
.photo-quality-warnings p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.photo-quality-warnings b {
  color: var(--ink);
}
.import-results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.import-results-heading h3,
.import-results-heading p {
  margin: 0;
}
.import-results-heading h3 {
  font: 500 28px "Fraunces", serif;
}
.import-results-heading span {
  color: var(--muted);
  font-size: 11px;
}
.import-pantry-rows {
  display: grid;
}
.import-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.import-result-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.import-result-row small {
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.import-result-row strong {
  font-size: 14px;
}
.import-result-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-result-row em {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resolution-candidates { display: grid; gap: .45rem; margin-top: .75rem; }
.resolution-candidates > b { color: var(--ink); font-size: .78rem; }
.resolution-candidates button { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.resolution-candidates button:hover { border-color: var(--accent); }
.resolution-candidates img { width: 2.75rem; height: 2.75rem; object-fit: contain; background: #fff; border-radius: .3rem; }
.resolution-candidates span, .resolution-candidates small { display: block; }
.import-row-actions {
  display: flex;
  gap: 6px;
}
.import-row-actions button {
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.import-row-actions [data-remove-import] {
  padding: 0;
  color: #c95648;
}
.receipt-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.status-pill {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.status-pill.tone-success {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green);
}
.status-pill.tone-warn {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
  color: var(--amber);
}
.status-pill.tone-fail {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}
.status-pill.tone-pending {
  animation: status-dot-pulse 1.4s ease-in-out infinite;
}
.import-receipt-tiles {
  display: grid;
  margin-top: 14px;
}
.product-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 2px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: none;
}
.product-tile-main {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.product-tile-main:hover strong {
  color: var(--accent);
}
.status-dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--muted);
}
.product-tile.tone-success .status-dot {
  background: var(--green);
}
.product-tile.tone-warn .status-dot {
  background: var(--amber);
}
.product-tile.tone-fail .status-dot {
  background: var(--accent);
}
.product-tile .status-dot.cache-hit {
  background: #000;
  box-shadow: 0 0 0 1px var(--line);
}
.status-dot.loading {
  animation: status-dot-pulse 1s ease-in-out infinite;
}
@keyframes status-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.product-tile.is-retrying .product-tile-main {
  pointer-events: none;
  opacity: 0.7;
}
.product-tile img,
.product-tile-thumb {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}
.product-tile-thumb {
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--muted);
  font: 600 14px "Fraunces", serif;
}
.product-tile-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.product-tile-body strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-tile-body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-tile-status {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.product-tile.tone-success .product-tile-status {
  color: var(--green);
}
.product-tile.tone-warn .product-tile-status {
  color: var(--amber);
}
.product-tile.tone-fail .product-tile-status {
  color: var(--accent);
}
.product-tile .import-row-actions {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}
.product-tile .resolution-candidates {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-left: 42px;
}
.receipt-exclusion-divider {
  width: 33%;
  margin: 28px auto;
  border: 0;
  border-top: 1px solid var(--line);
}
.product-tile.is-excluded {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  opacity: 0.55;
  filter: grayscale(0.3);
}
.product-tile.is-excluded:hover,
.product-tile.is-excluded:focus-visible {
  opacity: 0.9;
  filter: none;
  background: var(--soft);
}
.product-tile.is-excluded .product-tile-body {
  flex: 1;
  min-width: 0;
}
.product-tile-chevron {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.product-tile.is-excluded:hover .product-tile-chevron,
.product-tile.is-excluded:focus-visible .product-tile-chevron {
  opacity: 1;
}
@keyframes tile-exit-up {
  to { transform: translateY(-16px); opacity: 0; }
}
@keyframes tile-exit-down {
  to { transform: translateY(16px); opacity: 0; }
}
@keyframes tile-enter {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.product-tile.tile-exit-up {
  animation: tile-exit-up 0.22s ease forwards;
}
.product-tile.tile-exit-down {
  animation: tile-exit-down 0.22s ease forwards;
}
.product-tile.tile-enter {
  animation: tile-enter 0.25s ease;
}
.product-detail-dialog {
  width: min(560px, 94vw);
}
.product-detail-dialog > section {
  padding: 0;
}
.product-detail-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}
.product-detail-dialog header h2 {
  font-size: 24px;
}
.product-detail-body {
  padding: 22px 26px;
  max-height: 55vh;
  overflow-y: auto;
}
.detail-retry {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.detail-retry .field {
  flex: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: default;
}
.detail-retry .field span {
  cursor: default;
  user-select: none;
}
.detail-retry input {
  height: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0 10px;
  font: 400 14px "DM Sans", sans-serif;
  text-transform: none;
}
.detail-retry button {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.detail-retry button:hover {
  border-color: var(--accent);
}
.product-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.product-detail-table th,
.product-detail-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.product-detail-table th {
  width: 36%;
  padding-right: 12px;
  color: var(--muted);
  font-weight: 600;
}
.product-detail-table td a {
  color: var(--accent);
}
.product-detail-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
}
.product-detail-dialog footer .danger {
  margin-right: auto;
  color: #c95648;
}
@media (max-width: 900px) {
  .summary {
    grid-template-columns: repeat(3, 1fr);
  }
  .summary .value {
    grid-column: span 2;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  .filter-toggle {
    min-width: 92px;
    padding-inline: 12px;
  }
  .filters {
    left: 0;
    right: 0;
    width: 100%;
  }
  .filters button,
  .filters select {
    flex: 1 1 135px;
    margin-left: 0;
  }
  .topbar nav {
    display: none;
  }
  .profile strong {
    display: none;
  }
  .page-head {
    align-items: start;
    gap: 30px;
    flex-direction: column;
  }
  .summary {
    grid-template-columns: 1fr 1fr;
  }
  .summary .value {
    grid-column: span 2;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .filters select {
    margin-left: 0;
  }
  .future-options {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
}
button:not(:disabled),
a[href],
select:not(:disabled),
label[for],
[role="button"]:not([aria-disabled="true"]),
[role="link"]:not([aria-disabled="true"]),
[data-action],
[data-url] {
  cursor: pointer;
}
button:disabled,
select:disabled,
input:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}
body {
  cursor: default;
}
input:not([type]),
input[type="text"],
input[type="search"],
input[type="url"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
[contenteditable="true"] {
  cursor: text;
}
/* Compact pantry ledger rows. */
.summary {
  grid-template-columns: repeat(4, 1fr);
}
.grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  perspective: 900px;
}
.pantry-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 72px;
  overflow: visible;
  transform: translateZ(0);
  transform-origin: center;
  transition:
    transform 0.48s cubic-bezier(0.2, 0.72, 0.25, 1),
    box-shadow 0.48s cubic-bezier(0.2, 0.72, 0.25, 1),
    border-color 0.48s ease;
  background: var(--surface);
  position: relative;
}
.pantry-card:hover,
.pantry-card:focus-visible {
  transform: translateZ(18px) scale(1.012, 1.065);
  box-shadow: 0 14px 34px rgba(32, 35, 30, 0.16);
  z-index: 3;
}
.pantry-card.tilt-before {
  transform: perspective(900px) rotateX(-4deg) translateY(-3px) scale(0.995);
  transform-origin: bottom center;
}
.pantry-card.tilt-after {
  transform: perspective(900px) rotateX(4deg) translateY(3px) scale(0.995);
  transform-origin: top center;
}
.thumb {
  height: 72px;
  min-height: 72px;
}
.thumb img {
  filter: saturate(0.62);
  border-right: 1px solid var(--line);
}
.thumb .status {
  top: 6px;
  left: 6px;
  padding: 4px 5px;
  font-size: 7px;
}
.card-copy {
  min-width: 0;
  padding: 9px 16px;
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) minmax(130px, 0.65fr) minmax(
      220px,
      1fr
    );
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 22px;
}
.card-copy > p {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: 8px;
}
.card-copy h3 {
  grid-column: 1;
  grid-row: 2;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-copy small {
  display: none;
}
.card-copy > strong {
  grid-column: 2;
  grid-row: 1/3;
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
}
.card-copy > div {
  grid-column: 3;
  grid-row: 1/3;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 0;
  border-left: 1px solid var(--line);
  padding: 4px 0 4px 18px;
  font-size: 9px;
}
body.dark_mode .pantry-card:hover,
body.dark_mode .pantry-card:focus-visible {
  box-shadow: 0 15px 36px rgba(0, 0, 0, 0.36);
}
@media (max-width: 760px) {
  .card-copy {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .card-copy > div {
    display: none;
  }
  .card-copy > strong {
    grid-column: 2;
  }
  .summary {
    grid-template-columns: repeat(2, 1fr);
  }
}
.details > .close {
  float: none;
  display: grid;
  place-items: center;
  margin: 0 0 18px auto;
  position: relative;
  z-index: 1;
}
.details .detail-hero {
  margin: 0 -28px 38px;
}
.details .eyebrow {
  margin-top: 0;
}
.details h2 {
  line-height: 1.12;
  padding-top: 0.08em;
  overflow: visible;
}
