
:root {
  --on-photo: #ffffff;
  --scrim-strong: rgba(0, 0, 0, 0.72);
  --scrim-soft: rgba(0, 0, 0, 0.22);
  --scrim-none: rgba(0, 0, 0, 0);
  --on-photo-hover: rgba(255, 255, 255, 0.16);
  --sheet-backdrop: rgba(0, 0, 0, 0.56);
}

:where(.rail-icon, .pic.srv) { position: relative; }
:where(.rail-icon, .pic.srv) > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }

.side-head.has-banner { position: relative; z-index: 2; isolation: isolate; color: var(--on-photo); }
.side-banner { position: absolute; left: 0; right: 0; top: 0; height: 120px; z-index: -1; overflow: hidden; background: var(--panel); pointer-events: none; }
.side-body.under-banner { padding-top: 72px; }
.side-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.side-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--scrim-strong), var(--scrim-soft) 46%, var(--scrim-none) 80%); }
.side-head.has-banner .side-title { color: var(--on-photo); }
.side-head.has-banner .icon-btn { color: var(--on-photo); }
.side-head.has-banner .icon-btn:hover { background: var(--on-photo-hover); color: var(--on-photo); }
.side-head.has-banner .icon-btn:focus-visible { outline-color: var(--on-photo); }
.side-head.has-banner .side-icon { outline: 2px solid var(--scrim-soft); }
.side-icon { flex: none; align-self: center; }

.inv-banner { position: relative; height: 200px; margin: calc(-1 * var(--s5)) calc(-1 * var(--pad-x)) var(--s5); overflow: hidden; border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--raised); }
.inv-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.invite-desc { white-space: pre-line; overflow-wrap: anywhere; }

