/* Card pages (My cards + editor). Builds on style.css and gallery.css (same burgundy/gold look). */
body.vf { overflow-x: hidden; }
body.vf header { max-width: none; padding: 12px 32px; }
body.vf button, body.vf a.btn { cursor: pointer; border: none; font-weight: 600; transition: .2s; border-radius: 6px; letter-spacing: .6px; font-size: 12px; padding: 10px 16px; text-decoration: none; display: inline-block; font-family: inherit; }
body.vf button:hover, body.vf a.btn:hover { opacity: .9; }
body.vf button:disabled { opacity: .4; cursor: default; }
body.vf input:not([type=checkbox]):not([type=radio]), body.vf select, body.vf textarea { width: 100%; padding: 11px 12px; margin: 6px 0; background: var(--field);
  border: 1px solid var(--line-strong); color: var(--text); border-radius: 6px; font-size: 14px; font-family: inherit; }
body.vf textarea { min-height: 0; resize: vertical; line-height: 1.45; }
body.vf textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
body.vf select option { background: var(--panel); color: var(--text); }
body.vf input:focus, body.vf select:focus, body.vf textarea:focus { outline: none; border-color: var(--gold); }
body.vf label { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
body.vf .small { font-size: 12px; }
body.vf .muted { font-size: inherit; }
body.vf .b-ghost { color: var(--text); }
body.vf .b-ghost.danger { color: var(--danger); }
body.vf a.btn.b-gold { color: var(--on-gold); }

.vf-main { max-width: 1100px; margin: 0 auto; padding: 0 32px 120px; }
.vf-box { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--card) 70%, transparent); }
.vf-box-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--gold); }
.vf-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vf-row input { flex: 1; min-width: 180px; margin: 0 !important; }
.vf-msg { margin: 12px 0 0; font-size: 14px; }
.vf-msg:empty { display: none; }
.vf-msg.error { color: var(--danger); padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.vf-msg.ok { color: var(--ok); }
.vf-center { text-align: center; margin-top: 18px; }
.unsaved { color: var(--warn); font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }

.tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 18px 0 12px; }
.tab { background: none; color: var(--muted); border: 1px solid transparent !important; padding: 8px 14px !important; border-radius: 16px !important; }
.tab:hover { color: var(--gold); }
.tab.on { color: var(--gold); background: color-mix(in srgb, var(--accent) 50%, var(--panel)); border-color: var(--gold-soft) !important; }
.bigtabs { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tabs .muted { margin-left: auto; }

/* My cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-top: 8px; }
.card-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-card); }
.card-tile:hover { border-color: var(--line-strong); }
.card-cover { aspect-ratio: 3 / 4; background: color-mix(in srgb, var(--accent) 22%, var(--bg)); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-initial { font-size: 48px; color: var(--gold); opacity: .7; }
/* Lorebook covers are square everywhere (owner, 2026-11-24). The default covers (character-cover.svg, lorebook-cover.svg)
   are plain images filling the box like any picture. */
.card-cover.square, .vt-pic .card-cover.square, .vf-showcase .vf-pic .card-cover.square { aspect-ratio: 1 / 1; }
.cover-link { display: block; }
.card-info { padding: 10px 12px 4px; flex: 1; }
.card-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tag { margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 1.2em; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.pill { font-size: 10px; letter-spacing: .6px; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; border: 1px solid var(--gold-soft); color: var(--muted); }
.pill.public { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.pill.unlisted { color: var(--gold); }
.pill.nsfw { color: var(--nsfw); border-color: color-mix(in srgb, var(--nsfw) 50%, transparent); }
.card-foot { display: flex; justify-content: space-between; gap: 6px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 12px; }
.card-actions .btn, .card-actions button { padding: 7px 10px !important; flex: none; }
.import-list { max-height: 40vh; overflow-y: auto; font-size: 13px; }
.imp-row { padding: 6px 0; border-top: 1px solid var(--line); }
.imp-row:first-child { border-top: none; }
.imp-line { display: flex; justify-content: space-between; gap: 12px; }
.imp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-status { text-align: right; }
.imp-status.ok { color: var(--ok); }
.imp-status.err { color: var(--danger); }
.imp-warn { color: var(--warn); margin-top: 2px; }

/* Editor */
.savebar { position: sticky; top: var(--hdr-h, 0px); z-index: 20; transition: top .22s ease; display: flex; align-items: center; gap: 12px; padding: 10px 0; margin-top: 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.pane { max-width: 860px; }
.fld { margin: 14px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.box { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--card) 60%, transparent); margin: 14px 0; }
body.vf .check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); margin: 6px 0; }
body.vf .check input { width: auto; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 10px 0; }
.listbox { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.listbox > .list-item { width: 100%; }
.list-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: color-mix(in srgb, var(--card) 50%, transparent); }
.list-head { display: flex; gap: 6px; align-items: center; }
body.vf button.mini { padding: 5px 10px !important; font-size: 11px; }
.notes-frame { width: 100%; height: 340px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--notes-bg); resize: vertical; }
.entries-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 10px; }
.entries-bar input { flex: 1; min-width: 160px; margin: 0 !important; }
.entries { display: flex; flex-direction: column; gap: 6px; }
details.entry { border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--card) 60%, transparent); }
details.entry[open] { border-color: var(--line-strong); }
details.entry > summary { padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; list-style: none; }
details.entry > summary::-webkit-details-marker { display: none; }
details.entry > summary::before { content: "▸"; color: var(--gold); }
details.entry[open] > summary::before { content: "▾"; }
.e-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.entry-body { padding: 0 14px 4px; }
/* Picker for "copy entries in": small tiles with a picture and a name. */
.lb-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 34vh; overflow-y: auto; margin: 6px 0 14px; }
.lb-pick button { display: flex; flex-direction: column; padding: 0 !important; background: var(--card); border: 1px solid var(--line) !important; border-radius: 8px !important; overflow: hidden; text-align: center; }
.lb-pick button:hover, .lb-pick button:focus-visible { border-color: var(--gold) !important; }
.lb-pick img, .lb-pick .card-initial { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--gold); }
.linked-book { margin: 4px 0; }
.lb-pick-name { font-size: 11px; padding: 4px 6px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; }
.entry-tools { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 14px 14px; }
.pic-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.pic { width: 180px; aspect-ratio: 3 / 4; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 22%, var(--bg)); flex: none; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic-side { flex: 1; min-width: 220px; }
.ver { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: color-mix(in srgb, var(--card) 50%, transparent); }
.ver.current { border-color: var(--gold-soft); }
.ver-main b { margin-right: 8px; }
.wide-box { width: 720px; }
.vv { margin: 10px 0; }
.vv pre { white-space: pre-wrap; word-break: break-word; margin: 4px 0 0; padding: 8px 10px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; font: 13px/1.45 inherit; max-height: 220px; overflow-y: auto; }

