:root{--desk-ink:#245c4d;--desk-mint:#e6f3df;--desk-green:#3f8057;--desk-yellow:#ffe38c}
body[data-screen="login"],body[data-screen="home"]{background:#e6f3df!important;color:var(--desk-ink);overflow:auto;min-height:100dvh}
body:not([data-screen="project"]) #project-header,body:not([data-screen="project"]) .workbench,body:not([data-screen="project"]) #ocean,body:not([data-screen="project"]) #weather-sky,body:not([data-screen="project"]) #island3d{display:none!important}
body[data-screen="project"] #portal{display:none}
#portal{position:relative;z-index:10;max-width:1280px;margin:auto;padding:34px 6% 80px;font-family:"PingFang SC","Microsoft Yahei",sans-serif}
.desk-top{display:flex;justify-content:space-between;align-items:center;min-height:38px}.desk-logo{font-size:22px;font-weight:750;letter-spacing:-1px;color:var(--desk-ink);display:flex;align-items:center;gap:9px}.desk-logo span{font-size:28px;color:#74aa56}.identity-chip{font-size:13px;background:#ffffffa1;padding:10px 16px;border-radius:24px;color:var(--desk-ink)}
.login-garden{width:min(360px,100%);margin:5vh auto 0}.login-garden>svg{display:block;width:260px;height:180px;margin:0 auto 24px;animation:garden-arrive .7s ease-out both}.login-garden form{padding:0 16px}#portal label{color:#638372;font-size:12px;display:block;margin:0 0 17px}#portal input,#portal select{background:#ffffffb8;border:1px solid #c7ddc2;border-radius:12px;color:var(--desk-ink);padding:13px 14px;margin-top:7px;width:100%;font:inherit;font-size:14px;outline:none;box-sizing:border-box}#portal input:focus,#portal select:focus{border-color:#4b9264;box-shadow:0 0 0 3px #4b926414}.desk-submit{width:100%;background:var(--desk-green);color:#fff9e6;border-radius:14px;padding:15px 20px;font-size:15px;font-weight:600;box-shadow:0 4px 0 #2d6747;cursor:pointer}.desk-submit:active{transform:translateY(3px);box-shadow:0 1px 0 #2d6747}#portal p[role=alert]{min-height:16px;color:#bb6249;font-size:12px;margin:4px 0 16px}.project-desk{margin:70px auto 0;max-width:990px}.new-project{width:100%;min-height:190px;background:#ffe38c;border-radius:30px;display:flex;align-items:center;padding:36px 6%;gap:24px;color:#526335;font-size:clamp(26px,4vw,42px);font-weight:650;box-shadow:0 7px 0 #d4b866;transition:transform .2s}.new-project:hover{transform:translateY(-3px)}.new-sprout{font-size:80px;line-height:1;color:#719548}.create-arrow{margin-left:auto;font-weight:400;font-size:48px}.project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin-top:44px}.project-card{text-align:left;background:#f8fbed;border-radius:22px;padding:10px 22px 22px;color:var(--desk-ink);box-shadow:0 4px 0 #c5d9b8;transition:transform .2s;overflow:hidden}.project-card:hover{transform:translateY(-5px)}.project-card>svg{width:100%;height:155px;display:block}.card-name{display:flex;justify-content:space-between;gap:10px;font-size:17px;font-weight:650}.card-name>span{font-size:17px;opacity:.4}.card-dates{display:block;font:10px ui-monospace,monospace;color:#7b977e;margin-top:12px}.card-progress{display:block;margin-top:20px;height:4px;border-radius:8px;background:#e3ecd7;overflow:hidden}.card-progress i{display:block;background:#80b65d;height:100%}#portal dialog{width:min(570px,calc(100vw - 28px));max-height:88dvh;overflow:auto;background:#f5f9ea;color:var(--desk-ink);padding:28px;border:1px solid #fff;border-radius:24px}#portal dialog::backdrop{background:#244c3d55;backdrop-filter:blur(5px)}#portal h2{font-size:19px}#portal .form-head{margin-bottom:24px}#portal .dismiss{font-size:18px;color:#6e8e78}.date-pair{display:grid;grid-template-columns:1fr 1fr;gap:14px}.milestone-heading{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#638372}.milestone-heading button{font-size:24px;color:#52815c}.milestone-row{display:grid;grid-template-columns:83px minmax(60px,1fr) 140px 22px;gap:7px;align-items:center}.milestone-row input,.milestone-row select{padding:9px!important;font-size:12px!important;min-width:0}.milestone-row button{color:#af7058;font-size:20px}#identity-menu{position:absolute;right:6%;top:85px;background:#fff9e7;padding:14px 20px;border-radius:12px;box-shadow:0 5px 20px #30544315;font-size:13px}#back-home{font:32px/1 sans-serif;color:inherit;padding-right:12px}#project-range{font-size:10px!important;max-width:170px}#project-header .project h1{max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bug-fields textarea{display:block;width:100%;box-sizing:border-box;resize:vertical;font:14px/1.6 inherit;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);padding:10px;margin-top:8px}.upload-button{position:relative;border:1px dashed var(--line);border-radius:10px;padding:12px;cursor:pointer;text-align:center}.upload-button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}#entry-preview{max-width:100%;max-height:140px;object-fit:contain;border-radius:8px;margin:0 auto 16px;display:block}#entry-preview[hidden]{display:none}.bug-description{font-size:12px;line-height:1.6;white-space:pre-wrap;max-height:140px;overflow:auto;color:var(--ink)}.bug-image{display:block;width:100%;max-height:120px;object-fit:cover;border-radius:8px;cursor:zoom-in}#image-dialog{padding:16px;border:0;background:#f9f9f0;max-width:94vw;width:auto}#image-dialog img{display:block;max-width:86vw;max-height:80dvh;object-fit:contain}#image-dialog button{display:block;margin-left:auto;padding:8px}
body:not([data-theme="island"]) .timeline-scroll{overflow:auto;touch-action:none;cursor:grab}body:not([data-theme="island"]) .timeline-scroll.panning{cursor:grabbing}body:not([data-theme="island"]) #timeline{min-width:0;touch-action:none;max-width:none;display:block}body[data-theme="sprout"] .vine-leaf,body[data-theme="sprout"] .node-art{transform-box:view-box!important;transform-origin:0px 0px!important;scale:1!important}body[data-theme="sprout"] .leaf-pivot{transform-box:view-box;transform-origin:0px 0px;animation:leaf-breathe 6s ease-in-out infinite}body[data-theme="sprout"][data-weather="wind"] .leaf-pivot{animation:leaf-attached-wind 1.4s ease-in-out infinite}body[data-theme="sprout"] .vine-leaf{animation:none!important;rotate:none!important}@keyframes leaf-attached-wind{0%,100%{rotate:-3deg}50%{rotate:4deg}}@keyframes garden-arrive{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
body[data-screen="project"][data-theme="island"]:not(.three-active) .workbench{visibility:hidden}
@media(max-width:850px){.project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#project-range{display:none!important}#project-header .project h1{max-width:100px;font-size:17px}#back-home{padding-right:6px}}
@media(max-width:540px){#portal{padding:25px 6% 55px}.project-desk{margin-top:48px}.new-project{min-height:150px;border-radius:24px;gap:12px}.new-sprout{font-size:56px}.create-arrow{font-size:36px}.project-grid{gap:15px;margin-top:32px}.project-card{padding:4px 14px 17px;border-radius:18px}.project-card>svg{height:110px}.card-name{font-size:14px}.card-dates{font-size:8px}.milestone-row{grid-template-columns:70px 1fr 118px 18px;gap:4px}#portal dialog{padding:20px 14px}.login-garden{margin-top:3vh}.desk-logo{font-size:20px}}
@media(prefers-reduced-motion:reduce){#portal *,body .leaf-pivot{animation:none!important;transition:none!important}}

body[data-screen="login"],body[data-screen="home"]{transition:none;--paper:#e6f3df;--ink:#245c4d;--accent:#3f8057}
#portal dialog#unlock-dialog{width:360px}

.connection-state{text-align:center;margin:24vh auto;color:#638372;font-size:14px}.connection-state button{background:#3f8057;color:#fff9e6;border-radius:12px;padding:12px 28px}#sync-state{font:16px/1 sans-serif;color:#65a674;cursor:help}#sync-state[data-status=saving]{color:#c3a048}#sync-state[data-status=offline],#sync-state[data-status=conflict]{color:#db8057}.project .phase:empty{display:none}

/* Bug reading keeps the scene quiet; the expanded sheet uses the whole viewport. */
.milestone-row{grid-template-columns:minmax(110px,1fr) minmax(130px,1fr) 24px}.milestone-row input[type=hidden]{display:none!important}
#entry-previews{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:16px}#entry-previews:empty{display:none}#entry-previews figure{margin:0;position:relative;min-width:0}#entry-previews img{width:100%;height:85px;object-fit:cover;border-radius:10px;display:block;border:1px solid var(--line)}#entry-previews button{position:absolute;right:3px;top:3px;width:24px;height:24px;border-radius:50%;background:#fff9e9;box-shadow:0 2px 4px #244f5320;font-size:19px;line-height:1}#image-count{float:right;font:11px/1.5 ui-monospace,monospace;color:var(--muted)}#create-dialog{max-height:90dvh;overflow:auto}
.popover.bug-detail{padding:22px;max-height:calc(100dvh - 28px);overflow:auto;z-index:70}.bug-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-shrink:0}.bug-tools{display:flex;gap:5px}.bug-tools button{position:static;width:30px;height:30px;padding:6px;border-radius:9px;background:var(--soft);color:var(--ink)}.bug-tools svg{width:18px;height:18px}.bug-detail h3{margin-top:16px;font-weight:600}.priority-chip{display:inline-block;font-size:10px;padding:5px 8px;border-radius:7px;background:#f9dfd1;color:#9b503e}.priority-chip[data-level="1"]{background:#fff0ba;color:#8a6829}.priority-chip[data-level="2"]{background:#d6eddd;color:#407057}.priority-chip[data-level="3"]{background:#e8dff5;color:#73608f}.bug-detail .bug-description{max-height:none;font-size:13px;line-height:1.8;overflow:visible;overflow-wrap:anywhere;margin:15px 0}.bug-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(85px,1fr));gap:8px}.bug-gallery .bug-image{height:95px;max-height:none;border:1px solid var(--line);background:var(--soft)}.bug-gallery .bug-image:only-child{height:auto;max-height:180px;object-fit:contain}.bug-side{min-width:0}.bug-detail .pop-history li{align-items:flex-start;overflow-wrap:anywhere}.bug-detail .pop-history time{white-space:nowrap}.bug-comments{margin-top:20px;border-top:1px solid var(--line)}.bug-comments h4{font-size:11px;font-weight:500;color:var(--muted);margin:16px 0 10px}#comment-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}#comment-list li{background:var(--soft);border-radius:10px;padding:10px 12px;font-size:12px;overflow-wrap:anywhere}#comment-list li>div{display:flex;align-items:center;gap:10px}#comment-list strong{font-size:11px;font-weight:600}#comment-list time{margin-left:auto;color:var(--muted);font:9px ui-monospace,monospace;white-space:nowrap}#comment-list p{white-space:pre-wrap;line-height:1.75;margin:7px 0 0}#comment-form{display:flex;flex-direction:column;align-items:flex-end;gap:9px;margin-top:12px}#comment-content{width:100%;min-height:80px;resize:vertical;box-sizing:border-box;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);padding:10px 12px;font:13px/1.7 var(--font)}#comment-form button{background:var(--ink);color:var(--paper);border-radius:9px;padding:9px 14px;font-size:11px}
body.bug-expanded{overflow:hidden!important}.popover.bug-detail.expanded{inset:12px!important;width:auto!important;height:calc(100dvh - 24px);max-height:none;border-radius:20px;padding:24px 30px;display:flex;flex-direction:column;overflow:hidden;z-index:80;box-shadow:0 0 0 24px #1c474958}.bug-detail.expanded .bug-toolbar{padding-bottom:18px;border-bottom:1px solid var(--line)}.bug-detail.expanded .bug-detail-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,340px);gap:40px;min-height:0;flex:1}.bug-detail.expanded .bug-main,.bug-detail.expanded .bug-side{overflow:auto;padding:16px 5px 28px;scrollbar-width:thin}.bug-detail.expanded .bug-side{border-left:1px solid var(--line);padding-left:28px}.bug-detail.expanded h3{font-size:clamp(22px,2.3vw,32px);margin:0 0 15px;line-height:1.6}.bug-detail.expanded .bug-description{font-size:14px;line-height:1.9;margin:22px 0}.bug-detail.expanded .bug-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.bug-detail.expanded .bug-image{height:auto;max-height:420px;object-fit:contain;border-radius:12px}.bug-detail.expanded .bug-image:only-child,.bug-detail.expanded .bug-image:first-child:nth-last-child(3){grid-column:1/-1;max-height:56dvh}.bug-detail.expanded .pop-history{margin-top:0;border-top:0}.bug-detail.expanded .pop-history li{padding-top:0;padding-bottom:13px}.bug-detail [data-state=resolved] .bug-art{opacity:.65}
@media(max-width:700px){.popover.bug-detail.expanded{inset:0!important;width:100%!important;height:100dvh;border-radius:0;padding:18px}.bug-detail.expanded .bug-detail-body{display:block;overflow:auto;padding-top:18px}.bug-detail.expanded .bug-main,.bug-detail.expanded .bug-side{overflow:visible;padding:0}.bug-detail.expanded .bug-side{border-left:0;border-top:1px solid var(--line);margin-top:24px;padding-top:20px}.bug-detail.expanded .bug-gallery{gap:8px}.bug-detail.expanded .bug-image:only-child,.bug-detail.expanded .bug-image:first-child:nth-last-child(3){max-height:48dvh}.bug-detail.expanded h3{font-size:23px}.milestone-row{grid-template-columns:minmax(100px,1fr) minmax(120px,1fr) 22px;gap:5px}}

/* Administration uses the same quiet garden desk. */
.project-tile{position:relative;min-width:0}.project-tile .project-card{width:100%;height:100%;display:block}.card-team{display:inline-block;font-size:10px;color:#6c8c74;margin-top:9px;background:#e6eedc;padding:4px 8px;border-radius:6px}.delete-project{position:absolute;right:14px;top:14px;border-radius:50%;width:32px;height:32px;padding:7px;background:#fff9e9d9;color:#a56e56;opacity:.65}.delete-project:hover,.delete-project:focus-visible{opacity:1;background:#ffe0ca}.delete-project svg{width:100%;height:100%}.admin-desk{margin-top:48px;max-width:1120px}.admin-nav{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:30px}.admin-nav [role=tablist]{display:flex;gap:8px}.admin-nav [role=tab]{border-radius:12px;padding:11px 20px;font-size:15px;color:#6b8b76}.admin-nav [aria-selected=true]{background:#3f8057;color:#fff9e6}#portal #admin-team{width:auto;max-width:160px;margin:0;font-size:12px;padding:10px 12px}.admin-table-wrap{overflow:auto}.admin-table{width:100%;border-collapse:collapse;text-align:left;font-size:13px;color:#426c55}.admin-table th{font-weight:400;color:#7a9480;font-size:11px;padding:14px 15px;border-bottom:1px solid #c5d9b8;white-space:nowrap}.admin-table td{padding:19px 15px;border-bottom:1px solid #cfdfc67a;max-width:260px;overflow-wrap:anywhere}.admin-table time{font:11px ui-monospace,monospace;white-space:nowrap;color:#7b907e}.admin-table strong{font-size:12px;font-weight:500}.user-records{color:#3f8057;text-align:left}.user-records:hover{text-decoration:underline}.audit-target{display:block;font-size:11px;color:#819584;margin-top:7px}.admin-empty{color:#819584;text-align:center;margin:70px 0}.admin-pagination{display:flex;align-items:center;justify-content:flex-end;gap:15px;margin-top:24px;font:12px ui-monospace,monospace;color:#7b907e}.admin-pagination button{padding:10px 14px;border-radius:9px;background:#fff9e7;color:#426c55}.admin-pagination button:disabled{opacity:.3}.actor-filter{font-size:12px;color:#426c55;padding:9px 12px;background:#fff9e7;border-radius:8px;margin-bottom:15px}.delete-actions{display:flex;justify-content:flex-end;gap:12px}.delete-actions button{padding:12px 24px;border-radius:10px;background:#e3edda}.delete-actions .confirm-delete{background:#b7664f;color:#fff9e6}#portal #delete-project-dialog{width:380px}
@media(max-width:540px){.admin-nav{gap:8px}.admin-nav [role=tab]{padding:10px 13px;font-size:13px}#portal #admin-team{max-width:115px;font-size:11px}.admin-table td,.admin-table th{padding:14px 9px}.admin-table{min-width:580px}.delete-project{right:8px;top:8px;width:29px;height:29px}.admin-desk{margin-top:35px}}
