/* =========================================================
   色の役割(1つの色に1つの意味だけを持たせる)
   ---------------------------------------------------------
   ニュートラル  --ink / --ink-2 / --ink-3 / --surface / --fill
                 文字・面・線。意味を持たない情報はすべてこれで表す
   ブランド色    --brand       アプリアイコン・ログイン画面と、アイコンそのものである右下の追加ボタンだけ
   操作色        --action      押せるもの(主ボタン・リンク・タップで動くチップ・フォーカス)
   選択状態      --selected-*  いま選んでいる絞り込み・選択肢。色相を持たないインク反転
   状態色        --success     完了・そろった・同期済み・画面オン
   注意色        --attention   気づいてほしいこと(タイマー終了・オフラインで未同期)
   危険色        --danger      取り消せない操作・エラー(削除・同期失敗・入力ミス)
   お気に入り    --favorite    ♥ だけに使う
   ★評価はインク(色相なし)で表す
   ========================================================= */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --sunken: #f2f2f4;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #b8b8be;
  --line: rgba(0, 0, 0, .08);
  --fill: rgba(120, 120, 128, .12);

  --brand: #e2552b;
  --brand-press: #c9481f;

  --action: #0066cc;
  --action-press: #0055aa;
  --action-tint: rgba(0, 102, 204, .1);

  --selected-bg: #1d1d1f;
  --selected-fg: #ffffff;

  --success: #1e8e3e;
  --success-tint: rgba(30, 142, 62, .12);
  --attention: #f2a20c;
  --attention-ink: #8a5300;
  --attention-tint: rgba(242, 162, 12, .16);
  --danger: #d70015;
  --danger-tint: rgba(215, 0, 21, .1);
  --favorite: #e5337e;

  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 10px rgba(0,0,0,.06), 0 22px 44px rgba(0,0,0,.14);
  --glass: rgba(245, 245, 247, .72);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --sunken: #2c2c2e;
    --ink: #f5f5f7;
    --ink-2: #98989d;
    --ink-3: #545458;
    --line: rgba(255, 255, 255, .1);
    --fill: rgba(120, 120, 128, .28);

    --brand: #f0683f;
    --brand-press: #e2552b;

    --action: #2997ff;
    --action-press: #0a84ff;
    --action-tint: rgba(41, 151, 255, .16);

    --selected-bg: #f5f5f7;
    --selected-fg: #000000;

    --success: #32d74b;
    --success-tint: rgba(50, 215, 75, .16);
    --attention: #ffb340;
    --attention-ink: #ffb340;
    --attention-tint: rgba(255, 179, 64, .18);
    --danger: #ff453a;
    --danger-tint: rgba(255, 69, 58, .16);
    --favorite: #ff4f94;

    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.4);
    --shadow-hover: 0 4px 10px rgba(0,0,0,.5), 0 22px 44px rgba(0,0,0,.7);
    --glass: rgba(0, 0, 0, .66);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  letter-spacing: .01em;
}
body.locked { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: 1080px; margin: 0 auto; height: 52px; padding: 0 20px;
  display: flex; align-items: center; gap: 10px;
}
.nav-spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand-name { opacity: 0; transform: translateY(6px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.nav.scrolled .brand-name { opacity: 1; transform: none; }

.menu-toggle {
  position: relative; width: 40px; height: 40px; margin-right: -8px; border: 0; padding: 0; border-radius: 50%;
  background: none; color: var(--ink); display: grid; place-items: center;
  transition: transform .35s var(--spring), background .2s;
}
.menu-toggle:hover { background: var(--fill); }
.menu-toggle:active { transform: scale(.88); }
/* 右上の点は「気づいてほしいとき」だけ出す(オフライン=注意、エラー=危険) */
.sync-badge { position: absolute; top: 8px; right: 7px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); display: none; }
.sync-badge[data-state="offline"] { display: block; background: var(--attention); }
.sync-badge[data-state="error"] { display: block; background: var(--danger); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none;
  background: var(--fill); color: var(--ink-2); font-size: 16px; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 同期の状態 */
.sync-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ink-3); transition: background .4s; }
.sync-dot[data-state="synced"] { background: var(--success); }
.sync-dot[data-state="syncing"] { background: var(--ink-3); animation: pulse 1.2s ease-in-out infinite; }
.sync-dot[data-state="offline"] { background: var(--attention); }
.sync-dot[data-state="error"] { background: var(--danger); }
.sync-dot[data-state="local"] { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-3); }

