* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Echo Sans", "Echo Sans World", "SF Pro Text", "SF Pro Display", "Helvetica Neue", Roboto, "Segoe UI", Arial,
                 "PingFang TC", "Noto Sans CJK TC", "Microsoft JhengHei",
                 "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei",
                 system-ui, sans-serif;
}

:root {
    --p: #feb718;
    --pd: #e5a100;
    --pg: rgba(254, 183, 24, 0.25);
    --link: var(--pd);
    --link-hover: var(--p);
    --bg: #fff8e7;
    --sf: #fffcf4;
    --row-alt: rgba(0, 0, 0, 0.025);
    --t1: #333333;
    --t2: #666666;
    --tm: #888888;
    --b: #e8e2d5;
    --oops: rgba(0, 0, 0, 0.045);
    --s: rgba(0, 0, 0, 0.06);
    --lang-bg-top: #ffffff;
    --lang-bg-bot: #eeeeee;
    --lang-fg: var(--pd);
    --lang-opt-bg: #ffffff;
    --lang-opt-fg: #333333;
    --avatar-bg-top: #ffffff;
    --avatar-bg-bot: #f2efe9;
    --avatar-fg: #333333;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --link: var(--p);
        --link-hover: var(--pd);
        --bg: #1e1b10;
        --sf: #262319;
        --row-alt: rgba(255, 255, 255, 0.025);
        --t1: #eeeeee;
        --t2: #aaaaaa;
        --tm: #777777;
        --b: #3a3628;
        --oops: rgba(255, 255, 255, 0.035);
        --s: rgba(0, 0, 0, 0.35);
        --lang-bg-top: #2b2927;
        --lang-bg-bot: #1c1a18;
        --lang-fg: #ffffff;
        --lang-opt-bg: #22201e;
        --lang-opt-fg: #ffffff;
        --avatar-bg-top: #2b2927;
        --avatar-bg-bot: #1c1a18;
        --avatar-fg: #ffffff;
    }
}

:root[data-theme="dark"] {
    --link: var(--p);
    --link-hover: var(--pd);
    --bg: #1e1b10;
    --sf: #262319;
    --row-alt: rgba(255, 255, 255, 0.025);
    --t1: #eeeeee;
    --t2: #aaaaaa;
    --tm: #777777;
    --b: #3a3628;
    --oops: rgba(255, 255, 255, 0.035);
    --s: rgba(0, 0, 0, 0.35);
    --lang-bg-top: #2b2927;
    --lang-bg-bot: #1c1a18;
    --lang-fg: #ffffff;
    --lang-opt-bg: #22201e;
    --lang-opt-fg: #ffffff;
    --avatar-bg-top: #2b2927;
    --avatar-bg-bot: #1c1a18;
    --avatar-fg: #ffffff;
}

body {
    background: var(--bg);
    color: var(--t1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Global Theme-Aware Links (No underline by default, dashed primary underline on hover) */
a {
    color: var(--link);
    text-decoration: none;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    transition: color 0.18s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline dashed;
}

/* Strip underline on structural UI components & pill tags */
.brand-half, .brand-half:hover,
.nav-links-desktop a:hover,
.mobile-overlay-links a:hover,
.mobile-social-link:hover,
.avatar-dropdown-menu a:hover,
.ui-btn:hover,
a.ui-tag, a.ui-tag:hover,
.go-pill a:hover,
.lib-card-head h2 a:hover,
.file-link:hover,
.porta-search-form a:hover {
    text-decoration: none;
}

/* ==========================================================================
   UNIFIED DESIGN SYSTEM PRIMITIVES
   ========================================================================== */
.ui-frame {
    background: var(--sf);
    border: 1px solid var(--b);
    border-radius: 12px;
    box-shadow: 0 4px 14px var(--s);
}

.ui-card {
    background: var(--bg);
    border: 1px solid var(--b);
    border-radius: 12px;
    padding: 16px 18px;
    transition: border-color 0.2s, transform 0.2s;
}

.ui-card-hover:hover,
.catalog-card:hover {
    border-color: var(--p);
    transform: translateY(-2px);
}

.ui-card h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--t1);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.ui-card h3 i { color: var(--p); }
.ui-card p:last-child { margin-bottom: 0; }

.ui-grid-2, .ui-grid-3, .ui-grid-4 { display: grid; gap: 14px; }
.ui-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ui-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ui-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ui-grid-2 > *, .ui-grid-3 > *, .ui-grid-4 > * { min-width: 0; }

.ui-stack { display: flex; flex-direction: column; gap: 10px; }
.ui-stack p:last-child { margin-bottom: 0; }

.ui-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--bg);
    border: 1px solid var(--b);
    color: var(--t2);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

