:root {
  --brand-navy: #142a57;
  --brand-navy-strong: #0d2149;
  --brand-aqua: #1db8d9;
  --brand-aqua-soft: #dff8fd;
  --brand-lime: #a8df3e;
  --brand-lime-soft: #f3fbe2;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-muted: #f5fbfd;
  --border: #c8deea;
  --border-strong: #a7cbdf;
  --text: #17304f;
  --text-muted: #4f6981;
  --shadow: rgba(20, 42, 87, 0.12);
  --focus-ring: rgba(29, 184, 217, 0.2);
}

html {
  min-height: 100%;
  background: #fffaf2;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: transparent;
  isolation: isolate;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top right, rgba(168, 223, 62, 0.28), transparent 30%),
    radial-gradient(circle at left top, rgba(29, 184, 217, 0.2), transparent 32%),
    linear-gradient(180deg, #eefafd 0%, #f9feff 46%, #ffffff 100%);
  pointer-events: none;
}

body.has-list-modal-open {
  overflow: hidden;
}

main {
  flex: 1;
  padding: 0 2rem 2rem;
}


.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2rem 2rem 1.5rem;
}

.app-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--brand-navy);
  text-decoration: none;
}

.app-wordmark-logo {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 1rem;
  flex: 0 0 auto;
  box-shadow: 0 12px 30px rgba(20, 42, 87, 0.16);
}

.app-wordmark-copy {
  display: grid;
  gap: 0.08rem;
}

.app-wordmark-copy strong {
  font-size: 1.35rem;
  line-height: 1;
}

.app-wordmark-copy span {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-header-actions form {
  margin: 0;
  display: flex;
}

.admin-link,
.logout-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-navy);
  cursor: pointer;
  padding: 0.65rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.5rem;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
}

.admin-link:hover,
.logout-button:hover {
  background: var(--brand-aqua-soft);
  border-color: var(--border-strong);
}

.dashboard-shell {
  display: grid;
  gap: 1.5rem;
}

.dashboard-hero {
  display: grid;
  gap: 1rem;
}

.dashboard-hero {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  align-items: start;
}

.dashboard-copy h1 {
  margin: 0.3rem 0 1rem;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 0.95;
}

.dashboard-kicker,
.dashboard-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-aqua);
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-intro,
.dashboard-helper,
.dashboard-note,
.dashboard-empty p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid rgba(167, 203, 223, 0.92);
  border-radius: 24px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 18px 60px var(--shadow);
  backdrop-filter: blur(8px);
}

.dashboard-card-accent {
  background:
    linear-gradient(180deg, rgba(223, 248, 253, 0.96), rgba(255, 255, 255, 0.94));
}

.dashboard-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.dashboard-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-field {
  display: grid;
  gap: 0.4rem;
}

.dashboard-field span {
  font-weight: 700;
}

.dashboard-field input,
.dashboard-field select,
.dashboard-form button,
.primary-button {
  font: inherit;
}

.dashboard-field input,
.dashboard-field select,
.household-invite-row input {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  background: var(--surface-strong);
  color: var(--text);
}

.category-radio-group {
  border: 0;
  padding: 0;
  margin: 0;
}

.category-radio-group legend {
  padding: 0;
  margin-bottom: 0.55rem;
  font-weight: 700;
}

.category-search-input {
  width: 100%;
  margin-bottom: 0.7rem;
}

.category-radio-list {
  display: grid;
  gap: 0;
  max-height: 18rem;
  overflow: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 105, 129, 0.72) transparent;
}

.category-radio-list::-webkit-scrollbar {
  width: 12px;
}

.category-radio-list::-webkit-scrollbar-track {
  background: transparent;
  margin-block: 0.45rem;
}

.category-radio-list::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(79, 105, 129, 0.72);
  background-clip: content-box;
}

.category-radio-option {
  position: relative;
  display: block;
}

.category-radio-option input {
  position: absolute;
  opacity: 0.0001;
  inset: 0;
  pointer-events: none;
}

