:root {
  --lemon: #f3ff48;
  --lemon-soft: #f7ff7b;
  --olive: #26351f;
  --olive-2: #344229;
  --eucalyptus: #c9d9bf;
  --cream: #fbf8ec;
  --ink: #14161d;
  --muted: #6c7565;
  --danger: #8b5f4d;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --tap: 44px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 14px 36px rgb(0 0 0 / 14%);
  --hairline: inset 0 0 0 1px rgb(20 22 29 / 8%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--eucalyptus);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--eucalyptus);
}

body {
  background: var(--eucalyptus);
}

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

button {
  cursor: pointer;
}

.icon-sprite {
  display: none;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  flex: 0 0 auto;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(var(--space-2) + env(safe-area-inset-top)) var(--space-3) calc(104px + env(safe-area-inset-bottom));
  background: var(--eucalyptus);
  position: relative;
  overflow: hidden;
}

.screen {
  display: grid;
  gap: var(--space-3);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: var(--space-3);
  padding-top: 0;
}

.topbar.with-back {
  grid-template-columns: var(--tap) 1fr;
}

.topbar h1,
.login-card h1 {
  margin: 0;
  color: var(--olive);
  font-family: Impact, "Arial Narrow", "Roboto Condensed", sans-serif;
  font-size: clamp(30px, 8.5vw, 40px);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 var(--space-1);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-button {
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--lemon);
  background: var(--olive);
}

.icon-button.small {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.icon-button.accent,
.primary-button,
.mini-button.accent {
  background: var(--lemon);
  color: var(--ink);
}

.icon-button.ghosted {
  color: var(--olive);
  background: rgb(255 255 255 / 35%);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 406px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: 22px;
  background: #070807;
  box-shadow: var(--shadow);
  z-index: 20;
}

.bottom-nav button {
  height: 56px;
  border: 0;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  gap: var(--space-1);
  color: var(--cream);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.bottom-nav .icon {
  width: 28px;
  height: 28px;
}

.bottom-nav button.active {
  color: var(--ink);
  background: var(--lemon);
}

.home-stack,
.shopping-stack,
.settings-stack,
.detail-panel {
  display: grid;
  gap: var(--space-3);
}

.storage-hero {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-flow: row;
  gap: var(--space-3);
  margin: 0;
  overflow: visible;
  padding: 0;
  width: 100%;
}

.storage-card {
  width: 100%;
  min-height: 124px;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 72%), transparent 58%),
    var(--location-color);
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: var(--space-3);
  align-items: center;
  justify-items: stretch;
  text-align: left;
  color: var(--olive);
  box-shadow: var(--hairline);
}

.storage-card-icon,
.item-main-icon,
.row-icon,
.detail-icon {
  display: grid;
  place-items: center;
  color: var(--lemon);
  background: var(--olive);
  border-radius: 999px;
}

.storage-card-icon {
  width: 52px;
  height: 52px;
  font-size: 26px;
}

.storage-card h2,
.panel h2,
.detail-hero h2,
.form-panel h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.storage-card h2 {
  font-size: 22px;
}

.storage-card p {
  margin: 2px 0 4px;
  font-weight: 800;
  color: rgb(38 53 31 / 72%);
  font-size: 12px;
}

.storage-card .pill-button {
  grid-column: 1 / -1;
  min-height: 40px;
  width: 100%;
  padding: 0 var(--space-3);
  font-size: 13px;
}

.pill-button,
.primary-button,
.text-button,
.mini-button {
  border: 0;
  font-weight: 900;
}

.pill-button {
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border-radius: 999px;
}

.pill-button.dark {
  color: var(--cream);
  background: var(--olive);
}

.pill-button.light {
  color: var(--ink);
  background: var(--cream);
}

.pill-button.danger {
  color: var(--cream);
  background: var(--danger);
}

.primary-button {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  padding: 0 var(--space-5);
  font-size: 16px;
}

.primary-button:disabled {
  opacity: 0.45;
}

.text-button {
  padding: 0;
  color: inherit;
  background: transparent;
}

.search-box {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: var(--space-2);
  min-height: 50px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  color: var(--olive);
  background: var(--cream);
}

.search-box input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.panel {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--hairline);
}