.inv-own { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--rule); }
.inv-own .grow { flex: 1; min-width: 0; }
.inv-own .t { font-weight: 600; }
.inv-own-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-small); line-height: var(--lh-small); }
.inv-own .hint { color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.inv-own.none { display: block; }

.ov { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: var(--s6); align-items: start; }
.ov-main { min-width: 0; }
.ov-aside { position: sticky; top: var(--s5); min-width: 0; }
.ov-aside h2 { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; }
.ov-aside .hint { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.ov-card { margin-top: var(--s3); }
.ov-card .ds-card { cursor: default; }
.ov-blk + .ov-blk { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--rule); }
.ov-blk > h2 { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; }
.ov-blk > h2 label { font: inherit; }
.ov-blk > .hint { margin-top: var(--s1); max-width: 62ch; color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.ov-body { margin-top: var(--s3); }
.ov-body > .inp, .ov-body > textarea { display: block; width: 100%; }
.ov-body > textarea { min-height: 88px; padding: var(--s2) var(--s3); resize: vertical; font: var(--fs-body)/var(--lh-body) var(--font); }
.ov-body .hint.warn { margin-top: var(--s2); color: var(--pill-warning-ink); font-size: var(--fs-small); line-height: var(--lh-small); }
.ov-body .set-actions { margin-top: var(--s3); }
.ov-count { order: 9; margin-left: auto; color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); font-variant-numeric: tabular-nums; }
.ov-pic-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.ov-pic-acts .set-actions { margin-top: 0; }
.ov-icon { width: 80px; height: 80px; border-radius: var(--radius-card); font-size: var(--fs-title); }
.ov-pic.banner { flex: 0 1 320px; min-width: 0; }
.ov-ban { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-nested); background: var(--raised); }
.ov-ban img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.ov-none { padding: 0 var(--s4); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); text-align: center; }
.ov-link { display: flex; align-items: stretch; max-width: 480px; }
.ov-pre { display: inline-flex; align-items: center; flex: none; padding: 0 var(--s1) 0 var(--s3); border: 1px solid var(--control); border-right: 0; border-radius: var(--radius-nested) 0 0 var(--radius-nested); color: var(--muted); font: var(--fs-body)/1 var(--mono); }
.ov-link .inp { flex: 1; min-width: 0; border-radius: 0 var(--radius-nested) var(--radius-nested) 0; }
.ov-link .inp[aria-invalid="true"] { border-color: var(--negative-border); }
.ov-body > .hint { margin-top: var(--s2); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.ov-blk-disc .check { margin-top: 0; }
.ov-blk-disc .check .hint { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.ov-delisted { margin: 0 0 var(--s3); }
.ov-cats { margin: var(--s4) 0 0; padding: 0; border: 0; }
.ov-cats legend { padding: 0; font-weight: 500; }
.ov-cat-list { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.ov-cat {
  display: inline-flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 var(--s3); border: 1px solid var(--control); border-radius: var(--round);
  color: var(--muted); cursor: pointer; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.ov-cat input { width: 14px; height: 14px; margin: 0; accent-color: var(--text); }
.ov-cat:has(input:checked) { border-color: transparent; background: var(--active); color: var(--text); }
.ov-cat:has(input:disabled:not(:checked)) { opacity: 0.55; cursor: default; }
.ov-cats .hint { margin-top: var(--s2); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.ov-crop .rv-in > .ov-cropper { margin-top: var(--s4); }
.ov-cropper { padding: var(--s4); border-radius: var(--radius-nested); background: var(--raised); }

.crop-frame { position: relative; overflow: hidden; touch-action: none; cursor: grab; background: var(--ground); user-select: none; }
.crop-frame.icon { width: 240px; height: 240px; border-radius: var(--radius-card); }
.crop-frame.banner { width: 100%; max-width: 480px; aspect-ratio: 16 / 9; border-radius: var(--radius-nested); }
.crop-frame.grab { cursor: grabbing; }
.crop-frame:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.crop-canvas, .crop-gif { display: block; width: 100%; height: 100%; }
.crop-gif { object-fit: cover; }
.crop-z { display: flex; align-items: center; gap: var(--s3); max-width: 480px; margin-top: var(--s3); color: var(--muted); font-size: var(--fs-small); }
.crop-zoom { flex: 1; min-width: 0; accent-color: var(--text); }
.crop .hint { margin-top: var(--s2); max-width: 60ch; color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }

@media (max-width: 1180px) {
  .ov { grid-template-columns: minmax(0, 1fr); }
  .ov-aside { position: static; order: 2; max-width: 360px; }
}

.ds { min-width: 0; }
.ds-hero {
  position: relative; display: flex; align-items: flex-end; height: 240px; margin: calc(-1 * var(--s5)) calc(-1 * var(--pad-x)) 0; overflow: hidden;
  isolation: isolate; border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--raised);
}
.ds-hero-ban { position: absolute; inset: 0; z-index: -1; }
.ds-hero-ban img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ds-hero.has-img .ds-hero-ban::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--scrim-strong) 30%, var(--scrim-soft) 85%, var(--scrim-none)); }
.ds-hero-in { width: 100%; max-width: 640px; padding: var(--s5) var(--pad-x); }
.ds-hero h1 { font-size: var(--fs-stamp); line-height: var(--lh-stamp); font-weight: 600; letter-spacing: -0.025em; }
.ds-hero-p { margin-top: var(--s1); max-width: 56ch; color: var(--muted); }
.ds-hero.has-img h1, .ds-hero.has-img .ds-hero-p, .ds-hero.has-img .ds-hero-credit, .ds-hero.has-img .ds-hero-credit a { color: var(--on-photo); }
.ds-hero-credit { position: absolute; right: var(--s3); top: var(--s3); max-width: 40%; overflow: hidden; padding: 2px var(--s2); border-radius: var(--round); background: var(--scrim-strong); font-size: var(--fs-small); line-height: var(--lh-small); text-overflow: ellipsis; white-space: nowrap; }
.ds-hero:not(.has-img) .ds-hero-credit { display: none; }
.ds-search { position: relative; max-width: 480px; margin-top: var(--s4); }
.ds-search svg { position: absolute; left: var(--s3); top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--muted); pointer-events: none; }
.ds-search .inp { width: 100%; height: 40px; padding-left: 36px; background: var(--surface); }
.ds-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.ds-chip {
  flex: none; height: 32px; padding: 0 var(--s3); border: 1px solid var(--control); border-radius: var(--round); background: none; color: var(--muted);
  font: 500 var(--fs-body)/1 var(--font); white-space: nowrap; cursor: pointer; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.ds-chip:hover { color: var(--text); border-color: var(--control-hover); }
.ds-chip[aria-pressed="true"] { border-color: transparent; background: var(--active); color: var(--text); }
.ds-list { margin-top: var(--s5); }
.ds-sec + .ds-sec { margin-top: var(--s6); }
.ds-sec-h h2 { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; }
.ds-sec-h p { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.ds-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin: var(--s3) 0 0; padding: 0; list-style: none; }
.ds-sec:first-child > .ds-grid:first-child { margin-top: 0; }
.ds-card {
  position: relative; display: flex; flex-direction: column; height: 284px; min-width: 0; overflow: hidden; border-radius: var(--radius-card);
  background: var(--raised); cursor: pointer; transition: background-color var(--t-fast) var(--ease-out);
}
.ds-card:not(.skel):hover { background: var(--active); }
.ds-card:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.ds-card .t:focus-visible { outline: 0; }
.ds-ban { position: relative; flex: none; height: 120px; overflow: hidden; background: var(--active); }
.ds-ban img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ds-icon { position: absolute; left: var(--s4); top: 92px; width: 56px; height: 56px; border-radius: var(--radius-card); font-size: var(--fs-section); outline: 4px solid var(--raised); transition: outline-color var(--t-fast) var(--ease-out); }
.ds-card:not(.skel):hover .ds-icon { outline-color: var(--active); }
.ds-body { display: grid; align-content: start; gap: var(--s1); min-height: 0; padding: 40px var(--s4) var(--s4); }
.ds-name { min-width: 0; height: var(--lh-section); overflow: hidden; font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; white-space: nowrap; }
.ds-name .t { display: inline-flex; align-items: center; max-width: 100%; color: var(--text); }
.ds-name .t > bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ds-name .t::after { content: ""; position: absolute; inset: 0; }
.ds-desc { display: -webkit-box; height: calc(2 * var(--lh-body)); overflow: hidden; color: var(--muted); overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ds-desc .none, .ds-sheet-desc .none { color: var(--faint); }
.ds-meta { display: flex; gap: var(--s1); height: var(--lh-small); overflow: hidden; color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-meta .on { color: var(--text); }
.ds-meta .dot { color: var(--faint); }
.ds-tags { display: flex; gap: var(--s1); height: 20px; margin: var(--s1) 0 0; padding: 0; overflow: hidden; list-style: none; }
.ds-tags .pill { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 20px; height: 20px; padding: 0 var(--s2); border-radius: var(--round); font-size: var(--fs-small); font-weight: 500; white-space: nowrap; }
.ds-card.skel { cursor: default; }
.ds-card.skel .ds-body { padding-top: 48px; }
.ds-more { margin-top: var(--s5); }
.ds-empty { padding: var(--s6) 0; }
.ds-empty .t { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; }
.ds-empty .s { margin-top: var(--s1); color: var(--muted); }
@media (max-width: 1180px) { .ds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.ds-sheet { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 64px); padding: 0; overflow: hidden auto; border: 0; border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: var(--shadow-dialog); }
.ds-sheet::backdrop { background: var(--sheet-backdrop); }
.ds-sheet[open] { animation: ds-in var(--t-slow) var(--ease-out); }
@keyframes ds-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ds-sheet-ban { position: relative; height: 168px; overflow: hidden; background: var(--raised); }
.ds-sheet-ban img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ds-sheet-icon { position: absolute; left: var(--s5); top: 128px; width: 72px; height: 72px; border-radius: var(--radius-card); font-size: var(--fs-title); outline: 4px solid var(--surface); }
.ds-x { position: absolute; top: var(--s3); right: var(--s3); width: 32px; height: 32px; border-radius: var(--round); background: var(--scrim-strong); color: var(--on-photo); }
.ds-x:hover { background: var(--scrim-strong); color: var(--on-photo); }
.ds-x svg { width: 16px; height: 16px; }
.ds-sheet-in { padding: 44px var(--s5) var(--s5); }
.ds-sheet h2 { display: flex; align-items: center; min-width: 0; font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; letter-spacing: -0.015em; }
.ds-sheet h2 > bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-sheet-fig { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); font-variant-numeric: tabular-nums; }
.ds-sheet-desc { margin-top: var(--s3); white-space: pre-line; overflow-wrap: anywhere; }
.ds-sheet .ds-tags { margin-top: var(--s3); }
.ds-sheet-owner { margin-top: var(--s3); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.ds-sheet-owner .k { color: var(--muted); }
.ds-sheet-owner bdi { color: var(--text); }
.ds-sheet-acts { margin-top: var(--s5); }

@media (max-width: 760px) {
  .inv-banner { height: 152px; margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4); border-radius: 0; }
  .ds-hero { height: 216px; margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) 0; border-radius: 0; }
  .ds-hero-in { padding: var(--s4); }
  .ds-hero h1 { font-size: 26px; line-height: 30px; }
  .ds-search .inp { font-size: 16px; }
  .ds-chips { flex-wrap: nowrap; margin-right: calc(-1 * var(--s4)); padding-right: var(--s4); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .ds-chips::-webkit-scrollbar { display: none; }
  .ds-grid { grid-template-columns: minmax(0, 1fr); }
  .ds-sheet { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: var(--radius-card) var(--radius-card) 0 0; }
  .ov-pic.banner { flex-basis: 100%; }
  .crop-frame.icon { width: 200px; height: 200px; }
}
@media (prefers-reduced-motion: reduce) { .ds-sheet[open] { animation: none; } .ds-card, .ds-icon, .ds-chip, .ov-cat { transition: none; } }
.lead-back ~ .ds .ds-hero, .lead-back ~ .inv-banner { margin-top: 0; border-radius: var(--radius-nested); }
