:root {
  color-scheme: light only;
  --green-950: #06351f;
  --green-900: #0a4b2d;
  --green-800: #0d7542;
  --green-700: #0f8a4d;
  --green-100: #e6f3eb;
  --green-50: #f4faf6;
  --gold-50: #fffaf0;
  --gold-200: #eddaa5;
  --red-700: #c82f3b;
  --red-100: #ffe6e9;
  --red-50: #fff7f8;
  --ink: #13231a;
  --muted: #6a766e;
  --line: #d9e4de;
  --soft-line: #edf2ef;
  --surface: #ffffff;
  --page: #eef4f0;
  --shadow-card: 0 10px 28px rgba(8, 58, 35, 0.07);
  --shadow-header: none;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(16, 131, 75, 0.16), transparent 22rem),
    linear-gradient(180deg, #f3f8f5 0, var(--page) 280px);
  background-color: var(--page);
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Shared invariant for every square/circular icon tile. Component text rules
   must never be able to push its glyph into a corner. */
.icon-tile {
  display: grid !important;
  margin: var(--icon-tile-margin, 0) !important;
  padding: 0;
  place-items: center !important;
  line-height: 1 !important;
  text-align: center;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(13, 117, 66, 0.24);
  outline-offset: 2px;
}

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

.app-header {
  position: sticky;
  z-index: 9;
  top: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 9px) 0 10px;
  color: white;
  overflow: visible;
  background:
    linear-gradient(180deg, #f3f8f5 0%, #eef4f0 72%, #eef4f0 100%);
  box-shadow: 0 1px 0 rgba(205, 221, 212, 0.78);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(780px, calc(100% - 28px));
  min-height: 82px;
  padding: 11px 12px;
  margin: 0 auto;
  /* The account popover is intentionally positioned below this card. */
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, #07351f 0%, #075735 56%, #0b7442 100%);
  box-shadow: var(--shadow-header);
}

.header-inner::before {
  content: none;
}

.header-inner > * {
  position: relative;
  z-index: 1;
}

.brand-cluster {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: white;
  overflow: hidden;
}

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

.title-block {
  min-width: 0;
}

.title-block h1,
.title-block p {
  margin: 0;
}

.eyebrow {
  color: #9ee6b7;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.title-block h1 {
  margin-top: 2px;
  overflow: hidden;
  font-size: 1.34rem;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-block > p:last-child {
  overflow: hidden;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: stretch;
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
}

.account-menu[open] {
  z-index: 12;
}

.account-menu summary {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  font-size: 1.08rem;
  font-weight: 900;
  list-style: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.account-menu summary::-webkit-details-marker { display: none; }

.account-popover {
  position: absolute;
  /* Start below the header card rather than covering the header itself. */
  top: calc(100% + 30px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 190px;
  max-width: min(260px, calc(100vw - 28px));
  padding: 8px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  box-shadow: 0 14px 30px rgba(6, 53, 30, 0.18);
}

.account-popover strong {
  padding: 8px 10px 10px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.account-popover a,
.account-popover button {
  display: flex;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 0 11px;
  align-items: center;
  color: var(--green-900);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.account-popover button { color: var(--red-700); }
.account-popover a:hover,
.account-popover button:hover { background: var(--green-50); }

.language-toggle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 42px;
  min-height: 42px;
  padding: 4px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.03em;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  -webkit-tap-highlight-color: transparent;
}

.language-toggle::before {
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 4px;
  width: calc(50% - 5.5px);
  height: 34px;
  content: "";
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 37, 21, 0.16);
  transform: translateX(0);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.language-toggle span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 34px;
  padding: 0;
  line-height: 1;
  border-radius: 999px;
  transition:
    color 180ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-language="az"] .language-toggle::before {
  transform: translateX(calc(100% + 3px));
}

:root[data-language="ru"] [data-lang-pill="ru"],
:root[data-language="az"] [data-lang-pill="az"] {
  color: var(--green-900);
  transform: none;
}

.button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.page-shell {
  width: min(780px, calc(100% - 28px));
  padding: 4px 0 102px;
  margin: 0 auto;
}

.form-section,
.sent-panel {
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.details-section {
  margin-top: 0;
}

.section-heading {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 15px 14px 10px;
  margin: 0;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading h2 {
  font-size: 1.08rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.section-number {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  border-radius: 11px;
  background: var(--green-800);
}

.optional-number {
  color: white;
  border: 0;
  background: var(--green-800);
}

.setup-card {
  display: grid;
  gap: 0;
  padding: 0 10px 10px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.setup-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 14px;
  gap: 11px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background: #fbfdfb;
}

.setup-row + .setup-row {
  border-top: 1px solid var(--soft-line);
}

.setup-row-wide {
  grid-column: auto;
}

.row-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  font-size: 1.24rem;
  border-radius: 10px;
  background: var(--green-50);
}

.pale-green,
.pale-yellow,
.pale-purple {
  background: var(--green-50);
}

.field-copy {
  min-width: 0;
}

.field-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.setup-row input,
.setup-row select {
  width: 100%;
  min-height: 29px;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 850;
  text-overflow: ellipsis;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
}

.setup-row input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  opacity: 0;
  cursor: pointer;
}

.setup-row input[type="date"] {
  display: block;
  text-align: left;
  direction: ltr;
}

.setup-row input[type="date"]::-webkit-date-and-time-value {
  min-height: 29px;
  margin: 0;
  text-align: left;
}

.setup-row input[type="date"]::-webkit-datetime-edit {
  display: block;
  padding: 0;
  text-align: left;
}

.chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #89958d;
  border-bottom: 2px solid #89958d;
  transform: rotate(-45deg);
}

.number-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px 14px;
}

.metric-card {
  display: block;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfb;
}

.metric-gold {
  border-color: var(--gold-200);
  background: var(--gold-50);
}

.metric-red {
  border-color: #efccd0;
  background: var(--red-50);
}

.metric-title {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}

.metric-title > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.metric-title > span:first-child {
  font-size: 1.05rem;
}

.input-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #d3ded8;
  border-radius: 10px;
  background: white;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  border: 0;
  outline: 0;
  background: transparent;
}

.input-wrap:focus-within,
.money-input:focus-within,
textarea:focus {
  border-color: #78b28d;
  box-shadow: 0 0 0 3px rgba(13, 117, 66, 0.1);
}

.unit,
.currency {
  padding-right: 12px;
  color: var(--green-800);
  font-size: 0.67rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric-red .unit {
  color: var(--red-700);
}

.calculation-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  margin: 0 14px 14px;
  border: 1px solid #cfe0d4;
  border-radius: 14px;
  background: var(--green-50);
}

.calculation-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  font-size: 1.05rem;
  border-radius: 11px;
  background: var(--green-800);
}

.calculation-copy > span,
.formula > span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.calculation-copy strong {
  display: block;
  margin-top: 1px;
  color: var(--green-800);
  font-size: 1.72rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.calculation-copy small {
  font-size: 0.88rem;
}

.formula {
  display: none;
}

.formula strong {
  display: block;
  margin-top: 5px;
  font-size: 0.86rem;
  white-space: nowrap;
}

.text-red {
  color: var(--red-700);
}

.text-green {
  color: var(--green-800);
}

.sales-grid {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.sales-section {
  max-height: 680px;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 340ms cubic-bezier(0.4, 0, 0.2, 1),
    margin-top 340ms cubic-bezier(0.4, 0, 0.2, 1),
    border-width 340ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 180ms ease,
    transform 260ms ease;
}

.sales-section.is-collapsed {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  border-width: 0;
}

.sales-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 0.56fr);
  gap: 6px 12px;
  align-items: center;
  min-width: 0;
  padding: 13px;
  border: 1px solid #cfded5;
  border-radius: 14px;
  background: #fbfffc;
}

.sales-damaged {
  border-color: #f0c8cd;
  background: var(--red-50);
}

.sales-title {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  margin: 0;
  font-size: 0.94rem;
  font-weight: 900;
}

.money-icon {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  border-radius: 8px;
  background: var(--green-800);
}

.sales-damaged .money-icon {
  background: var(--red-700);
}

.sales-helper {
  display: block;
  grid-column: 1;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.money-input {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d4dcd7;
  border-radius: 10px;
  background: white;
}

.money-input > span:first-child {
  padding-left: 11px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

.money-input input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 8px;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 900;
  text-align: right;
  border: 0;
  outline: 0;
  background: transparent;
}

.sales-card-total {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  border-top: 1px solid rgba(207, 222, 213, 0.7);
}

.sales-card-total strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.sales-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  margin: 0 14px 14px;
  color: var(--green-900);
  font-size: 0.86rem;
  border: 1px solid #cfe0d4;
  border-radius: 14px;
  background: var(--green-50);
}

.sales-summary strong {
  color: var(--green-800);
  font-size: 1.28rem;
  letter-spacing: -0.03em;
}

.sent-item-side .sale-pending {
  width: 100%;
  max-width: 180px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: right;
  white-space: normal;
  overflow-wrap: break-word;
}

.notes-field {
  display: block;
  padding: 0 14px 14px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 13px 14px;
  resize: vertical;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.42;
  border: 1px solid #d4dcd7;
  border-radius: 12px;
  outline: 0;
  background: white;
}

input::placeholder,
textarea::placeholder {
  color: #98a39c;
  font-weight: 450;
}

.field-error {
  display: none;
  margin-top: 5px;
  color: #ad1f2a;
  font-size: 0.69rem;
  font-weight: 760;
}

.field-error:not(:empty) {
  display: block;
}

[aria-invalid="true"] {
  outline: 2px solid rgba(200, 47, 59, 0.42) !important;
  outline-offset: 2px;
}

.form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 900;
  border-radius: 12px;
}