/* ---------- 追加ボタン(右下・親指の届く位置) ---------- */
/* アプリアイコンをそのまま追加ボタンにしている(ブランド色を使う唯一のボタン)。
   横の余白は、画面下の余白(ジェスチャーバーの分を含む)とそろえる */
.fab {
  --fab-gap: 22px;
  --fab-edge: max(env(safe-area-inset-right, 0px), env(safe-area-inset-bottom, 0px));
  position: fixed; z-index: 40;
  right: calc(var(--fab-gap) + var(--fab-edge));
  bottom: calc(var(--fab-gap) + env(safe-area-inset-bottom, 0px));
  width: 64px; height: 64px; border: 0; padding: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 40%, transparent), 0 2px 6px rgba(0,0,0,.15);
  transition: transform .4s var(--spring), background .25s, box-shadow .4s var(--ease);
  animation: fabIn .7s .45s var(--spring) both;
}
.fab:hover { background: var(--brand-press); transform: translateY(-2px); }
.fab:active { transform: scale(.9); }
.fab .bowl { margin-top: 1px; overflow: visible; }
.fab .steam { animation: steam 2.8s ease-in-out infinite; }
.fab-plus {
  position: absolute; top: -2px; right: -2px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand), 0 2px 6px rgba(0,0,0,.2);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 120px; }

/* ---------- Hero ---------- */
.hero { padding: 36px 0 8px; text-align: center; }
.hero h1 {
  margin: 0; font-size: clamp(40px, 8vw, 64px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  animation: rise .9s var(--ease) both;
}
.sub {
  margin: 10px 0 28px; color: var(--ink-2); font-size: clamp(16px, 2.4vw, 21px);
  animation: rise .9s .08s var(--ease) both;
}

/* ---------- Search ---------- */
.search {
  position: relative; z-index: 15; max-width: 560px; margin: 0 auto;
  animation: rise .9s .16s var(--ease) both;
}
.search input {
  width: 100%; height: 50px; border: 0; outline: 0;
  border-radius: 14px; padding: 0 44px 0 46px;
  background: var(--surface); box-shadow: var(--shadow);
  font-size: 17px; -webkit-appearance: none; appearance: none;
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--ink-2); }
.search.focus input { box-shadow: 0 0 0 3px var(--action-tint), 0 0 0 1px var(--action), var(--shadow); transform: scale(1.015); }
.search-icon { position: absolute; z-index: 1; left: 16px; top: 16px; color: var(--ink-2); pointer-events: none; transition: transform .5s var(--spring); }
.search.focus .search-icon { transform: scale(1.12); }
.clear {
  position: absolute; right: 12px; top: 13px; width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: var(--fill); color: var(--ink-2); display: grid; place-items: center; padding: 0;
  opacity: 0; transform: scale(.5); pointer-events: none;
  transition: opacity .25s, transform .4s var(--spring);
}
.search.has-text .clear { opacity: 1; transform: none; pointer-events: auto; }