a.ui-tag { padding: 5px 12px; font-size: 0.84rem; transition: border-color 0.18s, color 0.18s; }
a.ui-tag:hover { border-color: var(--p); color: var(--link-hover); }

.ui-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 36px;
    background: var(--bg);
    border: 1px solid var(--b);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ui-control:focus-within { border-color: var(--p); box-shadow: 0 0 0 2px var(--pg); }

.ui-btn {
    height: 36px;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: 0.18s;
    flex-shrink: 0;
}

.ui-btn:disabled { opacity: 0.65; cursor: not-allowed; }
.ui-btn-sq { width: 36px; padding: 0; }
.ui-btn-sm { height: 32px; font-size: 0.84rem; padding: 0 12px; }

.ui-btn-amber {
    border: none;
    background: var(--p);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--pg);
}
.ui-btn-amber:hover { background: var(--pd); color: #ffffff; }
.ui-btn-amber.full-width { width: 100%; height: 44px; font-size: 0.94rem; }

.ui-btn-outline { border: 1px solid var(--b); background: var(--bg); color: var(--t1); }
.ui-btn-outline:hover { border-color: var(--p); color: var(--pd); }

.ui-btn-danger {
    border: 1px solid #c0392b;
    background: #e74c3c;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.25);
}
.ui-btn-danger:hover {
    background: #c0392b;
    border-color: #a93226;
    color: #ffffff;
}

.ui-btn-danger-outline {
    border: 1px solid var(--b);
    background: var(--bg);
    color: #e74c3c;
}
.ui-btn-danger-outline:hover {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
    color: #c0392b;
}

.ui-icon-action {
    border: none;
    background: transparent;
    color: var(--tm);
    padding: 3px 5px;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.ui-icon-action:hover { color: var(--pd); }
.ui-icon-action.copied { color: #27ae60; }
.ui-icon-action.danger:hover { color: #e74c3c; }

.ui-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; text-align: left; }

/* ==========================================================================
   FULL-WIDTH NAVBAR, BRAND PILL & AVATAR MENU
   ========================================================================== */
.cdn-navbar {
    width: 100%;
    background: var(--sf);
    border-bottom: 1px solid var(--b);
    box-shadow: 0 4px 16px var(--s);
    position: sticky;
    top: 0;
    z-index: 220;
    transition: background-color 0.2s, border-color 0.2s;
}

body.menu-open .cdn-navbar {
    background: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
}

/* Hide Logo & User Pills cleanly without altering flex geometry when Overlay is active */
body.menu-open .brand-lang-pill,
body.menu-open .avatar-pill-btn,
body.menu-open .avatar-dropdown-wrap {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-lang-pill {
    display: inline-flex;
    align-items: stretch;
    height: 38px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(229, 161, 0, 0.4);
    user-select: none;
    flex-shrink: 0;
}

.brand-half {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #ffffff !important;
    background: linear-gradient(var(--p) 50%, var(--pd) 0);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.lang-half {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-left: 6px;
    background: linear-gradient(var(--lang-bg-top) 50%, var(--lang-bg-bot) 0);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.pill-theme-icon {
    border: none;
    background: transparent;
    color: var(--lang-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    padding: 2px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pill-theme-icon:hover { transform: scale(1.15); }

.pill-theme-icon .theme-ic-moon { display: none; }
.pill-theme-icon .theme-ic-sun  { display: inline-block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .pill-theme-icon .theme-ic-sun  { display: none; }
    :root:not([data-theme="light"]) .pill-theme-icon .theme-ic-moon { display: inline-block; }
}
:root[data-theme="dark"] .pill-theme-icon .theme-ic-sun  { display: none; }
:root[data-theme="dark"] .pill-theme-icon .theme-ic-moon { display: inline-block; }

.lang-half select {
    appearance: none;
    -webkit-appearance: none;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--lang-fg);
    font-size: 0.88rem;
    font-weight: 800;
    padding: 0 28px 0 6px;
    cursor: pointer;
    outline: none;
}

.lang-half select option { background-color: var(--lang-opt-bg); color: var(--lang-opt-fg); }
.lang-caret {
    position: absolute;
    right: 9px;
    padding: 2px;
    font-size: 0.68rem;
    color: var(--lang-fg);
    pointer-events: none;
}

.nav-links-desktop { display: flex; align-items: center; gap: 28px; }
.nav-links-desktop a {
    color: var(--t2);
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
}
.nav-links-desktop a:hover,
.nav-links-desktop a.active { color: var(--pd); border-bottom-color: var(--p); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.avatar-dropdown-wrap { position: relative; }
.avatar-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 4px 12px 4px 5px;
    border-radius: 24px;
    border: 1px solid var(--b);
    background: linear-gradient(var(--avatar-bg-top) 50%, var(--avatar-bg-bot) 0);
    color: var(--avatar-fg);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s ease;
}
.avatar-pill-btn:hover { border-color: var(--p); }

.avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--p);
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar-action-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--p);
    font-size: 0.9rem;
    padding: 2px 2px 2px 4px;
    transition: color 0.18s ease, transform 0.18s ease;
}
.avatar-logout-trigger:hover {
    color: #e74c3c;
    transform: translateX(1px);
}

.avatar-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 230px;
    background: var(--sf);
    border: 1px solid var(--b);
    border-radius: 12px;
    box-shadow: 0 12px 30px var(--s);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 230;
}
.avatar-dropdown-menu.open { display: flex; }

.avatar-dropdown-menu a,
.avatar-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 13px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--t1);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.avatar-dropdown-menu a:hover,
.avatar-dropdown-menu button:hover { background: var(--bg); color: var(--pd); }
.avatar-dropdown-menu .repair-item { color: var(--pd); }
.avatar-dropdown-menu .danger-item:hover { color: #e74c3c; }
.dropdown-divider { height: 1px; background: var(--b); margin: 4px 0; }

/* Animated Hamburger -> Exact In-Place Cross */
.hamburger-animated {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger-animated span {
    position: absolute;
    left: 8px;
    width: 24px;
    height: 2.5px;
    border-radius: 3px;
    background: var(--t1);
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, background-color 0.2s ease;
}
.hamburger-animated span:nth-child(1) { top: 12px; }
.hamburger-animated span:nth-child(2) { top: 19px; }
.hamburger-animated span:nth-child(3) { top: 26px; }
.hamburger-animated:hover span { background: var(--p); }
.hamburger-animated.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-animated.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-animated.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 200;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 84px 20px 32px;
    text-align: center;
    cursor: pointer;
}
.mobile-overlay.active { display: flex; }

.mobile-overlay-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: auto 0;
}

.mobile-overlay-links a {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--t1);
    letter-spacing: 0.04em;
}
.mobile-overlay-links a:hover,
.mobile-overlay-links a.accent-link { color: var(--p); }

.mobile-overlay-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.mobile-social-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.mobile-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: none;
    background: transparent;
    color: var(--t2);
    font-size: 1.25rem;
    transition: color 0.18s ease, transform 0.18s ease;
}
.mobile-social-link:hover {
    color: var(--p);
    transform: translateY(-2px);
}