.button-secondary {
  color: var(--green-800);
  border: 1.5px solid #bcd6c7;
  background: white;
}

.button-primary {
  color: white;
  border: 0;
  background: linear-gradient(145deg, #119456, #0d7542);
  box-shadow: 0 10px 24px rgba(13, 117, 66, 0.22);
}

.button-danger {
  color: white;
  border: 0;
  background: linear-gradient(145deg, #e4444e, #bd202b);
}

.confirmation-dialog {
  width: min(480px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  border: 0;
  border-radius: 22px;
  background: white;
  box-shadow: 0 24px 70px rgba(0, 37, 21, 0.3);
}

.confirmation-dialog::backdrop {
  background: rgba(0, 38, 22, 0.6);
  backdrop-filter: blur(3px);
}

.confirmation-dialog form {
  padding: 22px;
}

.dialog-icon {
  --icon-tile-margin: 0 0 12px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  font-size: 1.5rem;
  border-radius: 15px;
  background: var(--green-100);
}

.danger-dialog .dialog-icon {
  background: var(--red-100);
}

.confirmation-dialog h2,
.confirmation-dialog p {
  margin: 0;
}

.confirmation-dialog h2 {
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

.confirmation-dialog p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.confirmation-dialog dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  padding: 13px;
  margin: 15px 0 0;
  border: 1px solid #cfe0d4;
  border-radius: 14px;
  background: var(--green-50);
}

.confirmation-dialog dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 760;
}

.confirmation-dialog dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: right;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 16px;
}

.dialog-actions .button {
  min-height: 50px;
  padding: 7px 12px;
  line-height: 1.2;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  min-height: 72px;
  padding: 7px max(12px, env(safe-area-inset-right))
    max(7px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-top: 1px solid rgba(205, 221, 212, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -14px 30px rgba(23, 34, 28, 0.08);
  backdrop-filter: blur(14px);
}

.nav-item {
  position: relative;
  display: grid;
  gap: 1px;
  width: min(160px, 31vw);
  min-height: 56px;
  place-items: center;
  padding: 4px 2px;
  color: #78847c;
  font-size: 0.66rem;
  font-weight: 850;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition:
    color 200ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item > .nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  line-height: 1;
  transition:
    color 200ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.nav-item > span:not(.nav-icon) {
  display: block;
}

.nav-item:is(.active, .is-active) {
  color: var(--green-800);
}

.nav-item:is(.active, .is-active)::before {
  position: absolute;
  top: 0;
  width: 42px;
  height: 3px;
  content: "";
  border-radius: 999px;
  background: var(--green-800);
}

.operator-nav-ink {
  display: none;
}

.nav-item b {
  position: absolute;
  top: 4px;
  left: calc(50% + 10px);
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: white;
  font-size: 0.58rem;
  border-radius: 50%;
  background: var(--red-700);
}

.toast {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 84px;
  left: 16px;
  width: fit-content;
  max-width: min(480px, calc(100% - 32px));
  padding: 11px 14px;
  margin: auto;
  color: white;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
  border-radius: 13px;
  background: #1f2924;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.toast.success {
  background: var(--green-800);
}

.toast.error {
  background: #ad1f2a;
}

.sent-panel {
  padding-bottom: 14px;
}

.fridge-panel {
  padding-bottom: 14px;
}

.fridge-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 0 14px 12px;
}

.fridge-metric {
  min-width: 0;
  padding: 11px;
  border: 1px solid #d8e8dd;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #f1f8f4);
}

.fridge-metric span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fridge-metric strong {
  display: block;
  margin-top: 4px;
  color: var(--green-800);
  font-size: 0.96rem;
  letter-spacing: -0.03em;
}

.fridge-list {
  display: grid;
  gap: 12px;
  padding: 0 14px;
}

.fridge-item {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfdfb;
  box-shadow: 0 10px 24px rgba(9, 64, 36, 0.055);
  animation: fridge-card-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fridge-item-header,
.fridge-item-sold {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.fridge-item-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  font-size: 1.45rem;
  border-radius: 14px;
  background: var(--green-50);
}

.fridge-item strong,
.fridge-item span:not(.icon-tile) {
  display: block;
}

.fridge-item strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fridge-item span:not(.icon-tile) {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.fridge-item b {
  color: var(--green-800);
  font-size: 0.9rem;
  white-space: nowrap;
}

.fridge-item-side {
  display: grid;
  gap: 5px;
  justify-items: end;
}

.fridge-item-side .fridge-age {
  display: inline-flex;
  min-height: 23px;
  margin: 0;
  padding: 4px 8px;
  align-items: center;
  color: #35624b;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid #cee2d5;
  border-radius: 999px;
  background: #edf7f0;
}

.fridge-weight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fridge-sale-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid #e2ece6;
}

.fridge-sale-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.fridge-sale-form input,
.fridge-sale-form select,
.fridge-sale-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  color: var(--ink);
  border: 1.5px solid #d0ddd5;
  border-radius: 12px;
  outline: 0;
  background: white;
}

.fridge-sale-form textarea {
  min-height: 72px;
  padding-top: 10px;
  resize: vertical;
}

.fridge-sale-form input:focus,
.fridge-sale-form select:focus,
.fridge-sale-form textarea:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(13, 117, 66, 0.12);
}

.fridge-input-with-unit {
  position: relative;
  display: block;
}

.fridge-input-with-unit input {
  padding-right: 72px;
}

.fridge-input-with-unit small {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--green-800);
  font-size: 0.67rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.fridge-notes-field,
.fridge-sale-form .button {
  grid-column: 1 / -1;
}

.fridge-subheading {
  margin: 8px 0 0;
  color: var(--green-900);
  font-size: 0.88rem;
}

.fridge-item-sold {
  background: #f6faf7;
}

@keyframes fridge-card-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sent-list {
  display: grid;
  gap: 10px;
  padding: 0 14px;
}

.sent-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(112px, 180px);
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfb;
}

.sent-item.cancelled {
  background: #fafafa;
}

.sent-item-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  font-size: 1.45rem;
  border-radius: 14px;
  background: var(--green-50);
}

