
/* access */
.access-lock{display:inline-flex;vertical-align:-2px;margin-inline-end:4px;color:var(--text-subtle)}.access-lock .icon{width:14px;height:14px}.access-when{display:none}.access-row .form-help{margin-top:4px}.access-pw{display:flex;gap:8px;justify-content:center;margin-top:12px}.access-pw input{max-width:220px}.access-hidden{margin:12px 0 0;padding:12px 14px;border:1px dashed var(--line);border-radius:var(--radius);background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-sm)}.access-hidden b{color:var(--text)}.access-shown{margin-top:12px;padding:12px 14px;border:1px solid var(--success);border-radius:var(--radius);background:var(--success-soft)}.access-shown > .access-shown-head{display:flex;align-items:center;gap:6px;margin-bottom:6px;color:var(--success);font-size:var(--font-size-sm);font-weight:600}.access-shown .icon{width:15px;height:15px}.access-private{color:var(--text-muted);font-style:italic}

/* announce */
.announce-bar{display:flex;align-items:center;gap:8px;padding:9px 14px;margin-bottom:12px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);font-size:var(--font-size-md)}.announce-icon{display:inline-flex;color:var(--brand);flex:none}.announce-icon svg{width:18px;height:18px}.announce-label{color:var(--brand);flex:none}.announce-list{position:relative;flex:1;min-width:0;height:1.6em;overflow:hidden}.announce-item{position:absolute;inset:0;display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:0;transform:translateY(110%);transition:opacity .35s,transform .35s}.announce-item.on{opacity:1;transform:none}.announce-item.off{opacity:0;transform:translateY(-110%)}.announce-item a{color:var(--text);font-weight:550}.announce-item a:hover{color:var(--brand)}.announce-item time{color:var(--text-subtle);font-size:var(--font-size-xs);flex:none}.announce-nav{display:inline-flex;gap:2px;flex:none;margin-inline-start:auto}.announce-nav button{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:0;border-radius:var(--radius-sm);background:none;color:var(--text-subtle);cursor:pointer;padding:0}.announce-nav button:hover{background:var(--panel-2);color:var(--text)}.announce-nav svg{width:16px;height:16px}[dir="rtl"] .announce-nav svg{transform:scaleX(-1)}.col-right .announce-bar{flex-wrap:wrap}.col-right .announce-list{flex-basis:100%}.col-right .announce-nav{order:-1;margin-inline-start:auto}@media(max-width:640px){.announce-bar{margin:0 calc(-1 * var(--page-x,12px)) 10px;border-radius:0;border-left:0;border-right:0;padding:8px var(--page-x,12px);font-size:var(--font-size-sm)}.announce-item time{display:none}}

/* back_to_top */

    #back-to-top {
      position: fixed;
      bottom: 24px;
      inset-inline-end: 24px;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      background: var(--panel);
      color: var(--text-muted);
      box-shadow: var(--shadow-md);
      cursor: pointer;
      opacity: 0;
      visibility: hidden;
      transform: translateY(10px);
      transition: opacity .2s ease, visibility .2s ease, transform .2s ease, background .12s, color .12s, border-color .12s;
    }
    #back-to-top.show {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
    #back-to-top:hover {
      background: var(--panel-2);
      color: var(--brand);
      border-color: var(--brand);
    }
    #back-to-top .icon {
      width: 18px;
      height: 18px;
    }

/* badge */
.badge-strip{display:inline-flex;align-items:center;gap:3px;vertical-align:middle}.badge-pic{display:inline-block;object-fit:contain;vertical-align:middle}.badge-pic-empty{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--panel-2);border:1px solid var(--line);color:var(--text-muted);font-size:11px;font-weight:700}.badge-more{font-size:var(--font-size-xs);color:var(--text-subtle)}.badge-profile{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px}.badge-profile-label{font-size:var(--font-size-sm);color:var(--text-muted)}.badge-profile .badge-pic{width:34px;height:34px}.badge-profile a{margin-inline-start:auto;font-size:var(--font-size-sm)}.profile-card .badge-profile{margin:0;gap:8px}.profile-card .badge-profile .badge-strip{order:3;flex-basis:100%;flex-wrap:wrap}.profile-card .badge-profile .badge-pic{width:30px;height:30px}.badge-wall{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}.badge-card{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}.badge-card.locked{opacity:.55}.badge-card .badge-pic{width:48px;height:48px;flex:none}.badge-card b{display:block}.badge-card p{margin:2px 0 6px;font-size:var(--font-size-sm);color:var(--text-muted)}.badge-how{font-size:var(--font-size-xs);color:var(--text-subtle)}.badge-have{display:block;margin-top:3px;font-size:var(--font-size-xs);color:var(--brand);font-weight:600}.badge-admin-pic{width:32px;height:32px;object-fit:contain;vertical-align:middle}

/* callouts */
/* ---------------------------------------------------------------- callouts
   Admonition boxes for Markdown, created by the Callouts plugin.
   Source syntax in posts/pages:
       > [!warning]
       > Body text — anything Markdown allows.
   The renderer turns this into:
       <div class="callout callout-warning">
         <div class="callout-head"><svg class="callout-icon">…</svg><span class="callout-label">Warning</span></div>
         <div class="callout-body">…rendered markdown…</div>
       </div>
   Colors come from FlatBB's semantic CSS variables (--info, --success,
   --warning, --danger) so each theme's palette is respected automatically.
*/

