/* Creators (creator.pocketplay.win): review + ideas workspaces. Kit v2 tokens only, no inline styles (CSP).
   Classes are prefixed cr-. Geometry that depends on data (chart) arrives as custom properties set by creator.js. */

/* pp.css has no [hidden] rule, and .pp-status / .pp-btn set their own display: keep ai.js's hidden attribute working. */
.pp-main [hidden] { display: none !important; }

/* ───────── Head and mode tiles ───────── */
.cr-head { position: relative; padding-top: 56px; gap: 14px; }
.cr-head::before { content: ""; position: absolute; z-index: -1; right: -60px; top: -30px; width: 560px; height: 340px; pointer-events: none; filter: blur(6px);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 15%, transparent), transparent); }
.cr-head .pp-title { max-width: 20em; }
.cr-head .pp-checks { margin-top: 4px; }

.cr-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.cr-mode { padding: 12px 16px; }
.cr-mode { grid-template-columns: auto minmax(0, 1fr); }
.cr-mode[aria-current] { background: var(--accent-soft); border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); transform: none; }
.cr-mode[aria-current] > .pp-i { display: none; }

/* ───────── Work area: form + side card ───────── */
.cr-work { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; margin-top: 20px; }
.cr-main { display: grid; gap: 32px; min-width: 0; }
.cr-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.cr-side-stack { display: grid; gap: 18px; }
.cr-inputrow { display: flex; align-items: center; gap: 12px; }
.cr-inputrow .pp-input { min-width: 0; flex: 1; height: 52px; }
.cr-inputrow .pp-btn { flex: none; min-height: 52px; }
.cr-examples { align-items: center; }
.cr-examples > span { color: var(--ink-3); font-size: 12.5px; }
.cr-lookup .cr-buttons:has([hidden]) { display: none; }
.cr-account-card { display: grid; gap: 20px; padding: 24px; }
.cr-account-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cr-account-head > div { flex: 1; min-width: 0; }
.cr-account-head > div h2 { overflow-wrap: anywhere; }
.cr-account-link { color: var(--ink-3); font-size: 14px; }
.cr-metrics-box { display: grid; gap: 20px; min-width: 0; }
.cr-post-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.cr-post-link { display: grid; gap: 6px; padding: 16px 20px; color: var(--ink); overflow-wrap: anywhere; }
.cr-post-link + .cr-post-link { border-top: 1px solid var(--line); }
.cr-post-link:hover { background: var(--surface-2); }
.cr-post-link b { font-size: 14px; font-weight: 600; }
.cr-post-link small { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
[data-cr-advice] form { display: grid; gap: 18px; }
.cr-download-progress { width: 100%; height: 10px; accent-color: var(--accent); }
.cr-download-notes { padding: 0 8px; color: var(--ink-3); font-size: 13px; }
.cr-download-notes summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.cr-download-notes p { margin: 10px 0; line-height: 1.65; }
@media (max-width: 640px) {
  .cr-inputrow { align-items: stretch; flex-direction: column; }
  .cr-account-card { padding: 18px; }
  .cr-post-link { padding: 14px 16px; }
}

.cr-form { display: grid; gap: 24px; padding: 30px; }
#cr-ideas .pp-seg { justify-self: start; }
#cr-ideas .pp-seg label { min-height: 40px; }
.cr-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.cr-references { display: grid; gap: 12px; min-width: 0; }
.cr-references .cr-fieldhead { flex-wrap: wrap; }
.cr-references .cr-fieldhead .pp-label { margin: 0; white-space: normal; }
#cr-ideas > * { min-width: 0; }
.cr-reference-chips { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; width: 100%; height: 52px; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; padding: 2px 0 8px; }
.cr-reference-chip { position: relative; display: inline-flex; align-items: center; flex: none; max-width: 180px; height: 40px; padding: 6px 42px 6px 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2); }
.cr-reference-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px/1.25 var(--font-mono); }
.cr-reference-chip__platform { position: absolute; right: 8px; bottom: 4px; font: 500 9px/1 var(--font-mono); color: var(--ink-3); }
.cr-reference-chip__remove { position: absolute; right: 0; top: -1px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r-s); background: transparent; color: var(--ink-3); }
.cr-reference-chip__remove .pp-i { position: absolute; top: 5px; right: 7px; width: 12px; height: 12px; }
.cr-reference-chip__remove:hover { color: var(--err); }
.cr-reference-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.cr-reference-entry .pp-input { min-width: 0; width: 100%; }
.cr-reference-entry .pp-btn { min-width: 68px; min-height: 44px; }
#cr-ideas .pp-label small { display: inline; }
.cr-references [data-cr-reference-cancel] { justify-self: start; }
@media (max-width: 640px) {
  .cr-references .cr-fieldhead { align-items: flex-start; }
}
@media (max-width: 360px) {
  .cr-references .cr-fieldhead { flex-direction: column; align-items: stretch; }
  .cr-references .cr-fieldhead .pp-label { flex: none; }
  .cr-references [data-cr-reference-add] { align-self: flex-start; }
}
.cr-fieldhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cr-fieldhead .pp-label { flex: 1; justify-content: flex-start; gap: 10px; min-width: 0; white-space: nowrap; }
.cr-form .pp-label { justify-content: flex-start; gap: 10px; }
.cr-data { gap: 10px; }
.cr-guides .pp-post--feature .pp-post__cover { min-height: 200px; }
.cr-csv { min-height: 196px; font: 13.5px/1.65 var(--font-mono); letter-spacing: 0; white-space: pre; overflow: auto; tab-size: 4; }
.cr-note { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; border-radius: var(--r-s); background: var(--accent-soft); font-size: 13px; color: var(--ink-2); }
/* Task status line: keep the title on one line, let the detail wrap under it on narrow screens. */
.cr-form .pp-status { flex-wrap: wrap; row-gap: 2px; }
.cr-form .pp-status strong { white-space: nowrap; }
.cr-form .pp-status span { flex: 1 1 180px; min-width: 0; }
.cr-linkbtn { border: 0; padding: 0; background: none; color: var(--accent-text); font-size: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.cr-linkbtn:hover { text-decoration-color: currentColor; }

.cr-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.cr-privacy { display: flex; align-items: flex-start; gap: 8px; max-width: 58ch; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.cr-privacy .pp-i { width: 15px; height: 15px; margin-top: 2px; }
.cr-buttons { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cr-actions .cr-buttons .pp-btn[type="submit"] { min-width: 168px; height: 46px; }

.cr-card { display: grid; gap: 4px; padding: 22px; background: var(--surface-2); box-shadow: none; }
.cr-card__title { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 15px; }
.cr-card__note { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }
.cr-colist li { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.cr-colist li:first-child { border-top: 0; }
.cr-colist code { font: 600 12.5px var(--font-mono); color: var(--ink); }
.cr-parts { display: grid; gap: 14px; margin-top: 6px; }
.cr-parts li { display: flex; align-items: center; gap: 12px; }
.cr-parts b { display: block; font-size: 14px; font-weight: 600; }
.cr-parts small { display: block; font-size: 12.5px; color: var(--ink-3); }

/* ───────── Result ───────── */
.cr-result { display: grid; gap: 36px; min-width: 0; scroll-margin-top: calc(var(--header-h) + 16px); animation: pp-fade .35s var(--ease) both; }
.cr-sect { display: grid; gap: 14px; min-width: 0; }
.cr-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 18px; letter-spacing: -.02em; }
.cr-h .pp-badge { height: 22px; }
.pp-facts .cr-fact-sub { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }

/* Views-per-post chart: thin columns (<= 24px) from one baseline, hairline grid, one accent. */
.cr-chart { display: grid; gap: 18px; padding: 20px 22px 16px; }
.cr-chart__head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; }
.cr-chart__head > div { display: grid; gap: 2px; }
.cr-chart__head b { font-size: 15px; font-weight: 650; }
.cr-chart__head > div > span { font-size: 13px; color: var(--ink-3); }
.cr-key { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1.3 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.cr-key i { width: 16px; height: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 55%, transparent); }
.cr-chart__body { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.cr-yaxis, .cr-plot { position: relative; height: 220px; }
.cr-yaxis__in, .cr-grid, .cr-median, .cr-cols { position: absolute; left: 0; right: 0; top: 0; bottom: 28px; }
.cr-yaxis__in span { position: absolute; right: 0; bottom: var(--y); transform: translateY(50%); font: 500 11px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.cr-grid i { position: absolute; left: 0; right: 0; bottom: var(--y); height: 1px; background: var(--line); }
.cr-grid i:first-child { background: var(--line-3); }
.cr-median { z-index: 2; pointer-events: none; }
.cr-median i { position: absolute; left: 0; right: 0; bottom: var(--y); height: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 55%, transparent); }
.cr-cols { display: flex; }
.cr-col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; border-radius: 6px; }
.cr-col:hover, .cr-col:focus-visible { background: var(--hover); }
.cr-bar { position: relative; display: block; width: min(24px, 100%); height: var(--h, 0); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); transition: filter .15s; }
.cr-col:hover .cr-bar, .cr-col:focus-visible .cr-bar { filter: brightness(1.1); }
.cr-bar__v { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); font: 600 11px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.cr-x { position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%); font: 500 10.5px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.cr-tip { position: absolute; z-index: 6; left: min(max(var(--x, 0px), 84px), calc(100% - 84px)); top: var(--y, 0px); transform: translate(-50%, calc(-100% - 10px)); display: grid; gap: 2px; padding: 8px 11px; border-radius: var(--r-s); background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.35; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-3); }
.cr-tip b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cr-tip span { color: color-mix(in srgb, var(--bg) 72%, transparent); }
.cr-table summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; }
.cr-table summary::-webkit-details-marker { display: none; }
.cr-table summary::after { content: ""; width: 7px; height: 7px; margin: 0 0 3px 4px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); transition: transform .18s; }
.cr-table[open] summary::after { transform: rotate(-135deg); margin-bottom: -2px; }
.cr-table summary:hover { color: var(--ink); }
.cr-table .pp-tablewrap { margin-top: 12px; max-height: 320px; overflow: auto; box-shadow: none; }