.sent-item strong,
.sent-item span:not(.icon-tile) {
  display: block;
}

.sent-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sent-item span:not(.icon-tile) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.sent-item-side {
  display: grid;
  gap: 7px;
  justify-items: end;
  width: 100%;
  min-width: 0;
}

.sent-item-side > b {
  color: var(--green-800);
  font-size: 0.88rem;
  white-space: nowrap;
}

.report-cancel {
  padding: 7px 9px;
  color: #ad1f2a;
  font-size: 0.68rem;
  font-weight: 850;
  border: 1px solid #edb9bd;
  border-radius: 10px;
  background: #fff7f7;
}

.report-status {
  padding: 5px 9px;
  font-weight: 850;
  border-radius: 999px;
}

.cancelled-status {
  color: #9c2029 !important;
  background: #ffebed;
}

.pending-status {
  color: #8a5c00 !important;
  background: #fff2c7;
}

.sent-item.duplicate {
  border-color: #e9c8cb;
  background: #fffafa;
}

.duplicate-status {
  color: #9c2029 !important;
  text-align: center;
  background: #ffebed;
}

.duplicate-pending-status {
  color: #835800 !important;
  text-align: center;
  background: #fff2c7;
}

.duplicate-dialog {
  width: min(560px, calc(100% - 24px));
}