.category-radio-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0.95rem;
  border: 0;
  border-top: 1px solid rgba(167, 203, 223, 0.75);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.category-radio-option:first-child .category-radio-card {
  border-top: 0;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.category-radio-option:last-child .category-radio-card {
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.category-radio-card:hover {
  background: rgba(223, 248, 253, 0.52);
}

.category-radio-option input:focus-visible + .category-radio-card {
  box-shadow:
    inset 0 0 0 2px var(--brand-aqua),
    inset 0 0 0 6px var(--focus-ring);
  position: relative;
  z-index: 1;
}

.category-radio-option input:checked + .category-radio-card {
  background: rgba(223, 248, 253, 0.85);
  box-shadow: inset 0 0 0 1px rgba(29, 184, 217, 0.4);
}

.category-radio-option input:focus-visible:checked + .category-radio-card {
  box-shadow:
    inset 0 0 0 2px var(--brand-aqua),
    inset 0 0 0 6px var(--focus-ring);
}

.category-radio-swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--brand-aqua);
  border: 1px solid rgba(20, 42, 87, 0.12);
  flex: 0 0 auto;
}

.category-radio-copy {
  min-width: 0;
}

.category-radio-copy strong,
.category-radio-copy span {
  display: block;
}

.category-radio-copy span {
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.category-radio-empty {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 0;
  color: var(--text-muted);
  background: transparent;
}

.dashboard-form button {
  border: 0;
  border-radius: 999px;
  background: var(--brand-navy);
  color: #fff;
  cursor: pointer;
  padding: 0.9rem 1.2rem;
  font-weight: 800;
}

.dashboard-form button:hover {
  background: var(--brand-navy-strong);
}

.dashboard-form button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.dashboard-banner {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(20, 42, 87, 0.08);
}

.dashboard-banner-error {
  background: #fff1f2;
  border-color: rgba(190, 18, 60, 0.18);
  color: #be123c;
}

.dashboard-banner-success {
  background: linear-gradient(180deg, rgba(168, 223, 62, 0.24), rgba(223, 248, 253, 0.92));
  border-color: rgba(22, 101, 52, 0.22);
  color: #14532d;
}

.dashboard-steps {
  margin: 1rem 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
}

.dashboard-lists {
  display: grid;
  gap: 1rem;
}

.dashboard-empty {
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  padding: 1.2rem;
  background: var(--surface-strong);
}

.dashboard-household-list {
  display: grid;
  gap: 1rem;
}

.household-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  background: var(--surface-strong);
}

.household-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.household-card h3,
.dashboard-card h2,
.dashboard-empty h3 {
  margin: 0;
}

.household-meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.secondary-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--border-strong);
  background: var(--brand-aqua-soft);
}

.secondary-button:disabled {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 1;
}

.primary-button,
.dashboard-form button {
  border: 0;
  border-radius: 999px;
  background: var(--brand-navy);
  color: #fff;
  cursor: pointer;
  padding: 0.9rem 1.2rem;
  font-weight: 800;
}

.primary-button:hover,
.dashboard-form button:hover {
  background: var(--brand-navy-strong);
}

.primary-button:disabled,
.dashboard-form button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.household-invite-output {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(29, 184, 217, 0.3);
  border-radius: 16px;
  background: rgba(223, 248, 253, 0.75);
}

.household-invite-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.household-invite-row input {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.list-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.list-grid li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.list-grid li a:hover {
  background: rgba(223, 248, 253, 0.7);
  border-color: var(--border-strong);
}

.list-grid small {
  color: var(--text-muted);
}

.list-shell,
.item-list {
  display: grid;
  gap: 1rem;
}

.list-shell {
  max-width: 960px;
  margin: 0 auto;
  padding-bottom: 7rem;
}

.list-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.list-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.list-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: space-between;
  width: min(100%, 28rem);
}

.list-title-row h1 {
  margin: 0;
}

.list-settings-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--brand-navy);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  min-height: 2.35rem;
  padding: 0.55rem 0.95rem;
}

.list-settings-button:hover {
  background: var(--brand-aqua-soft);
  border-color: var(--border-strong);
}

.back-link {
  color: var(--brand-navy);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.invite-shell {
  max-width: 720px;
  margin: 0 auto;
}

.invite-card {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 20px 48px var(--shadow);
}

.invite-lead {
  margin: 0;
  color: var(--text-muted);
}

.invite-actions {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
}

.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  border: 0;
  border-top: 1px solid rgba(167, 203, 223, 0.72);
  border-radius: 0;
  padding: 0.8rem 0.95rem;
  background: transparent;
  cursor: pointer;
}

