/* PICKBITS 拾点 · softside：奶油底、粉紫波浪、深夜色卡片、紫色胶囊按钮、圆滚滚的小角色。 */
:root {
  --cream: #fbf5ee;
  --paper: #fffdf9;
  --ink: #1e1a2e;
  --ink-2: #4a4560;
  --muted: #8a8499;
  --line: #eee4ea;
  --line-strong: #e0d3e3;
  --purple: #7b55d9;
  --purple-deep: #5f3dc4;
  --lilac: #cdb4f5;
  --lilac-soft: #efe6ff;
  --pink: #e7a3dd;
  --pink-soft: #f8dcf1;
  --mint: #c9f07f;
  --peach: #f6a35f;
  --night: #1f1b2e;
  --danger: #d6455d;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(31 27 46 / 5%), 0 10px 30px -12px rgb(123 85 217 / 22%);
  --shadow-lift: 0 2px 4px rgb(31 27 46 / 6%), 0 22px 44px -18px rgb(123 85 217 / 38%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font: 15px/1.6 var(--font); color: var(--ink);
  background: radial-gradient(1200px 520px at 85% -120px, #efd9f5 0%, transparent 70%), linear-gradient(180deg, #f7e6f1 0, var(--cream) 520px);
  background-color: var(--cream);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 850; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.mascot { flex: none; overflow: visible; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px max(20px, env(safe-area-inset-left)); backdrop-filter: blur(16px) saturate(1.4);
  background: rgb(251 245 238 / 72%); border-bottom: 1px solid rgb(224 211 227 / 60%);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: 6px; }
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand b { font-weight: 900; font-style: italic; letter-spacing: 0.02em; font-size: 18px; }
.brand small { font-size: 11px; color: var(--muted); letter-spacing: 0.3em; margin-top: 3px; }
.topnav { display: flex; gap: 4px; padding: 4px; background: rgb(255 255 255 / 70%); border: 1px solid var(--line); border-radius: 999px; }
.topnav a { text-decoration: none; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: background .2s, color .2s; }
.topnav a:hover { color: var(--ink); }
.topnav a.on { background: var(--night); color: #fff; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 420px; margin-left: auto; padding: 0 14px; height: 42px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--lilac); box-shadow: 0 0 0 4px var(--lilac-soft); }
.search .icon { color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; background: none; min-width: 0; height: 100%; }
.account { position: relative; display: flex; }
.me-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.me-btn .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lilac); }
.menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lift); display: grid; }
.menu[hidden] { display: none; }
.menu p { margin: 4px 10px 8px; display: grid; }
.menu p small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 12px; text-decoration: none; text-align: left; cursor: pointer; font-size: 14px; }
.menu a:hover, .menu button:hover { background: var(--lilac-soft); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; object-fit: cover; flex: none; background: var(--lilac); }