.suggest {
  position: absolute; left: 0; right: 0; top: 58px; margin: 0; padding: 6px; list-style: none; z-index: 10; text-align: left;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  border-radius: 18px; box-shadow: var(--shadow-hover); border: 1px solid var(--line);
  opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top center; visibility: hidden;
  transition: opacity .25s var(--ease), transform .4s var(--ease), visibility 0s .4s;
}
.suggest.open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.suggest li {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 35ms);
  transition: background .2s;
}
.suggest li.active, .suggest li:hover { background: var(--fill); }
.suggest .thumb {
  width: 40px; height: 40px; border-radius: 10px; flex: none; overflow: hidden; background: var(--fill);
  display: grid; place-items: center; font-size: 18px; font-weight: 700; color: var(--ink-2);
}
.suggest .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.suggest .s-name { min-width: 0; font-size: 16px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest .s-cat { margin-left: auto; font-size: 13px; color: var(--ink-2); flex: none; }
/* 一致部分は色ではなく太さと濃さで示す */
.suggest mark { background: none; color: var(--ink); font-weight: 700; }

/* ---------- Chips(絞り込み) ---------- */
.chips {
  display: flex; gap: 8px; margin: 26px -20px 0; padding: 4px 20px 8px;
  overflow-x: auto; scrollbar-width: none; justify-content: safe center;
  animation: rise .9s .24s var(--ease) both;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; max-width: 220px; border: 0; border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 500;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .35s var(--ease), color .35s var(--ease), transform .35s var(--spring);
}
.chip:hover { transform: translateY(-2px); }
.chip:active { transform: scale(.94); }
.chip .n { margin-left: 6px; font-size: 12px; opacity: .55; font-variant-numeric: tabular-nums; }
.chip.active { background: var(--selected-bg); color: var(--selected-fg); }
.sub-chips { margin-top: 4px; animation-delay: .3s; }
.sub-chips .chip { padding: 6px 14px; font-size: 14px; box-shadow: none; background: var(--fill); }
.sub-chips .chip.active { background: var(--selected-bg); color: var(--selected-fg); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 16px 0 14px; animation: rise .9s .34s var(--ease) both;
}
.count { margin: 0; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tools { display: flex; gap: 8px; align-items: center; min-width: 0; }
.tool {
  position: relative; flex: none; height: 34px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; color: var(--ink); font-size: 14px; font-weight: 500;
  transition: transform .35s var(--spring), background .3s, color .3s;
}
.tool:active { transform: scale(.94); }
.fav-tool { width: 34px; justify-content: center; padding: 0; color: var(--ink-2); }
.fav-tool path { fill: none; stroke: currentColor; stroke-width: 2; transition: fill .3s; }
.fav-tool[aria-pressed="true"] { background: var(--selected-bg); color: var(--favorite); }
.fav-tool[aria-pressed="true"] path { fill: currentColor; stroke: currentColor; }
/* アプリ独自のプルダウン */
.menu-btn { gap: 6px; padding: 0 14px; white-space: nowrap; }
.menu-btn svg { color: var(--ink-2); transition: transform .35s var(--ease); }
.menu-btn[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.menu-btn.on { background: var(--selected-bg); color: var(--selected-fg); }
.menu-btn.on svg { color: currentColor; }
.menu-pop {
  position: fixed; z-index: 85; margin: 0; padding: 6px; list-style: none; min-width: 200px; max-width: calc(100vw - 16px);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-hover);
  opacity: 0; transform: scale(.92) translateY(-6px); transform-origin: top right;
  transition: opacity .2s var(--ease), transform .35s var(--spring);
}
.menu-pop.open { opacity: 1; transform: none; }
.menu-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 10px; border-radius: 10px;
  font-size: 15px; cursor: pointer; outline: none; transition: background .15s;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--fill); }
.menu-item .mi-check { width: 18px; height: 18px; flex: none; color: var(--ink); opacity: 0; }
.menu-item.selected { font-weight: 600; }
.menu-item.selected .mi-check { opacity: 1; }

