.collections-page { min-height: 100vh; --page-inline:clamp(24px,4.8vw,78px); }
.collection-detail-page { --page-inline:clamp(24px,3.4vw,58px); }
.collections-page [hidden] { display: none !important; }
.collections-main { min-height: calc(100vh - 76px); padding: 48px var(--page-inline) 100px; }
.collections-toolbar { display: flex; align-items: center; gap: 28px; }
.collection-tabs { display: flex; min-width: 0; align-items: center; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.collection-tabs::-webkit-scrollbar { display: none; }
.collection-tabs button { flex: none; padding: 7px 11px; border: 1px solid #dcdcd7; border-radius: 8px; background: #fff; color: #777773; font-size: 14px; font-weight: 450; cursor: pointer; transition: border-color 180ms ease,background-color 180ms ease,color 180ms ease; }
.collection-tabs button:is(.is-active,:hover) { border-color: #111; background: #111; color: #fff; }
.collection-tabs button.is-active { font-weight: 500; }
.collection-tabs button:focus-visible { outline: 2px solid #2e7df2; outline-offset: 2px; }
.add-collection-button { display: inline-flex; height: 38px; flex: none; align-items: center; gap: 3px; margin: 0 0 8px auto; padding: 0 5px 0 12px; border: 0; border-radius: 6px; background: transparent; color: #2e7df2; font-size: 14px; cursor: pointer; }
.add-collection-button:hover { background: #f2f6fd; }
.add-collection-button span { font-size: 20px; }
.collections-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 56px clamp(16px,2.1vw,34px); padding-top: 46px; }
.collection-card-skeleton,.collection-person-skeleton { min-width:0; }
.collection-card-skeleton span,.collection-person-skeleton span,.collection-card-skeleton i,.collection-card-skeleton b,.collection-person-skeleton i,.collection-person-skeleton b,.collection-line-skeleton,.collection-owner-skeleton > i { display:block; border-radius:6px; background:linear-gradient(100deg,#efefec 30%,#fafaf8 50%,#efefec 70%); background-size:220% 100%; animation:collection-skeleton 1.15s linear infinite; }
.collection-card-skeleton span { width:100%; aspect-ratio:1; }
.collection-card-skeleton i,.collection-person-skeleton i { width:62%; height:13px; margin-top:10px; }
.collection-card-skeleton b,.collection-person-skeleton b { width:38%; height:10px; margin-top:7px; }
.collection-card { min-width: 0; }
.collection-mosaic { display: grid; width: 100%; aspect-ratio: 1; gap: 3px; overflow: hidden; border-radius: 7px; background: #f1f1ee; transition: transform 420ms cubic-bezier(.16,1,.3,1); }
.collection-card:hover .collection-mosaic,.collection-card:focus-visible .collection-mosaic { transform: scale(1.008); }
.collection-mosaic[data-count="1"] { grid-template-columns: 1fr; }
.collection-mosaic[data-count="2"] { grid-template-columns: repeat(2,1fr); }
.collection-mosaic[data-count="3"],.collection-mosaic[data-count="4"] { grid-template: repeat(2,1fr)/repeat(2,1fr); }
.collection-mosaic[data-count="3"] > :nth-child(3) { grid-column: 1/-1; }
.collection-mosaic img,.collection-mosaic-fallback { width: 100%; height: 100%; min-width: 0; min-height: 0; }
.collection-mosaic img { object-fit: cover; transition: transform 500ms cubic-bezier(.16,1,.3,1); }
.collection-mosaic-fallback { display:grid; place-items:center; background:#111; color:#fff; font-size:clamp(24px,4vw,52px); line-height:1; font-weight:600; }
.collection-card:hover .collection-mosaic img { transform: scale(1.018); }
.collection-card h2 { display: flex; align-items: center; gap: 4px; margin: 10px 0 0; font-size: 16px; line-height: 1.2; font-weight: 550; letter-spacing: -.35px; }
.collection-card h2 span { font-size: 16px; }
.collection-card p { margin: 5px 0 0; color: #999994; font-size: 14px; }
.collections-load-more { display:block; height:38px; margin:42px auto 0; padding:0 13px; border:1px solid #dcdcd7; border-radius:6px; background:#fff; color:#111; font-size:14px; cursor:pointer; }
.collections-load-more:hover { background:#f6f6f3; }
.collections-load-more:disabled { color:#999994; cursor:wait; }
.collections-load-more[hidden] { display:none; }

.collection-detail-main { min-height: calc(100vh - 76px); padding: 0 var(--page-inline) 110px; }
.collection-hero { display:grid; justify-items:center; padding:clamp(46px,6.4vw,88px) 12px clamp(42px,5vw,68px); text-align:center; }
.collection-hero h1 { margin: 0; font-size: clamp(32px,3.1vw,48px); line-height: 1; font-weight: 560; letter-spacing: -1.8px; }
.collection-hero h1 .collection-private-icon { margin-left: 7px; color: #8f8f8a; font-size: .48em; font-variation-settings: "FILL" 0, "wght" 450; vertical-align: .18em; }
.collection-meta { min-height:20px; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; margin-top:13px; color:#92928d; font-size:13px; line-height:1.3; }
.collection-meta > i { width:3px; height:3px; border-radius:50%; background:#b1b1ac; }
.collection-meta > a { color:#696965; transition:color 150ms ease; }.collection-meta > a:hover { color:#11110f; }
.collection-visibility { margin-left:2px; padding:2px 6px; border-radius:5px; color:#7d7d78; background:#f1f1ee; font-size:11px; }
.collection-owner { display:flex; align-items:center; gap:7px; margin-top:20px; color:#464643; font-size:13px; transition:opacity 150ms ease; }
.collection-owner:hover { opacity:.72; }
.collection-owner img { width:30px; height:30px; border-radius:6px; object-fit:cover; }
.collection-owner-fallback { display:grid; width:30px; height:30px; place-items:center; border-radius:6px; background:#111; color:#fff; font-size:12px; font-weight:600; }
.collection-hero > p { max-width:660px; margin:15px 0 0; color:#92928d; font-size:15px; line-height:1.45; }
.collection-header-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:6px; margin-top:24px; }
.collection-header-action { min-width:62px; height:38px; display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:0 10px; border:0; border-radius:8px; color:#73736e; background:transparent; font-size:12px; cursor:pointer; transition:background 150ms ease,color 150ms ease,transform 150ms ease; }
.collection-header-action:hover,.collection-header-action:focus-visible { color:#11110f; background:#f1f1ee; outline:0; }.collection-header-action:active { transform:scale(.97); }
.collection-header-action .material-symbols-rounded { font-size:18px; font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 20; }
.follow-collection { height:36px; padding:0 13px; border:1px solid #111; border-radius:8px; background:#111; color:#fff; font-size:12px; cursor:pointer; transition:background 150ms ease,color 150ms ease,transform 150ms ease; }
.follow-collection:active { transform:scale(.97); }
.follow-collection.is-following { background: #fff; color: #111; }
.collection-more { position:relative; }
.collection-more-menu { position:absolute; z-index:20; top:calc(100% + 7px); right:0; width:186px; padding:5px; border:1px solid #dfdfda; border-radius:10px; background:#fff; box-shadow:0 12px 34px rgba(17,17,15,.11); text-align:left; }
.collection-more-menu[hidden] { display:none; }
.collection-more-menu > button,.collection-more-destructive button { width:100%; min-height:36px; display:flex; align-items:center; gap:8px; padding:0 9px; border:0; border-radius:6px; color:#4d4d49; background:transparent; font-size:13px; cursor:pointer; transition:background 150ms ease,color 150ms ease; }
.collection-more-menu button:hover,.collection-more-menu button:focus-visible { color:#11110f; background:#f3f3f0; outline:0; }
.collection-more-menu .material-symbols-rounded { font-size:17px; }
.collection-more-destructive { margin-top:5px; padding-top:5px; border-top:1px solid #e8e8e4; }
.collection-more-destructive button { color:#bf3831; }.collection-more-destructive button:hover { color:#a92822; background:#faf1f0; }
.collection-action-feedback { min-height:16px; margin-top:7px; color:#8a8a85; font-size:11px; }
.collection-people-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 32px clamp(12px,1.3vw,20px); }
.collection-person-skeleton span { width:100%; aspect-ratio:4/5; }
.collection-line-skeleton { font-size:0; }
.collection-title-skeleton { width:min(330px,62vw); height:46px; }
.collection-description-skeleton { width:min(560px,76vw); height:18px; }
.collection-count-skeleton { width:58px; height:12px; }
.collection-followers-skeleton { width:76px; height:12px; }
.collection-owner-name-skeleton { width:72px; height:12px; }
.collection-owner-skeleton { pointer-events:none; }
.collection-owner-skeleton > i { width:30px; height:30px; }
.collection-owner-skeleton > span { width:88px; height:12px; }
.collection-detail-loading .collection-header-actions { visibility:hidden; }
@keyframes collection-skeleton { to { background-position-x:-220%; } }
.collection-people-grid .person-card img,.collection-person-fallback { width:100%; aspect-ratio:4/5; }
.collection-person-fallback { display:grid; place-items:center; border-radius:5px; background:#111; color:#fff; font-size:clamp(30px,5vw,68px); line-height:1; font-weight:600; }

.collection-dialog { width: min(512px,calc(100vw - 28px)); padding: 0; overflow: visible; border: 0; border-radius: 12px; background: transparent; box-shadow: 0 28px 80px rgba(0,0,0,.2); }
.collection-dialog::backdrop { background: rgba(20,20,18,.28); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.collection-dialog-card { overflow: hidden; border-radius: 12px; background: #fff; }
.collection-dialog-card > header { display: flex; height: 70px; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid #e5e5e1; }
.collection-dialog-card h2 { margin: 0; font-size: 16px; font-weight: 560; }
.dialog-close { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.dialog-close:hover { background: #f2f2ef; }
.dialog-close span { font-size: 20px; }
.collection-dialog-body { display: grid; gap: 22px; padding: 24px 22px 30px; }
.collection-dialog-body > label:not(.privacy-toggle) { display: grid; gap: 9px; font-size: 14px; font-weight: 520; }
.collection-dialog input[type="text"],.collection-dialog input[name="title"],.collection-dialog textarea { width: 100%; border: 1px solid transparent; border-radius: 5px; outline: 0; background: #f4f4f2; font-size: 14px; font-weight: 400; }
.collection-dialog input[name="title"] { height: 46px; padding: 0 12px; }
.collection-dialog input[name="title"]:read-only { color: #555550; cursor: default; }
.collection-dialog textarea { min-height: 116px; padding: 12px; resize: vertical; }
.collection-dialog input:focus,.collection-dialog textarea:focus { border-color: #111; background: #fff; }
.privacy-toggle { display: flex; width: fit-content; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.privacy-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.privacy-toggle > span { position: relative; width: 39px; height: 23px; border-radius: 999px; background: #d8d8d4; transition: 180ms ease; }
.privacy-toggle > span::after { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); content: ""; transition: 180ms ease; }
.privacy-toggle input:checked + span { background: #111; }
.privacy-toggle input:checked + span::after { transform: translateX(16px); }
.collection-dialog-card > footer { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 22px; border-top: 1px solid #e5e5e1; }
.collection-dialog-card > footer > div { display: flex; gap: 7px; margin-left: auto; }
.collection-dialog-card footer button { height: 38px; padding: 0 12px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.dialog-delete { border: 1px solid #e2e2dd; background: #fff; color: #e32626; }
.button-secondary { border: 1px solid #deded9; background: #fff; color: #111; }
.button-primary { border: 1px solid #111; background: #111; color: #fff; }

@media (max-width: 1080px) { .collections-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } .collection-people-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 720px) {
  .collections-page { padding-top: 0; }
  .collections-page .sidebar { display: none; }
  .collections-main { padding: 78px 14px 92px; }
  .collections-toolbar { align-items: flex-start; }
  .collection-tabs { gap: 8px; }
  .collection-tabs button { padding: 7px 10px; font-size: 13px; }
  .add-collection-button { width: 38px; padding: 0; justify-content: center; font-size: 0; }
  .collections-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 34px 10px; padding-top: 28px; }
  .collection-card h2 { font-size: 15px; }
  .collection-detail-main { padding: 0 14px 90px; }
  .collection-hero { padding:36px 4px 38px; }
  .collection-hero h1 { font-size:clamp(30px,10vw,40px); }
  .collection-meta { margin-top:11px; gap:6px; font-size:12px; }
  .collection-owner { margin-top:16px; }
  .collection-hero > p { font-size: 15px; }
  .collection-header-actions { width:100%; gap:3px; margin-top:19px; }
  .collection-header-action { min-width:58px; height:42px; padding:0 8px; }
  .follow-collection { height:38px; }
  .collection-more-menu { position:fixed; top:auto; right:14px; bottom:calc(78px + env(safe-area-inset-bottom)); left:14px; width:auto; }
  .collection-people-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px 10px; }
  .collection-dialog-card > footer { align-items: stretch; flex-direction: column-reverse; }
  .collection-dialog-card > footer > div { width: 100%; margin: 0; }
  .collection-dialog-card > footer > div button { flex: 1; }
}