.mobile-copy { font-size: 0.8rem; font-weight: 700; color: var(--tm); letter-spacing: 0.1em; }

/* ==========================================================================
   HERO WATERMARK HEADER & LIBRARY METADATA
   ========================================================================== */
.page-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 44px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hero-header {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 0 24px;
    overflow: hidden;
}
.hero-home { padding: 68px 0 48px; }

.hero-header::before {
    content: attr(data-bg);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(5.5rem, 15vw, 10.5rem);
    font-weight: 100;
    line-height: 0.85;
    color: var(--oops);
    letter-spacing: -0.02em;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}
.hero-header > * { position: relative; z-index: 2; }

.hero-header h1 {
    font-size: clamp(2.1rem, 4.5vw, 3.2rem);
    font-weight: 800;
    color: var(--p);
    text-shadow: 0 4px 15px var(--pg);
    letter-spacing: 0.03em;
    line-height: 1.15;
    margin-bottom: 10px;
}

.lib-title-with-ver {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}
.title-ver-tag { font-size: 0.96rem; font-weight: 800; color: var(--t2); text-shadow: none; }

.hero-lead, .lib-desc-lead {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--t2);
    max-width: 720px;
    margin-bottom: 6px;
    line-height: 1.6;
}
.hero-sub-stat { font-size: 0.86rem; font-weight: 600; color: var(--tm); margin-bottom: 24px; }