/* ---------- buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .15s, background .2s, box-shadow .2s, border-color .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 8px 18px -8px rgb(95 61 196 / 70%); }
.btn-primary:hover { background: var(--purple-deep); }
.btn-primary.is-on { background: var(--pink-soft); color: var(--purple-deep); box-shadow: none; border-color: var(--pink); }
.btn-primary.is-on .icon { fill: #e46fb6; stroke: #e46fb6; }
.btn-dark { background: var(--night); color: #fff; }
.btn-dark:hover { background: #342d4b; }
.btn-ghost { background: rgb(255 255 255 / 75%); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: #fff; border-color: var(--lilac); }
.btn-danger { color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 15px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.add-btn { flex: none; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: rgb(255 255 255 / 80%); cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--lilac); background: #fff; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 8px 0; }
.link-btn:hover { color: var(--danger); }
.link-btn .icon { width: 16px; height: 16px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; background: var(--mint); color: #2b3a12; font-size: 13px; font-weight: 600; text-decoration: none; }
a.chip:hover { background: #b9e866; }
.chip-sm { padding: 2px 9px; font-size: 12px; background: var(--lilac-soft); color: var(--purple-deep); }
.chip-x { background: var(--night); color: #fff; }
.chip-x .icon { width: 14px; height: 14px; }
.chip button { display: grid; place-items: center; border: 0; background: none; padding: 0; cursor: pointer; color: inherit; }
.chip button .icon { width: 14px; height: 14px; }
.badge { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgb(255 255 255 / 92%); color: var(--ink); box-shadow: 0 1px 3px rgb(31 27 46 / 10%); }
.badge .icon { width: 14px; height: 14px; }
.badge-lock { padding-left: 8px; background: var(--night); color: #fff; }
.badge-market { padding-left: 8px; background: #eee5ff; color: #5f3dc4; }
.badge-bad { padding-left: 10px; background: var(--danger); color: #fff; }

/* ---------- hero (pink wave panel) ---------- */
#main { outline: none; padding-bottom: 60px; }
.hero { position: relative; margin: 20px auto 0; max-width: 1320px; width: calc(100% - 40px); padding: 32px 40px; min-height: 280px; border-radius: 32px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: 24px;
  background: radial-gradient(500px 300px at 15% 0%, #f6c6ea 0%, transparent 70%), linear-gradient(135deg, #e7a3dd 0%, #cfa6ef 55%, #b9a2f2 100%); color: #fff; }
.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 800; letter-spacing: .16em; opacity: .85; }
.hero h1 { font-size: clamp(32px, 4vw, 48px); font-weight: 850; line-height: 1.02; letter-spacing: -0.03em; text-shadow: 0 2px 0 rgb(95 61 196 / 15%); }
.hero-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-primary { box-shadow: 0 10px 24px -8px rgb(70 40 160 / 70%); }
.hero-copy { min-width: 0; }
.hero-art { position: relative; height: 200px; }
.guest-login { margin-top: 24px; }
.hero-art .float { position: absolute; filter: drop-shadow(0 8px 12px rgb(80 40 140 / 12%)); }
.hero-art .f0 { left: 5%; top: 3%; animation: bob 5s ease-in-out infinite; }
.hero-art .f1 { left: 38%; top: 0%; animation: bob 4.2s ease-in-out .6s infinite; }
.hero-art .f2 { left: 71%; top: 3%; animation: bob 4.8s ease-in-out 1.1s infinite; }
.hero-art .f3 { left: 7%; top: 58%; animation: bob 5.4s ease-in-out .3s infinite; }
.hero-art .f4 { left: 40%; top: 57%; animation: bob 4.5s ease-in-out .9s infinite; }
.hero-art .f5 { left: 73%; top: 58%; animation: bob 5.1s ease-in-out .4s infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
.hero-me { background: linear-gradient(135deg, #c9b2f4 0%, #b49cf0 50%, #a58ff0 100%); }
.me-id { min-width: 0; display: flex; align-items: center; gap: 18px; }
.me-id > div { min-width: 0; }
.me-id h1 { overflow-wrap: anywhere; }
.me-id .avatar { box-shadow: 0 0 0 4px rgb(255 255 255 / 60%); }
.handle { margin: 6px 0 0; opacity: .9; font-weight: 600; }
.me-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 0; }
.me-actions .btn-ghost { background: rgb(255 255 255 / 22%); color: #fff; border-color: rgb(255 255 255 / 45%); }
.me-actions .btn-ghost:hover { background: rgb(255 255 255 / 35%); }

/* ---------- filters & grid ---------- */
.list-wrap { max-width: 1320px; width: calc(100% - 40px); margin: 0 auto; }
.filters { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 14px; flex-wrap: wrap; }
.type-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; margin: -4px -2px; }
.type-tabs::-webkit-scrollbar { display: none; }
.type-tab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; transition: transform .15s, border-color .2s, background .2s; }
.type-tab:hover { border-color: var(--lilac); transform: translateY(-1px); }
.type-tab b { font-size: 12px; color: var(--muted); font-weight: 700; }
.type-tab.on { background: var(--night); border-color: var(--night); color: #fff; }
.type-tab.on b { color: var(--lilac); }
.all-dot { width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(#8f6be8 0 20%, #f6a35f 0 40%, #9fdc5c 0 60%, #f29ac4 0 80%, #8fb8f2 0); }
.sort { display: flex; padding: 4px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; }
.sort a { padding: 5px 14px; border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--muted); }
.sort a.on { background: var(--lilac-soft); color: var(--purple-deep); }
.source-filters { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; }
.source-filters:empty { display: none; }
.filter-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.source-options { display: flex; flex-wrap: wrap; gap: 6px; }
.source-option { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.source-option .icon { width: 14px; height: 14px; }
.source-option span { font-size: 12px; opacity: .75; }
.source-option:hover, .source-option.on { background: var(--lilac-soft); color: var(--purple-deep); }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.active-filters:empty { display: none; }
.grid { columns: 4 260px; column-gap: 18px; }
.grid.is-empty, .grid:has(> .loading) { columns: auto; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px 0; color: var(--muted); font-weight: 600; }
.loading .mascot { animation: bob 1.4s ease-in-out infinite; }
.more { display: flex; justify-content: center; margin-top: 18px; }

.empty-mascots { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 20px; }
.empty-mascots .mascot { margin: 0; }
.empty-mascots-all { max-width: 100%; }
.empty-mascots-all .mascot { min-width: 0; flex: 0 1 56px; height: auto; }
/* ---------- cards ---------- */
.card { position: relative; break-inside: avoid; margin: 0 0 18px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; display: grid; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card .owner, .card .save, .card-delete { position: relative; z-index: 2; }
.media { border-radius: var(--radius-md); overflow: hidden; clip-path: inset(0 round var(--radius-md)); contain: paint; background: var(--lilac-soft); }
.media-image img { width: 100%; height: auto; }
.media-page { aspect-ratio: 4 / 3; position: relative; }
.media-page img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.media-live iframe { position: absolute; top: 0; left: 0; width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0; pointer-events: none; background: #fff; }
.media-site { aspect-ratio: 1.91 / 1; position: relative; background: linear-gradient(135deg, #dce9fb, var(--lilac-soft)); }
.media-site > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.site-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.site-fallback img { width: 40px; height: 40px; border-radius: 10px; background: #fff; padding: 4px; }
.badges { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; pointer-events: none; }
.card-body { padding: 12px 8px 2px; }
.card-body h3 { font-size: 15px; font-weight: 750; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-host { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 8px 0; }
.card-tags:empty { display: none; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 4px; }
.card-delete { flex: none; gap: 4px; padding-inline: 8px; }
.card-delete .icon { width: 15px; height: 15px; }
.owner { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 13px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.owner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner:hover span { color: var(--purple); }
.save { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; padding: 6px 8px; border-radius: 999px; }
.save:hover { background: var(--pink-soft); color: #d2559f; }
.save .icon { width: 19px; height: 19px; }
.save.on { color: #e046a6; }
.save[hidden] { display: none; }
.save.on .icon { fill: #f07cc3; stroke: #e046a6; animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }
/* Skill: the dark "private note" card with a lilac offset */
.card-skill { background: var(--night); color: #fff; border-color: var(--night); box-shadow: 8px 8px 0 var(--lilac), var(--shadow); margin-right: 8px; }
.card-skill:hover { box-shadow: 10px 10px 0 var(--pink), var(--shadow-lift); }
.skill-face { position: relative; padding: 8px 14px 6px; }
.skill-face .badges { position: static; margin-bottom: 16px; }
.skill-kicker { margin: 0 0 6px; font-size: 11px; letter-spacing: .18em; font-weight: 800; color: var(--lilac); }
.skill-face h3 { font-size: 22px; line-height: 1.15; word-break: break-word; }
.skill-desc { margin: 10px 0 12px; color: rgb(255 255 255 / 78%); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.skill-face code { display: inline-block; font: 600 12px var(--mono); padding: 3px 9px; border-radius: 8px; background: rgb(205 180 245 / 18%); color: var(--lilac); }
.card-skill .owner { color: rgb(255 255 255 / 80%); }
.card-skill .chip-sm { background: rgb(205 180 245 / 18%); color: var(--lilac); }
.card-skill .save { color: rgb(255 255 255 / 60%); }
.card-gone { opacity: .75; border-style: dashed; background: transparent; box-shadow: none; }
.gone-face { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 18px 10px; }
.gone-face h3 { font-size: 14px; }
.gone-face p { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 64px 20px; max-width: 420px; margin: 0 auto; }
.empty h3 { font-size: 22px; font-style: italic; font-weight: 850; margin-top: 8px; }
.empty p { margin: 0 0 12px; color: var(--muted); }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgb(31 27 46 / 45%); backdrop-filter: blur(6px); }
.sheet { width: min(560px, calc(100% - 24px)); margin: auto; }
.sheet[open] { animation: rise .28s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet-body { display: grid; gap: 14px; padding: 24px 28px 28px; background: var(--paper); border-radius: var(--radius-xl); box-shadow: var(--shadow-lift); max-height: calc(100dvh - 32px); overflow: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head .eyebrow { margin: 0; color: var(--purple); }
.sheet-head .badge { margin-right: auto; box-shadow: none; background: var(--lilac-soft); }
.sheet-body h2 { font-size: 30px; }
.sheet-lede { margin: -6px 0 4px; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field small, .hint { color: var(--muted); font-size: 12px; margin: 0; }
.field input:not([type=file]):not([type=checkbox]), .field textarea, .tag-input, .prefixed { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; outline: 0; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field textarea:focus, .tag-input:focus-within, .prefixed:focus-within { border-color: var(--lilac); box-shadow: 0 0 0 4px var(--lilac-soft); }
.prefixed { display: flex; align-items: center; gap: 4px; padding: 0 14px; }
.prefixed b { color: var(--muted); font-weight: 600; }
.prefixed input { border: 0 !important; box-shadow: none !important; padding: 11px 0 !important; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; cursor: text; }
.tag-input input { flex: 1; min-width: 120px; border: 0; outline: 0; padding: 4px; background: none; }
.file-box { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px dashed var(--lilac); border-radius: var(--radius-sm); background: var(--lilac-soft); }
.file-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-name { font-weight: 600; color: var(--purple-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; min-height: 0; }
.form-error:empty { display: none; }
.seg-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--lilac-soft); border-radius: 999px; }
.seg-switch button { border: 0; background: none; padding: 9px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg-switch button.on { background: #fff; color: var(--purple-deep); box-shadow: 0 2px 6px rgb(95 61 196 / 15%); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgb(255 255 255 / 40%); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.type-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-pick button { display: grid; justify-items: center; gap: 4px; padding: 14px 6px 12px; border: 1.5px solid var(--line); border-radius: 20px; background: #fff; cursor: pointer; transition: transform .15s, border-color .2s, background .2s; }
.type-pick button:hover { transform: translateY(-3px); border-color: var(--lilac); background: var(--lilac-soft); }
.type-pick b { font-size: 14px; }
.type-pick small { font-size: 11px; color: var(--muted); line-height: 1.3; text-align: center; }
.drop { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px; border: 2px dashed var(--line-strong); border-radius: 22px; cursor: pointer; color: var(--ink-2); text-align: left; transition: border-color .2s, background .2s; }
.drop .icon { width: 28px; height: 28px; color: var(--purple); }
.drop small { color: var(--muted); }
.drop.over, .drop:hover { border-color: var(--purple); background: var(--lilac-soft); }
.paste { display: flex; gap: 8px; }
.paste input { flex: 1; min-width: 0; padding: 0 16px; height: 44px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; outline: 0; }
.paste input:focus { border-color: var(--lilac); box-shadow: 0 0 0 4px var(--lilac-soft); }
.paste .btn { width: 44px; padding: 0; }
.unfurl-preview { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); }
.unfurl-preview img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { width: 48px; height: 28px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(31 27 46 / 20%); transition: transform .2s; }
.switch input:checked + .track { background: var(--purple); }
.switch input:checked + .track .thumb { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--purple); outline-offset: 2px; }
.switch-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.switch-label .icon { width: 16px; height: 16px; }
.switch-row { padding: 12px 14px; border-radius: var(--radius-md); background: var(--lilac-soft); }
.switch-row .switch-label { display: grid; gap: 0; }
.switch-row small { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- detail ---------- */
.detail { width: min(1240px, calc(100% - 32px)); height: min(860px, calc(100dvh - 32px)); margin: auto; }
.detail[open] { animation: rise .3s cubic-bezier(.2, .9, .3, 1.1); }
.detail-loading { display: grid; place-items: center; align-content: center; gap: 10px; height: 100%; background: var(--paper); border-radius: var(--radius-xl); color: var(--muted); }
.detail-shell { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: 100%; background: var(--paper); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lift); }
.detail-stage { position: relative; display: grid; place-items: center; min-height: 0; background: radial-gradient(500px 340px at 30% 20%, #f8e3f2, transparent 70%), var(--lilac-soft); padding: 24px; overflow: hidden; }
.detail-stage > img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-md); box-shadow: var(--shadow-lift); }
.stage-template, .stage-component { grid-template-rows: auto 1fr; place-items: stretch; gap: 12px; }
.frame-bar { display: flex; gap: 6px; justify-self: center; padding: 4px; background: #fff; border-radius: 999px; box-shadow: var(--shadow); }
.seg { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg .icon { width: 17px; height: 17px; }
.seg.on { background: var(--night); color: #fff; }
.frame { position: relative; justify-self: center; width: 100%; height: 100%; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: var(--shadow-lift); transition: width .3s ease; }
.frame[data-size="phone"] { width: 390px; max-width: 100%; border: 8px solid var(--night); border-radius: 40px; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage-skill { place-items: stretch; }
.md-paper { background: var(--night); color: #f3edff; border-radius: 24px; padding: 22px 24px; overflow: auto; box-shadow: 10px 10px 0 var(--lilac); margin: 4px 14px 14px 4px; }
.md-paper pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 13px/1.7 var(--mono); }
.md-file { margin: 0 0 12px; font-size: 11px; letter-spacing: .18em; font-weight: 800; color: var(--lilac); }
.md-empty { display: grid; place-items: center; align-content: center; gap: 10px; color: var(--lilac); }
.site-stage { position: relative; width: 100%; height: 100%; border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, #dce9fb, var(--lilac-soft)); box-shadow: var(--shadow-lift); }
.site-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.site-stage .site-fallback b { font-size: 18px; }
.site-stage .site-fallback img { width: 56px; height: 56px; }
.detail-side { display: flex; flex-direction: column; gap: 16px; padding: 22px 26px 26px; overflow: auto; border-left: 1px solid var(--line); }
.detail-top { display: flex; align-items: center; gap: 8px; }
.detail-top .icon-btn { margin-left: auto; }
.detail-top .badge { box-shadow: none; background: var(--lilac-soft); }
.detail-top .badge-lock { background: var(--night); }
.detail-top .badge-bad { background: var(--danger); }
.detail-side h2 { font-size: 30px; line-height: 1.12; word-break: break-word; }
.owner-lg span { display: grid; line-height: 1.3; }
.owner-lg b { color: var(--ink); font-size: 14px; }
.owner-lg small { color: var(--muted); font-weight: 500; font-size: 12px; }
.detail-desc { margin: 0; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-actions:empty { display: none; }
.source { margin: 0; font-size: 13px; color: var(--muted); }
.source a { display: inline-flex; align-items: center; gap: 4px; color: var(--purple); font-weight: 600; text-decoration: none; }
.source .icon { width: 14px; height: 14px; }
.note-card { background: var(--night); color: #f3edff; border-radius: 20px; padding: 14px 16px; box-shadow: 6px 6px 0 var(--lilac); margin-right: 6px; }
.note-card summary { cursor: pointer; font-size: 11px; letter-spacing: .18em; font-weight: 800; color: var(--lilac); }
.note-card pre { margin: 10px 0 0; white-space: pre-wrap; word-break: break-word; font: 13px/1.65 var(--font); max-height: 260px; overflow: auto; }
.note-sub { margin: 12px 0 0; font-size: 11px; color: var(--lilac); font-weight: 700; }
.owner-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-md); background: var(--lilac-soft); }
.owner-tools .switch { margin-right: auto; }
.owner-tools .muted { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; font-weight: 700; }
.owner-tools .muted .icon { width: 16px; height: 16px; }

/* ---------- admin ---------- */
.admin-search { max-width: 420px; margin: 28px 0 16px; }
.admin-list { display: grid; gap: 12px; margin-top: 28px; }
.admin-row { display: grid; grid-template-columns: 88px 1fr auto; gap: 16px; align-items: center; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.admin-thumb { display: grid; place-items: center; width: 88px; height: 88px; border-radius: var(--radius-md); overflow: hidden; background: var(--lilac-soft); }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-row h3 { font-size: 16px; }
.admin-row h3 a { text-decoration: none; }
.admin-row p { margin: 2px 0 0; font-size: 13px; }
.reason { color: var(--ink-2); font-style: italic; }
.admin-acts { display: flex; gap: 8px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table td a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; }
.table small { color: var(--muted); font-weight: 500; }

/* ---------- toast & dock ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 999px; background: var(--night); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lift); transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }
.dock { display: none; }
.offline .add-btn, .offline .dock-add, .offline [data-nav="me"] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .hero { padding: 32px; }
  .detail-shell { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 820px) {
  body { font-size: 14px; }
  .topbar { gap: 10px; padding: 10px 16px; }
  .topnav, .add-btn { display: none; }
  .brand small { display: none; }
  .search { height: 40px; }
  .hero, .list-wrap { width: calc(100% - 32px); }
  .hero { margin-top: 14px; padding: 28px; }
  .me-id { gap: 12px; }
  .me-id .avatar { width: 52px !important; height: 52px !important; }
  .filters { margin-top: 20px; }
  .grid { columns: 2 150px; column-gap: 12px; }
  .card { margin-bottom: 12px; padding: 6px; border-radius: 20px; }
  .card-body { padding: 10px 6px 0; }
  .card-body h3 { font-size: 13.5px; }
  .card-tags { padding: 6px 6px 0; }
  .card-foot { padding: 8px 6px 2px; }
  .owner span { max-width: 80px; }
  .badges { top: 12px; left: 12px; }
  .badge { font-size: 11px; }
  .skill-face { padding: 8px 10px 4px; }
  .skill-face h3 { font-size: 18px; }
  .card-skill { box-shadow: 5px 5px 0 var(--lilac), var(--shadow); margin-right: 5px; }
  .dock { display: flex; position: fixed; z-index: 30; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); align-items: center; gap: 22px; padding: 8px 22px; border-radius: 999px; background: rgb(255 253 249 / 88%); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
  .dock a { display: grid; justify-items: center; gap: 1px; text-decoration: none; font-size: 11px; font-weight: 700; color: var(--muted); min-width: 44px; }
  .dock a.on { color: var(--purple-deep); }
  .dock-add { display: grid; place-items: center; width: 54px; height: 54px; margin: -18px 0 -4px; border-radius: 50%; border: 4px solid var(--cream); background: var(--purple); color: #fff; box-shadow: 0 10px 20px -6px rgb(95 61 196 / 70%); cursor: pointer; }
  .dock-add .icon { width: 24px; height: 24px; stroke-width: 2.5; }
  #main { padding-bottom: 120px; }
  .toast { bottom: 96px; }
  .detail { width: 100%; height: 100dvh; margin: 0; }
  .detail-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; border-radius: 0; overflow: auto; }
  .detail-stage { min-height: 46dvh; max-height: 62dvh; padding: 16px; }
  .detail-stage > img { max-height: calc(62dvh - 32px); }
  .stage-template .frame, .stage-component .frame, .stage-motion .frame { height: 52dvh; }
  .frame[data-size="phone"] { width: 100%; border-width: 6px; }
  .detail-side { border-left: 0; overflow: visible; padding: 18px 18px 40px; }
  .detail-top { position: sticky; top: 0; }
  .detail-side h2 { font-size: 24px; }
  .sheet { width: 100%; margin: auto 0 0; }
  .sheet-body { border-radius: 30px 30px 0 0; padding: 20px 18px max(24px, env(safe-area-inset-bottom)); max-height: 92dvh; }
  .type-pick { grid-template-columns: repeat(3, 1fr); }
  .admin-row { grid-template-columns: 64px 1fr; }
  .admin-thumb { width: 64px; height: 64px; }
  .admin-acts { grid-column: 1 / -1; }
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}
@media (max-width: 420px) {
  .brand span { display: none; }
  .hero h1 { font-size: 36px; }
  .type-tab { padding-right: 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.hero-copy > .btn { justify-self: start; }
.card > * { min-width: 0; }

@media (max-width: 640px) {
  .hero { min-height: 320px; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px; border-radius: 28px; align-content: center; }
  .hero h1 { font-size: 32px; }
  .hero-art { display: flex; align-items: center; justify-content: space-between; height: 56px; order: -1; gap: 2px; }
  .hero-art .float { position: static; min-width: 0; flex: 0 1 48px; }
  .hero-art .float .mascot { display: block; width: 100%; height: auto; }
  .hero-actions, .me-actions { gap: 8px; margin-top: 20px; }
  .me-actions .btn { font-size: 12px; padding: 9px 11px; }
  .me-actions .icon { width: 15px; height: 15px; }
  .hero-actions .btn { font-size: 14px; padding: 10px 16px; }
  .empty-mascots-all { gap: 4px; }
  .empty-mascots-all .mascot { width: 40px; flex-basis: 40px; }
}

@media (max-width: 360px) {
  .hero { min-height: 340px; }
}

.source-filters[hidden] { display: none; }
.grid[aria-busy="true"] { opacity: .55; pointer-events: none; }
.grid[aria-busy="true"]:has(> .loading) { opacity: 1; }

/* ---------- image collections & Skill files ---------- */
.gallery-badge { position: absolute; z-index: 2; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); font-size: 12px; font-weight: 750; pointer-events: none; }
.gallery-badge .icon { width: 15px; height: 15px; }
.detail-image { grid-template-columns: minmax(0, 1.35fr) minmax(350px, 1fr); }
.gallery-stage { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--cream); overflow: hidden; }
.gallery-viewport { position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; overflow: hidden; touch-action: pan-y pinch-zoom; }
.gallery-image { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: clamp(56px, 14%, 100px); height: 72%; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--night); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gallery-arrow::before { content: ''; position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.66); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 3px 18px rgba(25,20,38,.12); }
.gallery-arrow::before, .gallery-arrow .icon { opacity: 0; transition: opacity 160ms ease; }
.gallery-arrow .icon { position: relative; width: 20px; height: 20px; }
.gallery-arrow.previous { left: 0; }
.gallery-arrow.next { right: 0; }
.gallery-arrow:hover::before, .gallery-arrow:hover .icon, .gallery-arrow:focus-visible::before, .gallery-arrow:focus-visible .icon { opacity: 1; }
.gallery-arrow:focus-visible { outline: none; }
.gallery-arrow:focus-visible::before { outline: 2px solid var(--purple); outline-offset: 3px; }
.gallery-arrow:disabled { visibility: hidden; pointer-events: none; }
@media (hover: none), (pointer: coarse) { .gallery-arrow::before, .gallery-arrow .icon { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gallery-arrow::before, .gallery-arrow .icon { transition: none; } }
.gallery-arrow[hidden], .gallery-rail[hidden], [data-file-download][hidden], [data-copy="active-file"][hidden] { display: none; }
.gallery-position { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; background: var(--night); color: var(--paper); font: 12px/1.8 var(--mono); }
.gallery-rail { display: flex; gap: 8px; padding: 14px 18px; overflow-x: auto; border-top: 1px solid var(--line); background: var(--paper); }
.gallery-rail button { flex: none; padding: 3px; background: none; border: 2px solid transparent; border-radius: var(--radius-sm); cursor: pointer; }
.gallery-rail button.on { border-color: var(--purple); }
.gallery-rail img { width: 64px; height: 56px; object-fit: cover; border-radius: 7px; }
.gallery-close { display: none; }
.image-detail-header { display: flex; align-items: center; gap: 8px; }
.image-detail-header h2 { flex: 1; min-width: 0; font-size: clamp(19px, 2vw, 24px); }
.image-prompt { padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--cream); }
.image-prompt-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.image-prompt-header .icon { width: 16px; height: 16px; }
.image-prompt h3 { font-size: 16px; }
.image-prompt h4 { font-size: 14px; margin: 20px 0 6px; }
.image-prompt pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.8 var(--font); color: var(--ink); }
.image-prompt > p { margin: 0; }
.image-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.image-detail-actions:empty { display: none; }
.image-download:hover { color: var(--purple-deep); }
.image-detail-info { border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.image-detail-info summary { padding: 7px 0; cursor: pointer; }
.image-detail-info > div { display: grid; gap: 10px; padding: 4px 0 0; }
.skill-shell { height: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; background: var(--paper); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lift); }
.skill-header { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); min-width: 0; }
.skill-header > div { min-width: 0; }
.skill-header p { margin: 0 0 3px; font: 10px var(--mono); letter-spacing: .12em; color: var(--purple-deep); }
.skill-header h2 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-header > .icon-btn { margin-left: auto; flex: none; }
.skill-workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 0; position: relative; }
.skill-sidebar { min-width: 0; min-height: 0; overflow: auto; background: var(--cream); border-right: 1px solid var(--line); padding: 16px 10px; }
.skill-tree-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 12px; font-size: 12px; }
.skill-tree-title span { font-size: 11px; color: var(--ink-2); }
.file-search { display: block; width: calc(100% - 16px); margin: 0 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); padding: 8px 10px; font-size: 12px; min-width: 0; }
.skill-tree { font: 12px/1.6 var(--mono); }
.file-folder > summary { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 8px; cursor: pointer; user-select: none; color: var(--ink-2); }
.file-folder > summary::before { content: '›'; width: 10px; font-size: 16px; }
.file-folder[open] > summary::before { transform: rotate(90deg); }
.file-folder > summary::-webkit-details-marker { display: none; }
.file-folder > div { margin-left: 12px; padding-left: 6px; border-left: 1px solid var(--line-strong); }
.file-entry { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 34px; border: 0; border-radius: 8px; background: transparent; padding: 7px 10px; text-align: left; cursor: pointer; font: inherit; color: var(--ink-2); }
.file-entry span, .file-folder summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-entry:hover { background: var(--lilac-soft); }
.file-entry.on { background: var(--lilac-soft); color: var(--purple-deep); font-weight: 750; }
.skill-tree .icon { width: 15px; height: 15px; }
.skill-reader { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.file-toolbar { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.file-path { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--mono); color: var(--ink-2); }
.file-toolbar .btn { flex: none; }
.file-content { min-width: 0; min-height: 0; overflow: auto; padding: 28px 34px 44px; }
.file-message { margin: 10px; color: var(--ink-2); font: 13px/1.6 var(--font); }
.file-empty { display: grid; justify-items: center; align-content: center; gap: 16px; min-height: 220px; text-align: center; color: var(--ink-2); overflow-wrap: anywhere; }
.file-image { display: grid; place-items: center; height: 100%; min-height: 180px; }
.file-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.source-reader { margin: 0; font: 12px/1.8 var(--mono); tab-size: 2; }
.markdown-reader { max-width: 760px; margin: 0 auto; font: 14px/1.85 var(--font); color: var(--ink-2); overflow-wrap: anywhere; }
.markdown-reader h2 { font-size: 26px; margin: 12px 0 24px; color: var(--ink); }
.markdown-reader h3 { font-size: 19px; margin: 28px 0 14px; color: var(--ink); }
.markdown-reader h4, .markdown-reader h5, .markdown-reader h6 { font-size: 15px; margin: 24px 0 12px; color: var(--ink); }
.markdown-reader p { margin: 12px 0; }
.markdown-reader ul, .markdown-reader ol { padding-left: 24px; }
.markdown-reader li { margin: 7px 0; }
.markdown-reader code { font: .88em/1.7 var(--mono); padding: 2px 5px; background: var(--lilac-soft); border-radius: 4px; color: var(--ink); }
.markdown-reader pre { overflow: auto; background: var(--cream); padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: 12px/1.7 var(--mono); }
.markdown-reader pre code { background: none; padding: 0; }
.markdown-reader blockquote { margin: 16px 0; padding-left: 16px; border-left: 3px solid var(--lilac); }
.markdown-reader hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.file-frontmatter { margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.file-frontmatter summary { cursor: pointer; }
.skill-about { min-width: 0; border-top: 1px solid var(--line); min-height: 44px; }
.skill-about > summary { padding: 12px 24px; cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.skill-about > summary span { margin-left: 14px; font-weight: 400; color: var(--ink-2); }
.skill-about-content { display: grid; gap: 14px; padding: 8px 24px 24px; max-height: 44dvh; overflow: auto; }
.file-tree-toggle { display: none; }
.sheet:has(.gallery-editor) { width: min(760px, calc(100% - 32px)); }
.gallery-editor h2 { font-size: 24px; }
.gallery-selection-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.gallery-selection-head > span { color: var(--ink-2); font: 11px var(--mono); }
.gallery-selected { max-height: 240px; overflow: auto; display: grid; gap: 6px; }
.gallery-selected-row { display: flex; align-items: center; gap: 8px; padding: 6px; background: var(--cream); border-radius: var(--radius-sm); }
.gallery-selected-row > img { border-radius: 8px; object-fit: cover; flex: none; }
.gallery-selected-row > span { font-size: 12px; min-width: 0; flex: 1; }
.gallery-selected-row > .icon-btn { width: 30px; height: 30px; flex: none; }
.cover-choice { display: flex; align-items: center; gap: 4px; flex: none; font-size: 12px; color: var(--purple-deep); }
.gallery-picker { max-height: 300px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gallery-pick { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; }
.gallery-pick > img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; }
.gallery-pick > span { min-width: 0; overflow-wrap: anywhere; }
.gallery-pick small { display: block; font-size: 10px; color: var(--ink-2); }
.gallery-pick.is-locked { opacity: .5; cursor: default; }
.gallery-editor input[type=checkbox], .gallery-editor input[type=radio] { accent-color: var(--purple); }
.gallery-editor-actions { display: flex; justify-content: flex-end; gap: 10px; }
.gallery-editor-actions [data-dissolve-gallery] { margin-right: auto; }
@media (max-width: 820px) {
  .detail-image { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38dvh auto; }
  .image-detail-close { display: none; }
  .gallery-arrow { width: 56px; }
  .gallery-rail { padding: 8px 12px; }
  .gallery-rail img { width: 48px; height: 42px; }
  .gallery-close { display: grid; position: absolute; z-index: 3; right: 12px; top: 12px; background: var(--paper); box-shadow: var(--shadow); }
  .gallery-badge { right: 12px; font-size: 10px; }
  .skill-shell { border-radius: 0; }
  .skill-header { padding: 14px 16px; }
  .skill-header h2 { font-size: 17px; }
  .skill-workspace { grid-template-columns: minmax(0, 1fr); }
  .skill-sidebar { display: none; position: absolute; inset: 0 auto 0 0; width: min(280px, 82%); z-index: 4; box-shadow: var(--shadow-lift); }
  .skill-workspace.show-tree .skill-sidebar { display: block; }
  .file-tree-toggle { display: inline-flex; }
  .file-toolbar { padding: 8px 10px; }
  .file-toolbar .btn { padding: 7px; font-size: 11px; }
  .file-toolbar .icon { width: 16px; height: 16px; }
  .file-path { font-size: 11px; }
  .file-content { padding: 20px 18px 32px; }
  .skill-about > summary { padding: 12px 16px; }
  .skill-about-content { padding: 8px 16px 20px; }
  .sheet:has(.gallery-editor) { width: 100%; }
  .gallery-picker { grid-template-columns: minmax(0, 1fr); }
  .gallery-selected-row { gap: 4px; }
  .gallery-selected-row > img { width: 36px; height: 40px; }
  .gallery-selected-row > .icon-btn { width: 26px; height: 30px; }
}

/* Fixed motion previews: fetch on intent, share the poster and video geometry. */
.media-motion { position: relative; z-index: 2; pointer-events: none; background: var(--night); }
.media-motion img, .media-motion video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-motion video { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.card.is-playing .media-motion video { opacity: 1; }
.motion-play { pointer-events: auto; position: absolute; right: 12px; bottom: 12px; z-index: 2; border: 0; border-radius: 999px; padding: 7px 12px; color: white; background: #1f1b2ed9; font: 600 12px var(--font); cursor: pointer; }
.stage-motion { display: flex; flex-direction: column; justify-content: center; gap: 18px; min-width: 0; }
.motion-screen { display: flex; justify-content: center; min-height: 0; width: 100%; }
.motion-screen video { display: block; width: 100%; max-height: 68dvh; object-fit: contain; border-radius: 18px; background: var(--night); }
.motion-variants { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.motion-variants .seg { background: var(--paper); }
.motion-variants .seg.on { background: var(--night); }
.motion-legacy { min-height: 55dvh; }
@media (max-width: 640px) { .motion-screen video { max-height: 55dvh; } .motion-play { right: 8px; bottom: 8px; padding: 6px 10px; } }
