/* Presets in the Library and Explore (owner 2026-12-03, design-refs/preset-library-mockup.html): the spec-card tile
   (tile B), the preset page, the Sharing dialog. Builds on tiles.css (.vt, .vt-bar, .vt-name) and the theme colours. */

/* ---------- the tile ---------- */
.pt { cursor: pointer; }
.pt .vt-bar { cursor: inherit; }
.pt-nsfw { flex: none; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; color: var(--nsfw); border: 1px solid color-mix(in srgb, var(--nsfw) 55%, transparent); }
.pt-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; padding: 9px 12px 8px; min-width: 0; }
.pt-by { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pt-by a { color: var(--muted); text-decoration: none; }
.pt-by a:hover, .pt-by a:focus-visible { color: var(--gold); }
.pt-ds { font-size: 13px; line-height: 1.4; color: color-mix(in srgb, var(--text) 88%, var(--bg)); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; overflow-wrap: anywhere; }
.pt-ds.muted { color: var(--muted); font-style: italic; }
.pt-kv { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 4px 6px; align-items: center; }
.pt-k { font-size: 10.5px; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.pt-v { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.pt-t { display: inline-flex; font-size: 11.5px; line-height: 1.5; padding: 0 8px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.pt-m { background: color-mix(in srgb, var(--accent) 50%, var(--card)); color: var(--text); }
.pt-p { border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold); }
.pt-c { border-color: var(--line-strong); color: var(--text); }
.pt-any { border: 1px dashed var(--line-strong); color: var(--muted); }
.pt-feat { font-size: 11.5px; color: var(--muted); }
.pt-peek { background: none !important; border: 0 !important; color: var(--gold); padding: 0 !important; margin: 0 !important; font-size: 12px !important; font-weight: 500 !important; letter-spacing: 0 !important; text-align: left; align-self: flex-start; min-height: 0 !important; text-transform: none !important; }
.pt-pl { margin: 0; padding: 6px 10px; list-style: none; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-size: 12.5px; }
.pt-pl.hidden { display: none; }
.pt-pl li { display: flex; gap: 7px; padding: 2px 0; }
.pt-pl li.off { opacity: .5; }
.pt-pl i { font-style: normal; color: var(--gold); width: 12px; flex: none; }
.pt-stats { display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; margin-top: auto; align-items: center; }
.pt-stats .pt-r { margin-left: auto; color: var(--gold); }
.pt-src { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pt-src a { color: var(--gold); text-decoration: none; }
.pt-src a:hover { text-decoration: underline; }
.pt-upd { margin-left: 4px; font-size: 11px; font-weight: 700; padding: 0 8px; border-radius: 999px; border: 1px solid var(--gold); }
/* visibility chip (My presets) */
.pt-vis { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 9px; border: 1px solid var(--line-strong); color: var(--muted); }
.pt-vis-pub { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.pt-vis-unl { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.pt-vis-mod { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.ps-grid .pt .mc-act { padding: 8px 12px 11px; }

/* ---------- Explore → Presets: filter buttons and their panels (library.html) ---------- */
.px-count { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.px-pop label { display: flex; gap: 9px; align-items: center; padding: 5px 4px; border-radius: 7px; font-size: 14px; cursor: pointer; }
.px-pop label:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); }
body.vf .px-pop input[type=checkbox], body.vf .px-pop input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); flex: none; }
.px-pop .px-n { margin-left: auto; font-size: 12px; color: var(--muted); }
.px-pop p { font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.px-note { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ---------- the preset page (/preset) ---------- */
.pp-page { max-width: 1100px; }
.pp-head { margin-top: 22px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.pp-big { width: 130px; height: 130px; border-radius: 16px; flex: none; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, var(--bg)), var(--bg) 80%);
  border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; color: var(--gold); }
.pp-big svg { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; }
.pp-main { flex: 1; min-width: 260px; }
.pp-main h1 { margin: 0; font: 700 26px/1.2 Georgia, serif; letter-spacing: .06em; color: var(--gold); text-transform: uppercase; overflow-wrap: anywhere; }
.pp-main h1 .pt-nsfw { vertical-align: middle; font-family: inherit; letter-spacing: 0; margin-left: 8px; }
.pp-by { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pp-by a { color: var(--gold); text-decoration: none; }
.pp-grp { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 6px 8px; align-items: center; margin: 12px 0; }
.pp-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.pp-split { display: inline-flex; position: relative; }
body.vf .pp-split > button:first-child { border-radius: 10px 0 0 10px; }
body.vf .pp-split > button.pp-caret { border-radius: 0 10px 10px 0; border-left: 1px solid color-mix(in srgb, var(--on-gold) 35%, transparent); padding-left: 10px; padding-right: 10px; }
.pp-stats { font-size: 13px; color: var(--muted); }
.pp-desc { max-width: 760px; white-space: pre-line; overflow-wrap: anywhere; margin: 14px 0; line-height: 1.55; }
.pp-src { font-size: 13px; color: var(--muted); }
.pp-src a { color: var(--gold); }
.pp-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.pp-h { margin: 0 0 8px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.pp-piece { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--line); padding: 9px 0; }
.pp-piece:first-of-type { border-top: 0; }
.pp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); margin-top: 7px; flex: none; }
.pp-dot.off { background: none; border: 1.5px solid var(--muted); }
.pp-dot.slot { background: none; border: 1.5px dashed var(--line-strong); border-radius: 3px; }
.pp-t1 { flex: 1; min-width: 0; }
.pp-t1 b { display: block; }
.pp-t1 small { color: var(--muted); }
.pp-piece.pp-slot b { font-weight: 500; color: var(--muted); }
.pp-text { margin: 8px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; max-height: 420px; overflow: auto; }
.pp-text.hidden { display: none; }
.pp-kvs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.pp-kvs dt { color: var(--muted); }
.pp-kvs dd { margin: 0; }
.pp-ver { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 8px 0; }
.pp-ver:first-of-type { border-top: 0; }
.pp-ver b { min-width: 48px; }
.pp-cur { font-size: 11px; font-weight: 700; color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 55%, transparent); border-radius: 999px; padding: 0 8px; }
.pp-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 260px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-pop); }
.pp-menu.hidden { display: none; }
body.vf .pp-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text); }
body.vf .pp-menu button:hover, body.vf .pp-menu button:focus-visible { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--gold); }
.pp-menu small { display: block; color: var(--muted); font-size: 12px; }
.pp-tabs { margin-top: 18px; }
.pp-panel { margin-top: 12px; }

