.hpd-app{display:grid;grid-template-columns:240px 1fr;min-height:760px;background:#0b0c0e;color:#f7f8fa;border:1px solid #2a2f37;border-radius:22px;overflow:hidden}.hpd-app-side{padding:20px;background:#0e1013;border-right:1px solid #2a2f37}.hpd-app-side nav{display:grid;gap:6px;margin:20px 0}.hpd-app-side nav button,.hpd-quick button{background:transparent;color:#a9b0bb;border:1px solid transparent;text-align:left;padding:10px;border-radius:10px;cursor:pointer}.hpd-app-side nav button:hover,.hpd-quick button:hover{border-color:#2a2f37;color:#fff}.hpd-button{background:#c8ff4d!important;color:#0b0c0e!important;border:0;border-radius:11px;padding:12px 16px;font-weight:900;cursor:pointer}.hpd-usage{margin-top:30px;border-top:1px solid #2a2f37;padding-top:18px;display:grid}.hpd-usage small{color:#a9b0bb}.hpd-app-main{display:grid;grid-template-rows:auto 1fr auto;min-width:0}.hpd-app-main header{display:flex;justify-content:space-between;align-items:center;padding:18px 22px;border-bottom:1px solid #2a2f37}.hpd-app-main h2{margin:0}.hpd-chip{border:1px solid #2a2f37;background:#14171b;color:#fff;border-radius:999px;padding:8px 12px;cursor:pointer}.hpd-chip.active{border-color:#c8ff4d;color:#c8ff4d}.hpd-messages{padding:26px;overflow:auto}.hpd-welcome{max-width:700px;margin:60px auto;text-align:center}.hpd-quick{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:20px}.hpd-quick button{border-color:#2a2f37;text-align:center}.hpd-message{max-width:760px;margin:14px auto;padding:14px 16px;border-radius:15px;background:#14171b}.hpd-message.user{background:#20242a}.hpd-result{max-width:760px;margin:12px auto}.hpd-result img{max-width:100%;border-radius:18px;background:white}.hpd-result-actions{display:flex;gap:8px;margin-top:8px}.hpd-result-actions a,.hpd-result-actions button{border:1px solid #2a2f37;background:#14171b;color:#fff;border-radius:9px;padding:8px 10px}#hpd-compose{padding:18px;border-top:1px solid #2a2f37;background:#0e1013}#hpd-prompt{width:100%;min-height:92px;resize:vertical;border:1px solid #2a2f37;border-radius:14px;background:#0b0c0e;color:#fff;padding:14px;font:inherit}.hpd-compose-row{display:flex;justify-content:space-between;align-items:center;margin-top:10px}.hpd-upload{cursor:pointer;color:#a9b0bb}.hpd-gate{padding:50px;border:1px solid #2a2f37;border-radius:20px;text-align:center}@media(max-width:760px){.hpd-app{grid-template-columns:1fr}.hpd-app-side{display:none}.hpd-quick{grid-template-columns:1fr 1fr}}
#hpd-files{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}.hpd-file-chip{font-size:12px;padding:6px 9px;border:1px solid #2a2f37;border-radius:999px;color:#a9b0bb}.hpd-file-chip.error,.hpd-error{color:#ff8b8b}.hpd-view-head{max-width:980px;margin:0 auto 18px}.hpd-view-head h3{font-size:28px;margin:0 0 4px}.hpd-view-head p{margin:0;color:#a9b0bb}.hpd-history-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;max-width:1100px;margin:0 auto}.hpd-history-card{border:1px solid #2a2f37;border-radius:16px;overflow:hidden;background:#14171b}.hpd-history-card img{width:100%;aspect-ratio:1;object-fit:contain;background:#fff}.hpd-history-card>div{padding:12px;display:grid;gap:6px}.hpd-history-card small{color:#a9b0bb}.hpd-card-actions{display:flex;gap:6px;flex-wrap:wrap}.hpd-card-actions button,.hpd-card-actions a{border:1px solid #2a2f37;background:#0e1013;color:#fff;padding:7px 9px;border-radius:8px;text-decoration:none;cursor:pointer}.hpd-project-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:1000px;margin:0 auto}.hpd-project-card{display:grid;text-align:left;gap:5px;padding:18px;border:1px solid #2a2f37;background:#14171b;color:#fff;border-radius:14px;cursor:pointer}.hpd-project-card span,.hpd-project-card small{color:#a9b0bb}.hpd-empty,.hpd-loading{grid-column:1/-1;padding:40px;text-align:center;color:#a9b0bb;border:1px dashed #2a2f37;border-radius:14px}@media(max-width:900px){.hpd-history-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:600px){.hpd-history-grid,.hpd-project-grid{grid-template-columns:1fr}}

/* V0.5 — app follows the site's light/dark selection */
html[data-theme="light"] .hpd-app{background:#f7f8fa;color:#111317;border-color:#d9dde2}html[data-theme="light"] .hpd-app-side,html[data-theme="light"] #hpd-compose{background:#fff;border-color:#d9dde2}html[data-theme="light"] .hpd-app-side nav button,html[data-theme="light"] .hpd-quick button,html[data-theme="light"] .hpd-upload,html[data-theme="light"] .hpd-usage small,html[data-theme="light"] .hpd-view-head p,html[data-theme="light"] .hpd-history-card small,html[data-theme="light"] .hpd-project-card span,html[data-theme="light"] .hpd-project-card small,html[data-theme="light"] .hpd-empty,html[data-theme="light"] .hpd-loading{color:#606873}html[data-theme="light"] .hpd-app-side nav button:hover,html[data-theme="light"] .hpd-quick button:hover{color:#111317;border-color:#d9dde2}html[data-theme="light"] .hpd-app-main header,html[data-theme="light"] #hpd-compose,html[data-theme="light"] .hpd-usage{border-color:#d9dde2}html[data-theme="light"] .hpd-chip,html[data-theme="light"] .hpd-message,html[data-theme="light"] .hpd-history-card,html[data-theme="light"] .hpd-project-card{background:#fff;color:#111317;border-color:#d9dde2}html[data-theme="light"] .hpd-message.user{background:#eef0f2}html[data-theme="light"] #hpd-prompt{background:#fff;color:#111317;border-color:#cfd4da}html[data-theme="light"] .hpd-result-actions a,html[data-theme="light"] .hpd-result-actions button,html[data-theme="light"] .hpd-card-actions button,html[data-theme="light"] .hpd-card-actions a{background:#fff;color:#111317;border-color:#d9dde2}html[data-theme="light"] .hpd-file-chip,html[data-theme="light"] .hpd-gate{border-color:#d9dde2}html[data-theme="light"] .hpd-chip.active{border-color:#7fae19;color:#628b0d}

#hpd-files{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:10px}.hpd-reference-card{display:flex;align-items:center;gap:9px;min-width:220px;max-width:340px;padding:8px 10px;border:1px solid var(--hpd-border,#30343b);border-radius:12px;background:var(--hpd-panel,#17191d)}.hpd-reference-card img{width:42px;height:42px;object-fit:cover;border-radius:8px;background:#fff;cursor:pointer}.hpd-reference-card>div{min-width:0;flex:1}.hpd-reference-card strong,.hpd-reference-card small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hpd-reference-card small{opacity:.65;font-size:11px}.hpd-reference-card button{border:0;background:transparent;color:inherit;font-size:22px;cursor:pointer}.hpd-file-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:8px;background:rgba(127,127,127,.15);font-size:10px;font-weight:800}html[data-theme="light"] .hpd-reference-card,body.hpd-light .hpd-reference-card{background:#fff;border-color:#d9dde3;color:#17191d}
