:root {
  color: #173127;
  background: #f4f1e8;
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 186, 73, 0.22), transparent 34rem),
    linear-gradient(160deg, #fbf8ef 0%, #edf3e9 100%);
}

main {
  width: min(44rem, 100%);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: #6d735e;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-header,
.section-heading,
.form-row,
.list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.page-header {
  align-items: end;
  margin-bottom: 1.5rem;
}

.header-status {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 0.45rem;
  margin-left: auto;
}

.debug-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: #6d735e;
  font-size: 0.72rem;
  font-weight: 650;
}

.debug-toggle input {
  width: 1rem;
  min-height: 1rem;
  margin: 0;
  accent-color: #276748;
}

.debug-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.connection {
  flex: 0 0 auto;
  border: 1px solid #c8c7b8;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  color: #6d735e;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 750;
}

.connection.live {
  border-color: #8ab79a;
  color: #22643d;
  background: #e3f2e6;
}

.panel {
  margin-bottom: 1rem;
  border: 1px solid rgba(85, 91, 75, 0.18);
  border-radius: 1.25rem;
  padding: 1.15rem;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1rem 3rem rgba(62, 72, 58, 0.08);
  backdrop-filter: blur(1rem);
}

.login-panel {
  max-width: 34rem;
  margin-inline: auto;
}

label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  font-weight: 750;
}

input,
button {
  min-height: 2.85rem;
  border-radius: 0.8rem;
  font: inherit;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid #c8c7b8;
  padding: 0.65rem 0.8rem;
  color: #173127;
  background: #fffef9;
  outline: none;
}

input:focus {
  border-color: #2f7450;
  box-shadow: 0 0 0 0.2rem rgba(47, 116, 80, 0.14);
}

button {
  border: 0;
  padding: 0.65rem 1rem;
  color: #fff;
  background: #276748;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #1e553a;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

.form-row input {
  flex: 1 1 auto;
}

.items {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.25rem;
  border-top: 1px solid #e4e2d7;
}

.item:first-child {
  border-top: 0;
}

.item input {
  width: 1.35rem;
  min-height: 1.35rem;
  accent-color: #276748;
}

.item-name {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  font-weight: 650;
}

.item.checked .item-name {
  color: #8b8b7e;
  text-decoration: line-through;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.quantity-button {
  min-height: 2.25rem;
  min-width: 2.25rem;
  padding: 0.25rem;
  color: #365748;
  background: #e4ece5;
}

.quantity-button:hover {
  background: #d7e4d9;
}

.quantity-value {
  min-width: 2.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: center;
}

.icon-button {
  min-height: 2.25rem;
  padding: 0.3rem 0.55rem;
  color: #6f6259;
  background: transparent;
}

.icon-button:hover {
  color: #7b3228;
  background: #f6e8e3;
}

.empty {
  margin: 1.5rem 0 0.5rem;
  color: #777869;
  text-align: center;
}

.list-actions {
  margin-top: 1rem;
  justify-content: flex-end;
}

.secondary {
  color: #365748;
  background: #e4ece5;
}

.secondary:hover {
  background: #d7e4d9;
}

.shortcuts {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

.shortcut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
}

.shortcut-add {
  min-width: 0;
  overflow: hidden;
  color: #3e4e31;
  background: #f1e8c8;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut-add:hover {
  background: #e9dba8;
}

.compact {
  padding-top: 0.9rem;
  border-top: 1px solid #e4e2d7;
}

.message {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin: auto;
  border-radius: 0.8rem;
  padding: 0.7rem 1rem;
  color: #fff;
  background: #7b3228;
  box-shadow: 0 0.8rem 2rem rgba(52, 25, 20, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: 160ms ease;
}

.message.visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 34rem) {
  main {
    padding-top: 1.25rem;
  }

  .page-header {
    align-items: start;
  }

  .header-status {
    align-items: end;
  }

  .form-row {
    align-items: stretch;
  }

  .form-row button {
    flex: 0 0 auto;
  }

  .item {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.4rem;
  }

  .item .icon-button {
    grid-column: auto;
  }

  .quantity {
    grid-column: auto;
    grid-row: auto;
    gap: 0;
  }

  .quantity-button {
    min-width: 2rem;
    min-height: 2rem;
  }

  .quantity-value {
    min-width: 1.6rem;
    font-size: 0.9rem;
  }
}
