/* Recipo web — same palette and feel as the app. */
:root {
  --bg: #EDE6D8; --surface: #F8F4EC; --surface2: #DED9D0;
  --ink: #1E140E; --ink2: #5C4A3C; --ink3: #8F8476;
  --line: rgba(60, 42, 30, .10); --line2: rgba(60, 42, 30, .18);
  --accent: #3C2A1E; --accent-ink: #EDE6D8;
  --blue: #5F7F9B; --blue-soft: #C9DCE8; --blue-mid: #A9C6DA; --blue-ink: #22384A;
  --danger: #7A3B22; --placeholder: #9A8068; --placeholder-ink: #EDE6D8;
  --shadow: 0 5px 14px rgba(60, 42, 30, .07);
  color-scheme: light dark;
}
/* Dark: follows the computer, unless the user chose a mode on the account page (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E140E; --surface: #2C2018; --surface2: #3C2A1E;
    --ink: #EDE6D8; --ink2: #C9BBA8; --ink3: #9A8F82;
    --line: rgba(237, 230, 216, .08); --line2: rgba(237, 230, 216, .18);
    --accent: #A9C6DA; --accent-ink: #1E140E;
    --blue: #A9C6DA; --blue-soft: #33434F; --blue-mid: #8AA2BA; --blue-ink: #C9DCE8;
    --danger: #D9A58C; --placeholder: #5A4636;
    --shadow: 0 6px 12px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E140E; --surface: #2C2018; --surface2: #3C2A1E;
  --ink: #EDE6D8; --ink2: #C9BBA8; --ink3: #9A8F82;
  --line: rgba(237, 230, 216, .08); --line2: rgba(237, 230, 216, .18);
  --accent: #A9C6DA; --accent-ink: #1E140E;
  --blue: #A9C6DA; --blue-soft: #33434F; --blue-mid: #8AA2BA; --blue-ink: #C9DCE8;
  --danger: #D9A58C; --placeholder: #5A4636;
  --shadow: 0 6px 12px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Arial, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--blue); }
h1 { font-size: 34px; line-height: 1.2; margin: 0; font-weight: 700; }
h2 { font-size: 20px; margin: 0; font-weight: 600; }
.muted { color: var(--ink2); } .small { font-size: 13px; color: var(--ink3); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 80px; }
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1080px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; text-decoration: none; color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav { display: flex; gap: 4px; background: var(--accent); border-radius: 999px; padding: 5px; margin-inline: auto; }
.nav a { color: var(--accent-ink); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.nav a.on { background: var(--accent-ink); color: var(--accent); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 16px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 500; background: var(--accent); color: var(--accent-ink); text-decoration: none; transition: transform .12s cubic-bezier(.23, 1, .32, 1), opacity .15s; }
.btn:active { transform: scale(.97); }
.btn.soft { background: var(--surface2); color: var(--ink); }
.btn.blue { background: var(--blue-soft); color: var(--blue-ink); }
.btn.ghost { background: none; color: var(--blue); padding: 0 12px; }
.btn.danger { background: var(--surface2); color: var(--danger); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: inline-grid; place-items: center; color: var(--blue); font-size: 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); font-size: 15px; font-weight: 500; }
.chip.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.field { margin-top: 18px; }
.field > label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin: 0 2px 6px; }
.input, textarea.input, select.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; outline: none; }
.input:focus { border-color: var(--blue); }
textarea.input { min-height: 140px; line-height: 1.6; resize: vertical; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); padding: 0 18px; }
.search input { flex: 1; border: 0; background: none; outline: none; min-width: 0; }
.hint { font-size: 13px; color: var(--ink3); margin: 6px 2px 0; }
.error { color: var(--danger); font-size: 15px; margin-top: 10px; }

/* cards */
.card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { display: block; text-decoration: none; color: inherit; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; position: relative; transition: transform .14s cubic-bezier(.23, 1, .32, 1); }
.tile:active { transform: scale(.98); }
.thumb { aspect-ratio: 5 / 4; background: var(--placeholder); color: var(--placeholder-ink); display: grid; place-items: center; font-weight: 700; font-size: 52px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .body { padding: 10px 12px 12px; }
.tile .t { font-weight: 600; font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fav { position: absolute; top: 8px; inset-inline-start: 8px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 17px; color: var(--ink2); }
.fav.on { color: var(--blue); }
.list { display: flex; flex-direction: column; gap: 12px; }
.rowcard { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; text-decoration: none; color: inherit; }
.rowcard .thumb { width: 64px; height: 64px; aspect-ratio: auto; border-radius: 16px; font-size: 28px; flex: none; }
.rowcard .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: thin; }
.hscroll .tile { flex: none; width: 190px; }
.empty { text-align: center; padding: 60px 20px; }

/* recipe page */
.hero { height: min(46vh, 380px); border-radius: 0 0 28px 28px; overflow: hidden; margin: 0 -20px; }
.hero .thumb { width: 100%; height: 100%; aspect-ratio: auto; font-size: 110px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 18px 0 26px; }
.stat { background: var(--blue-soft); color: var(--blue-ink); border-radius: 20px; padding: 14px; }
.stat small { display: block; opacity: .75; font-size: 13px; }
.stat b { font-size: 17px; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; background: var(--accent); color: var(--accent-ink); border-radius: 999px; height: 38px; }
.stepper button { width: 38px; height: 38px; color: inherit; font-size: 20px; }
.stepper output { min-width: 48px; text-align: center; font-weight: 700; }
.ing { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.ing li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--line2); cursor: pointer; }
.ing li:first-child { border-top: 0; }
.ing li.h { background: var(--surface2); color: var(--ink2); font-weight: 600; font-size: 14px; cursor: default; padding: 8px 14px; }
.ing li.done .tx { opacity: .45; text-decoration: line-through; }
.chk { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--blue-mid); margin-top: 2px; display: grid; place-items: center; font-size: 13px; color: transparent; }
.done .chk { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 12px; padding: 14px; cursor: pointer; }
.steps li.done { opacity: .5; }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink); font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.done .num { background: var(--accent); color: var(--accent-ink); }
.two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; align-items: start; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } .nav a { padding: 8px 12px; } .brand span { display: none; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.tag { background: var(--surface2); color: var(--ink2); border-radius: 999px; padding: 4px 10px; font-size: 13px; }

/* editor */
.photo { aspect-ratio: 16 / 9; max-height: 320px; width: 100%; border-radius: 18px; border: 1.5px dashed var(--line2); background: var(--surface); display: grid; place-items: center; overflow: hidden; color: var(--ink2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wrapchips { display: flex; flex-wrap: wrap; gap: 8px; }

/* shopping */
.item { display: flex; align-items: center; gap: 12px; padding: 0 6px 0 14px; min-height: 52px; border-top: 1px solid var(--line2); cursor: pointer; }
.item:first-child { border-top: 0; }
.item .tx { flex: 1; padding: 12px 0; }
.item.done .tx { opacity: .45; text-decoration: line-through; }
.x { width: 40px; height: 40px; color: var(--ink3); font-size: 18px; }

/* auth */
.auth { max-width: 400px; margin: 0 auto; padding: 60px 20px; text-align: center; }
.auth img { width: 112px; height: 112px; border-radius: 26px; }
.auth .input { height: 54px; border-radius: 16px; margin-top: 12px; }
.auth .btn { width: 100%; height: 54px; margin-top: 12px; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; color: var(--ink3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); border-radius: 16px; padding: 10px 18px; font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); z-index: 50; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.banner { display: flex; align-items: center; gap: 10px; background: var(--surface2); border-radius: 16px; padding: 6px 6px 6px 14px; margin: 14px 0 0; }
.banner .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; }
/* profile */
.profile { padding: 26px 18px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.avatar { border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink); display: inline-grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-pick { position: relative; cursor: pointer; margin-bottom: 10px; }
.avatar-pick .pen { position: absolute; bottom: 0; inset-inline-end: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 15px; border: 2px solid var(--surface); }
.profile .name { border: 0; background: none; text-align: center; font-size: 22px; font-weight: 700; width: 100%; max-width: 320px; padding: 4px 8px; border-radius: 10px; outline: none; }
.profile .name:hover, .profile .name:focus { background: var(--surface2); }
.icon-btn .avatar { box-shadow: none; }