.lib-ext-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--t2);
}

.lib-licenses-group { display: inline-flex; align-items: center; gap: 6px; }
.lib-licenses-group i { color: var(--t2); }

.lib-keywords-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
    max-width: 780px;
}

.porta-search-form {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    background: var(--sf);
    border: 1.5px solid var(--b);
    border-radius: 50px;
    padding: 4px 6px;
    box-shadow: 0 8px 24px var(--s);
}
.porta-search-form:focus-within { border-color: var(--p); box-shadow: 0 10px 30px var(--pg); }
.porta-search-form a,
.porta-search-form button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    flex-shrink: 0;
    cursor: pointer;
}
.porta-search-form a { color: var(--t2); background: transparent; }
.porta-search-form a:hover { background: var(--bg); color: var(--pd); }
.porta-search-form button { background: var(--p); }
.porta-search-form button:hover { background: var(--pd); }
.porta-search-form svg { width: 22px; height: 22px; }
.porta-search-form a svg { fill: currentColor; }
.porta-search-form button svg { fill: #ffffff; }
.porta-search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 14px;
    font-size: 0.94rem;
    color: var(--t1);
    outline: none;
}

/* ==========================================================================
   BROWSE LIBRARIES DIRECTORY (/libraries)
   ========================================================================== */
.libraries-directory { display: flex; flex-direction: column; gap: 16px; }
.dir-filter-bar { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }

.dir-search-box {
    width: 100%;
    max-width: 640px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sf);
    border: 1.5px solid var(--b);
    border-radius: 12px;
    padding: 11px 16px;
    box-shadow: 0 4px 14px var(--s);
}
.dir-search-box:focus-within { border-color: var(--p); }
.dir-search-box i { color: var(--tm); }
.dir-search-box input { flex: 1; border: none; background: transparent; color: var(--t1); font-size: 0.94rem; outline: none; }
.dir-count-line { font-size: 0.84rem; font-weight: 700; color: var(--tm); }