.item-category-header + .item-card {
  border-top: 1px solid rgba(167, 203, 223, 0.72);
}

.item-card.is-checked {
  background: var(--brand-lime-soft);
}

.item-card.is-highlighted {
  box-shadow: inset 0 0 0 2px var(--brand-aqua);
}

.item-card h3,
.item-card p {
  margin: 0;
}

.item-card p + p {
  margin-top: 0.35rem;
}

.item-meta {
  color: var(--text-muted);
}

.item-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 1;
}

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

.item-name {
  font-size: 1.1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.item-card.is-checked .item-name {
  color: var(--text-muted);
  text-decoration: line-through;
}

.item-check {
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  flex: 0 0 auto;
  position: relative;
}

.item-check:hover {
  background: var(--brand-aqua-soft);
}

.item-check::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.5rem;
  height: 1rem;
  border-right: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transform: rotate(45deg) translate(-1px, -1px);
}

.item-check.is-checked {
  background: var(--brand-lime);
  border-color: var(--brand-lime);
  color: #fff;
}

.item-check.is-checked::after {
  border-color: #fff;
}

.item-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.item-actions button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 700;
}

.item-actions button:hover {
  background: var(--brand-aqua-soft);
}

.item-category-group {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-strong);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.item-category-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.95rem;
  background: rgba(245, 251, 253, 0.96);
}

.item-category-swatch {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: var(--brand-aqua);
  flex: 0 0 auto;
}

.item-category-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.item-category-header h3,
.item-category-meta {
  margin: 0;
}

.item-category-header h3 {
  font-size: 0.96rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-category-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: right;
  line-height: 1;
  white-space: nowrap;
  justify-self: end;
  margin-left: auto;
}

.list-focus-card {
  gap: 0.9rem;
}

.list-focus-card .dashboard-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.list-status {
  margin: 0;
  text-align: right;
  justify-self: end;
  white-space: nowrap;
}

.floating-add-button {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  background: linear-gradient(135deg, var(--brand-aqua), #1396b8);
  color: #fff;
  box-shadow: 0 18px 36px rgba(20, 42, 87, 0.22);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  z-index: 20;
}

.floating-add-button-icon-only {
  width: 4rem;
  height: 4rem;
  padding: 0;
  justify-content: center;
}

.floating-add-button:hover {
  transform: translateY(-1px);
}

.floating-add-button span[aria-hidden="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 1.3rem;
}

.floating-add-button-icon-only span[aria-hidden="true"] {
  width: 2rem;
  height: 2rem;
  font-size: 1.6rem;
}

.dashboard-add-actions {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.dashboard-add-item-section {
  margin-top: 1.25rem;
}

.dashboard-add-action {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.dashboard-add-action:hover {
  border-color: var(--brand-aqua);
  background: rgba(223, 248, 253, 0.72);
}

.dashboard-add-action strong,
.dashboard-add-action span {
  display: block;
}

.dashboard-add-action span {
  color: var(--text-muted);
  line-height: 1.5;
}

.dashboard-add-list-group {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.dashboard-add-list-empty {
  margin: 0;
  padding: 0.95rem 1rem;
}

.dashboard-add-list-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border: 0;
  border-top: 1px solid rgba(167, 203, 223, 0.75);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.dashboard-add-list-button:first-of-type {
  border-top: 0;
}

.dashboard-add-list-button:hover {
  background: rgba(223, 248, 253, 0.52);
}

.dashboard-add-list-button small {
  color: var(--text-muted);
  font-weight: 600;
}

.item-modal {
  position: fixed;
  inset: 0;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: clamp(1.5rem, 4vw, 2.5rem) 1.5rem 1.5rem;
  z-index: 40;
}

.item-modal[hidden] {
  display: none;
}

.item-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 42, 87, 0.48);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.add-item-panel {
  position: relative;
  width: min(100%, 38rem);
  max-height: min(100vh - 3rem, 52rem);
  margin: 0;
  z-index: 1;
  overflow: auto;
  transform-origin: top center;
}

.item-edit-panel {
  position: relative;
  width: min(100%, 38rem);
  max-height: min(100vh - 3rem, 52rem);
  margin: 0;
  z-index: 1;
  overflow: auto;
  transform-origin: top center;
}

.add-item-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-back-button {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  flex: 0 0 auto;
}

.panel-back-button:hover {
  background: var(--brand-aqua-soft);
}

.add-item-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
}

.item-suggestion-slot {
  display: grid;
  gap: 0.5rem;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-0.35rem);
  transition:
    max-height 220ms ease,
    opacity 180ms ease,
    transform 220ms ease,
    margin 220ms ease;
}

.item-suggestion-slot.is-active {
  max-height: 22rem;
  opacity: 1;
  transform: translateY(0);
}

.item-suggestion-list {
  display: grid;
  gap: 0.5rem;
}

.item-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(29, 184, 217, 0.3);
  border-radius: 16px;
  background: rgba(223, 248, 253, 0.72);
}

