/* Shared GNIST colors and controls; selectors also work in isolated previews. */
:is(#eiwa-preview,body) .project-attachments{max-width:100%;min-width:0;color:var(--gn-text,#173b43)}
:is(#eiwa-preview,body) .attachment-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:0 0 24px;padding:0;border:0;background:none}
:is(#eiwa-preview,body) .attachment-heading{display:flex;align-items:center;gap:10px}
:is(#eiwa-preview,body) .attachment-heading h2{font-size:23px;font-weight:650;letter-spacing:-.025em;margin:0;line-height:1.3}
:is(#eiwa-preview,body) .attachment-count{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 7px;box-sizing:border-box;border-radius:7px;background:color-mix(in srgb,var(--gn-text,#173b43) 7%,transparent);font-size:12px;font-weight:650;color:var(--gn-muted,#526c75)}
:is(#eiwa-preview,body) .attachment-count:empty{display:none}
:is(#eiwa-preview,body) .attachment-header p{margin:8px 0 0;max-width:620px;font-size:14px;color:var(--gn-muted,#526c75);line-height:1.6}
:is(#eiwa-preview,body) .project-attachments button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;width:auto;margin:0;padding:10px 15px;border-radius:10px;border:1px solid var(--gn-border,#c9d8dc);background:transparent;color:var(--gn-text,#173b43);font:inherit;font-size:13px;font-weight:550;cursor:pointer;box-shadow:none;line-height:1.35}
:is(#eiwa-preview,body) .project-attachments button:hover:not(:disabled){background:color-mix(in srgb,var(--gn-text,#173b43) 6%,transparent)}
:is(#eiwa-preview,body) .project-attachments button:disabled{opacity:.5;cursor:default}
:is(#eiwa-preview,body) .project-attachments svg{display:block;width:20px;height:20px;flex:none}
:is(#eiwa-preview,body) .project-attachments button:focus-visible,:is(#eiwa-preview,body) .attachment-file-pick:focus-within{outline:2px solid var(--gn-text,#173b43);outline-offset:3px}
:is(#eiwa-preview,body) .project-attachments .attachment-refresh{white-space:nowrap;color:var(--gn-muted,#526c75);font-size:12px;min-height:40px;border-color:transparent;padding:7px 10px;margin-top:0}
:is(#eiwa-preview,body) .project-attachments .attachment-upload{display:grid;grid-template-columns:minmax(240px,.85fr) minmax(0,1.15fr);gap:28px;align-items:start;padding:24px;margin:0 0 28px;border:1px solid var(--gn-border,#c9d8dc);border-radius:18px;background:var(--gn-panel,#fff);box-shadow:0 4px 16px #173b4304}
:is(#eiwa-preview,body) .project-attachments [hidden]{display:none!important}
:is(#eiwa-preview,body) .attachment-dropzone{display:grid;justify-items:center;text-align:center;gap:8px;padding:24px 18px;border:1.5px dashed var(--gn-border,#c9d8dc);border-radius:12px;background:color-mix(in srgb,var(--gn-bg,#f3f7f7) 70%,var(--gn-panel,#fff));transition:background .15s,border-color .15s}
:is(#eiwa-preview,body) .attachment-dropzone.is-dragging{border-color:var(--gn-text,#173b43);background:color-mix(in srgb,var(--gn-text,#173b43) 10%,var(--gn-panel,#fff))}
:is(#eiwa-preview,body) .attachment-upload-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:var(--gn-panel,#fff);color:var(--gn-text,#173b43);border:1px solid var(--gn-border,#c9d8dc);margin-bottom:5px}
:is(#eiwa-preview,body) .attachment-upload-icon svg{width:22px;height:22px}
:is(#eiwa-preview,body) .attachment-dropzone strong{font-size:14px;font-weight:650}
:is(#eiwa-preview,body) .attachment-dropzone p{margin:0;font-size:12px;color:var(--gn-muted,#526c75);line-height:1.5}
:is(#eiwa-preview,body) .attachment-dropzone small{margin-top:6px;font-size:11px;color:var(--gn-muted,#526c75);line-height:1.5}
:is(#eiwa-preview,body) .project-attachments .attachment-file-pick{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:42px;box-sizing:border-box;padding:9px 16px;margin:5px 0 0;border:1px solid var(--gn-border,#c9d8dc);border-radius:9px;background:var(--gn-panel,#fff);color:var(--gn-text,#173b43);font-size:13px;font-weight:600;cursor:pointer}
:is(#eiwa-preview,body) .attachment-file-pick input[type=file]{position:absolute;inset:0;opacity:0;margin:0;width:100%;height:100%;min-width:0;cursor:pointer;padding:0;border:0}
:is(#eiwa-preview,body) .attachment-file-pick:has(input:disabled){opacity:.5;cursor:default}
:is(#eiwa-preview,body) .attachment-upload-fields{display:grid;gap:16px;min-width:0}
:is(#eiwa-preview,body) .project-attachments .attachment-description-label{display:grid;gap:10px;margin:0;font-size:13px;font-weight:600;line-height:1.5}
:is(#eiwa-preview,body) .project-attachments textarea{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:112px;resize:vertical;padding:13px 14px;margin:0;border:1px solid var(--gn-border,#c9d8dc);border-radius:10px;background:var(--gn-panel,#fff);color:var(--gn-text,#173b43);font:inherit;font-size:13px;line-height:1.6}
:is(#eiwa-preview,body) .project-attachments textarea::placeholder{color:var(--gn-muted,#526c75);opacity:.8}
:is(#eiwa-preview,body) .project-attachments textarea:focus{outline:2px solid color-mix(in srgb,var(--gn-text,#173b43) 25%,transparent);outline-offset:2px;border-color:var(--gn-muted,#526c75)}
:is(#eiwa-preview,body) .attachment-upload-footer{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
:is(#eiwa-preview,body) .project-attachments .attachment-upload-submit{background:#173b43;border-color:#173b43;color:#fff;padding-inline:20px}
:is(#eiwa-preview,body) .project-attachments .attachment-upload-submit:hover:not(:disabled){background:#22505a}
:is(#eiwa-preview,body) .project-attachments .attachment-upload-cancel{border-color:transparent;color:var(--gn-muted,#526c75);font-size:12px}
:is(#eiwa-preview,body) .attachment-selection{display:flex;flex-wrap:wrap;gap:7px}
:is(#eiwa-preview,body) .attachment-selection:empty{display:none}
:is(#eiwa-preview,body) .attachment-selection-item{display:inline-flex;align-items:center;gap:7px;min-width:0;max-width:100%;box-sizing:border-box;padding:7px 9px;background:var(--gn-bg,#f3f7f7);border:1px solid var(--gn-border,#c9d8dc);border-radius:8px;font-size:11px}
:is(#eiwa-preview,body) .attachment-selection-item>span{overflow-wrap:anywhere;min-width:0}
:is(#eiwa-preview,body) .attachment-selection-item svg{width:14px;height:14px}
:is(#eiwa-preview,body) .attachment-selection-item small{white-space:nowrap;font-size:10px;color:var(--gn-muted,#526c75)}
:is(#eiwa-preview,body) .project-attachment-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr));gap:16px;margin:0 0 20px}
:is(#eiwa-preview,body) .project-attachment{display:flex;flex-direction:column;min-width:0;overflow:hidden;box-sizing:border-box;padding:0;border:1px solid var(--gn-border,#c9d8dc);border-radius:15px;background:var(--gn-panel,#fff)}
:is(#eiwa-preview,body) .attachment-cover{position:relative;display:grid;place-items:center;min-height:112px;background:color-mix(in srgb,var(--gn-bg,#f3f7f7) 85%,var(--gn-panel,#fff));border-bottom:1px solid var(--gn-border,#c9d8dc);color:var(--gn-muted,#526c75)}
:is(#eiwa-preview,body) .attachment-cover>svg{width:34px;height:34px;opacity:.65}
:is(#eiwa-preview,body) .attachment-kind{position:absolute;bottom:12px;left:16px;padding:3px 6px;border:1px solid var(--gn-border,#c9d8dc);border-radius:5px;background:var(--gn-panel,#fff);font-size:9px;font-weight:650;letter-spacing:.07em;color:var(--gn-muted,#526c75)}
:is(#eiwa-preview,body) .project-attachment h3{margin:17px 16px 7px;font-size:14px;font-weight:650;line-height:1.45;overflow-wrap:anywhere}
:is(#eiwa-preview,body) .project-attachment p{margin:0 16px 14px;line-height:1.6;font-size:12px;overflow-wrap:anywhere}
:is(#eiwa-preview,body) .project-attachment .project-attachment-meta{font-size:10px;color:var(--gn-muted,#526c75);line-height:1.7;margin-bottom:12px}
:is(#eiwa-preview,body) .project-attachment-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:auto;padding:4px 16px 16px}
:is(#eiwa-preview,body) .project-attachment-actions button{flex:1;padding:9px 10px;min-height:40px;font-size:12px}
:is(#eiwa-preview,body) .project-attachments .attachment-preview{background:var(--gn-bg,#f3f7f7);border-color:transparent}
:is(#eiwa-preview,body) .project-attachments .attachment-remove{flex-basis:100%;margin-bottom:-6px;min-height:36px;border-color:transparent;font-size:11px;font-weight:400;color:var(--gn-muted,#526c75)}
:is(#eiwa-preview,body) .project-attachment-image{display:block;width:100%;height:180px;max-height:420px;object-fit:contain;margin:0;border-radius:0;background:var(--gn-bg,#f3f7f7)}
:is(#eiwa-preview,body) .project-attachment-confirm{border-top:1px solid var(--gn-border,#c9d8dc);padding:16px}
:is(#eiwa-preview,body) .project-attachment-confirm p{margin:0 0 12px}
:is(#eiwa-preview,body) .project-attachment-confirm button{margin-right:8px;margin-bottom:6px;font-size:12px}
:is(#eiwa-preview,body) .project-attachments [role=status]{font-size:13px;line-height:1.6;overflow-wrap:anywhere}
:is(#eiwa-preview,body) .project-attachments [role=status]:empty{display:none}
:is(#eiwa-preview,body) .attachment-empty{grid-column:1/-1;display:grid;justify-items:center;gap:8px;padding:34px 20px;color:var(--gn-muted,#526c75);text-align:center;border:1px dashed var(--gn-border,#c9d8dc);border-radius:14px}
:is(#eiwa-preview,body) .attachment-empty>svg{width:28px;height:28px;margin-bottom:4px}
:is(#eiwa-preview,body) .attachment-empty strong{font-size:14px;color:var(--gn-text,#173b43)}
:is(#eiwa-preview,body) .attachment-empty p{margin:0;font-size:13px;line-height:1.6}
@media(max-width:650px){:is(#eiwa-preview,body) .attachment-header{gap:10px;margin-bottom:20px}:is(#eiwa-preview,body) .attachment-header p{font-size:12px}:is(#eiwa-preview,body) .attachment-heading h2{font-size:21px}:is(#eiwa-preview,body) .project-attachments .attachment-refresh{font-size:0;padding:6px;min-width:40px}:is(#eiwa-preview,body) .project-attachments .attachment-refresh svg{width:18px;height:18px}:is(#eiwa-preview,body) .project-attachments .attachment-upload{grid-template-columns:1fr;padding:16px;gap:20px;border-radius:14px}:is(#eiwa-preview,body) .attachment-dropzone{padding:20px 14px}:is(#eiwa-preview,body) .attachment-dropzone>p{font-size:0}:is(#eiwa-preview,body) .attachment-dropzone>p::after{content:'Velg bilder eller filer fra enheten din.';font-size:12px}:is(#eiwa-preview,body) .project-attachment-list{grid-template-columns:1fr}:is(#eiwa-preview,body) .attachment-upload-submit{width:100%!important}:is(#eiwa-preview,body) .project-attachment-actions button{min-height:44px}}
html:not([data-theme=light]) #eiwa-preview .project-attachments .attachment-upload-submit{background:#bde5da;border-color:#bde5da;color:#173b43}
html:not([data-theme=light]) #eiwa-preview .project-attachments .attachment-upload-submit:hover:not(:disabled){background:#d1f0e8}
