:root {
  --bg: #120f13;
  --bg-2: #19131b;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-2: rgba(255, 255, 255, 0.12);
  --panel-3: rgba(255, 255, 255, 0.17);
  --text: #fff8ed;
  --muted: #d9c9ba;
  --soft: #a99a8e;
  --orange: #ff7a2f;
  --gold: #ffd166;
  --pink: #f54291;
  --green: #52d273;
  --blue: #56b7ff;
  --purple: #9b6dff;
  --red: #ff5f63;
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --radius: 26px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 7%, rgba(255,122,47,.38), transparent 28%),
    radial-gradient(circle at 86% 14%, rgba(245,66,145,.27), transparent 31%),
    radial-gradient(circle at 52% 95%, rgba(86,183,255,.18), transparent 35%),
    linear-gradient(135deg, var(--bg) 0%, #18131e 55%, #101721 100%);
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px; z-index: 5;
  background: rgba(12, 11, 14, 0.78); backdrop-filter: blur(28px); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 20px;
}
.brand { display: flex; gap: 14px; align-items: center; padding: 8px 6px 18px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center;
  font-size: 22px; line-height: 1; font-weight: 950; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--orange), var(--pink)); box-shadow: 0 18px 46px rgba(245, 66, 145, .24);
}
.brand h1 { margin: 0; font-size: 23px; letter-spacing: -.8px; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.nav-list { display: grid; gap: 8px; }
.nav-item {
  border: 1px solid transparent; background: transparent; color: var(--muted); text-align: left;
  padding: 13px 14px; border-radius: 16px; transition: .18s ease;
}
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--panel); border-color: var(--line); }
.status-card, .ai-card {
  margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
}
.ai-card { margin-top: 0; grid-template-columns: 1fr; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px rgba(82, 210, 115, .7); margin-top: 4px; }
.status-card small, .ai-card small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.status-grid .status-card, .status-grid .ai-card { margin-top: 0; }
@media (max-width: 720px) { .status-grid { grid-template-columns: 1fr; } }
.main { padding: 28px; min-width: 0; }
.topbar { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--gold); text-transform: uppercase; font-weight: 850; letter-spacing: .11em; font-size: 11px; }
h2 { margin: 0; font-size: clamp(34px, 5vw, 62px); letter-spacing: -2.4px; }
h3 { margin: 0; font-size: 22px; letter-spacing: -.6px; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.search { min-width: min(420px, 42vw); }
.input, .textarea, .search, .select {
  width: 100%; color: var(--text); background: rgba(255,255,255,.09); border: 1px solid var(--line);
  border-radius: 16px; padding: 13px 14px; outline: none; transition: .16s ease;
}
.input:focus, .textarea:focus, .search:focus, .select:focus { border-color: rgba(255, 209, 102, .8); box-shadow: 0 0 0 4px rgba(255, 209, 102, .12); }
.textarea { resize: vertical; min-height: 110px; }
.select option { color: #151515; }
.primary-btn, .ghost-btn, .danger-btn, .icon-btn {
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 15px; color: var(--text); transition: .16s ease; white-space: nowrap;
}
.primary-btn { border: 0; background: linear-gradient(135deg, var(--orange), var(--pink)); font-weight: 900; box-shadow: 0 16px 40px rgba(255, 122, 47, .2); }
.primary-btn.big { min-height: 78px; padding-inline: 28px; font-size: 17px; }
.ghost-btn { background: rgba(255,255,255,.08); }
.danger-btn { background: rgba(255,95,99,.16); color: #ffd5d6; border-color: rgba(255,95,99,.33); }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; background: rgba(255,255,255,.09); font-size: 26px; }
.primary-btn:hover, .ghost-btn:hover, .danger-btn:hover, .icon-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.view { display: none; }
.active-view { display: block; animation: lift .22s ease; }
@keyframes lift { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) 360px; gap: 22px; margin-bottom: 22px; }
.panel, .drop-panel, .stats-panel, .section-card, .column, .recipe-card {
  border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(20px); border-radius: var(--radius); box-shadow: var(--shadow);
}
.drop-panel, .stats-panel, .panel { padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.field-label, label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; margin: 14px 0 0; }
.upload-row { margin-top: 16px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: stretch; }
.upload-box { margin: 0; border: 1px dashed rgba(255,255,255,.24); border-radius: 20px; padding: 17px; background: rgba(255,255,255,.06); min-height: 78px; display: grid; align-content: center; }
.upload-box input { display: none; }
.upload-box span { font-size: 15px; color: var(--text); }
.upload-box small { color: var(--soft); margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 850; border: 1px solid var(--line); background: rgba(255,255,255,.09); }
.pill.warning { color: #ffe2ad; background: rgba(255,209,102,.13); border-color: rgba(255,209,102,.28); }
.stats-panel { display: flex; flex-direction: column; justify-content: space-between; min-height: 360px; background: linear-gradient(145deg, rgba(255,122,47,.22), rgba(245,66,145,.17), rgba(255,255,255,.08)); }
.big-number { font-size: 96px; font-weight: 950; line-height: .9; letter-spacing: -6px; }
.stats-panel p { color: var(--muted); margin: 10px 0 0; font-weight: 700; }
.stat-stack { display: grid; gap: 12px; }
.stat-stack div { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; }
.stat-stack strong { font-size: 28px; }
.stat-stack span { color: var(--muted); }
.section-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.section-card { padding: 18px; min-height: 138px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.section-card::before { content: ""; position: absolute; inset: auto -30px -55px auto; width: 110px; height: 110px; border-radius: 50%; background: var(--accent); opacity: .2; }
.section-card strong { display: block; font-size: 19px; letter-spacing: -.4px; }
.section-card span { color: var(--muted); display: block; margin: 8px 0 14px; }
.section-card button { position: relative; margin-top: auto; width: 100%; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.recipe-list { display: grid; gap: 12px; }
.recipe-card { padding: 16px; box-shadow: none; background: rgba(255,255,255,.075); cursor: grab; }
.recipe-card:active { cursor: grabbing; }
.recipe-card.dragging { opacity: .6; transform: scale(.98); }
.recipe-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.recipe-card h4 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.4px; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--soft); font-size: 12px; }
.tag { padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.09); border: 1px solid var(--line); color: var(--muted); }
.recipe-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.recipe-actions button, .recipe-actions select { padding: 8px 10px; border-radius: 12px; font-size: 12px; }
.compact .recipe-card { display: grid; gap: 8px; }
.shopping-preview, .shopping-list { display: grid; gap: 10px; }
.shop-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.07); }
.shop-item label { margin: 0; display: flex; flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.shop-item small { color: var(--soft); }
.shop-item.checked { opacity: .55; text-decoration: line-through; }
.library-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.library-toolbar .select { max-width: 240px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 16px; }
.column { min-height: 310px; padding: 16px; box-shadow: none; }
.column.over { outline: 3px solid rgba(255,209,102,.38); }
.column-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.column-head h3 { font-size: 19px; }
.column-count { color: var(--gold); font-weight: 900; }
.column-body { display: grid; gap: 12px; min-height: 220px; }
.empty { color: var(--soft); padding: 16px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; }
.review-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 22px; }
.raw-box { white-space: pre-wrap; margin: 16px 0 0; color: var(--muted); background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 18px; padding: 16px; max-height: 68vh; overflow: auto; }
.draft-empty { color: var(--muted); padding: 24px; border: 1px dashed var(--line); border-radius: 18px; margin-top: 16px; }
.draft-fields { display: grid; gap: 12px; margin-top: 16px; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.settings-panel .muted { color: var(--muted); line-height: 1.6; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.settings-grid div { padding: 16px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid var(--line); display: grid; gap: 7px; }
.settings-grid span { color: var(--gold); font-weight: 900; }
.settings-grid small { color: var(--muted); line-height: 1.45; }
.recipe-dialog { border: 1px solid var(--line); border-radius: 28px; padding: 0; color: var(--text); background: #17131a; max-width: 860px; width: calc(100vw - 34px); box-shadow: 0 34px 100px rgba(0,0,0,.58); }
.recipe-dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(8px); }
.recipe-dialog form { padding: 24px; display: grid; gap: 14px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 14px 16px; border-radius: 16px; background: rgba(20,18,24,.92); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
code { color: #ffe0ab; }
@media (max-width: 1180px) {
  .hero-grid, .two-col, .review-layout { grid-template-columns: 1fr; }
  .section-tiles { grid-template-columns: repeat(3, 1fr); }
  .kanban { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .stats-panel { min-height: 250px; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; padding: 18px; }
  .nav-list { grid-template-columns: repeat(2, 1fr); }
  .status-card, .ai-card { margin-top: 0; }
  .main { padding: 18px; }
  .topbar, .top-actions, .upload-row, .library-toolbar { flex-direction: column; display: flex; align-items: stretch; }
  .search { min-width: 0; }
  .section-tiles, .kanban, .settings-grid, .form-grid { grid-template-columns: 1fr; }
  .big-number { font-size: 72px; }
  h2 { font-size: 42px; }
}

/* ============================================================
   LOADING / SPLASH SCREEN
   The one bold moment. Everything else in the app stays quiet.
   Signature: the "rip" — a torn line tears across the wordmark,
   nodding to ripping a recipe out of a reel.
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 999; display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,122,47,.5), transparent 34%),
    radial-gradient(circle at 82% 22%, rgba(245,66,145,.42), transparent 38%),
    radial-gradient(circle at 50% 92%, rgba(86,183,255,.24), transparent 42%),
    linear-gradient(135deg, #120f13 0%, #18131e 55%, #101721 100%);
  transition: opacity .5s ease, visibility .5s ease;
  cursor: pointer;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: grid; justify-items: center; gap: 18px; padding: 24px; text-align: center; }

.splash-mark {
  position: relative; width: 108px; height: 108px; border-radius: 30px; display: grid; place-items: center;
  font-size: 42px; font-weight: 950; letter-spacing: -2px; color: #fff8ed;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  box-shadow: 0 26px 70px rgba(245,66,145,.4);
  animation: mark-pop .7s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes mark-pop {
  0% { transform: scale(.3) rotate(-14deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.steam {
  position: absolute; top: -18px; width: 7px; height: 26px; border-radius: 6px;
  background: linear-gradient(to top, rgba(255,248,237,.55), transparent);
  filter: blur(1px); opacity: 0; animation: steam 2.4s ease-in-out infinite;
}
.steam.s1 { left: 32px; animation-delay: .1s; }
.steam.s2 { left: 50px; animation-delay: .55s; height: 32px; }
.steam.s3 { left: 68px; animation-delay: .95s; }
@keyframes steam {
  0% { transform: translateY(6px) scaleY(.6); opacity: 0; }
  35% { opacity: .8; }
  100% { transform: translateY(-22px) scaleY(1.2); opacity: 0; }
}

.splash-word {
  margin: 0; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; justify-content: center;
  font-size: clamp(40px, 9vw, 82px); font-weight: 950; letter-spacing: -3px; line-height: .92;
}
.splash-word .rip {
  background: linear-gradient(135deg, var(--gold), var(--orange), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: word-in .6s ease .15s both;
}
.splash-word .rec { color: #fff8ed; animation: word-in .6s ease .3s both; }
@keyframes word-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* the signature tear */
.rip-line {
  width: min(340px, 74vw); height: 3px; margin-top: 2px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 10px, transparent 10px 18px);
  clip-path: polygon(0 40%, 6% 0, 12% 60%, 20% 10%, 28% 70%, 36% 20%, 46% 80%, 55% 15%, 64% 70%, 73% 25%, 82% 75%, 91% 20%, 100% 55%, 100% 100%, 0 100%);
  transform-origin: left center; animation: rip-across .55s cubic-bezier(.7,0,.3,1) .45s both;
}
@keyframes rip-across { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.splash-tag { margin: 4px 0 0; color: var(--gold); font-weight: 800; letter-spacing: .04em; font-size: clamp(14px, 2.4vw, 18px); animation: word-in .6s ease .6s both; }

.sizzle { width: min(300px, 68vw); height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.12); margin-top: 8px; }
.sizzle-fill {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--orange), var(--pink));
  box-shadow: 0 0 16px rgba(255,122,47,.6);
  animation: sizzle-fill 1.7s ease .5s forwards;
}
@keyframes sizzle-fill { from { width: 0; } to { width: 100%; } }

.splash-status { margin: 2px 0 0; color: var(--muted); font-size: 13px; min-height: 18px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .splash-mark, .splash-word .rip, .splash-word .rec, .rip-line, .splash-tag, .steam { animation: none !important; opacity: 1 !important; transform: none !important; }
  .sizzle-fill { animation: none !important; width: 100%; }
}

.version-tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: var(--gold); background: rgba(255,209,102,.14); border: 1px solid rgba(255,209,102,.28); }