/* ---------- Grid / Card ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); outline: none;
  transition: transform .55s var(--ease), box-shadow .55s var(--ease);
  will-change: transform;
}
.card:hover, .card:focus-visible { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.card:focus-visible { box-shadow: 0 0 0 3px var(--action), var(--shadow-hover); }
.card:active { transform: scale(.975); transition-duration: .2s; }
.card-img {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, var(--fill), transparent);
  display: grid; place-items: center; font-size: 44px;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s var(--ease), opacity .6s; opacity: 0; }
.card-img img.loaded { opacity: 1; }
img.yt { transform: scale(1.34); }
.card:hover .card-img img { transform: scale(1.07); }
.card:hover .card-img img.yt { transform: scale(1.42); }
.badge-play {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px 4px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.badge-play svg { width: 12px; height: 12px; }
.card-body { padding: 14px 18px 18px; }
.card-body h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.card-body p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); font-weight: 500; display: flex; gap: 8px; align-items: center; min-width: 0; }
.card-body .meta-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-star { flex: none; color: var(--ink); font-weight: 700; }

/* お気に入り(♥) */
.fav {
  border: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; color: #fff;
  transition: transform .4s var(--spring), background .3s;
}
.fav svg { width: 18px; height: 18px; }
.fav path { fill: none; stroke: currentColor; stroke-width: 2; transition: fill .25s; }
.fav.on path { fill: var(--favorite); stroke: var(--favorite); }
.fav:active { transform: scale(.85); }
.fav.pop { animation: heartPop .5s var(--spring); }
.card .fav {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  background: rgba(0,0,0,.3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.card .fav.on { background: rgba(255,255,255,.92); }
.fav.big { width: 44px; height: 44px; flex: none; background: var(--fill); color: var(--ink-2); }
.fav.big svg { width: 22px; height: 22px; }
.round-btn {
  width: 44px; height: 44px; flex: none; border: 0; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill); color: var(--ink-2); transition: transform .4s var(--spring), background .2s;
}
.round-btn:active { transform: scale(.85); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 60px 0; animation: rise .8s var(--ease) both; }
.empty-icon { font-size: 64px; animation: float 3.4s ease-in-out infinite; }
.empty h2 { margin: 12px 0 6px; font-size: 24px; letter-spacing: -.02em; }
.empty p { margin: 0 auto 22px; color: var(--ink-2); max-width: 32em; word-break: break-word; }
.loading { text-align: center; color: var(--ink-2); padding: 60px 0; font-size: 14px; }

.link { background: none; border: 0; padding: 0; color: var(--action); font-size: 14px; }
.link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 12px 26px; font-size: 16px; font-weight: 600; text-decoration: none;
  background: var(--fill); color: var(--ink); white-space: nowrap;
  transition: transform .35s var(--spring), background .25s, opacity .25s;
}
.btn:hover { transform: scale(1.04); }
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--action); color: #fff; }
.btn.primary:hover { background: var(--action-press); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger.confirm { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 16px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.pop { animation: heartPop .5s var(--spring); }
.icon-btn {
  width: 30px; height: 30px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; flex: none;
  background: var(--fill); color: var(--ink-2); transition: transform .4s var(--spring), background .2s;
}
.icon-btn:hover { transform: scale(1.12) rotate(90deg); }

/* ---------- Overlay / Sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; padding: 28px 16px;
  background: rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0);
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), backdrop-filter .6s var(--ease), -webkit-backdrop-filter .6s var(--ease), visibility 0s .5s;
}
.overlay.open {
  opacity: 1; visibility: visible; transition-delay: 0s;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.sheet {
  position: relative; flex: none; margin: auto 0; width: 100%; max-width: 620px; background: var(--surface); border-radius: 28px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(40px) scale(.94);
  transition: opacity .35s var(--ease), transform .6s var(--ease);
}
.overlay.open .sheet { opacity: 1; transform: none; }

.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; }
.sheet-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }

/* ---------- ログイン画面 ---------- */
.overlay.gate { z-index: 90; background: var(--bg); }
.overlay.gate.open { -webkit-backdrop-filter: none; backdrop-filter: none; }
.gate-sheet { max-width: 400px; padding: 40px 28px 28px; text-align: center; box-shadow: var(--shadow); }
.gate-mark { display: block; margin: 0 auto 16px; border-radius: 16px; animation: pop .8s .1s var(--ease) both; }
.gate-sheet h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.02em; }
.gate-lead { margin: 0 0 28px; color: var(--ink-2); font-size: 15px; }
.gate-error { margin: 12px 0 0; color: var(--danger); font-size: 13px; word-break: break-word; }
.gate-sheet .link { margin-top: 18px; font-size: 13px; color: var(--ink-2); }

/* ---------- 設定 ---------- */
#settingsOv { z-index: 60; }
.sheet.settings { max-width: 460px; }
.set-body { padding: 4px 24px 28px; display: grid; gap: 28px; }
.set-sec { display: grid; gap: 12px; }
.set-h { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: .06em; }
.edit-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.edit-chips li {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 4px 4px 4px 14px; border-radius: 999px;
  background: var(--sunken); font-size: 15px; animation: pop .4s var(--ease) both;
}
.edit-chips li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-chips li button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); display: grid; place-items: center; padding: 0; flex: none; transition: background .2s, color .2s; }
.edit-chips li button:hover { background: var(--danger-tint); color: var(--danger); }
.edit-chips .empty-note { padding: 6px 0; background: none; color: var(--ink-2); font-size: 14px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: var(--sunken); border-radius: 12px; padding: 10px 14px; font-size: 16px; }
.add-row input:focus { box-shadow: 0 0 0 2px var(--action); }
.set-sec .hint { margin: 0; }
.acc-status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--sunken); }
.acc-status-text { display: grid; min-width: 0; }
.acc-status-text b { font-size: 15px; }
.acc-status-text span { font-size: 13px; color: var(--ink-2); }
.acc-status[data-state="offline"] { background: var(--attention-tint); }
.acc-status[data-state="error"] { background: var(--danger-tint); }
.acc-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acc-user-text { display: grid; min-width: 0; }
.acc-user-text b, .acc-user-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-user-text span { font-size: 13px; color: var(--ink-2); }
.acc-list { list-style: none; margin: 0; padding: 0; border-radius: 16px; background: var(--sunken); overflow: hidden; }
.acc-list li + li { border-top: 1px solid var(--line); }
.acc-list button {
  width: 100%; border: 0; background: none; text-align: left; padding: 13px 16px; font-size: 15px; font-weight: 500; color: var(--action);
  display: grid; gap: 1px; transition: background .2s;
}
.acc-list button:hover { background: var(--fill); }
.acc-list button span { font-size: 12px; font-weight: 400; color: var(--ink-2); }

