:root { color-scheme: light; --ink:#171816; --muted:#555751; --line:#d9dad5; --soft:#f3f3ef; --accent:#f2edcd; font: 16px/1.45 Arial, sans-serif; color:var(--ink); background:#fff; }
* { box-sizing:border-box; }
body { margin:0; }
.masthead, main { width:min(1120px,calc(100% - 72px)); margin:auto; }
.masthead { --brand-size:140px; display:flex; justify-content:flex-end; align-items:center; min-height:calc(var(--brand-size) + 12px); border-bottom:1px solid var(--line); }
.brand { position:fixed; z-index:2; top:6px; left:50%; transform:translateX(-50%); width:var(--brand-size); height:var(--brand-size); background:#fff; }
.brand img { display:block; width:100%; height:100%; }
.masthead-action { max-width:calc((100% - var(--brand-size)) / 2 - 8px); }
.admin-entry { display:inline-flex; align-items:center; min-height:44px; padding:.45rem .25rem; color:var(--muted); font-size:.875rem; text-align:right; text-decoration:none; }
.admin-entry:hover { text-decoration:underline; }
nav { display:flex; gap:1.5rem; align-items:center; }
a { color:inherit; text-underline-offset:.23em; }
nav a { text-decoration:none; }
nav a:hover, nav a[aria-current="page"] { text-decoration:underline; }
main { padding:clamp(2rem,6vw,5rem) 0; }
h1, h2, p { margin:0; }
h1 { font-size:clamp(3rem,8vw,6.15rem); font-weight:700; line-height:.98; letter-spacing:-.07em; }
h2 { font-size:1.35rem; line-height:1.2; letter-spacing:-.025em; }
p { color:var(--muted); }
.intro { display:grid; grid-template-columns:1.15fr 1fr; align-items:start; gap:clamp(2rem,9vw,8rem); }
.eyebrow { font-size:.9rem; color:var(--muted); margin-bottom:.9rem; }
.lead { font-size:1.125rem; max-width:40ch; margin-top:1rem; }
.project-page .masthead { min-height:calc(var(--brand-size) * .54 + 12px); border-bottom:0; }
.project-page main { padding-top:0; }
.project-hero { text-align:center; margin-bottom:clamp(1.7rem, 4.2vw, 3.2rem); }
.project-picture { width:clamp(148px, 29vw, 242px); aspect-ratio:1; margin-inline:auto; overflow:hidden; border-radius:50%; background:#e6e6e4; }
.project-picture img { display:block; width:100%; height:100%; object-fit:cover; }
.project-hero h1 { font-size:clamp(2.15rem, 6vw, 4.4rem); margin-top:clamp(.95rem, 2.7vw, 1.45rem); overflow-wrap:anywhere; }
.project-documents-label { margin-bottom:.25rem; font-size:.875rem; }
.admin-photo-preview { display:block; width:72px; height:72px; border-radius:50%; object-fit:cover; margin:0 0 .6rem; }
.panel, .upload-zone { padding:clamp(1rem,3vw,2rem); background:var(--soft); border:1px solid var(--line); }
label { display:grid; gap:.35rem; margin-bottom:1rem; }
input, textarea { border:1px solid #9a9d94; padding:.7rem .75rem; background:white; color:inherit; font:inherit; min-width:0; width:100%; border-radius:0; }
button, .button { display:inline-flex; justify-content:center; align-items:center; color:var(--ink); background:white; border:1px solid #a9aaa2; font:inherit; padding:.56rem .85rem; min-height:42px; text-decoration:none; cursor:pointer; }
button:hover, .button:hover { background:var(--soft); }
button.primary, .button.primary { background:var(--ink); border-color:var(--ink); color:white; }
button.primary:hover, .button.primary:hover { background:#444640; }
button:disabled { opacity:.55; cursor:wait; }
:focus-visible { outline:2px solid #4b6546; outline-offset:3px; }
.actions { display:flex; flex-wrap:wrap; gap:.55rem; align-items:center; }
.credentials { margin-top:1.2rem; padding-top:1rem; border-top:1px solid var(--line); font-size:.95rem; }
.credentials button { margin-top:.6rem; }
.notice { padding:.7rem 1rem; background:var(--accent); margin-bottom:1.1rem; color:var(--ink); }
.message { min-height:1.45em; margin-top:.6rem; }
.error { color:#922c21; }
.titlebar { display:flex; justify-content:space-between; align-items:end; gap:1rem; margin-bottom:2rem; }
.titlebar .lead { margin-top:.55rem; }
.crumbs { display:flex; flex-wrap:wrap; gap:.48rem; margin:0 0 1.25rem; }
.crumbs span { color:var(--muted); }
.list-head { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:.75rem; }
.list { list-style:none; padding:0; margin:0; border-top:1px solid var(--line); }
.row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:1.25rem; align-items:center; border-bottom:1px solid var(--line); padding:0; }
.row .name { min-width:0; display:flex; align-items:center; gap:.8rem; overflow-wrap:anywhere; }
.row .name a { font-weight:bold; text-decoration:none; }
.row .name a:hover { text-decoration:none; color:#555751; }
.row .name .file-name { font-weight:normal; }
.row .actions .action-icon { width:44px; height:44px; min-height:44px; border:0; padding:0; background:transparent; flex-shrink:0; }
.row .actions .action-icon:hover { color:var(--muted); }
.action-icon svg { width:22px; height:22px; }
.icon { width:1.9rem; min-width:1.9rem; height:1.3rem; display:grid; place-items:center; font-size:.68rem; border:1px solid #a9aaa2; }
.icon.folder { min-width:1.6rem; width:1.6rem; height:1.1rem; position:relative; margin-right:.3rem; }
.icon.folder:before { content:""; position:absolute; top:-5px; left:-1px; width:9px; height:4px; border:1px solid #a9aaa2; border-bottom:0; background:white; }
.meta { font-size:.9rem; color:var(--muted); text-align:right; white-space:nowrap; }
.empty { padding:1rem 0; }
.upload-zone { margin:1.5rem 0; }
.upload-zone h2 { margin-bottom:.5rem; }
.upload-zone .actions { margin-top:1rem; }
.admin-layout { display:grid; grid-template-columns:1fr 1fr; gap:clamp(1.5rem,4vw,4rem); }
.admin-layout section > h2 { margin-bottom:.75rem; }
.tree { margin:0; padding:0 0 0 1.1rem; overflow-wrap:anywhere; }
.tree li { padding:.2rem 0; }
.tree details > summary { cursor:pointer; font-weight:bold; }
dialog { width:min(1050px,calc(100% - 24px)); max-height:95dvh; border:1px solid var(--line); padding:0; }
dialog::backdrop { background:#0008; }
dialog header { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.8rem; border-bottom:1px solid var(--line); }
dialog h2 { overflow-wrap:anywhere; }
#preview-content iframe { width:100%; height:72dvh; border:0; display:block; }
#preview-content img { max-width:100%; max-height:72dvh; display:block; margin:auto; }
#preview-content p { padding:.6rem .8rem; }
@media (max-width:690px) {
  .masthead, main { width:calc(100% - 32px); }
  .masthead { --brand-size:clamp(84px,24vw,120px); }
  .masthead-action button, .admin-entry { font-size:.8rem; }
  .masthead-action button { padding-inline:.45rem; }
  nav { gap:.85rem; font-size:.92rem; }
  .intro,.admin-layout { grid-template-columns:1fr; }
  .titlebar { display:block; }
  .titlebar .actions { margin-top:1rem; }
  .row { grid-template-columns:minmax(0,1fr) auto; gap:.55rem .65rem; }
  .row .meta { display:none; }
  .row .actions { grid-column:2; justify-content:flex-end; }
  .row .actions button { padding:.35rem .45rem; font-size:.88rem; }
}

.tree-folder { position:relative; border-bottom:1px solid var(--line); }
.tree-folder summary { display:flex; align-items:center; gap:.65rem; min-height:44px; padding:.35rem 50px .35rem .4rem; font-weight:bold; cursor:pointer; overflow-wrap:anywhere; }
.tree-folder summary::-webkit-details-marker { display:none; }
.tree-folder details[open] > summary { background:var(--soft); }
.tree-chevron { width:.55rem; height:.55rem; flex:none; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(-45deg); }
.tree-folder details[open] > summary .tree-chevron { transform:rotate(45deg); }
.tree-folder .tree-archive { position:absolute; top:0; right:0; display:block; border:0; }
.tree-folder-with-note > details > summary { padding-right:94px; }
.tree-archive .actions { gap:0; flex-wrap:nowrap; }
.tree-children { margin-left:clamp(.65rem, 2vw, 1.4rem); padding-left:.55rem; border-left:1px solid var(--line); }
.tree-children > .list { border-top:0; }
.tree-children > .list > :last-child { border-bottom:0; }

.admin-layout .panel p, .admin-layout .panel form { margin-top:1rem; }
.admin-layout select { width:100%; padding:.7rem .75rem; border:1px solid #9a9d94; background:white; font:inherit; }
.project-card { border-top:1px solid var(--line); padding:1rem 0; overflow-wrap:anywhere; }
.project-card h3 { margin:0 0 .3rem; }
.project-links { display:flex; flex-wrap:wrap; gap:.55rem; margin:.8rem 0; }
.project-card summary { cursor:pointer; }
.project-card details form { margin-top:.7rem; }

.project-upload-setting { display:flex; gap:.6rem; align-items:center; }
.project-upload-setting input { width:auto; margin:0; }
.submissions-section { margin-top:clamp(1.5rem, 3vw, 2.5rem); }
.submissions-section .list-head { flex-wrap:wrap; margin:0; padding-bottom:.65rem; border-bottom:1px solid var(--line); }
.submissions-section > .list { border-top:0; }
.submissions-list > summary { display:flex; gap:.75rem; align-items:center; min-height:44px; padding:.35rem .4rem; cursor:pointer; }
.submissions-list > summary::-webkit-details-marker { display:none; }
.submissions-list[open] > summary .tree-chevron { transform:rotate(45deg); }
.submissions-collapse, .submissions-list[open] > summary .submissions-expand { display:none; }
.submissions-list[open] > summary .submissions-collapse { display:inline; }
.submissions-section .submission-open { padding:.4rem .75rem; font-size:.95rem; }
#submission-dialog { width:min(620px, calc(100% - 24px)); padding:0; }
#submission-dialog header, .submission-body { padding:clamp(1rem, 4vw, 2rem); }
#submission-thread { width:min(490px, calc(100% - 24px)); max-height:min(85dvh, 650px); border-radius:16px; box-shadow:0 16px 48px #0003; overflow:auto; }
#submission-thread header { position:sticky; top:0; background:white; padding:.6rem .9rem; }
#submission-thread header h2 { font-size:1.05rem; }
#submission-thread header button { border:0; min-height:36px; padding:.25rem .45rem; border-radius:8px; font-size:.85rem; color:var(--muted); }
.thread-body { padding:.85rem .9rem; }
.thread-folder-name { font-size:.82rem; overflow-wrap:anywhere; }
.thread-empty { margin:.75rem 0; font-size:.9rem; }
.thread-posts { margin:.65rem 0 0; padding:0; list-style:none; }
.thread-posts li { border-top:1px solid var(--line); padding:.65rem 0; }
.thread-meta { display:flex; flex-wrap:wrap; align-items:baseline; gap:.15rem .65rem; font-size:.85rem; overflow-wrap:anywhere; }
.thread-meta span { color:var(--muted); font-size:.78rem; }
.thread-message { margin:.25rem 0 0; color:var(--ink); font-size:.93rem; white-space:pre-wrap; overflow-wrap:anywhere; }
.thread-form { display:grid; gap:.5rem; border-top:1px solid var(--line); margin-top:.7rem; padding-top:.7rem; }
.thread-form label { margin:0; gap:.2rem; font-size:.83rem; }
.thread-form input, .thread-form textarea { padding:.42rem .55rem; border-radius:7px; font-size:1rem; }
.thread-form textarea { resize:vertical; }
.thread-form button { justify-self:end; border-radius:8px; min-height:38px; padding:.4rem .75rem; font-size:.85rem; }
.thread-status { margin:.65rem .9rem 0; }
.thread-status:empty { display:none; }
.thread-page { max-width:490px; }
.thread-page > p:last-child { margin-top:1rem; }
.submission-form { max-width:640px; margin:1rem 0; }
.submission-form textarea { resize:vertical; }
.submission-body .submission-form { margin:0; }
.submission-picker { border:1px solid var(--line); padding:.75rem; }
.submission-picker input { border:0; padding:.35rem 0; }
.submission-selection:empty { display:none; }
.submission-files { padding-left:1.25rem; overflow-wrap:anywhere; }
.submission-files:empty { display:none; }
.submission-name { background:var(--soft); margin:.4rem 0 1rem; padding:.7rem; overflow-wrap:anywhere; }