.duplicate-dialog .dialog-icon.warning {
  background: #fff2c7;
}

.duplicate-matches {
  display: grid;
  gap: 8px;
  max-height: 230px;
  margin-top: 15px;
  overflow: auto;
}

.duplicate-match-card {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #d8e4dc;
  border-radius: 13px;
  background: #f8fbf9;
  animation: duplicate-card-in .24s cubic-bezier(.22,1,.36,1) both;
}

.duplicate-match-heading {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
}

.duplicate-match-heading strong {
  min-width: 0;
  overflow: hidden;
  font-size: .86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-match-card > span {
  color: var(--muted);
  font-size: .72rem;
}

.duplicate-match-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: #765300;
  font-size: .65rem;
  font-weight: 850;
  border-radius: 999px;
  background: #fff0bf;
}

.duplicate-match-badge.exact {
  color: #9d222b;
  background: #ffebed;
}

.duplicate-reason-field {
  display: grid;
  gap: 6px;
  margin-top: 15px;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 850;
}

.duplicate-reason-field textarea {
  width: 100%;
  min-height: 82px;
  padding: 10px 11px;
  resize: vertical;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  line-height: 1.4;
  border: 1px solid #cbdad1;
  border-radius: 12px;
  outline: 0;
  background: #fff;
}