@media (max-width: 760px) {
  body.vf header { padding: 12px 16px; }
  .vf-main { padding: 0 16px 100px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .tab { padding: 7px 10px !important; }
  .pic { width: 130px; }
  .savebar { gap: 8px; flex-wrap: wrap; }
  .gal-title { font-size: 18px; letter-spacing: 3px; }
}
body.vf .card-foot, body.vf .card-tag { font-size: 12px; }

.advanced { margin: 22px 0; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--card) 50%, transparent); }
.advanced > summary { padding: 12px 14px; cursor: pointer; color: var(--gold); letter-spacing: 1px; }
.adv-body { padding: 0 14px 8px; }
.readonly { padding: 9px 12px; border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--text); word-break: break-word; }
.savebar .major { margin: 0; white-space: nowrap; }
.savebar .changelog { flex: 1; min-width: 160px; max-width: 320px; margin: 0 !important; padding: 8px 10px !important; }
.import-hint { margin: 10px 0 0; }

.dl { position: relative; display: inline-flex; vertical-align: top; }
.dl-menu { position: absolute; top: 100%; right: 0; z-index: 50; width: 300px; max-width: calc(100vw - 32px); margin-top: 4px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 4px; }
.dl-menu a { display: block; padding: 9px 12px; color: var(--text); text-decoration: none; border-radius: 6px; }
.dl-menu a b { display: block; font-size: 13px; }
.dl-menu a span { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.dl-menu a:hover, .dl-menu a:focus { background: color-mix(in srgb, var(--accent) 45%, transparent); outline: none; }
.dl-menu a:hover b, .dl-menu a:focus b { color: var(--gold); }
.card-tile { position: relative; }
.card-tile .dl { position: static; }
.card-tile .dl-menu { top: auto; bottom: 56px; left: 8px; right: 8px; width: auto; max-width: none; margin: 0; }
@media (max-width: 760px) {
  .gal-top { position: relative; }
  .gal-top .dl { position: static; }
  .gal-top .dl-menu { left: 0; right: 0; width: auto; max-width: none; }
}

.gal-edit { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.gal-row { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.gal-row img { width: 80px; height: 100px; object-fit: cover; border-radius: 6px; flex: none; }
.gal-side { flex: 1; min-width: 0; }
.gal-side input { margin: 0 0 6px !important; }
.gal-album { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 0; overflow-wrap: anywhere; }
.gal-album .hint { flex-basis: 100%; margin: 0; }

.preview-frame { display: block; width: 100%; height: 640px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; resize: vertical; overflow: auto; }
.preview-frame.phone { width: 390px; max-width: 100%; margin: 0 auto; }

/* ---------- Editor, round 2: top box, field heads, greetings, full screen, Page Design ---------- */
.hero-box { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; margin: 18px 0 6px; padding: 18px;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 32%, var(--panel)), var(--panel) 70%); }
.hero-box:empty { display: none; }
.hero-piccol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hero-pic { width: 100%; }
.pic-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-content: start; min-width: 0; }
.hero-fields .fld { margin: 6px 0; }
.hero-fields .span2 { grid-column: 1 / -1; }
.hero-fields .chips { margin-top: 4px; }
.fld-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fld-note { display: inline-flex; gap: 10px; font-size: 11px; color: var(--muted); }
.tk { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); white-space: nowrap; }
.share-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.share-row .check { margin: 0 !important; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
body.vf .seg button { background: none; color: var(--muted); border-radius: 0; padding: 8px 14px; }
body.vf .seg button + button { border-left: 1px solid var(--line-strong); }
body.vf .seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 60%, var(--panel)); color: var(--gold); }
body.vf .seg button:disabled { cursor: not-allowed; }
/* "Before it can be Public" checklist under the Private / Unlisted / Public buttons */
body.vf .pub-check { flex-basis: 100%; margin-top: 6px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: .9em; color: var(--text); }
body.vf .pub-check ul { list-style: none; margin: 4px 0 0; padding: 0; }
body.vf .pub-check li { margin: 2px 0; }
body.vf .pub-check .mark { display: inline-block; width: 1.4em; font-weight: 700; }
body.vf .pub-check li.ok .mark { color: var(--ok); }
body.vf .pub-check li.no .mark { color: var(--danger); }
body.vf .pub-check .hint { margin-top: 6px; }
.slug-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slug-row .slug-pre { margin: 0; }
body.vf .slug-row input { flex: 1; min-width: 140px; margin: 0; padding: 7px 10px; }
.box-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
body.vf button.mini.on { color: var(--gold); border: 1px solid var(--gold-soft); }
.greets { display: flex; flex-direction: column; gap: 12px; }
.greet { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: color-mix(in srgb, var(--card) 55%, transparent); }
.greet.first { border-color: var(--gold-soft); }
.greet-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.greet-head b { color: var(--gold); }
.greet-note { margin-top: 6px; }
body.vf .greet-note input { margin: 2px 0 0; padding: 7px 10px; font-size: 13px; font-style: italic; }
.pane-h { color: var(--gold); font-weight: 400; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; margin: 18px 0 6px; }
.pane-wide { max-width: none; }
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.design-ed textarea { min-height: 520px; }
.design-pv .preview-frame { height: 600px; }
.design-pv .actions { gap: 6px; }
/* full screen for any big text box */
.bigfld.fs { position: fixed; inset: 0; z-index: 90; margin: 0; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg); display: flex; flex-direction: column; overflow: auto; border-radius: 0; }
.bigfld.fs textarea { flex: 1; min-height: 60vh; resize: none; font-size: 15px; }
body.fs-open { overflow: hidden; }
/* Greeting boxes open about 15 lines tall (owner 2026-11-29 dragged one to ~360px), smaller on phones; still resizable.
   Fixed height, no auto-grow, so a long greeting scrolls inside the box instead of making the page endless. */
