/* Wochenplaner | olivrr — Design Tokens & Layout */
:root {
  --bg: #0c0a09;
  --bg-secondary: #1c1917;
  --bg-tertiary: #292524;
  --bg-elevated: #1f1f23;
  --orange: #f97316;
  --amber: #f59e0b;
  --gold: #fbbf24;
  --warm: #fb923c;
  --text: #fafaf9;
  --text-secondary: rgba(250, 250, 249, 0.7);
  --text-tertiary: rgba(250, 250, 249, 0.5);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --alexa: #38bdf8;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --gradient: linear-gradient(135deg, #f97316 0%, #f59e0b 50%, #fbbf24 100%);
  --gradient-soft: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(251, 191, 36, 0.1) 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-height: 100dvh;
}

body.app-body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.app-body--auth .main-shell {
  padding-bottom: 0;
}

::selection {
  background: rgba(249, 115, 22, 0.3);
}

/* Glow background */
.glow-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(249, 115, 22, 0.06), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(251, 191, 36, 0.05), transparent 45%);
  animation: float-glow 20s ease-in-out infinite alternate;
}

@keyframes float-glow {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-12px) scale(1.02);
  }
}
@media (prefers-reduced-motion: reduce) {
  .glow-bg {
    animation: none;
  }
}

.font-display {
  font-family: var(--font-display);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
@media (min-width: 768px) {
  .section-title {
    font-size: 1.875rem;
  }
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted {
  color: var(--text-secondary);
}
.small {
  font-size: 0.8125rem;
}
.lead {
  font-size: 1.05rem;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Shell */
.main-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 5.5rem 1.25rem 2rem;
}
@media (max-width: 900px) {
  .main-shell {
    padding: calc(0.85rem + env(safe-area-inset-top, 0)) 1rem calc(5.5rem + env(safe-area-inset-bottom, 0));
    min-height: calc(var(--vvh, 100dvh) - 3.5rem);
  }
}

.safe-bottom {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0));
}

@media (min-width: 901px) {
  .safe-bottom {
    padding-bottom: 2rem;
  }
}

/* Top nav */
.top-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(12, 10, 9, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}
@media (min-width: 901px) {
  .top-nav {
    display: block;
  }
}

.top-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: calc(0.65rem + env(safe-area-inset-top, 0)) 1.25rem 0.65rem;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}
.brand--xl {
  font-size: 1.75rem;
}
.brand-mark {
  color: var(--orange);
  font-weight: 800;
  font-size: 1.35em;
  line-height: 0;
  margin-left: 1px;
}

.top-nav-links {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: background 0.2s, color 0.2s;
}
.nav-pill:hover {
  color: var(--text);
  background: var(--glass-hover);
}
.nav-pill.is-active {
  background: rgba(249, 115, 22, 0.15);
  color: var(--orange);
}

.top-nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Bottom nav */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 55;
  background: rgba(12, 10, 9, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(24px);
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0));
  justify-content: space-around;
  transform: translateZ(0);
  backface-visibility: hidden;
}
@media (min-width: 901px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--text-tertiary);
  padding: 0.25rem;
  font-size: 0.625rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav-item .bn-ico {
  font-size: 1.25rem;
}
.bottom-nav-item.is-active {
  color: var(--orange);
}

/* Glass & cards */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  transition: border-color 0.2s, transform 0.2s;
}
.glass-card:hover {
  border-color: var(--border-hover);
}

.glass-inner {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.card-tilt:hover {
  transform: translateY(-2px);
}

.card-title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(249, 115, 22, 0.2);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 50px rgba(249, 115, 22, 0.25);
}
.btn-secondary {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--glass-hover);
  border-color: var(--border-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text);
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}
.btn-block {
  width: 100%;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-icon.sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.85rem;
}
.btn-icon.btn-xl {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.25rem;
}
.btn-success {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}
.btn-danger.btn-xl {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
}

.btn-google {
  width: 100%;
  background: #fff;
  color: #1f1f1f;
  margin-top: 1rem;
  font-weight: 600;
}
.google-ico {
  font-weight: 800;
  color: #4285f4;
}

/* Inputs */
.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.input:focus {
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}
.textarea {
  min-height: 100px;
  resize: vertical;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: var(--warm);
}

/* Grid dashboard */
.grid-3 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}
@media (max-width: 640px) {
  .week-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}
.week-tile {
  text-align: center;
  padding: 0.65rem 0.25rem;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--border);
}
.week-tile.is-today {
  border-color: var(--orange);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.25);
}
.week-d {
  display: block;
  font-size: 0.7rem;
  color: var(--text-tertiary);
}
.week-t {
  font-size: 1rem;
}

