/* Drop a hint (builder, details, share, his view). Builds on base.css tokens; mobile-first. */

/* ---------------------------------------------------------------- shared */
.hb-narrow { max-width: 640px; margin: 0 auto; }
.hb-hero { margin-bottom: 18px; max-width: 680px; }
.hb-hero h1 { margin: 12px 0 8px; font-size: clamp(1.85rem, 7vw, 2.75rem); line-height: 1.08; letter-spacing: -.025em; }
.hb-hero .lede { margin: 0; font-size: 1.02rem; }
.hb-sec-h { margin: 0 0 12px; font: 750 1.15rem/1.2 var(--font-display); letter-spacing: -.01em; }
.hb-chev { width: 18px; height: 18px; flex: none; color: var(--ink-2); transition: transform .2s var(--ease); }
details[open] > summary .hb-chev { transform: rotate(180deg); }
.page-hint summary { list-style: none; }
.page-hint summary::-webkit-details-marker { display: none; }
.page-hint .choices-tight { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.page-hint .choices-tight .choice-body { min-height: 52px; justify-content: center; padding: 10px 14px; }
.page-hint .hb-rel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hb-rel .choice-body { text-align: center; padding: 10px 6px; }
.hb-rel .choice input:checked + .choice-body::after { display: none; }

/* step pills: 1 Pick, 2 Details, 3 Send */
.hb-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .84rem; font-weight: 650; color: var(--ink-2); }
.hb-steps li, .hb-steps a { display: inline-flex; align-items: center; gap: 7px; }
.hb-steps li { min-height: 34px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.hb-steps a { color: inherit; text-decoration: none; min-height: 34px; }
.hb-steps a:hover { color: var(--ink); }
.hb-steps span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); font-size: .78rem; }
.hb-steps .ico { width: 14px; height: 14px; }
.hb-steps .is-on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); }
.hb-steps .is-on span { background: var(--accent); color: var(--accent-ink); }
.hb-steps .is-done span { background: var(--good-soft); color: var(--good); }

.hb-live { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--good-soft); font-size: .92rem; }
.hb-live .ico { color: var(--good); margin-top: 3px; flex: none; }
.hb-live .link { min-height: 0; }

.hb-icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 0; background: transparent;
  color: var(--ink-2); cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.hb-icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.hb-icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.hb-icon-btn .ico { width: 20px; height: 20px; }
.hb-up .ico { transform: rotate(180deg); }
.hb-remove:hover { color: var(--bad); background: var(--bad-soft); }

/* 8 dots = the 8-item cap at a glance */
.hb-dots { display: grid; grid-template-columns: repeat(4, 8px); gap: 4px; flex: none; }
.hb-dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.hb-dots i.on { background: var(--accent); box-shadow: none; }

/* ---------------------------------------------------------------- step 1: search + tiles + results */
.page-hint-build .main { padding-bottom: 120px; }
.hb-search { margin: 0 0 6px; }
.hb-search-row { display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line-2); box-shadow: var(--shadow-sm); }
.hb-search-row:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent); }
.hb-search-row input { flex: 1; min-width: 0; min-height: 46px; border: 0; padding: 8px 14px; background: transparent; border-radius: 999px; font-size: 1.02rem; }
.hb-search-row input:focus { box-shadow: none; }
.hb-search-row input::-webkit-search-cancel-button { cursor: pointer; }
.hb-search-row .btn { min-height: 46px; padding: 0 20px; }

.hb-results { margin: 18px 0 30px; scroll-margin-top: calc(var(--header-h) + 12px); }
.hb-results[aria-busy="true"] { opacity: .55; transition: opacity .2s; }
.hb-res-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 4px; }
.hb-res-head .hb-sec-h { margin: 0; }