/* ---------- Detail ---------- */
.icon-btn.float { position: absolute; top: 14px; right: 14px; z-index: 3; width: 34px; height: 34px; background: rgba(0,0,0,.4); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.d-hero { position: relative; aspect-ratio: 16 / 10; background: var(--fill); display: grid; place-items: center; font-size: 72px; overflow: hidden; }
.d-hero img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.12); transition: transform 1.4s var(--ease), opacity .6s; }
.d-hero img.yt { transform: scale(1.5); }
.overlay.open .d-hero img { transform: none; }
.overlay.open .d-hero img.yt { transform: scale(1.34); }
.hero-play {
  position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border: 0; border-radius: 50%; color: #fff;
  display: grid; place-items: center; padding: 0 0 0 4px;
  background: rgba(0,0,0,.42); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform .45s var(--spring), background .3s;
  animation: pop .7s .25s var(--ease) both;
}
.hero-play svg { width: 30px; height: 30px; }
.hero-play:hover { transform: scale(1.1); background: rgba(0,0,0,.55); }
.hero-play:active { transform: scale(.92); }

.d-body { padding: 22px 26px 26px; }
.d-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--fill); padding: 3px 12px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-titlebar { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 6px; }
.d-titlebar h2 { flex: 1; min-width: 0; margin: 0; font-size: clamp(26px, 5vw, 34px); letter-spacing: -.025em; line-height: 1.2; word-break: break-word; }

.stars { display: flex; gap: 2px; margin-bottom: 18px; }
.stars button { border: 0; background: none; padding: 2px; color: var(--ink-3); transition: transform .35s var(--spring), color .25s; }
.stars button svg { width: 26px; height: 26px; display: block; }
.stars button path { fill: currentColor; }
.stars button.on { color: var(--ink); }
.stars button:hover { transform: scale(1.15); }
.stars button.pop { animation: starPop .5s var(--spring) both; animation-delay: calc(var(--i) * 40ms); }

.d-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.d-actions .btn { padding: 11px 20px; font-size: 15px; }
.d-actions .btn svg { width: 16px; height: 16px; }

.d-block { margin-bottom: 26px; }
.d-block h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: .06em; }
.d-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.d-head h4, .d-head h3 { margin: 0; }
.d-block ul, .d-block ol { margin: 0; padding: 0; list-style: none; }
.d-block li { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 40ms + .25s); }
.d-block.no-anim li { animation: none; }