.suggested-panel {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.suggested-panel .section-heading {
  margin-bottom: var(--space-2);
}

.compact-panel .suggestion:last-child {
  margin-bottom: 0;
}

.panel.olive {
  color: var(--cream);
  background: var(--olive);
}

.panel.pale {
  color: var(--ink);
  background: var(--cream);
}

.muted {
  color: rgb(255 255 255 / 64%);
}

.panel.pale .muted {
  color: var(--muted);
}

.search-results-panel h2 {
  margin: 0 0 var(--space-4);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.low-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
}

.low-strip span {
  white-space: nowrap;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  color: var(--ink);
  background: var(--lemon);
  font-weight: 900;
}

.home-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.home-summary article {
  min-height: 76px;
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: grid;
  align-content: center;
  gap: var(--space-1);
  color: var(--cream);
  background: var(--olive);
  box-shadow: var(--hairline);
}

.home-summary b {
  color: var(--lemon);
  font-size: 24px;
  line-height: 1;
}

.home-summary span {
  font-size: 11px;
  font-weight: 900;
  color: rgb(251 248 236 / 72%);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.item-card {
  position: relative;
  min-height: 126px;
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 78%), rgb(255 255 255 / 45%)),
    var(--card-accent);
}

.item-card.low {
  box-shadow: inset 0 0 0 3px var(--lemon);
}

.item-location {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--cream);
  background: var(--olive);
}

.item-main-icon {
  width: 40px;
  height: 40px;
  margin-bottom: auto;
  font-size: 21px;
}

.item-name {
  margin-top: var(--space-2);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.08;
}

.item-meta,
.remaining {
  margin-top: 2px;
  color: rgb(20 22 29 / 68%);
  font-size: 12px;
  font-weight: 800;
}

.item-rows {
  display: grid;
  gap: var(--space-2);
}

.item-row,
.settings-row {
  min-height: var(--tap);
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  text-align: left;
  color: var(--ink);
  background: var(--cream);
}

.suggestion {
  min-height: 62px;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  align-items: center;
  color: var(--ink);
  background: var(--cream);
}

.item-row.low {
  outline: 3px solid var(--lemon);
}

.row-icon {
  width: 34px;
  height: 34px;
}

.item-row small,
.suggestion small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.row-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 900;
}

.segmented {
  display: flex;
  padding: var(--space-1);
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
}