body.vf .greet textarea.greet-ta { height: 360px; }
@media (max-width: 600px) { body.vf .greet textarea.greet-ta { height: min(220px, 60vh); } }
body.vf .bigfld.fs textarea.greet-ta { height: auto; }
@media (max-width: 900px) { .design-grid { grid-template-columns: 1fr; } .design-ed textarea { min-height: 300px; } }
@media (max-width: 760px) {
  .hero-box { grid-template-columns: 1fr; padding: 14px; }
  .hero-piccol { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .hero-pic { width: 120px; }
  .hero-fields { grid-template-columns: 1fr; }
  .tok-total { flex-basis: 100%; }
}

/* ---------- Editor, round 3 ---------- */
.savebar { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; }
.editor-panel { margin-top: 14px; padding: 4px 18px 18px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, var(--panel)), color-mix(in srgb, var(--panel) 60%, var(--bg)) 240px); }
.editor-panel .bigtabs { margin-top: 10px; }
.tagin { position: relative; }
.tag-sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin-top: 2px; max-height: 280px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 4px; }
body.vf .tag-opt { display: flex; justify-content: space-between; gap: 12px; width: 100%; background: none; color: var(--text); text-align: left; padding: 8px 10px; font-weight: 500; letter-spacing: 0; font-size: 13px; }
body.vf .tag-opt.on, body.vf .tag-opt:hover { background: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--gold); }
.ta-wrap { position: relative; }
.ta-tag { position: absolute; top: 12px; right: 14px; font-size: 11px; color: var(--muted); pointer-events: none; letter-spacing: .4px;
  background: var(--field); padding: 1px 4px; border-radius: 4px; }