/* ---------- the Sharing dialog ---------- */
.pt-dlg { width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; }
.pt-vis-opts { border: 0; padding: 0; margin: 0 0 6px; }
.pt-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer; }
.pt-opt:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--accent) 22%, transparent); }
body.vf .pt-opt input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--gold); flex: none; }
.pt-opt > span > b { display: block; }
.pt-opt > span > span { font-size: 13px; color: var(--muted); }
.pt-f { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; }
body.vf .pt-dlg textarea { width: 100%; margin: 0; }
.pt-pick { display: flex; gap: 6px; flex-wrap: wrap; }
body.vf .pt-pick button { background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; margin: 0; color: var(--text); min-height: 0; }
body.vf .pt-pick button.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.pt-adult, body.vf .pt-adult { margin-top: 14px; }
.pt-note.pt-warn { color: var(--warn); }
.pt-link { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; font-size: 13px; overflow-wrap: anywhere; }
.pt-link.hidden, .pt-share-more.hidden { display: none; }

/* Import: the suggested tags (presetimport.js) */
.pi-tags .pt-f:first-child { margin-top: 4px; }

@media (max-width: 760px) {
  .pp-big { width: 92px; height: 92px; }
  .pp-big svg { width: 46px; height: 46px; }
  .pp-main h1 { font-size: 21px; }
  .pt-dlg { padding: 16px; }
}
@media (pointer: coarse) {
  body.vf .pt-pick button { min-height: 40px; }
  .pt-peek { min-height: 32px !important; }
}

/* My presets: the "Find more presets →" link at the end of the tabs */
.mc-tabs .mc-find { margin-left: auto; align-self: center; font-size: .9rem; white-space: nowrap; }
@media (max-width: 640px) { .mc-tabs { flex-wrap: wrap; } .mc-tabs .mc-find { margin-left: 0; flex-basis: 100%; padding: 6px 2px 0; } }
/* Import: the suggested tags */
.pi-tags { margin: 8px 0; }
.pi-tags .pt-k { display: block; margin-bottom: 4px; }
/* the sliders icon (presettile.js sliders()): a line drawing like the other tile icons */
.pt .vt-lead-i { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.pt-v .muted.small, .pp-grp .muted.small { font-size: .8rem; }
/* The preset editor (preset-edit.js): "What it does" and the tag pickers under the name */
.pe-tags .fl { margin-top: 10px; }
.pe-tags .pt-pick { margin-top: 2px; }
.pe-tags + .hint { margin-top: 8px; margin-bottom: 4px; }
/* Read out, not shown (the Sharing dialog's legend, "(off)" in What's inside) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
