:root {
  color-scheme: dark;
  scrollbar-gutter: stable;
  font-family: Inter, "Segoe UI", sans-serif;
  color: #f0ecf8;
  background: #131119;
  --muted: #b1a9c0;
  --surface: #1b1723;
  --line: #322b40;
  --accent: #d9c5ff;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
:focus-visible { outline: 2px solid #d9c5ff; outline-offset: 4px; }
.shell { width: min(100% - 72px, 1480px); margin-inline: auto; }
.topbar { background: #19151f; border-bottom: 1px solid var(--line); }
.topbar-account-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.topbar .account-button, .topbar .admin-button { background: #2b2338; color: var(--accent); }
.topbar-account-actions:has(.account-button[hidden]),
.topbar .admin-button[hidden], .account-status:empty { display: none; }
.account-status { padding-block: 10px; color: var(--muted); }
.account-profile { max-width: 660px; margin: 40px auto 0; }
.account-heading { display: flex; align-items: flex-end; gap: 8px; }
.account-heading h1, .account-profile dd { overflow-wrap: anywhere; }
.profile-edit { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: #D9C5FF; cursor: pointer; }
.profile-edit:hover { color: #f0e5ff; }
.profile-edit:focus-visible { outline: none; background: #3d3054; border-radius: 50%; }
.account-welcome { color: var(--muted); }
.welcome-confetti { position: absolute; inset-block-start: 3px; inset-inline: 0; pointer-events: none; }
.welcome-confetti i { position: absolute; width: 5px; height: 8px; border-radius: 2px; opacity: 0; }
.profile-verified { display: inline-block; margin-inline-start: 6px; color: var(--muted); }
.account-profile dl { margin-block: 24px; border-top: 1px solid var(--line); }
.account-profile dl div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.account-profile dt { color: var(--muted); }
.account-profile dd { margin: 0; }
.profile-feedback { margin-top: 12px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.login-challenge { width: min(340px, calc(100% - 24px)); text-align: center; color: inherit; background: transparent; border: 0; padding: 8px; }
.login-challenge::backdrop { background: #08070bb3; }
.login-challenge [role="status"]:empty { display: none; }
.login-widget { width: min(100%, 300px); min-height: 65px; margin-inline: auto; }
.login-widget:empty { display: none; }
.topbar-inner { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 32px; padding-inline: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 21px; letter-spacing: -.045em; }
.brand:hover, .brand:focus-visible { color: #EC6C9D; }
@media (prefers-reduced-motion: no-preference) {
  .brand { transition: color 180ms ease; }
}
.mark { display: block; width: 33px; height: 33px; object-fit: contain; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; font-weight: 550; color: var(--muted); }
nav a { padding: 9px 12px; border-radius: 8px; }
nav a:hover, nav [aria-current="page"] { background: #2b2338; color: var(--accent); }
.preference { position: relative; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.preference input { position: absolute; opacity: 0; }
.switch { width: 34px; height: 20px; border: 1px solid #665a78; border-radius: 20px; background: #332b41; padding: 3px; }
.switch::after { content: ""; display: block; width: 12px; height: 12px; background: #b6a8cb; border-radius: 50%; transition: transform .16s ease; }
.preference input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.preference input:checked + .switch::after { transform: translateX(14px); background: #43295f; }
.preference input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 4px; }
main { flex: 1; }
#main:not(:has(> .library, > .detail)) { padding-bottom: 42px; }
#main:has(> .library, > .detail) { display: grid; width: 100%; }
.intro { margin-bottom: 28px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(32px, 4vw, 53px); line-height: 1.06; letter-spacing: -.055em; }
.intro p, .guide p, .empty p { margin-top: 12px; color: var(--muted); line-height: 1.55; }
.library { display: grid; grid-template-columns: 312px minmax(0, 1fr); }
.filters { display: flex; flex-direction: column; --sort-border: #665478; background: var(--surface); border-right: 1px solid var(--line); padding: 38px 28px 42px 22px; }
.library-results { container-type: inline-size; padding: 20px clamp(24px, 3vw, 52px) 24px; }

/* Keep eight full-size cards on wide screens after widening the filters. */
@media (min-width: 1880px) {
  .library-results { padding-inline: clamp(16px, calc((100% - 1519px) / 2), 52px); }
}
.filters > input, .filters select { width: 100%; color: inherit; padding: 10px; background: #131019; border: 1px solid #42364e; border-radius: 7px; font-size: 14px; }
.filters > input, .filters #gender { display: block; margin-bottom: 8px; }
.tag-filter { position: relative; min-width: 0; margin-bottom: 8px; }
.search-tag-field { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; min-height: 39px; background: #131019; border: 1px solid #42364e; border-radius: 7px; }
.search-tag-field:focus-within { border-color: var(--accent); }
.search-tag-chips { display: contents; }
.search-tag-field input { flex: 1 1 55px; width: 100%; min-width: 0; border: 0; outline: 0; padding: 5px; background: transparent; color: inherit; font: inherit; font-size: 14px; }
.search-tag-field input::placeholder { color: #a297b0; }
.search-tag { max-width: 100%; overflow-wrap: anywhere; border: 0; border-radius: 4px; padding: 3px 6px; background: #382d48; color: var(--accent); font-size: 13px; cursor: pointer; }
.search-tag:hover { background: #514360; }
.tag-filter:has(.tag-suggestions:not([hidden])) .search-tag-field {
  border-color: var(--accent);
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}
.tag-suggestions {
  position: absolute;
  z-index: 5;
  inset: auto 0 auto;
  margin-top: -1px;
  max-height: 176px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--accent);
  border-top-color: #42364e;
  border-radius: 0 0 7px 7px;
  background: #131019;
  box-shadow: 0 6px 18px #0005;
  scrollbar-color: #665773 #211a29;
}
.tag-suggestion-rows { display: grid; width: max-content; min-width: 100%; }
.tag-suggestions button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.tag-suggestion-count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag-suggestions button:hover, .tag-suggestions button:focus-visible { background: #382d48; }
.tag-status:not(:empty) { padding-top: 4px; font-size: 12px; color: var(--accent); }
.tag-filter .search-tag-field:has(input[aria-invalid="true"]) { border-color: #ff8896; }
.tag-filter:has(input[aria-invalid="true"]) .tag-status { color: #ff9ba8; }
@media (prefers-reduced-motion: no-preference) {
  .tag-field-shake { animation: tag-field-shake .28s ease-in-out; }
}
@keyframes tag-field-shake {
  25%, 75% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
}
.filters > input::placeholder { color: #a297b0; }
.sort-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--sort-border); }
.filters #sort-order { border-color: var(--sort-border); background-color: #262033; }
.filter-actions { display: grid; gap: 8px; margin-top: 12px; }
.filter-actions > button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 38px; padding: 8px 10px; font-size: 14px; }
.reset-filters { border: 1px solid #514360; border-radius: 7px; background: #262033; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.reset-filters:hover { background: #382d48; }
.filter-summary { margin: 14px 0 24px; text-align: center; font-size: 14px; }
.content-preference {
  width: min(100%, 260px);
  margin: auto auto 0;
  padding: 14px;
  border: 1px solid #42364e;
  border-radius: 10px;
  background: #201a29;
  text-align: center;
}
.content-preference h2 { margin-bottom: 12px; font-size: 15px; font-weight: 650; }
.card-preferences .preference { text-align: left; }
.card-preferences .preference-options { width: auto; margin: 10px 0 0; }
.card-preferences .preference-tooltip {
  inset-inline: auto 0;
  width: min(210px, 100%);
  transform: none;
}
.card-preferences .switch { flex: none; }
.preference-options { display: grid; gap: 10px; width: fit-content; margin-inline: auto; }
.preference-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preference-info {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #665a78;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: help;
}
.preference-info:is(:hover, :focus-visible) { border-color: var(--accent); color: var(--accent); }
.preference-tooltip {
  position: absolute;
  z-index: 5;
  inset: auto auto 100% 50%;
  width: min(210px, calc(100vw - 48px));
  padding: 8px 10px;
  border: 1px solid #665a78;
  border-radius: 7px;
  background: #131019;
  color: #f0ecf8;
  box-shadow: 0 4px 12px #0006;
  font-size: 13px;
  line-height: 1.45;
  transform: translateX(-50%);
  visibility: hidden;
  pointer-events: none;
}
@media (hover: hover) {
  .preference-info:hover + .preference-tooltip { visibility: visible; }
}
.grid {
  --card-width: min(182px, 100cqw);
  --card-height: calc((var(--card-width) - 16px) * 7 / 5 + 16px);
  --card-details-height: 88px;
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--card-width));
  /* Keep the reserved rows in sync with ROWS_PER_PAGE in app.js. */
  grid-template-rows: repeat(3, minmax(calc(var(--card-height) + var(--card-details-height)), auto));
  justify-content: center;
  align-items: start;
  gap: 9px;
}
.tile { position: relative; min-width: 0; display: block; padding: 7px; background: #25232b; border: 1px solid #34313c; border-radius: 12px; transition: border-color .15s ease; }
.tile:hover, .tile:has(:focus-visible) { border-color: #a084cd; }
.art img, .detail-art img, .variant-row img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: contain; border-radius: 7px; background: #231b2d; }
.tile-open { display: block; }
.tile-image-unavailable {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 7;
  padding: 12px;
  border-radius: 7px;
  background: #231b2d;
  text-align: center;
  overflow-wrap: anywhere;
}
.tile-info {
  display: grid;
  gap: 4px;
  padding: 14px 8px 8px;
  overflow-wrap: anywhere;
}
.tile-info .tile-download { display: flex; justify-content: center; align-items: center; gap: 5px; padding: 6px 8px; font-size: 12px; }
.tile-download svg { width: 14px; height: 14px; flex: none; }
.tile-facts { display: none; }
.tile:has(:focus-visible) { z-index: 1; }
.tile:hover { z-index: 2; }
@media (hover: hover) and (pointer: fine) {
  .grid { --card-details-height: 0px; }
  .tile-facts {
    display: grid;
    position: fixed;
    top: 0;
    left: 0;
    width: min(218px, calc(100vw - 16px));
    margin: 0;
    padding: 10px 12px;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 6px 18px #0007;
    font-size: 12px;
    visibility: hidden;
  }
  .tile:hover .tile-facts,
  .grid:not(:has(.tile:hover)) .tile:has(:focus-visible) .tile-facts { visibility: visible; }
  .tile-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0 0 8px; border-bottom: 1px solid var(--line); list-style: none; }
  .tile-tags li { min-width: 0; }
  .tile-tags .tag-link { font-size: 12px; }
  .tile-metadata { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 9px; margin: 0; }
  .tile-variant-count { color: var(--accent); font-weight: 700; }
  .tile-metadata > div { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
  .tile-metadata dt { display: flex; align-items: center; gap: 5px; }
  .tile-facts dd { display: flex; flex-wrap: wrap; gap: 4px; overflow-wrap: anywhere; }
  .tile-info {
    position: absolute;
    inset: auto 7px 7px;
    border-radius: 0 0 7px 7px;
    background: linear-gradient(transparent, #131119 26%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
  }
  .tile:hover .tile-info,
  .grid:not(:has(.tile:hover)) .tile:has(:focus-visible) .tile-info { opacity: 1; }
  .tile:hover .tile-download,
  .grid:not(:has(.tile:hover)) .tile:has(:focus-visible) .tile-download { pointer-events: auto; }
}
.tile-info strong { font-size: 14px; text-align: center; }
.card-title-variant { color: #D9C5FF; }
.back { display: inline-block; margin: 28px 0 20px; color: var(--accent); font-size: 14px; }
.detail { display: grid; grid-template-columns: clamp(290px, 24vw, 424px) minmax(0, 1fr); min-height: 100svh; }
.detail-card-column {
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  padding: 38px clamp(16px, 2vw, 30px) 42px;
}
.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, min(28%, 404px));
  align-content: start;
  align-items: start;
  gap: clamp(20px, 3vw, 48px);
  padding: 38px clamp(24px, 3vw, 52px) 42px;
}
.detail-art { display: grid; gap: 12px; background: #25232B; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
#main > .empty { margin-top: 28px; }
.detail-tags { display: grid; gap: 16px; }
.tag-panel { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tag-panel h2 { font-size: 15px; }
.tag-panel ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tag-panel li { min-width: 0; }
.tag-link { display: block; overflow-wrap: anywhere; border-radius: 4px; padding: 3px 7px; background: #332a43; color: #fff; font-size: 13px; }
.tag-link.nsfw { background: #632839; }
.tag-link.sfw { background: #234c39; }
a.tag-link:is(:hover, :active, :focus-visible) {
  color: #eadfff;
  text-decoration: none;
  filter: brightness(1.15);
}
.breast-size-select {
  width: 100%; min-height: 42px; margin-top: 10px; padding: 8px 36px 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #131019; color: inherit; font: inherit;
}
.breast-size-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (forced-colors: none) {
  .breast-size-select, .filters select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23f0ecf8' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
  }
}
.breast-size-panel p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tag-copy-notice {
  position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 10;
  width: max-content; max-width: min(360px, calc(100vw - 40px));
  overflow-wrap: anywhere; pointer-events: none;
}
.tag-copy-notice:not(:empty) {
  padding: 12px 16px; border: 1px solid #514360; border-radius: 10px;
  background: var(--surface); color: var(--muted); box-shadow: 0 6px 18px #0005;
}
.tag-copy-notice strong { display: block; margin-bottom: 4px; color: var(--accent); }
.tag-copy-retry { display: block; margin-top: 8px; pointer-events: auto; }
.gender-tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; padding: 2px 7px; }
.gender-tag.female, .positive-tag-list .tag-link.female { background: #702b59; }
.gender-tag.male, .positive-tag-list .tag-link.male { background: #234874; }
.gender-tag.other, .positive-tag-list .tag-link.other { background: #493660; }
.gender-tag.female { color: #ffe0f1; }
.gender-tag.male { color: #e4efff; }
.gender-tag.other { color: #efe5ff; }
.series-name { color: var(--accent); margin: 9px 0 10px; }
.detail-info dl { margin: 22px 0; border-top: 1px solid var(--line); }
.detail-info h1 { text-wrap: balance; overflow-wrap: anywhere; }
.card-vote-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-vote-controls button { min-width: 28px; min-height: 27px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; cursor: pointer; }
.card-vote-controls button:hover, .card-vote-controls button[aria-pressed="true"] { background: var(--accent); color: #261739; }
.card-vote-controls button:disabled { opacity: .55; cursor: default; }
.card-vote-controls[data-loading] button:disabled { opacity: 1; }
.card-vote-controls small { color: var(--muted); }
.card-vote-score { text-align: center; }
.detail-info dl div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; }
.button { display: inline-block; border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 700; text-align: center; cursor: pointer; }
.primary { background: var(--accent); color: #261739; }
.primary:hover { background: #eadfff; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
summary { cursor: pointer; font-weight: 650; }
.download-card { display: flex; justify-content: center; align-items: center; gap: 8px; }
.detail-art .download-card { background: #D9C5FF; color: #261739; }
.detail-art .download-card:hover { background: #eadfff; }
.card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card-actions > * { padding-inline: 8px; }
.card-moderation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.card-moderation-actions[hidden], .card-moderation-status:empty { display: none; }
.card-moderation-actions .button {
  padding-inline: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.card-moderation-actions .hide-card { background: #484650; color: #faf8ff; }
.card-moderation-actions .hide-card:hover { background: #595662; }
.card-moderation-actions .remove-card { background: #f1c66c; color: #271c0a; }
.card-moderation-actions .remove-card:hover { background: #ffdb88; }
.card-moderation-status { grid-column: 1 / -1; color: #f1c66c; }
.report-card { display: flex; justify-content: center; align-items: center; gap: 8px; color: #301017; background: #E47787; }
.report-card:hover { background: #ef8b99; }
.report-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 22px; border: 1px solid var(--line); border-radius: 14px; color: inherit; background: var(--surface); }
.report-dialog::backdrop { background: #08070bb3; }
.request-notice h2 { margin: 0 0 8px; }
.request-notice p { margin: 0 0 18px; }
.report-dialog.account-delete-dialog { background: #26161c; border-color: #643542; }
.account-delete-dialog h2, .account-delete-dialog .delete-name { color: #ffbbc8; }
.delete-copy { display: inline; padding: 0; border: 0; background: transparent; color: #ffbbc8; cursor: pointer; overflow-wrap: anywhere; }
.delete-copy svg { vertical-align: -.15em; }
.delete-copy:hover { text-decoration: underline; }
.account-close[hidden] { display: none; }
.account-delete-dialog input:focus-visible { outline-color: #efa1b1; }
.report-form, .report-form label { display: grid; gap: 8px; }
.report-form .report-alias[hidden] { display: none; }
.report-form { gap: 14px; }
.report-form h2, .report-form p { margin: 0; }
.report-form input:not([type="hidden"]), .report-form textarea { width: 100%; padding: 9px; color: inherit; background: #131119; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.report-form textarea { resize: vertical; }
.report-form small, .report-status { color: var(--muted); }
.report-form small a { color: var(--accent); text-decoration: underline; }
.report-status:empty { display: none; }
.report-field-error { color: #efa1b1; font-size: 13px; }
.report-field-error:empty { display: none; }
.report-actions { display: flex; justify-content: flex-end; gap: 8px; }
.report-close { background: #30283d; color: inherit; }
.report-close:hover { background: #3c324b; }
.report-actions button:disabled { opacity: .65; cursor: wait; }
.report-confirmation { text-align: center; }
.report-confirmation h2 { margin: 0 0 8px; }
.report-confirmation p { margin: 0; color: var(--muted); }
.prompt-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 8px; }
.prompt-heading h3 { margin: 0; }
.copy-prompt { padding: 4px 10px; border: 1px solid #514360; border-radius: 6px; background: #332a43; color: var(--accent); font-size: 13px; cursor: pointer; }
.copy-prompt:hover { background: #463653; }
.copy-status { color: var(--muted); font-size: 13px; }
.clipboard-fallback { position: fixed; inset: 0 auto auto 0; opacity: 0; pointer-events: none; }
.prompt { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; color: var(--muted); }
.prompt-tag {
  border-radius: 3px; color: inherit; cursor: pointer;
}
.prompt-tag:is(:hover, :focus-visible, .tag-copy-highlight) {
  background: #332a43; color: var(--accent);
}
.tag-link.breast-size-override, .prompt .breast-size-override {
  border-radius: 4px; background: #703d61; color: #ffe9f5;
  box-shadow: inset 0 0 0 1px #ba719f;
}
.prompt-tag.breast-size-override { --prompt-tag-flash: #92537e; }
.prompt-tag.breast-size-override.tag-copy-highlight { outline: 1px solid var(--accent); }
.tag-link.breast-size-override { color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .prompt-token { display: inline-block; max-width: 100%; }
  .prompt-tag { transition: background-color .25s ease-out, color .25s ease-out; }
}
.prompt-tag-group { display: inline-block; max-width: 100%; }
.prompt-copy-preference { width: fit-content; margin-top: 16px; }
.detail-info > :is(.variants, .card-discussion) {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
h2 { font-size: 21px; letter-spacing: -.025em; }
.variant-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.variant-row a { width: 108px; display: grid; gap: 7px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; text-align: center; font-size: 13px; }
.variant-row a:hover { border-color: var(--accent); }
.guide { max-width: 720px; }
.usage-guide, .info-page { max-width: 840px; margin: 38px auto 0; }
.usage-guide p { color: var(--muted); line-height: 1.6; }
.usage-intro { margin-top: 12px; }
.usage-closing-quotes, .about-credits {
  display: grid;
  margin: clamp(48px, 8vw, 88px) auto 36px;
  padding: 28px clamp(12px, 4vw, 40px) 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.usage-quote {
  grid-area: 1 / 1;
  align-self: center;
  margin: 0;
  transition: opacity 420ms ease, visibility 420ms;
}
.usage-quote blockquote { margin: 0; font-size: clamp(17px, 2.4vw, 22px); line-height: 1.6; }
.usage-quote figcaption { margin-top: 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.usage-quote cite { font-style: italic; }
.usage-closing-quotes.quotes-clickable { cursor: pointer; }
.usage-quote:last-child, .show-paraphrase .usage-quote:first-child { visibility: hidden; opacity: 0; }
.show-paraphrase .usage-quote:last-child { visibility: visible; opacity: 1; transition-delay: 420ms; }
@media (prefers-reduced-motion: reduce) {
  .usage-closing-quotes .usage-quote { transition: none; }
}
.usage-steps { display: grid; gap: 16px; margin: 28px 0 0; padding: 0; }
.usage-steps > li {
  list-style-position: inside;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.usage-steps > li::marker { color: var(--accent); font-size: clamp(18px, 3vw, 22px); font-weight: 750; }
.usage-steps h2 { display: inline; font-size: clamp(18px, 3vw, 22px); }
.usage-steps p { margin-top: 9px; }
.usage-steps p code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #131119;
  color: var(--accent);
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: inherit;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.usage-restart-reminder { color: #f09aa9; }
.usage-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #131119;
}
.usage-command code { font-size: 13px; overflow-wrap: anywhere; }
.usage-command .button {
  display: grid;
  flex: none;
  place-items: center;
  padding: 8px;
  background: #2b2338;
  color: var(--accent);
  transition: background-color .18s ease, color .18s ease;
}
.usage-command .button:is(:hover, :focus-visible) {
  background: #3d3054;
  color: #f0e5ff;
}
.usage-command-copied { animation: usage-command-flash .44s ease-in-out; }
@keyframes usage-command-flash {
  22% {
    transform: scale(var(--usage-copy-scale, 1.08));
    background-color: #544267;
    box-shadow: 0 0 8px #d9c5ff26;
  }
}
@media (prefers-reduced-motion: reduce) {
  .usage-command-copied { --usage-copy-scale: 1; }
}
.usage-command-status:not(.usage-command-error) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.usage-command-error { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.usage-command-error:empty { display: none; }
.usage-install-details { margin-top: 14px; }
.usage-install-details summary { width: fit-content; color: var(--accent); cursor: pointer; }
.usage-install-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.usage-install-links .usage-action { margin-top: 0; }
.usage-install-links img { flex: none; }
.usage-action { display: inline-flex; align-items: center; gap: 9px; margin-top: 16px; }
.usage-action svg { flex: none; }
#node-demo { margin-top: 22px; }
#node-demo h3 { margin: 0; scroll-margin-top: 20px; }
.demo-footer { min-height: 112px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.demo-instructions-enter { animation: demo-description-in .28s ease-out; }
.demo-canvas {
  margin-top: 16px;
  padding: clamp(10px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #191919;
  background-image: linear-gradient(#1118 1px, transparent 1px), linear-gradient(90deg, #1118 1px, transparent 1px);
  background-size: 14px 14px;
}
.demo-node {
  position: relative;
  max-width: 450px;
  margin-inline: auto;
  padding: 0 10px 10px;
  border: 1px solid #111;
  border-radius: 10px;
  background: #333;
  box-shadow: 0 4px 12px #0008;
  color: #eee;
  font-size: 12px;
}
.demo-node-title { padding: 9px 3px; border-bottom: 1px solid #242424; font-weight: 650; }
.demo-node-title::before { content: "●"; margin-right: 7px; color: #999; }
.demo-ports { padding-block: 4px; text-align: right; color: #d0ccd6; }
.demo-port-row { display: block; }
.demo-field {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  padding: 3px 8px;
  border: 1px solid #6e6e6e;
  border-radius: 12px;
  background: #232323;
  color: #ccc;
}
.demo-field span:last-child { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.demo-node > .demo-field:not(.demo-copyright-hint) > span:first-child { color: #a0a0a0; }
.demo-node > :is(.demo-library-field, .demo-card-field) > span:last-child,
.demo-node > .demo-field > .demo-toggle-on { color: #eee; }
.demo-card-field > :first-child { flex: none; }
.demo-card-field > :last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.demo-toggle-on::after, .demo-toggle-off::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-inline-start: 4px;
  vertical-align: -2px;
  border-radius: 50%;
  background: #8899AA;
}
.demo-toggle-off::after { background: #363636; }
.demo-value {
  position: absolute;
  z-index: 1;
  inset: 105px 4px auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 20px;
  background: #181818;
  box-shadow: 0 6px 20px #000b;
}
.demo-value > span { color: #b4b4b4; }
.demo-value code {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #4b4c52;
  border-radius: 10px 2px 2px 10px;
  background: #313235;
  overflow-wrap: anywhere;
}
.demo-value-confirm {
  flex: none;
  padding: 4px 13px;
  border: 0;
  border-radius: 999px;
  background: #a0a0a0;
  color: #181818;
  font-weight: 650;
  cursor: pointer;
}
.demo-value-confirm:hover { background: #bcbcbc; }
.demo-toolbar, .demo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.demo-chip, .demo-actions button { padding: 4px 7px; border: 1px solid #626262; border-radius: 4px; background: #252525; }
.demo-toolbar .demo-variant-button { cursor: pointer; }
.demo-toolbar .demo-chip:disabled { color: #999; opacity: .55; cursor: default; }
.demo-toggle-off { color: #999; }
.demo-copyright { width: 100%; cursor: pointer; }
.demo-copyright:hover { border-color: var(--accent); }
.demo-toolbar :is(.demo-library-button, .demo-variant-hint), .demo-copyright-hint {
  border-color: var(--accent);
  background: var(--accent);
  color: #261739;
  cursor: pointer;
}
.demo-toolbar :is(.demo-library-button, .demo-variant-hint) { animation: demo-library-pulse 1.2s ease-in-out .35s 2; }
.demo-toolbar :is(.demo-library-button, .demo-variant-hint):hover, .demo-copyright-hint:hover { background: #eadfff; }
.demo-copyright-pulse { animation: demo-copyright-pulse 2.4s ease-in-out; }
.demo-copyright-hint .demo-toggle-off { color: inherit; }
.demo-toolbar .demo-variant-button:not(.demo-variant-hint):hover { border-color: var(--accent); }
.demo-status { margin-top: 8px; padding: 3px; overflow-wrap: anywhere; }
.demo-highlight { outline: 2px solid var(--accent); outline-offset: 1px; }
.demo-preview { display: grid; place-items: center; min-height: 132px; margin-top: 8px; }
.demo-workflow { position: relative; isolation: isolate; }
.demo-picker {
  position: absolute;
  inset: clamp(12px, 4vw, 32px) 0;
  z-index: 2;
  padding: clamp(10px, 3vw, 20px);
  overflow: auto;
  border: 1px solid #666;
  border-radius: 3px;
  background: #353535;
  color: #eee;
  box-shadow: 0 6px 24px #000b;
}
.demo-picker-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.demo-picker-search { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid #666; border-radius: 4px; background: #262626; color: #b3b3b3; font-size: 12px; }
.demo-picker button { color: inherit; cursor: pointer; }
.demo-picker button:focus-visible { outline-color: #aaa; }
.demo-picker-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-picker-card { display: grid; gap: 5px; justify-items: center; padding: 8px; border: 1px solid #626262; border-radius: 4px; background: #252525; font-size: 12px; }
.demo-picker-card-hint:not(:hover) { animation: demo-card-pulse 1.2s ease-in-out 1.5s 2; }
.demo-picker-card:hover { border-color: #999; }
.demo-picker-card img { width: 86px; border-radius: 3px; }
.demo-drag { display: grid; gap: 5px; justify-items: center; padding: 9px; border-radius: 6px; background: #212121; box-shadow: 0 4px 12px #0007; animation: demo-drag-in .55s ease-out; }
.demo-drag img { width: 57px; border-radius: 3px; }
.demo-drop { overflow: hidden; border: 1px dashed var(--accent); border-radius: 6px; }
.demo-loaded-card { width: min(55%, 165px); }
.demo-card-refreshing { visibility: hidden; }
.demo-prompt { min-height: 38px; margin-top: 8px; padding: 6px; background: #222; font: 11px/1.4 monospace; overflow-wrap: anywhere; }
.demo-prompt-placeholder { color: #757575; }
#node-demo .demo-node-variants .demo-loaded-card { aspect-ratio: 5 / 7; object-fit: contain; }
#node-demo .demo-node-variants .demo-prompt { height: calc(4lh + 12px); overflow: auto; }
.demo-prompt-editable { display: block; width: 100%; border: 0; resize: none; color: inherit; }
.demo-prompt-hint { outline: 1px solid var(--accent); }
.demo-prompt-editable:focus-visible { outline: 2px solid var(--accent); }
.demo-actions button { padding: 7px 11px; color: inherit; cursor: pointer; }
.demo-actions button:disabled { opacity: .5; cursor: default; }
.demo-actions button.primary, .demo-actions button[aria-pressed="true"] { background: var(--accent); color: #261739; }
.demo-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.workflow-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: inherit;
}
.workflow-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
html:has(.workflow-dialog[open]) { overflow: hidden; }
.workflow-dialog { overflow: hidden; }
.workflow-dialog::backdrop { background: #08070bd9; }
.workflow-header, .workflow-footer { padding: 16px clamp(14px, 3vw, 24px); }
.workflow-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.workflow-header button { background: #282431; color: inherit; }
.workflow-footer .demo-actions .workflow-run:not([hidden]) { display: inline-flex; align-items: center; gap: 7px; background: #0072bc; color: #fff; }
.workflow-footer .demo-actions .workflow-run:hover { background: #005f9e; }
.workflow-footer .demo-actions button[hidden] { display: none; }
.workflow-footer { max-height: 42dvh; overflow: auto; }
.workflow-stage { position: relative; min-width: 0; min-height: 0; }
.workflow-scroll {
  height: 100%;
  cursor: grab;
  scrollbar-width: none;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-block: 1px solid var(--line);
  background-color: #191919;
  background-image: linear-gradient(#1118 1px, transparent 1px), linear-gradient(90deg, #1118 1px, transparent 1px);
  background-size: 16px 16px;
}
.workflow-board { position: relative; width: 1340px; min-height: 500px; margin-inline: auto; padding: 24px; }
.workflow-scroll::-webkit-scrollbar { display: none; }
.workflow-scroll.is-panning { cursor: grabbing; user-select: none; }
.workflow-scroll img { -webkit-user-drag: none; }
.workflow-wires { position: absolute; inset: 0; pointer-events: none; }
.workflow-cards { display: flex; align-items: flex-start; gap: 20px; }
.workflow-cardbooru { position: relative; width: 380px; }
.workflow-cardbooru-secondary { margin-top: 62px; }
.workflow-cardbooru-label { position: absolute; top: -18px; right: 4px; color: var(--muted); font-size: 12px; }
.workflow-cardbooru-secondary .workflow-cardbooru-label { top: -14px; }
.workflow-cardbooru .demo-ports { height: 38px; }
.workflow-cardbooru .demo-port-row { position: absolute; top: 46px; right: 11px; transform: translateY(-50%); }
.workflow-cardbooru .demo-port-row + .demo-port-row { top: 62px; }
.workflow-cardbooru .demo-port-row span { position: absolute; right: -15px; top: 50%; width: 8px; height: 8px; transform: translateY(-50%); border-radius: 50%; background: #85eb86; font-size: 0; }
.workflow-cardbooru .demo-port-row + .demo-port-row span { background: #8899aa; }
.workflow-node {
  position: absolute;
  padding-bottom: 8px;
  border-radius: 8px;
  background: #315132;
  box-shadow: 0 3px 12px #0008;
  color: #edf3ed;
  font-size: 12px;
}
.workflow-node h3 { position: absolute; inset: 0 0 auto; margin: 0; padding: 8px 10px; border-radius: 8px 8px 0 0; background: #213222; color: #c5cec5; font-size: 12px; font-weight: 550; }
.workflow-node h3::before { content: "●"; margin-right: 6px; color: #899189; }
.workflow-node-highlight {
  transform: translateY(var(--workflow-node-lift, 0px));
  box-shadow: 0 0 0 1px #8eb58e, 0 4px 16px #0009;
}
.workflow-port { position: absolute; transform: translateY(-50%); }
.workflow-input { left: 11px; }
.workflow-output { right: 11px; }
.workflow-port::before { content: ""; position: absolute; top: 50%; width: 8px; height: 8px; transform: translateY(-50%); border-radius: 50%; background: #85eb86; }
.workflow-input::before { left: -15px; }
.workflow-output::before { right: -15px; }
.workflow-port[data-port="clip"]::before { background: #e8c462; }
.workflow-port[data-port="CONDITIONING"]::before { background: #e99454; }
.workflow-node-body { margin-inline: 8px; }
.workflow-node-body .demo-field { padding-block: 2px; }
.workflow-node-body .demo-toggle-on::after { width: 10px; height: 10px; }
.workflow-node-advanced .demo-field { align-items: center; padding-block: 3px; white-space: nowrap; }
.workflow-node-advanced .demo-toggle-on { flex-shrink: 0; }
.workflow-node-badge { position: absolute; top: -17px; right: 3px; padding: 1px 5px; border-radius: 3px; background: #152414; font-size: 10px; }
.workflow-node-time { position: absolute; bottom: 100%; left: 0; padding: 2px 7px; border-radius: 4px; background: #333; color: #ccc; font-size: 12px; font-variant-numeric: tabular-nums; }
.workflow-textarea { min-height: 52px; margin-bottom: 5px; padding: 5px; background: #222; font: 11px/1.4 monospace; }
.workflow-preview-widget { width: 100%; padding: 2px 6px; border: 1px solid #6e6e6e; background: #222; color: inherit; text-align: center; }
button.workflow-preview-widget { border-color: var(--accent); color: var(--accent); cursor: pointer; }
button.workflow-preview-widget:hover { background: #342c40; }
.workflow-preview-hint { animation: workflow-preview-pulse 1.6s ease-in-out 3s infinite; }
@keyframes workflow-preview-pulse {
  50% { transform: scale(1.05); }
}
.workflow-preview-dialog {
  width: min(92vw, 900px);
  max-height: 90dvh;
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid #818181;
  border-radius: 12px;
  background: #262626;
  color: inherit;
}
.workflow-preview-dialog::backdrop { background: #09090bb3; }
.workflow-preview-dialog h3 { margin: 0; }
.workflow-final-prompt {
  min-height: min(226px, 40vh);
  max-height: 48vh;
  margin-block: 14px 8px;
  padding: 8px;
  overflow: auto;
  overflow-wrap: anywhere;
  border: 1px solid #777;
  background: #383838;
  font: 14px/1.5 monospace;
  user-select: text;
}
.workflow-final-prompt [data-source] {
  border-radius: 3px;
  padding-block: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color .2s ease;
}
.workflow-dialog [data-source="frieren"] { --prompt-highlight: #286475; }
.workflow-dialog [data-source="fern"] { --prompt-highlight: #674982; }
.workflow-dialog [data-source="quality"] { --prompt-highlight: #6b5429; }
.workflow-dialog [data-source="scene"] { --prompt-highlight: #305c3e; }
.workflow-final-prompt [data-source]:hover { background-color: var(--prompt-highlight); }
@media (prefers-reduced-motion: no-preference) {
  .workflow-final-prompt.is-fresh [data-source] {
    animation: workflow-prompt-highlight 3.6s ease-in-out;
  }
  @keyframes workflow-prompt-highlight {
    12%, 78% { background-color: var(--prompt-highlight); }
  }
}
.workflow-preview-dialog button { color: inherit; cursor: pointer; }
.workflow-instructions h3 { margin: 0; }
.workflow-options { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 14px; margin-inline-start: auto; color: var(--muted); font-size: 14px; }
.workflow-optional-card input { accent-color: var(--accent); }
.workflow-prompt-stack {
  position: absolute;
  z-index: 1;
  inset: clamp(8px, 2.5vh, 24px) clamp(8px, 2vw, 32px) clamp(8px, 2.5vh, 24px) auto;
  width: min(460px, calc(100% - 16px));
  overflow: auto;
  padding: clamp(16px, 2vw, 28px);
  border: 1px solid #6a587d;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 40px #0009;
}
.workflow-prompt-stack h3 { margin: 0; font-size: clamp(18px, 2vw, 25px); }
.workflow-prompt-stack p { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.workflow-prompt-stack ol { margin: 18px 0 0; padding: 0 0 0 22px; }
.workflow-prompt-stack li { position: relative; list-style: none; margin-top: 6px; padding: 10px 14px; border-radius: 6px; background: color-mix(in srgb, var(--prompt-highlight) 80%, #131119); color: #edf3ed; font-weight: 650; }
.workflow-prompt-stack li.prompt-stack-first { border-radius: 22px 22px 6px 6px; }
.workflow-prompt-stack li.prompt-stack-last { border-radius: 6px 6px 22px 22px; }
.workflow-prompt-stack small { float: right; color: #ffdfb5; }
.workflow-prompt-stack li > span:not(.prompt-stack-symbol) { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; }
.prompt-stack-symbol { position: absolute; left: -22px; top: 50%; transform: translateY(-50%); color: var(--accent); }
.prompt-stack-result { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: #312543; color: var(--accent); font-weight: 700; }
.prompt-stack-result span { margin-right: 6px; }
@keyframes demo-description-in { from { opacity: 0; } }
@keyframes demo-drag-in { from { opacity: 0; transform: translateX(145%); } }
@keyframes demo-card-pulse { 50% { transform: scale(1.045); } }
@keyframes demo-library-pulse { 50% { transform: translateY(-2px) scale(1.06); background: #eadfff; } }
@keyframes demo-copyright-pulse {
  from { background: #bea3ed; }
  45% { transform: scale(1.025); background: #eadfff; }
}
.usage-path { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #131119; }
.usage-path span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 13px; }
.usage-path code { font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.empty { grid-column: 1 / -1; padding: 22px; border: 1px dashed var(--line); border-radius: 10px; }
.footer { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px 16px; min-height: 61px; padding: 8px 22px; border-top: 1px solid var(--line); background: #19151f; color: var(--muted); }
.footer small, .footer .creator-credit { font-weight: 550; }
.footer .creator-credit { justify-self: center; font-size: 13px; color: var(--accent); text-shadow: 0 0 8px rgb(217 197 255 / 38%); }
.creator-credit:hover, .creator-credit:focus-visible { text-decoration: none; }
@media (prefers-reduced-motion: no-preference) {
  .creator-credit { transition: transform 180ms ease; }
  .creator-credit:hover, .creator-credit:focus-visible { transform: scale(1.08); }
}
.footer nav { justify-self: end; }
@media (max-width: 640px) {
  .footer { grid-template-columns: 1fr 1fr; padding-inline: 16px; }
  .footer .creator-credit { grid-column: 1 / -1; grid-row: 2; }
  .footer nav { grid-column: 2; grid-row: 1; justify-content: flex-end; }
}
.footer small { display: block; font-size: 13px; line-height: 20px; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 13px; line-height: 20px; }
.footer a { white-space: nowrap; }
.legal-page { line-height: 1.7; }
.legal-page h2 { margin-top: 28px; font-size: 1.2rem; }
.legal-page p { color: var(--muted); }
.info-page > p { margin: 12px 0 28px; color: var(--muted); line-height: 1.6; }
.info-panel { margin-block: 16px; padding: clamp(16px, 3vw, 24px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.info-page .info-panel h2 { margin: 0 0 10px; font-size: 1.25rem; }
.info-panel p { margin: 0 0 10px; color: var(--muted); line-height: 1.65; }
.info-panel p:last-child { margin-bottom: 0; }
.info-panel a { color: var(--accent); text-decoration: underline; overflow-wrap: anywhere; }

.donations-page {
  max-width: 1040px;
  margin-inline: auto;
  padding-block: clamp(36px, 6vw, 68px) 40px;
}

.donations-page [hidden] { display: none; }
.donations-page p { margin: 0; color: var(--muted); line-height: 1.55; }
.donations-heading { margin-bottom: clamp(28px, 5vw, 48px); text-align: center; }
.donations-heading h1 { margin: 0 0 10px; font-size: clamp(32px, 5vw, 52px); line-height: 1.12; }
.donation-section-title { margin: 0 0 16px; font-size: clamp(22px, 3vw, 28px); }
.donation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.donation-method {
  min-width: 0;
  padding: clamp(17px, 3vw, 28px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--donation-accent, var(--line));
  border-radius: 14px;
  background: var(--surface);
}
.donation-patreon {
  --donation-accent: #ffa195;
  --donation-stripe: linear-gradient(110deg, #f66754, #b75148);
  border-color: rgb(249 104 84 / 23%);
  background: linear-gradient(135deg, rgb(249 104 84 / 10%), rgb(249 104 84 / 2%) 75%), rgb(27 23 35 / 72%);
}
.donation-solana {
  --donation-accent: #bda4ff;
  --donation-stripe: linear-gradient(35deg, #dc1fff, #8b78df 45%, #00ffa3);
  border-color: rgb(157 114 245 / 30%);
  background: linear-gradient(35deg, rgb(220 31 255 / 13%), rgb(139 120 223 / 9%) 45%, rgb(0 255 163 / 12%)), rgb(27 23 35 / 72%);
}
.donation-grid > .donation-method {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 34px);
  border-top-width: 1px;
  border-radius: 22px;
  box-shadow: 0 16px 32px rgb(0 0 0 / 15%);
}
.donation-grid > .donation-method::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--donation-stripe);
}
.donation-brand { display: flex; align-items: center; gap: 12px; }
.donation-brand-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 16px;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 6%);
}
.donation-brand-icon img { display: block; width: 44px; height: 44px; }
.donation-grid .donation-benefits {
  flex: 1;
  gap: 14px;
  margin-block: 26px;
  padding: 22px;
  background: rgb(16 14 23 / 32%);
  border-color: rgb(255 255 255 / 9%);
  border-radius: 14px;
}
.donation-patreon .donation-provider-button {
  --donation-button-hover: #ffb1a5;
  background: #ff9383;
  color: #160c06;
}
.donation-solana .donation-provider-button {
  --donation-button-hover: #d6c4ff;
  background: #bda4ff;
  color: #171226;
}
.donation-grid .donation-provider-button {
  padding: 13px 20px;
  border-radius: 10px;
  transition: background-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

@media (hover: hover) {
  .donation-grid .donation-provider-button:hover {
    background-color: var(--donation-button-hover);
    box-shadow: 0 0 18px color-mix(in srgb, var(--donation-button-hover) 38%, transparent);
    transform: scale(1.045);
  }
}
@media (prefers-reduced-motion: reduce) {
  .donation-grid .donation-provider-button { transition: background-color 220ms ease, box-shadow 220ms ease; }
  .donation-grid .donation-provider-button:hover { transform: none; }
}
.donation-grid .donation-method-heading { gap: 18px; }
.donation-grid .donation-price strong { font-size: 1.7em; }

.donation-method-heading,
.donation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.donation-method-heading { justify-content: space-between; }
.donation-method-heading h3 { margin: 0; font-size: clamp(22px, 3vw, 27px); }
.donation-price { white-space: nowrap; }
.donation-price strong { color: var(--donation-accent); font-size: 1.35em; }
.donation-benefits {
  display: grid;
  gap: 9px;
  margin: 18px 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #131119;
  list-style: none;
}
.donation-benefits li { display: flex; gap: 9px; line-height: 1.45; }
.donation-benefits li::before { content: ""; flex: 0 0 6px; height: 6px; margin-top: .55em; border-radius: 50%; background: var(--donation-accent); }
.donation-actions p { font-size: 14px; }
.donation-provider-button { color: var(--donation-accent); background: color-mix(in srgb, var(--donation-accent) 12%, var(--surface)); }
.donation-provider-button:disabled { cursor: default; }
@media (max-width: 720px) {
  .donation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
  .detail-content { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .topbar-inner { width: 100%; flex-wrap: wrap; gap: 8px 20px; padding: 8px 16px; }
  nav { order: 2; width: 100%; }
  .library { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px; padding: 20px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .library-results { padding: 16px 16px 32px; }
  .filters > input, .filters #gender, .tag-filter { margin-bottom: 0; }
  .content-preference, .sort-section, .filter-actions, .filter-summary { grid-column: 1 / -1; }
  .intro { margin-bottom: 20px; }
}

@media (max-width: 550px) {
  .detail { grid-template-columns: 1fr; }
  .detail-card-column { padding: 24px 16px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .detail-content { padding: 24px 16px 32px; }
  .detail-art, .card-moderation-actions { width: min(100%, 320px); margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .workflow-preview-hint { animation: none; }
  *, *::before, *::after { transition: none !important; }
  .demo-instructions-enter, .demo-drag, .demo-picker-card-hint:not(:hover) { animation: none; }
  .demo-toolbar :is(.demo-library-button, .demo-variant-hint), .demo-copyright-pulse { animation: none; }
}

.gallery-pages { justify-content: center; gap: 6px; min-height: 40px; margin-top: 12px; }
.gallery-pages[hidden] { display: flex; visibility: hidden; }
.gallery-pages button { min-width: 42px; min-height: 40px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--accent); font-size: 16px; font-weight: 650; cursor: pointer; }
.gallery-pages button:hover:not(:disabled), .gallery-pages button[aria-current="page"] { background: var(--accent); color: #261739; }
.gallery-pages button:disabled { opacity: .45; cursor: default; }

/* Search panel and card facts */
.filters > input, .filters select { min-height: 42px; padding: 11px; font-size: 15px; }
.filters select { padding-right: 36px; }
.search-tag-field { min-height: 42px; }
.search-tag-field input, .filter-actions > button, .filter-summary, .filters .preference { font-size: 15px; }
.filter-actions > button { min-height: 41px; }
.detail-info dl > div {
  grid-template-columns: minmax(0, 45%) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 0;
  font-size: 16px;
}
.detail-info dt { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.detail-info dt svg { flex: none; }
.requires-lora svg { color: #ebc9eb; fill: currentColor; stroke-width: 1; filter: drop-shadow(0 0 2px currentColor); }
@media (prefers-reduced-motion: no-preference) {
  .requires-lora svg {
    animation: lora-star-color 15s linear .75s infinite,
               lora-star-glow 5s ease-in-out .75s infinite,
               lora-star-spin 20s ease-in-out .75s infinite;
  }
}
@keyframes lora-star-color {
  0%, 100% { color: #ebc9eb; }
  33.333% { color: #b278ff; }
  66.667% { color: #fff; }
}
@keyframes lora-star-glow {
  0%, 90%, 100% { filter: drop-shadow(0 0 2px currentColor); }
  36% { filter: drop-shadow(0 0 5px currentColor); }
}
@keyframes lora-star-spin {
  0% { transform: rotate(0turn); }
  5%, 100% { transform: rotate(1turn); }
}
.detail-info dd { overflow-wrap: anywhere; }
.card-vote-controls { gap: 5px; }
.card-vote-controls button, .card-vote-score { display: inline-grid; place-items: center; min-height: 26px; border: 1px solid #483b55; border-radius: 6px; }
.card-vote-controls button { width: 34px; padding: 0; font-size: 17px; font-weight: 750; }
.card-vote-score { min-width: 38px; padding-inline: 7px; background: #211b2a; font: inherit; font-weight: 700; white-space: nowrap; }
.card-vote-controls button[aria-pressed="true"] { border-color: var(--accent); }
.tag-panel .lora-links { flex-direction: column; }
.lora-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; overflow-wrap: anywhere; }
.lora-link svg { flex-shrink: 0; }
.lora-link:hover { text-decoration: underline; }
.lora-heading .preference-tooltip { inset-inline: auto 0; transform: none; }
.lora-heading .preference-info:focus + .preference-tooltip { visibility: visible; }

.card-discussion [hidden] { display: none; }
.card-comment header, .comment-reply, .comment-actions {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.card-comment header { justify-content: space-between; }
.card-discussion h2 { margin: 0; font-size: 17px; }
.comment-list { display: grid; gap: 10px; margin: 12px 0; }
.comment-thread { background: #1b1722; border: 1px solid #342c40; border-radius: 8px; }
.card-comment { padding: 12px; overflow-wrap: anywhere; }
.card-comment:target { outline: 1px solid var(--accent); }
.card-comment.linked-moderation-comment {
  background: #e477871a;
  outline: 2px solid #e47787;
  outline-offset: -2px;
  border-radius: 6px;
}
.card-comment.linked-reply-comment {
  background: #d9c5ff1a;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}
.moderation-report dd { margin: 0 0 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.moderation-report .report-card-link { color: var(--accent); text-decoration: underline; overflow-wrap: anywhere; }
.comment-author { color: var(--accent); }
.comment-meta { display: inline-flex; align-items: center; gap: 6px; }
.comment-report {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #e47787;
  cursor: pointer;
}
.comment-report:hover { background: #e4778726; }
.card-comment p { margin: 6px 0; white-space: pre-wrap; }
.comment-link {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  overflow-wrap: anywhere;
  text-align: start;
  text-decoration: underline;
  cursor: pointer;
}
.report-dialog.comment-link-dialog {
  width: min(560px, calc(100% - 32px));
  background: #252017;
  border-color: #665131;
  color: #fff;
}
.comment-link-dialog h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #f1c66c;
}
.comment-link-dialog h2 svg { flex: none; }
.comment-link-destination { margin: 10px 0 8px; color: #80b8ff; overflow-wrap: anywhere; }
#comment-link-warning { margin: 0; }
.comment-link-dialog .report-actions { align-items: center; flex-wrap: wrap; margin-top: 18px; }
.comment-link-dialog .report-actions form { margin: 0; }
.comment-link-dialog .report-close { background: #443725; color: #fff; }
.comment-link-dialog .report-close:hover { background: #56452d; }
.comment-link-dialog .comment-link-continue { background: #f1c66c; color: #271c0a; }
.comment-link-dialog .comment-link-continue:hover { background: #ffdb88; }
.card-comment time, .reply-reference, .comment-login-note, .comment-reply { font-size: 13px; color: var(--muted); }
a.reply-reference:hover, a.reply-reference:focus-visible { color: var(--accent); text-decoration: underline; }
.comment-replies { margin: 0 12px 12px; border-inline-start: 2px solid #483b55; }
.comment-replies .card-comment + .card-comment { border-top: 1px solid #342c40; }
.comment-actions button, .cancel-reply { background: transparent; border: 0; padding: 4px 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.card-discussion form { margin-top: 12px; }
.comment-thread .comment-composer { margin: 0 12px 12px; }
.card-discussion textarea {
  display: block;
  width: 100%;
  margin: 6px 0 8px;
  padding: 9px;
  resize: vertical;
  color: inherit;
  background: #131119;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}
.card-discussion [role="status"] { display: block; margin-top: 6px; }
.comment-validation { margin: 0 0 8px; color: #efa1b1; font-size: 13px; }
.comment-validation:empty { margin: 0; }

.admin-page { width: min(100% - 32px, 720px); margin-inline: auto; padding-block: clamp(48px, 7vw, 88px); }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.admin-page > p { margin-top: 16px; }
.admin-page a:not(.button) { color: var(--accent); text-underline-offset: .2em; }
.admin-page a:hover, #publish-status a { text-decoration: underline; }
.admin-publish { display: grid; gap: 24px; padding: clamp(20px, 5vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.admin-drop { padding: 32px 16px; text-align: center; border: 1px dashed #665a78; border-radius: 10px; background: #19151f; }
.admin-drop.dragging, .admin-drop:focus-within { border-color: var(--accent); background: #2b2338; }
.admin-drop label { display: block; font-weight: 700; }
.admin-drop p, .admin-publish-note { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.admin-drop input { display: block; max-width: 100%; margin: 12px auto 0; font-size: 14px; }
.admin-drop input::file-selector-button { padding: 8px 12px; margin-inline-end: 8px; border: 0; border-radius: 8px; background: #392d4d; color: var(--accent); font: inherit; cursor: pointer; }
.admin-preview { display: flex; flex-wrap: wrap; gap: 16px; align-items: start; margin: 0; }
.admin-preview[hidden], #publish-status:empty { display: none; }
.admin-preview img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.admin-preview figcaption { flex: 1 1 180px; min-width: 0; }
.admin-preview span { display: block; margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }
.admin-publish button:disabled { background: #322b40; color: var(--muted); cursor: default; }
#publish-status { padding: 10px 12px; border-radius: 8px; background: #2b2338; }
#publish-status[data-state="error"] { background: #432330; color: #ffbbc8; }
#publish-status[data-state="success"] { background: #21382e; color: #bcf0d2; }

.admin-home { text-align: center; }
.admin-menu { justify-content: center; gap: 16px; margin-top: 32px; }
.admin-menu .admin-menu-link {
  min-width: min(180px, 100%); padding: 16px 24px;
  color: var(--accent); background: #2b2338; border: 1px solid #514360;
}
.admin-menu .admin-menu-link:hover { background: #392d4d; text-decoration: none; }
.admin-publish-note { margin: 0; }
.admin-publish .admin-actions { padding-top: 20px; border-top: 1px solid var(--line); }
.admin-publish-submit #publish-status { margin-top: 12px; }
.publish-duration { display: block; margin-top: 4px; font-size: 14px; }
.admin-report-list { display: grid; gap: 12px; list-style: none; padding: 0; margin: 20px 0; }
.admin-report-panel {
  display: grid; gap: 10px; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere;
}
.admin-report-panel span, .admin-report-panel dt { font-size: 14px; color: var(--muted); }
.admin-report-panel dl { display: grid; gap: 6px; margin: 0 0 8px; }
.admin-report-panel dd { margin-bottom: 8px; white-space: pre-wrap; }
.admin-report-panel .report-card-link { text-decoration: underline; }
.admin-report-cleanup { margin-top: 24px; }
.admin-report-cleanup .button { background: #432330; color: #ffbbc8; }
.admin-report-cleanup .button:hover { background: #573042; }

.admin-replace label { display: block; margin: 16px 0 8px; font-weight: 600; }
.admin-replace input {
  width: min(100%, 380px); padding: 10px 12px; color: inherit;
  background: #131119; border: 1px solid #514360; border-radius: 8px;
}
#replace-status { margin-top: 10px; color: var(--muted); font-size: 14px; }
#replace-status:empty { display: none; }
#replace-results { list-style: none; padding: 0; margin: 10px 0 0; }
#replace-results li + li { margin-top: 6px; }
#replace-results .button { width: 100%; text-align: start; color: var(--accent); background: #2b2338; }
#replace-results .button:hover { background: #392d4d; }

.comment-staff-badge {
  position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin-inline: 4px;
  padding: 3px; border-radius: 5px; background: #392d4d; color: var(--accent); cursor: help;
}
.comment-staff-badge:hover { background: #514360; }
.comment-staff-info {
  position: absolute; inset-inline-start: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  z-index: 2; width: max-content; visibility: hidden; pointer-events: none;
  padding: 10px 14px; border: 1px solid #514360; border-radius: 8px;
  background: var(--surface); color: var(--accent); font-size: 14px;
}
.comment-staff-badge:is(:hover, :focus-visible) .comment-staff-info { visibility: visible; }

.about-credits { gap: 14px; line-height: 1.65; }
.about-credits > p { margin: 0; color: var(--muted); }
.about-credits button[data-site] { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

.series-name { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.diva-info { position: relative; display: inline-flex; }
.diva-panel {
  display: none;
  position: absolute;
  z-index: 5;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 15rem;
  padding: .6rem .8rem;
  border: 1px solid #92d4ee;
  border-radius: .45rem;
  background: linear-gradient(115deg, #284f76, #23647b);
  color: #fff;
  font-size: .85rem;
  line-height: 1.4;
}
.diva-panel a { color: #d1f4ff; text-decoration: underline; }
.diva-info:is(:hover, :focus-within) .diva-panel { display: block; }
@media (max-width: 900px) {
  .diva-panel { left: auto; right: 0; top: 100%; transform: none; width: min(13rem, 80vw); }
  .series-name { position: relative; }
  .diva-info { position: static; }
  .diva-panel { left: 0; right: auto; }
}
.diva-badge, .tag-link.diva-tag {
  color: #fff;
  font-weight: 700;
}
.tag-link.diva-tag {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(115deg, #225994, #16758f);
}
.tag-link.diva-tag:is(:hover, :active, :focus-visible) {
  background: linear-gradient(115deg, #2863a0, #197b96);
  color: #fff;
  filter: none;
}
.diva-badge {
  position: relative;
  overflow: hidden;
  display: inline-block;
  font-family: inherit;
  line-height: 1.2;
  padding: .15em .65em;
  border: 1px solid #79d9ff;
  border-radius: 1em;
  background: linear-gradient(115deg, #194b90, #126886);
  font-size: .85em;
  vertical-align: middle;
}
@media (prefers-reduced-motion: no-preference) {
  .diva-tag[data-diva-sparkle="1"] { --diva-star-position: calc(100% / 3); }
  .diva-tag[data-diva-sparkle="2"] { --diva-star-position: calc(200% / 3); }
  .diva-tag[data-diva-sparkle="3"] { --diva-star-position: 100%; }
  .diva-tag.diva-sparkling::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    /* Each interaction selects one of the four rows. */
    background: center var(--diva-star-position, 0%) / 100% 400% no-repeat url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2084%2088'%20preserveAspectRatio%3D'none'%20fill%3D'%23bdf2ff'%3E%3Cdefs%3E%3Cpath%20id%3D'star'%20d%3D'M0-4%201-1%204%200%201%201%200%204-1%201-4%200-1-1Z'%2F%3E%3C%2Fdefs%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(9%205)%20scale(0.85)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(73%2016)%20scale(1.3)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(59%204)%20scale(0.55)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(14%2039)%20scale(1.15)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(43%2027)%20scale(0.65)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(77%2028)%20scale(0.85)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(6%2056)%20scale(0.6)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(28%2060)%20scale(0.85)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(69%2050)%20scale(1.15)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(12%2074)%20scale(1.15)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(51%2083)%20scale(0.7)'%2F%3E%3Cuse%20href%3D'%23star'%20transform%3D'translate(80%2078)%20scale(0.75)'%2F%3E%3C%2Fsvg%3E");
    animation: diva-sparkle .65s ease-out both;
  }
  @keyframes diva-sparkle {
    0%, 100% { opacity: 0; }
    40% { opacity: .45; }
  }
  .diva-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 48%) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: diva-shine 10s ease-in-out 1s infinite;
  }
  @keyframes diva-shine {
    0% { transform: translateX(-100%); }
    7.5%, 100% { transform: translateX(100%); }
  }
}

.open-card-notes {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.report-dialog.card-notes-dialog {
  width: min(560px, calc(100% - 32px));
  background: #101013;
  border-color: #373340;
}
.card-notes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #373340;
}
.card-notes-header-actions { display: flex; flex: none; gap: 8px; }
.card-notes-header-actions .button { padding-inline: 10px; }
.card-notes-heading h2 { margin: 0; overflow-wrap: anywhere; }
.card-notes-heading .close-card-notes {
  flex: none;
  background: #30283d;
  color: #fff;
}
.card-notes-heading .close-card-notes:hover { background: #40354f; }
.card-notes-dialog [hidden] { display: none; }
.report-dialog.card-notes-dialog.is-loading {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.card-notes-dialog.is-loading > :not(.card-notes-loading) { display: none; }
.card-notes-loading {
  display: grid;
  min-height: 90px;
  place-items: center;
}
.card-notes-loading::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 2px solid #50435d;
  border-top-color: #d1b9f3;
  border-radius: 50%;
  animation: card-notes-spin .7s linear infinite;
}
@keyframes card-notes-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .card-notes-loading::before { animation: none; }
}
.card-notes-dialog section { margin-top: 16px; }
.card-notes-dialog h3 { margin: 0 0 8px; font-size: 1rem; }
.card-note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.card-note-body a {
  color: #dac7fb;
  text-decoration: underline #aa87dc;
  text-underline-offset: .2em;
}
.card-note-body a:hover, .card-note-body a:focus-visible { text-decoration-color: #e8d8ff; }
.card-note-log { display: grid; gap: 12px; margin: 0; padding-inline-start: 18px; list-style: disc; }
.card-notes-content:not([hidden]) + .card-log-content { border-top: 1px solid #373340; padding-top: 14px; }
.card-note-log li::marker { color: var(--muted); }
.card-note-log .log-date + * { margin-block-start: 6px; }
.card-note-log li { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-tag-added, .log-tag-removed { display: block; margin-inline-end: 8px; padding: 3px 9px; font: .88rem/1.5 ui-monospace, monospace; }
.log-tag-added { color: #a4e6b6; background: #183329; }
.log-tag-removed { color: #ffb5be; background: #39232d; }
.log-date { display: inline-block; position: relative; vertical-align: middle; max-width: calc(100% - 6px); margin-inline-start: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface); font-size: .8rem; }
.log-date::before { content: ""; position: absolute; left: -4px; top: calc(50% - 3px); width: 6px; height: 6px; transform: rotate(45deg); background: inherit; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card-notes-more { margin-top: 12px; }
.card-notes-editor { display: grid; gap: 8px; margin-top: 16px; }
.card-notes-editor textarea {
  width: 100%;
  min-height: 62px;
  padding: 9px;
  resize: vertical;
  border: 1px solid #494350;
  border-radius: 6px;
  color: inherit;
  background: #18171c;
  font: inherit;
}
.card-notes-editor button { justify-self: start; }
.card-notes-editor p, .card-notes-status { margin: 0; font-size: .85rem; }
.card-notes-status:not(:empty) { margin-top: 10px; }

.admin-hidden .intro { margin-bottom: 24px; }
.hidden-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 14px;
  padding: 0;
  list-style: none;
}
.hidden-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.hidden-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
  object-fit: contain;
  border-radius: 7px;
  background: #25232b;
}
.hidden-card span { display: block; font-size: .85rem; color: var(--muted); }
.hidden-card form button { width: 100%; }

.card-notes-compose { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: #17151d; }
.card-notes-compose:focus-within { border-color: #76638e; }
.card-notes-formatting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
}
.card-notes-formatting .button, .card-notes-formatting select {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  padding: 3px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-size: .85rem;
}
.card-notes-formatting select { background: var(--surface); }
.card-notes-formatting .button:hover:not(:disabled),
.card-notes-formatting .button[aria-pressed="true"] { background: #332a43; color: var(--accent); }
.card-notes-formatting .button:disabled { opacity: .4; }
.card-notes-input .tiptap {
  min-height: 120px;
  max-height: 45vh;
  overflow: auto;
  padding: 10px 12px;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.card-notes-link:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.card-notes-link input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #131119;
  color: inherit;
}
.card-notes-link .button { padding: 6px 9px; }
.card-notes-link [role="status"]:not(:empty) { flex-basis: 100%; }
.card-notes-link [role="status"]:empty { display: none; }
.card-notes-input .tiptap :is(p, h3, h4), .card-note-body.has-rich-notes :is(p, h3, h4) { margin: 0; }
.card-notes-input .tiptap p { font-size: inherit; }
.card-notes-input .tiptap h3, .card-note-body.has-rich-notes h3 { font-size: 1.2em; }
.card-notes-input .tiptap h4, .card-note-body.has-rich-notes h4 { font-size: 1.05em; }
.card-notes-input .tiptap a { color: var(--accent); text-decoration: underline; }
.card-notes-log-editor summary { width: fit-content; cursor: pointer; }
.card-notes-log-editor textarea { margin-top: 8px; }
