:root {
  --green: #64d235;
  --green-dim: rgba(100, 210, 53, 0.15);
  --green-bdr: rgba(100, 210, 53, 0.38);
  --navy: #19283a;
  --navy2: #22364d;
  --blue: #0077d2;
  --blue-dim: rgba(0, 119, 210, 0.14);
  --orange: #ff8a3d;
  --orange-dim: rgba(255, 138, 61, 0.12);
  --orange-bdr: rgba(255, 138, 61, 0.35);
  --red: #ff5a67;
  --red-dim: rgba(255, 90, 103, 0.13);
  --red-bdr: rgba(255, 90, 103, 0.35);
  --bg: #19283a;
  --surface: #22364d;
  --surface2: #2b4562;
  --line: rgba(235, 235, 235, 0.12);
  --text: #ebebeb;
  --muted: rgba(235, 235, 235, 0.68);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 84px;
  --radius: 22px;
  --radius-sm: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "DM Sans", system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 18px 12px;
  background: rgba(25, 40, 58, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wordmark {
  font-family: "Syne", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.wordmark em {
  font-style: normal;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.main-content {
  padding: 0 16px;
  max-width: 560px;
  margin: 0 auto;
}
#view-liked,
#view-plan,
#view-shop,
#view-profile,
#view-pick-user {
  padding-top: 16px;
}

.status-banner {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 528px;
  z-index: 35;
  margin-bottom: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--blue-dim);
  color: #8ecbff;
  border: 1px solid rgba(0, 119, 210, 0.28);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.app-shell.no-nav .status-banner {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hidden {
  display: none !important;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-family: "Syne", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.section-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0;
  overflow: hidden;
}

#view-plan .filter-panel {
  margin-bottom: 12px;
}

.filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.filter-title {
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

.filter-toggle {
  min-height: 36px;
  padding: 8px 14px;
}

.filter-toggle .toggle-chevron {
  display: inline-block;
  transition: transform 0.18s ease;
}

.filter-toggle.open .toggle-chevron {
  transform: rotate(180deg);
}

.filter-content {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.filter-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--surface2);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c7d2df' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.filter-select:focus {
  border-color: rgba(100, 210, 53, 0.55);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 7px;
}

.filter-section-label:first-child {
  margin-top: 0;
}

.filter-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text-muted);
  text-transform: capitalize;
  transition: transform 0.12s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.filter-chip:active {
  transform: scale(0.97);
}

.filter-chip.chip-green {
  border-color: var(--green-bdr);
  background: var(--green-dim);
  color: var(--green);
}

.filter-chip.chip-red {
  background: var(--red-dim);
  border-color: var(--red-bdr);
  color: #ff9aa4;
  font-style: italic;
}

.filter-show-more {
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.filter-help-row {
  margin-top: 12px;
}

.filter-help-trigger {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
}

.filter-help-trigger:active {
  opacity: 0.7;
}

.filter-help-popup {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

.tag-row-active {
  margin-bottom: 6px;
}

.tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.progress-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

.swipe-area {
  position: relative;
  margin-bottom: 0;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--surface) 0%, var(--navy2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.recipe-card.dragging {
  transition: none;
}

.recipe-emoji {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 14px;
  display: block;
}

.recipe-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.recipe-title {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  word-break: break-word;
}

.time-pill {
  flex-shrink: 0;
  background: var(--blue-dim);
  color: #9cd3ff;
  border: 1px solid rgba(0, 119, 210, 0.28);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.recipe-desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.meta-box {
  background: rgba(235, 235, 235, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-width: 0;
}

.meta-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.meta-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card-section {
  margin-top: 12px;
}

.card-section h3 {
  margin: 0 0 10px;
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.simple-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.simple-list li + li {
  margin-top: 6px;
}

.section-toggle {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(235, 235, 235, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: left;
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.section-toggle-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
}

.section-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card-overlay {
  position: absolute;
  top: 22px;
  z-index: 4;
  font-family: "Syne", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  border: 3px solid currentColor;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s;
}

.card-overlay.like {
  right: 18px;
  color: var(--green);
  transform: rotate(12deg);
}

.card-overlay.pass {
  left: 18px;
  color: var(--orange);
  transform: rotate(-12deg);
}

.discover-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.action-btn {
  min-height: 56px;
  border-radius: var(--radius-sm);
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.action-btn:active {
  transform: scale(0.96);
  opacity: 0.85;
}

.btn-icon {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.btn-label {
  font-size: 12px;
  line-height: 1;
}

.scran-btn {
  background: var(--green-dim);
  color: var(--green);
  border: 1.5px solid var(--green-bdr);
}

.scrap-btn {
  background: var(--orange-dim);
  color: var(--orange);
  border: 1.5px solid var(--orange-bdr);
}

.undo-btn {
  background: rgba(235, 235, 235, 0.05);
  color: var(--text);
  border: 1.5px solid var(--line);
}

.discover-hint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  transition: transform 0.12s ease, opacity 0.12s ease, border-color 0.15s ease, color 0.15s ease;
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.primary-btn {
  min-height: 52px;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 15px;
  background: var(--green);
  color: var(--navy);
}

.secondary-btn {
  min-height: 52px;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 15px;
  background: var(--blue-dim);
  color: #9cd3ff;
  border: 1px solid rgba(0, 119, 210, 0.25);
}

.ghost-btn {
  min-height: 52px;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-btn:hover {
  color: var(--text);
  border-color: rgba(235, 235, 235, 0.22);
}

.small-btn {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 12px;
}

.full-width {
  width: 100%;
}

.is-disabled,
button:disabled {
  opacity: 0.45;
  cursor: default;
}

.plan-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.shop-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.list-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.list-card-title-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.list-emoji {
  font-size: 30px;
  line-height: 1;
  flex-shrink: 0;
}

.list-card h3 {
  margin: 0 0 4px;
  font-family: "Syne", sans-serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.list-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.saved-date {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  opacity: 0.7;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.remove-btn {
  color: #ffb0b7 !important;
  border-color: rgba(255, 90, 103, 0.3) !important;
}

.day-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--blue-dim);
  color: #9cd3ff;
  border: 1px solid rgba(0, 119, 210, 0.2);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.shop-group-title {
  margin: 0 0 12px;
  font-family: "Syne", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.shop-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
}

.shop-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.shop-bullet {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 6px;
  flex-shrink: 0;
}

.shop-item-text {
  flex: 1;
  min-width: 0;
}

.shop-item-count {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed rgba(235, 235, 235, 0.14);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
}

.empty-state .big {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: "Syne", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.app-shell.no-nav {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(25, 40, 58, 0.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: 560px;
  margin: 0 auto;
}

@media (min-width: 560px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 560px;
    border-radius: 20px 20px 0 0;
  }
}

.nav-btn {
  min-height: 58px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.03em;
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease;
  padding: 4px 2px;
}

.nav-btn.active {
  background: var(--green-dim);
  color: var(--green);
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  border-top: 1px solid var(--line);
  padding: 20px 18px calc(80px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.modal-sheet::-webkit-scrollbar {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.modal-close-fab {
  position: fixed;
  bottom: 28px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid rgba(235, 235, 235, 0.2);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-close-fab:hover {
  background: var(--surface);
  border-color: rgba(235, 235, 235, 0.35);
}

.modal-title {
  margin: 0 0 6px;
  font-family: "Syne", sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

.modal-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.section-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.discover-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid var(--green-bdr);
}

#view-home .recipe-card {
  transition: transform 0.42s ease, opacity 0.25s ease;
}

#profile-username {
  word-break: break-word;
}

@media (max-width: 520px) {
  .plan-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .plan-toolbar .filter-block {
    grid-column: 1 / -1;
  }

  .bottom-nav {
    gap: 2px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .nav-btn {
    min-height: 56px;
  }

  .nav-label {
    font-size: 9px;
    letter-spacing: 0.03em;
  }
}

@media (max-width: 420px) {
  .shop-toolbar {
    grid-template-columns: 1fr;
  }

  .recipe-title-row,
  .list-card-head,
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .recipe-card {
    padding: 18px;
  }

  .recipe-title {
    font-size: 22px;
  }

  .swipe-area {
    /* no min-height — card is content-sized */
  }

  .card-overlay {
    font-size: 18px;
    padding: 7px 12px;
  }
}

@media (max-width: 360px) {
  .main-content {
    padding: 0 12px;
  }

  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .wordmark {
    font-size: 10px;
  }

  h1 {
    font-size: 23px;
  }

  .recipe-title {
    font-size: 20px;
  }

  .recipe-card {
    padding: 16px;
  }

  .nav-icon {
    font-size: 18px;
  }

  .nav-label {
    font-size: 8px;
  }
}

/* ── HOME HERO ──────────────────────────────────────── */
.home-hero {
  padding: 24px 0 20px;
  text-align: center;
}

.home-hero-wordmark {
  font-family: "Syne", sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 4px;
}

.home-hero-wordmark em {
  font-style: normal;
  color: var(--muted);
}

.home-tagline {
  color: var(--muted);
  font-size: 15px;
  margin: 8px 0 20px;
}

/* ── PROFILE ────────────────────────────────────────── */
.profile-user-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 8px;
}

.profile-name-display {
  font-family: "Syne", sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  word-break: break-word;
}

/* ── PICK USER ──────────────────────────────────────── */
.pick-user-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pick-user-title {
  font-family: "Syne", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.pick-user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pick-user-btn {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: "Syne", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pick-user-btn:active {
  background: var(--green-dim);
  border-color: var(--green-bdr);
  color: var(--green);
}

.pick-user-emoji {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.pick-user-name {
  flex: 1;
}

/* ── RETRY PANEL ────────────────────────────────────── */
.retry-panel {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.retry-bar-wrap {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.retry-bar {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  width: 100%;
  transition: width linear;
}

.retry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.retry-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* ── GHOST BTN FIX ──────────────────────────────────── */
.ghost-btn {
  overflow: visible;
}

/* ── STATUS TOAST ───────────────────────────────────── */
@keyframes statusPuff {
  0%   { opacity: 1;   transform: translateX(-50%) scale(1); }
  60%  { opacity: 0.7; transform: translateX(-50%) scale(1.03); }
  100% { opacity: 0;   transform: translateX(-50%) scale(0.92); }
}

.status-banner.status-puff {
  animation: statusPuff 0.5s forwards;
}

/* ── TOPBAR RIGHT ───────────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
}

/* ── SYNC INDICATOR ─────────────────────────────────── */
.sync-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sync-indicator {
  opacity: 0.55;
  display: block;
  cursor: pointer;
}
.sync-track {
  fill: none;
  stroke: rgba(235,235,235,0.12);
  stroke-width: 2;
}
.sync-ring {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-dasharray: 56.55;
  stroke-dashoffset: 56.55;
  transform: rotate(-90deg);
  transform-origin: 12px 12px;
}
.sync-indicator.syncing .sync-ring {
  stroke: var(--orange);
  stroke-dashoffset: 56.55;
  animation: syncPulse 0.5s infinite alternate;
}
.sync-indicator.sync-success .sync-ring {
  stroke: var(--green);
  animation: syncFill 1.8s ease-in-out forwards;
}
@keyframes syncPulse {
  from { opacity: 1; }
  to   { opacity: 0.25; }
}
@keyframes syncFill {
  0%   { stroke-dashoffset: 56.55; }
  45%  { stroke-dashoffset: 0; }
  80%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 56.55; }
}
.sync-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* ── PROFILE FONTS ──────────────────────────────────── */
#view-profile .ghost-btn,
#view-profile .secondary-btn {
  font-family: "DM Sans", sans-serif;
}

/* ── APP VERSION ─────────────────────────────────────── */
.app-version {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  cursor: default;
  user-select: none;
}

/* ── SCRAPPED SECTION ───────────────────────────────── */
.scrapped-toggle-btn {
  width: 100%;
  min-height: 44px;
  background: none;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
}
.scrap-card {
  opacity: 0.75;
}
.scran-rescue-btn {
  color: var(--green) !important;
  border-color: var(--green-bdr) !important;
}

/* ── SHOP CUPBOARD ──────────────────────────────────── */
.shop-cupboard-section {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
/* scrapped section uses stack-list gap */
#scrapped-section > .stack-list {
  margin-top: 12px;
}

/* shop cupboard — top-level card */
.shop-cupboard-card {
  opacity: 0.85;
}
.shop-cupboard-title {
  font-family: "Syne", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}
.shop-item-cupboard .shop-item-text {
  text-decoration: line-through;
  color: var(--muted);
}
.shop-item-cupboard .shop-item-count {
  color: var(--muted);
}
.shop-item-cupboard .shop-bullet {
  opacity: 0.35;
}
.shop-cupboard-toggle {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 15px;
  padding: 0 0 0 8px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

/* ── RESET OVERLAY ──────────────────────────────────── */
.reset-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 32, 0.72);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.reset-overlay-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: calc(100% - 48px);
  max-width: 340px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.reset-overlay-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: resetSpin 0.75s linear infinite;
}
@keyframes resetSpin {
  to { transform: rotate(360deg); }
}
.reset-overlay-tick {
  font-size: 52px;
  color: var(--green);
  line-height: 1;
  font-family: "DM Sans", sans-serif;
}
.reset-overlay-msg {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  text-align: center;
  font-family: "DM Sans", sans-serif;
}

/* ── LAUNCH OVERLAY ─────────────────────────────────── */
#launch-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 1;
  transition: opacity 0.35s ease;
}
#launch-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.launch-logo {
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.launch-plate {
  font-family: "Syne", sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--green);
}
.launch-date {
  font-family: "Syne", sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #aeb7c2;
}
.launch-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: resetSpin 0.75s linear infinite;
}

/* ── OFFLINE OVERLAY ────────────────────────────────── */
#offline-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 32, 0.88);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#offline-overlay.hidden { display: none; }
.offline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: calc(100% - 48px);
  max-width: 300px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.offline-ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}
.offline-ring-svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}
.offline-ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.5;
}
.offline-ring-bar {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 119.4;
  stroke-dashoffset: 0;
}
.offline-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 0;
  font-family: "DM Sans", sans-serif;
}
.offline-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  font-family: "DM Sans", sans-serif;
}

/* ── PARTNER UP ──────────────────────────────────────── */

.pick-partner-header {
  border-top: none;
  padding-top: 20px;
}

/* Decision pills on saved/plan cards */
.partner-decisions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 2px;
}

.decision-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.decision-pill--scran {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.decision-pill--scrap {
  background: rgba(255, 90, 103, 0.12);
  border-color: rgba(255, 90, 103, 0.3);
  color: #ff9aa4;
}

/* Discover card partner badge */
.partner-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.partner-badge--like {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.partner-badge--conflict {
  background: rgba(255, 90, 103, 0.12);
  border: 1px solid rgba(255, 90, 103, 0.3);
  color: #ff9aa4;
}

/* Topbar "Partnered Up" pill */
.partner-topbar-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Profile: active partner name display */
.partner-name-display {
  font-family: "Syne", sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
}

/* Profile: disconnect button tint */
.partner-disconnect-btn {
  color: #ff9aa4;
  border-color: rgba(255, 90, 103, 0.3);
}

/* Profile: empty / inactive state */
.partner-empty-state {
  text-align: center;
  padding: 18px 8px 20px;
}

.partner-empty-icon {
  display: block;
  font-size: 36px;
  line-height: 1;
  margin-bottom: 10px;
}

.partner-empty-title {
  font-family: "Syne", sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
}

.partner-empty-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 4px;
}

/* Partner-only cards (B decided, A undecided) */
.partner-only-card {
  opacity: 0.85;
  border-style: dashed;
}

/* Pick-partner: highlight currently active partner */
.pick-user-btn--active {
  background: var(--green-dim);
  border-color: var(--green-bdr);
  color: var(--green);
}

.partner-active-check {
  margin-left: auto;
  font-size: 18px;
  color: var(--green);
}

/* ── NOTIFICATION DOT ────────────────────────────────── */
.notif-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.notif-dot.hidden {
  display: none;
}

/* Nav button dot: position top-right of icon */
.nav-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 14px;
  width: 8px;
  height: 8px;
}

/* ── PARTNER ROWS (profile card) ─────────────────────── */
.partner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.partner-row--last {
  border-bottom: none;
}

.partner-row-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.partner-row-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.partner-toggle-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.partner-toggle-btn--active {
  border-color: var(--green-bdr);
  background: var(--green-dim);
  color: var(--green);
}

.partner-end-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
}

.partner-end-btn:active {
  opacity: 1;
}

.partner-pending-hint {
  margin: 10px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.partner-pending-hint a {
  color: var(--green);
  text-decoration: none;
}

.partner-add-btn {
  margin-top: 10px;
}

.partner-pin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}

.partner-pin-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.partner-pin-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--green);
  font-family: monospace;
}

/* ── ADD PARTNER VIEW ────────────────────────────────── */
.add-partner-list {
  padding: 0 16px 24px;
}

.add-partner-form {
  margin-bottom: 20px;
}

.partner-form-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.partner-search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.partner-email-input {
  flex: 1;
  min-width: 0;
}

.partner-find-btn {
  flex-shrink: 0;
  padding-left: 16px;
  padding-right: 16px;
}

.partner-search-msg {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.partner-search-err {
  color: var(--red);
}

.partner-search-warn {
  color: var(--orange);
}

.partner-found-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}

.partner-found-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.partner-found-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.partner-send-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
}

/* ── PENDING INVITES ─────────────────────────────────── */
.partner-pending-section {
  margin-bottom: 16px;
}

.partner-section-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.partner-invite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.partner-invite-row:last-child {
  border-bottom: none;
}

.partner-invite-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── AUTH / ONBOARDING ───────────────────────────────── */
.pd-text-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
}

.pd-text-input:focus {
  border-color: var(--green);
}

.pd-text-input::placeholder {
  color: rgba(235, 235, 235, 0.35);
}

.pd-field-error {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--red);
  line-height: 1.4;
}

.pd-auth-helper {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pd-auth-success {
  margin: 0 0 10px;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--green);
}

/* ── PROFILE ACTION ROW ─────────────────────────────── */
.profile-action-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.profile-settings-btn {
  font-size: 18px;
  padding: 12px 10px;
}

/* ── SETTINGS PAGE ──────────────────────────────────── */
#view-settings {
  padding-top: 0;
}

.settings-page-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 0 -16px;
  border-bottom: 1px solid var(--line);
}

.settings-section-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-uuid {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  font-family: monospace;
  line-height: 1.5;
  user-select: all;
}

.settings-action-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(25, 40, 58, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  z-index: 30;
}

.settings-action-bar .ghost-btn {
  flex: 1;
}

.settings-action-bar .primary-btn {
  flex: 2;
}

/* ── RESET OPTION MODAL ─────────────────────────────── */
.reset-group-label {
  margin: 14px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.reset-options {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.reset-option-btn {
  flex: 1;
  min-height: 48px;
  background: var(--surface2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: "DM Sans", sans-serif;
  padding: 12px 10px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.reset-option-btn:active {
  transform: scale(0.98);
}

.reset-option-btn.selected {
  background: var(--green-dim);
  border-color: var(--green-bdr);
  color: var(--green);
}

.reset-option-explainer {
  margin: 14px 0 0;
  min-height: 2.6em;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

#settings-reset-confirm-btn:not(:disabled) {
  color: #ff9aa4;
  border-color: rgba(255, 90, 103, 0.3);
}