.callout {
    --co-color: var(--info, #2563eb);
    --co-soft: var(--info-soft, #dbeafe);
    margin: 16px 0;
    padding: 0;
    border: 1px solid var(--co-color);
    border-left-width: 4px;
    border-radius: var(--radius, 6px);
    background: var(--co-soft);
    overflow: hidden;
}

/* Type variants — only the color tokens change, structure stays identical. */
.callout-note      { --co-color: var(--info,    #2563eb); --co-soft: var(--info-soft,    #dbeafe); }
.callout-tip       { --co-color: var(--success, #16a34a); --co-soft: var(--success-soft, #dcfce7); }
.callout-success   { --co-color: var(--success, #16a34a); --co-soft: var(--success-soft, #dcfce7); }
.callout-warning   { --co-color: var(--warning, #d97706); --co-soft: var(--warning-soft, #fef3c7); }
.callout-danger    { --co-color: var(--danger,  #dc2626); --co-soft: var(--danger-soft,  #fee2e2); }

/* Header bar: icon + label, sits above the body. Uses the callout's color
   for the icon + label text so the type is unmistakable even when scanning. */
.callout-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 6px;
    font-weight: 700;
    color: var(--co-color);
}
.callout-icon { width: 18px; height: 18px; flex: none; }
.callout-label {
    font-size: var(--font-size-sm, 14px);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

/* Body — keeps the same horizontal padding as the head, a touch more vertical.
   Inner paragraphs use the post-content pipeline (so bold/links/lists/code
   all work). The first paragraph's top margin is zeroed so the body sits
   flush with the head, and the last paragraph's bottom margin is zeroed so
   the callout doesn't have an awkward gap at the bottom. */
.callout-body {
    padding: 4px 10px 8px;
    color: var(--text, inherit);
}
.callout-body > *:first-child { margin-top: 0; }
.callout-body > *:last-child { margin-bottom: 0; }

/* Dark theme tweaks — the soft tints get a translucent alpha via the
   --*-soft variables already redefined in [data-theme="dark"], so we don't
   need a separate override here. But the colored border can feel harsh on
   a dark background, so we soften it slightly. */
[data-theme="dark"] .callout,
[data-theme="auto"] .callout {
    border-color: color-mix(in srgb, var(--co-color) 50%, transparent);
}

/* Inside .post-content (post body) the existing rule sets `> :first-child`
   margin to 0 — our callout sits there fine. But inside a blockquote
   (someone nested a callout in a regular quote — unusual but valid),
   the existing blockquote styles would add italic. Undo that. */
blockquote .callout { font-style: normal; }

/* Mobile: tighten the padding so a callout doesn't dominate a small screen. */
@media (max-width: 600px) {
    .callout-head { padding: 8px 10px 4px; }
    .callout-body { padding: 2px 10px 10px; }
}


/* cattabs */
.cattabs-nav{display:flex;flex-wrap:nowrap;gap:.3rem;padding:.25rem;margin-block-end:1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none}
.cattabs-nav::-webkit-scrollbar{display:none}
.cattabs-nav>a{flex:1 0 auto;display:flex;align-items:center;justify-content:center;min-block-size:2.75rem;padding-block:.5rem;padding-inline:1rem;border-radius:var(--radius-sm);color:var(--text-muted);font-size:var(--font-size-sm);font-weight:600;line-height:1.7;text-decoration:none;white-space:nowrap;scroll-snap-align:center}
.cattabs-nav>a:hover{background:var(--panel-2);color:var(--text)}
.cattabs-nav>a.active{background:var(--brand-soft);color:var(--brand)}
.cattabs-nav>a:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.cattabs-warn{color:var(--danger)}
@media(max-width:40rem){.cattabs-nav>a{padding-inline:.8rem;min-block-size:2.6rem}}


/* code_highlight */
.post-content pre code.hljs{background:transparent;padding:0}.post-content pre,.editor-preview pre{position:relative;padding:34px 14px 14px;border-radius:6px;line-height:1.7;tab-size:4}.post-content pre.code-dark,.editor-preview pre.code-dark{background:#22272e;border-color:#2f3742;color:#d6dae1}.post-content pre.has-lines,.editor-preview pre.has-lines{padding-inline-start:56px}.code-lines{position:absolute;top:34px;inset-inline-start:0;width:42px;padding-inline-end:10px;text-align:end;color:var(--text-disabled);white-space:pre;user-select:none;-webkit-user-select:none;pointer-events:none;line-height:inherit;font-size:inherit}.code-dark .code-lines{color:#5b6675;border-inline-end:1px solid #2f3742}.code-copy{position:absolute;top:6px;inset-inline-end:8px;display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--text-muted);font:inherit;font-size:var(--font-size-xs);line-height:1.6;cursor:pointer;opacity:.75;transition:opacity .15s,color .15s,border-color .15s}.code-copy svg{width:13px;height:13px}.code-copy:hover,.code-copy:focus-visible{opacity:1;color:var(--text)}.code-dark .code-copy{border-color:#39424f;background:#2b323b;color:#9aa6b5}.code-dark .code-copy:hover{color:#fff}.code-copy.done{opacity:1;color:var(--success);border-color:var(--success)}.code-dark .code-copy.done{color:#5dd39e;border-color:#3d7f63}@media(max-width:640px){.code-copy span{display:none}.code-copy{padding:4px 6px}}

/* docs */
body.page-docs.no-left.no-right .page-grid{max-width:1360px}.docs-shell{display:grid;grid-template-columns:250px minmax(0,1fr) 210px;gap:28px;align-items:start}.docs-side{position:sticky;top:calc(var(--topbar-h,56px) + 16px);max-height:calc(100vh - var(--topbar-h,56px) - 32px);overflow-y:auto;scrollbar-width:thin;padding-inline-end:6px}.docs-side-head{margin-bottom:10px}.docs-brand{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:var(--font-size-lg);color:var(--text)}.docs-brand svg{width:20px;height:20px;color:var(--brand)}.docs-search{display:flex;align-items:center;gap:6px;padding:0 10px;height:34px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--text-subtle);margin-bottom:12px}.docs-search svg{width:15px;height:15px;flex:none}.docs-search input{border:0;background:none;padding:0;height:100%;min-width:0;flex:1}.docs-search input:focus{outline:0}.docs-spaces{display:flex;flex-direction:column;gap:2px;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--line-soft)}.docs-space{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--radius-sm);color:var(--text-muted);font-weight:500}.docs-space svg{width:16px;height:16px}.docs-space:hover{background:var(--panel-2);text-decoration:none}.docs-space.active{background:var(--brand-soft);color:var(--brand)}.docs-tree{list-style:none;margin:0;padding:0}.docs-tree li{position:relative}.docs-tree a{display:block;padding:5px 30px 5px 8px;border-radius:var(--radius-sm);color:var(--text-muted);font-size:var(--font-size-sm);line-height:1.4}.docs-tree a:hover{background:var(--panel-2);color:var(--text);text-decoration:none}.docs-tree li.active>a{background:var(--brand-soft);color:var(--brand);font-weight:600}.docs-tree .flag{font-size:10px;padding:0 5px;margin-inline-start:4px}.docs-tree-sub{margin-inline-start:12px;padding-inline-start:8px;border-inline-start:1px solid var(--line)}.docs-tree li.has-kids:not(.open)>.docs-tree-sub{display:none}.docs-fold{position:absolute;top:3px;inset-inline-end:2px;width:24px;height:24px;border:0;background:none;color:var(--text-subtle);cursor:pointer;border-radius:4px;display:inline-flex;align-items:center;justify-content:center}.docs-fold svg{width:14px;height:14px;transition:transform .15s;transform:rotate(-90deg)}.docs-tree li.open>.docs-fold svg{transform:none}.docs-fold:hover{background:var(--panel-2);color:var(--text)}.docs-main{min-width:0}.docs-article{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:28px 34px 24px}.docs-crumbs{display:flex;flex-wrap:wrap;gap:6px;font-size:var(--font-size-sm);color:var(--text-subtle);margin-bottom:10px}.docs-crumbs a{color:var(--text-muted)}.docs-article h1{margin:0 0 6px;font-size:1.75rem;line-height:1.25}.docs-lede{margin:0 0 6px;color:var(--text-muted);font-size:var(--font-size-md)}.docs-meta{font-size:var(--font-size-xs);color:var(--text-subtle);margin-bottom:22px;padding-bottom:14px;border-bottom:1px solid var(--line-soft)}.docs-body{font-size:15.5px}.docs-body h2{font-size:1.35rem;margin:1.6em 0 .6em;padding-top:.2em}.docs-body h3{font-size:1.12rem;margin:1.3em 0 .5em}.docs-body h4{font-size:1rem;margin:1.1em 0 .4em}.docs-body h2,.docs-body h3,.docs-body h4{scroll-margin-top:calc(var(--topbar-h,56px) + 18px);position:relative}.docs-anchor{margin-inline-start:6px;color:var(--text-disabled);font-weight:400;text-decoration:none;opacity:0}.docs-body h2:hover .docs-anchor,.docs-body h3:hover .docs-anchor,.docs-body h4:hover .docs-anchor{opacity:1}.docs-body pre{position:relative}.docs-copy-code{position:absolute;top:6px;inset-inline-end:6px;padding:2px 8px;font-size:11px;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--text-muted);cursor:pointer;opacity:0}.docs-body pre:hover .docs-copy-code{opacity:1}.docs-foot{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:32px}.docs-pager{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius-sm);color:inherit}.docs-pager:hover{border-color:var(--brand);text-decoration:none}.docs-pager small{color:var(--text-subtle)}.docs-pager.next{grid-column:2;text-align:end}.docs-pager.prev{grid-column:1}.docs-links{display:flex;flex-wrap:wrap;gap:16px;margin-top:18px;font-size:var(--font-size-sm)}.docs-links a{display:inline-flex;align-items:center;gap:5px;color:var(--text-muted)}.docs-links svg{width:14px;height:14px}.docs-toc{position:sticky;top:calc(var(--topbar-h,56px) + 16px);max-height:calc(100vh - var(--topbar-h,56px) - 32px);overflow-y:auto;font-size:var(--font-size-sm)}.docs-toc-head{font-weight:600;font-size:var(--font-size-xs);text-transform:uppercase;letter-spacing:.04em;color:var(--text-subtle);margin-bottom:8px}.docs-toc-list{list-style:none;margin:0;padding:0;border-inline-start:2px solid var(--line-soft)}.docs-toc-list li a{display:block;padding:4px 10px;color:var(--text-muted);border-inline-start:2px solid transparent;margin-inline-start:-2px;line-height:1.35}.docs-toc-list li.l3 a{padding-inline-start:22px;font-size:var(--font-size-xs)}.docs-toc-list li a:hover{color:var(--text);text-decoration:none}.docs-toc-list li.active>a{color:var(--brand);border-color:var(--brand);font-weight:600}.docs-ai{display:flex;flex-direction:column;gap:6px;margin-top:16px}.docs-ai .btn{justify-content:flex-start}.docs-callout{margin:1em 0;padding:12px 14px;border-radius:var(--radius-sm);border:1px solid var(--line);border-inline-start:4px solid var(--c);background:color-mix(in srgb,var(--c) 7%,var(--panel))}.docs-callout-title{display:flex;align-items:center;gap:6px;font-weight:600;color:var(--c);margin-bottom:4px}.docs-callout-title svg{width:16px;height:16px}.docs-callout-body>:last-child{margin-bottom:0}.docs-callout-tip{--c:#16a34a}.docs-callout-note{--c:#2563eb}.docs-callout-warning{--c:#d97706}.docs-callout-danger{--c:#dc2626}.docs-callout-success{--c:#0d9488}.docs-tabs{margin:1em 0;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden}.docs-tab-list{display:flex;gap:2px;padding:4px;background:var(--panel-2);border-bottom:1px solid var(--line);overflow-x:auto}.docs-tab{border:0;background:none;padding:6px 12px;border-radius:4px;color:var(--text-muted);font:inherit;font-size:var(--font-size-sm);cursor:pointer;white-space:nowrap}.docs-tab.active{background:var(--panel);color:var(--brand);font-weight:600;box-shadow:var(--shadow)}.docs-tab-panel{padding:12px 14px}.docs-tab-panel>:last-child{margin-bottom:0}.docs-steps{counter-reset:s;margin:1em 0;padding:0}.docs-step{position:relative;padding:0 0 18px 42px;border-inline-start:2px solid var(--line-soft);margin-inline-start:14px}.docs-step:last-child{border-color:transparent;padding-bottom:0}.docs-step::before{counter-increment:s;content:counter(s);position:absolute;inset-inline-start:-15px;top:-2px;width:28px;height:28px;border-radius:50%;background:var(--brand);color:#fff;font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:center}.docs-step-title{font-weight:600;margin-bottom:4px;line-height:1.7}.docs-step-body>:last-child{margin-bottom:0}.docs-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin:1em 0}.docs-card{display:flex;gap:12px;padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);color:inherit}.docs-card-link:hover{border-color:var(--brand);text-decoration:none;box-shadow:var(--shadow-md)}.docs-card-icon{display:inline-flex;width:34px;height:34px;border-radius:8px;background:var(--brand-soft);color:var(--brand);align-items:center;justify-content:center;flex:none}.docs-card-icon svg{width:18px;height:18px}.docs-card-text{min-width:0}.docs-card-text b{display:block;margin-bottom:2px}.docs-card-text p{margin:0;color:var(--text-muted);font-size:var(--font-size-sm)}.docs-card-text small{color:var(--text-subtle)}.docs-details{margin:1em 0;border:1px solid var(--line);border-radius:var(--radius-sm);padding:0 14px}.docs-details summary{padding:10px 0;font-weight:600;cursor:pointer}.docs-details-body{padding:0 0 12px}.docs-details-body>:last-child{margin-bottom:0}.docs-block{margin:1em 0;padding:12px 14px;border:1px dashed var(--line);border-radius:var(--radius-sm)}.docs-block-title{font-weight:600;margin-bottom:6px}.docs-hero{padding:34px 36px;border-radius:18px;color:#fff;background:linear-gradient(135deg,var(--brand) 0%,color-mix(in srgb,var(--brand) 55%,#2563eb) 100%);margin-bottom:20px}.docs-hero h1{display:flex;align-items:center;gap:10px;margin:0 0 6px;color:#fff;font-size:1.7rem}.docs-hero h1 svg{width:30px;height:30px}.docs-hero p{margin:0 0 16px;opacity:.9;max-width:560px}.docs-hero-search{display:flex;align-items:center;gap:8px;max-width:560px;background:#fff;border-radius:999px;padding:4px 4px 4px 14px;color:var(--text-subtle)}.docs-hero-search svg{width:18px;height:18px;flex:none}.docs-hero-search input{flex:1;border:0;background:none;padding:8px 0;min-width:0;color:#1f2328}.docs-hero-search input:focus{outline:0}.docs-hero-search .btn{border-radius:999px}.docs-search-big{background:var(--panel-2);margin:12px 0 20px;max-width:none}.docs-search-big input{color:var(--text)}.docs-space-cards{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));margin:0 0 20px}.docs-space-card{padding:18px}.docs-recent{list-style:none;margin:0;padding:0}.docs-recent li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--line-soft)}.docs-recent li:last-child{border:0}.docs-recent .muted{font-size:var(--font-size-sm);white-space:nowrap}.docs-results{list-style:none;margin:0;padding:0}.docs-results li{padding:12px 0;border-bottom:1px solid var(--line-soft)}.docs-results li a{display:flex;justify-content:space-between;gap:12px}.docs-results li p{margin:4px 0 0;color:var(--text-muted);font-size:var(--font-size-sm)}.docs-results mark{background:var(--brand-soft);color:var(--brand);padding:0 2px;border-radius:2px}.docs-menu-btn{display:none}.docs-scrim{position:fixed;inset:0;background:var(--backdrop);z-index:110}@media(max-width:1100px){.docs-shell{grid-template-columns:230px minmax(0,1fr)}.docs-toc{display:none}}@media(max-width:820px){.docs-shell{grid-template-columns:minmax(0,1fr)}.docs-menu-btn{display:inline-flex;margin-bottom:10px}.docs-side{position:fixed;top:0;bottom:0;inset-inline-start:0;width:290px;max-width:85vw;max-height:none;background:var(--panel);padding:16px;z-index:120;transform:translateX(-100%);transition:transform .2s;box-shadow:var(--shadow-md)}[dir=rtl] .docs-side{transform:translateX(100%)}.docs-side.open{transform:none}.docs-article{padding:18px 16px}.docs-foot{grid-template-columns:1fr}.docs-pager.next{grid-column:1}.docs-hero{padding:22px 18px}.docs-hero h1{font-size:1.3rem}}

/* drafts */
.drafts-status{margin-inline-start:8px;align-self:center}.drafts-save{white-space:nowrap}.drafts-ask{position:fixed;inset:0;z-index:220;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.45);padding:16px}.drafts-ask-box{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-md);padding:20px 22px;max-width:440px;width:100%}.drafts-ask-box h3{margin:0 0 6px;font-size:1.05em}.drafts-ask-box p{margin:0 0 16px;color:var(--text-muted)}.drafts-ask-row{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.drafts-list{display:grid;gap:8px}.drafts-item{display:flex;align-items:center;gap:12px;padding:12px 14px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius)}.drafts-item{min-width:0}.drafts-main{flex:1;min-width:0;overflow:hidden}.drafts-main .small{overflow-wrap:anywhere;word-break:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.drafts-title{font-weight:600;color:var(--text)}.drafts-title:hover{color:var(--brand)}.drafts-item .row-actions{display:flex;gap:6px;flex:none}@media(max-width:640px){.drafts-item{flex-wrap:wrap}}

/* featured */
.featured-label{display:inline-block;margin-inline-end:6px;padding:0 6px;border-radius:5px;background:color-mix(in srgb,var(--warning) 16%,transparent);color:color-mix(in srgb,var(--warning) 72%,var(--text));font-size:var(--font-size-xs);font-weight:600;line-height:1.7;vertical-align:.12em;white-space:nowrap}.topic-title .featured-label{font-size:var(--font-size-sm);vertical-align:.28em}.featured-bold{font-weight:700}.featured-red,.featured-red a{color:#d93025}.featured-orange,.featured-orange a{color:#e7672e}.featured-green,.featured-green a{color:#188038}.featured-blue,.featured-blue a{color:#1a73e8}.featured-purple,.featured-purple a{color:#7b3fe4}.featured-menu{position:relative;display:inline-block}.featured-menu summary{list-style:none;cursor:pointer}.featured-menu summary::-webkit-details-marker{display:none}.featured-form{position:absolute;inset-inline-start:0;top:calc(100% + 6px);z-index:30;min-width:230px;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 8px 24px rgba(0,0,0,.12)}.featured-form .form-row{margin-bottom:8px}.featured-form select{width:100%}.featured-buttons{display:flex;flex-wrap:wrap;gap:6px}.topic-bar .featured-form{inset-inline-start:auto;inset-inline-end:0}

/* follow */
.follow-you{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:6px;background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs);font-weight:400;vertical-align:middle}.follow-list .follow-row{display:flex;align-items:center;gap:12px;padding:12px 16px;border-top:1px solid var(--line-soft)}.follow-list .follow-row:first-child{border-top:0}.follow-row-main{flex:1;min-width:0}.follow-row-name{font-weight:600}.follow-bio{color:var(--text-muted);font-size:var(--font-size-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.follow-row .member-action-form{margin:0;flex:none}[data-action=follow]:not(.is-done):not(.btn-primary){color:var(--brand);border-color:var(--brand)}[data-action=follow].is-done:hover{color:var(--danger);border-color:var(--danger);background:var(--danger-soft)}.follow-suggest{border-bottom:1px solid var(--line-soft)}.follow-suggest-head{padding:12px 16px 0;color:var(--text-muted);font-size:var(--font-size-sm)}

/* gacha */
/* Gacha — 插件样式(由 core/plugin.php 的 plugin_assets_build 读取,合并进 data/cache/plugins.css) */
/* 稀有度配色阶梯(按设计稿):N 冷石板灰 / R 青绿 / SR 宝蓝 / SSR 亮金橙(独占金色) / UR 红粉 / Special 彩虹。
   集中成插件专属变量:fg=文字色,border=边框/accent,bg=称号卡浅渐变,shadow=卡投影(SSR/UR 含辉光),g1/g2=按钮饱和渐变两端。
   称号卡 bg 与 fg 同为浅色系自包含,故浅色/深色主题下都直接可读。 */
:root{
  --gacha-n:#3a4256;   --gacha-n-border:#8b95a8;  --gacha-n-bg:linear-gradient(160deg,#f4f6f9,#e3e7ed);  --gacha-n-shadow:0 4px 14px -4px rgba(90,100,120,.18);  --gacha-n-g1:#94a3b8;  --gacha-n-g2:#64748b;
  --gacha-r:#1e5e40;   --gacha-r-border:#4caf7d;  --gacha-r-bg:linear-gradient(160deg,#eaf7f0,#d4f0e2);  --gacha-r-shadow:0 4px 14px -4px rgba(40,140,90,.22);   --gacha-r-g1:#34d399;  --gacha-r-g2:#10b981;
  --gacha-sr:#2a3f9e;  --gacha-sr-border:#5b7cfa; --gacha-sr-bg:linear-gradient(160deg,#eef2ff,#d8e2ff); --gacha-sr-shadow:0 4px 14px -4px rgba(60,90,220,.22);  --gacha-sr-g1:#7c93ff; --gacha-sr-g2:#4f6ef7;
  --gacha-ssr:#7a4a00; --gacha-ssr-border:#ffb020;--gacha-ssr-bg:linear-gradient(160deg,#fff8e6,#ffe4a3);--gacha-ssr-shadow:0 4px 18px -4px rgba(255,150,40,.35),0 0 16px rgba(255,176,32,.45); --gacha-ssr-g1:#ffd45e; --gacha-ssr-g2:#ffab2e;
  --gacha-ur:#8a1f1f;  --gacha-ur-border:#ff5252; --gacha-ur-bg:linear-gradient(160deg,#fff0f0,#ffd0d0); --gacha-ur-shadow:0 4px 18px -4px rgba(255,80,80,.3),0 0 14px rgba(255,82,82,.35); --gacha-ur-g1:#ff7b7b;  --gacha-ur-g2:#ff5252;
  --gacha-special:#ffffff; --gacha-special-border:rgba(255,255,255,.6); --gacha-special-bg:linear-gradient(135deg,#ff6b6b,#ffb347,#ffe66d,#6bff9e,#4dd4ff,#8f7bff,#ff6bd6); --gacha-special-shadow:0 4px 20px -4px rgba(150,100,255,.4),0 0 18px rgba(180,139,255,.45);
}
.gacha-collection, .gacha-pool-card {margin-top:16px}
.gacha-draw-card .card-body{display:block}
/* 抽卡按钮:三张大号渐变卡(设计稿提供)。选择器限定在 .gacha-draw-card 内,避免污染全局。 */
.gacha-draw-card .gacha-draw-form{display:contents}
.gacha-draw-card .draw-buttons{display:flex;gap:16px;flex-wrap:wrap;justify-content:center;padding:12px 0}
.gacha-draw-card .draw-btn{position:relative;flex:1 1 160px;max-width:158px;min-height:96px;border:none;border-radius:16px;cursor:pointer;padding:18px 16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#fff;font-family:inherit;overflow:hidden;transition:transform .18s ease,box-shadow .18s ease,filter .18s ease;box-shadow:0 6px 18px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.35)}
.gacha-draw-card .draw-btn::after{content:"";position:absolute;top:-60%;left:-30%;width:60%;height:220%;background:linear-gradient(120deg,transparent,rgba(255,255,255,.45),transparent);transform:rotate(18deg);transition:left .5s ease;pointer-events:none}
.gacha-draw-card .draw-btn:hover::after{left:120%}
.gacha-draw-card .draw-btn:hover{transform:translateY(-3px);filter:brightness(1.06)}
.gacha-draw-card .draw-btn:active{transform:translateY(0) scale(.98)}
.gacha-draw-card .draw-btn__label{font-size:18px;font-weight:700;letter-spacing:1px;text-shadow:0 1px 2px rgba(0,0,0,.25)}
.gacha-draw-card .draw-btn__cost{font-size:13px;opacity:.92;padding:2px 10px;border-radius:999px;background:rgba(0,0,0,.18)}
.gacha-draw-card .draw-btn__badge{position:absolute;top:8px;right:8px;font-size:11px;font-weight:700;padding:2px 8px;border-radius:999px;background:#ffe066;color:#6b4e00;box-shadow:0 2px 6px rgba(0,0,0,.2)}
.gacha-draw-card .draw-btn--single{background:linear-gradient(135deg,#4facfe 0%,#00c6ff 100%)}
.gacha-draw-card .draw-btn--ten{background:linear-gradient(135deg,#a855f7 0%,#ec4899 100%)}
.gacha-draw-card .draw-btn--hundred{background:linear-gradient(135deg,#f7971e 0%,#ffd200 100%);color:#4a2c00;text-shadow:none}
.gacha-draw-card .draw-btn--hundred .draw-btn__label{text-shadow:0 1px 1px rgba(255,255,255,.4)}
.gacha-draw-card .draw-btn--hundred .draw-btn__cost{background:rgba(0,0,0,.12)}
.gacha-draw-card .draw-btn[disabled]{opacity:.45;cursor:not-allowed;pointer-events:none}
@media (max-width:560px){.gacha-draw-card .draw-buttons{gap:12px}.gacha-draw-card .draw-btn{flex:1 1 100%;max-width:none;min-height:80px}}
.gacha-balance{display:flex;justify-content: center;align-items:center;gap:6px;margin:var(--space-sm,16px) 0 0}
.gacha-balance b{font-weight:700}
.gacha-reveal{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;margin-block-start:var(--space-sm,8px)}
.gacha-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:14px 8px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);text-align:center;animation:gacha-flip .4s ease}
.gacha-card-emoji{font-size:2rem;line-height:1}
.gacha-card-name{font-weight:600}
.gacha-card-rar{font-size:var(--font-size-xs);letter-spacing:.05em;opacity:.7}
.gacha-card-new,.gacha-card-dup{font-size:var(--font-size-xs);padding:1px 6px;border-radius:999px}
.gacha-card-new{background:var(--success-soft);color:var(--success)}
.gacha-card-dup{background:var(--panel-2);color:var(--text-muted)}
@keyframes gacha-flip{from{transform:rotateX(90deg);opacity:0}to{transform:none;opacity:1}}
.gacha-group{margin-block-start:var(--space-md,16px)}
.gacha-group h4{margin:0 0 8px;font-size:var(--font-size-sm);letter-spacing:.05em}
.gacha-group h4 small{opacity:.6;font-weight:400}
.gacha-grid{display:flex;flex-wrap:wrap;gap:8px}
.gacha-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid var(--line);border-radius:999px;background:var(--panel);font-size:var(--font-size-sm)}
.gacha-chip-emoji{font-style:normal}
.gacha-chip.worn{box-shadow:0 0 0 1px var(--brand) inset}
.gacha-chip.locked{opacity:.45;filter:grayscale(1)}
.gacha-wear-form{margin:0}
.gacha-worn-btn{background:var(--brand);color:#fff;border-color:var(--brand)}
.gacha-worn-tag{font-size:var(--font-size-xs);opacity:.7}
.gacha-label{display:inline-flex;align-items:center;gap:3px;margin-inline-start:6px;padding:1px 8px;border-radius:999px;font-size:var(--font-size-xs);font-weight:600;vertical-align:middle}
.gacha-label i{font-style:normal}
.gacha-count{font-weight:400}
/* 称号池概览:每个稀有度一格(左侧强调色条 + 名称 + 数量 ×N + 机率胶囊)。
   配色取自插件稀有度变量(--gacha-*),与 chip 同色系、随整条阶梯一致。 */
.gacha-pool{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.gacha-pool-card .gacha-pool-item{--accent:var(--text-muted);position:relative;display:flex;align-items:center;gap:10px;padding:12px 14px 12px 18px;border:1px solid var(--line-soft);border-radius:var(--radius-sm);background:var(--panel-2);color:var(--text);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.gacha-pool-card .gacha-pool-item::before{content:"";position:absolute;inset-block:10px;inset-inline-start:0;width:3px;border-radius:3px;background:var(--accent)}
.gacha-pool-card .gacha-pool-item:hover{transform:translateY(-2px);border-color:var(--accent);box-shadow:var(--shadow-md)}
.gacha-pool-rar{font-size:var(--font-size-sm);font-weight:600;letter-spacing:.03em;color:var(--accent);min-width:45px}
.gacha-pool-count{font-size:var(--font-size-sm);color:var(--text-muted);margin-inline-start:auto}
.gacha-pool-count::before{content:'\00d7';margin-inline-end:2px;color:var(--text-disabled)}
.gacha-pool-odds{font-size:var(--font-size-sm);color:var(--text);padding:2px 8px;border-radius:var(--radius-pill);background:color-mix(in srgb,var(--accent) 12%,var(--panel))}
.gacha-pool-item.gacha-n{--accent:var(--gacha-n-border)}
.gacha-pool-item.gacha-r{--accent:var(--gacha-r-border)}
.gacha-pool-item.gacha-sr{--accent:var(--gacha-sr-border)}
.gacha-pool-item.gacha-ssr{--accent:var(--gacha-ssr-border)}
.gacha-pool-item.gacha-ur{--accent:var(--gacha-ur-border)}
.gacha-pool-item.gacha-special{--accent:#8f7bff}
@media (max-width:480px){.gacha-pool{grid-template-columns:1fr}}
/* 稀有度称号外观:文字取 fg、边框取 border、底色取浅渐变 bg;chip/card 带投影(SSR/UR 含辉光),label 保持轻量 */
.gacha-n{color:var(--gacha-n)}
.gacha-r{color:var(--gacha-r)}
.gacha-sr{color:var(--gacha-sr)}
.gacha-ssr{color:var(--gacha-ssr)}
.gacha-ur{color:var(--gacha-ur)}
.gacha-special{color:var(--gacha-special)}
.gacha-chip.gacha-n,.gacha-card.gacha-n{background:var(--gacha-n-bg);border-color:var(--gacha-n-border);box-shadow:var(--gacha-n-shadow)}
.gacha-chip.gacha-r,.gacha-card.gacha-r{background:var(--gacha-r-bg);border-color:var(--gacha-r-border);box-shadow:var(--gacha-r-shadow)}
.gacha-chip.gacha-sr,.gacha-card.gacha-sr{background:var(--gacha-sr-bg);border-color:var(--gacha-sr-border);box-shadow:var(--gacha-sr-shadow)}
.gacha-chip.gacha-ssr,.gacha-card.gacha-ssr{background:var(--gacha-ssr-bg);border-color:var(--gacha-ssr-border);box-shadow:var(--gacha-ssr-shadow)}
.gacha-chip.gacha-ur,.gacha-card.gacha-ur{background:var(--gacha-ur-bg);border-color:var(--gacha-ur-border);box-shadow:var(--gacha-ur-shadow)}
.gacha-label.gacha-n{background:var(--gacha-n-bg);border-color:var(--gacha-n-border)}
.gacha-label.gacha-r{background:var(--gacha-r-bg);border-color:var(--gacha-r-border)}
.gacha-label.gacha-sr{background:var(--gacha-sr-bg);border-color:var(--gacha-sr-border)}
.gacha-label.gacha-ssr{background:var(--gacha-ssr-bg);border-color:var(--gacha-ssr-border)}
.gacha-label.gacha-ur{background:var(--gacha-ur-bg);border-color:var(--gacha-ur-border)}
/* SSR/UR 称号名发光 */
.gacha-card.gacha-ssr .gacha-card-name{text-shadow:0 0 10px rgba(255,176,32,.7)}
.gacha-card.gacha-ur .gacha-card-name{text-shadow:0 0 8px rgba(255,82,82,.5)}
/* Special 彩虹:流动渐变底 + 深色蒙版压光,文字白色带投影;card 保留翻牌动画,chip/card 需 relative 承载蒙版 */
.gacha-card.gacha-special,.gacha-chip.gacha-special{position:relative;border-color:var(--gacha-special-border);box-shadow:var(--gacha-special-shadow);background:var(--gacha-special-bg);background-size:300% 300%;color:var(--gacha-special);animation:gacha-special-shift 4s ease infinite}
.gacha-card.gacha-special{animation:gacha-flip .4s ease,gacha-special-shift 4s ease infinite}
.gacha-label.gacha-special{background:var(--gacha-special-bg);color:var(--gacha-special);border-color:var(--gacha-special-border)}
.gacha-card.gacha-special>*,.gacha-chip.gacha-special>*{position:relative;z-index:2}
.gacha-card.gacha-special::before,.gacha-chip.gacha-special::before{content:'';position:absolute;inset:0;z-index:1;border-radius:inherit;background:rgba(20,10,40,.18);pointer-events:none}
.gacha-card.gacha-special .gacha-card-name,.gacha-card.gacha-special .gacha-card-rar,.gacha-chip.gacha-special,.gacha-label.gacha-special{text-shadow:0 1px 4px rgba(0,0,0,.35)}
@keyframes gacha-special-shift{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
.gacha-side .btn{margin-block-start:8px;width:100%;justify-content:center}
.gacha-side{display:flex;flex-direction:column}
.gacha-more{opacity:.6}
.gacha-more:hover{opacity:1}
.gacha-reveal.no-anim .gacha-card{animation:none}
.gacha-pity{margin-block-start:6px}
.gacha-lv{margin-inline-start:4px;font-size:var(--font-size-xs);font-weight:700;opacity:.85}
.gacha-qty{margin-inline-start:4px;font-size:var(--font-size-xs);font-weight:700;color:var(--text-muted)}
.gacha-qty::before{content:'\00d7';margin-inline-end:1px}
.gacha-broadcast{display:flex;align-items:center;gap:8px;padding:8px 12px;margin-block-end:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);font-size:var(--font-size-sm)}
.gacha-broadcast svg{width:18px;height:18px;color:var(--brand);flex:none}
.gacha-broadcast-list{display:flex;flex-wrap:wrap;gap:12px;min-width:0}
.gacha-broadcast-item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
/* 熔炼面板:上方三档配方按钮(N/R/SR,汇总文案 + 可熔态),下方材料选择(勾选 + 消耗数量)。选择器限定在 .gacha-smelt-card 内。 */
.gacha-smelt-card{margin-top:16px}
.gacha-smelt-card .card-body{display:block}
.gacha-smelt-hint{margin:0 0 14px}
/* 三档熔炼配方按钮:仿抽卡按钮(圆角渐变卡 + 悬停扫光 + 白字大号),三个等宽并排在一行。
   稀有度类限定在 .gacha-smelt-btn 上,避免全局 .gacha-n/.gacha-r/.gacha-sr 影响 chip/图鉴;
   渐变取自插件稀有度变量(--gacha-*-g1/g2),与整条阶梯一致。 */
.gacha-smelt-recipes{display:flex;flex-wrap:nowrap;align-items:stretch;gap:12px;width:100%;margin:0 auto 18px}
.gacha-smelt-btn{position:relative;flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:104px;border:none;border-radius:16px;padding:12px 8px;color:#fff;font-family:inherit;font-weight:600;text-align:center;cursor:not-allowed;overflow:hidden;transition:transform .18s ease,box-shadow .18s ease,filter .18s ease,opacity .18s ease;box-shadow:0 6px 18px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.35)}
.gacha-smelt-btn:not([disabled]){cursor:pointer}
/* 悬停扫光(与抽卡按钮同款) */
.gacha-smelt-btn::after{content:"";position:absolute;top:-60%;left:-30%;width:60%;height:220%;background:linear-gradient(120deg,transparent,rgba(255,255,255,.45),transparent);transform:rotate(18deg);transition:left .5s ease;pointer-events:none}
.gacha-smelt-btn:not([disabled]):hover::after{left:120%}
.gacha-smelt-btn:not([disabled]):hover{transform:translateY(-3px);filter:brightness(1.06)}
.gacha-smelt-btn:not([disabled]):active{transform:translateY(0) scale(.98)}
.gacha-smelt-btn[disabled]{opacity:.45}
/* 熔炼公式标题(仿抽卡 label:大号粗体,单行不换行) */
.gacha-smelt-recipe{position:relative;z-index:2;max-width:100%;font-size:18px;font-weight:700;letter-spacing:1px;line-height:1.3;white-space:nowrap;text-shadow:0 1px 2px rgba(0,0,0,.25)}
/* 信息行(仿抽卡 cost:半透明胶囊,已选/可熔实时汇总) */
.gacha-smelt-line{position:relative;z-index:2;max-width:100%;font-size:13px;line-height:1.4;padding:2px 10px;border-radius:999px;background:rgba(0,0,0,.18);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gacha-smelt-line.muted{opacity:.82}
/* 第二行(消耗/产出):不用的胶囊,弱化为小号副标题,与第一行拉开主次 */
.gacha-smelt-btn .gacha-smelt-sub{background:transparent;padding:0;font-size:12px;font-weight:600;opacity:.9}
/* 稀有度渐变按钮(N 石板灰 / R 青绿 / SR 宝蓝 / SSR 亮金橙):填充取饱和 g1→g2,SSR 金底配深字保证对比 */
.gacha-smelt-btn.gacha-n{background:linear-gradient(135deg,var(--gacha-n-g1) 0%,var(--gacha-n-g2) 100%)}
.gacha-smelt-btn.gacha-r{background:linear-gradient(135deg,var(--gacha-r-g1) 0%,var(--gacha-r-g2) 100%)}
.gacha-smelt-btn.gacha-sr{background:linear-gradient(135deg,var(--gacha-sr-g1) 0%,var(--gacha-sr-g2) 100%)}
.gacha-smelt-btn.gacha-ssr{background:linear-gradient(135deg,var(--gacha-ssr-g1) 0%,var(--gacha-ssr-g2) 100%);color:#5a3600;text-shadow:none}
.gacha-smelt-btn.gacha-ssr .gacha-smelt-recipe{text-shadow:0 1px 1px rgba(255,255,255,.5)}
.gacha-smelt-btn.gacha-ssr .gacha-smelt-line{background:rgba(90,54,0,.16)}
/* 回收:单个 SSR 配方按钮,容器收窄居中,避免一个按钮被拉满整行。 */
.gacha-recycle-recipes{max-width:520px;justify-content:center}
@media (max-width:600px){.gacha-smelt-recipes{gap:8px}.gacha-smelt-btn{min-height:82px;padding:12px 6px}.gacha-smelt-recipe{font-size:13px;letter-spacing:0}.gacha-smelt-line{font-size:11px;padding:2px 6px}}
@media (prefers-reduced-motion:reduce){.gacha-smelt-btn{transition:none}.gacha-smelt-btn::after{animation:none;transition:none}.gacha-card.gacha-special,.gacha-chip.gacha-special{animation:none}}
.gacha-smelt-materials h4{margin:0 0 10px;font-size:var(--font-size-xl)}
/* 熔炼材料按稀有度分组(N / R / SR):每个小标题做成胶囊标签,用稀有度本身的背景色,组间留出间距。 */
.gacha-smelt-group{margin-block-start:12px}
.gacha-smelt-group:first-of-type{margin-block-start:0}
.gacha-smelt-materials .gacha-smelt-group h4{display:inline-flex;align-items:center;gap:6px;margin:0 0 8px;padding:2px 10px;border-radius:999px;font-size:var(--font-size-sm);font-weight:700;letter-spacing:.05em}
.gacha-smelt-materials .gacha-smelt-group h4 small{opacity:.6;font-weight:400}
.gacha-smelt-group h4.gacha-n{background:var(--gacha-n-bg)}
.gacha-smelt-group h4.gacha-r{background:var(--gacha-r-bg)}
.gacha-smelt-group h4.gacha-sr{background:var(--gacha-sr-bg)}
/* 回收警示:回收不可恢复,用警告色提醒确认数量。 */
.gacha-recycle-warn{margin:0 0 10px;color:var(--warning);font-size:var(--font-size-sm)}
/* 材料行:扁平可选列表(无卡片边框与强调条),与上方配方按钮卡片明显区分;每行 2 个。 */
.gacha-smelt-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.gacha-smelt-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid transparent;border-radius:var(--radius-sm);background:transparent;cursor:pointer;transition:background .14s ease,border-color .14s ease}
.gacha-smelt-item:hover{background:var(--panel-2);border-color:var(--text-disabled)}
.gacha-smelt-item.is-selected{border-color:var(--brand);background:var(--brand-soft)}
.gacha-smelt-item input[type=checkbox]{margin:0;cursor:pointer;flex:none}
.gacha-smelt-name{font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gacha-smelt-qty{margin-inline-start:auto;flex:none;font-size:var(--font-size-xs);white-space:nowrap;color:var(--text-muted)}
/* 数量输入需胜过 app.css 的全局 input[type=number]{width:100%}(0-1-1),故用 0-2-0 选择器并锁死宽度。 */
.gacha-smelt-item .gacha-smelt-amt{flex:none;width:56px;max-width:56px;padding:2px 6px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2);color:var(--text);font-size:var(--font-size-sm);text-align:center}
.gacha-smelt-item .gacha-smelt-amt[disabled]{opacity:.4}
@media (max-width:480px){.gacha-smelt-list{grid-template-columns:1fr}}


/* growth */
/* Growth: the pages (head and tabs, hero, overview boxes, calendar, leaderboards, levels) and the sidebar card. */
.growth-page{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.growth-page>*{min-width:0}
.growth-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.growth-head h1{margin:0;font-size:var(--font-size-2xl)}
.growth-tabs{margin:0}
.growth-pill{display:inline-block;padding:0 6px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600;line-height:1.6;white-space:nowrap;vertical-align:middle}
/* buttons */
.growth-go{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 18px;height:40px;border:0;border-radius:999px;background:var(--brand);color:var(--brand-text,#fff);font:inherit;font-weight:650;cursor:pointer;box-shadow:0 4px 12px color-mix(in srgb,var(--brand) 25%,transparent);transition:transform .12s}
.growth-go:hover{transform:translateY(-1px);color:var(--brand-text,#fff);text-decoration:none}
.growth-go:disabled{opacity:.7;cursor:default;transform:none}
.growth-go svg,.growth-done svg{width:17px;height:17px}
.growth-go b{padding:1px 8px;border-radius:999px;background:color-mix(in srgb,#fff 24%,transparent);font-size:var(--font-size-sm)}
.growth-done{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border-radius:999px;background:var(--success-soft);color:var(--success);font-weight:650}
.growth-done:hover{color:var(--success);text-decoration:none}
/* layout: two columns on wide screens, one below 900px */
.growth-top2{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:14px}
.growth-split{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:14px;align-items:start}
.growth-split-cal{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}
.growth-col{display:flex;flex-direction:column;gap:14px;min-width:0}
/* the warm cards (the streak, the level): the one tinted surface of a page */
.growth-warm{padding:16px 18px;border-radius:var(--radius);background:var(--brand-soft);color:color-mix(in srgb,var(--brand) 55%,var(--text))}
.growth-warm-line{display:flex;align-items:center;gap:6px;margin:0;font-size:var(--font-size-sm)}
.growth-warm-line svg{width:16px;height:16px;flex:none}
.growth-warm .growth-go{box-shadow:none}
.growth-streak-num{display:flex;align-items:baseline;gap:8px;margin-top:12px;color:color-mix(in srgb,var(--brand) 35%,var(--text))}
.growth-streak-num svg{width:22px;height:22px;align-self:center;color:var(--brand)}
.growth-streak-num b{font-size:2rem;font-weight:600;line-height:1}
.growth-streak-num span{font-size:var(--font-size-sm)}
.growth-steps{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-top:14px}
.growth-seg{text-align:center;font-size:var(--font-size-xs);line-height:1.3}
.growth-seg i{display:block;height:6px;margin-bottom:5px;border-radius:3px;background:color-mix(in srgb,var(--brand) 22%,transparent)}
.growth-seg.on i{background:var(--brand)}
.growth-seg span{display:inline-flex;align-items:center;gap:2px}
.growth-seg svg{width:12px;height:12px}
.growth-level-top{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.growth-level-top b{font-size:1.75rem;font-weight:600;line-height:1;color:color-mix(in srgb,var(--brand) 35%,var(--text))}
.growth-level-top small{margin-inline-start:auto;font-size:var(--font-size-xs)}
.growth-warm-bar{height:8px;margin:14px 0 6px;border-radius:4px;background:color-mix(in srgb,var(--brand) 22%,transparent);overflow:hidden}
.growth-warm-bar i{display:block;height:100%;border-radius:inherit;background:var(--brand)}
.growth-level p{margin:0;font-size:var(--font-size-xs)}
/* my card and the three numbers (overview) */
.growth-me .card-body{display:flex;align-items:center;gap:14px;height:100%}
.growth-me-main{flex:1;min-width:0}
.growth-me-name{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.growth-me-name .user-link{font-size:var(--font-size-md);font-weight:600}
.growth-lvtag{padding:1px 8px;border:1px solid color-mix(in srgb,var(--brand) 40%,var(--line));border-radius:999px;color:var(--brand);font-size:var(--font-size-xs);font-weight:600;white-space:nowrap}
.growth-me-main small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-thin{display:block;height:6px;margin:10px 0 6px;border-radius:3px;background:var(--line);overflow:hidden}
.growth-thin i{display:block;height:100%;border-radius:inherit;background:var(--brand)}
.growth-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.growth-stats a{display:flex;flex-direction:column;gap:2px;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);color:var(--text)}
.growth-stats a:hover{border-color:color-mix(in srgb,var(--brand) 40%,var(--line));text-decoration:none}
.growth-stats small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-stats b{font-size:var(--font-size-xl);font-weight:600;line-height:1.2}
/* today's tasks: one row each */
.growth-tasks{list-style:none;margin:0;padding:0}
.growth-task{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line-soft)}
.growth-task:last-child{border:0}
.growth-ic{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--brand-soft);color:var(--brand)}
.growth-ic svg{width:16px;height:16px}
.growth-task-main{flex:1;min-width:0}
.growth-task-name{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px}
.growth-task-name a,.growth-task-name span{color:var(--text);font-weight:500}
.growth-task-name small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-task .growth-thin{margin:6px 0 0}
.growth-task-num{flex:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:3px;min-width:44px;color:var(--text-muted);font-size:var(--font-size-xs);font-variant-numeric:tabular-nums;white-space:nowrap}
.growth-task.is-done .growth-task-num{color:var(--brand);font-weight:600}
.growth-task-num svg{width:13px;height:13px}
.growth-tasks+.growth-chips{margin:0 0 6px 44px}
.growth-note{display:flex;align-items:center;gap:6px;margin:8px 0 0;color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-note svg{width:13px;height:13px;color:var(--brand)}
/* lists: top members, today's check-ins */
.growth-toplist .growth-n{width:18px}
.growth-n.top{color:var(--brand)}
.growth-page .growth-toplist li>b{color:var(--text-muted);font-weight:500}
.growth-toplist li.me .user-link{font-weight:600}
.growth-pts{padding:1px 8px;border-radius:999px;background:var(--brand-soft)}
/* overview lists */
.growth-box .card-head a{font-size:var(--font-size-sm)}
.growth-toplist,.growth-rows{list-style:none;margin:0;padding:0}
.growth-toplist li,.growth-rows li{display:flex;align-items:center;gap:9px;padding:6px 0;border-bottom:1px solid var(--line-soft)}
.growth-toplist li:last-child,.growth-rows li:last-child{border:0}
.growth-toplist li>b,.growth-rows li>b{margin-inline-start:auto;color:var(--brand);font-size:var(--font-size-sm);white-space:nowrap}
.growth-toplist .user-link{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.growth-who{display:flex;flex-direction:column;min-width:0}
.growth-who small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-earn-group{margin:14px 0 2px;color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.growth-earn-group:first-of-type{margin-top:4px}
.growth-earn-intro{margin:0 0 6px}
.growth-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:-6px}
.growth-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border:1px solid var(--line);border-radius:999px;color:var(--text);font-size:var(--font-size-xs)}
.growth-chip b{color:var(--brand)}
.growth-chip.ok{border-color:transparent;background:var(--success-soft);color:var(--success)}
.growth-chip svg{width:12px;height:12px}
a.growth-chip:hover{border-color:var(--brand);text-decoration:none}
.growth-more-list{list-style:none;margin:0;padding:0}
.growth-more-list li{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--line-soft);font-size:var(--font-size-sm)}
.growth-more-list li:last-child{border:0}
.growth-more-list li b{margin-inline-start:auto;color:var(--brand)}
.growth-box .growth-earn-intro{margin:14px 0 0}
/* calendar: checked days tinted circles, today ringed (solid once checked in) */
.growth-cal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.growth-cal-head h3{margin:0;font-size:var(--font-size-md)}
.growth-cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px 4px;justify-items:center}
.growth-cal .wd{padding-bottom:2px;color:var(--text-subtle);font-size:var(--font-size-xs)}
.growth-cal .d{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;color:var(--text);font-size:var(--font-size-sm)}
.growth-cal .d.pad{visibility:hidden}
.growth-cal .d.on{background:var(--brand-soft);color:color-mix(in srgb,var(--brand) 55%,var(--text));font-weight:600}
.growth-cal .d.today{box-shadow:inset 0 0 0 1.5px var(--brand)}
.growth-cal .d.on.today{background:var(--brand);color:#fff;box-shadow:none}
.growth-cal .d.ahead{color:var(--text-subtle)}
.growth-cal-foot{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line-soft)}
.growth-cal-foot span{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-cal-foot svg{width:13px;height:13px}
/* leaderboards */
.growth-board-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.growth-board-head .tabs{margin:0}
.growth-board-sub{margin:-6px 0 0}
.growth-mine{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:var(--font-size-sm);font-weight:600}
.growth-mine svg{width:14px;height:14px}
.growth-podium{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr) minmax(0,1fr);gap:14px;align-items:end;margin-top:26px}
.growth-top.r1,.growth-top.r2,.growth-top.r3{--tint:rgba(122,167,255,.16);--ring:#7aa7ff;--num:#4c7fe8;display:block;min-width:0;padding:44px 10px 18px;border:1px solid var(--line-soft);border-radius:16px;background:linear-gradient(180deg,var(--tint) 0%,var(--panel) 100%);text-align:center}
.growth-top.r1{--tint:rgba(255,178,36,.2);--ring:#f5a623;--num:#e8641c;padding-top:50px;transform:translateY(-14px)}
.growth-top.r3{--tint:rgba(240,138,155,.16);--ring:#f08a9b;--num:#e2576f}
.growth-top.empty{min-height:110px;border-style:dashed;background:none}
.growth-top.me{box-shadow:0 0 0 2px var(--brand)}
.growth-pic{position:relative;display:inline-block;line-height:0}
.growth-crown{position:absolute;z-index:1;top:-28px;left:50%;width:40px;height:40px;transform:translateX(-50%);color:var(--ring);line-height:normal}
.growth-crown svg{width:40px;height:40px;fill:currentColor}
.growth-crown i{position:absolute;top:14px;left:0;right:0;color:#fff;font-size:12px;font-style:normal;font-weight:700;text-align:center}
.growth-top .avatar{width:72px;height:72px;font-size:28px;border:3px solid var(--ring)}
.growth-name{margin-top:10px;overflow:hidden;font-weight:600;white-space:nowrap;text-overflow:ellipsis}
.growth-val{margin-top:8px;color:var(--num);font-weight:700;font-size:1.15rem}
.growth-sub{margin-top:2px;overflow:hidden;color:var(--text-muted);font-size:var(--font-size-xs);white-space:nowrap;text-overflow:ellipsis}
.growth-table ol{list-style:none;margin:0;padding:4px 16px}
.growth-table li{padding:10px 0;border-bottom:1px solid var(--line-soft)}
.growth-table li:last-child{border:0}
.growth-table .growth-row{display:flex;align-items:center;gap:10px}
.growth-n{flex:none;width:28px;color:var(--text-subtle);font-weight:600;text-align:center}
.growth-table li.me{margin:0 -16px;padding-inline:16px;background:var(--brand-soft)}
.growth-table .growth-row>b{margin-inline-start:auto;white-space:nowrap}
/* levels: reached ones ticked, the current one tinted, the ones ahead as open circles */
.growth-ladder{list-style:none;margin:0 0 8px;padding:0}
.growth-ladder li{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:var(--radius-sm)}
.growth-ladder li>svg{flex:none;width:16px;height:16px;color:var(--text-subtle)}
.growth-ladder li.past>svg,.growth-ladder li.now>svg{color:var(--brand)}
.growth-ladder li b{font-weight:500}
.growth-ladder li .muted{margin-inline-start:auto;font-variant-numeric:tabular-nums}
.growth-ladder li.now{background:var(--brand-soft)}
.growth-ladder li.now b{font-weight:600}
.growth-ladder li.past .growth-pill{border-color:color-mix(in srgb,var(--brand) 40%,var(--line));color:var(--brand)}
.growth-ladder li.now .growth-pill{border-color:var(--brand);background:var(--brand);color:#fff}
/* sidebar card */
.growth-sidecard .card-head{gap:8px}
.growth-more{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;color:var(--text-muted)}
.growth-more:hover{background:var(--panel-2);color:var(--text)}
.growth-more svg{width:15px;height:15px}
.growth-card{display:flex;flex-direction:column;gap:10px}
.growth-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.growth-wd{display:flex;flex-direction:column;align-items:center;gap:5px}
.growth-wd i{color:var(--text-subtle);font-size:11px;font-style:normal;font-weight:500;line-height:1}
.growth-wd.today i{color:var(--brand);font-weight:700}
.growth-wd b{display:flex;align-items:center;justify-content:center;width:100%;max-width:26px;aspect-ratio:1;border:1px solid var(--line);border-radius:50%;background:var(--panel-2);color:#fff}
.growth-wd b.on{border-color:var(--brand);background:var(--brand)}
.growth-wd.today b:not(.on){border:2px dashed var(--brand);background:var(--brand-soft)}
.growth-wd b.ahead{opacity:.45}
.growth-wd b svg{width:12px;height:12px;stroke-width:3}
.growth-inline{margin:0}
.growth-card .growth-go,.growth-card .growth-done{width:100%}
/* in the sidebar the check-in is the second action: soft, so New Topic in the member card above stays the one solid button */
.growth-card .growth-go{background:var(--brand-soft);color:var(--brand);box-shadow:none}
.growth-card .growth-go:hover{background:color-mix(in srgb,var(--brand) 18%,var(--panel));color:var(--brand)}
.growth-card .growth-go b{background:color-mix(in srgb,var(--brand) 16%,transparent)}
.growth-hint{margin:0;color:var(--text-muted);font-size:var(--font-size-xs);text-align:center}
.growth-lv{display:block;padding-top:10px;border-top:1px solid var(--line-soft);color:var(--text)}
.growth-lv:hover{text-decoration:none}
.growth-card.just-done .growth-done{animation:growth-pop .4s ease}
@keyframes growth-pop{0%{transform:scale(.9)}60%{transform:scale(1.04)}100%{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.growth-card.just-done *{animation:none}}
@media (max-width:900px){.growth-top2,.growth-split,.growth-split-cal{grid-template-columns:minmax(0,1fr)}.growth-split-cal>.growth-col{order:-1}}
@media (max-width:640px){
.growth-head h1{font-size:var(--font-size-xl)}
.growth-head{flex-wrap:nowrap;flex-direction:column;align-items:stretch}
.growth-tabs{width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
.growth-tabs .tab{flex:none}
.growth-stats{gap:8px}
.growth-stats a{padding:10px 12px}
.growth-stats b{font-size:var(--font-size-lg)}
.growth-cal .d{width:100%;max-width:38px;height:auto;aspect-ratio:1}
.growth-tasks+.growth-chips{margin-inline-start:0}
.growth-podium{gap:8px;margin-top:22px}
.growth-top.r1,.growth-top.r2,.growth-top.r3{padding:30px 6px 12px;border-radius:12px}
.growth-top.r1{padding-top:34px;transform:translateY(-10px)}
.growth-top .avatar{width:52px;height:52px;font-size:20px;border-width:2px}
.growth-crown{top:-20px;width:28px;height:28px}.growth-crown svg{width:28px;height:28px}.growth-crown i{top:9px;font-size:10px}
.growth-name{font-size:var(--font-size-sm)}
.growth-val{font-size:var(--font-size-md)}
}
/* the Leaderboard card of the right column (board.php): a segmented switch, then the top members of the board */
.growth-topcard .card-body{padding-top:4px}
.growth-top-tabs{display:flex;gap:2px;margin:0 0 6px;padding:3px;border-radius:9px;background:var(--panel-2)}
.growth-top-tab{flex:1;min-width:0;padding:5px 2px;border:0;border-radius:7px;background:none;color:var(--text-muted);font:inherit;font-size:var(--font-size-xs);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.growth-top-tab:hover{color:var(--text)}
.growth-top-tab.active{background:var(--panel);color:var(--text);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.growth-top-list{list-style:none;margin:0;padding:0}
.growth-top-list[hidden]{display:none}
.growth-top-list li{display:flex;align-items:center;gap:9px;padding:6px 2px;font-size:var(--font-size-sm)}
.growth-top-list .avatar{width:26px;height:26px;flex:none}
.growth-top-rank{display:inline-grid;place-items:center;width:20px;height:20px;flex:none;border-radius:50%;color:var(--text-subtle);font-size:11px;font-weight:700}
.growth-top-rank.r1{background:#fac775;color:#633806}.growth-top-rank.r2{background:#d3d1c7;color:#444441}.growth-top-rank.r3{background:#f0997b;color:#712b13}
.growth-top-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.growth-top-name .user-link{color:var(--text)}
.growth-top-value{display:inline-flex;align-items:center;gap:3px;flex:none;color:var(--text-muted);font-size:var(--font-size-xs);font-variant-numeric:tabular-nums}
.growth-top-value .icon{width:13px;height:13px;color:var(--brand)}
.growth-top-list li.me{margin:0 -6px;padding-inline:8px;border-radius:9px;background:var(--brand-soft)}
.growth-top-list li.growth-top-you{margin-top:4px}
.growth-top-list li.me .growth-top-name,.growth-top-list li.me .growth-top-value{color:var(--brand);font-weight:600}
.growth-top-empty{padding:8px 2px}
.growth-guest{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 24px}
.growth-guest-main{min-width:0}
.growth-guest h2{margin:0 0 6px;overflow-wrap:anywhere;font-size:var(--font-size-xl);color:var(--text)}
.growth-guest p{margin:0 0 16px;font-size:var(--font-size-sm)}
.growth-guest-btns{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.growth-guest-btns .btn{height:40px;border-radius:999px;padding:0 18px}
.growth-guest .growth-streak-num{flex:none;margin:0;flex-direction:column;align-items:center;gap:2px}
.growth-ways{list-style:none;margin:0;padding:0}
.growth-ways li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px solid var(--line-soft)}
.growth-ways li:first-child{border-top:0}
.growth-ways span{display:flex;flex-direction:column;min-width:0}
.growth-ways small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-ways b{color:var(--brand);font-weight:650}
@media (max-width:640px){.growth-guest{flex-direction:column;align-items:stretch;padding:18px}.growth-guest .growth-streak-num{flex-direction:row;align-items:baseline}}


/* guard */
.guard-secret{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin:.4rem 0 .8rem}.guard-secret code{font-size:1.1em;letter-spacing:.08em;padding:.4rem .6rem;background:var(--bg-soft);border-radius:var(--radius)}.guard-codes{margin-bottom:1rem;padding:.8rem 1rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-soft)}.guard-codes pre{margin:.4rem 0 0;font-size:1.05em;letter-spacing:.06em}.guard-status{margin-bottom:1rem}

/* history */
.history-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 4px}.history-head h1{margin:0;font-size:var(--font-size-xl)}.history-private{display:inline-flex;align-items:center;gap:5px;color:var(--text-muted);font-size:var(--font-size-xs)}.history-private .icon{width:13px;height:13px}.history-day{padding:12px 16px 4px;color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600}.history-row{display:flex;align-items:center;gap:10px;padding:10px 16px;border-top:1px solid var(--line-soft);transition:opacity .2s}.history-row:hover{background:var(--panel-2)}.history-row.is-gone{opacity:0}.history-main{flex:1;min-width:0}.history-title{display:block;color:var(--text);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-title:hover{color:var(--brand);text-decoration:none}.history-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin-top:2px;color:var(--text-muted);font-size:var(--font-size-xs)}.history-cat{padding:0 6px;border-radius:6px;background:var(--panel-2);color:var(--text-muted)}.history-continue{flex:none;color:var(--brand);font-size:var(--font-size-sm);white-space:nowrap}.history-x{flex:none;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--text-muted);cursor:pointer}.history-x:hover{background:var(--danger-soft);color:var(--danger)}.history-x .icon{width:15px;height:15px}@media (max-width:640px){.history-continue{display:none}.history-row{padding:10px 12px}}

/* image_gallery */
/* ============================================================
   Image Gallery — assets/gallery.css
   Two parts:
     1. The grid (.imgallery) — wraps consecutive <img> tags inside
        a post into a responsive grid.
     2. The lightbox (.imgallery-lightbox) — a full-screen overlay
        with prev/next navigation, opened by clicking a gallery image.

   All colours come from the forum's CSS variables, so the gallery
   follows light/dark themes and any brand-colour override.
   ============================================================ */

/* ---------- 1. Grid ---------- */
[data-imgallery] {
  display: grid;
  grid-template-columns: repeat(var(--imgallery-cols, 2), 1fr);
  gap: 6px;
  margin: 12px 0;
  /* Cap each image's height so a row of three portraits doesn't push
     the rest of the topic down by 3000 pixels. */
  --imgallery-cell-h: 220px;
}

/* Column-count modifiers — set by the PHP hook based on image count.
   .imgallery-2 → two columns, .imgallery-3 → three, and so on up to 5. */
.imgallery-2 { --imgallery-cols: 2; }
.imgallery-3 { --imgallery-cols: 3; }
.imgallery-4 { --imgallery-cols: 4; --imgallery-cell-h: 180px; }
.imgallery-5 { --imgallery-cols: 5; --imgallery-cell-h: 160px; }

/* On small screens, cap the column count at 2 so thumbnails stay big enough to tap. */
@media (max-width: 540px) {
  [data-imgallery] { --imgallery-cols: 2 !important; --imgallery-cell-h: 140px; }
  .imgallery-2     { --imgallery-cols: 2 !important; }
}

[data-imgallery] img[data-imgallery-item] {
  width: 100%;
  height: var(--imgallery-cell-h);
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
  cursor: zoom-in;
  background: var(--panel-2, #f8f9fb);
  border: 1px solid var(--line-soft, #eff1f4);
  transition: transform .2s cubic-bezier(.22, .61, .2, 1), box-shadow .2s, filter .2s;
  display: block;
}

[data-imgallery] img[data-imgallery-item]:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  filter: brightness(1.05);
  z-index: 1;
}

[data-imgallery] img[data-imgallery-item]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* When images live inside the grid, the .post-image-max setting of the
   forum shouldn't make them tiny — override it for gallery items only. */
.post-content [data-imgallery] img[data-imgallery-item] {
  max-width: none;
}

/* ---------- 2. Lightbox ---------- */
[data-imgallery-lightbox] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 10, 14, .92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: imgallery-fade-in .25s cubic-bezier(.22, .61, .2, 1);
}

[data-imgallery-lightbox][hidden] {
  display: none;
}

@keyframes imgallery-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* The big image */
.imgallery-stage {
  margin: 0;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imgallery-stage img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  animation: imgallery-zoom-in .25s cubic-bezier(.22, .61, .2, 1);
}

@keyframes imgallery-zoom-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Caption (the image's alt text, if any) */
.imgallery-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  padding: 6px 14px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--font-size-sm, 12px);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.imgallery-caption:empty { display: none; }

/* Counter ("3 / 7") */
.imgallery-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--font-size-xs, 11px);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.imgallery-counter:empty { display: none; }

/* Close button (top-right) */
.imgallery-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.imgallery-close:hover {
  background: rgba(255, 255, 255, .18);
  transform: scale(1.05);
}
.imgallery-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Prev / next buttons (vertically centred on each side) */
.imgallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.imgallery-nav:hover {
  background: rgba(255, 255, 255, .18);
}
.imgallery-prev:hover { transform: translateY(-50%) scale(1.05) translateX(-2px); }
.imgallery-next:hover { transform: translateY(-50%) scale(1.05) translateX(2px); }
.imgallery-nav svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }

.imgallery-prev { inset-inline-start: 16px; }
.imgallery-next { inset-inline-end: 16px; }

/* On small screens, move the prev/next buttons to the bottom and make
   them bigger so they're easy to tap. */
@media (max-width: 540px) {
  [data-imgallery-lightbox] { padding: 12px; }
  .imgallery-stage,
  .imgallery-stage img { max-width: 95vw; max-height: 70vh; }
  .imgallery-nav {
    top: auto;
    bottom: 24px;
    transform: none;
    width: 56px;
    height: 56px;
  }
  .imgallery-prev:hover,
  .imgallery-next:hover { transform: scale(1.05); }
  .imgallery-prev { inset-inline-start: 16px; }
  .imgallery-next { inset-inline-end: 16px; }
  .imgallery-caption { bottom: 90px; }
  .imgallery-close { width: 36px; height: 36px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  [data-imgallery-lightbox],
  .imgallery-stage img,
  [data-imgallery] img[data-imgallery-item] {
    animation: none !important;
    transition: none !important;
  }
}

/* Print: hide the lightbox; galleries print as simple image grids. */
@media print {
  [data-imgallery-lightbox] { display: none !important; }
  [data-imgallery] img[data-imgallery-item] { height: auto; cursor: default; }
}


/* invite */
.invite-note{display:flex;align-items:center;gap:6px;color:var(--brand);font-weight:600}.invite-note svg{width:15px;height:15px}.invite-hero{display:flex;flex-wrap:wrap;align-items:center;gap:18px}.invite-hero>div:first-child{flex:1 1 320px}.invite-hero h1{margin:0 0 6px}.invite-hero p{margin:0;color:var(--text-muted)}.invite-link{display:flex;gap:8px;align-items:center;margin-top:14px;flex-wrap:wrap}.invite-link input{flex:1 1 260px;font-family:var(--mono);font-size:var(--font-size-sm)}.invite-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}.invite-stats div{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:14px;text-align:center}.invite-stats b{display:block;font-size:1.4rem;color:var(--brand)}.invite-stats span{font-size:var(--font-size-sm);color:var(--text-muted)}.invite-rules{margin:0;padding-inline-start:18px;color:var(--text-muted);font-size:var(--font-size-sm)}.invite-rules b{color:var(--text)}.invite-list{list-style:none;margin:0;padding:0}.invite-list li{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line-soft)}.invite-list li:last-child{border:0}.invite-list .muted{margin-inline-start:auto;font-size:var(--font-size-sm)}.invite-state{font-size:var(--font-size-xs);padding:1px 8px;border-radius:999px;background:var(--panel-2);color:var(--text-muted)}.invite-state.paid{background:var(--success-soft);color:var(--success)}@media(max-width:640px){.invite-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.invite-stats b{font-size:1.1rem}}

/* lightbox */
.post-content img,.editor-preview img{cursor:zoom-in}.post-content a img,.editor-preview a img{cursor:pointer}html.lightbox-lock{overflow:hidden}.lightbox{position:fixed;inset:0;z-index:210;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.88);opacity:0;transition:opacity .15s;touch-action:pan-y}.lightbox.open{display:flex;opacity:1}.lightbox-stage{margin:0;display:flex;flex-direction:column;align-items:center;gap:10px;max-width:94vw;max-height:92vh}.lightbox-stage img{max-width:94vw;max-height:84vh;object-fit:contain;border-radius:var(--radius-sm);background:#fff;box-shadow:0 8px 40px rgba(0,0,0,.5);cursor:default}.lightbox-cap{color:rgba(255,255,255,.82);font-size:var(--font-size-sm);max-width:80vw;text-align:center;word-break:break-word}.lightbox-close{position:fixed;top:14px;inset-inline-end:16px;width:40px;height:40px;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:20px;line-height:1;cursor:pointer}.lightbox-close:hover{background:rgba(255,255,255,.22)}.lightbox-nav{position:fixed;top:50%;transform:translateY(-50%);width:48px;height:48px;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:30px;line-height:1;cursor:pointer;display:none}.lightbox.has-many .lightbox-nav{display:inline-flex;align-items:center;justify-content:center}.lightbox-nav:hover{background:rgba(255,255,255,.22)}.lightbox-prev{inset-inline-start:16px}.lightbox-next{inset-inline-end:16px}[dir="rtl"] .lightbox-nav{transform:translateY(-50%) scaleX(-1)}.lightbox-count{position:fixed;top:18px;inset-inline-start:50%;transform:translateX(-50%);color:rgba(255,255,255,.82);font-size:var(--font-size-sm);font-variant-numeric:tabular-nums}@media(max-width:640px){.lightbox-nav{width:40px;height:40px;font-size:24px}.lightbox-prev{inset-inline-start:6px}.lightbox-next{inset-inline-end:6px}}@media(prefers-reduced-motion:reduce){.lightbox{transition:none}}

/* maintenance */
.maintenance-body{display:flex;align-items:center;justify-content:center;min-height:100vh;margin:0;padding:24px;background:var(--bg)}.maintenance-box{max-width:520px;width:100%;text-align:center;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:40px 32px}.maintenance-icon svg{width:44px;height:44px;color:var(--brand)}.maintenance-site{color:var(--muted);font-size:var(--font-size-sm);margin:8px 0 0}.maintenance-box h1{font-size:1.5rem;margin:6px 0 14px}.maintenance-box .post-content{color:var(--text);text-align:left}.maintenance-box .post-content p{text-align:center}.maintenance-login{margin:22px 0 0;font-size:var(--font-size-sm)}.maintenance-login a{color:var(--muted)}.maintenance-banner{display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:var(--radius-sm);margin-bottom:16px;background:var(--danger-soft);color:var(--danger);font-weight:500}.maintenance-banner svg{width:18px;height:18px;flex:none}.maintenance-banner a{color:inherit;text-decoration:underline;margin-left:auto}.maintenance-card-b svg{width:26px;height:26px;color:var(--danger)}

/* market */
.market-filter-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}.market-filter-row .tabs{margin:0}.market-search{margin-inline-start:auto;width:200px;height:32px;padding:0 10px}.market-search input{font-size:var(--font-size-sm)}.market-filter-row .icon-btn{width:32px;height:32px}.market-cat-form select{width:auto;max-width:220px;height:32px;padding:0 8px;font-size:var(--font-size-sm)}@media(max-width:640px){.market-search{width:100%;margin-inline-start:0;order:2}.market-filter-row .icon-btn{order:3}}.market-connect{padding:18px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2);text-align:center}.market-connect p:first-child{max-width:520px;margin:0 auto 12px}.market-connect .btn-lg{margin:4px 0 8px}.market-token-fold{margin-top:14px}.market-token-fold summary{cursor:pointer}.market-token-fold .admin-form{margin-top:10px}@media(max-width:640px){.plugin-item{flex-direction:column;gap:10px}.plugin-ops{justify-content:flex-start}.market-account-card .btn-row{margin-inline-start:0}.admin-toolbar form.inline{margin:0}}.market-other{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;margin:0 0 14px;border-radius:var(--radius-sm);background:var(--warning-soft,var(--info-soft));color:var(--text)}.market-other svg{width:20px;height:20px;flex:none;margin-top:2px;color:var(--warning,var(--info))}.market-other p{margin:0 0 6px}.market-other-stop{background:var(--danger-soft)}.market-other-stop svg{color:var(--danger)}.market-tabs{margin-bottom:12px}.market-free{background:var(--success-soft,#dcfce7);color:var(--success,#15803d)}.market-paid{background:#fff1e6;color:#c2410c}[data-theme=dark] .market-paid{background:rgba(194,65,12,.25);color:#fdba74}.market-account{display:inline-flex;align-items:center;gap:6px;margin-inline-start:auto;color:var(--text-muted);font-size:var(--font-size-sm);white-space:nowrap}.market-account svg{width:16px;height:16px}.market-account b{color:var(--text)}.market-account-card{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2)}.market-account-card>svg{width:28px;height:28px;color:var(--brand);flex:none}.market-account-card>div:first-of-type{flex:1;min-width:200px}.market-account-card .btn-row{margin-inline-start:auto}.plugin-ops small{display:block;text-align:right;margin-top:4px}.plugin-ops .btn[disabled]{opacity:.5;cursor:default}.market-foot{margin-top:14px}.market-theme-blank{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--text-subtle)}.market-theme-blank .icon{width:40px;height:40px}.market-theme-badges{margin:2px 0}a.theme-shot{display:block}.market-item-link{color:inherit}.market-item-link:hover{color:var(--brand);text-decoration:underline}.theme-ops small{display:block;width:100%}.market-publish-themes{margin-top:18px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2)}.market-publish-themes h3{margin:0 0 4px;font-size:var(--font-size-md)}.market-publish-themes p{margin:0}.market-publish-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.market-publish-list .muted{font-weight:400}

/* market */
.market-shots-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px}.market-shot{position:relative;aspect-ratio:3/2;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;background:var(--panel-2);user-select:none;-webkit-user-select:none}.market-shot img{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none;-webkit-user-drag:none}.market-shots.is-js .market-shot{cursor:grab}.market-shot.is-dragging{opacity:.45;pointer-events:none;outline:2px dashed var(--brand);outline-offset:-2px}.market-shots.is-sorting,.market-shots.is-sorting *{cursor:grabbing}.market-shot:first-child{border:2px solid var(--brand)}.market-shot-cover{display:none;position:absolute;left:5px;bottom:5px;padding:1px 7px;border-radius:4px;background:var(--brand);color:var(--brand-text,#fff);font-size:11px;font-weight:600;line-height:1.5}.market-shot:first-child .market-shot-cover{display:block}.market-shot-x,.market-shot-grip{position:absolute;top:5px;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;font-size:16px;line-height:1;cursor:pointer}.market-shot-x{right:5px}.market-shot-x:hover{background:var(--danger,#dc2626)}.market-shot-grip{left:5px;cursor:grab;touch-action:none}.market-shot-grip:hover{background:rgba(0,0,0,.8)}.market-shot-x:focus-visible,.market-shot-grip:focus-visible{outline:2px solid var(--brand);outline-offset:1px}.market-shot-keep{position:absolute;left:5px;top:5px;display:flex;gap:4px;align-items:center;margin:0;padding:1px 6px;border-radius:4px;background:var(--panel);font-size:var(--font-size-xs)}.market-shots.is-js .market-shot-keep,.market-shots:not(.is-js) .market-shot-x,.market-shots:not(.is-js) .market-shot-grip{display:none}.market-shot-add{position:relative;aspect-ratio:3/2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;margin:0;border:1px dashed var(--text-subtle);border-radius:var(--radius-sm);color:var(--text-muted);font-size:var(--font-size-sm);font-weight:500;cursor:pointer}.market-shot-add:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}.market-shot-add .icon{width:20px;height:20px}.market-shot-add[hidden],.market-shots-error[hidden]{display:none}.market-shots.is-js .market-shot-add input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.market-shots:not(.is-js) .market-shot-add{grid-column:1/-1;aspect-ratio:auto;align-items:stretch;border:0;cursor:default}.market-shots:not(.is-js) .market-shot-add .icon,.market-shots:not(.is-js) .market-shot-add span{display:none}.market-shots-error{margin:6px 0 0;color:var(--danger,#dc2626);font-size:var(--font-size-sm)}

/* media_embed */
/* ============================================================
   Media Embed — assets/embed.css
   Responsive video / audio / tweet embeds inside .post-content.
   All colours come from the forum's CSS variables so the plugin
   follows light / dark themes.
   ============================================================ */

.media-embed {
  margin: 16px 0;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  background: var(--panel-2, #f8f9fb);
  border: 1px solid var(--line-soft, #eff1f4);
}

/* ---------- Video (YouTube / Vimeo / Aparat) ---------- */
.media-embed-video {
  position: relative;
  width: 100%;
  aspect-ratio: var(--media-embed-ratio, 16 / 9);
}

.media-embed-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Direct HTML5 video (.mp4 / .webm / .ogg / .mov / .m4v) ---------- */
.media-embed-html5 {
  position: relative;
  width: 100%;
  background: #000;
  /* No forced aspect-ratio — let the video's native dimensions
     drive the height so portrait videos don't get letterboxed
     into a 16:9 slab. The browser sizes <video> to the file's
     intrinsic ratio while still respecting the container width. */
}

.media-embed-html5 video {
  display: block;
  width: 100%;
  max-height: 80vh;            /* keep tall portrait videos sane */
  height: auto;
  background: #000;
  border: 0;
  outline: 0;
}

/* The download fallback link — visible only if the <video> tag
   itself cannot render (browser shows the inline fallback). In
   a supporting browser it stays as a tiny "Download" link under
   the player, which is genuinely useful for direct file links. */
.media-embed-html5 .media-embed-download {
  display: block;
  padding: 8px 12px;
  background: var(--panel-2, #f8f9fb);
  color: var(--brand, #2563eb);
  font-size: 0.85em;
  text-decoration: none;
  border-top: 1px solid var(--line-soft, #eff1f4);
}

.media-embed-html5 .media-embed-download:hover {
  text-decoration: underline;
}

/* The inline <a> fallback inside <video> is shown only when the
   browser cannot play the source — hide it visually otherwise
   so we don't end up with a duplicate of the download link. */
.media-embed-html5 video > a {
  display: inline-block;
  color: #fff;
  padding: 12px;
  background: #111;
}

/* ---------- Audio (SoundCloud / Spotify) ---------- */
.media-embed-audio {
  background: transparent;
  border: 0;
}

.media-embed-audio iframe {
  display: block;
  border: 0;
}

/* ---------- Twitter / X ---------- */
.media-embed-tweet {
  padding: 12px 16px;
  max-width: 550px;
}

.media-embed-tweet blockquote {
  margin: 0;
}

.media-embed-tweet a {
  color: var(--brand);
  text-decoration: none;
}

.media-embed-tweet a:hover {
  text-decoration: underline;
}

/* ---------- Small screens ---------- */
@media (max-width: 540px) {
  .media-embed {
    margin: 12px -4px;
    border-radius: var(--radius-sm, 8px);
  }

  .media-embed-tweet {
    padding: 8px 12px;
  }

  .media-embed-html5 video {
    max-height: 70vh;
  }
}

/* ---------- Print ---------- */
@media print {
  .media-embed-video,
  .media-embed-audio,
  .media-embed-html5 {
    display: none;
  }

  .media-embed-tweet {
    border: 1px solid #ccc;
  }
}


/* media_gallery */

/* =========================================================
 * MEDIA GALLERY
 * Responsive, clean and consistent design
 * ========================================================= */

.mg-hero,
.mg-filters,
.mg-grid,
.mg-card,
.mg-empty,
.mg-pagination,
.mg-add-hero,
.mg-add-card,
.mg-add-form,
.mg-upload-box,
.mg-youtube-input,
.mg-item,
.mg-item-top,
.mg-item-title,
.mg-item-image,
.mg-item-video,
.mg-item-description,
.mg-item-bottom,
.mg-item-stats,
.mg-item-actions {
    box-sizing: border-box;
}

.mg-hero *,
.mg-add-hero *,
.mg-filters *,
.mg-grid *,
.mg-add-card *,
.mg-item * {
    box-sizing: border-box;
}

.mg-hero,
.mg-filters,
.mg-grid,
.mg-card,
.mg-add-card,
.mg-item {
    min-width: 0;
}


/* =========================================================
 * HERO
 * ========================================================= */


.mg-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1.25rem;

    width: 100%;
    margin-bottom: 1.25rem;
    padding: 1.5rem;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background:
        linear-gradient(
            135deg,
            var(--card-bg, var(--panel)),
            var(--bg-soft, var(--panel))
        );

    box-shadow:
        0 .2rem .8rem rgba(0, 0, 0, .035);
}

.mg-hero-content {
    flex: 1 1 auto;
    min-width: 0;
}

.mg-kicker {
    margin: 0 0 .35rem;

    color: var(--brand);

    font-size: .72rem;
    font-weight: 800;

    letter-spacing: .08em;
    line-height: 1.3;

    text-transform: uppercase;
}

.mg-hero h1 {
    margin: 0;

    max-width: 100%;

    font-size: clamp(1.65rem, 4vw, 2.35rem);
    line-height: 1.1;

    overflow-wrap: anywhere;
}

.mg-hero p {
    max-width: 46rem;

    margin: .55rem 0 0;

    color: var(--text-muted);

    line-height: 1.5;

    overflow-wrap: anywhere;
}

.mg-hero-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.mg-edit-card {
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

.mg-edit-form {
    width: 100%;
}

.mg-action-edit {
    text-decoration: none;
}

.mg-action-edit:hover {
    text-decoration: none;
}

.mg-action-delete {
    color: #dc3545;
}

.mg-action-delete:hover {
    color: #fff;
    background: #dc3545;
}
/* =========================================================
 * FILTERS
 * ========================================================= */

.mg-filters {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(9rem, 11rem)
        minmax(9rem, 11rem)
        auto;

    align-items: stretch;

    gap: .65rem;

    width: 100%;
    margin-bottom: 1.25rem;
}

.mg-search {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    min-width: 0;
}

.mg-search > svg,
.mg-search > i,
.mg-search > .icon,
.mg-search > span:first-child {
    position: absolute;

    inset-inline-start: .85rem;
    top: 50%;

    z-index: 3;

    display: grid;

    width: 1rem;
    height: 1rem;

    place-items: center;

    margin: 0;

    transform: translateY(-50%);

    color: var(--text-muted);

    pointer-events: none;

    line-height: 0;
}

.mg-search input {
    display: block;

    width: 100%;
    min-width: 0;
    height: 2.75rem;

    box-sizing: border-box;

    margin: 0 !important;

    padding-top: 0 !important;
    padding-bottom: 0 !important;

    padding-inline-start: 2.5rem !important;
    padding-inline-end: .85rem !important;
}

.mg-filters select {
    display: block;

    width: 100%;
    min-width: 0;
    height: 2.75rem;

    box-sizing: border-box;

    margin: 0 !important;
}

.mg-filters > .btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 6.5rem;
    height: 2.75rem;

    box-sizing: border-box;

    margin: 0 !important;

    white-space: nowrap;
}


/* =========================================================
 * GALLERY GRID
 * ========================================================= */

.mg-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 1rem;

    width: 100%;
}


/* =========================================================
 * CARD
 * ========================================================= */

.mg-card {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;

    overflow: hidden;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .2rem .8rem rgba(0, 0, 0, .035);

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.mg-card:hover {
    transform: translateY(-2px);

    border-color: var(--brand);

    box-shadow:
        0 .65rem 1.5rem rgba(0, 0, 0, .08);
}


/* =========================================================
 * MEDIA PREVIEW
 * ========================================================= */

.mg-media {
    position: relative;

    display: block;

    width: 100%;
    min-width: 0;

    overflow: hidden;

    aspect-ratio: 16 / 10;

    background: var(--bg-soft, var(--panel));

    text-decoration: none;
}

.mg-media img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform .3s ease,
        filter .3s ease;
}

.mg-card:hover .mg-media img {
    transform: scale(1.035);
}

.mg-card-youtube:hover .mg-media img {
    filter: brightness(.82);
}

.mg-media-fallback {
    display: grid;

    width: 100%;
    height: 100%;

    place-items: center;

    color: var(--text-muted);
}

.mg-media-fallback svg,
.mg-media-fallback i {
    width: 3rem;
    height: 3rem;
}


/* =========================================================
 * YOUTUBE BADGE
 * ========================================================= */

.mg-youtube-badge {
    position: absolute;

    inset-block-start: .65rem;
    inset-inline-start: .65rem;

    z-index: 2;

    display: inline-flex;

    align-items: center;

    gap: .35rem;

    max-width: calc(100% - 1.3rem);

    padding: .35rem .55rem;

    border-radius: 999px;

    background: rgba(0, 0, 0, .78);

    color: #fff;

    font-size: .72rem;
    font-weight: 700;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;

    backdrop-filter: blur(5px);
}

.mg-youtube-badge svg,
.mg-youtube-badge i {
    flex: 0 0 auto;

    width: .8rem;
    height: .8rem;
}

.mg-play {
    position: absolute;

    left: 50%;
    top: 50%;

    z-index: 2;

    display: grid;

    width: 3.35rem;
    height: 3.35rem;

    place-items: center;

    transform: translate(-50%, -50%);

    border-radius: 50%;

    background: var(--brand);

    color: #fff;

    box-shadow:
        0 .45rem 1.2rem rgba(0, 0, 0, .3);

    transition:
        transform .18s ease,
        background .18s ease;
}

.mg-card:hover .mg-play {
    transform:
        translate(-50%, -50%)
        scale(1.08);
}

.mg-play svg,
.mg-play i {
    width: 1.25rem;
    height: 1.25rem;
}


/* =========================================================
 * PHOTO BADGE
 * ========================================================= */

.mg-photo-badge {
    position: absolute;

    inset-block-end: .65rem;
    inset-inline-start: .65rem;

    z-index: 2;

    display: grid;

    width: 2rem;
    height: 2rem;

    place-items: center;

    border-radius: 50%;

    background: rgba(0, 0, 0, .68);

    color: #fff;

    backdrop-filter: blur(5px);
}

.mg-photo-badge svg,
.mg-photo-badge i {
    width: .95rem;
    height: .95rem;
}


/* =========================================================
 * FEATURED
 * ========================================================= */

.mg-featured {
    position: absolute;

    inset-block-start: .65rem;
    inset-inline-end: .65rem;

    z-index: 2;

    display: inline-flex;

    align-items: center;

    gap: .3rem;

    max-width: calc(100% - 1.3rem);

    padding: .35rem .55rem;

    border-radius: 999px;

    background: var(--brand);

    color: #fff;

    font-size: .7rem;
    font-weight: 800;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;

    box-shadow:
        0 .25rem .6rem rgba(0, 0, 0, .14);
}

.mg-featured svg,
.mg-featured i {
    width: .75rem;
    height: .75rem;

    flex: 0 0 auto;
}


/* =========================================================
 * CARD BODY
 * ========================================================= */

.mg-card-body {
    display: flex;
    flex-direction: column;

    flex: 1 1 auto;

    min-width: 0;

    padding: 1rem;
}

.mg-card-category {
    display: inline-flex;
    align-items: center;

    width: fit-content;
    max-width: 100%;

    margin: 0 0 .45rem;
    padding: .22rem .55rem;

    box-sizing: border-box;

    border-radius: 999px;

    background: rgba(0, 123, 255, .08);

    color: var(--brand);

    font-size: .68rem;
    font-weight: 800;

    letter-spacing: .035em;
    line-height: 1.25;

    text-transform: uppercase;

    white-space: normal;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.mg-card h3 {
    display: block;

    width: 100%;
    min-width: 0;

    margin: 0;

    font-size: 1.05rem;
    font-weight: 750;

    line-height: 1.3;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.mg-card h3 a {
    display: block;

    width: 100%;
    min-width: 0;

    color: inherit;
    text-decoration: none;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.mg-card h3 a:hover {
    color: var(--brand);
}

.mg-card h3 a:hover {
    color: var(--brand);
}

.mg-excerpt {
    display: -webkit-box;

    margin: .5rem 0 0;

    overflow: hidden;

    color: var(--text-muted);

    font-size: .9rem;
    line-height: 1.45;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;

    overflow-wrap: anywhere;
}

.mg-card-foot {
    display: flex;

    align-items: center;

    gap: 1rem;

    min-width: 0;

    margin-top: auto;
    padding-top: .75rem;

    border-top: 1px solid var(--line, var(--border));

    color: var(--text-muted);

    font-size: .78rem;

    flex-wrap: wrap;
}

.mg-card-author {
    display:flex;
    align-items:center;

    gap:9px;

    width:100%;
    max-width:100%;

    margin-top:11px;
    padding:7px 9px 7px 7px;

    border:1px solid var(--line);
    border-radius:var(--radius);

    background:var(--panel);

    box-sizing:border-box;
}

.mg-card-author-avatar {
    flex:0 0 34px;
}

.mg-card-author-avatar img {
    display:block;

    width:34px;
    height:34px;

    border-radius:50%;
    object-fit:cover;
}

.mg-card-author-info {
    display:flex;
    flex-direction:column;
    justify-content:center;

    min-width:0;
    flex:1;

    line-height:1.2;
}

.mg-card-author-name {
    display:block;

    min-width:0;
    max-width:100%;

    font-size:var(--font-size-xs);
    font-weight:600;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.mg-card-author-role {
    display:block;

    margin-top:2px;

    min-width:0;
    max-width:100%;

    color:var(--brand);

    font-size:11px;
    font-weight:600;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.mg-card-author-date {
    display:block;

    margin-top:2px;

    color:var(--muted);

    font-size:11px;

    line-height:1.2;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.mg-card-foot > span {
    display: inline-flex;

    align-items: center;

    gap: .3rem;

    min-width: 0;
}

.mg-card-foot svg,
.mg-card-foot i {
    flex: 0 0 auto;

    width: .85rem;
    height: .85rem;
}


/* =========================================================
 * EMPTY STATE
 * ========================================================= */

.mg-empty {
    display: flex;
    flex-direction: column;

    align-items: center;

    width: 100%;

    padding: 4rem 1.5rem;

    text-align: center;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--card-bg, var(--panel));
}

.mg-empty-icon {
    display: grid;

    width: 4rem;
    height: 4rem;

    margin-bottom: 1rem;

    place-items: center;

    border-radius: 50%;

    background: rgba(0, 123, 255, .10);

    color: var(--brand);
}

.mg-empty-icon svg,
.mg-empty-icon i {
    width: 1.75rem;
    height: 1.75rem;
}

.mg-empty h2 {
    margin: 0;
}

.mg-empty p {
    max-width: 30rem;

    margin: .45rem 0 1.25rem;

    color: var(--text-muted);

    line-height: 1.5;

    overflow-wrap: anywhere;
}


/* =========================================================
 * PAGINATION
 * ========================================================= */

.mg-pagination {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: .4rem;

    width: 100%;

    margin-top: 1.5rem;

    flex-wrap: wrap;
}

.mg-pagination a {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 2.35rem;
    min-height: 2.35rem;

    padding: .35rem .65rem;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 10px);

    background: var(--card-bg, var(--panel));

    color: inherit;

    text-decoration: none;

    transition:
        background .15s ease,
        color .15s ease,
        border-color .15s ease;
}

.mg-pagination a:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.mg-pagination a.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}


/* =========================================================
 * ADD PAGE
 * ========================================================= */

.mg-add-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1.25rem;

    width: 100%;
    min-width: 0;
    box-sizing: border-box;

    margin-bottom: 1.25rem;
    padding: 1.5rem;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background:
        linear-gradient(
            135deg,
            var(--card-bg, var(--panel)),
            var(--bg-soft, var(--panel))
        );

    box-shadow:
        0 .2rem .8rem rgba(0, 0, 0, .035);
}

.mg-add-hero > * {
    min-width: 0;
}


.mg-add-hero h1 {
    margin: 0;

    max-width: 100%;

    font-size: clamp(1.65rem, 4vw, 2.35rem);
    line-height: 1.1;

    overflow-wrap: anywhere;
}

.mg-add-hero p {
    max-width: 46rem;

    margin: .55rem 0 0;

    color: var(--text-muted);

    line-height: 1.5;

    overflow-wrap: anywhere;
}

.mg-add-hero .btn {
    flex: 0 0 auto;

    white-space: nowrap;
}

.mg-add-card {
    width: 100%;
    max-width: 54rem;

    margin: 0 auto;

    padding: 1.25rem;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .2rem .8rem rgba(0, 0, 0, .035);
}

.mg-add-form {
    display: grid;

    gap: 1rem;

    min-width: 0;
}


/* =========================================================
 * UPLOAD BOX
 * ========================================================= */

.mg-upload-box {
    display: flex;
    flex-direction: column;

    align-items: center;

    width: 100%;

    padding: 2rem 1.25rem;

    border: 1.5px dashed var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--bg-soft, var(--panel));

    text-align: center;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.mg-upload-box:hover {
    border-color: var(--brand);

    background:
        color-mix(
            in srgb,
            var(--brand) 4%,
            var(--bg-soft, var(--panel))
        );
}

.mg-upload-icon {
    display: grid;

    width: 3.75rem;
    height: 3.75rem;

    margin-bottom: .8rem;

    place-items: center;

    border-radius: 50%;

    background: rgba(0, 123, 255, .10);

    color: var(--brand);
}

.mg-upload-icon svg,
.mg-upload-icon i {
    width: 1.7rem;
    height: 1.7rem;
}

.mg-upload-title {
    max-width: 100%;

    font-size: 1.05rem;
    font-weight: 750;

    overflow-wrap: anywhere;
}

.mg-upload-text {
    max-width: 32rem;

    margin: .35rem 0 1rem;

    color: var(--text-muted);

    font-size: .88rem;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

.mg-upload-button {
    position: relative;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: .45rem;

    max-width: 100%;

    overflow: hidden;

    cursor: pointer;
}

.mg-upload-button input {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    opacity: 0;

    cursor: pointer;
}

.mg-upload-box small {
    max-width: 100%;

    margin-top: .75rem;

    color: var(--text-muted);

    font-size: .75rem;
    line-height: 1.4;

    overflow-wrap: anywhere;
}


/* =========================================================
 * OR
 * ========================================================= */

.mg-or {
    display: flex;

    align-items: center;

    gap: .75rem;

    width: 100%;

    color: var(--text-muted);

    font-size: .75rem;
    font-weight: 800;

    letter-spacing: .08em;

    white-space: nowrap;
}

.mg-or::before,
.mg-or::after {
    content: "";

    flex: 1 1 auto;

    min-width: 0;

    height: 1px;

    background: var(--line, var(--border));
}


/* =========================================================
 * YOUTUBE INPUT
 * ========================================================= */

.mg-youtube-input {
    display: flex;

    align-items: center;

    width: 100%;
    min-width: 0;

    overflow: hidden;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 10px);

    background: var(--card-bg, var(--panel));

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.mg-youtube-input:focus-within {
    border-color: var(--brand);

    box-shadow:
        0 0 0 3px rgba(0, 123, 255, .08);
}

.mg-youtube-input-icon {
    display: grid;

    flex: 0 0 3rem;

    width: 3rem;
    height: 3rem;

    place-items: center;

    background: rgba(0, 123, 255, .10);

    color: var(--brand);
}

.mg-youtube-input-icon svg,
.mg-youtube-input-icon i {
    width: 1rem;
    height: 1rem;
}

.mg-youtube-input input {
    display: block;

    flex: 1 1 auto;

    width: 100%;
    min-width: 0;

    box-sizing: border-box;

    border: 0 !important;

    box-shadow: none !important;
}


/* =========================================================
 * FORM ACTIONS
 * ========================================================= */

.mg-form-actions {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    gap: .65rem;

    width: 100%;

    padding-top: .5rem;
}


/* =========================================================
 * ITEM PAGE
 * ========================================================= */

.mg-item {
    width: 100%;
    max-width: 72rem;

    margin: 0 auto;
}


/* =========================================================
 * ITEM TOP
 * ========================================================= */

.mg-item-top {
    display: flex;

    align-items: center;
    justify-content: flex-start;

    gap: .75rem;

    width: 100%;
    min-width: 0;

    margin-bottom: .75rem;

    flex-wrap: wrap;
}


/* =========================================================
 * ITEM TYPE
 * ========================================================= */

.mg-item-type {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: .4rem;

    flex: 0 0 auto;

    max-width: 100%;

    min-height: 2rem;

    padding: .4rem .7rem;

    border-radius: 999px;

    font-size: .72rem;
    font-weight: 800;

    line-height: 1.25;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}

.mg-item-type.photo {
    background: rgba(0, 123, 255, .10);
    color: var(--brand);
}

.mg-item-type.youtube {
    background: #111;
    color: #fff;
}

.mg-item-type svg,
.mg-item-type i {
    flex: 0 0 auto;

    width: .8rem;
    height: .8rem;
}


/* =========================================================
 * ITEM TITLE
 * ========================================================= */

.mg-item-title {
    width: 100%;
    min-width: 0;

    margin: 0 0 1rem;
}

.mg-item-title h1 {
    max-width: 100%;

    margin: 0;

    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 750;

    line-height: 1.15;

    overflow-wrap: anywhere;
}


/* =========================================================
 * ITEM IMAGE
 * ========================================================= */

.mg-item-image {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    max-width: 100%;

    min-height: 0;

    overflow: hidden;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--bg-soft, var(--panel));
}

.mg-item-image img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 78vh;

    object-fit: contain;
}

.mg-item-image-empty {
    display: grid;

    width: 100%;
    min-height: 20rem;

    place-items: center;

    color: var(--text-muted);
}

.mg-item-image-empty svg,
.mg-item-image-empty i {
    width: 3rem;
    height: 3rem;
}


/* =========================================================
 * ITEM VIDEO
 * ========================================================= */

.mg-item-video {
    position: relative;

    width: 100%;
    max-width: 100%;

    overflow: hidden;

    aspect-ratio: 16 / 9;

    border-radius: var(--radius, 14px);

    background: #000;
}

.mg-item-video iframe {
    position: absolute;

    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}


/* =========================================================
 * MEDIA CARD DESCRIPTION
 * ========================================================= */

.mg-card-description {
    width: 100%;
    min-width: 0;

    margin-top: 1rem;
    padding: 1rem 1.1rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .12rem .4rem rgba(0, 0, 0, .025);

    overflow: hidden;
}


/* =========================================================
 * EXCERPT
 * ========================================================= */

.mg-card-description .mg-excerpt {
    margin: 0;

    color: var(--text, inherit);

    font-size: .8rem;
    font-weight: 500;

    line-height: 1.55;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-card-description {
        margin-top: .7rem;
        padding: .75rem .8rem;

        border-radius: var(--radius, 12px);
    }

    .mg-card-description .mg-excerpt {
        font-size: .75rem;
        line-height: 1.5;
    }

}


/* =========================================================
 * ITEM BOTTOM
 * ========================================================= */

.mg-item-bottom {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: stretch;

    gap: .75rem;

    width: 100%;
    min-width: 0;

    margin-top: 1rem;
    padding: .75rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));
}


/* =========================================================
 * STATS
 * ========================================================= */

.mg-item-stats {
    grid-column: 1;
    min-width: 0;
}


/* =========================================================
 * ACTIONS
 * ========================================================= */

.mg-item-actions {
    grid-column: 1 / -1 !important;

    display: flex;

    flex-direction: row;
    flex-wrap: wrap;

    align-items: center;
    justify-content: center;

    gap: .55rem;

    width: 100%;
    max-width: 100%;

    margin: 1rem auto 0;
    padding: .4rem;

    box-sizing: border-box;

    border: none;
    border-radius: 12px;

    background: var(--bg-soft, var(--panel));

    box-shadow:
        0 .15rem .5rem rgba(0, 0, 0, .025);
}



/* =========================================================
 * ITEM STATS
 * ========================================================= */

.mg-item-stats {
    display: flex;

    align-items: center;

    gap: .45rem;

    min-width: 0;

    flex-wrap: wrap;

    color: var(--text-muted);

    font-size: .8rem;
}

.mg-item-stats > span {
    display: inline-flex;

    align-items: center;
    justify-content: flex-start;

    gap: .35rem;

    min-width: 0;
    min-height: 2.35rem;

    padding: .35rem .65rem;

    border: 1px solid var(--line, var(--border));
    border-radius: 8px;

    background: var(--bg-soft, var(--panel));

    white-space: nowrap;
}

.mg-item-stats strong {
    color: inherit;
    font-weight: 750;
}

.mg-item-stats svg,
.mg-item-stats i {
    flex: 0 0 auto;

    width: .9rem;
    height: .9rem;
}


/* =========================================================
 * ITEM ACTIONS CONTAINER
 * Харесай + Добави в любими
 * ========================================================= */

.mg-item-actions {
    display: flex;

    flex-direction: row;
    flex-wrap: wrap;

    align-items: center;
    justify-content: center;

    gap: .55rem;

    width: 100%;
    max-width: 100%;

    margin: 1rem auto 0;
    padding: .4rem;

    box-sizing: border-box;

    border: none;
    border-radius: 12px;

    background: var(--bg-soft, var(--panel));

    box-shadow:
        0 .15rem .5rem rgba(0, 0, 0, .025);
}

/* =========================================================
 * ACTION FORM
 * ========================================================= */

.mg-item-actions form.mg-action-form {

    display: flex;

    align-items: stretch;
    justify-content: center;

    flex: 0 0 auto;

    width: auto;
    min-width: 0;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    background: transparent !important;

    box-shadow: none !important;
}


/* =========================================================
 * ACTION BUTTON
 * ========================================================= */

.mg-item-actions form.mg-action-form button,
.mg-item-actions form.mg-action-form input[type="submit"],
.mg-item-actions > button.mg-action-form,
.mg-item-actions > input.mg-action-form[type="submit"] {

    display: inline-flex !important;

    align-items: center;
    justify-content: center;

    gap: .5rem;

    width: auto;

    min-width: 9.5rem;
    min-height: 2.65rem;

    margin: 0 !important;

    padding: .55rem .9rem !important;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border)) !important;
    border-radius: 9px !important;

    background: var(--card-bg, var(--panel)) !important;

    color: var(--text, inherit) !important;

    font-family: inherit;

    font-size: .8rem;
    font-weight: 750;

    line-height: 1.2;

    text-align: center;

    white-space: nowrap;

    cursor: pointer;

    box-shadow:
        0 .1rem .3rem rgba(0, 0, 0, .025) !important;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background .18s ease,
        color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}


/* =========================================================
 * ACTION ICON
 * ========================================================= */

.mg-item-actions form.mg-action-form button svg,
.mg-item-actions form.mg-action-form button i,
.mg-item-actions form.mg-action-form input[type="submit"] svg,
.mg-item-actions form.mg-action-form input[type="submit"] i,
.mg-item-actions > button.mg-action-form svg,
.mg-item-actions > button.mg-action-form i {

    display: block;

    flex: 0 0 auto;

    width: 1rem;
    height: 1rem;

    margin: 0;

    transition:
        transform .18s ease,
        color .18s ease;
}


/* =========================================================
 * ACTION TEXT
 * ========================================================= */

.mg-item-actions form.mg-action-form button span,
.mg-item-actions form.mg-action-form input[type="submit"] span,
.mg-item-actions > button.mg-action-form span {

    display: inline-flex;
    align-items: center;

    min-width: 0;

    margin: 0;

    color: inherit;

    font-size: inherit;
    font-weight: inherit;

    line-height: 1.2;

    white-space: nowrap;
}


/* =========================================================
 * HOVER
 * ========================================================= */

.mg-item-actions form.mg-action-form button:hover,
.mg-item-actions form.mg-action-form input[type="submit"]:hover,
.mg-item-actions > button.mg-action-form:hover,
.mg-item-actions > input.mg-action-form[type="submit"]:hover {

    border-color: var(--brand) !important;

    background:
        rgba(0, 123, 255, .055) !important;

    color: var(--brand) !important;

    box-shadow:
        0 .25rem .7rem rgba(0, 123, 255, .08) !important;

    transform: translateY(-1px);
}


.mg-item-actions form.mg-action-form button:hover svg,
.mg-item-actions form.mg-action-form button:hover i,
.mg-item-actions > button.mg-action-form:hover svg,
.mg-item-actions > button.mg-action-form:hover i {

    transform: scale(1.08);
}


/* =========================================================
 * ACTIVE
 * Харесано / Добавено в любими
 * ========================================================= */

.mg-item-actions form.mg-action-form.is-active button,
.mg-item-actions form.mg-action-form.is-active input[type="submit"],
.mg-item-actions > button.mg-action-form.is-active,
.mg-item-actions > input.mg-action-form.is-active[type="submit"],
.mg-item-actions form.is-active button,
.mg-item-actions form.is-active input[type="submit"] {

    border-color: var(--brand) !important;

    background:
        rgba(0, 123, 255, .11) !important;

    color: var(--brand) !important;

    box-shadow:
        inset 0 0 0 1px rgba(0, 123, 255, .04),
        0 .2rem .6rem rgba(0, 123, 255, .06) !important;
}


/* =========================================================
 * ACTIVE ICON
 * ========================================================= */

.mg-item-actions form.mg-action-form.is-active button svg,
.mg-item-actions form.mg-action-form.is-active button i,
.mg-item-actions form.is-active button svg,
.mg-item-actions form.is-active button i {

    transform: scale(1.08);
}


/* =========================================================
 * ACTIVE HOVER
 * ========================================================= */

.mg-item-actions form.mg-action-form.is-active button:hover,
.mg-item-actions form.mg-action-form.is-active input[type="submit"]:hover,
.mg-item-actions > button.mg-action-form.is-active:hover,
.mg-item-actions > input.mg-action-form.is-active[type="submit"]:hover,
.mg-item-actions form.is-active button:hover,
.mg-item-actions form.is-active input[type="submit"]:hover {

    border-color: var(--brand) !important;

    background: var(--brand) !important;

    color: #fff !important;

    box-shadow:
        0 .3rem .8rem rgba(0, 123, 255, .18) !important;

    transform: translateY(-1px);
}

.mg-author-card {
    display:flex;
    align-items:center;
    gap:12px;

    width:100%;
    max-width:100%;

    margin:16px 0 20px;
    padding:10px 14px 10px 10px;

    border:1px solid var(--line);
    border-radius:var(--radius);

    background:var(--panel);
    box-sizing:border-box;
}

.mg-author-card-avatar {
    flex:0 0 44px;
}

.mg-author-card-avatar img {
    display:block;

    width:44px;
    height:44px;

    border-radius:50%;
    object-fit:cover;
}

.mg-author-card-info {
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;

    min-width:0;
    flex:1;

    line-height:1.2;
}

.mg-author-card-name {
    display:block;

    max-width:100%;

    font-size:var(--font-size-sm);
    font-weight:600;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.mg-author-card-role {
    display:block;

    margin-top:3px;

    color:var(--brand);
    font-size:var(--font-size-xs);
    font-weight:600;

    line-height:1.2;
}

.mg-author-card-date {
    display:block;

    margin-top:3px;

    color:var(--muted);
    font-size:var(--font-size-xs);

    line-height:1.2;
}

/* =========================================================
 * FOCUS
 * ========================================================= */

.mg-item-actions form.mg-action-form button:focus-visible,
.mg-item-actions form.mg-action-form input[type="submit"]:focus-visible,
.mg-item-actions > button.mg-action-form:focus-visible,
.mg-item-actions > input.mg-action-form[type="submit"]:focus-visible {

    outline: 2px solid var(--brand);

    outline-offset: 2px;
}


/* =========================================================
 * DISABLED
 * ========================================================= */

.mg-item-actions form.mg-action-form button:disabled,
.mg-item-actions form.mg-action-form input[type="submit"]:disabled {

    opacity: .55;

    cursor: not-allowed;

    transform: none !important;
}


/* =========================================================
 * MOBILE
 * ========================================================= */



@media (max-width: 42rem) {

    .mg-item-actions {

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        align-items: stretch;

        width: 100%;

        gap: .45rem;

        padding: .4rem;
    }

    .mg-item-actions form.mg-action-form {

        display: flex;

        width: 100%;
        min-width: 0;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {

        width: 100%;

        min-width: 0;

        min-height: 2.75rem;

        padding: .55rem .45rem !important;

        border-radius: 9px !important;

        font-size: .78rem;
    }

    .mg-item-actions form.mg-action-form button svg,
    .mg-item-actions form.mg-action-form button i {

        width: .95rem;
        height: .95rem;
    }
}


/* =========================================================
 * SMALL PHONES
 * ========================================================= */

@media (max-width: 32rem) {

    .mg-item-actions {

        gap: .4rem;

        padding: .35rem;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {

        min-height: 2.65rem;

        padding-inline: .3rem !important;

        font-size: .75rem;
    }
}


/* =========================================================
 * VERY SMALL PHONES
 * ========================================================= */

@media (max-width: 25rem) {

    .mg-item-actions {

        gap: .35rem;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {

        min-height: 2.6rem;

        padding-inline: .2rem !important;

        font-size: .72rem;
    }

    .mg-item-actions form.mg-action-form button svg,
    .mg-item-actions form.mg-action-form button i {

        width: .85rem;
        height: .85rem;
    }
}

/* =========================================================
 * DISABLED
 * ========================================================= */

.mg-item-actions form.mg-action-form button:disabled,
.mg-item-actions form.mg-action-form input[type="submit"]:disabled {
    opacity: .55;

    cursor: not-allowed;

    transform: none !important;
}


/* =========================================================
 * TABLET
 * ========================================================= */

@media (max-width: 58rem) {

    .mg-filters {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(8.5rem, 10rem)
            minmax(8.5rem, 10rem);
    }

    .mg-search {
        grid-column: 1 / -1;
    }

    .mg-filters > .btn {
        width: 100%;
    }

    .mg-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .mg-item-bottom {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .mg-item-actions {
        max-width: 100%;
    }
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-grid {
        grid-template-columns: 1fr !important;
        gap: .8rem;
    }

    .mg-hero {
        align-items: stretch;

        flex-direction: column;

        gap: 1rem;

        padding: 1.25rem;
    }

    .mg-hero-button {
        width: 100%;

        justify-content: center;
    }

    .mg-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: .8rem;
    }

    .mg-item-top {
        align-items: flex-start;

        gap: .6rem;

        margin-bottom: .65rem;
    }

    .mg-item-type {
        min-height: 1.95rem;

        padding: .38rem .6rem;

        font-size: .7rem;
    }

    .mg-item-title {
        margin-bottom: .85rem;
    }

    .mg-item-title h1 {
        font-size: clamp(1.4rem, 6vw, 1.9rem);

        line-height: 1.16;
    }

    .mg-item-image {
        border-radius: 10px;
    }

    .mg-item-image img {
        max-width: 100%;
        max-height: 70vh;
    }

    .mg-item-video {
        border-radius: 10px;
    }

    .mg-item-description {
        margin-top: .8rem;

        padding: .9rem;
    }

    .mg-item-bottom {
        display: flex;
        flex-direction: column;

        gap: .65rem;

        margin-top: .8rem;

        padding: .65rem;
    }

    .mg-item-stats {
        width: 100%;
    }

    .mg-item-actions {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        align-items: stretch;

        width: 100%;

        gap: .45rem;

        padding: .35rem;
    }

    .mg-item-actions form.mg-action-form {
        display: flex;

        width: 100%;
        min-width: 0;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {
        width: 100%;
        min-width: 0;
        min-height: 2.65rem;

        padding: .5rem .45rem !important;

        font-size: .78rem;
    }
}


/* =========================================================
 * SMALL TABLETS / LARGE PHONES
 * ========================================================= */

@media (max-width: 38rem) {

    .mg-filters {
        grid-template-columns: 1fr;
    }

    .mg-search,
    .mg-filters select,
    .mg-filters > .btn {
        grid-column: 1;
    }

    .mg-search input,
    .mg-filters select,
    .mg-filters > .btn {
        width: 100%;

        height: 2.7rem;
    }

    .mg-add-hero {
        align-items: flex-start;

        flex-direction: column;

        gap: .75rem;
    }

    .mg-add-hero .btn {
        width: 100%;

        justify-content: center;
    }

    .mg-add-card {
        padding: 1rem;
    }

    .mg-item-top {
        align-items: flex-start;

        flex-direction: row;

        flex-wrap: wrap;
    }

    .mg-item-type {
        flex: 0 0 auto;

        max-width: 100%;
    }

    .mg-item-stats {
        display: grid;

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: .35rem;

        width: 100%;
    }

    .mg-item-stats > span {
        justify-content: center;

        min-width: 0;
        min-height: 2.35rem;

        padding: .3rem .35rem;

        font-size: .72rem;

        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mg-item-actions {
        width: 100%;
    }
}


/* =========================================================
 * PHONES
 * ========================================================= */

@media (max-width: 32rem) {

    .mg-grid {
        grid-template-columns: 1fr;

        gap: .8rem;
    }

    .mg-card-body {
        padding: .9rem;
    }

    .mg-card-category {
        margin-bottom: .4rem;

        padding: .2rem .5rem;

        font-size: .65rem;
        line-height: 1.25;
    }

    .mg-card h3 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .mg-card-foot {
        gap: .75rem;
    }

    /* останалият ти CSS продължава */

    .mg-upload-box {
        padding: 1.5rem .7rem;
    }

    .mg-upload-title {
        font-size: 1rem;
    }

    .mg-upload-text {
        font-size: .82rem;
    }

    .mg-upload-button {
        width: 100%;

        justify-content: center;
    }

    .mg-form-actions {
        width: 100%;
    }

    .mg-form-actions .btn {
        width: 100%;

        justify-content: center;
    }

    .mg-item-title {
        margin-bottom: .75rem;
    }

    .mg-item-title h1 {
        font-size: clamp(1.35rem, 6.5vw, 1.75rem);

        line-height: 1.17;
    }

    .mg-item-description {
        padding: .85rem;
    }

    .mg-pagination {
        gap: .3rem;
    }

    .mg-pagination a {
        min-width: 2.2rem;
        min-height: 2.2rem;

        padding-inline: .5rem;
    }

    .mg-item-actions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {
        min-width: 0;

        font-size: .76rem;

        padding-inline: .3rem !important;
    }

    .mg-item-actions form.mg-action-form button span,
    .mg-item-actions form.mg-action-form input[type="submit"] span {
        overflow: hidden;

        text-overflow: ellipsis;
    }
}


/* =========================================================
 * VERY SMALL PHONES
 * ========================================================= */

@media (max-width: 25rem) {

    .mg-hero,
    .mg-add-hero,
    .mg-add-card {
        border-radius: 10px;
    }

    .mg-hero,
    .mg-add-hero {
        padding: 1.1rem;
    }

    .mg-hero h1,
    .mg-add-hero h1 {
        font-size: 1.5rem;
    }

    .mg-hero p,
    .mg-add-hero p {
        font-size: .88rem;
    }

    .mg-media {
        aspect-ratio: 4 / 3;
    }

    .mg-item-top {
        gap: .5rem;

        margin-bottom: .55rem;
    }

    .mg-item-type {
        min-height: 1.85rem;

        padding: .35rem .55rem;

        font-size: .67rem;
    }

    .mg-item-title h1 {
        font-size: 1.3rem;

        line-height: 1.18;
    }

    .mg-item-stats {
        grid-template-columns: 1fr 1fr 1fr;

        gap: .3rem;
    }

    .mg-item-stats > span {
        justify-content: center;

        padding-inline: .25rem;

        font-size: .68rem;
    }

    .mg-item-actions {
        grid-template-columns:
            1fr 1fr;
    }

    .mg-item-actions form.mg-action-form {
        width: 100%;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {
        width: 100%;

        min-height: 2.65rem;

        padding-inline: .2rem !important;

        font-size: .72rem;
    }

    .mg-item-actions form.mg-action-form button svg,
    .mg-item-actions form.mg-action-form button i {
        width: .85rem;
        height: .85rem;
    }
}


/* =========================================================
 * EXTRA SMALL PHONES
 * ========================================================= */

@media (max-width: 21rem) {

    .mg-hero {
        padding: 1rem;
    }

    .mg-upload-button {
        width: 100%;
    }

    .mg-youtube-input-icon {
        flex-basis: 2.6rem;

        width: 2.6rem;
    }

    .mg-youtube-input input {
        font-size: .85rem;
    }

    .mg-item-title h1 {
        font-size: 1.22rem;
    }

    .mg-item-stats {
        grid-template-columns: 1fr;
    }

    .mg-item-stats > span {
        justify-content: flex-start;

        padding-inline: .55rem;

        font-size: .72rem;
    }

    .mg-item-actions {
        grid-template-columns:
            1fr 1fr;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {
        min-height: 2.55rem;

        font-size: .69rem;
    }

    .mg-item-actions form.mg-action-form button span,
    .mg-item-actions form.mg-action-form input[type="submit"] span {
        white-space: nowrap;
    }
}
/* =========================================================
 * MOBILE GALLERY — ONE CARD PER ROW
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-grid {
        display: grid !important;

        grid-template-columns: minmax(0, 1fr) !important;

        width: 100% !important;

        gap: .8rem !important;
    }

    .mg-card {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* =========================================================
 * REDUCED MOTION
 * ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .mg-card,
    .mg-media img,
    .mg-play,
    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"],
    .mg-upload-box,
    .mg-youtube-input {
        transition: none !important;
    }

    .mg-card:hover {
        transform: none;
    }

    .mg-card:hover .mg-media img {
        transform: none;
    }

    .mg-card:hover .mg-play {
        transform: translate(-50%, -50%);
    }
}
/* =========================================================
 * ITEM TITLE — CLEAN CENTERED VERSION
 * ========================================================= */

.mg-item-title {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;

    margin: 0 0 1rem !important;

    text-align: center !important;
}

.mg-item-title h1 {
    display: block !important;

    width: auto;
    max-width: 100%;

    margin: 0 auto !important;

    padding: .55rem 1rem !important;

    border: 1px solid var(--line, var(--border)) !important;
    border-radius: 10px !important;

    background: var(--card-bg, var(--panel)) !important;

    color: inherit;

    font-size: clamp(1.4rem, 4vw, 2.1rem);
    font-weight: 750;

    line-height: 1.2;

    text-align: center !important;

    overflow-wrap: anywhere;

    box-sizing: border-box;
}


/* =========================================================
 * IMAGE — VISUAL SEPARATION FROM TITLE
 * ========================================================= */

.mg-item-image {
    margin-top: .25rem;

    border: 0;
    outline: 0;

    border-radius: 12px;

    overflow: hidden;

    background: var(--bg-soft, var(--panel));

    box-shadow: none;
}

.mg-item-image a,
.mg-item-image a:focus,
.mg-item-image a:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-item-title {
        margin-bottom: .8rem !important;
    }

    .mg-item-title h1 {
        padding: .5rem .75rem !important;

        font-size: clamp(1.3rem, 6vw, 1.8rem);
    }

    .mg-item-image {
        margin-top: .15rem;

        border-radius: 10px;
    }
}
/* =========================================================
 * ITEM TITLE + CATEGORY — VERTICAL
 * ========================================================= */

.mg-item-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;

    width: 100% !important;
    margin: 0 0 1rem !important;

    text-align: center !important;
}

.mg-item-title .mg-card-category {
    margin: 0 !important;
    flex: 0 0 auto;
    text-align: center !important;
}

.mg-item-title h1 {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding: .55rem 1rem !important;

    border: 1px solid var(--line, var(--border)) !important;
    border-radius: 10px !important;

    background: var(--card-bg, var(--panel)) !important;
    color: inherit;

    font-size: clamp(1.4rem, 4vw, 2.1rem);
    font-weight: 750;
    line-height: 1.2;

    text-align: center !important;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}
/* =========================================================
 * MEDIA TYPE BADGE — ЕДНАКВА ВИСОЧИНА
 * ========================================================= */

.mg-item-media {
    display: flex !important;
    align-items: center !important;
    gap: .65rem !important;
}

.mg-item-media .mg-media-type,
.mg-item-media .mg-type-badge,
.mg-item-media .mg-card-category {
    position: static !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transform: none !important;
    align-self: center !important;
}
/* =========================================================
 * ITEM TOP
 * Back to gallery + media type
 * ========================================================= */

.mg-item-top {
    display: flex;

    align-items: center;
    justify-content: flex-start;

    gap: .65rem;

    width: 100%;
    min-width: 0;

    margin-bottom: .75rem;

    flex-wrap: wrap;
}


/* =========================================================
 * BACK TO GALLERY
 * ========================================================= */

.mg-item-top .mg-item-back {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: auto;
    max-width: 100%;

    min-width: 0;
    min-height: 2.45rem;
    height: 2.45rem;

    margin: 0;
    padding: .45rem .75rem;

    box-sizing: border-box;

    gap: .4rem;

    white-space: nowrap;

    overflow: hidden;
}


/* Icon */

.mg-item-top .mg-item-back svg,
.mg-item-top .mg-item-back i {
    flex: 0 0 auto;

    width: .85rem;
    height: .85rem;

    margin: 0;
}


/* Text */

.mg-item-top .mg-item-back span {
    display: inline-block;

    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
 * MEDIA TYPE
 * ========================================================= */

.mg-item-top .mg-item-type {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: auto;
    max-width: 100%;

    min-width: 0;
    min-height: 2.45rem;
    height: 2.45rem;

    margin: 0;
    padding: .45rem .7rem;

    box-sizing: border-box;

    gap: .4rem;

    white-space: nowrap;

    overflow: hidden;
}

.mg-item-type-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: .85rem;
    height: .85rem;

    margin: 0;
}

.mg-item-type-icon svg,
.mg-item-type-icon i {
    width: .85rem;
    height: .85rem;

    margin: 0;
}

.mg-item-type-text {
    display: inline-flex;

    align-items: center;

    min-width: 0;
    height: 100%;

    line-height: 1;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-item-top {
        align-items: center;

        gap: .5rem;

        width: 100%;

        flex-wrap: nowrap;
    }

    .mg-item-top .mg-item-back {
        flex: 0 1 auto;

        width: auto;
        max-width: calc(100% - 5rem);

        height: 2.4rem;
        min-height: 2.4rem;

        padding: .4rem .65rem;
    }

    .mg-item-top .mg-item-type {
        flex: 0 0 auto;

        width: auto;

        height: 2.4rem;
        min-height: 2.4rem;

        padding: .4rem .65rem;
    }
}


/* =========================================================
 * SMALL PHONES
 * ========================================================= */

@media (max-width: 32rem) {

    .mg-item-top {
        gap: .4rem;
    }

    .mg-item-top .mg-item-back {
        max-width: calc(100% - 4.7rem);

        height: 2.35rem;
        min-height: 2.35rem;

        padding: .4rem .55rem;
    }

    .mg-item-top .mg-item-type {
        height: 2.35rem;
        min-height: 2.35rem;

        padding: .4rem .55rem;
    }

    .mg-item-type-icon,
    .mg-item-type-icon svg,
    .mg-item-type-icon i {
        width: .8rem;
        height: .8rem;
    }

    .mg-item-type-text {
        font-size: .72rem;
    }
}


/* =========================================================
 * VERY SMALL PHONES
 * ========================================================= */

@media (max-width: 25rem) {

    .mg-item-top {
        gap: .35rem;
    }

    .mg-item-top .mg-item-back {
        max-width: calc(100% - 4.5rem);

        height: 2.3rem;
        min-height: 2.3rem;

        padding: .35rem .5rem;
    }

    .mg-item-top .mg-item-type {
        height: 2.3rem;
        min-height: 2.3rem;

        padding: .35rem .5rem;
    }
}


/* =========================================================
 * EXTRA SMALL PHONES
 * ========================================================= */

@media (max-width: 21rem) {

    .mg-item-top {
        align-items: stretch;

        flex-wrap: wrap;

        gap: .4rem;
    }

    .mg-item-top .mg-item-back {
        flex: 1 1 auto;

        max-width: none;

        min-width: 0;
    }

    .mg-item-top .mg-item-type {
        flex: 0 0 auto;
    }
}


/* =========================================================
 * VERY SMALL PHONES
 * ========================================================= */

@media (max-width: 25rem) {

    .mg-item-top {
        gap: .4rem;
    }

    .mg-item-top .mg-item-back,
    .mg-item-top .mg-item-type {
        height: 2.3rem;
        min-height: 2.3rem;
    }

    .mg-item-top .mg-item-back {
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .mg-item-top .mg-item-type {
        padding-left: .5rem;
        padding-right: .5rem;
    }
}
@media (max-width:600px) {

    .mg-item-stats .mg-stat-label {
        display: none;
    }

    .mg-author-card {
        gap:9px;

        margin:12px 0 16px;
        padding:8px 11px 8px 8px;
    }

    .mg-author-card-avatar {
        flex-basis:40px;
    }

    .mg-author-card-avatar img {
        width:40px;
        height:40px;
    }

    .mg-author-card-name {
        font-size:var(--font-size-xs);
    }

    .mg-author-card-role {
        font-size:11px;
    }

    .mg-author-card-date {
        font-size:11px;
    }
}


@media (max-width:380px) {

    .mg-author-card {
        gap:8px;

        padding:7px 9px 7px 7px;
    }

    .mg-author-card-avatar {
        flex-basis:36px;
    }

    .mg-author-card-avatar img {
        width:36px;
        height:36px;
    }
}
@media (max-width:600px) {

    .mg-card-author {
        gap:7px;

        margin-top:9px;
        padding:6px 8px 6px 6px;
    }

    .mg-card-author-avatar {
        flex-basis:30px;
    }

    .mg-card-author-avatar img {
        width:30px;
        height:30px;
    }

    .mg-card-author-name {
        font-size:11px;
    }

    .mg-card-author-role {
        font-size:10px;
    }

    .mg-card-author-date {
        font-size:10px;
    }
}


@media (max-width:380px) {

    .mg-card-author {
        gap:6px;

        padding:5px 7px 5px 5px;
    }

    .mg-card-author-avatar {
        flex-basis:28px;
    }

    .mg-card-author-avatar img {
        width:28px;
        height:28px;
    }
}

.mg-item-page,
.mg-item-content,
.mg-item-comments,
.mg-comments,
.mg-comment-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* =========================================================
 * ITEM ACTIONS — FULL ROW BELOW STATS
 * ========================================================= */

.mg-item-actions {
    grid-column: 1 / -1 !important;

    display: flex !important;

    flex-direction: row !important;
    flex-wrap: wrap !important;

    align-items: center !important;
    justify-content: center !important;

    gap: .55rem !important;

    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding: .4rem !important;

    box-sizing: border-box;
}
/* =========================================================
 * MEDIA CARD FOOT — STATISTICS BLOCK
 * ========================================================= */

.mg-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: .5rem;

    width: 100%;
    min-width: 0;

    margin-top: .7rem;
    padding: .55rem .65rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .12rem .4rem rgba(0, 0, 0, .025);
}


/* =========================================================
 * INDIVIDUAL STAT
 * ========================================================= */

.mg-card-foot > span {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1 1 0;

    gap: .35rem;

    min-width: 0;

    padding: .4rem .5rem;

    border-radius: 8px;

    color: var(--muted, #777);

    font-size: .75rem;
    font-weight: 650;
    line-height: 1.2;

    text-align: center;
    white-space: nowrap;

    box-sizing: border-box;
}


/* =========================================================
 * ICON
 * ========================================================= */

.mg-card-foot > span > svg,
.mg-card-foot > span > i {
    width: 1rem;
    height: 1rem;

    flex: 0 0 auto;

    opacity: .8;
}


/* =========================================================
 * NUMBER
 * ========================================================= */

.mg-card-foot > span > span {
    display: inline-flex;
    align-items: center;

    min-width: 0;
}


/* =========================================================
 * HOVER
 * ========================================================= */

.mg-card-foot > span:hover {
    color: var(--text, inherit);

    background: var(--bg-soft, var(--panel));
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-card-foot {
        gap: .3rem;

        margin-top: .55rem;
        padding: .45rem .5rem;

        border-radius: 10px;
    }

    .mg-card-foot > span {
        gap: .25rem;

        padding: .35rem .3rem;

        font-size: .72rem;
    }

    .mg-card-foot > span > svg,
    .mg-card-foot > span > i {
        width: .9rem;
        height: .9rem;
    }

}

/* =========================================================
 * COMPLETE MEDIA CARD
 * ========================================================= */

.mg-card-container {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;

    padding: .75rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .12rem .4rem rgba(0, 0, 0, .025);

    overflow: hidden;
}


/* =========================================================
 * ITEM DESCRIPTION
 * ========================================================= */

.mg-item-description {
    display: block;

    width: 100%;
    min-width: 0;

    margin-top: 1rem;
    padding: 1rem 1.1rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .12rem .4rem rgba(0, 0, 0, .025);

    white-space: pre-wrap;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================================================
 * DESCRIPTION LABEL
 * ========================================================= */

.mg-item-description-label {
    margin: 0 0 .45rem;

    color: var(--brand);

    font-size: .7rem;
    font-weight: 800;

    letter-spacing: .05em;
    line-height: 1.3;

    text-transform: uppercase;
}


/* =========================================================
 * DESCRIPTION TEXT
 * ========================================================= */

.mg-item-description > div:not(.mg-item-description-label) {
    color: var(--text, inherit);

    font-size: .8rem;
    font-weight: 500;

    line-height: 1.55;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-item-description {
        margin-top: .7rem;
        padding: .75rem .8rem;

        border-radius: var(--radius, 12px);
    }

    .mg-item-description-label {
        margin-bottom: .4rem;

        font-size: .68rem;
    }

    .mg-item-description > div:not(.mg-item-description-label) {
        font-size: .75rem;
        line-height: 1.5;
    }

}

.mg-card-body h3 {
    width: 100%;
    min-width: 0;

    margin: .2rem 0 0;

    color: var(--text, inherit);

    font-size: 1.05rem;
    font-weight: 800;

    line-height: 1.35;
    letter-spacing: -.01em;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.mg-card-body h3 a {
    display: block;

    color: inherit;

    text-decoration: none;
}

.mg-card-body h3 a:hover {
    color: var(--brand);
}
/* =========================================================
 * ITEM BOTTOM — SINGLE COLUMN
 * ========================================================= */

.mg-item-bottom {
    display: flex !important;

    flex-direction: column !important;

    align-items: stretch !important;

    gap: .75rem;

    width: 100%;
    min-width: 0;

    margin-top: 1rem;
    padding: .75rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));
}


/* =========================================================
 * ITEM STATS — FULL WIDTH
 * ========================================================= */

.mg-item-stats {
    width: 100% !important;
    max-width: 100% !important;

    min-width: 0;

    box-sizing: border-box;

    grid-column: auto !important;

    margin-top: 8px;

    justify-content: center;
}


/* =========================================================
 * ITEM ACTIONS — FULL WIDTH
 * ========================================================= */

.mg-item-actions {
    width: 100% !important;
    max-width: 100% !important;

    min-width: 0;

    box-sizing: border-box;

    margin: 0 !important;

    grid-column: auto !important;
}


/* =========================================================
 * COMMENTS — FULL WIDTH
 * ========================================================= */

.mg-item-comments,
.mg-comments,
.mg-comment-form {
    width: 100% !important;
    max-width: 100% !important;

    min-width: 0 !important;

    box-sizing: border-box;

    grid-column: auto !important;
}

/* =========================================================
 * MEDIA GALLERY — ADMIN THUMBNAILS
 * ========================================================= */

.mg-admin-media {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
}

.mg-admin-thumb {
    display: block;
    width: 90px;
    height: 60px;
    flex: 0 0 90px;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
}

.mg-admin-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-admin-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f1f1f1;
    font-size: 22px;
}

.mg-admin-media-info {
    min-width: 0;
}

.mg-admin-media-info b {
    display: inline-block;
    max-width: 100%;
}

.mg-admin-media-info b a {
    text-decoration: none;
}

.mg-admin-media-info small {
    white-space: nowrap;
}

@media (max-width: 800px) {

    .mg-admin-media {
        min-width: 200px;
    }

    .mg-admin-thumb {
        width: 70px;
        height: 48px;
        flex-basis: 70px;
    }

}
.mg-card {
    position: relative;
}


/* media_gallery_profile */

/* =========================================================
 * MEDIA GALLERY PROFILE
 * ========================================================= */

.page-media-gallery-profile .mg-profile-page {
    width: 100%;
    box-sizing: border-box;
}


/* =========================================================
 * HEADER
 * ========================================================= */

.page-media-gallery-profile .mg-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-sizing: border-box;
}


.page-media-gallery-profile .mg-profile-header-title {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}


.page-media-gallery-profile .mg-profile-header-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f3f4f6;
    font-size: 21px;
}


.page-media-gallery-profile .mg-profile-header h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
    color: #222;
}


.page-media-gallery-profile .mg-profile-header-subtitle {
    margin-top: 4px;
    color: #777;
    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
 * SWITCH BUTTONS
 * ========================================================= */

.page-media-gallery-profile .mg-profile-switch {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}


.page-media-gallery-profile .mg-profile-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #ddd;
    border-radius: 9px;
    background: #fff;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    box-sizing: border-box;
    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease;
}


.page-media-gallery-profile .mg-profile-switch-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    text-decoration: none;
}


.page-media-gallery-profile .mg-profile-switch-btn.is-active {
    background: #007BFF;
    border-color: #007BFF;
    color: #fff;
}


.page-media-gallery-profile .mg-profile-switch-btn span {
    opacity: .75;
    font-weight: 700;
}


.page-media-gallery-profile .mg-profile-switch-btn.is-active span {
    opacity: 1;
}


/* =========================================================
 * PROFILE GRID
 *
 * Uses the same card system as the main Media Gallery.
 * ========================================================= */

.page-media-gallery-profile .mg-profile-grid {
    width: 100%;
}


/*
 * If the main Gallery CSS already defines .mg-grid,
 * its grid layout is used directly.
 *
 * This fallback only makes sure the Profile grid still
 * behaves correctly if the main grid CSS is not scoped
 * globally.
 */

.page-media-gallery-profile .mg-profile-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
}


/* =========================================================
 * MAIN GALLERY CARD COMPATIBILITY
 *
 * These rules use the SAME class names as the main Gallery.
 * They do not recreate the old Profile card design.
 * ========================================================= */

.page-media-gallery-profile .mg-card-wrap,
.page-media-gallery-profile .mg-card-container {
    min-width: 0;
}


/*
 * Author section.
 *
 * Same class names and visual proportions as the main Gallery.
 */

.page-media-gallery-profile .mg-card-author {
    display: flex;
    align-items: center;
    min-width: 0;
}


.page-media-gallery-profile .mg-card-author-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 50%;
}


.page-media-gallery-profile .mg-card-author-avatar img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: cover;
}


.page-media-gallery-profile .mg-card-author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}


.page-media-gallery-profile .mg-card-author-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.page-media-gallery-profile .mg-card-author-role {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.page-media-gallery-profile .mg-card-author-date {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
 * EMPTY STATE
 * ========================================================= */

.page-media-gallery-profile .mg-profile-empty {
    padding: 50px 22px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    text-align: center;
    box-sizing: border-box;
}


.page-media-gallery-profile .mg-profile-empty-icon {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 14px;
}


.page-media-gallery-profile .mg-profile-empty-title {
    color: #222;
    font-size: 17px;
    font-weight: 700;
}


.page-media-gallery-profile .mg-profile-empty-text {
    max-width: 520px;
    margin: 8px auto 18px;
    color: #777;
    font-size: 13px;
    line-height: 1.5;
}


.page-media-gallery-profile .mg-profile-gallery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    border-radius: 8px;
    background: #007BFF;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}


.page-media-gallery-profile .mg-profile-gallery-btn:hover {
    background: #0069d9;
    color: #fff;
    text-decoration: none;
}


/* =========================================================
 * PAGINATION
 * ========================================================= */

.page-media-gallery-profile .mg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 20px;
}


.page-media-gallery-profile .mg-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0 .65rem;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fff;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease;
}


.page-media-gallery-profile .mg-pagination a:hover {
    background: #f5f5f5;
    border-color: #ccc;
    text-decoration: none;
}


.page-media-gallery-profile .mg-pagination a.is-active {
    background: #007BFF;
    border-color: #007BFF;
    color: #fff;
}


/* =========================================================
 * PRIVACY SETTINGS
 * ========================================================= */

.mg-profile-privacy {
    width: 100%;
    max-width: 760px;
    box-sizing: border-box;
}


.mg-profile-privacy-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-sizing: border-box;
}


.mg-profile-privacy-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f3f4f6;
    font-size: 20px;
}


.mg-profile-privacy-header h2 {
    margin: 0;
    color: #222;
    font-size: 20px;
    line-height: 1.25;
}


.mg-profile-privacy-header p {
    margin: 5px 0 0;
    color: #777;
    font-size: 13px;
    line-height: 1.5;
}


.mg-profile-privacy-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    margin-bottom: 10px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-sizing: border-box;
    cursor: pointer;
}


.mg-profile-privacy-option:hover {
    border-color: #d5d5d5;
    background: #fafafa;
}


.mg-profile-privacy-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 2px 0 0;
    cursor: pointer;
}


.mg-profile-privacy-option-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}


.mg-profile-privacy-option-title {
    color: #222;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}


.mg-profile-privacy-option-description {
    color: #777;
    font-size: 12px;
    line-height: 1.5;
}


.mg-profile-privacy-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 15px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-sizing: border-box;
}


.mg-profile-privacy-info strong {
    color: #333;
    font-size: 13px;
}


.mg-profile-privacy-info span {
    color: #777;
    font-size: 12px;
    line-height: 1.5;
}


.mg-profile-privacy-actions {
    display: flex;
    align-items: center;
    margin-top: 18px;
}


.mg-profile-privacy-actions .btn {
    min-height: 40px;
    padding: 0 17px;
}

/* =====================================================
 * MEDIA GALLERY PROFILE PRIVACY
 * ===================================================== */

.mg-profile-privacy {
    width: 100%;
    max-width: 760px;
    box-sizing: border-box;
}


/* =====================================================
 * HEADER
 * ===================================================== */

.mg-profile-privacy-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-sizing: border-box;
}

.mg-profile-privacy-header-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f3f4f6;
    color: #555;
}

.mg-profile-privacy-header-icon svg {
    width: 20px;
    height: 20px;
}

.mg-profile-privacy-header-text {
    min-width: 0;
}

.mg-profile-privacy-header-text h3 {
    margin: 0;
    color: #222;
    font-size: 20px;
    line-height: 1.25;
}

.mg-profile-privacy-header-text p {
    margin: 5px 0 0;
    color: #777;
    font-size: 13px;
    line-height: 1.5;
}


/* =====================================================
 * SETTINGS LIST
 * ===================================================== */

.mg-profile-privacy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* =====================================================
 * INDIVIDUAL PRIVACY CARD
 * ===================================================== */

.mg-profile-privacy-card {
    display: block;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;

    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease,
        box-shadow .15s ease;
}

.mg-profile-privacy-card:hover {
    border-color: #cfd8e3;
    background: #fafcff;
}


/* =====================================================
 * TOP ROW
 * ===================================================== */

.mg-profile-privacy-card-main {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}


/* =====================================================
 * ICON
 * ===================================================== */

.mg-profile-privacy-card-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 12px;

    border-radius: 9px;
    background: #f4f6f8;
    color: #555;
}

.mg-profile-privacy-card-icon svg {
    width: 18px;
    height: 18px;
}


/* =====================================================
 * TITLE
 * ===================================================== */

.mg-profile-privacy-card-title {
    min-width: 0;
    flex: 1;

    color: #222;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}


/* =====================================================
 * SWITCH
 * ===================================================== */

.mg-profile-privacy-card-switch {
    position: relative;

    width: 44px;
    height: 24px;
    min-width: 44px;

    margin-left: 14px;

    flex: 0 0 44px;
}


/* -----------------------------------------------------
 * CHECKBOX
 * ----------------------------------------------------- */

.mg-profile-privacy-card-switch input {
    position: absolute;

    width: 44px;
    height: 24px;

    margin: 0;
    padding: 0;

    opacity: 0;

    cursor: pointer;

    z-index: 2;
}


/* -----------------------------------------------------
 * SLIDER
 * ----------------------------------------------------- */

.mg-profile-privacy-slider {
    position: absolute;

    left: 0;
    top: 0;

    width: 44px;
    height: 24px;

    border-radius: 24px;

    background: #cfd4da;

    pointer-events: none;

    transition:
        background .2s ease;
}


/* -----------------------------------------------------
 * KNOB
 * ----------------------------------------------------- */

.mg-profile-privacy-slider::before {
    content: "";

    position: absolute;

    width: 18px;
    height: 18px;

    left: 3px;
    top: 3px;

    border-radius: 50%;

    background: #fff;

    box-shadow:
        0 1px 3px rgba(0,0,0,.20);

    transition:
        transform .2s ease;
}


/* -----------------------------------------------------
 * ON
 * ----------------------------------------------------- */

.mg-profile-privacy-card-switch
input:checked
~ .mg-profile-privacy-slider {

    background: #007BFF !important;
}


.mg-profile-privacy-card-switch
input:checked
~ .mg-profile-privacy-slider::before {

    transform: translateX(20px);
}


/* -----------------------------------------------------
 * OFF
 * ----------------------------------------------------- */

.mg-profile-privacy-card-switch
input:not(:checked)
~ .mg-profile-privacy-slider {

    background: #cfd4da !important;
}


.mg-profile-privacy-card-switch
input:not(:checked)
~ .mg-profile-privacy-slider::before {

    transform: translateX(0);
}


/* =====================================================
 * DESCRIPTION
 *
 * Separate row below the title/switch.
 * ===================================================== */

.mg-profile-privacy-card-description {
    margin-top: 8px;

    margin-left: 50px;

    color: #777;

    font-size: 13px;
    line-height: 1.5;

    max-width: calc(100% - 64px);

    overflow-wrap: anywhere;
}


/* =====================================================
 * INFORMATION NOTE
 * ===================================================== */

.mg-profile-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    margin-top: 15px;
    padding: 13px 15px;

    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;

    color: #777;
    font-size: 12px;
    line-height: 1.5;

    box-sizing: border-box;
}

.mg-profile-privacy-note-icon {
    flex: 0 0 auto;
    margin-top: 1px;
}

.mg-profile-privacy-note-icon svg {
    width: 16px;
    height: 16px;
}


/* =========================================================
 * RESPONSIVE
 * ========================================================= */

@media (max-width: 1100px) {

    .page-media-gallery-profile .mg-profile-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


@media (max-width: 800px) {

    .page-media-gallery-profile .mg-profile-header {
        align-items: flex-start;
        flex-direction: column;
    }


    .page-media-gallery-profile .mg-profile-switch {
        width: 100%;
    }


    .page-media-gallery-profile .mg-profile-switch-btn {
        flex: 1 1 0;
    }


    .page-media-gallery-profile .mg-profile-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 12px;
    }


    .mg-profile-privacy {
        max-width: 100%;
    }

}


@media (max-width: 480px) {

    .page-media-gallery-profile .mg-profile-header {
        padding: 14px;
        margin-bottom: 15px;
        border-radius: 11px;
    }


    .page-media-gallery-profile .mg-profile-header h2 {
        font-size: 18px;
    }


    .page-media-gallery-profile .mg-profile-header-subtitle {
        font-size: 12px;
    }


    .page-media-gallery-profile .mg-profile-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 9px;
    }


    /*
     * Do NOT shrink the author to the old
     * mg-profile-card-author design.
     *
     * Main Gallery uses 34px avatar.
     */
    .page-media-gallery-profile .mg-card-author-avatar {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }


    .page-media-gallery-profile .mg-card-author-avatar img {
        width: 34px;
        height: 34px;
    }


    .page-media-gallery-profile .mg-profile-empty {
        padding: 38px 15px;
    }


    .page-media-gallery-profile .mg-pagination {
        gap: 4px;
        margin-top: 16px;
    }


    .page-media-gallery-profile .mg-pagination a {
        min-width: 2.15rem;
        min-height: 2.15rem;
        padding: 0 .5rem;
        font-size: 12px;
    }


    .mg-profile-privacy-header {
        padding: 14px;
        border-radius: 11px;
    }


    .mg-profile-privacy-option {
        padding: 14px;
    }


    .mg-profile-privacy-header h2 {
        font-size: 18px;
    }

}
/* =====================================================
 * MOBILE
 * ===================================================== */

@media (max-width: 600px) {

    .mg-profile-privacy-header {
        gap: 10px;
        margin-bottom: 15px;
        padding: 14px;
    }

    .mg-profile-privacy-header-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .mg-profile-privacy-header-text h3 {
        font-size: 16px;
    }

    .mg-profile-privacy-header-text p {
        font-size: 13px;
    }

    .mg-profile-privacy-card {
        padding: 13px;
    }

    .mg-profile-privacy-card-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        margin-right: 10px;
    }

    .mg-profile-privacy-card-title {
        font-size: 14px;
    }

    .mg-profile-privacy-card-switch {
        width: 44px;
        min-width: 44px;
        margin-left: 10px;
    }

    .mg-profile-privacy-card-description {
        margin-top: 7px;
        margin-left: 44px;
        max-width: calc(100% - 44px);
        font-size: 12px;
        line-height: 1.45;
    }

    .mg-profile-privacy-note {
        padding: 12px 13px;
    }
}

/* messages */
.page-messages .layout-main{max-width:100%}.chat{display:grid;grid-template-columns:300px 1fr;height:calc(100vh - 140px);min-height:420px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);overflow:hidden}.chat-list{border-inline-end:1px solid var(--line);overflow-y:auto}.chat-list-head{padding:12px 16px;border-bottom:1px solid var(--line)}.chat-list-head h3{margin:0}.chat-item{display:flex;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line);color:inherit;text-decoration:none}.chat-item:hover,.chat-item.active{background:var(--panel-2)}.chat-item-main{flex:1;min-width:0}.chat-item-top{display:flex;justify-content:space-between;gap:8px}.chat-item-top time{color:var(--text-muted);font-size:var(--font-size-xs);white-space:nowrap}.chat-item-last{color:var(--text-muted);font-size:var(--font-size-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-item.unread .chat-item-last{color:var(--text);font-weight:600}.chat-item.unread b::after{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--brand);margin-inline-start:6px;vertical-align:middle}.chat-pane{display:flex;flex-direction:column;min-width:0;min-height:0}.chat-head{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line)}.chat-head-tools{margin-inline-start:auto;display:flex;gap:6px}.chat-back{display:none;color:inherit}.chat-who{display:flex;flex-direction:column;min-width:0;line-height:1.25}.chat-who small{color:var(--text-muted);font-size:var(--font-size-xs)}.chat-more{text-align:center;color:var(--text-muted);font-size:var(--font-size-xs);padding:4px 0}.chat-log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px;display:flex;flex-direction:column;gap:4px}.chat-day{text-align:center;margin:10px 0 4px;color:var(--text-muted);font-size:var(--font-size-xs)}.chat-msg{display:flex;align-items:center;gap:4px}.chat-msg.me{justify-content:flex-end}.bubble{max-width:75%;padding:8px 12px;border-radius:18px;background:var(--panel-2);line-height:1.4}.chat-msg.me .bubble{background:var(--brand);color:#fff}.chat-msg.me .bubble a{color:#fff;text-decoration:underline}.bubble .post-content{display:inline}.bubble .post-content p{display:inline;margin:0}.bubble .post-content p+p::before{content:"\A";white-space:pre}.chat-meta{display:inline-flex;align-items:center;gap:4px;margin-inline-start:8px;vertical-align:bottom;font-size:10px;opacity:.75;white-space:nowrap}.chat-edited{font-style:italic}.chat-tick{display:inline-flex;line-height:0}.chat-tick svg{width:16px;height:11px}.chat-tick .chat-tick-2{display:none}.chat-tick.is-read .chat-tick-2{display:inline}.chat-msg.me .chat-meta:has(.is-read){opacity:1}.chat-item-last .chat-tick{margin-inline-end:3px;vertical-align:-1px;color:var(--text-muted)}.chat-item-last .chat-tick.is-read{color:var(--brand)}.chat-tools{display:none;gap:2px}.chat-msg.me:hover .chat-tools,.chat-msg.show-tools .chat-tools,.chat-tools:focus-within{display:inline-flex}.chat-tool{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--text-muted);cursor:pointer}.chat-tool:hover{background:var(--panel-2);color:var(--text)}.chat-tool svg{width:15px;height:15px}.chat-recalled{justify-content:center}.chat-note{padding:2px 10px;border-radius:999px;background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs)}.chat-editing{display:flex;align-items:center;gap:8px;padding:6px 14px;border-top:1px solid var(--line);background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-sm)}.chat-editing svg{width:15px;height:15px}.chat-editing span{flex:1}.chat-editing[hidden]{display:none}.chat-editing+.chat-input{border-top:0}.chat-input{display:flex;gap:8px;padding:10px 14px;border-top:1px solid var(--line);align-items:flex-end}.chat-input textarea{flex:1;resize:none;min-height:38px;max-height:140px}.chat-empty{padding:40px 20px;text-align:center}.chat-none .chat-empty{margin:auto}@media (max-width:760px){.chat{grid-template-columns:1fr;height:auto;min-height:0}.chat:not(.chat-open) .chat-list{overflow:visible;border-inline-end:0}.chat-open .chat-list{display:none}.chat:not(.chat-open) .chat-pane{display:none}.chat-open{position:fixed;left:0;right:0;top:0;z-index:85;height:100vh;height:100dvh;height:var(--chat-vh,100dvh);border:0;border-radius:0}body.page-messages-chat{overflow:hidden}.chat-open .chat-head{padding:8px 10px}.chat-open .chat-head .btn{padding-inline:8px}.chat-open .chat-log{padding:10px}.chat-open .chat-input{padding:8px 10px calc(8px + env(safe-area-inset-bottom))}.chat-open .chat-input textarea{font-size:16px}.chat-back{display:inline-flex;padding:4px}.bubble{max-width:88%}.chat-msg.me:hover .chat-tools{display:none}.chat-msg.show-tools .chat-tools{display:inline-flex}}

/* nsfw */
.nsfw-badge{display:inline-block;margin-inline-start:4px;padding:0 6px;border-radius:4px;background:#e0245e;color:#fff;font-size:10px;font-weight:700;letter-spacing:.3px;line-height:1.7;vertical-align:middle}.topic-title .nsfw-badge{font-size:12px;line-height:1.8;padding:0 8px}

/* oidc_center */
/* OIDC Center — consent screen, Third-party apps, Open platform and the admin page.
   Only core CSS variables are used, and every selector is scoped to this plugin. */

.oidc_center-shell { display: grid; gap: .75rem; }

.oidc_center-apps { display: flex; flex-direction: column; gap: .65rem; }

.oidc_center-app {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.oidc_center-app-icon {
  flex: 0 0 auto;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.oidc_center-app-icon img { inline-size: 100%; block-size: 100%; object-fit: cover; }

.oidc_center-app-body { flex: 1 1 auto; min-inline-size: 0; }

.oidc_center-app-name { font-weight: 600; color: var(--text); }
.oidc_center-app-name a { color: var(--text); }

.oidc_center-app-meta { color: var(--text-muted); font-size: var(--font-size-xs); }

.oidc_center-note { color: var(--text-muted); font-size: var(--font-size-xs); }

.oidc_center-empty {
  color: var(--text-muted);
  padding: 1rem;
  text-align: center;
}

.oidc_center-scopes { display: flex; flex-wrap: wrap; gap: .25rem; margin-block: .35rem; }

.oidc_center-scope {
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--text);
  font-size: var(--font-size-xs);
}

.oidc_center-status {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

.oidc_center-status[data-oidc_center-status="active"] { background: var(--success-soft); color: var(--success); }
.oidc_center-status[data-oidc_center-status="pending"] { background: var(--warning-soft); color: var(--warning); }
.oidc_center-status[data-oidc_center-status="rejected"] { background: var(--danger-soft); color: var(--danger); }
.oidc_center-status[data-oidc_center-status="suspended"] { background: var(--danger-soft); color: var(--danger); }

.oidc_center-mono {
  display: block;
  padding: .4rem .55rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  font-size: var(--font-size-xs);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.oidc_center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  margin-block-start: .5rem;
}

.oidc_center-actions form { display: inline-flex; margin: 0; }

.oidc_center-copy {
  padding: .15rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  font-size: var(--font-size-xs);
  cursor: pointer;
}

.oidc_center-copy:hover { background: var(--brand-soft); }

.oidc_center-consent-head {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-block-end: .75rem;
}

.oidc_center-consent-list {
  margin-block: .5rem;
  padding-inline-start: 1.1rem;
  color: var(--text-muted);
}

.oidc_center-consent-list li { margin-block: .2rem; }

.oidc_center-checks { display: grid; gap: .3rem; }

.oidc_center-check {
  display: flex;
  gap: .4rem;
  align-items: baseline;
  color: var(--text);
  font-size: var(--font-size-sm);
}

.oidc_center-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.oidc_center-stat { color: var(--text); font-size: var(--font-size-xl); font-weight: 600; }

.oidc_center-redirect { max-inline-size: 32rem; margin-inline: auto; margin-block: 3rem; }

.oidc_center-admin-note { margin-block-end: 1rem; }

.oidc_center-ok { color: var(--success); }
.oidc_center-bad { color: var(--danger); }


/* pages */
.pages-page h1{margin-bottom:4px}.pages-page .post-content{margin-top:16px}.pages-page .post-content h2{margin-top:26px}.pages-page .post-content h3{margin-top:18px}

/* poll */
.poll-box{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2);padding:14px;margin:14px 0}.poll-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}.poll-head b{font-size:var(--font-size-md)}.poll-head svg{width:16px;height:16px;color:var(--brand)}.poll-tag{font-size:var(--font-size-xs);color:var(--text-muted);border:1px solid var(--line);border-radius:999px;padding:1px 8px}.poll-tag.poll-over{color:var(--text);border-color:var(--text-muted)}.poll-list{list-style:none;margin:0;padding:0}.poll-row{position:relative;display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);overflow:hidden}.poll-row+.poll-row{margin-top:6px}.poll-fill{position:absolute;inset-inline-start:0;top:0;bottom:0;background:var(--brand);opacity:.14}.poll-pick{position:relative;display:flex;align-items:center;gap:8px;flex:1;cursor:pointer;margin:0}.poll-pick input{margin:0}.poll-label{position:relative;flex:1;display:flex;align-items:center;gap:6px}.poll-label.poll-mine{font-weight:600}.poll-label svg{width:14px;height:14px;color:var(--success)}.poll-num{position:relative;color:var(--text-muted);font-size:var(--font-size-sm);font-variant-numeric:tabular-nums;white-space:nowrap}.poll-voters{position:relative;display:flex;align-items:center;gap:2px}.poll-voters img{width:20px;height:20px;border-radius:50%;border:1px solid var(--panel)}.poll-more{color:var(--text-muted);font-size:var(--font-size-xs);margin-inline-start:2px}.poll-actions{margin-top:10px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.poll-foot{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px;color:var(--text-muted);font-size:var(--font-size-xs)}.poll-links{display:flex;gap:12px;margin-inline-start:auto;flex-wrap:wrap}.poll-links form{display:inline}.poll-links .danger{color:var(--danger,#d64545)}.poll-chip{display:inline-flex;align-items:center;gap:3px;margin-inline-start:6px;font-size:var(--font-size-xs);color:var(--brand);vertical-align:middle}.poll-chip svg{width:12px;height:12px}.poll-chip-over{color:var(--text-muted)}.poll-composer{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;margin-bottom:12px;background:var(--panel-2)}.poll-composer summary{cursor:pointer;display:flex;align-items:center;gap:6px;font-weight:600}.poll-composer summary svg{width:15px;height:15px;color:var(--brand)}.poll-composer[open] summary{margin-bottom:10px}.poll-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:0 14px}.poll-locked{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;background:var(--panel-2)}

/* portal */

/* =========================================================
   PORTAL HOME
   ========================================================= */

.page-portal .main,
.page-portal main {
    min-width: 0;
}

.portal-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Hero */

.portal-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border-radius: 14px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
}

.portal-hero-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #007BFF;
    color: #fff;
}

.portal-hero-icon svg {
    width: 25px;
    height: 25px;
}

.portal-hero h1 {
    margin: 0 0 5px;
    font-size: 1.55rem;
    line-height: 1.2;
}

.portal-hero p {
    margin: 0;
    color: var(--muted, #6b7280);
    line-height: 1.5;
}

/* Generic card */

.portal-card {
    overflow: hidden;
}

.portal-card .card-body {
    min-width: 0;
}

.portal-empty {
    padding: 15px 4px;
    color: var(--muted, #6b7280);
    text-align: center;
}

/* Two-column main sections */

.portal-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

/* Topics */

.portal-topic-list {
    display: flex;
    flex-direction: column;
}

.portal-topic-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.portal-topic-item:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
}

.portal-topic-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted, #6b7280);
}

.portal-topic-icon svg {
    width: 17px;
    height: 17px;
}

.portal-topic-title {
    margin: 0;
    font-size: .96rem;
    line-height: 1.35;
}

.portal-topic-title a {
    color: inherit;
    text-decoration: none;
}

.portal-topic-title a:hover {
    color: #007BFF;
}

.portal-topic-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 5px;
    font-size: .78rem;
    color: var(--muted, #6b7280);
}

.portal-topic-meta .badge,
.portal-topic-meta .category-badge {
    font-size: .72rem;
}

.portal-meta-author {
    white-space: nowrap;
}

.portal-topic-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--muted, #6b7280);
    font-size: .75rem;
    white-space: nowrap;
}

.portal-topic-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.portal-topic-stats svg {
    width: 13px;
    height: 13px;
}

.portal-topic-last {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 105px;
}

.portal-topic-last > div {
    min-width: 0;
}

.portal-last-user {
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-last-time {
    color: var(--muted, #6b7280);
    font-size: .72rem;
    margin-top: 2px;
}

/* Comments */

.portal-comments-list {
    display: flex;
    flex-direction: column;
}

.portal-comment-item {
    display: flex;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.portal-comment-item:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
}

.portal-comment-avatar {
    flex: 0 0 auto;
}

.portal-comment-main {
    min-width: 0;
    flex: 1;
}

.portal-comment-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .86rem;
}

.portal-comment-floor {
    color: var(--muted, #6b7280);
    font-size: .75rem;
}

.portal-comment-topic {
    display: block;
    margin-top: 2px;
    color: #007BFF;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-comment-excerpt {
    margin-top: 5px;
    color: var(--muted, #6b7280);
    font-size: .82rem;
    line-height: 1.45;
    overflow: hidden;
}

.portal-comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: .72rem;
    color: var(--muted, #6b7280);
}

/* Media type badge */

.portal-media-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 4px 7px;

    border-radius: 6px;

    background: rgba(0, 0, 0, .72);
    color: #fff;

    font-size: .68rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;

    pointer-events: none;
}

.portal-media-type-badge svg {
    width: 12px;
    height: 12px;
}

.portal-media-type-badge.is-video {
    background: rgba(220, 38, 38, .88);
}

.portal-media-type-badge.is-image {
    background: rgba(0, 0, 0, .72);
}

/* =========================================================
 * LATEST COMMENTS
 * ========================================================= */

.portal-comments-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}

.portal-comment-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
}

/* Последният ред на desktop няма долна линия */
.portal-comment-item:nth-last-child(-n + 2) {
    border-bottom: 0;
}

/* =========================================================
 * USER
 * ========================================================= */

.portal-comment-top {
    grid-column: 1;
    grid-row: 1 / span 2;

    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.portal-comment-author-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.portal-comment-author {
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.portal-comment-user {
    display: block;
    width: 100%;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-comment-time {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

/* =========================================================
 * COMMENT TEXT
 * ========================================================= */

.portal-comment-text {
    grid-column: 2;
    grid-row: 1;

    min-width: 0;
    max-width: 100%;

    margin: 0;

    color: var(--text);
    font-size: var(--font-size-sm);
    line-height: 1.5;

    overflow-wrap: anywhere;
    word-break: break-word;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================================
 * TOPIC / GALLERY ITEM
 * ========================================================= */

.portal-comment-target {
    grid-column: 2;
    grid-row: 2;

    display: flex;
    align-items: center;
    gap: 6px;

    min-width: 0;
    max-width: 100%;

    margin: 0;

    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--font-size-xs);
    line-height: 1.3;
}

.portal-comment-target:hover {
    color: #007BFF;
    text-decoration: none;
}

.portal-comment-target-type {
    flex: 0 0 auto;
    font-weight: 600;
}

.portal-comment-target-title {
    min-width: 0;
    max-width: 100%;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Gallery */

.portal-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}

.portal-media-item {
    min-width: 0;
}

.portal-media-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 9px;
    background: #111;
    text-decoration: none;
}

.portal-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s ease;
}

.portal-media-thumb:hover img {
    transform: scale(1.04);
}

.portal-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.portal-media-placeholder svg {
    width: 28px;
    height: 28px;
}

.portal-media-play,
.portal-video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .72);
    color: #fff;
}

.portal-media-play svg,
.portal-video-play svg {
    width: 19px;
    height: 19px;
}

.portal-media-info {
    padding-top: 7px;
}

.portal-media-title {
    display: block;
    color: inherit;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-media-title:hover {
    color: #007BFF;
}

.portal-media-meta,
.portal-video-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    color: var(--muted, #6b7280);
    font-size: .7rem;
}

.portal-media-meta span,
.portal-video-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.portal-media-meta svg,
.portal-video-meta svg {
    width: 12px;
    height: 12px;
}

/* Videos */

.portal-video-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 13px;
}

.portal-video-item {
    min-width: 0;
}

.portal-video-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 9px;
    background: #111;
}

.portal-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portal-video-info {
    padding-top: 7px;
}

.portal-video-title {
    display: block;
    color: inherit;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-video-title:hover {
    color: #007BFF;
}

/* Account */

.portal-account-guest {
    text-align: center;
    padding: 5px 0;
}

.portal-account-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 123, 255, .1);
    color: #007BFF;
}

.portal-account-icon svg {
    width: 25px;
    height: 25px;
}

.portal-account-guest h3 {
    margin: 0 0 5px;
}

.portal-account-guest p {
    margin: 0 auto 15px;
    font-size: .84rem;
}

.portal-account-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.portal-account-actions .btn {
    flex: 1;
}

.portal-account-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-account-avatar {
    flex: 0 0 auto;
}

.portal-account-name {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.portal-account-name .user-link {
    font-size: 1rem;
    font-weight: 700;
}

.portal-account-name > span {
    color: var(--muted, #6b7280);
    font-size: .78rem;
}

.portal-user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid var(--border, #e5e7eb);
}

.portal-user-stats > div {
    text-align: center;
}

.portal-user-stats strong {
    display: block;
    font-size: 1rem;
}

.portal-user-stats span {
    display: block;
    margin-top: 2px;
    color: var(--muted, #6b7280);
    font-size: .7rem;
}

/* Statistics */

.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.portal-stat {
    padding: 11px;
    border-radius: 9px;
    background: var(--bg, #f8fafc);
    display: grid;
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto auto;
    column-gap: 8px;
}

.portal-stat-icon {
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007BFF;
}

.portal-stat-icon svg {
    width: 18px;
    height: 18px;
}

.portal-stat strong {
    font-size: .95rem;
    line-height: 1.1;
}

.portal-stat > span:last-child {
    color: var(--muted, #6b7280);
    font-size: .7rem;
}

/* Online */

.portal-online-grid {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.portal-online-user,
.portal-new-user {
    display: flex;
    align-items: center;
    gap: 9px;
}

.portal-online-user > div:last-child,
.portal-new-user > div:last-child {
    min-width: 0;
}

.portal-online-user .user-link,
.portal-new-user .user-link {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-online-user > div:last-child > span,
.portal-new-user > div:last-child > span {
    display: block;
    color: var(--muted, #6b7280);
    font-size: .7rem;
    margin-top: 2px;
}

/* New users */

.portal-new-users {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Categories */

.portal-category-list {
    display: flex;
    flex-direction: column;
}

.portal-category-item {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 0;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.portal-category-item:last-child {
    border-bottom: 0;
}

.portal-category-item:hover {
    color: #007BFF;
}

.portal-category-icon {
    width: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-category-icon svg {
    width: 16px;
    height: 16px;
}

.portal-category-name {
    flex: 1;
    min-width: 0;
    font-size: .82rem;
}

.portal-category-count {
    color: var(--muted, #6b7280);
    font-size: .72rem;
    margin-right: 3px;
}

/* Tags */

.portal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.portal-tags .tag {
    font-size: .72rem;
}


/* =========================================================
   PORTAL SIDEBAR LAYOUT
   ========================================================= */

.portal-sidebar-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.portal-sidebar-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.portal-sidebar-pair > .portal-card {
    min-width: 0;
    margin: 0;
}

.portal-sidebar-full {
    width: 100%;
}

.portal-sidebar-full > .portal-card {
    margin: 0;
}

/* Categories: two columns inside the category card */

.portal-sidebar-full .portal-category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
}

.portal-sidebar-full .portal-category-item {
    min-width: 0;
}

/* Responsive */

@media (max-width: 1100px) {
    .portal-video-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .portal-two-columns {
        grid-template-columns: 1fr;
    }

    .portal-media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .portal-video-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    /*
     * Sidebar cards become one column on mobile.
     */
    .portal-sidebar-pair {
        grid-template-columns: 1fr;
    }

    /*
     * Categories also become one column on mobile.
     */
    .portal-sidebar-full .portal-category-list {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .portal-topic-item {
        grid-template-columns: 25px minmax(0, 1fr) auto;
    }

    .portal-topic-last {
        display: none;
    }

    .portal-topic-stats {
        display: none;
    }

    .portal-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-video-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .portal-hero {
        padding: 16px;
    }

    .portal-hero-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .portal-hero h1 {
        font-size: 1.25rem;
    }

    .portal-hero p {
        font-size: .8rem;
    }

    .portal-media-grid,
    .portal-video-list {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .portal-topic-meta .category-badge {
        display: none;
    }
}

/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 700px) {

    .portal-comments-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .portal-comment-item {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 8px;
        padding: 14px 0;
    }

    .portal-comment-item:nth-last-child(-n + 2) {
        border-bottom: 1px solid var(--line-soft);
    }

    .portal-comment-item:last-child {
        border-bottom: 0;
    }

    .portal-comment-top {
        grid-column: 1;
        grid-row: 1;
    }

    .portal-comment-text {
        grid-column: 1;
        grid-row: 2;
    }

    .portal-comment-target {
        grid-column: 1;
        grid-row: 3;
    }
}


/* post_timeline */
/* ---------- the gutter the column lives in (wide screens) ---------- */

@media (min-width: 1100px) {
  /* 96px of room: 68px of column + a ~28px breathing gap before the posts */
  .post-stream:has(> .ptl-col) { position: relative; padding-inline-end: 96px; }
}

/* The timeline compensates every prepend itself, pixel-perfect, at the
   exact moment of insertion. The browser's own scroll anchoring must not
   double-correct those inserts (a double correction is what made the
   landing drift a post off the target), so the stream's posts are taken
   out of the anchor candidates while the timeline owns the page. */
.post-stream:has(> .ptl-col) { overflow-anchor: none; }

/* ---------- the column and its sticky pin ---------- */

.ptl-col {
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-end: 0;
  width: 68px;
  pointer-events: none;                 /* the empty column never blocks clicks */
}

.ptl-pin {
  position: sticky;
  /* centred in the area below the topbar: topbar + half the leftover - half the widget */
  top: calc(var(--topbar-h, 56px) + (100vh - var(--topbar-h, 56px)) / 2 - min(60vh, 540px) / 2);
  height: min(60vh, 540px);
  max-height: 100%;                     /* a short stream caps the pin: the widget never outgrows the posts */
}

/* ---------- the widget ---------- */

.ptl { display: none; }
.ptl.ptl-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%; height: 100%;
  pointer-events: auto;                 /* re-enable what .ptl-col disabled */
  transition: opacity .2s ease;
}
.ptl.ptl-hidden { opacity: 0; pointer-events: none; }
.ptl[hidden] { display: none; }

/* ---------- dates ---------- */

.ptl-date {
  flex: 0 0 auto;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
  max-width: 100%;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

/* ---------- the quiet chevron buttons ---------- */

.ptl-jump {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: 0 0 auto;
  padding: 0; border: 0;
  background: none;
  border-radius: var(--radius-pill);
  color: var(--text-subtle);
  cursor: pointer;
}
.ptl-jump:hover { color: var(--text); background: var(--line-soft); }
.ptl-jump:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ptl-jump .icon { width: 15px; height: 15px; }

/* ---------- the track: a thin rail, a small handle, a floating number ---------- */

.ptl-track {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 90px;
  touch-action: none;
}

/* the rail runs near the posts-side edge of the column (its centre is 14px in) */
.ptl-rail {
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-start: 14px;
  width: 3px;
  margin-inline-start: -1.5px;
  border-radius: var(--radius-pill);
  background: var(--text-disabled, #c0c6d0);
}

/* the handle button is a generous invisible grab area; the pill inside is small */
.ptl-handle {
  position: absolute;
  top: 0; inset-inline-start: 0;
  width: 28px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; margin: 0;
  border: 0; background: none;
  cursor: grab;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.ptl-handle::after {
  content: "";
  display: block;
  width: 7px; height: 34px;
  border-radius: var(--radius-pill);
  background: var(--text-subtle);
  transition: background .15s ease;
}
.ptl-handle:hover::after { background: var(--text-muted); }
.ptl-handle:active { cursor: grabbing; }
.ptl-handle:focus-visible { outline: none; }
.ptl-handle:focus-visible::after { background: var(--text-muted); box-shadow: 0 0 0 3px var(--brand-soft, rgba(0,0,0,.08)); }

/* the number badge floats beside the rail, on the page-edge side, and
   follows the handle (JS sets its top). The big digit is the current
   post, the small one below it is the total. */
.ptl-num {
  position: absolute;
  top: 0;
  inset-inline-start: 26px;
  width: calc(100% - 26px);
  text-align: start;
  line-height: 1.15;
  pointer-events: none;
}
.ptl-num b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ptl-num span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* the counter inside the handle — only the narrow bottom bar uses it */
.ptl-count {
  display: none;
  align-items: baseline;
  gap: 3px;
  font-size: var(--font-size-xs);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ptl-count b { font-weight: 700; }
.ptl-count .ptl-sep { color: var(--text-subtle); }

.ptl-i18n { display: none; }

/* the dark little bubble shown while scrubbing */
.ptl-tip {
  display: none;
  position: absolute;
  z-index: 2;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--panel);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  pointer-events: none;
}
.ptl.ptl-scrub .ptl-tip { display: block; }

.ptl.ptl-loading .ptl-handle::after { animation: ptl-pulse 1s ease-in-out infinite; }
@keyframes ptl-pulse { 50% { opacity: .5; } }

/* ---------- the narrow-screen bar (same markup, row shape) ---------- */

.ptl.ptl-x {
  position: fixed;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: min(460px, calc(100vw - 24px));
  min-height: 42px;
  height: auto;
  padding: 4px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  z-index: 40;
}

.ptl-x .ptl-date {
  flex: 0 1 auto;
  max-width: 110px;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: start;
}

.ptl-x .ptl-jump { width: 30px; height: 30px; }

.ptl-x .ptl-track {
  flex: 1 1 auto;
  width: auto;
  height: 30px;
  min-height: 0;
}

.ptl-x .ptl-rail {
  top: 50%; bottom: auto;
  inset-inline-start: 0; inset-inline-end: 0;
  width: auto; height: 3px;
  margin-inline-start: 0;
  margin-top: -1.5px;
}

.ptl-x .ptl-handle {
  top: 0; bottom: 0; inset-inline-start: 0;
  width: 64px; height: auto;
  border-radius: var(--radius-pill);
  background: var(--panel-2);
}
.ptl-x .ptl-handle:hover { background: var(--line-soft); }
.ptl-x .ptl-handle::after { display: none; }
.ptl-x .ptl-handle:focus-visible::after { display: none; }
.ptl-x .ptl-handle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.ptl-x .ptl-count { display: inline-flex; }
.ptl-x .ptl-num { display: none; }

/* ---------- the loading row inside the stream ---------- */

.ptl-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.ptl-more[hidden] { display: none; }

.ptl-spin {
  width: 16px; height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--text-subtle);
  animation: ptl-spin .8s linear infinite;
}
@keyframes ptl-spin { to { transform: rotate(360deg); } }

/* while a jump fetches its window, the old posts dim */
.post-stream.ptl-busy > article.post { opacity: .45; transition: opacity .15s ease; }
.post-stream.ptl-busy > .ptl-more { opacity: .45; }

/* ---------- print, motion, small screens ---------- */

@media print {
  .ptl, .ptl-col { display: none !important; }
  .post-stream { padding-inline-end: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ptl, .ptl-more, .ptl-handle::after { transition: none; }
  .ptl.ptl-loading .ptl-handle::after, .ptl-spin { animation: none; }
}

@media (max-width: 480px) {
  .ptl-x { gap: 6px; padding: 3px 8px; }
  .ptl-x .ptl-date { display: none; }
  .ptl-x .ptl-handle { width: 56px; }
}


/* preset_avatars */
.preset_avatars-box{margin-block-end:4px}
.preset_avatars-current{display:flex;align-items:center;gap:12px;margin-block-end:10px}
.preset_avatars-current-text{color:var(--text-muted);font-size:var(--font-size-sm)}
.preset_avatars-note{color:var(--text-muted);font-size:var(--font-size-sm);margin-block:0 12px}
.preset_avatars-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(56px,1fr));gap:8px;margin-block-end:12px}
.preset_avatars-item{display:block;width:100%;padding:4px;cursor:pointer;appearance:none;font:inherit;background:var(--panel-2);border:1px solid var(--line);border-radius:var(--radius-sm);line-height:0}
.preset_avatars-item img{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;border-radius:var(--avatar-radius,50%)}
.preset_avatars-item:hover{border-color:var(--brand)}
.preset_avatars-item:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.preset_avatars-item-picked{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft)}
.preset_avatars-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.preset_avatars-box.is-busy,.preset_avatars-groups.is-busy{opacity:.6;pointer-events:none}
.preset_avatars-hidden{display:none}
.preset_avatars-thumb{display:block;border-radius:var(--avatar-radius,50%)}
.preset_avatars-row-form{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.preset_avatars-row-form input[type=text],.preset_avatars-row-form input:not([type]){width:11rem;max-width:100%}
.preset_avatars-row-form input[name=sort]{width:4rem}
.preset_avatars-id{color:var(--text-subtle);font-size:var(--font-size-xs)}
.preset_avatars-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-block-end:12px}
.preset_avatars-head-text{color:var(--text-muted);font-size:var(--font-size-sm)}
.preset_avatars-flag{margin-inline-start:6px}
.preset_avatars-library-actions{margin-block-start:12px}
.preset_avatars-groups-note{color:var(--text-subtle);font-size:var(--font-size-xs)}
.preset_avatars-multi{max-width:22rem;padding:6px 10px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm)}
.preset_avatars-multi>summary{cursor:pointer;font-size:var(--font-size-sm)}
.preset_avatars-multi-list{display:grid;gap:6px;max-height:14rem;overflow:auto;padding-block-start:8px}
.preset_avatars-multi-list label{display:flex;align-items:center;gap:8px;font-size:var(--font-size-sm)}
.preset_avatars-multi-list small{color:var(--text-subtle);font-size:var(--font-size-xs)}

/* qa */
.qa-c-brand,.slot:has(.qa-c-brand)+.post{--qa-c1:var(--brand);--qa-c2:var(--brand-hover);--qa-ink:var(--brand)}.qa-c-green,.slot:has(.qa-c-green)+.post{--qa-c1:#18a050;--qa-c2:#14b8a6;--qa-ink:#188038}.qa-c-orange,.slot:has(.qa-c-orange)+.post{--qa-c1:#eb8214;--qa-c2:#fac828;--qa-ink:#b8600a}[data-theme="dark"] .qa-c-green,[data-theme="dark"] .slot:has(.qa-c-green)+.post{--qa-ink:#5dd39e}.qa-c-orange,[data-theme="dark"] .slot:has(.qa-c-orange)+.post{--qa-ink:#f5b04c}@media(prefers-color-scheme:dark){[data-theme="auto"] .qa-c-green,[data-theme="auto"] .slot:has(.qa-c-green)+.post{--qa-ink:#5dd39e}.qa-c-orange,[data-theme="auto"] .slot:has(.qa-c-orange)+.post{--qa-ink:#f5b04c}}.qa-tag{display:inline-block;margin-inline-end:6px;padding:0 6px;border-radius:4px;font-size:.6em;font-weight:700;line-height:1.7;vertical-align:middle;letter-spacing:.02em}.row-title .qa-tag{font-size:var(--font-size-xs);vertical-align:1px}.qa-tag-open{background:var(--brand-soft);color:var(--brand)}.qa-tag-solved{background:color-mix(in srgb,var(--qa-c1) 14%,transparent);color:var(--qa-ink)}.qa-medal{width:22px;height:22px;color:#e0a100;flex:none}.qa-seek{display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;margin:16px 0 4px;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2)}.qa-seek b{font-size:var(--font-size-md)}.qa-seek-item{color:var(--text-muted);font-size:var(--font-size-sm)}.qa-answer-btn{margin-inline-start:auto}.qa-best{margin:16px 0 4px;border:1px solid color-mix(in srgb,var(--qa-c1) 35%,var(--line));border-radius:var(--radius);background:linear-gradient(180deg,color-mix(in srgb,var(--qa-c1) 10%,transparent),color-mix(in srgb,var(--qa-c2) 3%,transparent) 70%,transparent),var(--panel)}.qa-best header{display:flex;align-items:center;gap:8px;padding:12px 16px 10px;border-bottom:1px solid color-mix(in srgb,var(--qa-c1) 22%,transparent);color:var(--qa-ink)}.qa-best header b{font-size:var(--font-size-md)}.qa-reward{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px;color:#e0a100;font-size:var(--font-size-sm);font-weight:600}.qa-reward .icon{width:14px;height:14px}.qa-best-who{display:flex;align-items:center;gap:8px;padding:10px 16px 0}.qa-best .post-content{padding:8px 16px 12px}.qa-best footer{padding:0 16px 12px;text-align:end;font-size:var(--font-size-sm)}.slot:has(.qa-accepted-anchor)+.post{border-color:color-mix(in srgb,var(--qa-c1) 35%,var(--line));background:linear-gradient(180deg,color-mix(in srgb,var(--qa-c1) 10%,transparent),color-mix(in srgb,var(--qa-c2) 3%,transparent) 70%,transparent),var(--panel)}.qa-best-mark{display:inline-flex;align-items:center;gap:3px;color:var(--qa-ink);font-weight:600}.qa-best-mark .icon{width:14px;height:14px}.qa-act.active .icon,.qa-best-mark .icon{fill:none;stroke:var(--qa-ink)}.qa-act.active{color:var(--qa-ink)}.qa-ask .form-help{margin-top:4px}@media(max-width:640px){.qa-seek{padding:10px 12px}.qa-answer-btn{margin-inline-start:0;width:100%;justify-content:center}}

/* reactions */
.card-reactions-top .card-body {padding-top: 4px;}
.reactions{display:flex;align-items:center;gap:3px;flex-wrap:wrap;margin-top:10px;position:relative}
.reactions-pills{display:flex;align-items:center;gap:4px;flex-wrap:wrap;min-width:0}
.reactions-pill{display:inline-flex;align-items:center;gap:4px;padding:3px 8px 3px 5px;border-radius:999px;background:var(--panel-2,var(--panel));border:1px solid var(--line-soft,var(--line));cursor:pointer;font-size:var(--font-size-xs);line-height:1.4;color:var(--text);user-select:none;transition:background .12s,border-color .12s,transform .12s}
.reactions-pill:hover{background:var(--brand-soft,var(--panel));border-color:var(--brand)}
.reactions-pill:active{transform:scale(.94)}
.reactions-pill.active{background:var(--brand-soft,var(--panel));border-color:var(--brand);color:var(--brand-hover,var(--brand))}
.reactions-pill[aria-disabled="true"]{cursor:default;opacity:.85}
.reactions-pill[aria-disabled="true"]:hover{background:var(--panel-2,var(--panel));border-color:var(--line-soft,var(--line))}
.reactions-count{font-variant-numeric:tabular-nums;font-weight:600;color:var(--text-muted,var(--text))}
.reactions-pill.active .reactions-count{color:var(--brand-hover,var(--brand))}

.reactions-more{display:inline-flex;align-items:center}
.reactions-more>summary{list-style:none;cursor:pointer;font-size:var(--font-size-xs);color:var(--text-subtle);padding:3px 6px;border-radius:999px;user-select:none}
.reactions-more>summary::-webkit-details-marker{display:none}
.reactions-more>summary:hover{color:var(--brand-hover,var(--brand));text-decoration:underline}
.reactions-more[open]>summary{color:var(--brand)}
.reactions-more-list{display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap}

.reactions-add{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px solid var(--line-soft,var(--line));background:transparent;color:var(--text-muted);cursor:pointer;padding:0;transition:background .12s,border-color .12s,color .12s,transform .12s}
.reactions-add:hover{background:var(--brand-soft,var(--panel));border-color:var(--brand);color:var(--brand-hover,var(--brand))}
.reactions-add:active{transform:scale(.92)}
.reactions-add svg{width:16px;height:16px}
.reactions-add[aria-expanded="true"]{background:var(--brand-soft,var(--panel));border-color:var(--brand);color:var(--brand-hover,var(--brand))}

.reactions-picker{position:absolute;top:calc(100% + 4px);inset-inline-start:0;z-index:50;min-width:200px;max-width:min(90vw,320px);padding:6px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);animation:reactions-pop .12s ease-out}
.reactions-picker[hidden]{display:none}
.reactions-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(32px,1fr));gap:2px}
.reactions-picker-item{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:var(--radius-sm);cursor:pointer;font-size:20px;line-height:1;padding:0;transition:background .1s,transform .1s}
.reactions-picker-item:hover{background:var(--panel-2,var(--panel));transform:scale(1.15)}
.reactions-picker-item.active{background:var(--brand-soft,var(--panel));box-shadow:inset 0 0 0 2px var(--brand)}

@keyframes reactions-pop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}

/* RTL: nothing direction-specific here (we use inset-inline-start), but keep
   the picker anchored to the start edge in RTL too. */
[dir="rtl"] .reactions-picker{inset-inline-start:0;inset-inline-end:auto}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  .reactions-pill,.reactions-add,.reactions-picker-item,.reactions-picker{transition:none;animation:none}
}

/* Topic-list reactions bar — same .reactions markup as in-topic, but placed
   in the title_suffix region under the topic's excerpt. We just trim the
   default margin-top a bit so it doesn't push too hard against the excerpt
   above, and add a small bottom margin so the meta row below has air. */
.reactions-topic-list-bar .reactions,
.reactions-topic-list-bar.reactions{margin-top:6px;margin-bottom:2px}

/* Mobile: even tighter, since the topic row is denser on narrow screens. */
@media (max-width:640px){
  .reactions-topic-list-bar .reactions,
  .reactions-topic-list-bar.reactions{margin-top:4px}
}

/* When xstyle is enabled, our JS moves the .reactions-topic-list-bar
   wrapper from .row-title INTO xstyle's .xstyle-body, right before
   .xstyle-actions. We give the wrapper a bit of vertical breathing room
   so it sits between the post content (excerpt + media) and the actions
   row without crowding either; the inner .reactions then needs no extra
   margin of its own. The selector is scoped to .xstyle-body so it only
   applies in xstyle context — the no-xstyle case keeps the rules above. */
.xstyle-body > .reactions-topic-list-bar,.xmad-body > .reactions-topic-list-bar{margin-top:10px;margin-bottom:8px}
.xstyle-body > .reactions-topic-list-bar .reactions,.xmad-body > .reactions-topic-list-bar .reactions{margin-top:0;margin-bottom:0}

/* Reactions sidebar widget (Latest + Top tabs) */
.reactions-top-list{display:flex;flex-direction:column;gap:0}
.reactions-top-item{display:flex;flex-direction:column;gap:4px;padding:10px 0;border-bottom:1px solid var(--line-soft,var(--line))}
.reactions-top-item:first-child{padding-top:0}
.reactions-top-item:last-child{border-bottom:none;padding-bottom:0}
.reactions-top-topic{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--font-size-sm);font-weight:600;color:var(--text);text-decoration:none}
.reactions-top-topic:hover{color:var(--brand-hover,var(--brand))}
.reactions-top-breakdown{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.reactions-top-chip{display:inline-flex;align-items:center;gap:3px;font-size:var(--font-size-xs);color:var(--text-muted,var(--text));font-variant-numeric:tabular-nums;line-height:1.4}
.reactions-top-chip-more{color:var(--text-subtle);font-weight:600}
.reactions-top-sep{color:var(--text-subtle);font-size:var(--font-size-xs);user-select:none}
.reactions-top-body{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:var(--font-size-sm);line-height:1.4;color:var(--text-muted,var(--text));text-decoration:none;transition:color .12s}
.reactions-top-body:hover{color:var(--brand-hover,var(--brand))}

/* Reactions widget tab toggle (Latest | Top). Segmented control matching
   the growth leaderboard tabs: a rounded gray container with the active tab
   as a raised pill. Mirrors .growth-top-tabs/.growth-top-tab exactly so the
   two widgets look like the same component. */
.reactions-top-tabs{display:flex;gap:2px;margin:0 0 6px;padding:3px;border-radius:9px;background:var(--panel-2)}
.reactions-top-tab{flex:1;min-width:0;padding:5px 2px;border:0;border-radius:7px;background:none;color:var(--text-muted);font:inherit;font-size:var(--font-size-xs);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reactions-top-tab:hover{color:var(--text)}
.reactions-top-tab.active{background:var(--panel);color:var(--text);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.reactions-top-panel[hidden]{display:none}
.reactions-top-empty{padding:14px 0;text-align:center;color:var(--text-subtle);font-size:var(--font-size-sm)}

/* report */
.report-act.report-flagged{color:var(--danger)}.report-quote{border-inline-start:3px solid var(--line);padding:8px 12px;margin:0 0 16px;color:var(--text-muted);background:var(--panel-2);border-radius:var(--radius-sm)}.report-quote b{color:var(--text)}.report-group{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);margin-bottom:14px}.report-group-head{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--line)}.report-group-head .flag{margin-inline-start:auto}.report-excerpt{padding:10px 14px;color:var(--text-muted);font-size:var(--font-size-sm);border-bottom:1px solid var(--line)}.report-list{list-style:none;margin:0;padding:6px 14px}.report-list li{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;padding:6px 0;border-bottom:1px dashed var(--line)}.report-list li:last-child{border-bottom:0}.report-note{flex-basis:100%;color:var(--text)}.report-ops{display:flex;gap:8px;padding:10px 14px;border-top:1px solid var(--line);flex-wrap:wrap}.report-ops .action-form{display:inline}

/* reward */
.reward-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:12px 0 4px;padding:10px 14px;border:1px solid var(--warning);border-radius:var(--radius);background:var(--warning-soft);font-size:var(--font-size-sm)}.reward-bar .icon{width:18px;height:18px;color:#e0a100;flex:none}.reward-bar form{margin-inline-start:auto}.reward-over{border-color:var(--line);background:var(--panel-2);color:var(--text-muted)}.reward-mark{display:inline-flex;vertical-align:-2px;margin-inline-end:4px;color:#e0a100}.reward-mark .icon{width:14px;height:14px}.reward-got{display:inline-flex;align-items:center;gap:2px;color:#b8860b;font-weight:600}.reward-got .icon{width:13px;height:13px;fill:currentColor;stroke:none}.reward-when{display:none}

/* seo_pro */
.seo-pro-panel{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;margin-bottom:12px;background:var(--panel-2)}.seo-pro-panel summary{cursor:pointer;display:flex;align-items:center;gap:6px;font-weight:600}.seo-pro-panel summary svg{width:15px;height:15px;color:var(--brand)}.seo-pro-panel[open] summary{margin-bottom:10px}.seo-pro-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0 14px}.seo-pro-map{margin:0;padding-inline-start:18px;line-height:1.8}.seo-pro-tags .tag{margin:0 6px 6px 0}.seo-pro-card{max-width:520px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--panel)}.seo-pro-card img{display:block;width:100%;max-height:270px;object-fit:cover}.seo-pro-noimg{height:120px;display:flex;align-items:center;justify-content:center;background:var(--panel-2);color:var(--text-muted)}.seo-pro-card-body{padding:10px 12px}.seo-pro-card-body b{display:block;margin:2px 0}.seo-pro-card-body p{margin:0;color:var(--text-muted);font-size:var(--font-size-sm)}

/* share */
.share-menu .dropdown-menu{min-width:190px;inset-inline-end:auto;inset-inline-start:0}.topic-bar .share-menu .dropdown-menu{inset-inline-start:auto;inset-inline-end:0}.share-menu .dropdown-menu a{text-decoration:none}.share-menu .dropdown-menu .icon{width:18px;height:18px;flex:none}.post-actions .share-menu{display:inline-block}.post-actions .share-menu .dropdown-toggle{padding:4px 8px}

/* signature */
.signature{margin-top:12px;padding-top:8px;border-top:1px dashed var(--line);color:var(--text-muted);font-size:var(--font-size-sm);line-height:1.45}.signature p{margin:0}.signature a{color:var(--text-muted);text-decoration:underline}.signature-preview{margin-top:0;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-sm)}@media(max-width:640px){.signature-mobile-hide{display:none}}

/* spoiler */
/* ---------------------------------------------------------------- spoiler
   Collapsible hidden-content blocks for Markdown, created by the Spoiler
   plugin. Source syntax in posts/pages:

       [spoiler]
       The butler did it.
       [/spoiler]

       [spoiler=Ending]
       They lived happily ever after.
       [/spoiler]

   The renderer turns each block into a native <details> element:

       <details class="spoiler">
         <summary>Spoiler</summary>
         <div class="spoiler-body">…rendered markdown…</div>
       </details>

   Collapsing/expanding is the browser's native <details> behavior — no JS.
   Colors and radii come from FlatBB's CSS variables so each theme's
   palette is respected automatically.
*/

/* The box itself: a subtle panel with a thin border, matching the language
   of blockquotes and callouts. margin: 16px 0 gives it air on both sides;
   overflow:hidden keeps the summary's bottom border flush with the body. */
.spoiler {
    margin: 16px 0;
    border: 1px solid var(--line-soft, var(--line));
    border-radius: var(--radius, 6px);
    background: var(--panel-2, var(--panel));
    overflow: hidden;
}

/* The clickable summary bar. We hide the native disclosure triangle and
   draw our own chevron (::below) so it rotates smoothly on open.
   flex + gap keeps the chevron and label aligned. */
.spoiler > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    font-weight: 600;
    font-size: var(--font-size-sm, 14px);
    color: var(--text-muted, var(--text));
    user-select: none;
    transition: color .12s, background .12s;
}
/* Hide the default triangle on WebKit/Blink (Firefox respects list-style:none
   above, but Safari/Chrome also need this pseudo-element hidden). */
.spoiler > summary::-webkit-details-marker { display: none; }

/* Custom chevron: a right-pointing triangle drawn with borders, rotated 90°
   to point down when the <details> is open. transition gives a smooth flip. */
.spoiler > summary::before {
    content: '';
    flex: none;
    width: 0;
    height: 0;
    border-left: 4px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform .15s ease;
}
.spoiler[open] > summary::before {
    transform: rotate(90deg);
}

/* Hover: brighten the text and tint the background with the brand color so
   the affordance is clear. The tint uses --brand-soft (or falls back to a
   semi-transparent brand) so it works in both light and dark themes. */
.spoiler > summary:hover {
    color: var(--text);
    background: var(--brand-soft, color-mix(in srgb, var(--brand, #2563eb) 8%, transparent));
}

/* When open, separate the header from the body with a border so the
   boundary is visible even when the body has no top margin. */
.spoiler[open] > summary {
    border-bottom: 1px solid var(--line-soft, var(--line));
    color: var(--text);
}

/* Body: same horizontal padding as the summary, a touch more vertical.
   Inner paragraphs/lists/etc. come through the post-content pipeline, so
   we just zero the first child's top margin and last child's bottom margin
   so content sits flush inside the box. */
.spoiler-body {
    padding: 7px 12px;
    color: var(--text, inherit);
}
.spoiler-body > *:first-child { margin-top: 0; }
.spoiler-body > *:last-child { margin-bottom: 0; }

/* When a spoiler sits inside a <blockquote> (unusual but valid), the
   blockquote's italic style would leak in. Undo it, same as callouts. */
blockquote .spoiler { font-style: normal; }

/* Guest-gated spoiler body: shown instead of the real content when the
   viewer is not logged in (hide_from_guests setting). The real text is
   not in the HTML at all — this prompt is all a guest (or scraper) sees.
   Styled as a quiet, italic login nudge so it reads as "you're missing
   something, here's how to see it" without looking like an error. */
.spoiler-guest {
    margin: 0;
    font-style: italic;
    color: var(--text-muted, var(--text));
    font-size: var(--font-size-sm, 14px);
}
.spoiler-guest a {
    color: var(--brand, #2563eb);
    text-decoration: none;
    font-weight: 600;
    font-style: normal; /* keep the link itself upright inside italic body */
}
.spoiler-guest a:hover {
    text-decoration: underline;
}

/* Mobile: tighten padding so the box doesn't dominate a small screen. */
@media (max-width: 600px) {
    .spoiler > summary { padding: 8px 10px; }
    .spoiler-body { padding: 8px 10px; }
}


/* tabbar */
/* Bottom Bar: phones only. The bar sits over the bottom of the page; the page leaves --tabbar-h free so nothing hides under it
   (other floating buttons can use the same variable: bottom: calc(var(--tabbar-h, 0px) + 16px)). */
.tabbar { display: none; }
@media (max-width: 768px) {
  body:has(.tabbar) { --tabbar-h: calc(58px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; z-index: 70; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--tabbar-cols, 5), minmax(0, 1fr)); align-items: center;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--panel); transition: transform .25s; }
  body:has(.tabbar) .page-grid { padding-bottom: calc(var(--tabbar-h) + 24px); }
  body:has(.tabbar) .footer { padding-bottom: var(--tabbar-h); }
  body:has(.tabbar[data-tabbar-hide-new]) .header-new-topic { display: none; } /* setting: New Topic only in the middle of the bar */
  .tabbar-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; height: 58px; color: var(--text-subtle); font-size: 11px; line-height: 1.2; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .tabbar-item:hover { color: var(--text); }
  .tabbar-item.active { color: var(--brand); }
  .tabbar-item.active .tabbar-label { font-weight: 600; }
  .tabbar-icon { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; }
  .tabbar-icon > .icon { width: 23px; height: 23px; }
  .tabbar-item.active .tabbar-icon > .icon { stroke-width: 2.4; }
  .tabbar-icon .avatar { width: 24px !important; height: 24px !important; font-size: 11px; }
  .tabbar-item.active .tabbar-icon .avatar { box-shadow: 0 0 0 2px var(--brand); }
  .tabbar-label { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar-badge { position: absolute; top: -3px; inset-inline-start: 15px; min-width: 16px; height: 16px; padding: 0 4px; border: 2px solid var(--panel); border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 12px; text-align: center; box-sizing: content-box; }
  /* New Topic: a round brand button lifted above the bar */
  .tabbar-center { display: grid; place-items: center; }
  .tabbar-new { display: grid; place-items: center; width: 50px; height: 50px; margin-top: -22px; border: 4px solid var(--panel); border-radius: 50%; background: var(--brand); color: #fff;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 38%, transparent); -webkit-tap-highlight-color: transparent; }
  .tabbar-new:hover, .tabbar-new:active { color: #fff; filter: brightness(.95); }
  .tabbar-new .icon { width: 26px; height: 26px; stroke-width: 2.4; }
  /* a solid bar that stays; the setting can slide it away while scrolling down (scrolling up brings it back). The keyboard always wins */
  body.tabbar-away .tabbar[data-tabbar-scroll="hide"] { transform: translateY(calc(100% + 24px)); }
  body.tabbar-typing .tabbar { transform: translateY(calc(100% + 24px)); }
  body.drawer-open .tabbar { visibility: hidden; }
}


/* tag_block */

    /* Block button — tag page positioning */
    .tag-block-tagpage { margin: 12px 0 10px 10px; }
    .tag-block-form { display: inline; }

    /* Blocked state — override btn-danger with success green
       (content is hidden, green = click to restore) */
    .tag-block-btn.is-blocked {
        color: var(--success);
        border-color: var(--success);
        background: transparent;
    }
    .tag-block-btn.is-blocked:hover {
        background: var(--success-soft);
        border-color: var(--success);
        color: var(--success);
    }

    /* Settings → Blocked tags: hide the core Save button */
    body.page-settings-tag_block .settings-form .form-actions { display: none; }

    /* Settings → Blocked tags list */
    .tag-block-list { display: flex; flex-direction: column; gap: 8px; }
    .tag-block-item {
        display: flex; align-items: center; gap: 12px;
        padding: 8px 12px; background: var(--panel); border: 1px solid var(--line);
        border-radius: var(--radius);
    }
    .tag-block-name { font-weight: 700; color: var(--text); text-decoration: none; }
    .tag-block-name:hover { color: var(--brand); }
    .tag-block-count { margin-right: auto; }
    

/* tip */
.tip-modal[hidden],.tip-custom[hidden]{display:none}.tip-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;padding:8px 12px;border-radius:var(--radius-sm);background:var(--panel-2);font-size:var(--font-size-sm);color:var(--text-muted)}.tip-strip-faces{display:flex;align-items:center}.tip-strip-faces .avatar{margin-inline-end:-6px;border:2px solid var(--panel)}.tip-more{margin-inline-start:12px;font-size:var(--font-size-xs)}.tip-strip-text{display:inline-flex;align-items:center;gap:4px;margin-inline-start:6px}.tip-strip-text svg{width:14px;height:14px;color:var(--brand)}.tip-modal{position:fixed;inset:0;z-index:230;display:flex;align-items:center;justify-content:center;padding:16px}.tip-modal-scrim{position:absolute;inset:0;background:var(--backdrop)}.tip-modal-box{position:relative;width:100%;max-width:460px;max-height:92vh;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-md);padding:18px 20px 20px}.tip-modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.tip-modal-head h3{margin:0;font-size:1.15rem}.tip-modal-x{border:0;background:none;color:var(--text-subtle);cursor:pointer;width:32px;height:32px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}.tip-modal-x:hover{background:var(--panel-2);color:var(--text)}.tip-modal-x svg{width:18px;height:18px}.tip-author{display:flex;align-items:center;gap:12px;padding:10px 0 14px;border-bottom:1px solid var(--line-soft);margin-bottom:14px}.tip-author-avatar .avatar{--s:46px;width:46px;height:46px;font-size:20px}.tip-author b{font-size:var(--font-size-md)}.tip-author p{margin:2px 0 0}.tip-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}.tip-tile{display:flex;flex-direction:column;align-items:center;gap:2px;padding:12px 6px;border:1px solid var(--line);border-radius:12px;background:var(--panel-2);color:var(--text);cursor:pointer;font:inherit}.tip-tile b{font-size:1.25rem;line-height:1.2}.tip-tile span{font-size:var(--font-size-xs);color:var(--text-muted)}.tip-tile.active{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}.tip-tile.active span{color:var(--brand)}.tip-tile-custom b svg{width:20px;height:20px}.tip-custom{margin-bottom:12px}.tip-note{margin-bottom:12px}.tip-balance{display:flex;align-items:center;gap:6px;font-size:var(--font-size-sm);color:var(--text-muted);margin-bottom:12px}.tip-balance a{margin-inline-start:auto}.tip-send{display:flex;justify-content:center;gap:8px;padding:12px;font-size:var(--font-size-md);border-radius:12px}.tip-send.busy{opacity:.6;pointer-events:none}@media(max-width:480px){.tip-tiles{gap:8px}.tip-tile b{font-size:1.1rem}}

/* topic_excerpt */
.topic_excerpt-line{display:block;color:var(--text-muted);font-size:var(--font-size-md);line-height:1.4;margin-top:2px;text-decoration:none;overflow-wrap:anywhere}a:hover .topic_excerpt-line{text-decoration:none}.topic_full-wrap{display:block;max-height:400px;overflow:hidden;position:relative;border-radius:6px;cursor:inherit;user-select:none}.topic_full-wrap .topic_full-preview{font-size:var(--font-size-md);line-height:1.4;color:var(--text-muted);margin-top: 10px;}.topic_full-wrap .topic_full-preview :is(p,ul,ol,blockquote,pre,code){margin:.4em 0}.topic_full-wrap .topic_full-preview :is(h1,h2,h3,h4,h5,h6){font-size:1em;color:inherit;font-weight:600;margin:.4em 0}.topic_full-wrap .topic_full-preview a{color:inherit}.topic_full-wrap{-webkit-mask-image:linear-gradient(to bottom, black 82%, transparent 100%);mask-image:linear-gradient(to bottom, black 82%, transparent 100%)}a:hover .topic_full-wrap{opacity:1}.topic_excerpt-nsfw{display:flex;flex-direction:column;align-items:center;gap:12px;margin-top:8px;padding:20px 12px;text-align:center;color:var(--text-muted);font-size:var(--font-size-md);line-height:1.4;text-decoration:none;overflow-wrap:anywhere;}.topic_excerpt-nsfw-icon .icon,.topic_excerpt-nsfw-icon svg,.topic_excerpt-nsfw-icon img{width:40px;height:40px;color:var(--text-muted);opacity:.55;display:block;stroke:currentColor;fill:none}.topic_excerpt-nsfw-text{max-width:420px; font-size:var(--font-size-md)}.topic_excerpt-nsfw-form{margin:0;padding:0;pointer-events:auto}.topic_excerpt-nsfw-btn{pointer-events:auto;cursor:pointer;text-decoration:none}a:hover .topic_excerpt-nsfw{text-decoration:none}

/* usercard */
.usercard{position:absolute;z-index:60;width:320px;max-width:calc(100vw - 20px);border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);box-shadow:var(--shadow-lg,0 10px 30px rgba(0,0,0,.18));opacity:0;pointer-events:none;transform:translateY(-4px);transition:opacity .12s,transform .12s}.usercard.open{opacity:1;pointer-events:auto;transform:none}.usercard-body{padding:14px}.usercard-head{display:flex;gap:12px;align-items:center}.usercard-head img{width:52px;height:52px;border-radius:50%}.usercard-who{display:flex;flex-direction:column;gap:2px;min-width:0}.usercard-name{font-weight:600;font-size:var(--font-size-md)}.usercard-handle{color:var(--text-muted);font-size:var(--font-size-xs)}.usercard-group{color:var(--brand);font-size:var(--font-size-xs)}.usercard-seen{color:var(--text-muted);font-size:var(--font-size-xs)}.usercard-bio{margin:10px 0 0;color:var(--text);font-size:var(--font-size-sm);line-height:1.5}.usercard-meta{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px;color:var(--text-muted);font-size:var(--font-size-xs)}.usercard-meta span{display:inline-flex;align-items:center;gap:4px}.usercard-meta svg{width:12px;height:12px}.usercard-stats{display:flex;gap:4px;margin-top:12px;text-align:center}.usercard-stats>*{flex:1;min-width:0;color:var(--text);text-decoration:none;border:1px solid var(--line);border-radius:var(--radius-sm);padding:6px 2px}.usercard-stats a:hover{background:var(--brand-soft)}.usercard-stats b{display:block;font-size:var(--font-size-md)}.usercard-stats span{display:block;color:var(--text-muted);font-size:var(--font-size-xs);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.usercard-foot{display:flex;gap:6px;margin-top:12px}.usercard-foot form{display:flex;flex:1;margin:0}.usercard-foot .btn{flex:1;width:100%;justify-content:center}.usercard-loading{height:96px;border-radius:var(--radius-sm);background:linear-gradient(90deg,var(--panel-2) 25%,var(--line) 37%,var(--panel-2) 63%);background-size:400% 100%;animation:usercard-shine 1.2s linear infinite}@keyframes usercard-shine{0%{background-position:100% 0}100%{background-position:0 0}}@media (prefers-reduced-motion:reduce){.usercard{transition:none}.usercard-loading{animation:none}}

/* verified */
.profile-labels .verified-title{margin:0;padding:1px 7px;border-radius:var(--flag-radius,4px);background:color-mix(in srgb,currentColor 12%,transparent);font-size:var(--font-size-xs);vertical-align:middle}.profile-labels .verified-badge{margin:0}.verified-corner{position:absolute;inset-inline-end:-2px;bottom:-2px;width:clamp(13px,calc(var(--s) * .3),18px);height:clamp(13px,calc(var(--s) * .3),18px);border-radius:50%;background:var(--panel);box-shadow:0 0 0 1.5px var(--panel);line-height:0}.verified-corner svg{width:100%;height:100%;display:block}.profile-head .verified-corner{width:24px;height:24px}@media (max-width:768px){.profile-head .verified-corner{width:18px;height:18px}}.verified-badge{display:inline-block;vertical-align:-.15em;width:1.05em;height:1.05em;margin-left:.25em;line-height:0}.verified-badge svg{width:100%;height:100%;display:block}.profile-head h1 .verified-badge{width:.8em;height:.8em;vertical-align:-.05em}.verified-title{display:inline-block;margin-left:.4em;font-size:.55em;font-weight:600;vertical-align:.3em;letter-spacing:.01em}.settings-form:has(input[name=verified_noop]) .form-actions{display:none}.verified-status{display:flex;align-items:center;gap:.6rem;padding:.8rem 1rem;border:1px solid var(--border);border-radius:var(--radius);margin-bottom:1rem;background:var(--bg-soft)}.verified-status .verified-badge{width:1.4em;height:1.4em;margin:0}

/* video */

    
audio {
    width: 100%;
}

    video {
  border: 0;
  width: 100%;
  max-height:400px;
  display: inline-block;
  border-radius: 5px;
}

      iframe {
  border: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
    height:100%;
    object-fit: cover;
  border-radius: 5px; 
}
    .audio-container {
        margin: 1rem 0;
        border-radius: 8px;
        overflow: hidden;
    }
    .tweet-container {
        margin: 1rem 0;
        max-width: 550px;
    }
    .tweet-container iframe{
        border-radius: 8px;
    }

/* votes */
/* Vote widget — replaces the core like button. Two layouts:
   .votes-vertical: ▲ score ▼ stacked (9gag/Reddit style)
   .votes-horizontal: ▲ score ▼ inline
   Tokens from the flatbb CSS variable set so each theme is respected. */

.votes{display:inline-flex;align-items:center;gap:0;margin-right:6px}

/* Vertical layout: stack the buttons and score in a column. */
.votes-vertical{flex-direction:column;gap:0;border:1px solid var(--line-soft,var(--line));border-radius:var(--radius-sm,4px);overflow:hidden;background:var(--panel-2,var(--panel));margin-right:8px}
.votes-vertical .vote-btn{width:32px;height:24px;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:none;cursor:pointer;color:var(--text-subtle);transition:background .1s,color .1s}
.votes-vertical .vote-btn .icon{width:16px;height:16px}
.votes-vertical .vote-score{min-width:32px;text-align:center;font-size:var(--font-size-sm,14px);font-weight:700;font-variant-numeric:tabular-nums;line-height:1;padding:1px 0;color:var(--text-muted)}
.votes-vertical .vote-btn:hover{background:var(--brand-soft,var(--panel));color:var(--brand)}
.votes-vertical .vote-up.active{color:var(--brand);background:var(--brand-soft,var(--panel))}
.votes-vertical .vote-down.active{color:var(--danger);background:var(--danger-soft,var(--panel))}
.votes-vertical .vote-down:hover{color:var(--danger);background:var(--danger-soft,var(--panel))}

/* Horizontal layout: inline buttons with score between them. */
.votes-horizontal{flex-direction:row;gap:2px;align-items:center}
.votes-horizontal .vote-btn{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;border-radius:var(--radius-sm,4px);background:none;cursor:pointer;color:var(--text-subtle);transition:background .1s,color .1s}
.votes-horizontal .vote-btn .icon{width:16px;height:16px}
.votes-horizontal .vote-score{min-width:24px;text-align:center;font-size:var(--font-size-sm,14px);font-weight:700;font-variant-numeric:tabular-nums;color:var(--text-muted);padding:0 2px}
.votes-horizontal .vote-btn:hover{background:var(--brand-soft,var(--panel));color:var(--brand)}
.votes-horizontal .vote-up.active{color:var(--brand)}
.votes-horizontal .vote-down.active{color:var(--danger)}
.votes-horizontal .vote-down:hover{color:var(--danger);background:var(--danger-soft,var(--panel))}

/* Guest vote buttons are <a> links to /login (with a back= redirect), not
   interactive <button>s — see votes_widget_html(). Reset the link underline
   so they render identically to the member buttons; the .vote-btn color and
   layout rules above already apply (class specificity beats the element). */
a.vote-btn{text-decoration:none}

/* Static variant — score only, no buttons. No longer emitted by the plugin
   (guests now get the full widget with login-link buttons), kept for themes
   that may reference the class independently. */
.votes-static{padding:4px 8px;border-radius:var(--radius-sm,4px);background:var(--panel-2,var(--panel));color:var(--text-muted,var(--text));font-size:var(--font-size-sm,14px);font-weight:700;font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:4px}

/* Score color shifts when net-negative: a subtle red tint so a downvoted
   post reads as "community disagrees" at a glance. Only applies when the
   score is actually negative (the widget carries data-negative="1"). */
.votes[data-negative="1"] .vote-score{color:var(--danger)}
.votes-static[data-negative="1"]{color:var(--danger)}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){.vote-btn{transition:none}}

/* Mobile: the vertical widget is already compact; horizontal tightens slightly. */
@media (max-width:600px){
  .votes-horizontal .vote-btn{width:24px;height:24px}
}

/* widget_manager */
.widget_manager-box+.widget_manager-box{margin-block-start:var(--gap)}.widget_manager-head{display:flex;align-items:center;justify-content:space-between;gap:var(--gap)}.widget_manager-sort{display:flex;gap:4px}.widget_manager-name{max-inline-size:20rem;font-family:var(--mono)}.widget_manager-code{inline-size:100%;min-block-size:12rem;resize:vertical;font-family:var(--mono);font-size:var(--font-size-sm)}.widget_manager-list{list-style:none;margin:0;padding:0}.widget_manager-row{display:flex;align-items:center;gap:var(--gap);padding:6px 16px;border-block-start:1px solid var(--line-soft)}.widget_manager-row:first-child{border-block-start:0}.widget_manager-main{display:flex;align-items:center;gap:6px;flex:1 1 auto;min-inline-size:0}.widget_manager-tag{min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;user-select:all;font-family:var(--mono)}.widget_manager-meta{white-space:nowrap;min-inline-size:8rem;text-align:end}.widget_manager-pager{padding:8px 16px;border-block-start:1px solid var(--line-soft)}.widget_manager-actions{display:flex;align-items:center;gap:4px}.widget_manager-actions form,.widget_manager-foot form{margin:0}.widget_manager-foot{display:flex;align-items:center;gap:var(--gap);padding:8px 16px;border-block-start:1px solid var(--line-soft)}.widget_manager-error{color:var(--danger);font-size:var(--font-size-sm)}@media (max-width:640px){.widget_manager-row{flex-wrap:wrap}.widget_manager-meta{order:3;text-align:start}}

/* wiki */
/* Wiki — pages, toolbar, history, diffs and the index.
 * Every colour and size comes from the theme tokens in public/assets/app.css, so a theme restyles this too. */

/* 主栏不画左右竖线:目录与正文直接铺满。
 * body.page-wiki 让它只作用于 wiki 页面,并由这一层选择器盖过主题里的 body .col-main。 */
.breadcrumbs, .wiki-page { margin-top: 10px; }
 body.page-wiki .col-main { border-inline: none; }
/* 右栏的卡片是插件直接拼接的,没有核心的 .card-stack 间距,自己给一份 */
body.page-wiki .col-right .card { margin-bottom: 16px; }
.wiki-title { margin-bottom: .3em; word-break: break-word; }
.wiki-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 16px; }
.wiki-toolbar form { display: inline-flex; margin: 0; }
.wiki-meta { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.wiki-h2 { margin: 24px 0 10px; font-size: var(--font-size-lg); }
.wiki-note { padding: 9px 12px; margin-bottom: 14px; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-size: var(--font-size-sm); }
.wiki-note a { color: inherit; font-weight: 600; }
/* how many pages use a shared block, on its edit screen */
.wiki-usage { background: var(--panel-2); color: var(--text-muted); }
.wiki-usage a { color: var(--brand); }
.wiki-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.wiki-form-actions form { display: inline-flex; margin: 0; }
.wiki-merge { font-family: var(--mono); font-size: 13px; line-height: 1.55; }
.wiki-current-version { max-height: 420px; overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }

/* links to pages that have not been written yet */
.wiki-link-missing { color: var(--danger); border-bottom: 1px dashed currentColor; }
.wiki-link-missing:hover { color: var(--danger); opacity: .8; }
/* 页面已删除(回收站里):最近更改与「我关注的页」用它,和普通链接区分开 */
.wiki-redlink { color: var(--danger); }
.wiki-redlink:hover { color: var(--danger); opacity: .8; }
.wiki-backlinks { margin-top: 22px; padding-top: 4px; border-top: 1px solid var(--line-soft); }
.wiki-backlinks .wiki-h2 { margin-top: 12px; }

/* table of contents (built by assets/wiki.js) */
.wiki-toc { margin: 0 0 20px; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-2); }
.wiki-toc-title { margin-bottom: 6px; color: var(--text-muted); font-size: var(--font-size-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.wiki-toc-list { margin: 0; padding-inline-start: 18px; font-size: var(--font-size-sm); }
.wiki-toc-list li { margin: 3px 0; }
.wiki-toc-list li.is-sub { margin-inline-start: 14px; font-size: var(--font-size-xs); }
.wiki-toc-list a { color: var(--text-muted); }
.wiki-toc-list a:hover { color: var(--brand); }

/* pick two versions on the history page */
.wiki-compare { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-2); font-size: var(--font-size-sm); }
.wiki-compare label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.wiki-compare select { max-width: 220px; }

/* shared header / footer blocks (_header, _footer) */
.wiki-partial { position: relative; margin: 0 0 16px; padding: 10px 14px; border: 1px dashed var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-2); }
.wiki-partial-footer { margin: 18px 0 0; }
.wiki-partial-header { margin-bottom: 16px; }
.wiki-partial .wiki-body > :first-child { margin-top: 0; }
.wiki-partial .wiki-body > :last-child { margin-bottom: 0; }
.wiki-partial-edit { position: absolute; inset-inline-end: 8px; inset-block-start: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: var(--font-size-xs); opacity: .55; }
.wiki-partial:hover .wiki-partial-edit { opacity: 1; }
.wiki-partial-edit:hover { color: var(--brand); background: var(--brand-soft); }
.wiki-partial-edit .icon { width: 13px; height: 13px; }

/* index, search results, side lists */
.wiki-index { columns: 2; column-gap: 28px; margin: 0 0 8px; padding-inline-start: 18px; }
.wiki-index li { break-inside: avoid; margin-bottom: 5px; }
/* 空节留在目录里,用一行提示代替页面列表 */
.wiki-section-empty { margin: -4px 0 14px; }
/* 目录里的一级分节标题:旁边跟一个「新建页面」入口,建在这一节里 */
.wiki-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* 子节嵌在父节的目录里:缩进来自嵌套的 <ul>,这里只把多栏收掉,免得子节被拆到两栏 */
.wiki-index .wiki-index { columns: 1; }
.wiki-subsection { margin-bottom: 6px; }
.wiki-subsection-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: var(--font-size-md); }
.wiki-section-add { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; color: var(--text-muted); font-size: var(--font-size-xs); font-weight: 600; letter-spacing: 0; text-transform: none; }
.wiki-section-add:hover { color: var(--brand); background: var(--brand-soft); }
.wiki-section-add .icon { width: 12px; height: 12px; }
.wiki-search { display: flex; gap: 8px; margin-bottom: 14px; }
.wiki-search input { flex: 1; min-width: 0; }
.wiki-search-hits { list-style: none; margin: 0; padding: 0; }
.wiki-search-hits li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.wiki-search-hits li:last-child { border-bottom: 0; }
.wiki-side-list { list-style: none; margin: 0; padding: 0; }
.wiki-side-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.wiki-side-list li:last-child { border-bottom: 0; }
.wiki-side-list li.is-current a { font-weight: 650; color: var(--text); }
.wiki-side-list li > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* history and recent changes */
.wiki-history { list-style: none; margin: 0; padding: 0; }
.wiki-history-row { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.wiki-history-row:last-child { border-bottom: 0; }
.wiki-history-row.is-current { padding-inline: 10px; border-radius: var(--radius-sm); background: var(--brand-soft); }
.wiki-history-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.wiki-history-actions form { display: inline-flex; margin: 0; }
.wiki-changes { list-style: none; margin: 0; padding: 0; }
.wiki-changes li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.wiki-changes li:last-child { border-bottom: 0; }

/* line diff */
.wiki-diff { margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.wiki-diff-line { display: flex; gap: 8px; padding: 1px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wiki-diff-sign { flex: none; width: 1ch; color: var(--text-subtle); user-select: none; }
.wiki-diff-text { flex: 1; min-width: 0; }
.wiki-diff-line.is-add { background: var(--success-soft); color: var(--success); }
.wiki-diff-line.is-del { background: var(--danger-soft); color: var(--danger); }
.wiki-diff-line.is-same { color: var(--text-muted); }
.wiki-diff-gap { padding: 3px 10px; background: var(--panel-2); color: var(--text-subtle); font-size: var(--font-size-xs); }

/* the guide (/wiki/help), its home-page card and the cheat sheet in the editor's right column */
.wiki-cheat { list-style: none; margin: 0; padding: 0; }
.wiki-cheat li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--font-size-sm); }
.wiki-cheat li:last-child { border-bottom: 0; }
.wiki-cheat code { flex: 0 0 auto; max-width: 100%; padding: 1px 5px; border-radius: var(--radius-sm); background: var(--panel-2); color: var(--brand); font-family: var(--mono); font-size: var(--font-size-xs); overflow-wrap: anywhere; }
.wiki-cheat span { flex: 1 1 150px; min-width: 0; color: var(--text-muted); }
.wiki-cheat-compact li { padding: 4px 0; }
.wiki-help-more { margin: 10px 0 0; font-size: var(--font-size-sm); }
.wiki-help-points { margin: 0 0 12px; padding-inline-start: 18px; }
.wiki-help-points li { margin: 5px 0; }
.wiki-help .wiki-h2:first-of-type { margin-top: 20px; }

/* page templates (templates/<name>.php) and the sample block in the guide */
.wiki-sample { margin: 0 0 12px; padding: 10px 12px; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); font-family: var(--mono); font-size: var(--font-size-xs); line-height: 1.65; }
.wiki-kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; color: var(--text-muted); font-size: var(--font-size-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wiki-kicker svg { width: 14px; height: 14px; flex: 0 0 auto; }
.wiki-byline { margin: 0 0 12px; }
.wiki-tpl-book .wiki-toolbar { margin-top: 10px; }

/* 从搜索结果打开的页面:命中词被 wiki.js 包成 <mark>,滚到第一处 */
.wiki-hit { padding: 0 1px; border-radius: 2px; background: var(--warning-soft); color: var(--warning); }

/* 最近更改的过滤条 */
.wiki-changes-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.wiki-changes-filter input { flex: 1 1 150px; min-width: 0; max-width: 240px; }

/* 后台的批量操作条与整节搬迁表单 */
.wiki-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.wiki-bulk input[type="text"] { flex: 0 1 180px; min-width: 0; }

/* 页面评论区：外壳用 .composer，所以默认主题与 twitter 主题各自给它现成的底色、边框与编辑器 */
.wiki-comments { margin: 16px 0 0; }
.wiki-comments-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; }
.wiki-comments-head h2 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--font-size-xl); }
.wiki-comments-head h2 svg { width: 18px; height: 18px; flex: 0 0 auto; }
.wiki-comment-list { list-style: none; margin: 0; padding: 0; }
.wiki-comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.wiki-comment:last-child { border-bottom: 0; }
.wiki-comment-avatar { flex: 0 0 auto; }
.wiki-comment-main { flex: 1 1 auto; min-width: 0; }
.wiki-comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.wiki-comment-author { font-weight: 600; }
.wiki-comment-body { margin-top: 4px; }
/* 作者/版主才有的删除按钮推到行尾，不挤作者名 */
.wiki-comment-actions { margin-inline-start: auto; }
.wiki-comment-del { display: inline; margin: 0; }
.wiki-comment-del .link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-size-xs); }
.wiki-comment-del .link svg { width: 13px; height: 13px; }
.wiki-comment-form { margin: 14px 0 0; }
.wiki-comment-form h2 { margin: 0 0 8px; font-size: var(--font-size-lg); }
.wiki-comment-compose { display: flex; align-items: flex-start; gap: 10px; }
.wiki-comment-compose .wiki-comment-avatar { padding-top: 2px; }
.wiki-comment-editor { flex: 1 1 auto; min-width: 0; }
.wiki-comment-form .form-actions { margin: 8px 0 0; }
/* 评论输入框:和帖子页的回复框一样先折成一行(头像 + 占位 + 发表),点一下才展开编辑器。
   外壳仍交给主题的 .composer,这里只收起编辑器自己那几块;类由 wiki.js 加上,
   没有 JS 时一直展开,照样能写能发。 */
.wiki-comment-form.is-compact:not(.is-open) h2 { display: none; }
.wiki-comment-form.is-compact:not(.is-open) form { display: flex; align-items: center; gap: 10px; }
.wiki-comment-form.is-compact:not(.is-open) .wiki-comment-compose { flex: 1 1 auto; min-width: 0; align-items: center; cursor: text; }
.wiki-comment-form.is-compact:not(.is-open) .wiki-comment-compose .wiki-comment-avatar { padding-top: 0; }
.wiki-comment-form.is-compact:not(.is-open) .editor { border: 0; background: none; }
.wiki-comment-form.is-compact:not(.is-open) .editor-tabs,
.wiki-comment-form.is-compact:not(.is-open) .editor-toolbar,
.wiki-comment-form.is-compact:not(.is-open) .editor-foot,
.wiki-comment-form.is-compact:not(.is-open) .editor-emoji,
.wiki-comment-form.is-compact:not(.is-open) .editor-help { display: none; }
.wiki-comment-form.is-compact:not(.is-open) .editor-input { min-height: 0; height: 42px; padding: 10px 0; resize: none; overflow: hidden; }
.wiki-comment-form.is-compact:not(.is-open) .form-actions { margin: 0; flex: 0 0 auto; }
.wiki-comment-form.is-compact:not(.is-open) .wiki-comment-submit { border-radius: 999px; padding-inline: 16px; }
/* 没写字时和 x.com 一样是暗的、按不下去 */
.wiki-comment-submit[disabled] { opacity: .5; cursor: default; }

/* 星标：工具栏里的小按钮与 /wiki/starred 的列表 */
.wiki-star-form { display: flex; margin: 0; }
.wiki-star-form .btn.is-on { border-color: var(--brand); color: var(--brand); }
.wiki-star-form .btn.is-on svg { fill: currentColor; }
.wiki-star-list { list-style: none; margin: 0; padding: 0; }
.wiki-star-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.wiki-star-list li:last-child { border-bottom: 0; }
.wiki-star-title { font-weight: 600; }
.wiki-star-list .wiki-star-form { margin-inline-start: auto; }
.wiki-star-form button.link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-size-xs); }
.wiki-star-form svg { width: 14px; height: 14px; }

/* 页面配图:首页目录上方的一排缩略图,以及编辑页里的预览 */
.wiki-images { margin: 0 0 20px; }
.wiki-images .wiki-h2 { margin-top: 0; }
.wiki-image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.wiki-image-item { display: block; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-2); }
.wiki-image-item:hover { border-color: var(--brand); }
.wiki-image-thumb { display: block; width: 100%; height: 104px; object-fit: cover; }
.wiki-image-title { display: block; padding: 6px 9px; overflow: hidden; color: var(--text); font-size: var(--font-size-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wiki-image-item:hover .wiki-image-title { color: var(--brand); }
.wiki-image-preview { display: block; max-width: 260px; height: auto; margin: 0 0 8px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }

@media (max-width: 760px) {
  .wiki-index { columns: 1; }
  .wiki-toolbar .btn span { display: none; } /* icon-only on phones: Edit, History, Source, Delete */
  .wiki-toolbar .btn { padding: 5px 8px; }
  .wiki-comment-compose .wiki-comment-avatar { display: none; } /* 手机上把宽度留给输入框 */
}


/* wysiwyg */
.editor.wysiwyg .editor-input,.editor.wysiwyg [data-cmd=preview]{display:none}.editor:not(.wysiwyg) .wysiwyg-area{display:none}.wysiwyg-area{position:relative;min-width:0;max-width:100%;overflow:hidden;min-height:200px;padding:10px 12px;cursor:text;font-size:15px;line-height:1.7}.wysiwyg-area .milkdown{min-width:0;max-width:100%}.wysiwyg-area .ProseMirror{outline:0;border:0;background:none;border-radius:0;padding:0;margin:0;min-height:180px;min-width:0;max-width:100%;position:relative;white-space:pre-wrap;white-space:break-spaces;word-wrap:break-word;overflow-wrap:anywhere;word-break:break-word;font-variant-ligatures:none}.wysiwyg-area .ProseMirror:focus,.wysiwyg-area .ProseMirror:focus-visible{outline:0;box-shadow:none}.wysiwyg-area.wysiwyg-empty::before{content:attr(data-placeholder);position:absolute;top:10px;inset-inline-start:12px;color:var(--text-subtle);pointer-events:none}.wysiwyg-area .ProseMirror>*:first-child{margin-top:0}.wysiwyg-area .ProseMirror>*:last-child{margin-bottom:0}.wysiwyg-area .ProseMirror li{position:relative}.wysiwyg-area .ProseMirror pre{white-space:pre;overflow:auto;max-width:100%}.wysiwyg-area .ProseMirror code{overflow-wrap:anywhere}.wysiwyg-area .ProseMirror img{max-width:100%;height:auto}.wysiwyg-area .ProseMirror a{pointer-events:none}.wysiwyg-area .ProseMirror hr{margin:14px 0}.wysiwyg-area .tableWrapper{overflow-x:auto;max-width:100%;margin-bottom:1em}.wysiwyg-area .ProseMirror table{display:block;overflow-x:auto;max-width:100%;width:auto;min-width:0;border-collapse:collapse;table-layout:auto;margin:0 0 1em}.wysiwyg-area .ProseMirror td,.wysiwyg-area .ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative;min-width:90px;overflow-wrap:break-word}.wysiwyg-area .ProseMirror .selectedCell:after{z-index:2;position:absolute;content:"";inset:0;background:var(--brand-soft);opacity:.6;pointer-events:none}.wysiwyg-area .ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background:var(--brand);pointer-events:none}.wysiwyg-area .ProseMirror.resize-cursor{cursor:col-resize}.wysiwyg-area .ProseMirror-selectednode{outline:2px solid var(--brand)}.wysiwyg-area li.ProseMirror-selectednode{outline:none}.wysiwyg-area .ProseMirror-hideselection *::selection{background:transparent}.wysiwyg-area .ProseMirror-hideselection{caret-color:transparent}.wysiwyg-area img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}.wysiwyg-area .ProseMirror [draggable][contenteditable=false]{user-select:text}.editor.fullscreen .wysiwyg-area{height:100%;min-height:0;overflow:auto}.tb-btn[data-cmd=wysiwyg].active{color:var(--brand);background:var(--brand-soft)}.editor.wysiwyg .mention-menu button.active{background:var(--panel-2)}@media(max-width:640px){.wysiwyg-area{padding:10px;font-size:15px}.wysiwyg-area.wysiwyg-empty::before{inset-inline-start:10px}}

/* xstyle */
/* X Style: a topic row that carries .xstyle-head is laid out as a post of a timeline.
   Grid: the avatar in the first column; head, title (core .row-main) and body stacked in the second. */
.topic-row:has(> .slot .xstyle-head) {
  --xstyle-like: #f91880;
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 4px;
  padding: 14px 16px 8px; cursor: pointer;
}
.topic-row:has(> .slot .xstyle-head) > * { grid-column: 2; }
.topic-row:has(> .slot .xstyle-head) > .slot[data-slot="topic_list.item.after"] { display: contents; }
.topic-row:has(> .slot .xstyle-head) > .row-avatar { grid-column: 1; grid-row: 1 / span 3; padding-top: 2px; }
.topic-row:has(> .slot .xstyle-head) > .row-main { grid-row: 2; }
/* the classic meta line and category tag give way to the X Style head and actions: one rule each, matched anywhere in the
   row, so a theme or plugin that moves them (or a selector one browser rejects) cannot bring them back twice */
.topic-row:has(.xstyle-head) .row-meta { display: none !important; }
.topic-row:has(.xstyle-head) .row-cat { display: none !important; }
.topic-row:has(.xstyle-head) .row-icon-pin { display: none; }
.topic-row:has(.xstyle-head) .row-new { display: inline-block; margin-inline-start: 6px; vertical-align: middle; font-size: var(--font-size-xs); }
.topic-row:has(> .slot .xstyle-head) .row-title { margin: 0; font-size: var(--font-size-lg); font-weight: 600; line-height: 1.4; }
.topic-row.read:has(> .slot .xstyle-head) .row-title a { font-weight: 500; }

/* a member's own list (no avatar): one column, and the name is not repeated */
.topic-row:has(> .slot .xstyle-head):not(:has(> .row-avatar)) { grid-template-columns: minmax(0, 1fr); }
.topic-row:has(> .slot .xstyle-head):not(:has(> .row-avatar)) > * { grid-column: 1; }
.topic-row:not(:has(> .row-avatar)) .xstyle-name, .topic-row:not(:has(> .row-avatar)) .xstyle-name + .xstyle-dot { display: none; }

.xstyle-head { grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; font-size: var(--font-size-sm); color: var(--text-subtle); line-height: 1.4; }
.xstyle-pinned { flex-basis: 100%; display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-size-xs); font-weight: 600; color: var(--text-subtle); }
.xstyle-pinned .icon { width: 12px; height: 12px; }
.xstyle-who { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.xstyle-head .xstyle-name { font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xstyle-head .xstyle-name:hover { color: var(--text); text-decoration: underline; }
.xstyle-time { color: var(--text-subtle); white-space: nowrap; }
.xstyle-time:hover { color: var(--text-subtle); text-decoration: underline; }
.xstyle-cat { margin-inline-start: auto; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-muted); font-size: var(--font-size-xs); white-space: nowrap; }
.xstyle-cat:hover { border-color: var(--text-subtle); color: var(--text); }

.xstyle-body { grid-row: 3; min-width: 0; }
/* paragraphs stay paragraphs (one line break each), with a little air between them */
.xstyle-text { color: var(--text); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.xstyle-more { display: inline-block; margin-top: 2px; color: var(--brand); font-size: var(--font-size-sm); }
.xstyle-more:hover { text-decoration: underline; }
.xstyle-tags { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 6px; font-size: var(--font-size-sm); }
.xstyle-tags a { color: var(--brand); }
.xstyle-tags a:hover { text-decoration: underline; }

/* up to four pictures, the way a timeline shows them: one wide, two side by side, one tall beside two, or four squares; "+N" on the fourth */
.xstyle-media { display: grid; gap: 2px; max-width: 560px; margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel-2); }
.xstyle-pic { position: relative; display: block; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; cursor: zoom-in; }
a.xstyle-media .xstyle-pic { cursor: pointer; }
.xstyle-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xstyle-media-1 img { height: auto; max-height: 420px; }
.xstyle-media-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 260px; }
.xstyle-media-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 280px; }
.xstyle-media-3 > :first-child { grid-row: 1 / span 2; }
.xstyle-media-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 280px; }
.xstyle-plus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.4rem; font-weight: 600; }
/* a video: its cover and a play button, the player takes its place when pressed */
.xstyle-video { position: relative; display: flex; align-items: center; justify-content: center; max-width: 560px; margin-top: 12px; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #1c1c1e; }
.xstyle-video img, .xstyle-video video, .xstyle-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.xstyle-video.is-file video { object-fit: contain; background: #000; }
.xstyle-play { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); cursor: pointer; transition: transform .12s, background .12s; }
.xstyle-play:hover { background: var(--brand); transform: scale(1.06); }
.xstyle-tri { display: block; width: 0; height: 0; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.xstyle-badge { position: absolute; z-index: 1; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: var(--font-size-xs); }
.xstyle-badge .icon { width: 13px; height: 13px; }
.xstyle-video.playing .xstyle-play, .xstyle-video.playing .xstyle-badge { display: none; }
/* the picture viewer */
.xstyle-viewer { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); }
.xstyle-viewer[hidden] { display: none; }
.xstyle-viewer img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 4px; }
.xstyle-viewer button { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.xstyle-viewer button:hover { background: rgba(255, 255, 255, .24); }
.xstyle-v-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.xstyle-v-next { right: 16px; top: 50%; transform: translateY(-50%); }
.xstyle-v-close { top: 16px; right: 16px; }
.xstyle-viewer.single .xstyle-v-prev, .xstyle-viewer.single .xstyle-v-next, .xstyle-viewer.single .xstyle-count { display: none; }
.xstyle-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .8); font-size: var(--font-size-sm); }
.xstyle-mature { display: flex; align-items: center; gap: 8px; max-width: 560px; margin-top: 12px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 16px; background: var(--panel-2); color: var(--text-muted); font-size: var(--font-size-sm); }
.xstyle-mature .icon { width: 18px; height: 18px; flex: none; }
.xstyle-mature:hover { color: var(--text); }

/* fixed columns (replies, like, views, last reply, then bookmark and share), so the buttons line up from one row to the next */
.xstyle-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr) auto; align-items: center; gap: 8px; max-width: 600px; margin-top: 8px; margin-inline-start: -8px; color: var(--text-subtle); font-size: var(--font-size-sm); }
.xstyle-actions > * { justify-self: start; }
.xstyle-actions .action-form { display: inline-flex; margin: 0; }
.xstyle-act { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px; border: 0; border-radius: 999px; background: none; color: var(--text-subtle); font: inherit; line-height: 1; cursor: pointer; white-space: nowrap; }
.xstyle-act .icon { width: 17px; height: 17px; flex: none; }
.xstyle-act span:empty { display: none; }
.xstyle-reply:hover { color: var(--brand); background: var(--brand-soft, var(--panel-2)); }
.xstyle-like:hover, .xstyle-like.active { color: var(--xstyle-like); }
.xstyle-like:hover { background: color-mix(in srgb, var(--xstyle-like) 10%, transparent); }
.xstyle-like.active .icon { fill: var(--xstyle-like); }
.xstyle-views { cursor: default; }
.xstyle-last { max-width: 100%; overflow: hidden; }
.xstyle-last time { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xstyle-last span { overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.xstyle-last time { color: var(--text-subtle); }
.xstyle-last:hover { color: var(--text); background: var(--panel-2); }
.xstyle-end { justify-self: end; display: inline-flex; align-items: center; gap: 2px; }
.xstyle-end .action-form { display: inline-flex; margin: 0; }
.xstyle-bookmark span { display: none; } /* the core script writes Bookmark / Bookmarked into it: it stays the tooltip only */
.xstyle-bookmark:hover, .xstyle-bookmark.active { color: var(--brand); }
.xstyle-bookmark:hover { background: var(--panel-2); }
.xstyle-bookmark.active .icon { fill: var(--brand); }
.xstyle-share:hover { color: var(--brand); background: var(--panel-2); }

@media (max-width: 640px) {
  .topic-row:has(> .slot .xstyle-head) { grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; padding: 12px 12px 8px; }
  .topic-row:has(> .slot .xstyle-head) .row-avatar .avatar { width: 36px; height: 36px; }
  .topic-row:has(> .slot .xstyle-head) .row-title { font-size: 15px; }
  .xstyle-cat { display: none; }
  .xstyle-media, .xstyle-video { border-radius: 12px; }
  .xstyle-media-2, .xstyle-media-3, .xstyle-media-4 { height: 200px; }
  .xstyle-v-prev, .xstyle-v-next { display: none !important; }
  .xstyle-last, .xstyle-actions > span:empty { display: none; } /* no room for the last reply (or its empty place) beside the buttons on a phone; the topic shows it */
  .xstyle-actions { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
}