.quick-actions {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }
}

.link-arrow {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}
.link-arrow:hover {
  text-decoration: underline;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.text-success {
  color: var(--success);
}
.text-danger {
  color: var(--danger);
}

/* Animations */
.fade-in-up {
  animation: fadeInUp 0.5s ease both;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.scale-in {
  animation: scaleIn 0.45s ease both;
}
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.25);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(249, 115, 22, 0.15);
  }
}

.mt-md {
  margin-top: 0.75rem;
}
.mt-lg {
  margin-top: 1.25rem;
}
.mt-xl {
  margin-top: 2rem;
}
.page-head {
  margin-bottom: 1.5rem;
}
.page-sub {
  margin: 0;
}

/* Onboarding */
.onboarding-progress {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.onboarding-progress-bar {
  height: 100%;
  width: 20%;
  background: var(--gradient);
  transition: width 0.35s ease;
}
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.chip {
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
}
.chip.is-on {
  border-color: rgba(249, 115, 22, 0.5);
  background: rgba(249, 115, 22, 0.12);
}
.chip-desc {
  display: block;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 0.15rem;
}
.ob-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.inline-add {
  display: flex;
  gap: 0.5rem;
}
.servings-big {
  text-align: center;
  padding: 1rem 0;
}
.servings-number {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
}
.servings-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin: 1rem auto;
  max-width: 280px;
  overflow: hidden;
}
.servings-fill {
  height: 100%;
  width: 20%;
  background: var(--gradient);
  border-radius: 8px;
  transition: width 0.25s ease;
}
.stepper {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* Plan */
.plan-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.plan-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.debug-toggle.is-active {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.week-nav {
  display: flex;
  gap: 0.35rem;
}
.banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.banner--warn {
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text);
}
.banner--danger {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
}

.plan-generate-sticky {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0) + 0.25rem);
  z-index: 40;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
  background: linear-gradient(180deg, rgba(12, 10, 9, 0.96) 70%, transparent);
  pointer-events: none;
}
.plan-generate-sticky .btn {
  pointer-events: auto;
}
@media (min-width: 901px) {
  .plan-generate-sticky {
    top: 0.5rem;
  }
}