.duplicate-reason-field textarea:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(13, 117, 66, .13);
}

.duplicate-reason-field small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 650;
}

.duplicate-reason-error {
  min-height: 18px;
  margin-top: 4px !important;
  color: #ad1f2a !important;
  font-size: .72rem !important;
  font-weight: 800;
}

@keyframes duplicate-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-state {
  color: #ad1f2a;
}

.empty-state {
  padding: 28px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

@media (max-width: 560px) {
  .header-inner,
  .page-shell {
    width: calc(100% - 20px);
  }

  .app-header {
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 0 8px;
  }

  .header-inner {
    min-height: 68px;
    padding: 9px 10px;
    border-radius: 18px;
  }

  .brand-cluster {
    flex: 1 1 auto;
    gap: 8px;
    max-width: calc(100% - 118px);
    min-width: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .eyebrow {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
  }

  .title-block h1 {
    max-width: none;
    font-size: 1.12rem;
    line-height: 1.05;
  }

  .title-block > p:last-child {
    display: none;
  }

  .header-actions {
    flex: 0 0 auto;
    gap: 5px;
    align-items: center;
  }

  .language-toggle {
    width: 66px;
    height: 38px;
    min-height: 38px;
    padding: 3px;
    font-size: 0.58rem;
  }

  .account-menu summary {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .language-toggle::before {
    top: 3px;
    left: 3px;
    width: calc(50% - 4.5px);
    height: 32px;
  }

  .language-toggle span {
    flex: 1 1 0;
    min-width: 0;
    height: 32px;
    padding: 0;
  }

  .page-shell {
    padding-top: 4px;
  }

  .form-section {
    margin-top: 16px;
  }

  .details-section {
    margin-top: 0;
  }

  .calculation-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

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

  .form-actions .button-primary {
    grid-row: 1;
  }

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

  .fridge-item-header,
  .fridge-item-sold {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
  }

  .fridge-item-header > .fridge-item-side,
  .fridge-item-sold > b {
    grid-column: 2;
  }

  .fridge-item-side {
    grid-auto-flow: column;
    align-items: center;
    justify-content: space-between;
    justify-items: start;
    width: 100%;
  }

  .fridge-sale-form {
    grid-template-columns: 1fr;
  }

  .fridge-sale-form .button-primary {
    grid-row: auto;
  }

  .sent-item {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
  }

  .sent-item-side {
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    justify-content: space-between;
    justify-items: start;
    width: 100%;
    min-width: 0;
  }

  .sent-item-side .sale-pending {
    max-width: none;
    text-align: left;
  }
}

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

  .metric-card {
    display: block;
  }

  .metric-title {
    margin-bottom: 8px;
  }

  .metric-card .field-error {
    grid-column: auto;
  }

  .sales-card {
    grid-template-columns: 1fr;
  }

  .money-input {
    grid-row: auto;
    grid-column: 1;
  }

  .sales-helper {
    grid-column: 1;
  }

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

  .dialog-actions .button-primary,
  .dialog-actions .button-danger {
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sales-section,
  .language-toggle::before,
  .language-toggle span {
    transition: none;
  }
  .duplicate-match-card {
    animation: none;
  }
}
