:root {
    color-scheme: light;
    --bg: #f6faf8;
    --panel: #fff;
    --ink: #203b49;
    --muted: #536c76;
    --line: #dce8e9;
    --brand: #147999;
    --brand-dark: #13576e;
    --brand-soft: #edf8fc;
    --sun: #ffe16a;
    --mint: #dcf6e9;
    --danger: #aa3427;
    --shadow: 0 12px 36px #264e6510;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(ellipse at 0 0, #fff6ca, transparent 48%),
        radial-gradient(ellipse at 100% 30%, #e0f5ff, transparent 55%), var(--bg);
    color: var(--ink);
    font: 16px/1.5 "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
:where(a, button, input, summary):focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 5; padding: 12px 18px; border-radius: 10px; background: var(--sun); }
.skip-link:focus { top: 12px; }
.page { width: min(1160px, calc(100% - 48px)); margin: auto; padding: 24px 0 32px; }
.site-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.site-brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.15rem; font-weight: 800; }
.site-brand:hover { text-decoration: none; }
.site-brand img { flex: 0 0 40px; }
.site-brand small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.site-link { color: var(--brand-dark); font-size: .86rem; font-weight: 600; }
.site-link span { margin-left: 5px; }
.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 28px;
    min-height: 280px;
    padding: 36px;
    border: 1px solid #d3e6e6;
    border-radius: 24px;
    background: linear-gradient(90deg, #f6fcff 0%, #f6fcfff5 35%, #f6fcff70 65%, #f6fcff08 100%),
        url("joembedded_theme.jpg") center 47% / cover no-repeat;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.hero::after { position: absolute; bottom: 0; left: 0; right: 0; height: 5px; content: ""; background: linear-gradient(90deg, #ffdf62 0% 25%, #80d5f0 25% 50%, #96e1bc 50% 75%, #f7b3a4 75%); }
.brand { min-width: 0; align-self: center; }
.eyebrow { margin: 0 0 12px; color: var(--brand-dark); font-size: .73rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.1; letter-spacing: -.04em; }
.hero-description { max-width: 360px; margin: 14px 0 18px; color: #395764; font-size: .98rem; }
.path-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 30px; background: #fff1ac; color: #665013; font-size: .8rem; font-weight: 700; }
.path-pill span { font-size: 1.1rem; }
.internal-badge { display: inline-block; padding: 3px 7px; border-radius: 6px; background: #fff1ac; color: #665013; font-size: .72rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(92px, 1fr)); gap: 10px; }
.stat { min-width: 108px; padding: 16px 18px; border: 1px solid #ffffff; border-radius: 16px; background: #fffffff2; box-shadow: 0 4px 20px #203b4910; }
.stat:first-child { background: #fff5c9; }
.stat:last-child { background: #e0f7ec; }
.stat strong { display: block; font-size: 1.75rem; line-height: 1.1; letter-spacing: -.04em; }
.stat span { display: block; margin-top: 5px; color: #46616b; font-size: .77rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 15px; border: 1px solid #cbdfe4; border-radius: 10px; background: var(--panel); color: var(--brand-dark); font-size: .88rem; font-weight: 650; }
.button.primary { background: var(--sun); border-color: #e8cd5d; color: #433b20; }
.button:hover { background: var(--brand-soft); border-color: #79b5c6; text-decoration: none; }
.button.primary:hover { background: #ffec92; border-color: #c6a83b; }
.section { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: #f1faf6; }
h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.015em; }
.count { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.section-head > .count { padding: 4px 10px; border: 1px solid #cfe5da; border-radius: 20px; background: #fff; }
.tree-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 18px; padding: 20px 24px 0; }
.search-field { flex: 1 1 300px; min-width: 0; }
.search-field label { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 700; }
.search-field input { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid #b9d1da; border-radius: 10px; background: #f9fcfd; color: var(--ink); }
.search-field input::placeholder { color: #647c87; opacity: 1; }
.search-field input:focus { background: #fff; }
.tree-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tree-help, .search-status { margin: 0; padding: 12px 24px 20px; color: var(--muted); font-size: .8rem; }
.search-status { color: var(--brand-dark); font-weight: 700; }
.tree-list { margin: 0; padding: 0; list-style: none; }
.tree-folder summary, .file-row { display: grid; grid-template-columns: 12px 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 10px 24px; border-top: 1px solid var(--line); background: var(--panel); }
.tree-folder summary { list-style: none; }
.tree-folder summary::-webkit-details-marker { display: none; }
.tree-folder summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.tree-folder details[open] > summary::before { transform: rotate(45deg) translateY(-2px); }
.tree-folder details[open] > summary { background: #f1f9fc; }
.tree-folder summary:hover, .file-row:hover { background: #edf8fc; }
.tree-folder summary[aria-current] { box-shadow: inset 4px 0 var(--brand); }
.tree-folder summary > .count { padding: 3px 8px; background: #f2f6f7; border-radius: 7px; font-variant-numeric: tabular-nums; }
.tree-children { margin-left: 24px; border-left: 2px solid #d7eee5; }
.icon { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #fff4cb; font-size: 1.15rem; }
#media-tree > .tree-list > .tree-folder:nth-child(3n + 2) > details > summary > .icon { background: #def3fc; }
#media-tree > .tree-list > .tree-folder:nth-child(3n) > details > summary > .icon { background: #e2f6e9; }
.file-icon { background: #f0f5fb; }
.item-title { display: block; min-width: 0; font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; }
.file-row { grid-template-columns: 34px minmax(0, 1fr) auto; padding-left: 48px; }
.file-row:hover { text-decoration: none; }
.file-row:hover .item-title { text-decoration: underline; }
.file-meta { display: flex; gap: 16px; color: var(--muted); font-size: .78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.file-meta > span { min-width: 65px; text-align: right; }
.empty, .error { margin: 0; padding: 24px; background: var(--panel); color: var(--muted); }
.error { color: var(--danger); font-weight: 700; }
.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-top: 24px; color: var(--muted); font-size: .78rem; }
.footer a { color: var(--brand-dark); font-weight: 700; }
@media (max-width: 760px) {
    .page { width: calc(100% - 24px); padding-top: 18px; }
    .site-bar { margin: 0 4px 18px; }
    .site-link { display: none; }
    .hero { grid-template-columns: 1fr; gap: 24px; padding: 26px; background-image: linear-gradient(90deg, #f6fcfff5, #f6fcffbc), url("joembedded_theme.jpg"); border-radius: 18px; }
    .stats { width: min(280px, 100%); }
    .stat { min-width: 0; padding: 12px 16px; }
    .stat strong { font-size: 1.4rem; }
    .eyebrow { max-width: 260px; line-height: 1.6; }
    .hero-description { max-width: 320px; }
}
@media (max-width: 600px) {
    .site-brand { font-size: 1.05rem; }
    .site-brand small { font-size: .72rem; }
    .hero { padding: 24px 20px; }
    .toolbar { margin: 16px 0; }
    .section-head { padding: 16px; gap: 8px; flex-wrap: wrap; }
    .tree-tools { padding: 16px 12px 0; gap: 12px; }
    .tree-actions { width: 100%; }
    .tree-actions .button { flex: 1; }
    .tree-help, .search-status { padding: 12px; }
    .tree-children { margin-left: 8px; }
    .tree-folder summary { gap: 7px; padding: 10px 8px; grid-template-columns: 10px 28px minmax(0, 1fr); }
    .tree-folder summary > .count { grid-column: 3; justify-self: start; font-size: .72rem; padding: 1px 6px; }
    .icon { width: 28px; height: 28px; border-radius: 8px; font-size: 1rem; }
    .file-row { grid-template-columns: 28px minmax(0, 1fr); padding: 10px 8px 10px 25px; gap: 4px 7px; }
    .file-meta { grid-column: 2; flex-wrap: wrap; gap: 4px 12px; }
    .file-meta > span { min-width: 0; text-align: left; }
    .footer { justify-content: center; text-align: center; }
}