.greet-label { margin-top: 8px; }
.picker.multi button { position: relative; }
.picker.multi button[aria-pressed="true"] { border-color: var(--gold) !important; box-shadow: 0 0 0 2px var(--gold) inset; }
.picker.multi button::after { content: ""; position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--gold-soft); background: color-mix(in srgb, var(--scrim) 55%, transparent); }
.picker.multi button[aria-pressed="true"]::after { content: "✓"; background: var(--gold); color: var(--on-gold); font-size: 13px; line-height: 18px; text-align: center; font-weight: 700; }
.pick-foot { margin-top: 10px; }
/* the hidden note looks different from the greeting itself */
body.vf .greet-note input { border-style: dashed; background: color-mix(in srgb, var(--panel) 80%, transparent); }
.ta-wrap textarea { padding-top: 30px !important; }

/* ---------- Editor: pictures and videos in greetings ---------- */
.seg-sm button { padding: 6px 11px !important; font-size: 12px !important; }
.seg.off { opacity: .4; pointer-events: none; }
.media-opts { display: flex; gap: 18px; flex-wrap: wrap; }
.media-opts label { margin-bottom: 4px; }
.hint.err { color: var(--danger); }
.media-code { white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; padding: 8px 10px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; }
.media-code-box > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
/* chat bubble, drawn the same way as on the chat page */
.bubble { padding: 10px 13px; border-radius: 12px; line-height: 1.5; overflow-wrap: anywhere; background: var(--bubble-bot); border: 1px solid var(--line); font-size: 15px; }
.bubble em { color: var(--bubble-em); }
.bubble .msg-quote { color: var(--chat-quote); }
.bubble p { margin: 0 0 .6em; }
.bubble img.msg-img { max-width: 100%; max-height: 420px; border-radius: 8px; display: block; margin: 6px 0; }
.bubble video.msg-video { display: block; width: auto; max-width: min(100%, 600px); height: auto; border-radius: 8px; margin: 6px 0; }
.media-pv { min-height: 60px; max-height: 360px; overflow: auto; }
.greet-pv { margin-top: 8px; white-space: normal; }
.picker video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.picker button[aria-pressed="true"] { border-color: var(--gold) !important; box-shadow: 0 0 0 2px var(--gold) inset; }

