/* UI refinement trial (2026-12-04) — owner review; not adopted and not released.
   Everything is scoped to html.ui-refine, which ui_refine_trial.js sets only after ?refine=1 was
   opened in this browser (?refine=0 turns it off). From 600px, where the rail appears; phones keep the current layout.

   The colour tokens stay. What changes is the layering:
     tinted canvas → translucent work panel → white lifted cards,
   a white floating rail (owner's choice; a dark olive rail was tried and dropped), one corner scale
   (panel 28 / card 20 / control 10), and inner margins wide enough that no text sits against a
   panel edge (owner 2026-12-04: 「矩形とマージンがほとんどないところがありそう」). */
html.ui-refine {
  --rf-r-panel:28px; --rf-r-card:20px;
  --rf-pad-x:36px; --rf-pad-top:30px;
  --rf-tile:#faf9f6;
  --rf-rail-lift:0 1px 0 rgba(255,255,255,.9) inset,0 1px 2px rgba(41,45,41,.05),0 14px 34px -16px rgba(41,45,41,.22);
  --rf-panel-lift:0 0 0 1px rgba(255,255,255,.85) inset,0 30px 60px -34px rgba(41,45,41,.3);
  --rf-card-lift:0 1px 0 #fff inset,0 1px 2px rgba(41,45,41,.06),0 22px 44px -24px rgba(41,45,41,.34);
  --rf-soft-lift:0 1px 0 #fff inset,0 1px 2px rgba(41,45,41,.1),0 8px 18px -10px rgba(41,45,41,.3);
}
@media (min-width:600px) {
  html.ui-refine {--control-radius:10px}
  /* ── 1. Canvas and rail: every screen that has the shell ── */
  html.ui-refine body:is(.notebook-page,.plate-page,.classes-page) {
    background:linear-gradient(155deg,#dfe6da 0%,#e8e7dc 48%,#efebe1 100%) fixed;
  }
  html.ui-refine body #workspace-primary-shell {background:transparent;border-right-color:transparent}
  html.ui-refine body #workspace-primary-shell::before {
    content:"";position:absolute;inset:10px 8px 10px 10px;z-index:0;border-radius:22px;
    background:var(--paper);box-shadow:var(--rf-rail-lift);pointer-events:none;
  }
  html.ui-refine body #workspace-primary-shell>* {z-index:1}
  /* ロゴの位置 (2026-12-05, owner: 「アプリロゴの位置が違和感あり」): 白いレールは上端から10px下で始まるのに、ロゴの枠は
     既定のまま上端から10pxにあり、印がレールの上の角に寄っていた（上の空き約12px、左右は17〜19px）。
     ロゴ・開閉ボタン・メニューを同じ8pxだけ下げる。開いたときも閉じたときも同じ量なので、アイコンは動かない。 */
  html.ui-refine body #workspace-primary-shell>:is(#home-link,.workspace-menu-toggle) {top:18px}
  html.ui-refine body #workspace-primary-shell>#workspace-primary-nav {top:82px}
  html.ui-refine body .app-header {background:transparent}
  html.ui-refine body #workspace-primary-nav a {transition:background-color .16s ease,color .16s ease}
  html.ui-refine body #workspace-primary-nav a[aria-current=page],
  html.ui-refine body #workspace-primary-nav a[aria-current=page]:is(:hover,:focus-visible) {
    border-radius:13px;background:var(--action);color:#fff;box-shadow:0 6px 14px -6px rgba(52,70,48,.55);
  }
  html.ui-refine body #workspace-primary-nav a[aria-current=page] svg {color:#fff;stroke:#fff}

  /* ── 2. Work panel: one per screen, 10px from the window and the rail ── */
  html.ui-refine body main#discovery-workspace,
  html.ui-refine body main#notebook-home,
  html.ui-refine body main#plate-home,
  html.ui-refine body main#pantry-planner,
  html.ui-refine body .app>main.analysis-workspace-main {
    box-sizing:border-box;min-height:calc(100vh - 20px);border-radius:var(--rf-r-panel);
    background:rgba(255,255,255,.5);box-shadow:var(--rf-panel-lift);
  }
  html.ui-refine body main#discovery-workspace,
  html.ui-refine body main#notebook-home,
  html.ui-refine body main#plate-home {margin:10px;padding:var(--rf-pad-top) var(--rf-pad-x) 48px}
  html.ui-refine body main#pantry-planner {margin:10px}
  /* .app's own padding changes with the width (18px to 30px), so the trial fixes it at 10px
     instead of reaching out of it with negative margins. */
  html.ui-refine body .app:has(>main.analysis-workspace-main) {padding:10px!important}
  html.ui-refine body .app>main.analysis-workspace-main {margin:0;padding:var(--rf-pad-top) var(--rf-pad-x) 30px}
  html.ui-refine body .app>aside#notebook-sidebar {padding-inline:var(--rf-pad-x)}
  html.ui-refine body #recipe-analysis-dialog,
  html.ui-refine body #recipe-analysis-dialog .analysis-header {background:transparent}

  /* Page titles */
  html.ui-refine body #recipe-analysis-title,
  html.ui-refine body .assembly-home-top h1,
  html.ui-refine body .discovery-page-heading h1,
  html.ui-refine body .notebook-home-heading h1,
  html.ui-refine body main#plate-home>header h1,
  html.ui-refine body main#pantry-planner .task-head h1 {font-size:30px;font-weight:400;line-height:1.3}

  /* ── 3. 組み立てる・掛け合わせる ── */
  html.ui-refine #recipe-analysis-dialog .analysis-header button,
  html.ui-refine #recipe-analysis-dialog .iwb-header-actions button,
  html.ui-refine #recipe-analysis-dialog .iwb-start-menu>summary {
    border-radius:999px;border-color:transparent;background:var(--paper);padding-inline:16px;box-shadow:var(--rf-soft-lift);
  }
  html.ui-refine #recipe-analysis-dialog .iwb-start-menu>summary {background:var(--action);color:#fff}
  html.ui-refine #recipe-analysis-dialog .iwb-start-menu>summary svg {color:#fff;stroke:#fff}
  html.ui-refine #recipe-analysis-dialog .iwb-seed {border-radius:16px}

  /* Overview: seven thin tiles; counts lead as numbers. Kept light so the edit card leads. */
  html.ui-refine #recipe-analysis-dialog dl.iwb-overview {border:0;gap:12px;padding:0;margin:8px 0 20px;align-items:stretch}
  html.ui-refine #recipe-analysis-dialog dl.iwb-overview>div {
    min-width:0;padding:14px 16px 12px!important;border:0!important;border-radius:16px;background:rgba(255,255,255,.72);
    box-shadow:0 0 0 1px rgba(255,255,255,.9) inset,0 1px 2px rgba(41,45,41,.05);
  }
  html.ui-refine #recipe-analysis-dialog dl.iwb-overview dt {color:var(--ink-soft);font-size:12px;line-height:1.5}
  html.ui-refine #recipe-analysis-dialog dl.iwb-overview dd[data-iwb-metric] {font-size:30px;font-weight:300;line-height:1.2;letter-spacing:0;white-space:nowrap;font-variant-numeric:tabular-nums}
  html.ui-refine #recipe-analysis-dialog dl.iwb-overview dd[data-iwb-metric] button {font:inherit;white-space:nowrap;padding-inline:0;border-radius:8px}
  html.ui-refine #recipe-analysis-dialog dl.iwb-overview dd[data-iwb-metric] small {margin-left:2px;font-size:12px;font-weight:400;color:var(--ink-soft)}
  html.ui-refine #recipe-analysis-dialog dl.iwb-overview dd:not([data-iwb-metric]) {font-size:16px;line-height:1.5}

  /* The edit card and the next-move panel are the two lifted cards */
  html.ui-refine #recipe-analysis-dialog .iwb>section.iwb-block,
  html.ui-refine #recipe-analysis-dialog section.iwb-block:not(.iwb-side *) {border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift)}
  html.ui-refine #recipe-analysis-dialog .iwb-side {border-radius:var(--rf-r-card);box-shadow:0 1px 0 rgba(255,255,255,.7) inset,0 22px 44px -24px rgba(41,45,41,.34)}
  html.ui-refine #recipe-analysis-dialog .iwb-side details.iwb-fold {
    margin:10px 0 0;padding:0 14px;border:0;border-radius:14px;background:var(--paper);
    box-shadow:0 1px 2px rgba(41,45,41,.06),0 10px 20px -14px rgba(41,45,41,.3);
  }
  html.ui-refine #recipe-analysis-dialog .iwb-side details.iwb-fold[open] {padding-bottom:12px}
  html.ui-refine #recipe-analysis-dialog .iwb-side details.iwb-fold>summary {border-radius:12px}
  html.ui-refine #recipe-analysis-dialog .iwb-side details.iwb-fold~section.iwb-recipe {margin-top:18px}
  html.ui-refine #recipe-analysis-dialog .iwb-row {margin-top:6px;border:0;border-radius:12px;background:var(--bg)}
  /* 材料の行 (2026-12-05): 未選択の調理法は静かに、選んだ行だけ濃く。件数と「工程から反映」は一覧の上に一か所。
     注記は種類で見た目を分ける — 状態のタグは白い小さな札、下処理の説明は行の2行目の本文。 */
  html.ui-refine #recipe-analysis-dialog .iwb-method-tools {display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin:4px 0 12px}
  html.ui-refine #recipe-analysis-dialog .iwb-method-count:not([hidden]) {margin:0;font-size:13px;font-weight:600;color:var(--ink)}
  html.ui-refine #recipe-analysis-dialog .iwb .iwb-method-tools [data-iwb-recheck-methods] {
    min-height:34px;padding:6px 16px;border:1px solid var(--line)!important;border-radius:999px!important;background:var(--paper);
    color:var(--ink);font-size:13px;text-decoration:none;box-shadow:var(--rf-soft-lift);
  }
  html.ui-refine #recipe-analysis-dialog .iwb .iwb-row select[data-iwb-method-unset] {
    border-color:var(--line)!important;background-color:rgba(255,255,255,.55);color:var(--ink-soft);box-shadow:none;
  }
  html.ui-refine #recipe-analysis-dialog .iwb .iwb-row select[data-iwb-method-unset]:is(:hover,:focus-visible) {border-color:var(--control-border)!important;background-color:var(--paper);color:var(--ink)}
  html.ui-refine #recipe-analysis-dialog .iwb .iwb-row-tag:not(.iwb-row-tag-fresh,.iwb-row-tag-prep) {
    padding:1px 8px;border:1px solid var(--line);border-radius:999px;background:var(--paper);color:var(--ink-soft);
  }
  html.ui-refine #recipe-analysis-dialog .iwb .iwb-source-amount {color:var(--ink-soft)}
  /* 掛け合わせる: 2品を選んだ後の組と設定を一枚のカードに */
  html.ui-refine #recipe-analysis-dialog section#lab-panel:has(>.lab-fusion-pair) {
    margin-top:14px;padding:24px 28px;border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift);
  }
  html.ui-refine #recipe-analysis-dialog .lab-start.lab-selected-dish {border-radius:16px;background:rgba(255,255,255,.72);padding:14px 18px}
  /* 右から出るパネル（狙い・履歴・材料知識・配合）: 画面の端から10px離して浮かせる */
  html.ui-refine #recipe-analysis-dialog :is(.iwb-history-panel,.iwb-aims-panel,.iwb-knowledge-panel,.iwb .iwb-aims-fold[open]>.iwb-goals) {
    top:10px;right:10px;bottom:10px;max-height:calc(100dvh - 20px);max-width:calc(100vw - 20px);padding:26px 28px;border:0;border-radius:24px;
    box-shadow:0 0 0 1px rgba(41,45,41,.06),0 28px 60px -20px rgba(41,45,41,.42);
  }
  html.ui-refine #recipe-analysis-dialog .iwb-lower .iwb-process-block {margin-top:16px;padding:20px 22px;border:0;border-radius:16px}
  html.ui-refine #recipe-analysis-dialog .iwb-savebar {
    border-radius:999px;border-color:transparent;padding-inline:22px;
    box-shadow:0 1px 0 #fff inset,0 0 0 1px rgba(255,255,255,.9),0 18px 40px -14px rgba(41,45,41,.4);
  }

  /* ── 4. 出会う: 今日の一皿, 料理を探す, ブックマーク ── */
  html.ui-refine body main#discovery-workspace #discovery-daily,
  html.ui-refine body main#discovery-workspace #discovery-dish-map,
  html.ui-refine body main#discovery-workspace .discovery-hero.discovery-pick {
    padding:28px 32px;border:0;border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift);
  }
  html.ui-refine body main#discovery-workspace #discovery-dish-map {margin-top:16px}
  html.ui-refine body main#discovery-workspace #discovery-daily img,
  html.ui-refine body main#discovery-workspace .discovery-hero.discovery-pick img {border-radius:16px}
  html.ui-refine body main#discovery-workspace #discovery-dish-map svg {border-radius:14px}
  html.ui-refine body main#discovery-workspace #discovery-daily .discovery-daily-quiz button:not(.discovery-text-action) {
    border-radius:12px;border-color:var(--rule);background:var(--rf-tile);box-shadow:0 1px 2px rgba(41,45,41,.05);
  }
  html.ui-refine body main#discovery-workspace #discovery-daily .discovery-daily-quiz button:not(.discovery-text-action):hover {border-color:var(--action);background:var(--paper)}
  html.ui-refine body main#discovery-workspace form.discovery-entry-search {border-bottom:0;padding-bottom:20px}
  html.ui-refine body main#discovery-workspace .discovery-entry-browse {border-radius:14px}
  html.ui-refine body main#discovery-workspace section.discovery-themes {border-top:0}
  html.ui-refine body main#discovery-workspace article.discovery-tile {border-radius:16px;box-shadow:0 14px 28px -18px rgba(41,45,41,.4)}

  /* 料理の一覧: the four ways to search are one segmented control; the filters are a card */
  html.ui-refine body main#discovery-workspace nav.discovery-search-methods {
    display:flex;flex-wrap:wrap;gap:4px;padding:6px;border-radius:16px;background:rgba(255,255,255,.6);
  }
  html.ui-refine body main#discovery-workspace a.discovery-search-method {border-radius:11px;border-bottom-color:transparent}
  html.ui-refine body main#discovery-workspace a.discovery-search-method[aria-current] {background:var(--paper);box-shadow:var(--rf-soft-lift)}
  html.ui-refine body main#discovery-workspace form.discovery-filters {
    padding:22px 26px;border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift);
  }
  html.ui-refine body main#discovery-workspace details.discovery-filter-details {border-bottom-color:transparent}

  /* 料理の詳細: each reading section is its own card */
  html.ui-refine body main#discovery-workspace .discovery-hero.discovery-reading-first,
  html.ui-refine body main#discovery-workspace section.discovery-reading {
    margin-top:16px;padding:clamp(20px,2.6vw,28px) clamp(20px,3vw,32px)!important;border:0;border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift);
  }
  html.ui-refine body main#discovery-workspace .discovery-hero.discovery-reading-first img {border-radius:16px}
  html.ui-refine body main#discovery-workspace .discovery-recipe-body {column-gap:16px;align-items:start}
  html.ui-refine body main#discovery-workspace :is(.discovery-cooking-record,.discovery-next) {border-top-color:transparent}

  /* 開いたレールの中身が画面より長いとき、スクロールバーが白いレールの外（地の上）に出るので隠す。スクロールはできる。 */
  html.ui-refine body #workspace-primary-nav {scrollbar-width:none}
  html.ui-refine body #workspace-primary-nav::-webkit-scrollbar {display:none}

  /* ── 5. 記録する, 盛り合わせる (list pages) ── */
  html.ui-refine body main#notebook-home .notebook-home-empty,
  html.ui-refine body main#plate-home .plate-home-empty {
    padding:28px 32px;border:0;border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift);
  }
  html.ui-refine body main#notebook-home .notebook-home-banner {border-radius:16px}
  html.ui-refine body main#notebook-home ul.notebook-home-recipes {
    padding:4px 10px;border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift);
  }
  html.ui-refine body main#notebook-home ul.notebook-home-recipes>li:last-child {border-bottom:0}
  /* すべての料理（一覧だけを開いた状態）: 一覧そのものを作業面にする */
  html.ui-refine body.notebook-page.notebook-library-open .app>aside#notebook-sidebar {
    box-sizing:border-box;min-height:calc(100vh - 20px);padding:26px var(--rf-pad-x) 30px;
    border-radius:var(--rf-r-panel);background:rgba(255,255,255,.5);box-shadow:var(--rf-panel-lift);
  }
  html.ui-refine body main#notebook-home .notebook-home-tools,
  html.ui-refine body main#plate-home>details {border-top-color:transparent}

  /* 盛り合わせる (editing a plate) */
  html.ui-refine body.plate-page .app-shell:has(>main:not(#plate-home)) {padding:10px!important;row-gap:0}
  /* Between 600px and the wide layout the plate page keeps an empty 62px header band; the panel replaces it. */
  html.ui-refine body.plate-page header.app-header {min-height:0!important;height:0!important;padding-block:0!important}
  html.ui-refine body.plate-page .workspace-navigation {display:none}
  html.ui-refine body.plate-page .app-shell>main:not(#plate-home) {
    box-sizing:border-box;min-height:calc(100vh - 20px);margin:0;padding:22px var(--rf-pad-x) 30px;
    border-radius:var(--rf-r-panel);background:rgba(255,255,255,.5);box-shadow:var(--rf-panel-lift);
  }
  html.ui-refine body.plate-page .app-shell>main:not(#plate-home)>:is(.workspace-head,.work-area) {background:transparent}
  html.ui-refine body.plate-page .app-shell>main:not(#plate-home)>.workspace-head {padding-inline:0}
  html.ui-refine body.plate-page #plate-account-storage {padding:14px 28px 0;min-height:0}
  /* 一覧の上の案内（読み込み・取り込み）: 既定の68pxの上余白は、なくなった右上の切り替えを避けるためのもの。
     試し版ではパネルのすぐ上に、パネルの本文と同じ左位置で置き、区切り線は引かない (2026-12-05)。 */
  html.ui-refine body.plate-home-open>#plate-account-storage {margin-top:10px;padding:8px 46px 0;border-bottom:0}
  html.ui-refine body.plate-home-open>#plate-account-storage p {margin:4px 0}
  html.ui-refine body.plate-home-open>#plate-account-storage summary {min-height:32px;padding:4px 0}
  html.ui-refine body.plate-page #nav {border-radius:16px;background:rgba(255,255,255,.6)}
  html.ui-refine body.plate-page #nav>button {border-radius:11px}
  html.ui-refine body.plate-page .plate-canvas {border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift)}
  html.ui-refine body.plate-page #inspector {border-top-color:transparent}
  html.ui-refine body.plate-page #inspector :is(details.stock-drawer,details.artisan-picker) {
    border-color:transparent;border-radius:16px;box-shadow:var(--rf-soft-lift);
  }
  html.ui-refine body.plate-page #inspector section.stock {border-color:transparent;border-radius:16px;box-shadow:var(--rf-soft-lift)}
  html.ui-refine body.plate-page main#plate-home .workspace-resume-card,
  html.ui-refine body main#notebook-home .workspace-resume-card {border-color:transparent;border-radius:var(--rf-r-card);box-shadow:var(--rf-card-lift)}
  html.ui-refine body.plate-page #nav>button[aria-pressed=true] {box-shadow:var(--rf-soft-lift)}
  html.ui-refine body.plate-page #plate-link-status:not(:empty) {margin-inline:0;border-radius:14px}
  html.ui-refine body.bookmarks-open main#discovery-workspace {background:rgba(255,255,255,.5)}

  /* 記録する (one recipe open): the record itself is the lifted card */
  html.ui-refine body.notebook-page main.analysis-workspace-main>#feature {border:0;border-radius:var(--rf-r-card);overflow:hidden;box-shadow:var(--rf-card-lift)}

  /* Sheets and dialogs sit above the panel with the card corner */
  html.ui-refine body .ref-sheet {border-radius:var(--rf-r-card);overflow:hidden}
  html.ui-refine body dialog:not(.iwb-aims-dialog) {border-radius:var(--rf-r-card)}

  /* 設定: the sheet takes the card corner; each setting block is a soft inset card */
  html.ui-refine body .settings-sheet {border-radius:var(--rf-r-card)!important;overflow:hidden auto}
  html.ui-refine body .settings-sheet .settings-section {border-color:var(--rule-soft);border-radius:14px;background:var(--rf-tile)}

  /* クラス */
  html.ui-refine body.classes-page .workspace-layout {padding:10px!important}
  html.ui-refine body.classes-page main.class-workspace {
    box-sizing:border-box;min-height:calc(100vh - 20px);padding:var(--rf-pad-top) var(--rf-pad-x) 48px;
    border-radius:var(--rf-r-panel);background:rgba(255,255,255,.5);box-shadow:var(--rf-panel-lift);
  }
  html.ui-refine body.classes-page #class-status {border-radius:14px}

  /* ── 6. あるもので作る ── */
  html.ui-refine body main#pantry-planner .task-panel {border:0;border-radius:var(--rf-r-card);padding:26px 28px;box-shadow:var(--rf-card-lift)}
  html.ui-refine body main#pantry-planner .pantry-safety {border-color:transparent;border-radius:14px}
  html.ui-refine body main#pantry-planner :is(.pantry-summary,.pantry-card,.pantry-aside) {border-radius:14px}
  html.ui-refine body main#pantry-planner .task-alert {border-radius:12px}
}
/* ── 7. アカウント・ログイン・招待（一枚のカードの画面）──
   これらの画面は850px以下でカードが画面いっぱいになるので、新案はカードに余白がある幅だけに当てる。 */
@media (min-width:851px) {
  html.ui-refine body[data-account-page] {min-height:100svh;background:linear-gradient(155deg,#dfe6da,#e8e7dc 48%,#efebe1) fixed}
  html.ui-refine body[data-account-page]>.result,
  html.ui-refine body[data-account-page]>.account-layout {border-radius:var(--rf-r-panel);box-shadow:var(--rf-card-lift)}
  html.ui-refine body[data-account-page]>.result {padding:44px 48px}
  html.ui-refine body[data-account-page] .account-panel {border-radius:var(--rf-r-card)}
  html.ui-refine body[data-account-page="login"] .introduction::after {border-radius:16px}
  html.ui-refine body[data-account-page="account"] .billing-section {margin-top:20px;padding:22px 26px;border-radius:var(--rf-r-card);background:var(--rf-tile)}
  html.ui-refine body[data-account-page="account"] .billing-section .usage-item {background:#fff;border-radius:14px;box-shadow:0 1px 2px rgba(41,45,41,.06)}
  html.ui-refine body[data-account-page="account"] .billing-actions {margin:22px 0 28px}
  html.ui-refine body[data-account-page] :is(.auth-notice,.usage-warning) {border-radius:12px}
  /* 「ログアウト」「ログインをやり直す」「別のアカウントでログインする」など控えめなボタンも同じ丸い形にそろえる (2026-12-05) */
  html.ui-refine body[data-account-page] button {border-radius:999px}
  /* 枠のないボタンは白地の上で形が見えないので、細い線で輪郭を出す */
  html.ui-refine body[data-account-page] button.quiet {border:1px solid var(--line)}
  html.ui-refine body[data-account-page] input:not([type=checkbox]):not([type=radio]) {border-radius:10px}
}

/* ── 8. プランを選ぶ ── */
@media (min-width:600px) {
  html.ui-refine body.plans-page {background:linear-gradient(155deg,#dfe6da,#e8e7dc 48%,#efebe1) fixed}
  html.ui-refine body.plans-page .plans-header {background:transparent;border-bottom-color:transparent}
  html.ui-refine body.plans-page .plan-card {border-color:transparent;border-radius:var(--rf-r-card);padding:30px 24px 26px;box-shadow:var(--rf-card-lift)}
  html.ui-refine body.plans-page .plan-card:hover {border-color:transparent;box-shadow:var(--rf-card-lift),0 0 0 1px var(--action)}
  html.ui-refine body.plans-page .plan-card:has(input:checked) {border-color:transparent;box-shadow:var(--rf-card-lift),0 0 0 2px var(--action)}
  html.ui-refine body.plans-page .recommendation {border-radius:999px}
  html.ui-refine body.plans-page .preview-note>span {border-color:transparent;border-radius:999px;padding:2px 10px}
  html.ui-refine body.plans-page .included-note {margin-top:22px;padding:18px 24px;border:0;border-radius:var(--rf-r-card);background:rgba(255,255,255,.5)}
  html.ui-refine body.plans-page .comparison-scroll {border-color:transparent;border-radius:var(--rf-r-card);box-shadow:var(--rf-card-lift)}
  html.ui-refine body.plans-page .faq-list {padding:6px 26px;border-radius:var(--rf-r-card);background:var(--paper);box-shadow:var(--rf-card-lift)}
  html.ui-refine body.plans-page .faq-list details:last-child {border-bottom:0}
  html.ui-refine body.plans-page :is(.primary-button,.secondary-button) {border-radius:999px}
  html.ui-refine body.plans-page .selection-bar {
    left:16px;right:16px;bottom:14px;padding:14px 26px;border:0;border-radius:28px;
    box-shadow:0 0 0 1px rgba(41,45,41,.06),0 24px 50px -22px rgba(41,45,41,.45);
  }
  html.ui-refine body.plans-page #selection-dialog {border-color:transparent;border-radius:var(--rf-r-card)}
}
@media (min-width:600px) and (prefers-reduced-motion:reduce) {
  html.ui-refine body #workspace-primary-nav a {transition:none}
}

/* あるもので作る：選んだときの動きと、選んだ料理の帯 (2026-12-06)。
   押した場所は pantry_planner.js が画面上で動かさずに保つ。ここは、押して増えたものが短く現れる動きと、
   「いま入れている料理」を上に留める細い帯。 */
@media (min-width:600px) {
  html.ui-refine body main#pantry-planner .pantry-picked .pantry-tiles {align-items:center}
  html.ui-refine body main#pantry-planner .pantry-picked-amounts {margin-left:6px;font-size:12px;min-height:32px}
  /* 選んだ材料は、下の一覧の「選択中」と見分けがつくように白地のまま、×で外せる札にする */
  html.ui-refine body main#pantry-planner .pantry-tile-picked {background:var(--paper,#fff);border-color:var(--action);border-radius:999px;padding-right:8px}
  html.ui-refine body main#pantry-planner .pantry-tile-picked .pantry-x {color:var(--ink-soft);margin-left:2px}

  html.ui-refine body main#pantry-planner .pantry-chosen {position:sticky;top:10px;z-index:5;display:flex;align-items:center;gap:18px;padding:10px 20px;border:0;box-shadow:0 6px 22px rgba(40,44,30,.13)}
  html.ui-refine body main#pantry-planner .pantry-chosen h2 {flex:none;margin:0;font-size:13px;font-weight:600;white-space:nowrap}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-set {flex:1;min-width:0;display:flex;grid-template-columns:none;gap:14px;margin:0;padding:6px 2px;overflow-x:auto;scrollbar-width:thin}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-set>li {flex:none;flex-direction:row;align-items:center;gap:8px;max-width:210px}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-set button.pantry-photo {width:48px;flex:none;border-radius:10px}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-set button.pantry-photo {overflow:visible}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-set .pantry-photo img {border-radius:10px}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-caption {margin:0}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-caption strong {font-size:12px;-webkit-line-clamp:1}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-left {top:auto;bottom:-6px;right:-8px;padding:0 5px;font-size:10px;line-height:1.5}
  html.ui-refine body main#pantry-planner .pantry-chosen .pantry-chosen-x {top:-6px;left:-6px;width:20px;height:20px;font-size:14px}
}
@media (min-width:600px) and (prefers-reduced-motion:no-preference) {
  @keyframes rf-pantry-pop {from {opacity:0;transform:scale(.86)} to {opacity:1;transform:none}}
  @keyframes rf-pantry-press {from {background:var(--paper,#fff)} to {background:var(--accent-soft)}}
  @keyframes rf-pantry-rise {from {opacity:0;transform:translateY(8px)} to {opacity:1;transform:none}}
  @keyframes rf-pantry-row {from {background:var(--accent-soft)} to {background:transparent}}
  html.ui-refine body main#pantry-planner .pantry-tile-picked.is-new {animation:rf-pantry-pop 180ms cubic-bezier(.2,.8,.3,1) both;animation-delay:var(--rf-run,0ms)}
  html.ui-refine body main#pantry-planner .pantry-tile[data-pick].is-new {animation:rf-pantry-press 160ms ease-out both;animation-delay:var(--rf-run,0ms)}
  html.ui-refine body main#pantry-planner .pantry-row.is-new {animation:rf-pantry-row 900ms ease-out both;animation-delay:var(--rf-run,0ms)}
  html.ui-refine body main#pantry-planner .pantry-chosen li:has(>.is-new) {animation:rf-pantry-pop 260ms cubic-bezier(.2,.8,.3,1) both;animation-delay:var(--rf-run,0ms)}
  html.ui-refine body main#pantry-planner #pantry-candidates-title.is-new ~ :is(.pantry-cards,.pantry-aside) {animation:rf-pantry-rise 240ms ease-out both;animation-delay:var(--rf-run,0ms)}
}

/* あるもので作る：材料の量と条件の入力欄 (2026-12-06)。
   名前と量の欄が画面の両端に離れていたのを寄せ、数字ひとつの欄や説明文が横いっぱいに伸びないようにし、
   問いごとの間をあけて区切りを付ける。選ぶボタンは、丸印を重ねずに塗りと印で選択を示す。 */
@media (min-width:900px) {
  html.ui-refine body main#pantry-planner .pantry-screen-input :is(.pantry-rows,.pantry-rows+.task-note) {max-width:660px}
  html.ui-refine body main#pantry-planner .pantry-screen-input .pantry-grid:has(>label:only-child) {max-width:333px}
  html.ui-refine body main#pantry-planner .pantry-screen-input :is(p.task-note,.pantry-open,.pantry-grid small,.pantry-range-also small) {max-width:74ch}
}
@media (min-width:600px) {
  html.ui-refine body main#pantry-planner .pantry-screen-input .pantry-rows {margin-top:4px;border-top:1px solid var(--rule,#e4e1d8);border-bottom:1px solid var(--rule,#e4e1d8)}
  html.ui-refine body main#pantry-planner .pantry-screen-input .pantry-flags .pantry-check {border-style:solid;border-color:var(--line)}
  /* 問いの見出しは本文より一段はっきり、問いと問いの間は広く */
  html.ui-refine body main#pantry-planner .pantry-screen-input :is(.pantry-choice>legend,.pantry-grid>label,.pantry-range-also>label,h3) {font-weight:600;color:var(--ink)}
  html.ui-refine body main#pantry-planner .pantry-screen-input .task-panel>:is(fieldset.pantry-choice,.pantry-grid) {margin-top:26px!important}
  html.ui-refine body main#pantry-planner .pantry-screen-input .task-panel>.pantry-choice+.pantry-grid,
  html.ui-refine body main#pantry-planner .pantry-screen-input .task-panel>.pantry-grid+.pantry-grid {margin-top:16px!important}
  html.ui-refine body main#pantry-planner .pantry-screen-input .task-panel>.pantry-choice+.task-note {margin-top:8px}
  html.ui-refine body main#pantry-planner .pantry-screen-input .pantry-range-also {margin-top:0;align-content:start}
  /* 選ぶボタン：丸印・四角印は隠し、選択中は塗りと ✓ で示す */
  html.ui-refine body main#pantry-planner .pantry-choice label {position:relative;min-height:40px;padding:0 16px;border-color:var(--line)}
  html.ui-refine body main#pantry-planner .pantry-choice label:hover {border-color:var(--action)}
  html.ui-refine body main#pantry-planner .pantry-choice label input {position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
  html.ui-refine body main#pantry-planner .pantry-choice label:has(:checked) {padding-left:12px}
  html.ui-refine body main#pantry-planner .pantry-choice label:has(:checked)::before {content:"✓";font-size:12px;font-weight:700;color:var(--action)}
  /* 下に留まるボタンの帯：線で切らず、淡い影で内容の上に浮かせる */
  html.ui-refine body main#pantry-planner .pantry-go {border-top:0;box-shadow:0 -12px 18px -14px rgba(40,44,30,.22)}
}