.catalog-main { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.catalog-card { padding: 18px 20px; cursor: pointer; }

.lib-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.lib-card-head h2, .lib-card-head h3 {
    font-size: 1.08rem;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 0;
}
.lib-card-head h2 a { color: var(--t1); }
.catalog-card:hover .lib-card-head h2 a { color: var(--pd); }
.card-ver-at { font-size: 0.84rem; font-weight: 700; color: var(--pd); }
.catalog-card p { font-size: 0.88rem; color: var(--t2); }

/* ==========================================================================
   UNIFIED SINGLE LIBRARY EXPLORER & COMPACT HEADINGLESS FILE LIST
   ========================================================================== */
.lib-explorer-frame { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.lib-explorer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lib-top-identity { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.lib-top-slug { font-size: 1.15rem; font-weight: 800; color: var(--t1); line-height: 1.2; }
.lib-top-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lib-top-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1; min-width: 0; }

.lib-filter-control { flex: 1; max-width: 300px; min-width: 120px; padding: 0 11px; gap: 8px; }
.lib-filter-control i { color: var(--tm); font-size: 0.8rem; }
.lib-filter-control input { width: 100%; border: none; background: transparent; color: var(--t1); font-size: 0.84rem; outline: none; }

.lib-select-control select {
    appearance: none;
    -webkit-appearance: none;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--t1);
    padding: 0 30px 0 12px;
    cursor: pointer;
    outline: none;
}
.lib-select-control select option { background: var(--sf); color: var(--t1); }
.select-caret {
    position: absolute;
    right: 10px;
    padding: 2px;
    font-size: 0.68rem;
    color: var(--t2);
    pointer-events: none;
}

.release-notes-strip {
    background: var(--bg);
    border-left: 3px solid var(--p);
    border-radius: 6px;
    padding: 9px 13px;
    font-size: 0.86rem;
    color: var(--t2);
    display: flex;
    align-items: flex-start;
    gap: 9px;
}
.release-notes-strip i { color: var(--p); margin-top: 3px; }
.notes-multiline { line-height: 1.5; flex: 1; }
.release-notes-edit-btn { margin-left: auto; flex-shrink: 0; }

.lib-files-wrap { border: 1px solid var(--b); border-radius: 10px; overflow-x: auto; }
.lib-files-table tbody tr:nth-child(odd) { background: var(--row-alt); }
.lib-files-table tbody tr:hover { background: rgba(254, 183, 24, 0.08); }
.lib-files-table td { padding: 7px 14px; vertical-align: middle; }

.file-path-cell { width: 100%; }
.file-link { display: inline-flex; align-items: center; gap: 8px; color: var(--t1); word-break: break-all; }
.file-row-ic { color: var(--tm); font-size: 0.84rem; flex-shrink: 0; }
.path-dir { color: var(--tm); font-weight: 500; }
.path-name { color: var(--t1); font-weight: 700; }
.file-link:hover .path-name { color: var(--pd); text-decoration: underline dashed; }

.type-cell, .size-cell, .actions-cell { white-space: nowrap; }
.ext-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    background: var(--sf);
    border: 1px solid var(--b);
    color: var(--t2);
}
.ext-styling { border-color: #3498db; color: #3498db; }
.ext-javascript { border-color: #d4ac0d; color: #d4ac0d; }
.ext-typescript { border-color: #2980b9; color: #2980b9; }
.ext-sourcemaps { border-color: #7f8c8d; color: #7f8c8d; }
.ext-images { border-color: #27ae60; color: #27ae60; }
.ext-fonts { border-color: #9b59b6; color: #9b59b6; }

.size-cell { color: var(--tm); font-size: 0.8rem; font-weight: 600; text-align: right; }
.actions-cell { text-align: right; }
.icon-btn-group { display: inline-flex; align-items: center; gap: 6px; }
.empty-row { text-align: center; color: var(--tm); padding: 18px !important; }

/* ==========================================================================
   MODALS, FORMS, INLINE TOOLTIP, LICENSE ROWS & UPLOAD QUEUE
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 260;
    padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal-card { width: 100%; max-width: 490px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-card.modal-wide { max-width: 650px; }

.modal-head {
    padding: 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--b);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-head h3 { font-size: 1.12rem; font-weight: 800; color: var(--p); display: flex; align-items: center; gap: 8px; }
.modal-close { border: none; background: transparent; color: var(--t2); font-size: 1.15rem; cursor: pointer; }

.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.88rem; font-weight: 800; color: var(--t2); display: inline-flex; align-items: center; gap: 6px; }

/* Instant Hover / Tap Tooltip for Form Label Hints */
.label-tip-ic {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--pd);
    cursor: help;
    outline: none;
}

.label-tip-ic[data-tip]:hover::after,
.label-tip-ic[data-tip]:focus::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    right: -10px;
    width: max-content;
    max-width: 260px;
    padding: 8px 11px;
    border-radius: 8px;
    background: #22201e;
    color: #ffffff;
    border: 1px solid var(--p);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.45;
    white-space: normal;
    text-align: left;
    z-index: 280;
    pointer-events: none;
}

.form-input {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--b);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.9rem;
    color: var(--t1);
    outline: none;
}
.form-input:focus { border-color: var(--p); }
textarea.form-input { resize: vertical; min-height: 68px; }

/* Multi-License Rows with Inline Input End Remove Button */
.lic-field-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.lic-rows-list { display: flex; flex-direction: column; gap: 8px; }
.lic-input-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; align-items: center; }

.input-end-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.form-input.has-end-btn { padding-right: 34px; }
.input-end-btn { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); }

.drop-zone {
    border: 2px dashed var(--b);
    background: var(--bg);
    border-radius: 12px;
    padding: 22px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}
.drop-zone.drag-over { border-color: var(--p); background: rgba(254, 183, 24, 0.1); }
.drop-ic { font-size: 1.8rem; color: var(--p); }
.drop-title { font-size: 0.94rem; font-weight: 800; color: var(--t1); }
.drop-sub { font-size: 0.8rem; color: var(--tm); }
.drop-pickers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

.upload-queue-box { border: 1px solid var(--b); background: var(--bg); border-radius: 10px; overflow: hidden; margin-top: 8px; }
.queue-header { padding: 7px 12px; background: var(--sf); border-bottom: 1px solid var(--b); font-size: 0.78rem; font-weight: 800; color: var(--pd); }
.queue-list { list-style: none; max-height: 170px; overflow-y: auto; padding: 4px 10px; font-size: 0.8rem; }
.queue-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 5px 2px;
    border-bottom: 1px dashed var(--b);
    color: var(--t2);
}
.queue-list li:last-child { border-bottom: none; }
.q-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.q-file-meta { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.q-remove-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--b);
    background: var(--sf);
    color: var(--tm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
}
.q-remove-btn:hover { background: #e74c3c; border-color: #c0392b; color: #ffffff; }
.modal-error { color: #e74c3c; font-size: 0.85rem; font-weight: 700; display: none; }
.modal-error.show { display: block; }

.modal-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.modal-actions-row .ui-btn {
    flex: 1;
    height: 44px;
    font-size: 0.94rem;
}

.ui-btn-danger {
    border: 1px solid #c0392b;
    background: #e74c3c;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.25);
}

.ui-btn-danger:hover {
    background: #c0392b;
    border-color: #a93226;
    color: #ffffff;
}

@media (max-width: 520px) {
    .modal-actions-row {
        flex-direction: column-reverse;
    }
    .modal-actions-row .ui-btn {
        width: 100%;
    }
}

/* ==========================================================================
   CONTENT PAGES, DOC SECTIONS, CODE BLOCKS, FOOTER, COOKIE & TOAST
   ========================================================================== */
.content-box { padding: 28px; }
.content-box h2 { color: var(--pd); font-size: 1.2rem; margin: 16px 0 6px; }
.content-box h2:first-child { margin-top: 0; }
.content-box p, .content-box li { color: var(--t2); font-size: 0.94rem; margin-bottom: 8px; }
.content-box ol, .content-box ul { padding-left: 22px; }

.cdn-doc-section { display: flex; flex-direction: column; gap: 8px; }
.cdn-doc-section h2 { margin: 16px 0 0; }
.cdn-doc-section h2:first-child { margin-top: 0; }
.cdn-doc-section > p,
.cdn-doc-section > ol,
.cdn-doc-section > ul { margin-bottom: 0; }
.cdn-doc-section > p:first-child { margin-bottom: 8px; }
.doc-lead-intro { font-size: 1.02rem !important; color: var(--t1) !important; line-height: 1.65; }

.ui-stat-card { text-align: center; padding: 18px 12px; }
.ui-stat-val { font-size: 1.65rem; font-weight: 800; color: var(--p); line-height: 1.15; margin-bottom: 4px; }
.ui-stat-lbl { font-size: 0.74rem; font-weight: 800; color: var(--t2); text-transform: uppercase; letter-spacing: 0.05em; }
.ui-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.content-box pre,
.content-box pre code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.content-box pre {
    background: var(--bg);
    border: 1px solid var(--b);
    border-radius: 10px;
    padding: 14px 40px 14px 14px;
    font-size: 0.82rem;
    line-height: 1.55;
    overflow-x: hidden;
    margin: 0;
    height: 100%;
}
.ui-code-wrap { position: relative; }
.code-copy-btn { position: absolute; top: 10px; right: 10px; z-index: 2; }

.cdn-footer {
    width: 100%;
    background: var(--sf);
    border-top: 1px solid var(--b);
    margin-top: auto;
    padding: 36px 20px 26px;
}
.footer-inner { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h4 { font-size: 0.82rem; font-weight: 800; color: var(--pd); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px; }
.footer-col a { color: var(--t2); font-size: 0.92rem; font-weight: 600; }
.footer-col a:hover { color: var(--link-hover); }

.footer-bottom {
    padding-top: 20px;
    border-top: 1px dashed var(--b);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}
.footer-brand-note { font-size: 0.84rem; color: var(--tm); }

.go-pill {
    display: inline-flex;
    align-items: stretch;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 6px #0001, 0 1px 2px #0001;
    user-select: none;
}
.go-pill a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 13px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    z-index: 1;
}
.go-pill a::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.2s; }
.go-pill a:first-child, .go-pill a:last-child::after { background: linear-gradient(#fff 50%, #eee 0); }
.go-pill a:last-child, .go-pill a:first-child::after { background: linear-gradient(var(--p) 50%, var(--pd) 0); }
.go-pill a:last-child, .go-pill:hover a:first-child { color: #fff; }
.go-pill a:first-child, .go-pill:hover a:last-child { color: var(--pd); }
.go-pill:hover a::after { opacity: 1; }
.go-pill a:last-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 5px;
    background: #fff;
    border: 1.5px solid var(--pd);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    --pc: rgba(254, 183, 24, 0.85);
    animation: pillPulse 2s infinite;
}
.go-pill:hover a:last-child::before { background: var(--pd); border-color: #fff; --pc: rgba(255, 255, 255, 0.9); }

@keyframes pillPulse {
    0% { box-shadow: 0 0 0 0 var(--pc); }
    70%, 100% { box-shadow: 0 0 0 4.5px #0000; }
}

.cookie-banner {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 820px;
    background: var(--sf);
    border: 1.5px solid var(--p);
    border-radius: 14px;
    padding: 12px 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    z-index: 120;
}
.cookie-banner.show { display: flex; }
.cookie-text { display: flex; align-items: center; gap: 10px; font-size: 0.84rem; color: var(--t1); }
.cookie-text i { color: var(--p); font-size: 1.1rem; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-cookie-sub, .btn-cookie-main { border-radius: 20px; padding: 6px 14px; font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.btn-cookie-sub { background: var(--bg); border: 1px solid var(--b); color: var(--t2); }
.btn-cookie-main { background: var(--p); border: none; color: #fff; }

.cdn-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #222;
    color: #fff;
    border-left: 4px solid var(--p);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: 0.22s;
    z-index: 300;
}
.cdn-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
    .nav-links-desktop { display: none !important; }
    .hamburger-animated { display: block; }
    .ui-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .ui-grid-3, .ui-grid-2, .form-row-2 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .cookie-banner { flex-direction: column; align-items: flex-start; }
    .label-tip-ic[data-tip]:hover::after,
    .label-tip-ic[data-tip]:focus::after {
        left: -10px;
        right: auto;
    }
}

@media (max-width: 768px) {
    .lib-filter-control { display: none !important; }
    .lib-explorer-top { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .lic-input-row { grid-template-columns: 1fr; }
}