.item-suggestion.is-checked {
  background: var(--brand-lime-soft);
  border-color: rgba(168, 223, 62, 0.8);
}

.item-suggestion-check {
  cursor: default;
  pointer-events: none;
}

.item-suggestion-copy {
  min-width: 0;
}

.item-suggestion-copy strong,
.item-suggestion-copy span {
  display: block;
}

.item-suggestion-copy span {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.item-suggestion.is-checked .item-suggestion-copy strong {
  color: var(--text-muted);
  text-decoration: line-through;
}

.item-suggestion.is-checked .item-suggestion-copy span {
  color: #166534;
}

.item-suggestion button {
  border: 0;
  border-radius: 999px;
  background: var(--brand-navy);
  color: #fff;
  cursor: pointer;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  font-size: 2rem;
  line-height: 1;
  flex: 0 0 auto;
}

.list-toast {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.95rem 1rem;
  border-radius: 20px;
  background: rgba(20, 42, 87, 0.96);
  color: #fff;
  box-shadow: 0 18px 36px rgba(20, 42, 87, 0.26);
  z-index: 25;
  overflow: hidden;
}

.list-toast[hidden] {
  display: none;
}

.list-toast p {
  margin: 0;
  line-height: 1.4;
}

.list-toast button {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-navy);
  cursor: pointer;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.list-toast-timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-lime), var(--brand-aqua));
  transform-origin: left center;
}

.list-toast.is-active .list-toast-timer {
  animation: list-toast-countdown linear forwards;
  animation-duration: var(--undo-duration, 10s);
}