.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--fill); border-radius: 999px; padding: 3px; }
.stepper button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--surface); font-size: 17px; font-weight: 600; line-height: 1; transition: transform .3s var(--spring); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stepper button:active { transform: scale(.85); }
.stepper button:disabled { opacity: .35; }
.stepper span { min-width: 64px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.scale-note { margin: -4px 0 6px; font-size: 12px; color: var(--ink-2); }

.ing li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ing li:last-child { border-bottom: 0; }
.ing .i-name { min-width: 0; word-break: break-word; }
.ing .i-amt { color: var(--ink-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 換算した量は色ではなく濃さと太さで示す */
.ing .i-amt.scaled { color: var(--ink); font-weight: 700; }
.ing .i-amt.bump { animation: bump .45s var(--spring); }
.ing li.i-head, .c-ing li.i-head { border-bottom: 0; padding: 16px 0 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }

.steps { counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 16px 42px; word-break: break-word; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--fill); color: var(--ink); font-size: 14px; font-weight: 700; display: grid; place-items: center;
}
.step-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
/* 手順の中の「押せるもの」(動画の頭出し・タイマー)は操作色 */
.chip-btn {
  display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 999px; padding: 4px 10px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--action-tint); color: var(--action);
  transition: transform .3s var(--spring), background .2s;
}
.chip-btn svg { width: 12px; height: 12px; }
.chip-btn:hover { transform: scale(1.06); }
.chip-btn:active { transform: scale(.92); }

.d-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 26px; }
.tag { max-width: 100%; border: 0; background: var(--fill); color: var(--action); border-radius: 999px; padding: 5px 12px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .3s var(--spring), background .2s; }
.tag:hover { background: var(--action-tint); }
.memo { color: var(--ink-2); white-space: pre-wrap; word-break: break-word; font-size: 15px; background: var(--sunken); padding: 14px 16px; border-radius: 14px; }
.memo a, .steps a, .c-steps a { color: var(--action); word-break: break-all; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* 作った記録 */
.log-sum { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.log-form { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease), opacity .4s; opacity: 0; }
.log-form.open { grid-template-rows: 1fr; opacity: 1; }
.log-form-inner { overflow: hidden; display: grid; gap: 8px; }
.log-form.open .log-form-inner { padding: 2px 2px 14px; }
.log-row { display: flex; gap: 8px; }
.log-form input[type="date"], .log-form input#logNote {
  border: 0; outline: 0; background: var(--sunken); border-radius: 12px; padding: 10px 12px; font-size: 15px; min-width: 0;
}
.log-form input[type="date"] { flex: 1; }
.log-photo { display: inline-flex; align-items: center; padding: 0 14px; border-radius: 12px; background: var(--sunken); font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--action); }
.log-photo.has { color: var(--ink); font-weight: 600; }
.log-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.log-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-list li:last-child { border-bottom: 0; }
.log-list .l-date { font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-list .l-note { flex: 1; min-width: 0; color: var(--ink-2); font-size: 14px; word-break: break-word; }
.log-list img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.log-list .l-del { border: 0; background: none; color: var(--ink-2); padding: 4px; opacity: .5; transition: opacity .2s, color .2s; }
.log-list .l-del:hover { opacity: 1; color: var(--danger); }

/* ---------- Form ---------- */
.form { padding-bottom: 24px; }
.photo {
  position: relative; display: grid; place-items: center; margin: 12px 24px 6px; aspect-ratio: 16 / 9;
  border-radius: 18px; background: var(--sunken); border: 2px dashed var(--line); color: var(--ink-2);
  overflow: hidden; cursor: pointer;
  transition: border-color .3s, transform .4s var(--spring);
}
.photo:hover, .photo.drag { border-color: var(--action); }
.photo.drag { transform: scale(1.02); }
.photo.filled { border-style: solid; border-color: transparent; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: pop .6s var(--ease) both; }
.photo-hint { display: grid; place-items: center; gap: 6px; font-size: 14px; font-weight: 500; text-align: center; padding: 0 12px; }
.photo-hint span { color: var(--action); }
.photo-hint small { font-size: 12px; font-weight: 400; }
.photo-remove {
  position: absolute; right: 10px; bottom: 10px; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
  background: rgba(0,0,0,.55); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.field { margin: 22px 24px 0; }
.field label, .field .lbl { display: block; margin: 0 0 8px 2px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lbl-row { display: flex; align-items: baseline; justify-content: space-between; }
.link.small { font-size: 13px; padding: 2px 4px; }
.field input, .field textarea {
  width: 100%; border: 0; outline: 0; background: var(--sunken); border-radius: 12px; padding: 12px 14px; font-size: 16px; resize: none;
  transition: box-shadow .3s var(--ease);
}
.field input:focus, .field textarea:focus { box-shadow: 0 0 0 2px var(--action); }
.field.shake input { animation: shake .45s; box-shadow: 0 0 0 2px var(--danger); }
.field input.filled-flash { animation: flash 1.2s var(--ease); }
.hint { margin: 6px 2px 0; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 24px; }
.field-row .field { margin: 22px 0 0; }
.suffix { position: relative; }
.suffix input { padding-right: 52px; }
.suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: 14px; pointer-events: none; }
.cat-picks { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.cat-pick {
  max-width: 100%; border: 0; border-radius: 999px; padding: 9px 16px; font-size: 15px; font-weight: 500; background: var(--sunken); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .3s, color .3s, transform .35s var(--spring);
}
.cat-pick:active { transform: scale(.92); }
.cat-pick.active { background: var(--selected-bg); color: var(--selected-fg); }
.form .actions { margin: 28px 24px 0; }
.form .sheet-head { padding-bottom: 12px; }

.video-prev {
  display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 8px; border-radius: 14px; background: var(--sunken);
  animation: rise .5s var(--ease) both;
}
.video-prev .vp-thumb { position: relative; width: 96px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; flex: none; background: var(--fill); display: grid; place-items: center; font-size: 22px; }
.video-prev .vp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-prev .vp-text { min-width: 0; font-size: 13px; }
.video-prev .vp-text b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-prev .vp-text span { color: var(--ink-2); }
.video-prev.bad { color: var(--danger); background: var(--danger-tint); font-size: 13px; padding: 10px 12px; }

/* ---------- 調理モード ---------- */
#cookOv { z-index: 55; }
.sheet.cook { max-width: 980px; }
.cook-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 18px 24px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 1px solid var(--line);
}
.cook-title { flex: 1; min-width: 0; }
.cook-title h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .04em; }
.wake {
  display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--fill); padding: 5px 10px; border-radius: 999px; opacity: .5; transition: all .4s;
}
.wake.on { opacity: 1; color: var(--success); background: var(--success-tint); }
.cook-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; padding: 24px; align-items: start; }
.cook-body h3 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.02em; }
.cook-ing { position: sticky; top: 92px; }
.c-prog { font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--fill); border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink-2); border-radius: inherit; transition: width .6s var(--ease), background .4s; }
.progress.done span { background: var(--success); }
.c-ing, .c-steps { list-style: none; margin: 0; padding: 0; }
.c-ing li:not(.i-head) {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 17px;
  user-select: none; transition: opacity .35s;
}
.c-ing .check {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-3); flex: none; display: grid; place-items: center; color: #fff;
  transition: background .3s, border-color .3s, transform .4s var(--spring);
}
.c-ing .check svg { width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .4s var(--spring); }
.c-ing .c-name { flex: 1; min-width: 0; position: relative; word-break: break-word; }
.c-ing .c-name::after { content: ""; position: absolute; left: 0; top: 52%; height: 1.5px; width: 0; background: currentColor; transition: width .35s var(--ease); }
.c-ing .c-amt { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-ing li.done { opacity: .45; }
.c-ing li.done .check { background: var(--success); border-color: var(--success); transform: scale(1.1); }
.c-ing li.done .check svg { opacity: 1; transform: none; }
.c-ing li.done .c-name::after { width: 100%; }
.c-steps li {
  position: relative; padding: 18px 18px 18px 64px; margin-bottom: 12px; border-radius: 18px; background: var(--sunken);
  font-size: 19px; line-height: 1.6; cursor: pointer; user-select: none; word-break: break-word;
  transition: opacity .4s, transform .4s var(--spring);
  animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 50ms + .2s);
}
.c-steps li:active { transform: scale(.985); }
.c-steps .num {
  position: absolute; left: 16px; top: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); color: var(--ink);
  font-size: 16px; font-weight: 700; display: grid; place-items: center; transition: background .3s, color .3s, transform .4s var(--spring);
}
.c-steps li.done { opacity: .45; }
.c-steps li.done .num { background: var(--success); color: #fff; transform: scale(.9); }
.c-steps .chip-btn { font-size: 14px; padding: 6px 12px; }

/* ---------- PiP 動画プレーヤー ---------- */
.pip {
  position: fixed; left: 0; top: 0; z-index: 70; touch-action: none;
  transition: transform .6s cubic-bezier(.2, 1.25, .35, 1), width .45s var(--ease);
  will-change: transform;
}
.pip-inner {
  border-radius: 16px; overflow: hidden; background: #000; color: #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,.35), 0 0 0 .5px rgba(255,255,255,.08);
  transition: transform .35s var(--spring), box-shadow .35s;
}
.pip.dragging .pip-inner { transform: scale(1.05); box-shadow: 0 28px 70px rgba(0,0,0,.45); }
.pip.dragging iframe { pointer-events: none; }
.pip-bar {
  height: 40px; display: none; align-items: center; gap: 8px; padding: 0 8px 0 12px; cursor: grab;
  background: rgba(28,28,30,.96); user-select: none; touch-action: none;
}
.pip.big .pip-bar { display: flex; }
.pip-video { position: relative; }
.pip-frame { position: absolute; inset: 0; }
/* 小さいときは動画の上に透明な面を重ねて、どこを持っても動かせるようにする */
.pip-shield { position: absolute; inset: 0; z-index: 1; cursor: grab; touch-action: none; user-select: none; background: rgba(0,0,0,0); transition: background .3s; }
.pip.big .pip-shield { display: none; }
.pip.dragging .pip-shield { cursor: grabbing; }
.pip.ctrls .pip-shield { background: rgba(0,0,0,.38); }
.pip-ctl {
  position: absolute; border: 0; padding: 0; display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transform: scale(.8);
  transition: opacity .25s var(--ease), transform .35s var(--spring), background .2s;
}
.pip.ctrls .pip-ctl { opacity: 1; pointer-events: auto; transform: none; }
.pip-ctl:active { transform: scale(.85) !important; }
.pip-ctl.corner { top: 8px; width: 32px; height: 32px; border-radius: 50%; }
.pip-ctl.left { left: 8px; }
.pip-ctl.right { right: 8px; }
.pip-ctl.center { left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; }
.pip-ctl.center svg { width: 24px; height: 24px; }
.pip.dragging .pip-bar { cursor: grabbing; }
.grip { width: 18px; height: 10px; flex: none; background: radial-gradient(circle, rgba(255,255,255,.5) 1.2px, transparent 1.6px) 0 0 / 6px 5px; }
.pip-title { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.pip-btn { width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; padding: 0; transition: background .2s, transform .3s var(--spring); }
.pip-btn:hover { background: rgba(255,255,255,.24); }
.pip-btn:active { transform: scale(.85); }
.pip-video { aspect-ratio: 16 / 9; }
.pip-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.pip.flash .pip-inner { animation: pipFlash .6s var(--ease); }

/* ---------- タイマー ---------- */
.timers {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 80; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px);
}
.timer {
  pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 16px; border-radius: 999px; color: #fff; min-width: 230px; max-width: 100%;
  background: rgba(30,30,32,.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 12px 34px rgba(0,0,0,.3);
  animation: timerIn .55s var(--spring) both;
}
.timer .t-prog { position: absolute; inset: 0; right: auto; width: 0; background: rgba(255,255,255,.12); transition: width .3s linear; pointer-events: none; }
.timer > *:not(.t-prog) { position: relative; }
.timer .t-time { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.timer .t-label { flex: 1; min-width: 0; font-size: 13px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.timer button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: inherit; display: grid; place-items: center; padding: 0; flex: none; transition: transform .3s var(--spring), background .2s; }
.timer button:active { transform: scale(.85); }
.timer.paused .t-time { opacity: .5; }
/* 終了は「注意色」:すぐ気づいてほしいが、危険ではない */
.timer.done { background: var(--attention); color: #1d1d1f; animation: timerIn .55s var(--spring) both, ring 1s ease-in-out infinite; }
.timer.done button { background: rgba(0,0,0,.12); }
.timer.done .t-prog { display: none; }
.timer.out { animation: timerOut .3s var(--ease) forwards; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); z-index: 99;
  transform: translate(-50%, -20px) scale(.9); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
  background: rgba(40, 40, 42, .92); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 15px; font-weight: 500;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: transform .55s var(--spring), opacity .3s;
}
.toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; }

/* ---------- Keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes heartPop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes starPop { 0% { transform: scale(.6) rotate(-20deg); } 60% { transform: scale(1.3) rotate(8deg); } 100% { transform: none; } }
@keyframes bump { 0% { transform: translateY(-6px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px var(--action-tint), 0 0 0 1px var(--action); } }
@keyframes pipFlash { 50% { box-shadow: 0 0 0 3px #fff, 0 18px 50px rgba(0,0,0,.35); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes steam { 0%, 100% { opacity: 1; transform: translateY(0); } 50% { opacity: .55; transform: translateY(-22px); } }
@keyframes fabIn { from { opacity: 0; transform: scale(.4) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes timerIn { from { opacity: 0; transform: translateY(30px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes timerOut { to { opacity: 0; transform: translateY(20px) scale(.85); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-3deg); } 20% { transform: rotate(3deg); } 30% { transform: rotate(-2deg); } 40% { transform: rotate(0); } }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .cook-body { grid-template-columns: 1fr; gap: 28px; }
  .cook-ing { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px 120px; }
  .nav-inner { padding: 0 16px; }
  .chips { margin: 22px -16px 0; padding: 4px 16px 8px; justify-content: flex-start; }
  .sub-chips { margin-top: 2px; }
  .toolbar { flex-wrap: wrap; }
  .tools { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .count { order: -1; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 12px 14px; }
  .card-body h3 { font-size: 15px; }
  .card .fav { width: 30px; height: 30px; top: 8px; right: 8px; }
  .card .fav svg { width: 16px; height: 16px; }
  .badge-play { left: 8px; bottom: 8px; }
  .overlay { padding: 40px 0 0; }
  .sheet { margin: auto 0 0; border-radius: 28px 28px 0 0; min-height: 40vh; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .overlay.gate { padding: 0 16px; }
  .gate-sheet { margin: auto 0; border-radius: 28px; min-height: 0; transform: translateY(30px); }
  #cookOv { padding: 0; }
  .sheet.cook { border-radius: 0; min-height: 100%; }
  .cook-head { padding: 14px 16px; }
  .cook-body { padding: 18px 16px 120px; }
  .c-steps li { font-size: 18px; padding: 16px 14px 16px 58px; }
  .c-steps .num { left: 12px; top: 16px; }
  .d-body, .sheet-head { padding-left: 20px; padding-right: 20px; }
  .set-body { padding: 4px 20px 28px; }
  .field, .photo { margin-left: 20px; margin-right: 20px; }
  .fab { --fab-gap: 20px; }
  .field-row { margin: 0 20px; }
  .timer { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
