:root{font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:#20334c;background:#f3f6fa}*{box-sizing:border-box}body{margin:0}header{background:#102e4d;color:white;padding:22px max(24px,calc((100vw - 1100px)/2));display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap}header a{color:white;text-decoration:none}header nav{display:flex;gap:20px;flex-wrap:wrap}.logo{font-weight:800}.wrap{max-width:1100px;margin:34px auto;padding:0 18px}.panel{background:white;border:1px solid #dfe8f2;border-radius:14px;padding:26px;margin-bottom:22px;box-shadow:0 5px 24px #12304a08}.muted{color:#64748b}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:18px}.card{border:1px solid #e1e9f2;border-radius:12px;padding:20px;background:white}h1{font-size:29px;margin:0 0 10px}h2{font-size:20px;margin:0 0 14px}.field{margin-bottom:18px}label{font-weight:650;display:block;margin-bottom:8px}input,textarea,select{font:inherit;width:100%;padding:12px 14px;border:1px solid #cbd5e1;border-radius:8px;background:white}textarea{resize:vertical}small{display:block;color:#64748b;margin-top:6px}.btn{display:inline-block;border:0;border-radius:9px;background:#1768a5;color:white;text-decoration:none;padding:12px 20px;font:inherit;font-weight:650;cursor:pointer}.btn.secondary{background:#edf4fb;color:#1768a5}.btn:disabled{opacity:.6}.actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center}.alert{padding:14px 18px;border-radius:9px;background:#fff3e8;border:1px solid #ffd3a5;margin-bottom:20px;white-space:pre-wrap;overflow-wrap:anywhere}.ok{background:#e9f9ef;border-color:#b6e8c7}.pill{display:inline-block;padding:5px 9px;background:#edf4fa;border-radius:100px;color:#31577a;font-size:12px}ul.clean{padding:0;list-style:none}ul.clean li{padding:16px 0;border-bottom:1px solid #e8eef5}.split{display:grid;grid-template-columns:1fr 1fr;gap:18px}@media(max-width:700px){.split{grid-template-columns:1fr}.panel{padding:19px}}
.license-text{white-space:normal;line-height:1.75;padding:20px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;margin:18px 0}

/* Submission metadata widgets */
.field select{display:block;width:100%;padding:12px 14px;border:1px solid #d7e0e9;border-radius:10px;background:#fff;color:#16324a;font:inherit}
.keyword-row{display:flex;align-items:center;gap:9px;margin-bottom:9px}
.keyword-row input{flex:1;min-width:0}
.keyword-grip{color:#8798aa;font-weight:700;letter-spacing:-2px;user-select:none}
.keyword-remove{border:0;border-radius:8px;background:#edf1f5;color:#4b5967;cursor:pointer;padding:11px 14px;font-size:16px}
.keyword-remove:hover{background:#ffe6e6;color:#b52222}
#add-keyword{margin-top:4px;margin-bottom:12px}
/* Repository hierarchy */
.tree-node{border:1px solid #e2eaf3;border-radius:11px;margin:10px 0;background:#fff;overflow:hidden}
.tree-node summary{cursor:pointer;display:flex;justify-content:space-between;gap:12px;align-items:center;padding:15px 16px;font-weight:700}
.tree-node summary::marker{color:#1e699e}
.tree-node summary:hover{background:#f7fbff}
.tree-label{flex:1}.tree-node a,.tree-collection a{color:#1768a5;text-decoration:none}.tree-node a:hover,.tree-collection a:hover{text-decoration:underline}
.tree-children{border-top:1px solid #eaf0f5;padding:8px 12px 10px 22px;border-left:3px solid #d9e9f6;margin-left:17px}
.tree-collection{padding:12px 10px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #eef2f6}
.tree-collection:last-child{border-bottom:0}

/* Collapsible full item metadata */
.metadata-spoiler{overflow:hidden}
.metadata-spoiler>summary{cursor:pointer;font-weight:700;font-size:18px;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 20px}
.metadata-spoiler>summary::-webkit-details-marker{display:none}
.metadata-spoiler>summary::after{content:"+";font-size:24px;font-weight:400;color:#1768a5}
.metadata-spoiler[open]>summary::after{content:"−"}
.metadata-spoiler>summary:hover{background:#f7fbff}
.metadata-spoiler-content{padding:0 20px 20px}

/* v8: Clean, visually nested repository tree (no emoji or counts) */
.tree-node{margin:9px 0;border:1px solid #dce6f0;border-radius:11px;background:#fff;overflow:visible;box-shadow:0 2px 8px rgba(22,52,82,.035)}
.tree-node>summary{list-style:none;display:flex;align-items:center;justify-content:flex-start;gap:12px;min-height:53px;padding:12px 17px;font-weight:650;cursor:pointer;border-radius:10px;transition:background .15s ease}
.tree-node>summary::-webkit-details-marker{display:none}
.tree-node>summary::before{content:"";display:block;flex:0 0 9px;width:9px;height:9px;border-right:2px solid #55738d;border-bottom:2px solid #55738d;transform:rotate(-45deg);transition:transform .15s ease;margin-right:4px}
.tree-node[open]>summary::before{transform:rotate(45deg)}
.tree-node>summary:hover{background:#f1f7fd}
.tree-node>summary:focus-visible{outline:3px solid #80b7e4;outline-offset:2px}
.tree-node .tree-label{min-width:0;flex:1}
.tree-node a,.tree-collection a{color:#174f7f;text-decoration:none}
.tree-node a:hover,.tree-collection a:hover{text-decoration:underline}
.tree-children{margin:0 0 0 24px;padding:5px 13px 11px 21px;border-top:0;border-left:2px solid #d4e4f3}
.tree-children>.tree-node{margin:7px 0;background:#fbfdff;border-color:#e4ebf3;box-shadow:none}
.tree-children>.tree-node>summary{min-height:47px;padding:10px 13px}
.tree-children>.tree-children{margin-left:24px}
.tree-collection{display:flex;align-items:center;gap:11px;min-height:43px;margin:5px 0;padding:9px 13px 9px 20px;border:0;border-radius:8px;background:#f3f7fb;position:relative}
.tree-collection::before{content:"";position:absolute;left:0;top:50%;width:12px;height:2px;background:#b7cde1}
.tree-collection-label{min-width:0;overflow-wrap:anywhere}
.tree-node>summary .tree-label a{overflow-wrap:anywhere}
@media(max-width:700px){.tree-children{margin-left:12px;padding-left:12px;padding-right:5px}.tree-node>summary{padding:10px 12px}.tree-collection{padding:9px 8px 9px 15px}}

/* v10: unmistakable hierarchy, scoped styles and clear content levels */
.tree-node,.tree-collection{font-family:inherit}
.tree-node{display:block;border:0;box-shadow:none;background:transparent;margin:8px 0;overflow:visible}
.tree-node>summary{display:flex;align-items:center;gap:12px;list-style:none;min-height:62px;padding:12px 16px;background:#f2f7fc;border:1px solid #dce8f4;border-radius:10px;cursor:pointer}
.tree-node>summary::-webkit-details-marker{display:none}
.tree-node>summary::before{content:none!important}
.tree-node>summary:hover{background:#eaf3fc}
.tree-node .tree-toggle{display:inline-block;flex:0 0 9px;width:9px;height:9px;border-right:2px solid #416a8b;border-bottom:2px solid #416a8b;transform:rotate(-45deg);transition:transform .15s}
.tree-node[open]>summary .tree-toggle{transform:rotate(45deg)}
.tree-title{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1;line-height:1.35}
.tree-kind{display:block;font-size:10px;font-weight:800;letter-spacing:.10em;text-transform:uppercase;color:#6885a1}
.tree-title>a{display:block;color:#163d63;text-decoration:none;font-weight:650;font-size:15px;overflow-wrap:anywhere}
.tree-title>a:hover{text-decoration:underline}
.tree-node.tree-root{margin:17px 0 20px;border:1px solid #d8e4f0;border-radius:13px;background:#fff;overflow:hidden;box-shadow:0 3px 13px #143e5c0b}
.tree-node.tree-root>summary{border:0;border-radius:0;background:#eaf3fc;min-height:75px;padding:16px 20px}
.tree-node.tree-root>summary .tree-title>a{font-size:17px;font-weight:750}
.tree-node.tree-root>summary .tree-kind{color:#336c9d}
.tree-node .tree-children{display:block;margin:0 0 0 28px;padding:12px 12px 12px 24px;border-left:2px solid #bfd5e8;border-top:0;position:relative}
.tree-node.tree-root>.tree-children{margin:0 0 0 25px;padding:12px 18px 16px 25px}
.tree-children>.tree-node{margin:10px 0;background:transparent;border:0;box-shadow:none}
.tree-children>.tree-node>summary{min-height:60px;background:#f7f9fc;border:1px solid #e2eaf3;border-radius:9px;padding:10px 14px}
.tree-children>.tree-node>summary:hover{background:#edf5fc}
.tree-children>.tree-node>.tree-children{margin-left:23px;padding-left:22px}
.tree-collection{display:flex;align-items:center;gap:13px;position:relative;margin:8px 0;padding:11px 14px;background:#fff;border:1px solid #e4ebf3;border-radius:9px;min-height:60px}
.tree-collection::before{content:none}
.tree-collection-dot{width:10px;height:10px;border:2px solid #5d94c1;border-radius:3px;flex:0 0 10px}
.tree-collection .tree-kind{color:#67829a}
.tree-collection .tree-title>a{font-weight:550}
@media(max-width:700px){.tree-node.tree-root>summary{padding:13px}.tree-node.tree-root>.tree-children,.tree-node .tree-children{margin-left:12px;padding-left:13px;padding-right:7px}.tree-children>.tree-node>.tree-children{margin-left:12px;padding-left:13px}.tree-title>a{font-size:14px}}

/* Dashboard tabs and records */
.dash-tabs{display:flex;flex-wrap:wrap;gap:8px;border-bottom:1px solid #dce6f0;padding-bottom:14px;margin-bottom:24px}
.dash-tab{display:inline-flex;align-items:center;padding:11px 15px;border-radius:9px;color:#1768a5;text-decoration:none;font-weight:650;background:#f1f5f9}
.dash-tab:hover{background:#e4eef9}
.dash-tab.active{background:#1768a5;color:white}
.dash-entry{display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap}
.dash-entry .actions{margin-left:auto}
@media(max-width:650px){.dash-tab{flex:1;justify-content:center}.dash-entry .actions{margin-left:0}}

/* v16: єдина шапка для головної і всіх PHP-сторінок */
.portal-header, header.portal-header{display:block;background:#fff;color:#142f4d;border-bottom:1px solid #d9e5ef;padding:0;margin:0;box-shadow:0 2px 12px rgba(15,44,70,.04)}
.portal-header *{box-sizing:border-box}
.portal-header-inner{max-width:1200px;margin:0 auto;padding:13px 22px;min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.portal-header a{color:#142f4d;text-decoration:none}
.portal-brand{display:flex;align-items:center;gap:13px;min-width:0}
.portal-brand-mark{height:44px;width:44px;flex:none;background:#1c659b;color:#fff;display:grid;place-items:center;font-size:20px;font-weight:750}
.portal-brand-text{display:flex;flex-direction:column;gap:3px;min-width:0}
.portal-brand-text strong{font-size:17px;line-height:1.25;color:#142f4d}
.portal-brand-text small{display:block;margin:0;color:#6f849b;font-size:12px;line-height:1.3}
.portal-nav{display:flex;align-items:center;justify-content:flex-end;gap:22px;flex-wrap:wrap;flex-shrink:0}
.portal-nav>a{display:inline-flex!important;align-items:center;font-size:14px;font-weight:500;white-space:nowrap}
.portal-nav>a:hover{color:#1768a5!important}
.portal-nav a.portal-login,.portal-logout button{background:#1b6399;color:#fff!important;padding:11px 15px;border:none;font:inherit;font-size:14px;font-weight:600;cursor:pointer;border-radius:5px}
.portal-logout{margin:0}.portal-logout button:hover,.portal-nav a.portal-login:hover{background:#114e7e;color:#fff!important}
.portal-logout input[type=hidden]{display:none}
@media(max-width:850px){.portal-header-inner{flex-wrap:wrap;gap:13px}.portal-nav{width:100%;justify-content:flex-start;gap:12px 20px}.portal-nav>a{display:inline-flex!important}}
@media(max-width:480px){.portal-header-inner{padding:12px 16px}.portal-brand-text strong{font-size:15px}.portal-nav{gap:10px 15px}.portal-nav>a{font-size:13px}}
/* v16: простий список фондів / підфондів без акордеона */
.fund-list{display:grid;gap:11px;margin-top:18px}
.fund-link{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#f8fbff;border:1px solid #dce8f2;padding:17px 19px;border-radius:11px;color:#173c60;text-decoration:none;transition:background .15s,border-color .15s}
.fund-link:hover{background:#ebf4fb;border-color:#9bc8e7}
.fund-link strong{font-size:16px;font-weight:700;display:block;overflow-wrap:anywhere}
.fund-link .fund-arrow{font-size:22px;color:#4a7fa6;flex:none}
.fund-section{margin:26px 0 8px}.fund-section h2{margin-bottom:6px}
.fund-breadcrumbs{display:flex;gap:8px;flex-wrap:wrap;align-items:center;font-size:14px;margin:0 0 17px;color:#667e94}
.fund-breadcrumbs a{color:#1768a5;text-decoration:none}

/* v18: file management and complete submission review */
.upload-file-list{display:grid;gap:12px;margin:16px 0}
.uploaded-file{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;border:1px solid #dae4ef;border-radius:12px;padding:16px;background:#f8fbff}
.uploaded-file form{margin:0}
.review-metadata{border:1px solid #dce6f0;border-radius:12px;overflow:hidden;margin:15px 0 25px}
.review-row{display:grid;grid-template-columns:minmax(170px,30%) 1fr;border-bottom:1px solid #e8eef5}
.review-row:last-child{border-bottom:none}
.review-label{font-weight:700;color:#29425f;background:#f6f9fc;padding:14px 16px}
.review-values{padding:12px 16px;min-width:0;overflow-wrap:anywhere}
.review-value{white-space:normal;padding:4px 0;line-height:1.6}
.review-value+.review-value{border-top:1px dashed #e4ebf1}
.review-lang{display:inline;color:#6b8194;margin-left:4px}
@media(max-width:650px){.review-row{grid-template-columns:1fr}.review-label{padding:10px 14px}.review-values{padding:10px 14px}}


/* v19: homepage documents and shared site footer */
.hero-resource-links{display:flex;align-items:stretch;flex-wrap:wrap;gap:12px;margin:25px 0 22px;position:relative;z-index:4}
.hero-resource-button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:47px;padding:11px 18px;border:1px solid rgba(255,255,255,.55);border-radius:7px;background:rgba(255,255,255,.13);color:#fff!important;font-size:14px;font-weight:650;text-decoration:none!important;line-height:1.35;cursor:pointer;box-sizing:border-box}
.hero-resource-button:hover,.hero-resource-dropdown[open]>.hero-resource-button{background:#fff;color:#174e77!important}
.hero-resource-dropdown{position:relative;min-width:183px}
.hero-resource-dropdown>summary{list-style:none;user-select:none}
.hero-resource-dropdown>summary::-webkit-details-marker{display:none}
.hero-dropdown-chevron{width:8px;height:8px;border-bottom:2px solid currentColor;border-right:2px solid currentColor;transform:rotate(45deg);margin-left:5px;margin-top:-4px}
.hero-resource-dropdown[open] .hero-dropdown-chevron{transform:rotate(225deg);margin-top:4px}
.hero-resource-menu{position:absolute;top:calc(100% + 7px);left:0;min-width:310px;max-width:min(420px,90vw);background:#fff;border:1px solid #d9e5ef;border-radius:10px;padding:7px;box-shadow:0 14px 36px rgba(15,45,70,.18);z-index:10}
.hero-resource-menu a{display:block;color:#153f64!important;background:transparent;padding:12px 14px;border-radius:7px;font-size:14px;font-weight:600;line-height:1.45;text-decoration:none!important}
.hero-resource-menu a:hover{background:#eef5fb}
footer.site-footer{background:#122e49!important;color:#d9e5f0!important;padding:0!important;margin-top:40px;font-size:14px}
.site-footer-inner{max-width:1200px;margin:0 auto;padding:37px 22px 28px;display:grid;grid-template-columns:minmax(240px,1fr) minmax(260px,1fr);gap:30px;align-items:start}
.site-footer-contact h2{font-size:18px;line-height:1.3;color:#fff;margin:0 0 15px}
.site-footer-contact a,.site-footer-links a{color:#e0ecf6!important;text-decoration:none!important}
.site-footer-contact a:hover,.site-footer-links a:hover{text-decoration:underline!important;color:#fff!important}
.site-footer-contact p{margin:11px 0 0;color:#c1d2e0}
.site-footer-links{display:flex;flex-direction:column;gap:13px;align-items:flex-end;text-align:right}
.site-footer-copyright{text-align:center;border-top:1px solid rgba(255,255,255,.15);padding:18px 15px 21px;font-size:13px;color:#b8cada}
@media(max-width:700px){.site-footer-inner{grid-template-columns:1fr;padding:30px 18px;gap:24px}.site-footer-links{align-items:flex-start;text-align:left}.hero-resource-links{flex-direction:column;align-items:stretch}.hero-resource-dropdown,.hero-resource-dropdown>.hero-resource-button{width:100%}.hero-resource-button{justify-content:space-between}.hero-resource-menu{position:relative;top:5px;left:0;min-width:0;max-width:100%}}