.plan-grid-anim {
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.32s ease;
  will-change: transform, opacity;
}
.plan-grid-exit-left {
  transform: translateX(-105%);
  opacity: 0.25;
}
.plan-grid-exit-right {
  transform: translateX(105%);
  opacity: 0.25;
}
.plan-grid-enter-from-right {
  animation: plan-week-in-right 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.plan-grid-enter-from-left {
  animation: plan-week-in-left 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes plan-week-in-right {
  from {
    transform: translateX(92%);
    opacity: 0.2;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes plan-week-in-left {
  from {
    transform: translateX(-92%);
    opacity: 0.2;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.plan-grid-wrap {
  overflow-x: auto;
  overflow-y: visible;
  margin: 0 -0.5rem;
  padding: 0 0.5rem 0.5rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.plan-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: stretch;
  min-height: 0;
}
@media (min-width: 1100px) {
  .plan-grid-wrap {
    overflow-x: visible;
    margin: 0;
    padding: 0;
    scroll-snap-type: none;
  }
  .plan-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
    align-items: start;
  }
}

.plan-col {
  flex: 0 0 min(300px, 88vw);
  scroll-snap-align: start;
  max-width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(28, 25, 23, 0.9), rgba(20, 18, 16, 0.95));
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (min-width: 1100px) {
  .plan-col {
    flex: none;
    scroll-snap-align: unset;
    min-width: 0;
  }
}
.plan-col:hover {
  transform: translateY(-2px);
}
.plan-col.is-today {
  border-color: rgba(249, 115, 22, 0.55);
  box-shadow: 0 0 28px rgba(249, 115, 22, 0.2);
}
.plan-day-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 0.5rem 0.6rem 0.15rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.plan-day-date {
  font-size: 0.68rem;
  text-align: center;
  padding: 0 0.5rem 0.35rem;
  border-bottom: 1px solid var(--border);
}

.plan-header.week-flash {
  animation: week-flash-anim 0.65s ease;
}
@keyframes week-flash-anim {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  35% {
    opacity: 0.72;
    transform: translateX(4px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
#plan-range.range-pop {
  animation: range-pop 0.5s ease;
}
@keyframes range-pop {
  0% {
    transform: scale(1);
    color: var(--text-secondary);
  }
  40% {
    transform: scale(1.03);
    color: var(--orange);
  }
  100% {
    transform: scale(1);
    color: var(--text-secondary);
  }
}
.plan-slots {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.45rem;
}
.plan-slot {
  position: relative;
  padding: 0.45rem;
  border-radius: var(--radius-md);
}
.plan-slot-recipe {
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.plan-slot-recipe:hover {
  border-color: rgba(249, 115, 22, 0.35);
}
.plan-slot-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--orange);
  margin-bottom: 0.35rem;
  opacity: 0.95;
}
.plan-slot-img-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.plan-thumb {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
}
.plan-slot-title {
  font-size: 0.78rem;
  margin: 0 0 0.25rem;
  line-height: 1.25;
  font-weight: 600;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.slot-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  justify-content: flex-end;
}
.btn-glass {
  background: rgba(0, 0, 0, 0.35) !important;
  border-color: var(--border) !important;
  backdrop-filter: blur(10px);
}
.plan-slot-empty {
  width: 100%;
  min-height: 76px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  transition: border-color 0.2s, background 0.2s;
}
.plan-slot-empty:hover {
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.06);
}
.plan-slot-empty .plus {
  font-size: 1.35rem;
  opacity: 0.45;
  line-height: 1;
}
.slot-hint {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.btn-rate {
  margin-top: 0.35rem;
  width: 100%;
  padding: 0.3rem;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.1);
  color: var(--orange);
  cursor: pointer;
  font-weight: 600;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(1rem + env(safe-area-inset-top, 0)) 1rem calc(1rem + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal {
  width: 100%;
  max-width: 420px;
  max-height: min(88dvh, calc(100dvh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0) - 2rem));
  overflow-y: auto;
  position: relative;
  margin: auto;
}
.modal--scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal--lg {
  max-width: 640px;
}
.modal-actions--stack-sm {
  flex-direction: column;
  align-items: stretch;
}
.modal-actions--stack-sm .btn {
  width: 100%;
}
.modal-title {
  margin-top: 0;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}
.modal-x {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: rgba(12, 10, 9, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.gen-overlay-inner {
  text-align: center;
  max-width: 360px;
}
.gen-emoji {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}
.gen-status {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  min-height: 1.5em;
}
.gen-segments {
  display: flex;
  gap: 4px;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-tertiary);
}
.gen-segments .seg {
  flex: 1;
  background: var(--bg-tertiary);
  transition: background 0.3s;
}
.gen-segments .seg.is-on {
  background: var(--gradient);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}
.stepper-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}
.stepper-val {
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 2rem;
  text-align: center;
}

/* Detail modal */
.detail-img-wrap .plan-thumb {
  height: 200px;
  border-radius: var(--radius-md);
}
.ing-list,
.ins-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.ing-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.dot-li {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 0.45rem;
  flex-shrink: 0;
}
.ins-list li {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.num-li {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.2);
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Stars */
.stars {
  display: flex;
  gap: 0.15rem;
  margin: 0.75rem 0;
}
.star-pair {
  display: flex;
}
.stars .half {
  width: 14px;
  height: 28px;
  cursor: pointer;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.25) 50%, rgba(255, 255, 255, 0.08) 50%);
  border-radius: 2px;
}
.stars .half:first-child {
  border-radius: 4px 0 0 4px;
  margin-right: 1px;
}
.stars .half:last-child {
  border-radius: 0 4px 4px 0;
}
.stars .half.is-on {
  background: linear-gradient(90deg, var(--orange) 50%, var(--orange) 50%);
}

.rate-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.answer-box {
  margin-top: 0.75rem;
}
.answer-text {
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Debug */
.debug-panel {
  margin-top: 1.5rem;
  padding: 1rem;
}
.debug-title {
  margin: 0 0 0.5rem;
  color: var(--orange);
}
.debug-block {
  margin-top: 0.75rem;
}
.debug-block h4 {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  color: var(--orange);
  text-transform: uppercase;
}
.debug-block pre {
  margin: 0;
  padding: 0.75rem;
  background: #0a0a0c;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  overflow: auto;
  max-height: 200px;
  white-space: pre-wrap;
  word-break: break-word;
}
.debug-sim-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.debug-copy-row {
  margin-top: 0.75rem;
  justify-content: flex-start;
}
.debug-coach-pre {
  max-height: 160px;
}
.coach-messages {
  max-height: min(42vh, 320px);
  overflow-y: auto;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@keyframes coach-msg-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes coach-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes coach-dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}
.coach-msg {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.45;
  animation: coach-msg-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.coach-msg--user {
  align-self: flex-end;
  background: var(--glass-hover);
  max-width: 92%;
}
.coach-msg--assistant {
  align-self: flex-start;
  background: var(--bg-tertiary);
  max-width: 96%;
  white-space: pre-wrap;
}
.coach-msg--typing {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.75rem 1rem;
  min-height: 2.5rem;
}
.coach-msg--typing .coach-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--text-muted, #888);
  animation: coach-dot-pulse 1s ease-in-out infinite both;
}
.coach-msg--typing .coach-dot:nth-child(2) {
  animation-delay: 0.15s;
}
.coach-msg--typing .coach-dot:nth-child(3) {
  animation-delay: 0.3s;
}
.coach-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.15rem 0 0.35rem;
  padding: 0.5rem 0;
  animation: coach-msg-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.coach-act-btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.coach-act-btn:hover {
  transform: translateY(-1px);
}
.coach-recipe-card--enter {
  animation: coach-card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.coach-page .btn-primary.is-loading,
.import-reel-page .btn-primary.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.coach-page .btn-primary.is-loading::after,
.import-reel-page .btn-primary.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: coach-spin 0.65s linear infinite;
}
@keyframes coach-spin {
  to {
    transform: rotate(360deg);
  }
}
.coach-recipe-card {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.coach-recipe-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.coach-recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: flex-end;
}
.coach-recipe-actions .field {
  flex: 1 1 120px;
  margin: 0;
}

.coach-page .coach-card {
  margin-top: 1rem;
}
.coach-messages--page {
  max-height: min(52vh, 440px);
  margin-bottom: 1rem;
}
.coach-page .coach-actions {
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.coach-input-hint {
  margin: -0.35rem 0 0.5rem;
}
.coach-batch-bar {
  margin: 0.35rem 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.coach-batch-head {
  margin: 0 0 0.35rem;
}
.coach-batch-list {
  margin: 0 0 0.65rem;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.45;
}
.coach-batch-run {
  margin-top: 0.15rem;
}
.coach-confirm-list {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.2rem;
  line-height: 1.5;
  font-size: 0.92rem;
}
.import-reel-card {
  margin-top: 1rem;
}
.import-reel-actions {
  margin-top: 0.75rem;
  justify-content: flex-start;
}
.import-reel-result-title {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

/* Swipe */
.swipe-top {
  margin-bottom: 1rem;
}
.progress-wrap {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #f97316, #fbbf24);
  transition: width 0.3s ease;
}

.swipe-card-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 2rem;
}

.swipe-card {
  width: 100%;
  max-width: 400px;
  touch-action: manipulation;
  position: relative;
  cursor: grab;
  will-change: transform;
}
.ob2-safe,
.swipe-safe {
  padding-top: env(safe-area-inset-top, 0);
}
.habit-chat-log {
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
}
.habit-chat-line {
  margin: 0 0 0.35rem;
}
.swipe-layers {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
}
.swipe-ribbon {
  position: absolute;
  top: 1rem;
  padding: 0.35rem 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.15s;
}
.swipe-no {
  left: 1rem;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}
.swipe-yes {
  right: 1rem;
  background: rgba(34, 197, 94, 0.85);
  color: #fff;
}
.swipe-drag-zone.show-no .swipe-no,
.swipe-drag-zone.show-yes .swipe-yes,
.swipe-card.show-no .swipe-no,
.swipe-card.show-yes .swipe-yes {
  opacity: 1;
}

.swipe-body {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 0.15rem;
  margin-right: -0.15rem;
}
.swipe-drag-zone {
  touch-action: none;
  cursor: grab;
  position: relative;
}
.swipe-drag-zone:active {
  cursor: grabbing;
}

.swipe-slot-badge {
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin: 0 0 0.35rem;
}

.swipe-quick {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
}

.swipe-actions {
  position: relative;
  z-index: 20;
  pointer-events: auto;
  margin-top: 0.75rem;
}

.swipe-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
}
.swipe-title {
  font-size: 1.5rem;
  margin: 0.75rem 0 0.35rem;
}
.swipe-desc {
  font-size: 0.9rem;
  line-height: 1.45;
}
.ing-preview {
  margin: 0.75rem 0 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.82rem;
}
.swipe-hint {
  text-align: center;
  margin: 1rem 0;
}
.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.done-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.done-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}

/* Shopping */
.shop-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.preset-card {
  cursor: pointer;
  text-align: center;
  padding: 1rem 0.5rem;
  border: 1px solid var(--border);
}
.preset-card.is-selected {
  border-color: var(--orange);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
}
.preset-n {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.preset-l {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.summary-card .summary-line {
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.shop-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.shop-line {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}
.shop-line.is-done {
  opacity: 0.45;
  text-decoration: line-through;
}
.shop-line:hover {
  border-color: var(--border);
}
.shop-check {
  color: var(--orange);
  font-weight: 700;
}
.cat-head {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.modal--alexa .alexa-list {
  padding-left: 1.1rem;
  line-height: 1.5;
}

/* Profile */
.profile-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.save-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.saved-toast {
  color: var(--success);
  font-weight: 600;
}
.danger-zone {
  border-color: rgba(239, 68, 68, 0.25);
}
.badge-rem {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.15rem;
}
.badge-x {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* Auth */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom, 0));
  position: relative;
  z-index: 1;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.auth-brand {
  justify-content: center;
  margin-bottom: 0.5rem;
}
.auth-tagline {
  margin: 0 0 0.5rem;
}
.auth-title {
  margin: 1rem 0 0.35rem;
}
.auth-sub {
  margin: 0 0 1rem;
}
.oauth-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.auth-install-card {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.45;
}
.auth-install-card strong {
  color: var(--alexa);
}

.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  animation: shine 3.5s ease-in-out infinite;
}
@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(25deg);
  }
  100% {
    transform: translateX(100%) rotate(25deg);
  }
}
.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

/* Guide overlay */
.guide-sheet {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  padding-top: calc(1rem + env(safe-area-inset-top, 0));
}
.guide-sheet--solid {
  background: rgba(12, 10, 9, 0.94);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  align-items: center;
}
@media (min-width: 640px) {
  .guide-sheet:not(.guide-sheet--solid) {
    align-items: center;
  }
}
.guide-sheet-inner {
  max-width: 420px;
  width: 100%;
  padding: 1.25rem;
  max-height: min(520px, 85dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.guide-wizard .guide-step-meta {
  font-size: 0.75rem;
  color: var(--orange);
  margin: 0 0 0.35rem;
  letter-spacing: 0.04em;
}
.guide-nav-btns {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.guide-dots {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 0.75rem;
}
.guide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}
.guide-dot.is-on {
  background: var(--orange);
  transform: scale(1.15);
}
.guide-animate {
  animation: guide-fade 0.45s ease both;
}
@keyframes guide-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.guide-sheet-title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}
.guide-list {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  line-height: 1.55;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.guide-list li {
  margin-bottom: 0.45rem;
}

/* PWA install bar */
.pwa-install-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0));
  background: rgba(12, 10, 9, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.pwa-install-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.pwa-install-inner p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex: 1;
  min-width: 200px;
}

/* Onboarding V2 */
.onboarding-v2 .ob2-progress-wrap {
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.onboarding-v2 .ob2-progress {
  height: 100%;
  width: 16%;
  background: var(--gradient);
  transition: width 0.35s ease;
}
.ob2-card {
  padding: 1.35rem;
  animation: fadeInUp 0.45s ease both;
}
.ob2-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: var(--orange);
  margin-bottom: 0.75rem;
}
.ob2-highlights {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.25rem;
  text-align: left;
}
.ob2-highlights li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.hl-ico {
  flex-shrink: 0;
}
.ob2-chat-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.35rem;
}
.ob2-chat {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  margin: 0.75rem 0;
  padding: 0.65rem;
  font-size: 0.88rem;
}
.ob2-chat-line {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.ob2-chat-line.is-user {
  color: var(--text);
}
.ob2-chat-line.is-bot {
  color: var(--text-secondary);
}
.ob2-chat-input-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ob2-chat-input-row .input {
  flex: 1;
  min-width: 160px;
}
.ob2-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.usage-panel .usage-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.usage-panel .usage-total {
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--orange);
}

.pf-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pf-slot-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pf-slot-row label {
  flex: 0 0 7rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.pf-slot-row .input {
  flex: 1;
}

.modal--alexa {
  max-width: 440px;
}
.modal-actions--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
.alexa-phrase {
  font-size: 1.05rem;
  line-height: 1.45;
  min-height: 3.2em;
  margin: 0.5rem 0;
  color: var(--text);
}
.alexa-progress {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.75rem 0;
}
.alexa-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  transition: width 0.3s ease;
}
.alexa-auto {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}
.alexa-auto input {
  accent-color: var(--orange);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-pill {
  cursor: pointer;
}

/* Loading spinner utility */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
