/* The gallery shares FHUB's type, colour and navigation tokens. */
body:has(#view-themes:not([hidden])) .mkt-hero,
body:has(#view-themes:not([hidden])) .library-discover { display:none; }
body:has(#view-themes:not([hidden])) .mkt-section { padding-top:124px; }
body:has(#gallery-dialog[open]) { overflow:hidden; }
.theme-gallery { --tg-muted:#a2adbe; --tg-line:rgba(255,255,255,.09); color:#f5f6fa; padding-bottom:24px; }
.theme-gallery button,.theme-sheet button { font:inherit; cursor:pointer; }
.theme-gallery-header { display:grid; grid-template-columns:1.35fr 1fr; align-items:end; gap:48px; padding:38px 0 34px; }
.theme-gallery-header h1 { font-size:clamp(36px,4vw,58px); font-weight:750; line-height:1.06; letter-spacing:-.045em; margin:0; }
.theme-gallery-header h1 span { display:block; color:#b7bdfb; }
.theme-gallery-header p { max-width:360px; color:var(--tg-muted); font-size:15px; line-height:1.75; margin:0 0 3px; justify-self:end; }
.theme-tools { display:flex; gap:16px; align-items:center; }
.theme-search-field { min-width:0; flex:1; display:flex; align-items:center; gap:12px; border:1px solid rgba(255,255,255,.13); border-radius:10px; background:#0d0e13; padding:0 16px; }
.theme-search-field:focus-within { border-color:#a2a9ec; box-shadow:0 0 0 3px #b7bdfb12; }
.theme-search-field>svg { color:#abb5c7; width:18px; height:18px; }
.theme-search-field input { min-width:0; flex:1; border:0; background:none; color:#f5f6fa; font:inherit; font-size:14px; padding:17px 0; outline:none!important; box-shadow:none; }
.theme-search-field input::placeholder { color:#929dad; opacity:1; }
.theme-clear { display:grid; place-items:center; width:32px; height:36px; background:none; color:#adb7c7; border:0; }
.theme-sort { display:flex; gap:9px; align-items:center; white-space:nowrap; color:#aeb7c7; font-size:13px; }
.theme-sort select { color:#e0e4ee; background:#0c0d12; border:1px solid var(--tg-line); border-radius:8px; padding:14px 28px 14px 12px; max-width:190px; cursor:pointer; color-scheme:dark; }
.theme-filters { display:flex; flex-wrap:wrap; gap:5px; padding:18px 0 20px; border-bottom:1px solid var(--tg-line); }
.theme-filters button { display:flex; align-items:center; gap:8px; min-height:40px; padding:8px 12px; font-size:13px; border:1px solid transparent; border-radius:7px; color:#b1bbcc; background:transparent; transition:background .15s,color .15s; }
.theme-filters button:hover { color:#fff; background:#ffffff07; }
.theme-filters button[aria-pressed="true"] { color:#e3e5ff; background:#b7bdfb15; border-color:#b7bdfb25; }
.theme-filters button span { font-variant-numeric:tabular-nums; color:#929dad; font-size:11px; }
.theme-results-bar { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:24px 0 20px; }
.theme-results-bar h2 { font-size:15px; font-weight:600; margin:0; }
.theme-results-bar { scroll-margin-top:110px; }
.theme-results-bar h2 span { color:#949fb2; margin-left:8px; font-size:12px; font-weight:400; }
.theme-preview-toggle { display:flex; align-items:center; gap:9px; color:#acb6c6; font-size:12px; cursor:pointer; min-height:36px; }
.theme-preview-toggle input { accent-color:#b7bdfb; width:15px; height:15px; margin:0; }
.theme-gallery-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:36px 24px; }
.theme-gallery-card { min-width:0; position:relative; }
.theme-card-open { display:block; width:100%; padding:0; text-align:left; background:none; color:inherit; border:0; border-radius:12px 12px 4px 4px; }
.theme-card-preview { display:flex; position:relative; align-items:center; justify-content:center; overflow:hidden; width:100%; aspect-ratio:16/10; background:#0d0e14; border:1px solid var(--tg-line); border-radius:12px; isolation:isolate; }
.theme-card-preview img { display:block; width:100%; height:100%; object-fit:cover; object-position:center; transition:transform .4s cubic-bezier(.2,.7,.2,1); }
.theme-card-open:hover .theme-card-preview img { transform:scale(1.025); }
.theme-preview-action { position:absolute; bottom:12px; right:12px; display:flex; gap:7px; align-items:center; padding:8px 10px; border-radius:6px; font-size:11px; color:#fff; background:#08090eeb; opacity:0; transform:translateY(4px); transition:opacity .2s,transform .2s; }
.theme-card-open:is(:hover,:focus-visible) .theme-preview-action { opacity:1; transform:none; }
.theme-card-title { display:flex; justify-content:space-between; align-items:baseline; gap:16px; padding:17px 0 0; font-size:18px; font-weight:650; line-height:1.25; letter-spacing:-.025em; overflow-wrap:anywhere; }
.theme-card-title svg { color:#8490a4; width:14px; height:14px; flex-shrink:0; transition:color .15s,transform .15s; }
.theme-card-open:hover .theme-card-title svg { transform:translate(2px,-2px); color:#d9ddff; }
.theme-card-author { display:inline-block; margin-top:6px; color:#aeb8c9; font-size:12px; line-height:1.5; text-decoration:none; overflow-wrap:anywhere; }
.theme-card-author:hover { color:#e0e3ff; text-decoration:underline; text-underline-offset:3px; }
.theme-card-description { color:#a0abbd; font-size:13px; line-height:1.65; margin:10px 0 11px; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; min-height:43px; }
.theme-card-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px 12px; color:#8b97aa; font-size:11px; line-height:1.65; }
.theme-card-meta ul { display:flex; flex-wrap:wrap; gap:6px; list-style:none; padding:0; margin:0; }
.theme-card-meta li+li::before { content:'·'; margin-right:6px; color:#606c80; }
.theme-no-preview { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px; gap:12px; color:#929eb1; width:100%; height:100%; text-align:center; }
.theme-no-preview strong { font-size:30px; letter-spacing:-.06em; font-weight:500; color:#adb5cd; }
.theme-no-preview span { font-size:11px; max-width:180px; line-height:1.6; }
.theme-preview-label { position:absolute; left:10px; bottom:10px; background:#08090eeb; color:#bdc6d7; border-radius:4px; font-size:10px; padding:5px 7px; }
.theme-pagination { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:7px; margin:42px 0 26px; }
.theme-pagination button { min-width:38px; min-height:40px; padding:8px; display:grid; place-items:center; color:#acb6c8; border:1px solid transparent; border-radius:7px; background:none; font-size:12px; font-variant-numeric:tabular-nums; }
.theme-pagination button:hover:not(:disabled) { background:#ffffff09; color:#fff; }
.theme-pagination button[aria-current="page"] { background:#e3e5ff; color:#13141b; }
.theme-pagination button:disabled { opacity:.3; cursor:default; }
.theme-pagination>span { font-size:12px; color:#7f8a9d; padding:0 4px; }
.theme-empty { text-align:center; padding:70px 20px; }
.theme-empty h3 { font-size:23px; letter-spacing:-.035em; margin:14px 0 8px; }
.theme-empty p { color:#a2adbe; font-size:14px; line-height:1.6; margin:0 0 20px; }
.theme-button { display:inline-flex; gap:9px; align-items:center; justify-content:center; min-height:42px; border:1px solid #ffffff1c; border-radius:7px; background:#ffffff07; padding:11px 15px; color:#e2e6f0; text-decoration:none; font-size:13px; font-weight:500; line-height:1.4; }
.theme-button:hover { background:#ffffff10; border-color:#ffffff30; }
.theme-button--primary { color:#15161e; background:#e5e7ff; border-color:#e5e7ff; }
.theme-button--primary:hover { background:#fff; border-color:#fff; }
.theme-button:disabled { opacity:.5; cursor:progress; }
.theme-gallery-note { display:flex; gap:32px; justify-content:space-between; border-top:1px solid var(--tg-line); margin-top:34px; padding-top:22px; color:#909caf; font-size:12px; line-height:1.8; }
.theme-gallery-note p { max-width:590px; margin:0; }
.theme-gallery-note a { color:#b7bdfb; text-decoration:none; white-space:nowrap; }
.theme-gallery-note a:hover { text-decoration:underline; }
.theme-sheet { width:min(1050px,calc(100% - 48px)); max-height:calc(100dvh - 48px); padding:0; margin:auto; color:#eef0f7; background:#101117; border:1px solid #ffffff26; border-radius:16px; overflow:auto; overscroll-behavior:contain; box-shadow:0 30px 100px #0008; color-scheme:dark; }
.theme-sheet::backdrop { background:#030409d9; backdrop-filter:blur(6px); }
.theme-sheet button:focus-visible,.theme-sheet a:focus-visible,.theme-sheet input:focus-visible { outline:2px solid #b7bdfb; outline-offset:3px; }
.theme-sheet-top { position:relative; background:#08090d; }
.theme-sheet-preview { display:flex; align-items:center; justify-content:center; width:100%; aspect-ratio:16/9; max-height:57dvh; min-height:180px; }
.theme-sheet-preview img { width:100%; height:100%; object-fit:contain; }
.theme-sheet-close { position:absolute; top:14px; right:14px; z-index:2; display:grid; place-items:center; width:40px; height:40px; border-radius:50%; border:1px solid #ffffff33; background:#090a0ff0; color:#eef0f7; }
.theme-sheet-credit { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:10px 28px; color:#919eb4; font-size:11px; border-bottom:1px solid #ffffff0d; }
.theme-sheet-credit a { color:#b7bdfb; }
.theme-sheet-content { display:grid; grid-template-columns:1.3fr 1fr; column-gap:38px; padding:28px 32px 32px; }
.theme-sheet h2 { margin:0 0 7px; font-size:30px; line-height:1.15; letter-spacing:-.035em; overflow-wrap:anywhere; }
.theme-sheet-byline { font-size:13px; color:#9da9bd; }
.theme-sheet-byline a { color:#c3c9ee; text-decoration:none; }
.theme-sheet-byline a:hover { text-decoration:underline; }
.theme-sheet-description { font-size:14px; line-height:1.75; color:#aeb8c9; margin:18px 0; }
.theme-sheet-tags { display:flex; flex-wrap:wrap; gap:10px; color:#b7bdfb; font-size:12px; margin-bottom:22px; }
.theme-sheet-facts { grid-column:1; grid-row:2; display:grid; grid-template-columns:auto 1fr; gap:8px 18px; font-size:12px; line-height:1.6; margin:0; }
.theme-sheet-facts dt { color:#8f9bb0; }
.theme-sheet-facts dd { margin:0; color:#c9d0e0; overflow-wrap:anywhere; }
.theme-sheet-facts a { color:#c3c9ee; }
.theme-sheet-facts summary { cursor:pointer; color:#b7bdfb; }
.theme-sheet-facts details[open] summary { margin-bottom:6px; }
.theme-sheet-facts summary:focus-visible { outline:2px solid #b7bdfb; outline-offset:3px; }
.theme-sheet-install { grid-column:2; grid-row:1/span 2; border-left:1px solid #ffffff12; padding-left:28px; }
.theme-sheet-install h3 { margin:0 0 12px; font-size:14px; font-weight:600; }
.theme-sheet-install p { color:#a2aec3; font-size:12px; line-height:1.75; }
.theme-sheet-actions { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0 14px; }
.theme-import-label { display:block; font-size:11px; color:#9ca9bf; margin-bottom:7px; }
.theme-import-field { display:flex; gap:6px; }
.theme-import-field input { min-width:0; flex:1; background:#08090e; border:1px solid #ffffff1a; border-radius:6px; color:#b5bfd2; font:11px/1.5 monospace; padding:10px; }
.theme-import-field button { padding:10px; }
.theme-sheet-status { min-height:20px; color:#c5cafa!important; margin-bottom:0!important; }
@media(min-width:1500px){ .theme-gallery-grid { gap:38px 28px; } }
@media(max-width:1024px){
  .theme-gallery-header { gap:28px; }
  .theme-gallery-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:30px 22px; }
  .theme-gallery-header h1 { font-size:46px; }
  .theme-filters { gap:2px; }
  .theme-filters button { padding:8px 10px; }
}
@media(max-width:767px){
  body:has(#view-themes:not([hidden])) .mkt-section { padding-top:100px; }
  .theme-gallery-header { grid-template-columns:1fr; gap:16px; padding:24px 0 22px; }
  .theme-gallery-header h1 { font-size:clamp(34px,7vw,46px); }
  .theme-gallery-header p { justify-self:start; max-width:440px; font-size:14px; line-height:1.65; }
  .theme-tools { flex-wrap:wrap; gap:10px; }
  .theme-search-field { flex-basis:100%; }
  .theme-sort { width:100%; justify-content:flex-end; }
  .theme-sort select { padding-top:10px; padding-bottom:10px; }
  .theme-filters { padding:14px 0 17px; }
  .theme-filters button { min-height:42px; }
  .theme-results-bar { padding:15px 0; align-items:center; flex-direction:row; gap:10px; }
  .theme-results-bar h2 span { margin-left:6px; }
  .theme-preview-toggle { min-height:36px; white-space:nowrap; font-size:11px; }
  .theme-gallery-grid { gap:30px 18px; }
  .theme-card-title { font-size:17px; }
  .theme-card-description { font-size:12px; }
  .theme-gallery-note { flex-direction:column; gap:12px; }
  .theme-sheet { width:calc(100% - 20px); max-height:calc(100dvh - 20px); border-radius:12px; }
  .theme-sheet-content { grid-template-columns:1fr; padding:22px; gap:24px; }
  .theme-sheet-install { grid-column:1; grid-row:2; border-left:0; border-top:1px solid #ffffff12; padding:22px 0 0; }
  .theme-sheet-facts { grid-row:3; border-top:1px solid #ffffff12; padding-top:22px; }
  .theme-sheet-tags { margin-bottom:0; }
  .theme-sheet-credit { padding:10px 20px; }
  .theme-sheet-preview { aspect-ratio:16/10; max-height:none; }
  .theme-sheet h2 { font-size:27px; }
}
@media(max-width:540px){
  .theme-gallery-header p { font-size:13px; line-height:1.6; }
  .theme-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; }
  .theme-filters button { justify-content:center; padding:8px 2px; font-size:12px; }
  .theme-filters button span { display:none; }
  .theme-gallery-grid { grid-template-columns:minmax(0,1fr); gap:30px; }
  .theme-card-description { font-size:13px; min-height:0; margin-top:8px; }
  .theme-card-title { font-size:20px; padding-top:14px; }
  .theme-card-author { font-size:13px; }
  .theme-card-meta { font-size:12px; }
  .theme-preview-action { display:none; }
}
@media(prefers-reduced-motion:reduce){
  .theme-gallery *, .theme-sheet * { scroll-behavior:auto!important; animation:none!important; transition:none!important; }
  .theme-card-open:hover .theme-card-preview img { transform:none; }
}