/* AI text */
.cr-text { display: grid; gap: 22px; padding: 28px 32px; }
.cr-prose { max-width: 68ch; font-size: 16px; line-height: 1.75; }
:lang(zh) .cr-prose { font-size: 16px; line-height: 1.9; }
.cr-prose > * + * { margin-top: .85em; }
.cr-prose h3 { margin-top: 1.5em; font-size: 17px; }
.cr-prose--lead { color: var(--ink-2); font-size: 15px; }
.cr-tag { height: 22px; margin-right: 8px; vertical-align: 1px; }
.cr-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.cr-foot p { max-width: 44ch; font-size: 12.5px; color: var(--ink-3); }

/* Idea cards */
.cr-ideas { display: grid; gap: 14px; }
.cr-idea { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 16px; padding: 22px 26px 24px; }
.cr-idea__n { padding-top: 4px; font: 600 22px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--accent-text); }
.cr-idea h3 { font-size: 18px; line-height: 1.35; }
.cr-idea__desc { margin-top: 6px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.cr-idea__rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 16px 0 0; }
.cr-idea__rows > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); }
.cr-idea dt { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font: 500 11px/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.cr-idea dd { margin: 0; font-size: 14px; line-height: 1.55; }

/* ───────── Below the work area ───────── */
.cr-community .pp-chips { margin-top: 16px; }
.cr-community .pp-chip { background: var(--surface); }

/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
  .cr-work { grid-template-columns: minmax(0, 1fr); }
  .cr-aside { position: static; }
  .cr-head::before { right: -200px; }
}
@media (max-width: 760px) {
  .cr-row { grid-template-columns: minmax(0, 1fr); }
  .cr-platform .pp-seg { display: flex; }
  .cr-platform .pp-seg label { flex: 1; }
  .cr-ideas .cr-idea { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cr-head { padding-top: 32px; }
  .cr-modes { gap: 8px; margin-top: 22px; }
  .cr-mode { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 8px; padding: 14px 6px 12px; text-align: center; }
  .cr-mode small, .cr-mode > .pp-i { display: none; }
  .cr-form { gap: 20px; padding: 20px; }
  .cr-csv { min-height: 168px; font-size: 12.5px; }
  .cr-form .pp-label small { display: none; }
  .cr-actions { align-items: stretch; flex-direction: column; }
  .cr-buttons { margin-left: 0; }
  .cr-buttons .pp-btn { flex: 1; }
  .cr-chart { padding: 16px 14px 14px; }
  .cr-chart__body { grid-template-columns: 34px minmax(0, 1fr); gap: 6px; }
  .cr-yaxis, .cr-plot { height: 190px; }
  .cr-text { padding: 20px; }
  .cr-idea { padding: 18px 18px 20px; }
  .cr-foot .cr-buttons { width: 100%; }
}
