/* The gift finder's tool: cards, kinds, the dock. Shared by prototype/mix.html and prototype/post.html. */
    /* the Workings look (design-system.css), with fallbacks so it stands alone */
    :root { color-scheme: light; --like: #2f7d4f; --love: #b8325a; }
    * { box-sizing: border-box; }
    button { font: inherit; color: inherit; }
    a { color: inherit; }
    .mono, .examples button, .pill, .kind, .meta, .why, .pass, .bar, .toast, .note, .hint, label { font-family: var(--f-mono, ui-monospace, monospace); }

    /* the question */
    .ask { display: grid; gap: 10px; }
    .ask form { display: flex; gap: 0; max-width: 720px; border: 1px solid var(--ink, #1b1a17); background: #fff; }
    .ask input { flex: 1; min-width: 0; border: 0; outline: 0; font: 18px/1.2 var(--f-body, Spectral, serif); padding: 0 14px; min-height: 52px; background: transparent; }
    .ask form:focus-within { outline: 2px solid var(--ink, #1b1a17); outline-offset: 2px; }
    .primary { border: 0; border-left: 1px solid var(--ink, #1b1a17); background: var(--ink, #1b1a17); color: #fff; font: 700 14px/1 var(--f-mono, monospace); text-transform: uppercase; letter-spacing: .05em; padding: 0 20px; min-height: 52px; cursor: pointer; white-space: nowrap; }
    .primary:hover { background: var(--like); }
    .primary:disabled { background: #888; cursor: default; }
    .examples { display: flex; flex-wrap: wrap; gap: 6px; }
    .examples button { border: 1px solid var(--ink, #1b1a17); background: #fff; padding: 8px 10px; min-height: 34px; cursor: pointer; font-size: 12px; }
    .examples button:hover { background: var(--ink, #1b1a17); color: #fff; }

    /* the ideas */
    .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
    .hint { font-size: 12px; color: var(--ink-2, #5b574f); margin: 0; }
    .kinds { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 6px; }
    .pill { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--like); color: var(--like); background: #fff; padding: 0 4px 0 9px; min-height: 32px; font-size: 13px; }
    .pill button { border: 0; background: none; min-width: 28px; min-height: 30px; cursor: pointer; font-size: 14px; color: inherit; }
    .pill.done { border-color: var(--ink-2, #5b574f); color: var(--ink-2, #5b574f); background: transparent; padding-right: 9px; }
    .pill.fresh { background: var(--like); color: #fff; }
    .pill .tag { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
    .pill.off { color: #999; border-color: #ccc; text-decoration: line-through; }

    .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
    .card { border: 1px solid var(--ink, #1b1a17); background: #fff; display: grid; grid-template-rows: auto 1fr auto; min-width: 0; transition: opacity .3s, transform .3s, filter .3s; }
    .card .b { padding: 8px 10px 10px; display: grid; gap: 4px; align-content: start; min-width: 0; grid-template-columns: minmax(0, 1fr); }
    .card { grid-template-columns: minmax(0, 1fr); }
    .meta { min-width: 0; }
    .card.leaving { opacity: .25; filter: grayscale(1); transform: scale(.97); }
    .card.skipped { opacity: .35; }
    .card.loved { outline: 3px solid var(--like); outline-offset: -3px; }
    .pic { position: relative; aspect-ratio: 1; background: #eee; overflow: hidden; }
    .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .kind { position: absolute; left: 6px; top: 6px; background: #fff; border: 1px solid var(--ink, #1b1a17); padding: 3px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
    /* the picture is a button: tap for details */
    button.pic { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; }
    .line { font: 11px/1.35 var(--f-mono, monospace); color: var(--ink-2, #5b574f); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    /* details */
    .detail { width: min(720px, calc(100vw - 24px)); max-height: min(86vh, 760px); padding: 0; border: 1px solid var(--ink, #1b1a17); background: var(--paper, #f6f1e7); color: var(--ink, #1b1a17); box-shadow: 8px 8px 0 var(--accent, #2f7d4f); }
    .detail::backdrop { background: rgba(27, 26, 23, .55); }
    .detail__in { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); position: relative; }
    .detail__img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-right: 1px solid var(--ink, #1b1a17); background: #eee; }
    .detail__b { padding: 16px 18px; display: grid; gap: 10px; align-content: start; overflow: auto; max-height: min(86vh, 760px); }
    .detail__b .kind { position: static; justify-self: start; }
    .detail__b h3 { margin: 0; font: 600 20px/1.25 var(--f-body, Spectral, serif); }
    .detail__b .meta { justify-content: flex-start; gap: 12px; flex-wrap: wrap; font-size: 12px; }
    .detail__b p { margin: 0; font-size: 15px; line-height: 1.5; }
    .detail__b ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.45; }
    .detail__acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
    .detail__acts button, .detail__acts a { min-height: 40px; padding: 0 14px; border: 1px solid var(--ink, #1b1a17); background: #fff; font: 12px/1 var(--f-mono, monospace); cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; color: var(--ink, #1b1a17); }
    .detail__acts button[data-v="like"][aria-pressed="true"] { background: var(--like); border-color: var(--like); color: #fff; }
    .detail__acts button[data-v="pass"][aria-pressed="true"] { background: var(--ink, #1b1a17); color: #fff; }
    .detail__x { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 1px solid var(--ink, #1b1a17); background: #fff; font-size: 18px; cursor: pointer; z-index: 1; }
    @media (max-width: 560px) { .detail__in { grid-template-columns: 1fr; } .detail__img { border-right: 0; border-bottom: 1px solid var(--ink, #1b1a17); max-height: 42vh; } .detail__b { max-height: none; } .detail { overflow: auto; } }
    /* ♡ and ✕ */
    .acts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink, #1b1a17); align-self: end; }
    .acts button { min-height: 44px; border: 0; background: none; font-size: 18px; cursor: pointer; }
    .acts button + button { border-left: 1px solid var(--ink, #1b1a17); }
    .acts button:hover { background: rgba(27, 26, 23, .06); }
    .acts button[data-v="like"][aria-pressed="true"] { background: var(--like); color: #fff; }
    .acts button[data-v="pass"][aria-pressed="true"] { background: var(--ink, #1b1a17); color: #fff; }
    .t { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11px; color: var(--ink-2, #5b574f); }
    .meta .price { color: var(--ink, #1b1a17); font-weight: 600; }
    .shop { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .why { font-size: 10px; color: var(--like); text-transform: uppercase; letter-spacing: .04em; }
    .pass { justify-self: start; border: 0; background: none; padding: 2px 0; font-size: 11px; color: var(--ink-2, #5b574f); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
    .pass:hover { color: var(--ink, #1b1a17); }
    .ghost { aspect-ratio: 1; border: 1px solid #ddd; background: linear-gradient(90deg, #eee 0%, #f7f7f5 50%, #eee 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
    @keyframes shimmer { to { background-position: -200% 0; } }
    .more { justify-self: center; min-height: 44px; padding: 0 12px; border: 0; background: none; font: 12px/1 var(--f-mono, monospace); color: var(--ink-2, #5b574f); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
    .more:hover { color: var(--ink, #1b1a17); }
    .more[hidden] { display: none; }

    /* their list */
    .list { border-top: 3px solid var(--ink, #1b1a17); padding-top: 14px; display: grid; gap: 10px; }
    .list[hidden] { display: none; }
    .rows { display: grid; gap: 8px; }
    .row { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--ink, #1b1a17); padding: 6px; }
    .row img { width: 52px; height: 52px; object-fit: cover; background: #eee; display: block; }
    .row a { font-weight: 600; text-decoration: none; }
    .row a:hover { text-decoration: underline; }
    .row .meta { justify-content: flex-start; }
    .row button { border: 0; background: none; font: 11px/1 var(--f-mono, monospace); color: var(--ink-2, #5b574f); cursor: pointer; text-decoration: underline; }

    /* the bar: always in reach */
    .bar { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--ink, #1b1a17); color: #fff; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; box-shadow: 0 -6px 18px rgba(0,0,0,.15); }
    .bar[hidden] { display: none; }
    .bar span { font-size: 12px; opacity: .85; }
    .go { min-height: 52px; padding: 0 24px; border: 2px solid #fff; background: var(--like); color: #fff; font: 700 15px/1 var(--f-mono, monospace); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
    .go:hover:not(:disabled) { background: #fff; color: var(--like); }
    .go:disabled { background: transparent; color: #aaa; border-color: #666; cursor: default; }
    .toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #fff; border: 1px solid var(--ink, #1b1a17); padding: 10px 14px; font-size: 12px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 11; max-width: calc(100% - 24px); opacity: 0; transition: opacity .3s; pointer-events: none; }
    .toast.on { opacity: 1; }
    .note { font-size: 11px; color: var(--ink-2, #5b574f); margin: 0; }
    #status.err { color: #b3261e; }
    @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
    /* phones: two cards across */
    @media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .card .b { padding: 6px 7px 8px; } .t { font-size: 13px; } .acts button { min-height: 40px; font-size: 16px; } }
    /* the dots on a tag: turns on the wall per round; tap to set */
    .pill .dots { display: inline-flex; margin-left: 4px; }
    .pill .dots button { min-width: 22px; width: 22px; min-height: 30px; padding: 0; font-size: 13px; letter-spacing: 0; }
    .pill.quiet { color: #999; border-color: #bbb; border-style: dashed; }
    .pill.moved { background: #eef6f0; }
    .pill i { font-style: normal; font-size: 11px; opacity: .7; margin-left: 4px; }
    /* start over */
    .reset { border: 0; background: none; padding: 4px 0; font: 11px/1 var(--f-mono, monospace); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2, #5b574f); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
    .reset:hover { color: var(--ink, #1b1a17); }
    .reset[hidden] { display: none; }
    /* what each tag learned: one line per tag, under the pills */
    .learned { flex-basis: 100%; display: grid; gap: 4px; padding-top: 4px; }
    .learn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font: 12px/1.3 var(--f-mono, monospace); }
    .learn b { font-weight: 600; margin-right: 2px; }
    .learn .lab { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2, #5b574f); }
    .learn .sep { color: var(--ink-2, #5b574f); }
    .word { display: inline-flex; align-items: center; border: 1px solid var(--like); color: var(--like); background: #fff; padding-left: 7px; min-height: 26px; }
    .word button { border: 0; background: none; min-width: 26px; min-height: 26px; padding: 0; cursor: pointer; color: inherit; font-size: 13px; }
    .word.gone { border-style: dashed; color: #999; border-color: #bbb; }
    .word.gone .w { text-decoration: line-through; }
    .word.less { border-color: var(--ink-2, #5b574f); color: var(--ink-2, #5b574f); padding-right: 7px; background: transparent; }
    /* ?v=taste: tastes sit with the kinds, in italics */
    .pill.taste { font-style: italic; }
    /* the in-between states (?v=taste, 12-04): pills shimmer while the model works, then arrive one after another; a taste
       label fades in on its card as its batch lands; quick matches say what they are */
    .pill.ghostpill { border-color: #ddd; color: #999; padding-right: 9px; background: linear-gradient(90deg, #f3f3f1 0%, #fff 50%, #f3f3f1 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
    .pill.arrive { animation: arrive .4s ease-out backwards; animation-delay: calc(var(--i, 0) * 70ms); }
    @keyframes arrive { from { opacity: 0; transform: translateY(6px); } }
    .kinds .sorting { align-self: center; font-size: 11px; color: #888; font-family: var(--f-mono, ui-monospace, monospace); }
    .kind .tl.fresh { animation: tl 1.2s ease-out; }
    @keyframes tl { from { background: var(--like); color: #fff; } }
    .kind.quick { border-style: dashed; color: #666; }
    .quicknote { grid-column: 1 / -1; margin: 0; font-size: 12px; color: #666; font-family: var(--f-mono, ui-monospace, monospace); }
    /* the tags on a phone (12-05): kinds on one row, tastes on another, each scrolling sideways, so the cards start on the
       first screen. Wider screens let both rows flow together as one wrapped list. */
    .krow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
    .kinds:has(.krow) { display: grid; gap: 8px; }
    .khow { margin: 0; font-size: 13px; color: var(--ink-2, #5b574f); }
    .khow em { font-style: italic; }
    @media (max-width: 560px) {
      .kinds { display: grid; gap: 6px; }
      .krow { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
        -webkit-mask-image: linear-gradient(90deg, #000 85%, #0000); mask-image: linear-gradient(90deg, #000 85%, #0000); }
      .krow::-webkit-scrollbar { display: none; }
      .krow:empty { display: none; }
      .krow .pill { flex: none; min-height: 30px; font-size: 12px; padding-left: 8px; white-space: nowrap; }
      .krow .sorting { flex: none; white-space: nowrap; }
    }
    @media (prefers-reduced-motion: reduce) { .pill.arrive, .kind .tl.fresh, .pill.ghostpill { animation: none; } }
/* over 10 minutes old: no prices (taste-app.mjs staleIn) */
body.stale .price { display: none; }
body.stale #ideas .part__h::after { content: 'Over 10 minutes old: prices hidden. Start over for fresh ones.'; font: 11px/1.3 var(--f-mono, monospace); text-transform: none; color: var(--ink-2, #5b574f); }
/* 12-05 phone pass: ♡ and ✕ at least 44px tall, a full fingertip */
.card .acts button { min-height: 44px; }
/* a loved card lifts forward while Re-shuffle works, then slides and shrinks into its new place (taste-app.mjs settle) */
.card.lifted { position: relative; z-index: 3; transform: scale(1.06); box-shadow: 0 22px 48px rgba(27, 26, 23, .22); transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; }
@media (prefers-reduced-motion: reduce) { .card.lifted { transform: none; transition: none; } }
