@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600&display=swap');

:root {
    color-scheme: light;
    --bg: #edf3ee;
    --bg-deep: #dce8df;
    --card: rgb(255 255 255 / 92%);
    --card-border: rgba(107, 136, 113, 0.2);
    --text: #1f382b;
    --muted: #4f4d4d;
    --brand: #3c8140;
    --brand-strong: #4f6e56;
    --brand-soft: rgba(111, 143, 113, 0.12);
    --accent: #87a98c;
    --section-bg: #ffffff00;
    --section-border: #b8cbbb;
    --item-bg: rgba(255, 255, 255, 0.97);
    --danger: #bc1313;
    --danger-soft: rgba(194, 80, 80, 0.18);
    --shadow: 0 16px 32px rgb(66 95 73 / 21%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Barlow', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(153, 190, 161, 0.22), transparent 24%),
    linear-gradient(180deg, #f6faf6 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

body {
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

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

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #8eae90 0%, var(--brand) 100%);
  color: #fbfdfb;
  cursor: pointer;
  min-height: 2.9rem;
  padding: 0.75rem 1.1rem;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 10px 20px rgba(79, 110, 86, 0.18);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

button:hover {
  filter: saturate(1.03);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  padding: 0.9rem 1rem;
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand-strong) 50%),
    linear-gradient(135deg, var(--brand-strong) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 1.1rem 1rem 2rem;
}

.topbar {
  margin-bottom: 0.75rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-copy {
  display: grid;
  gap: 0.2rem;
}

.app-logo {
  width: auto;
  height: clamp(2.55rem, 9vw, 3.3rem);
  display: block;
}

.small {
  min-height: 2.25rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.92rem;
}

.toolbar,
.panel-header,
.modal-header,
.setting-row,
.setting-actions,
.item-surface {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toolbar {
  min-width: 0;
  margin-bottom: 0.0rem;
}

.list-tabs {
  display: flex;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
}

.tab {
  min-height: 2.55rem;
  padding: 0.6rem 1rem;
  white-space: nowrap;
  color: var(--brand-strong);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(107, 136, 113, 0.18);
  box-shadow: none;
}

.tab.active {
  color: #fbfdfb;
  background: linear-gradient(180deg, #86a989 0%, var(--brand) 100%);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-card {
  margin-top: 1.5rem;
}

.app-shell,
.list-panel,
.stack,
.items-view,
.section-block,
.section-items,
.modal-body,
.modal-form,
.setting-copy,
.page-footer-actions {
  display: grid;
  gap: 0.85rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h2,
p,
strong,
label {
  margin: 0;
}

h2 {
  font-size: clamp(1.35rem, 5vw, 1.85rem);
}

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

.status {
  margin: 0.75rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 4px;
  background: rgba(135, 169, 140, 0.18);
  color: var(--brand-strong);
  border: 1px solid rgba(107, 136, 113, 0.16);
}

.status.error {
  background: rgba(194, 80, 80, 0.14);
  color: #812f2f;
  border-color: rgba(194, 80, 80, 0.18);
}

.panel-header {
  justify-content: space-between;
}

.item-form {
  display: grid;
  gap: 0.75rem;
}

.item-form-meta {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 0.75rem;
}

.item-input-wrap {
  position: relative;
}

.suggestions-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
  border: 1px solid rgba(107, 136, 113, 0.16);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(66, 95, 73, 0.16);
}

.suggestion-option {
  min-height: 2.5rem;
  justify-content: flex-start;
  padding: 0.65rem 0.8rem;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.suggestion-option:hover {
  background: var(--brand-soft);
  filter: none;
}

.add-button,
.action-button,
.edit-button {
  min-height: 3rem;
}

.add-button {
  width: 100%;
}

.page-footer-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.15rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.45rem 0.0rem;
  border-radius: 4px;
  background: var(--section-bg);
  border: 0px solid var(--section-border);
  color: var(--text);
  box-shadow: none;
}

.section-header:hover,
.ghost:hover {
  box-shadow: none;
}

.section-name {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-unchecked {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 200px;
  background: rgb(203 196 196 / 45%);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.section-unchecked.alert {
  color: var(--danger);
}

.item-row {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  touch-action: pan-y;
}

.swipe-delete-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1rem;
  color: #fff7f7;
  background: linear-gradient(90deg, rgba(194, 80, 80, 0.12), rgba(197, 64, 64, 0.85));
}

.swipe-delete-bg span {
  font-size: 0.88rem;
  font-weight: 700;
}

.item-surface {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgb(7 82 7 / 10%);
  border-radius: 4px;
  background: var(--item-bg);
}

.item-meta {
  display: grid;
  gap: 0.08rem;
  align-content: center;
  min-width: 0;
}

.item-name {
  font-weight: 700;
  line-height: 1.1;
  word-break: break-word;
}

.item-name.bought {
  text-decoration: line-through;
  text-decoration-thickness: 0.11em;
  text-decoration-color: rgba(68, 89, 74, 0.72);
}

.item-subtle {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.1;
}

.state-button {
  width: 2.65rem;
  height: 2.65rem;
  min-height: 2.65rem;
  padding: 0;
  border-radius: 200px;
  box-shadow: none;
}

.state-button.pending {
  color: var(--brand-strong);
  background: rgba(111, 143, 113, 0.14);
}

.state-button.bought {
  background: linear-gradient(180deg, #8cac90 0%, var(--brand) 100%);
}

.state-button.uncertain {
  color: #7f4f17;
  background: rgb(252 174 50 / 76%);
}


.item-actions {
  display: flex;
  align-items: center;
}

.edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  min-width: 2.4rem;
  padding: 0.4rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--brand-strong);
}

.edit-button:hover,
.edit-button:active {
  background: transparent;
  box-shadow: none;
  filter: none;
}

.edit-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  object-fit: contain;
}

.ghost {
  color: var(--brand-strong);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(107, 136, 113, 0.18);
  box-shadow: none;
}

.danger {
  color: var(--danger);
  border-color: rgba(194, 80, 80, 0.22);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(42, 60, 45, 0.28);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.modal-card {
  width: min(100%, 540px);
  max-height: min(88vh, 760px);
  overflow: auto;
}

.modal-header {
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.setting-row {
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(107, 136, 113, 0.13);
}

.setting-copy {
  gap: 0.25rem;
}

.setting-actions,
.modal-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.modal-actions {
  justify-content: flex-end;
}

.empty-state {
  padding: 1rem 0.35rem;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 719px) {
  .shell {
    padding-inline: 0.85rem;
  }

  .card {
    padding: 1rem;
    border-radius: 4px;
  }

  .brand-row {
    align-items: center;
  }

  .app-logo {
    height: clamp(2.35rem, 10vw, 3rem);
  }

  .item-surface {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.4rem 0.65rem;
  }

  .item-actions {
    justify-content: flex-end;
  }

  .state-button {
    width: 2.4rem;
    height: 2.4rem;
    min-height: 2.4rem;
  }

  .edit-button {
    min-height: 2.4rem;
    width: 2.2rem;
    min-width: 2.2rem;
    padding: 0.35rem;
  }

  .item-subtle {
    font-size: 0.82rem;
    line-height: 1.05;
  }

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