@keyframes list-toast-countdown {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

.item-edit-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-category-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.settings-category-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.settings-category-copy {
  min-width: 0;
  flex: 1;
}

.settings-category-copy strong,
.settings-category-copy span {
  display: block;
}

.settings-category-copy span {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.settings-category-actions {
  display: flex;
  gap: 0.45rem;
  margin-left: auto;
}

.settings-category-actions button {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.danger-button {
  border: 1px solid #fca5a5;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  cursor: pointer;
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 800;
}

.danger-button:hover {
  background: #ffe4e6;
  border-color: #fb7185;
}

.danger-button:disabled {
  border-color: #fecdd3;
  background: #fff5f6;
  color: #f43f5e;
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 720px) {
  html {
    font-size: 16px;
  }

  body {
    min-height: 100dvh;
  }

  main {
    padding: 0 max(0.8rem, env(safe-area-inset-right)) calc(1.1rem + env(safe-area-inset-bottom)) max(0.8rem, env(safe-area-inset-left));
  }

  .app-header {
    padding: calc(0.75rem + env(safe-area-inset-top)) max(0.8rem, env(safe-area-inset-right)) 0.8rem max(0.8rem, env(safe-area-inset-left));
    align-items: flex-start;
    gap: 0.75rem;
  }

  .app-wordmark {
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
  }

  .app-wordmark-logo {
    width: 2.5rem;
    height: 2.5rem;
  }

  .app-wordmark-copy strong {
    font-size: 1rem;
  }

  .app-wordmark-copy span {
    display: none;
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .app-header-actions {
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .admin-link,
  .logout-button,
  .back-link {
    min-height: 2.2rem;
    font-size: 0.84rem;
  }

  .app-header-actions .admin-link,
  .app-header-actions .logout-button {
    width: 5.4rem;
    min-width: 5.4rem;
    min-height: 2.2rem;
    justify-content: center;
    padding: 0.42rem 0.8rem;
    text-align: center;
  }

  .list-shell {
    gap: 0.85rem;
    padding-bottom: calc(5.6rem + env(safe-area-inset-bottom));
  }

  .list-hero,
  .item-category-header {
    flex-direction: column;
  }

  .list-hero {
    gap: 0.55rem;
  }

  .list-title-row {
    width: 100%;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .list-title-row h1 {
    font-size: clamp(1.7rem, 7.5vw, 2.25rem);
    line-height: 0.98;
  }

  .list-settings-button {
    min-height: 2.35rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.84rem;
  }

  .back-link {
    align-self: flex-start;
    padding: 0.45rem 0.75rem;
  }

  .dashboard-card {
    border-radius: 20px;
    padding: 0.9rem;
  }

  .dashboard-label,
  .dashboard-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }

  .dashboard-helper,
  .dashboard-note,
  .dashboard-empty p,
  .item-meta,
  .item-category-header p {
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .dashboard-copy h1 {
    margin: 0.15rem 0 0.55rem;
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .dashboard-intro {
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .dashboard-hero,
  .dashboard-lists,
  .dashboard-household-list {
    gap: 0.8rem;
  }

  .dashboard-section-heading {
    gap: 0.55rem;
  }

  .dashboard-empty {
    padding: 0.9rem;
  }

  .household-card {
    padding: 0.8rem;
    border-radius: 16px;
  }

  .household-card-header {
    align-items: flex-start;
    gap: 0.7rem;
  }

  .household-card-header .secondary-button {
    align-self: flex-start;
  }

  .household-meta,
  .list-grid small,
  .passkey-copy span {
    font-size: 0.8rem;
  }

  .household-invite-output {
    margin-top: 0.75rem;
    padding: 0.8rem;
  }

  .household-invite-row {
    gap: 0.55rem;
  }

  .list-grid {
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .list-grid li a {
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
  }

  .list-focus-card {
    gap: 0.35rem;
    padding: 0;
    overflow: hidden;
  }

  .list-focus-card .dashboard-section-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 0.7rem 0.8rem 0.3rem;
  }

  .item-list {
    gap: 0;
  }

  .item-category-group {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .item-category-group + .item-category-group {
    margin-top: 0.5rem;
  }

  .item-category-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    background: rgba(245, 251, 253, 0.72);
    border-top: 2px solid rgba(167, 203, 223, 0.88);
  }

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

  .item-card {
    align-items: center;
    gap: 0.55rem;
    border-radius: 0;
    border-top-color: rgba(167, 203, 223, 0.42);
    padding: 0.62rem 0.8rem;
    background: var(--surface-strong);
  }

  .item-main {
    gap: 0.58rem;
  }

  .item-check {
    width: 1.95rem;
    height: 1.95rem;
  }

  .item-name {
    font-size: 0.96rem;
    line-height: 1.15;
  }

  .item-actions {
    justify-content: flex-start;
    width: auto;
    flex: 0 0 auto;
  }

  .item-actions button {
    min-height: 2rem;
    padding: 0.38rem 0.62rem;
    font-size: 0.78rem;
  }

  .floating-add-button {
    right: max(0.8rem, env(safe-area-inset-right));
    bottom: calc(0.8rem + env(safe-area-inset-bottom));
    min-height: 3.2rem;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
  }

  .floating-add-button-icon-only {
    width: 3.25rem;
    min-width: 3.25rem;
    padding: 0;
  }

  .floating-add-button span[aria-hidden="true"] {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1.2rem;
  }

  .item-modal {
    padding: max(0.6rem, env(safe-area-inset-top)) max(0.6rem, env(safe-area-inset-right)) max(0.6rem, env(safe-area-inset-bottom)) max(0.6rem, env(safe-area-inset-left));
    align-items: end;
  }

  .add-item-panel,
  .item-edit-panel {
    width: 100%;
    max-height: min(100dvh - 1rem, 100%);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .add-item-panel-header h2,
  .item-edit-panel h2 {
    font-size: 1.6rem;
  }

  .add-item-close {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: var(--surface-muted);
    font-size: 2rem;
  }

  .dashboard-field input,
  .dashboard-field select,
  .dashboard-form button,
  .category-search-input,
  .danger-button {
    min-height: 2.75rem;
    font-size: 0.94rem;
  }

  .dashboard-form button,
  .danger-button {
    padding-block: 0.72rem;
  }

  .category-radio-card,
  .settings-category-row,
  .item-suggestion {
    padding: 0.75rem 0.85rem;
  }

  .item-suggestion button,
  .settings-category-actions button {
    width: 2.4rem;
    height: 2.4rem;
  }

  .list-status {
    text-align: right;
    justify-self: end;
    align-self: start;
    font-size: 0.8rem;
  }

  .list-toast {
    left: max(0.8rem, env(safe-area-inset-left));
    right: max(0.8rem, env(safe-area-inset-right));
    bottom: calc(4.9rem + env(safe-area-inset-bottom));
    max-width: none;
    padding: 0.8rem 0.9rem;
  }
}

.auth-shell {
  display: grid;
  gap: 2rem;
  max-width: 960px;
}

.auth-copy {
  max-width: 48rem;
}

.auth-copy {
  display: grid;
  gap: 0.75rem;
}

.auth-copy h1,
.auth-copy h2,
.auth-copy p {
  margin: 0;
}

.auth-copy h1 {
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  line-height: 0.95;
}

.auth-copy h2 {
  margin-top: 0.65rem;
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.05;
}

.auth-copy p {
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 30px var(--shadow);
}

.auth-card-primary {
  max-width: 72rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-tab-button {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 1rem;
  border-radius: 999px;
}

.auth-tab-button[aria-selected="true"] {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #fff;
}

.auth-tab-button:hover {
  border-color: var(--border-strong);
}

.auth-field {
  display: grid;
  gap: 0.35rem;
}

.auth-field span {
  font-weight: 600;
}

.auth-field input,
.auth-form button {
  font: inherit;
}

.auth-field input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}

.auth-form button {
  border: 0;
  border-radius: 999px;
  background: var(--brand-navy);
  color: #fff;
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
}

.auth-form button:hover {
  background: var(--brand-navy-strong);
}

.auth-form button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.auth-banner {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-weight: 600;
}

.auth-banner-error {
  background: #fef2f2;
  color: #991b1b;
}

.auth-banner-success {
  background: #ecfdf5;
  color: #166534;
}

.auth-banner-info {
  background: rgba(223, 248, 253, 0.92);
  color: var(--brand-navy);
}

@media (max-width: 720px) {
  .auth-card {
    padding: 0.9rem 1rem;
    border-radius: 16px;
  }

  .auth-tabs {
    gap: 0.4rem;
    margin-bottom: 0.75rem;
  }

  .auth-tab-button {
    width: 100%;
    padding: 0.6rem 0.85rem;
  }

  .auth-shell {
    gap: 1.1rem;
  }

  .auth-copy {
    gap: 0.55rem;
  }

  .auth-copy h1 {
    font-size: 2.1rem;
  }

  .auth-copy h2 {
    margin-top: 0.45rem;
    font-size: 1.35rem;
  }

  .auth-form {
    gap: 0.8rem;
  }
}

.dashboard-account-card {
  gap: 1rem;
}

.passkey-list {
  display: grid;
  gap: 0.9rem;
}

.passkey-name-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(223, 248, 253, 0.92), rgba(255, 255, 255, 0.96));
}

.passkey-name-form[hidden] {
  display: none;
}

.passkey-name-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.passkey-row {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.1rem;
}

.passkey-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.passkey-copy strong {
  font-size: 1rem;
}

.passkey-copy span {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.passkey-delete-panel {
  width: min(100%, 34rem);
}

.passkey-delete-panel .dashboard-helper {
  margin: 0.75rem 0 0;
}

@media (max-width: 720px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .list-hero {
    flex-direction: column;
  }

  .passkey-list {
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-strong);
  }

  .passkey-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
    border: 0;
    border-top: 1px solid rgba(167, 203, 223, 0.75);
    border-radius: 0;
    padding: 0.8rem 0.85rem;
  }

  .passkey-row:first-child {
    border-top: 0;
  }

  .passkey-actions {
    justify-content: flex-start;
    gap: 0.55rem;
  }

  .passkey-name-actions {
    flex-direction: column;
  }

  .passkey-actions .secondary-button,
  .passkey-actions .danger-button,
  .dashboard-section-heading > .secondary-button,
  .household-card .secondary-button {
    min-height: 2.25rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
  }
}