.segmented button {
  border: 0;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 var(--space-3);
  color: var(--cream);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.segmented button.active {
  color: var(--ink);
  background: var(--lemon);
}

.detail-hero {
  min-height: 220px;
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  color: var(--olive);
  background:
    linear-gradient(140deg, rgb(243 255 72 / 82%), transparent 46%),
    var(--card-accent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.detail-hero .edit {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}

.detail-icon {
  width: 58px;
  height: 58px;
  margin-bottom: var(--space-3);
  font-size: 29px;
}

.detail-title-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.detail-title-row h2 {
  margin: 0;
  color: var(--olive);
  font-size: 26px;
  line-height: 1;
}

.detail-title-row span {
  margin-bottom: 2px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--cream);
  background: var(--olive);
  font-size: 11px;
  font-weight: 950;
}

.detail-primary-meta {
  margin: var(--space-1) 0 0;
  font-size: 16px;
  font-weight: 900;
}

.detail-meta-grid {
  margin-top: var(--space-3);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-1);
}

.detail-meta-grid span {
  min-width: 0;
  border-radius: 10px;
  padding: 7px 9px;
  display: grid;
  gap: 1px;
  overflow: hidden;
  color: var(--olive);
  background: rgb(251 248 236 / 46%);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.detail-meta-grid small {
  color: rgb(38 53 31 / 68%);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-meta-grid b {
  font-size: 13px;
}

.amount-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.amount-buttons button {
  min-height: var(--tap);
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--cream);
  font-size: 13px;
  font-weight: 950;
}

.amount-buttons button.active {
  background: var(--lemon);
}

.secondary-actions,
.split-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.form-panel {
  display: grid;
  gap: var(--space-3);
}

.inline-editor {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgb(38 53 31 / 8%);
}

.panel.olive .inline-editor {
  background: rgb(255 255 255 / 10%);
}

.notice-panel {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  color: var(--ink);
  background: var(--lemon);
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.field {
  display: grid;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  background: rgb(38 53 31 / 8%);
}

.field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dark-field {
  background: rgb(255 255 255 / 10%);
}

.dark-field span,
.dark-field input {
  color: var(--cream);
}

.optional-details {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: rgb(38 53 31 / 8%);
}

.optional-details summary {
  font-weight: 950;
}

.optional-details[open] {
  display: grid;
  gap: var(--space-3);
}

.optional-details[open] > * + * {
  margin-top: var(--space-3);
}

.suggestion {
  margin-bottom: var(--space-2);
}

.remaining-pill {
  min-width: 44px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--lemon);
  font-size: 12px;
  font-weight: 950;
}

.suggestion-actions {
  display: inline-flex;
  gap: var(--space-1);
}

.count-pill,
.mini-button {
  min-width: 40px;
  min-height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--cream);
}

.shopping-list {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.shopping-item {
  min-height: 52px;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  display: grid;
  grid-template-columns: 30px 36px 1fr 40px;
  gap: var(--space-2);
  align-items: center;
  color: var(--ink);
  background: rgb(38 53 31 / 8%);
  font-weight: 950;
}

.shopping-item.done {
  background: var(--lemon-soft);
}

.shopping-check {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}

.shopping-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: transparent;
  background: var(--cream);
  box-shadow: inset 0 0 0 2px rgb(38 53 31 / 28%);
}

.shopping-check input:checked + .check-box {
  color: var(--ink);
  background: var(--lemon);
  box-shadow: none;
}

.shopping-item .danger-icon {
  width: 36px;
  height: 36px;
}

.settings-row {
  grid-template-columns: 1fr auto;
  margin: var(--space-2) 0;
  font-weight: 900;
}

.settings-actions {
  display: inline-flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

.danger-icon {
  color: var(--cream);
  background: var(--danger);
}

.settings-row span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.settings-row small {
  color: var(--muted);
}

.household-panel {
  display: grid;
  gap: var(--space-3);
}

.household-tool {
  color: var(--cream);
}

.household-tool .section-heading h2 {
  color: var(--cream);
}

.admin-account-card {
  min-height: 58px;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--space-3);
  align-items: center;
  color: var(--ink);
  background: var(--cream);
}

.admin-account-card > span {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--lemon);
  background: var(--olive);
}

.admin-account-card b,
.admin-account-card small {
  display: block;
}

.admin-account-card small,
.admin-note {
  color: rgb(251 248 236 / 72%);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.admin-account-card small {
  color: var(--muted);
}

.admin-note {
  margin: 0;
}

.logout-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: var(--cream);
  background: var(--danger);
  font-weight: 950;
}

.settings-editor {
  box-shadow: none;
}

.color-grid,
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.color-swatch,
.icon-swatch {
  min-width: 0;
}

.color-swatch input,
.icon-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-swatch span {
  width: 36px;
  height: 36px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 999px;
  display: block;
  background: var(--swatch);
  box-shadow:
    inset 0 0 0 1px rgb(20 22 29 / 12%),
    0 2px 8px rgb(0 0 0 / 8%);
}

.color-swatch input:checked + span {
  box-shadow:
    inset 0 0 0 3px var(--olive),
    inset 0 0 0 6px rgb(255 255 255 / 70%);
}

.icon-swatch span {
  width: 42px;
  height: 42px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--lemon);
  background: var(--olive);
  box-shadow: inset 0 0 0 1px rgb(20 22 29 / 12%);
  font-size: 25px;
}

.icon-swatch input:checked + span {
  color: var(--ink);
  background: var(--lemon);
  box-shadow: inset 0 0 0 3px var(--olive);
}

.login-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--eucalyptus);
}

.login-card {
  width: min(100%, 390px);
  border-radius: 28px;
  padding: var(--space-4);
  display: grid;
  gap: var(--space-4);
  background: var(--cream);
  box-shadow: var(--shadow);
}

.login-card form {
  display: grid;
  gap: var(--space-3);
}

.login-card .field {
  padding: var(--space-3);
}

.login-card .primary-button {
  margin-top: var(--space-1);
}

.login-card .muted {
  color: var(--muted);
}

.login-card img {
  width: 100%;
  border-radius: var(--radius-lg);
}

@media (min-width: 700px) {
  .phone-shell {
    min-height: calc(100svh - 48px);
    margin-top: 24px;
    margin-bottom: 24px;
    border-radius: 36px;
  }
}
