.project-files { margin-top:24px; }
.project-files h2 { margin:0; }
.project-files .page-heading p { margin:4px 0 0; }
.project-timeline { display:grid; gap:0; }
.project-entry { display:flex; align-items:flex-start; gap:16px; padding:16px 0; border-top:1px solid var(--line); }
.entry-content { flex:1; min-width:0; }
.entry-content header { overflow-wrap:anywhere; }
.entry-content header small { display:block; margin-top:4px; color:var(--muted); }
.entry-body { margin:10px 0; overflow-wrap:anywhere; white-space:normal; }
.entry-preview { flex:0 0 160px; }
.entry-preview img { display:block; max-width:100%; object-fit:cover; border-radius:8px; background:var(--paper,#eee); }
.entry-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:10px; }
.entry-actions .button { min-height:30px; padding:5px 9px; font-size:.8rem; }
.project-entry-form { max-width:760px; margin-top:18px; }
.project-entry-form textarea { width:100%; }
@media screen {
  .project-workspace .project-bom td,.project-workspace .project-bom th { padding:6px 8px; vertical-align:top; }
  .project-workspace .project-bom .button,.project-workspace .project-bom button,.project-workspace .project-bom details > summary { min-height:26px; padding:3px 6px; font-size:.75rem; line-height:1.2; margin:2px 0; border-radius:5px; }
  .project-workspace .project-bom .project-stock-action { gap:4px; margin-top:4px; }
  .project-workspace .project-bom .project-stock-action input { min-height:26px; max-width:65px; padding:3px 5px; font-size:.8rem; }
  .project-workspace .project-bom small { margin-top:2px; line-height:1.3; }
  .project-workspace .project-bom .supply-summary { padding:3px 0; margin:0; }
}
@media (pointer:coarse) { .entry-actions .button,.project-workspace .project-bom button,.project-workspace .project-bom .button,.project-workspace .project-bom details > summary { min-height:40px; } }
@media screen and (max-width:600px) { .project-entry { gap:10px; flex-wrap:wrap; } .entry-preview { flex-basis:100%; } .entry-preview img { width:100%; height:auto; max-height:220px; object-fit:contain; } }
.project-timeline { grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr)); gap:16px; }
.project-entry { flex-direction:column; border:1px solid var(--line); border-radius:12px; padding:12px; gap:10px; min-width:0; }
.project-entry.entry-note { grid-column:1/-1; }
.project-entry .entry-content { width:100%; }
.project-entry .entry-preview { flex:auto; width:100%; height:210px; display:flex; align-items:center; justify-content:center; background:color-mix(in srgb,var(--ink) 5%,transparent); border-radius:8px; }
.project-entry .entry-preview img { width:100%; height:210px; max-height:210px; object-fit:contain; }
.file-placeholder { flex-direction:column; text-align:center; padding:16px; overflow-wrap:anywhere; text-decoration:none; color:var(--ink); }
.file-placeholder span { font-size:60px; opacity:.55; }
#file-lightbox { width:96vw; max-width:1800px; height:94dvh; max-height:94dvh; padding:0; border:1px solid #555; border-radius:12px; background:#171717; color:#eee; overflow:hidden; }
#file-lightbox::backdrop { background:#000c; }
#file-lightbox[open] { display:flex; flex-direction:column; }
#file-lightbox iframe { border:0; flex:1; min-height:0; width:100%; }
.lightbox-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 12px; background:#252525; }
.lightbox-toolbar button { background:#333 !important; color:#fff !important; border:1px solid #777; min-height:40px; padding:6px 10px; }
#upload-queue { padding-left:24px; overflow-wrap:anywhere; }
#upload-queue li { margin:10px 0; }
@media print { #file-lightbox { display:none !important; } }
.project-notes { display:grid; gap:12px; }
.project-files h3 { margin:24px 0 12px; }
.project-entry .entry-content { display:flex; flex-direction:column; }
.project-entry .entry-actions { margin-top:auto; padding-top:12px; }
.entry-actions .entry-icon { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-height:32px; padding:0; border-radius:6px; }
.project-entry:not(.entry-note) .entry-remove { margin-left:auto; }
.entry-icon svg { flex-shrink:0; }
#note-tools { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0 0; }
#note-tools[hidden], #note-editor[hidden] { display:none; }
#note-tools button { padding:5px 9px; min-height:32px; font-size:.85rem; }
#note-editor { min-height:200px; padding:14px; border:1px solid var(--line); border-radius:8px; background:var(--paper); color:var(--ink); overflow-wrap:anywhere; }
@media (pointer:coarse) { .entry-actions .entry-icon { width:40px; height:40px; min-height:40px; } }
#project-upload-dialog { width:min(760px,94vw); max-height:90dvh; overflow:auto; padding:24px; border:1px solid var(--line); border-radius:16px; background:var(--paper,#fff); color:var(--ink); box-shadow:0 24px 80px #0006; }
#project-upload-dialog::backdrop { background:#0009; backdrop-filter:blur(2px); }
#project-upload-dialog[open] { animation:upload-float-in .2s ease-out; }
.upload-dialog-header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.upload-dialog-header h2 { margin:0; }
#project-upload-dialog .project-entry-form { margin:12px 0 0; padding:0; border:0; box-shadow:none; background:transparent; }
#project-upload-dialog [data-upload-close] { min-width:36px; min-height:36px; padding:4px; }
@keyframes upload-float-in { from { opacity:0; transform:translateY(16px) scale(.98); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce) { #project-upload-dialog[open] { animation:none; } }
@media (max-width:600px) { #project-upload-dialog { padding:16px; } }
#note-tools { border:1px solid var(--line); border-bottom:0; border-radius:8px 8px 0 0; padding:6px; background:color-mix(in srgb,var(--ink) 5%,var(--paper)); gap:4px; }
#note-tools button { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; padding:4px; font-family:Georgia,serif; font-size:17px; border-radius:4px; }
#note-tools svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
#note-editor { border-radius:0 0 8px 8px; line-height:1.6; min-height:240px; }
#note-editor:focus { outline:2px solid var(--ink); outline-offset:2px; }
.note-summary{display:flex;width:100%;text-align:left;flex-direction:column;align-items:flex-start;gap:.4rem;white-space:normal;overflow-wrap:anywhere;margin:.65rem 0}
.note-summary small{font-weight:600}
.project-note-dialog{width:min(760px,94vw);max-height:88dvh;overflow:auto;padding:24px;border:1px solid var(--line);border-radius:16px;background:var(--paper,#fff);color:var(--ink);box-shadow:0 24px 80px #0006}
.project-note-dialog::backdrop{background:#0009;backdrop-filter:blur(2px)}
.project-note-dialog[open]{animation:upload-float-in .2s ease-out}
@media(prefers-reduced-motion:reduce){.project-note-dialog[open]{animation:none}}
.project-notes{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr));gap:16px;margin-bottom:24px}
.project-notes .project-entry.entry-note{grid-column:auto}
.project-notes .note-summary{min-height:200px;justify-content:space-between;border-radius:5px;padding:20px 18px 16px 30px;color:var(--ink);background:linear-gradient(90deg,transparent 19px,color-mix(in srgb,var(--ink) 15%,transparent) 20px,transparent 21px),repeating-linear-gradient(transparent 0 27px,color-mix(in srgb,var(--ink) 8%,transparent) 27px 28px),color-mix(in srgb,#f3e7a4 35%,var(--paper,#fff));box-shadow:0 2px 5px #0001;line-height:1.75}
.project-notes .note-summary>span{display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden;font-weight:400}
