/* AVS AI Studio — community: what people chose to share.
   The home strip "Made by people on AVS", /community, the opened work (dialog on a computer, sheet on a phone, and /c/<id>),
   the Share dialog and the Library's share row. Everything uses avs.css tokens, so light and dark follow the site.
   Breakpoints as everywhere: phone < 760 · tablet 760–1099 · computer ≥ 1100. Taps are 44 px (a smaller look gets an invisible larger target). */

.cm-tap { position: relative; }
.cm-tap::after { content: ''; position: absolute; inset: -6px -3px; }  /* a 44 px target around a 32 px control */
.cm-leaf { display: inline-block; flex: none; width: .72em; height: .72em; margin-left: .3em; vertical-align: -.02em; color: #86B394; }
.cm-leaf svg { display: block; width: 100%; height: 100%; fill: currentColor; }
:root[data-theme="dark"] .cm-leaf { color: #93BFA0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cm-leaf { color: #93BFA0; } }
.cm-ico { width: 16px; height: 16px; flex: none; display: block; overflow: visible; }

/* ── the strip on the home page, and /community ──────────────────────────────────────────────────────────────────────── */
.cm-home { padding-top: 0; }
.cm-home[hidden] { display: none; }
.cm-head { margin-bottom: 14px; }
.cm-head .h2 { margin: 10px 0 0; }
.cm-head .cm-sub { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.cm-kinds { margin: 0; }
.cm-share .cm-sh-songs { margin-top: 8px; font-weight: 600; color: var(--ink); }
.cm-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cm-chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.cm-chips button { position: relative; height: 32px; padding: 0 14px; border-radius: 999px; font: 600 13px/1 var(--font); color: var(--ink2); background: var(--bg2); border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.cm-chips button::after { content: ''; position: absolute; inset: -6px -3px; }
.cm-chips button:hover { color: var(--ink); border-color: var(--line2); }
.cm-chips button[aria-selected="true"], .cm-chips button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.cm-selects { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-select { position: relative; display: inline-flex; align-items: center; }
.cm-select select { appearance: none; -webkit-appearance: none; height: 36px; max-width: 220px; padding: 0 34px 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); font: 600 13px/1 var(--font); cursor: pointer; text-overflow: ellipsis; }
.cm-select select:hover { border-color: var(--faint); }
.cm-select::after { content: ''; position: absolute; right: 15px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.cm-select .cm-k { position: absolute; left: 14px; font-size: 0; }

/* the cards: a strip is a plain grid of one shape (10 to a kind: 5 × 2, and 2 × 5 on a phone); /community is a masonry of each work's own shape */
.cm-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 12px; }
.cm-grid.cm-strip .cm-media { aspect-ratio: 4 / 5; }  /* a strip is one shape; /community keeps each work's own */
.cm-masonry { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); grid-auto-rows: 4px; column-gap: 12px; align-items: start; }
.cm-masonry > .cm-card { align-self: start; }
.cm-masonry.is-empty { display: block; }
@media (max-width: 1099px) { .cm-masonry { --cols: 4; } }
@media (max-width: 759px) { .cm-grid, .cm-masonry { --cols: 2; gap: 10px; } .cm-masonry { column-gap: 10px; } }
.cm-see { display: flex; justify-content: center; margin-top: 22px; }
.cm-see .btn { height: 44px; padding: 0 22px; }

.cm-card { position: relative; min-width: 0; border-radius: var(--radius); background: var(--card-solid); border: 1px solid var(--line); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .2s; animation: cm-rise .45s var(--ease) both; }
@keyframes cm-rise { from { opacity: 0; transform: translateY(8px); } }
@media (hover: hover) and (pointer: fine) { .cm-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line2); } }
.cm-card[hidden] { display: none; }
.cm-media { position: relative; aspect-ratio: var(--ar, 4 / 5); background: var(--tint, var(--bg2)); overflow: hidden; isolation: isolate; }
.cm-poster, .cm-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-poster { background: var(--tint, var(--bg2)); }
.cm-poster.is-broken { visibility: hidden; }
.cm-vid { opacity: 0; transition: opacity .25s; background: transparent; }
.cm-card.is-playing .cm-vid { opacity: 1; }
.cm-vid.cm-first { opacity: 1; }  /* the studio's own works have no poster: the clip's own first frame is on show */
.cm-hit { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border-radius: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cm-hit:focus-visible { outline-offset: -4px; border-radius: var(--radius); }
.cm-card[data-kind="image"] .cm-hit { cursor: zoom-in; }
.cm-star { position: absolute; right: 8px; top: 8px; z-index: 3; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 253, 249, .9); box-shadow: 1.5px 1.5px 0 var(--butter); pointer-events: none; }
.cm-star svg { width: 14px; height: 14px; fill: var(--butter); stroke: #2B2730; stroke-width: 1.7; stroke-linejoin: round; }
.cm-chip { position: absolute; left: 8px; top: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; font: 500 10.5px/1 var(--mono); letter-spacing: .02em; color: #2B2730; background: rgba(255, 253, 249, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.cm-play { position: absolute; inset: 0; z-index: 3; margin: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 253, 249, .9); color: #2B2730;
  box-shadow: 1.5px 1.5px 0 var(--lav), 0 8px 18px -10px rgba(43, 39, 48, .55); pointer-events: none; transition: opacity .2s, transform .25s var(--spring); }
.cm-play svg { width: 18px; height: 18px; }
.cm-play .i-pause { display: none; }
.cm-card.is-playing .cm-play .i-play, .cm-vstage.is-playing .cm-play .i-play { display: none; }
.cm-card.is-playing .cm-play .i-pause, .cm-vstage.is-playing .cm-play .i-pause { display: block; }
.cm-card.is-playing[data-kind="video"] .cm-play, .cm-card.is-playing[data-kind="music"] .cm-play { opacity: 0; transform: scale(.85); }
.cm-card.is-loading .cm-play { opacity: .7; }
.cm-card[data-kind="image"] .cm-play { display: none; }
.cm-card[data-kind="voice"] .cm-play { inset: auto 10px 10px auto; margin: 0; width: 36px; height: 36px; }

/* a voice: a quiet waveform and the first line of its words, in place of a picture */
.cm-card[data-kind="voice"] .cm-media { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 34px 14px 16px; background: var(--tint, var(--bg2)); }
.cm-wave { position: relative; height: 54px; flex: none; }
.cm-wave svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cm-wave .w-base { color: rgba(43, 39, 48, .24); }
.cm-wave .w-fill { color: #2B2730; clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
:root[data-theme="dark"] .cm-wave .w-base { color: rgba(242, 238, 246, .24); }
:root[data-theme="dark"] .cm-wave .w-fill { color: #F2EEF6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cm-wave .w-base { color: rgba(242, 238, 246, .24); } :root:not([data-theme="light"]) .cm-wave .w-fill { color: #F2EEF6; } }
.cm-line { margin: 0; padding-right: 40px; font-size: 12.5px; line-height: 1.4; color: #2B2730; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
:root[data-theme="dark"] .cm-card[data-kind="voice"] .cm-line { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cm-card[data-kind="voice"] .cm-line { color: var(--ink); } }
.cm-card[data-kind="voice"] .cm-media { color: #2B2730; }

/* a computer: pointing at a work shows its first words and the way to make one like it */
.cm-over { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: none; flex-direction: column; gap: 8px; padding: 40px 10px 10px; color: #fff; background: linear-gradient(transparent, rgba(20, 18, 23, .8));
  opacity: 0; transition: opacity .2s; pointer-events: none; }
.cm-over p { margin: 0; font-size: 12px; line-height: 1.4; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cm-make { pointer-events: auto; width: 100%; height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(255, 253, 249, .97); color: #2B2730; font: 600 13px/1 var(--font); white-space: nowrap; transition: transform .2s var(--ease), box-shadow .2s; }
.cm-make:hover { transform: translateY(-1px); box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.cm-hidden-note { display: block; width: 100%; padding: 9px 12px; border-radius: 999px; text-align: center; font: 600 12.5px/1 var(--font); color: rgba(255, 255, 255, .92); background: rgba(255, 255, 255, .16); }
@media (hover: hover) and (pointer: fine) {
  .cm-over { display: flex; }
  .cm-card:hover .cm-over, .cm-card:focus-within .cm-over { opacity: 1; }
  .cm-card[data-kind="voice"] .cm-play { bottom: 10px; }
  .cm-card[data-kind="voice"]:hover .cm-play { opacity: 0; }
  .cm-card[data-kind="voice"].is-playing:hover .cm-play { opacity: 1; }
}
.cm-foot { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 6px; height: 56px; padding: 4px 4px 4px 10px; }
.cm-who, .cm-stats { display: contents; }
.cm-by { grid-column: 1; grid-row: 1; min-width: 0; display: block; text-align: left; font: 600 13px/1.25 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-by::after { content: ''; position: absolute; inset: 0; }  /* the whole footer opens the work (the model name and the heart sit above it) */
.cm-model { grid-column: 1; grid-row: 2; position: relative; z-index: 1; justify-self: start; max-width: 100%; display: inline-flex; align-items: center; font-size: 12px; line-height: 1.25; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-model > span { overflow: hidden; text-overflow: ellipsis; }
.cm-model:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (hover: none), (pointer: coarse) { .cm-model { pointer-events: none; } }  /* on a touch screen the whole line opens the work; the model filter is in the opened work and on /community */
.cm-like { grid-column: 2; grid-row: 1; justify-self: end; position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 6px; border-radius: 999px; color: var(--ink2); font: 600 12px/1 var(--mono); transition: color .2s, background .2s; }
.cm-like::after { content: ''; position: absolute; inset: -10px -4px; }
.cm-like svg { width: 15px; height: 15px; }
.cm-like svg path { fill: transparent; transition: fill .2s; }
.cm-like:hover { color: var(--ink); background: var(--bg2); }
.cm-like[aria-pressed="true"] { color: var(--ink); }
.cm-like[aria-pressed="true"] svg path { fill: var(--rose); }
.cm-like[aria-pressed="true"] svg { animation: cm-pop .45s var(--spring); }
.cm-like[aria-disabled="true"] { cursor: default; color: var(--muted); }
.cm-like[aria-disabled="true"]:hover { background: none; color: var(--muted); }
@keyframes cm-pop { 40% { transform: scale(1.3); } }
.cm-remix { grid-column: 2; grid-row: 2; justify-self: end; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 6px; color: var(--muted); font: 500 12px/1 var(--mono); pointer-events: none; }
.cm-remix svg { width: 14px; height: 14px; }

/* the quiet states */
.cm-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 6px; padding: 38px 16px; text-align: center; color: var(--muted); }
.cm-empty .cm-m { width: 74px; }
.cm-empty b { font: 600 16px/1.3 var(--display); color: var(--ink); }
.cm-empty p { margin: 0; font-size: 13.5px; }
.cm-empty .btn { margin-top: 8px; height: 40px; }

/* ── the opened work: a dialog on a computer, a sheet from the bottom on a phone ─────────────────────────────────────── */
body.cm-lock { overflow: hidden; }
.cm-ov { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(20, 18, 23, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: cm-fade .2s; }
@keyframes cm-fade { from { opacity: 0; } }
.cm-ov.is-leaving { opacity: 0; transition: opacity .18s; }
.cm-dialog { position: relative; display: flex; width: min(980px, 100%); height: auto; max-height: min(780px, calc(var(--app-h, 100vh) - 40px)); border-radius: var(--radius-xl); background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; animation: cm-in .28s var(--ease); }
@keyframes cm-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.cm-dialog:focus, .cm-dialog:focus-visible { outline: none; }  /* the box itself takes focus so a screen reader reads its name; the controls inside show their own ring */
.cm-ov.is-narrow .cm-dialog { width: min(460px, 100%); height: auto; max-height: 100%; }
.cm-x { position: absolute; top: 10px; right: 10px; z-index: 6; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); background: color-mix(in srgb, var(--card-solid) 82%, transparent); backdrop-filter: blur(6px); transition: background .2s, color .2s; }
.cm-x::after { content: ''; position: absolute; inset: -4px; }
.cm-x:hover { background: var(--bg2); color: var(--ink); }
.cm-x svg { width: 18px; height: 18px; }
.cm-stage { position: relative; flex: 1 1 58%; min-width: 0; min-height: 380px; display: grid; place-items: center; background: var(--tint, var(--bg2)); }
.cm-stage > img, .cm-stage > video { display: block; max-width: 100%; max-height: min(780px, calc(var(--app-h, 100vh) - 42px)); width: auto; height: auto; object-fit: contain; }
.cm-stage > video { background: #000; }
.cm-stage.is-wide > img, .cm-stage.is-wide > video { width: 100%; }
.cm-info { flex: 0 0 min(370px, 42%); min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
.cm-who2 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-right: 40px; }
.cm-who2 b { font: 600 15.5px/1.25 var(--display); letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-when { flex: none; font-size: 12px; color: var(--muted); }
.cm-set { margin: -8px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.cm-set b { font-weight: 600; color: var(--ink2); }
.cm-set a { color: var(--ink2); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.cm-set a:hover { color: var(--ink); text-decoration-color: currentColor; }
.cm-status { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--tint-butter); color: var(--ink); font-size: 12.5px; font-weight: 600; }
.cm-prompt { position: relative; max-height: 220px; overflow-y: auto; padding: 12px 14px 12px; border-radius: var(--radius); background: var(--tint-peach); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.cm-promptwrap { position: relative; }
.cm-copy { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; margin-top: 6px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink2); background: var(--bg2); transition: background .2s, color .2s; position: relative; }
.cm-copy::after { content: ''; position: absolute; inset: -7px -3px; }
.cm-copy:hover { color: var(--ink); background: var(--card-hover); }
.cm-copy svg { width: 14px; height: 14px; }
.cm-cta { display: grid; gap: 6px; }
.cm-cta:empty { display: none; }
.cm-cta .btn { height: 46px; width: 100%; font-size: 14.5px; }
.cm-cta .cm-fine { margin: 0; text-align: center; font-size: 12px; line-height: 1.45; color: var(--muted); }
.cm-cta .cm-hid { display: block; width: 100%; padding: 14px; border-radius: 999px; text-align: center; font: 600 14px/1 var(--font); color: var(--muted); background: var(--bg2); }
.cm-signup { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--tint-lav); border: 1px solid var(--line); }
.cm-signup p { margin: 0; font-size: 13.5px; color: var(--ink); }
.cm-signup .row2 { display: flex; gap: 8px; }
.cm-signup .btn { flex: 1; height: 44px; }
.cm-counts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-counts .cm-like { height: 36px; padding: 0 12px 0 9px; background: var(--bg2); font-size: 13px; }
.cm-counts .cm-like::after { inset: -4px -3px; }
.cm-counts .cm-like svg { width: 18px; height: 18px; }
.cm-counts .cm-remix { height: 36px; font-size: 13px; pointer-events: auto; }
.cm-counts .cm-remix svg { width: 16px; height: 16px; }
.cm-links { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: auto; padding-top: 4px; }
.cm-links button, .cm-links a { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink2); transition: background .2s, color .2s; }
.cm-links button::after, .cm-links a::after { content: ''; position: absolute; inset: -5px -2px; }
.cm-links button:hover, .cm-links a:hover { color: var(--ink); background: var(--bg2); }
.cm-links svg { width: 15px; height: 15px; }
.cm-report { display: grid; gap: 4px; padding: 12px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--line); }
.cm-report > b { font: 600 13px/1.3 var(--display); margin-bottom: 2px; }
.cm-report label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 8px; border-radius: 10px; font-size: 13.5px; cursor: pointer; }
.cm-report label:hover { background: var(--card-hover); }
.cm-report input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.cm-report textarea { width: 100%; min-height: 64px; resize: vertical; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card-solid); font-size: 16px; line-height: 1.4; outline: none; }
.cm-report textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cm-report .row2 { display: flex; gap: 8px; margin-top: 4px; }
.cm-report .btn { flex: 1; height: 42px; }
.cm-thanks { margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--tint-mint); font-size: 13.5px; color: var(--ink); }
.cm-unavail { display: grid; justify-items: center; gap: 8px; padding: 46px 20px; text-align: center; grid-column: 1 / -1; width: 100%; }
.cm-unavail b { font: 600 17px/1.3 var(--display); }
.cm-unavail p { margin: 0; color: var(--muted); font-size: 14px; }

/* a voice, opened: its waveform made big, with one play button and the time */
.cm-vstage { position: relative; width: 100%; max-width: 520px; display: grid; gap: 22px; padding: 28px 28px 30px; justify-items: center; align-self: center; }
.cm-vstage .cm-wave { width: 100%; height: 96px; }
.cm-vstage .cm-play { position: relative; inset: auto; margin: 0; width: 64px; height: 64px; pointer-events: auto; cursor: pointer; opacity: 1; }
.cm-vstage .cm-play svg { width: 26px; height: 26px; }
.cm-vstage .cm-time { font: 500 12.5px/1 var(--mono); color: #2B2730; opacity: .75; }
.cm-vstage .cm-wave .w-base { color: rgba(43, 39, 48, .24); }
.cm-vstage .cm-wave .w-fill { color: #2B2730; }
.cm-stage .cm-vline { margin: 0; font-size: 14px; line-height: 1.5; text-align: center; color: #2B2730; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
:root[data-theme="dark"] .cm-stage .cm-vstage .cm-time, :root[data-theme="dark"] .cm-stage .cm-vline { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cm-stage .cm-vstage .cm-time, :root:not([data-theme="light"]) .cm-stage .cm-vline { color: var(--ink); } }

/* a narrow screen: the same dialog, its parts stacked (the picture, then the words), scrolling as one */
@media (max-width: 759px) {
  .cm-ov { padding: 12px; }
  .cm-dialog { flex-direction: column; width: 100%; height: auto; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
  .cm-ov.is-narrow .cm-dialog { width: 100%; }
  .cm-stage { flex: none; min-height: 0; }
  .cm-stage > img, .cm-stage > video { max-height: 52vh; max-height: 52dvh; }
  .cm-info { flex: none; overflow: visible; padding: 16px 16px 18px; }
  .cm-who2 { padding-right: 0; }
  .cm-x { top: 10px; right: 10px; }
  .cm-vstage { padding: 36px 20px 22px; }
}

/* ── /c/<id> ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
.cm-page { padding: clamp(24px, 4vw, 44px) 0 clamp(40px, 6vw, 72px); }
.cm-page .cm-title { margin-bottom: 18px; }
.cm-page .cm-title .h2 { margin: 0; }
.cm-page .cm-title p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.cm-itempage { display: flex; width: 100%; border-radius: var(--radius-xl); background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.cm-itempage .cm-stage { min-height: 320px; }
.cm-itempage .cm-stage > img, .cm-itempage .cm-stage > video { max-height: 78vh; }
.cm-itempage .cm-info { flex-basis: 380px; }
.cm-itempage .cm-who2 { padding-right: 0; }
.cm-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; color: var(--ink2); }
.cm-back:hover { color: var(--ink); }
.cm-back svg { width: 15px; height: 15px; transform: rotate(180deg); }
@media (max-width: 859px) {
  .cm-itempage { flex-direction: column; border-radius: var(--radius-l); }
  .cm-itempage .cm-stage { flex: 0 0 auto; }
  .cm-itempage .cm-stage > img, .cm-itempage .cm-stage > video { max-height: 70dvh; }
}

/* ── the little "Login to like" ──────────────────────────────────────────────────────────────────────────────────── */
.cm-pop { position: fixed; z-index: 120; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--btn); color: var(--btn-ink); font: 600 13px/1 var(--font); white-space: nowrap; box-shadow: var(--shadow); animation: cm-pop-in .22s var(--ease); }
.cm-pop::after { content: ''; position: absolute; inset: -4px; }
.cm-pop::before { content: ''; position: absolute; left: var(--ax, 50%); bottom: -4px; width: 10px; height: 10px; margin-left: -5px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.cm-pop.is-below::before { bottom: auto; top: -4px; }
@keyframes cm-pop-in { from { opacity: 0; transform: translateY(5px) scale(.96); } }

/* ── Share to community ──────────────────────────────────────────────────────────────────────────────────────────── */
.cm-share { display: flex; flex-direction: column; gap: 14px; width: 100%; padding: 24px 22px 20px; overflow-y: auto; overscroll-behavior: contain; }
.cm-share h3 { margin: 0; padding-right: 36px; font: 600 19px/1.25 var(--display); letter-spacing: -.01em; }
.cm-share .cm-sh-top { display: flex; gap: 14px; align-items: flex-start; }
.cm-share .cm-sh-prev { position: relative; flex: none; width: 96px; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink2); }
.cm-share .cm-sh-prev img, .cm-share .cm-sh-prev video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cm-share .cm-sh-prev svg { width: 30px; height: 30px; }
.cm-share .cm-sh-say { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink2); }
.cm-share label.cm-fl { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.cm-share input[type="text"] { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
.cm-share input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cm-share .cm-err { margin: -6px 0 0; min-height: 0; font-size: 12.5px; color: #b0493d; }
.cm-share .cm-err:empty { display: none; }
.cm-switch { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0; text-align: left; font-size: 13.5px; line-height: 1.4; color: var(--ink); width: 100%; }
.cm-switch .cm-sw { position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line2); transition: background .2s; }
.cm-switch .cm-sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s var(--spring); }
.cm-switch[aria-checked="true"] .cm-sw { background: var(--accent); }
.cm-switch[aria-checked="true"] .cm-sw::after { transform: translateX(18px); }
.cm-adult { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font-size: 13px; line-height: 1.45; color: var(--ink2); cursor: pointer; }
.cm-adult input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.cm-sh-act { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.cm-sh-act .btn { height: 44px; padding: 0 22px; }
.cm-sh-done { display: grid; justify-items: center; gap: 10px; padding: 16px 4px 4px; text-align: center; }
.cm-sh-done svg { width: 38px; height: 38px; color: var(--accent); }
.cm-sh-done p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink); max-width: 340px; }
.cm-sh-done .btn { height: 44px; padding: 0 28px; margin-top: 4px; }
@media (max-width: 759px) { .cm-share { padding: 26px 16px calc(18px + env(safe-area-inset-bottom)); } .cm-sh-act .btn { flex: 1; } }

/* ── the Library: one more icon among the card's icons, the "Shared" filter, and the Shared view ────────────────────────── */
.card.real .foot .cm-lib-btn { position: relative; }
.card.real .foot .cm-lib-btn::after { content: ''; position: absolute; inset: -7px -2px; }
.card.real .foot .cm-lib-btn.is-on circle { fill: var(--mint); }
.card.real .foot .cm-lib-btn.is-off { opacity: .45; }
.card.real .foot .cm-lib-btn svg { overflow: visible; }
.card.real.cm-has { --cm-lib-h: 0px; }
@media (min-width: 760px) and (hover: hover) and (pointer: fine) {
  .card.real.cm-has .foot { bottom: var(--cm-lib-h, 0px); }  /* the hover icons stay over the picture, above the state line */
  .canvas[data-size="l"] .card.real.cm-has .foot { bottom: auto; }
}
@media (max-width: 759px) { .card.real.cm-has > .cm-lib { display: none; } }  /* a phone's Library keeps its layout: only the icon and the Shared chip are added */
.cm-lib.is-quiet { padding-bottom: 6px; }
.cm-lib .cm-why { flex-basis: 100%; font-size: 11px; }
.cm-st { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; min-width: 0; }
.cm-st b { font-weight: 600; color: var(--ink2); }
.cm-st a { color: var(--ink2); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.cm-n { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); }
.cm-n svg { width: 12px; height: 12px; }
.cm-lib { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; padding: 7px 8px 8px 10px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.cm-lib .cm-st { flex: 1 1 auto; }
.cm-lib button { position: relative; flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid var(--line2); transition: background .2s, border-color .2s, color .2s; }
.cm-lib button::after { content: ''; position: absolute; inset: -8px -4px; }
.cm-lib button:hover { color: var(--ink); background: var(--card-solid); border-color: var(--faint); }
.cm-lib button.arm { background: var(--tint-rose); color: var(--ink); border-color: var(--rose); }
.cm-mine { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--thumb, 200px), 1fr)); gap: var(--gap, 12px); }
@media (max-width: 759px) { .cm-mine { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-mine .cm-card .cm-media { aspect-ratio: 4 / 5; }
.cm-mine .cm-card .cm-foot { height: auto; display: block; padding: 0; }
.cm-mine .cm-over { display: none !important; }
.cm-ph { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--ink) 38%, transparent); }
.cm-ph svg { width: 34px; height: 34px; }
.cm-status-box { display: grid; gap: 4px; font-size: 13.5px; color: var(--ink2); }
.cm-status-box .cm-st { font-size: 14px; }
.cm-sh-act .cm-rm.arm { background: var(--tint-rose); border-color: var(--rose); }

/* ── the header link, and the quiet fine print ───────────────────────────────────────────────────────────────────── */
.cm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .cm-card, .cm-ov, .cm-dialog, .cm-pop, .cm-like[aria-pressed="true"] svg { animation: none !important; }
  .cm-card, .cm-play, .cm-vid, .cm-over, .cm-make, .cm-chips button, .cm-switch .cm-sw::after { transition: none !important; }
  .cm-card:hover { transform: none !important; }
}