.hb-tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.hb-tile { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 10px 12px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; -webkit-tap-highlight-color: transparent; }
.hb-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.hb-tile:active { transform: scale(.98); }
.hb-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hb-tile-art { display: grid; place-items: center; aspect-ratio: 16 / 10; margin-bottom: 8px; border-radius: 14px; }
.hb-tile-art img { width: 58%; max-width: 76px; height: auto; }
.hb-tile-label { padding: 0 4px; font: 700 .98rem/1.2 var(--font-display); letter-spacing: -.01em; }
.hb-tile-n { padding: 0 4px; font-size: .8rem; color: var(--ink-2); }
@media (min-width: 560px) { .hb-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .hb-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.hb-cards { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); margin: 10px 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .hb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hb-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 100%; padding: 10px 12px 10px 10px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .2s, background-color .2s; }
.hb-card-art { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; }
.hb-card-art img { width: 44px; height: 44px; }
.hb-card-title { margin: 0; font: 650 .94rem/1.3 var(--font); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hb-card-meta { margin: 3px 0 0; font-size: .82rem; color: var(--ink-2); }
.hb-card-add { margin: 0; }
.hb-add { min-width: 86px; padding: 0 14px; }
.hb-card.is-on { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.hb-card.is-on .hb-add, .hb-add.is-on { opacity: 1; --btn-bg: var(--good-soft); --btn-line: transparent; --btn-ink: var(--good); cursor: default; }
.hb-more { margin-top: 12px; }
.hb-none { padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--line-2); }
.hb-none p { margin: 0 0 12px; }
.hb-none-add { margin: 0; }

/* her own idea / pasted link */
.hb-own { margin: 0 0 24px; }
.hb-own-grid { display: grid; gap: 10px; }
@media (min-width: 720px) { .hb-own-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.hb-own-card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.hb-own-card > summary { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 16px 12px 12px; cursor: pointer; border-radius: var(--radius); }
.hb-own-card > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hb-own-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; color: var(--ink); }
.hb-own-txt { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.hb-own-txt small { font-size: .84rem; color: var(--ink-2); }
.hb-own-form { padding: 2px 16px 16px; }
.hb-own-form p { margin: 0; }

/* ---------------------------------------------------------------- the tray: bottom sheet on phones */
.hb-tray { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px -14px rgba(10, 14, 22, .35); }
.hb-tray-bar { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; padding: 10px 16px; }
.hb-tray-toggle { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; min-height: 48px; color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.hb-tray-label { flex: 1; min-width: 0; line-height: 1.2; }
.hb-tray-count { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.hb-tray-toggle .hb-chev { transform: rotate(180deg); }
.hb-next { flex: none; }
.hb-next[aria-disabled="true"] { pointer-events: none; }
.hb-tray-body { display: none; max-width: 760px; max-height: min(74vh, 640px); margin: 0 auto; padding: 6px 16px 16px; overflow: auto; overscroll-behavior: contain; }
.hb-tray:target .hb-tray-body, .hb-tray.is-open .hb-tray-body { display: block; }
.hb-tray:target .hb-tray-bar, .hb-tray.is-open .hb-tray-bar { display: none; }
.hb-tray.is-open, .hb-tray:target { box-shadow: 0 0 0 100vmax rgba(10, 14, 22, .42); }
.hb-tray-head { position: sticky; top: -6px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -16px 8px; padding: 6px 8px 6px 16px; background: var(--surface); }
.hb-tray-h { margin: 0; font: 750 1.15rem/1.2 var(--font-display); }
.hb-tray-h .hb-tray-count { font: 600 .95rem var(--font); margin-left: 4px; }

.hb-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hb-row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 10px 6px 4px 10px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid transparent; transition: background-color .2s, box-shadow .2s, opacity .2s; }
.hb-row.is-gone { opacity: .7; border-color: var(--line-2); border-style: dashed; }
.hb-row.is-dragging { opacity: .5; }
.hb-row.is-drop { box-shadow: 0 -3px 0 var(--accent); }
.hb-row[draggable="true"] { cursor: grab; }
.hb-row-pic { position: relative; }
.hb-row-art { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.hb-row-art img { width: 34px; height: 34px; }
.hb-row-ico { background: var(--accent-soft); color: var(--accent-text); }
.hb-row-ico .ico { width: 20px; height: 20px; }
.hb-row-n { position: absolute; top: -6px; left: -6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font: 800 .7rem/1 var(--font-display); }
.hb-row-body { min-width: 0; }
.hb-row-title { margin: 0; font-weight: 650; font-size: .93rem; line-height: 1.3; overflow-wrap: anywhere; }
.hb-row-sub { margin: 2px 0 0; font-size: .8rem; color: var(--ink-2); overflow-wrap: anywhere; }
.hb-row-note { display: flex; gap: 5px; align-items: flex-start; margin: 4px 0 0; font-size: .84rem; overflow-wrap: anywhere; }
.hb-row-note .ico { width: 14px; height: 14px; margin-top: 2px; flex: none; color: var(--accent-text); }
.hb-row-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }
.hb-row-tools form { margin: 0; }
.hb-row-more { flex: 1 1 auto; min-width: 0; }
.hb-row-more > summary { display: inline-flex; align-items: center; min-height: 44px; font-size: .84rem; font-weight: 650; color: var(--accent-text); cursor: pointer; }
.hb-row-more[open] { flex-basis: 100%; order: 9; }
.hb-note-form { display: flex; gap: 6px; margin: 0 0 8px; }
.hb-note-form input { min-height: 44px; padding: 8px 12px; font-size: .95rem; }
.hb-order-tip { margin: 10px 0 0; }
.hb-empty { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.hb-empty p { margin: 0; font-size: .94rem; }
.hb-empty-art { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 16px; }
.hb-empty-art img { width: 48px; height: 48px; }
.hb-full { margin: 10px 0 0; font-weight: 650; color: var(--good); }
.hb-tray-cta { margin-top: 14px; }
.hb-skip { margin: 10px 0 0; text-align: center; }
.hb-skip .linkbtn { color: var(--ink-2); }
.hb-privacy { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; }
.hb-privacy .ico { width: 14px; height: 14px; margin-top: 2px; flex: none; }

/* toast for in-place adds (hint.js) */
.hb-toast { position: fixed; z-index: 40; left: 50%; top: calc(var(--header-h) + 10px); max-width: calc(100% - 32px); margin: 0;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 650; font-size: .92rem; text-align: center;
  opacity: 0; transform: translate(-50%, -12px); transition: opacity .2s, transform .25s var(--ease); pointer-events: none; }
.hb-toast.show { opacity: 1; transform: translate(-50%, 0); }
.hb-toast.is-error { background: var(--bad); color: #fff; }

/* wide screens: the list sits beside the picker, always open */
@media (min-width: 980px) {
  .page-hint-build .main { padding-bottom: 48px; }
  .hb { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; }
  .hb-tray { position: sticky; z-index: 1; top: calc(var(--header-h) + 18px); left: auto; right: auto; bottom: auto; padding: 0;
    max-height: calc(100vh - var(--header-h) - 36px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .hb-tray.is-open, .hb-tray:target { box-shadow: var(--shadow); }
  .hb-tray .hb-tray-bar { display: none; }
  .hb-tray .hb-tray-body { display: block; max-height: none; padding: 18px; overflow: visible; }
  .hb-tray-head { position: static; margin: 0 0 12px; padding: 0; }
  .hb-tray-close { display: none; }
  .hb-toast { top: auto; bottom: 28px; transform: translate(-50%, 12px); }
  .hb-hero h1 { margin-top: 16px; }
}

/* ---------------------------------------------------------------- step 2: details */
.hb-summary { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 14px 16px; color: var(--ink); text-decoration: none; background: var(--surface-2); }
.hb-summary > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.hb-summary .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-summary .link { min-height: 0; flex: none; }
.hb-details .card + .card { margin-top: 0; }
.hb-legend { margin: 0 0 6px; font: 750 1.2rem/1.2 var(--font-display); letter-spacing: -.01em; }
.hb-two { display: grid; gap: 14px; }
@media (min-width: 520px) { .hb-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hb-opt { padding: 0; }
.hb-opt > summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 16px 20px; cursor: pointer; border-radius: var(--radius); }
.hb-opt > summary > span { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.hb-opt > summary strong { font: 750 1.08rem/1.2 var(--font-display); }
.hb-opt > summary small { font-size: .86rem; color: var(--ink-2); }
.hb-opt > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hb-opt-body { padding: 0 20px 20px; }
.hb-sizes { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .hb-sizes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- step 3: share */
.hb-narrow > .hb-steps { margin-bottom: 16px; }
.hb-share { text-align: center; }
.hb-share h1 { margin: 6px 0 0; }
.hb-share .lede { margin: 0; }
.hb-share-art { display: grid; place-items: center; width: 112px; height: 112px; margin: 0 auto; border-radius: 30px; }
.hb-share-actions { display: grid; gap: 10px; margin-top: 4px; }
.hb-share-row { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hb-share-row .btn { padding: 0 12px; }
.hb-copy { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 4px; border-radius: 16px; background: var(--surface-2); }
.hb-copy input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border: 0; background: transparent; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.hb-copy .btn { flex: none; }
.hb-privacy-box { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--good-soft); font-size: .9rem; text-align: left; }
.hb-privacy-box .ico { flex: none; margin-top: 2px; color: var(--good); }
.hb-share p, .hb-edit-card p { margin: 0; }
.hb-edit-card { margin-top: 16px; }
.hb-edit-card h2 { display: flex; gap: 8px; align-items: center; margin: 0; }
.hb-turnoff { margin: 0; text-align: center; }
.hb-turnoff .linkbtn { color: var(--bad); }
.hb-off-card .btn { margin-top: 4px; }
.hb-closed { text-align: center; margin-top: 12px; }
.hb-closed h1 { margin: 6px 0 0; }

/* ---------------------------------------------------------------- his view */
.hb-preview-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 18px; padding: 8px 14px; border-radius: 14px; background: var(--accent-soft); font-size: .92rem; }
.hb-preview-note .ico { flex: none; }
.hb-preview-note .link { min-height: 0; }
.hb-view-hero { margin-bottom: 24px; max-width: 680px; }
.hb-view-hero h1 { margin: 14px 0 8px; }
.hb-view-hero .lede { margin: 0; }
.hb-gift-own .gift-title { overflow-wrap: anywhere; }
.hb-view-disclosure { margin-top: 12px; }
.hb-view-disclosure p + p { margin-top: 6px; }
.hb-cheat, .hb-save { margin-top: 28px; }
.hb-cheat h2, .hb-save h2 { margin: 0; }
.hb-save { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; }
.hb-save p { margin: 0; }
.hb-quote { margin: 0; padding: 14px 18px; border-radius: 4px 18px 18px 18px; background: var(--accent-soft); font-size: 1.06rem; white-space: pre-line; overflow-wrap: anywhere; }
.hb-dl { display: grid; gap: 10px; margin: 0; }
.hb-dl > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.hb-dl dt { font-weight: 700; color: var(--ink-2); font-size: .92rem; }
.hb-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .hb-dl > div { grid-template-columns: 1fr; gap: 2px; } }

@media (prefers-reduced-motion: reduce) {
  .hb-tile, .hb-toast, .hb-chev, .hb-row { transition: none; }
}

/* art tiles can carry a photo (ui.art -> <picture class="art-photo">): fill the tile instead of floating in it */
.hb-tile-art, .hb-card-art, .hb-row-art, .hb-share-art, .hb-empty-art { overflow: hidden; }
.page-hint .hb-tile-art .art-photo, .page-hint .hb-card-art .art-photo, .page-hint .hb-row-art .art-photo,
.page-hint .hb-share-art .art-photo, .page-hint .hb-empty-art .art-photo { display: block; width: 100%; height: 100%; }
.page-hint .hb-tile-art .art-photo img, .page-hint .hb-card-art .art-photo img, .page-hint .hb-row-art .art-photo img,
.page-hint .hb-share-art .art-photo img, .page-hint .hb-empty-art .art-photo img { display: block; width: 100%; max-width: none; height: 100%; object-fit: cover; }