/* ---------- Chat with your own cards (My cards + editor) ---------- */
body.vf .dl-menu button { display: block; width: 100%; text-align: left; background: none; color: var(--text); padding: 9px 12px; border-radius: 6px; font-weight: 400; letter-spacing: 0; font-size: inherit; }
body.vf .dl-menu button b { display: block; font-size: 13px; }
body.vf .dl-menu button span { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
body.vf .dl-menu button:hover, body.vf .dl-menu button:focus { background: color-mix(in srgb, var(--accent) 45%, transparent); outline: none; }
body.vf .dl-menu button:hover b, body.vf .dl-menu button:focus b { color: var(--gold); }
#dl-slot { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.card-hint { font-size: 11px; color: var(--muted); line-height: 1.35; margin: 2px 0 4px; }

/* ---------- Announce update (save bar) and tagline counter ---------- */
.announce-slot { display: inline-flex; align-items: center; gap: 8px; }
.announce-slot:empty { display: none; }
.ann-bar { position: relative; display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--field); border: 1px solid var(--line); overflow: visible; }
.ann-bar i { position: absolute; left: 0; top: 0; bottom: 0; max-width: 100%; border-radius: 3px; background: var(--gold); }
.ann-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.ann-bar.big { display: block; width: 100%; height: 10px; margin-top: 6px; }
.ann-pct { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint.caution { color: var(--warn); }
.hint:empty { display: none; }
.tk.over { color: var(--danger); }
.ann-btn { white-space: nowrap; }

/* Square cover tool (cardlib.js cropSquare) and square lorebook pictures in the builder. */
.pic.square { aspect-ratio: 1 / 1; }
.crop-dlg { width: auto; max-width: calc(100vw - 32px); }
.crop-frame { position: relative; overflow: hidden; margin: 0 auto 12px; border-radius: 10px; border: 1px solid var(--gold); background: var(--field);
  cursor: grab; touch-action: none; user-select: none; }
.crop-frame:active { cursor: grabbing; }
.crop-frame:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.crop-img { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; transform-origin: 0 0; }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.crop-zoom input { flex: 1; accent-color: var(--gold); }
.crop-zoom > span { flex: none; min-width: 6.5em; font-variant-numeric: tabular-nums; }   /* "Zoom 250%": the slider keeps its place */
body.vf .crop-zoom input { padding: 0; margin: 0; background: none; border: none; }

/* ---------- character builder, round 4 (owner 2026-11-24, design-refs/character-builder-mockup.html) ---------- */
/* small "Label ▾" menus: Insert template, Insert media */
.pop-hold { position: relative; display: inline-block; }
.bpop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(340px, 86vw); max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 12px 34px #000c; padding: 6px; text-align: left; }
.bpop-h { padding: 8px 10px 3px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.bpop-note { padding: 4px 10px 6px; font-size: 12.5px; color: var(--muted); }
.bpop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.bpop-row { display: flex; align-items: stretch; gap: 4px; }
body.vf .bpop-i, body.vf .bpop-side { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px;
  padding: 7px 10px; color: var(--text); font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; cursor: pointer; }
body.vf .bpop-i b { font-weight: 600; }
body.vf .bpop-i span { color: var(--muted); font-size: 12px; }
body.vf .bpop-side { width: auto; flex: none; color: var(--gold); font-size: 12.5px; justify-content: center; }
body.vf .bpop-i:hover, body.vf .bpop-i:focus-visible, body.vf .bpop-side:hover, body.vf .bpop-side:focus-visible { background: color-mix(in srgb, var(--accent) 35%, transparent); outline: none; }
.fld-head .pop-hold { margin-left: auto; }

/* the site's on/off switch */
body.vf .vf-switch { flex: none; width: 36px; height: 20px; padding: 0 !important; border-radius: 999px; border: 1px solid var(--line-strong) !important;
  background: var(--field); position: relative; cursor: pointer; vertical-align: middle; min-height: 0; }
body.vf .vf-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: left .12s, background .12s; }
body.vf .vf-switch[aria-checked="true"] { background: var(--gold); border-color: var(--gold) !important; }
body.vf .vf-switch[aria-checked="true"]::after { left: 18px; background: var(--on-gold); }
body.vf .vf-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { body.vf .vf-switch::after { transition: none; } }
.switch-row { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; margin: 6px 16px 6px 0; }

/* Lorebook tab: settings as one folded line, Entries with a header that hides them all */
details.fold > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 4px 0 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▾"; color: var(--gold); order: 1; }
details.fold[open] > summary::after { content: "▴"; }
details.fold > summary b, .fold-head b { font-size: 15px; }
.fold-vals { color: var(--muted); font-size: 12.5px; font-weight: 400; order: 2; }
.fold-body { padding: 4px 0 8px; }
.entries-sec { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
body.vf .fold-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; width: 100%; background: none; border: 0; padding: 8px 0; color: var(--text);
  text-transform: none; letter-spacing: 0; font-weight: 400; text-align: left; cursor: pointer; }
body.vf .fold-head .fold-arrow { font-style: normal; color: var(--gold); transition: transform .12s; }
body.vf .fold-head[aria-expanded="false"] .fold-arrow { transform: rotate(-90deg); }
details.entry { margin-bottom: 6px; }
details.entry > summary { align-items: center; min-width: 0; }
details.entry .e-title { flex: 0 1 auto; max-width: 40%; }
details.entry .e-keys { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.entry .e-flag { color: var(--gold); font-size: 11.5px; white-space: nowrap; }
details.entry .e-tok { color: var(--muted); font-size: 12px; white-space: nowrap; }
details.entry.off > summary .e-title, details.entry.off > summary .e-keys { opacity: .55; }
details.entry[open] { border-color: var(--gold); }
details.more-opts { margin: 10px 0 4px; }
details.more-opts > summary { cursor: pointer; color: var(--gold); font-size: 13px; }
@media (max-width: 560px) { details.entry .e-keys { display: none; } details.entry .e-title { max-width: none; flex: 1; } }

/* Greetings: Write / Preview */
.greet.previewing .ta-wrap { display: none; }
.wp-seg { margin-left: 4px; }

/* Character's note: the "messages back" number */
.inline-num { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
body.vf input.num-sm { width: 72px !important; margin: 0 !important; padding: 4px 8px !important; }

/* Page Design: Computer at a real desktop width (scaled), Phone in a phone frame */
.pv-stage { position: relative; width: 100%; overflow: hidden; }
.pv-stage .preview-frame { position: absolute; top: 0; left: 0; max-width: none; transform-origin: top left; resize: none; margin: 0; }
.pv-stage.phone .preview-frame { border: 6px solid var(--line-strong); border-radius: 28px; box-sizing: content-box; }

/* "Add a lorebook" (the chat's picker, in the builder's window) */
.pill-tabs { display: flex; gap: 6px; margin: 8px 0; }
body.vf .pill-tab { background: none; color: var(--muted); border: 1px solid var(--line) !important; border-radius: 999px; padding: 4px 12px !important; font-size: 12.5px; font-weight: 400; letter-spacing: 0; }
body.vf .pill-tab.on { color: var(--gold); border-color: var(--gold) !important; }
.lb-list { max-height: 52vh; overflow-y: auto; }
.lb { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.lb .lb-cv, .lb img.lb-cv { width: 42px; height: 42px; object-fit: cover; flex: none; border-radius: 8px; border: 1px solid var(--line-strong); }
.lb-text { min-width: 0; flex: 1; }
.lb-text b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-text small { color: var(--muted); font-size: 12px; }
.pubas-row .seg button { text-transform: none; }
/* lorebook keys as chips */
.key-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; margin: 6px 0; background: var(--field); border: 1px solid var(--line); border-radius: 9px; cursor: text; }
.key-chips:focus-within { border-color: var(--gold); }
.key-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 1px 4px 1px 10px; font-size: 13px; }
body.vf .key-chip .key-x { background: none; border: 0; padding: 0 4px; color: var(--muted); font-size: 11px; cursor: pointer; min-height: 0; }
body.vf .key-chip .key-x:hover { color: var(--danger); }
body.vf .key-chips input { flex: 1; min-width: 120px; width: auto !important; margin: 0 !important; padding: 4px !important; border: 0 !important; background: transparent !important; }
.ver.draft-row { border-style: dashed; }
/* template editor / manager and other builder dialogs (buildertemplates.js dialog) */
.vf-dlg.tpl-dlg { width: min(640px, 94vw); max-height: 90vh; overflow-y: auto; text-align: left; }
.tpl-dlg .tpl-l { display: block; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.tpl-dlg input[type=text], .tpl-dlg textarea { width: 100%; }
.tpl-list { max-height: 55vh; overflow-y: auto; margin: 8px 0; }

/* ---- Page Studio box: Page Design tab and profile designer (studiocopies.js, STUDIO.md) ---- */
.st-copies { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--gold-soft); border-radius: 12px; background: color-mix(in srgb, var(--gold) 6%, var(--panel)); }
.st-copies .fld-head label { color: var(--gold); }
.st-copies .st-kept > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.st-copies .st-kept > summary:hover, .st-copies .st-kept[open] > summary { color: var(--text); }
.st-copies .st-fl { font-size: 12.5px; font-weight: 600; margin: 12px 0 2px; }
.st-copy { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; margin-top: 6px; background: var(--card); }
.st-copy .actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* a file dragged over My characters / lorebooks / Worlds: the whole page takes the drop (mychars.js) */
body.imp-dropping main { outline: 2px dashed var(--accent, currentColor); outline-offset: -6px; }
.imp-over { font-style: italic; }
