.file-edit{margin-top:14px;padding:13px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:rgba(255,255,255,.025)}
.file-edit label{display:block;font-size:11px;color:#c4cfea}
.file-edit input{width:100%;margin-top:8px;color:#c4cfea;font-size:11px}
.file-edit small{display:block;margin-top:6px;color:#8492ae;font-size:10px}
.primary,.secondary,.quiet{font-family:'DM Sans',sans-serif}
.row-actions button:first-child{border-color:rgba(105,190,255,.32);background:linear-gradient(135deg,rgba(77,132,255,.24),rgba(74,207,215,.13));color:#bcecff}
.row-actions button:first-child:hover{border-color:rgba(105,190,255,.68);background:linear-gradient(135deg,rgba(77,132,255,.42),rgba(74,207,215,.25));color:#fff;box-shadow:0 4px 14px rgba(61,157,235,.18)}
.row-actions button:last-child{border-color:rgba(255,117,139,.3);background:linear-gradient(135deg,rgba(239,75,109,.2),rgba(197,65,105,.12));color:#ffb0bc}
.row-actions button:last-child:hover{border-color:rgba(255,117,139,.7);background:linear-gradient(135deg,rgba(239,75,109,.38),rgba(197,65,105,.24));color:#fff;box-shadow:0 4px 14px rgba(224,72,105,.17)}
.row-actions button:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.field-warning{display:none;color:#ff7a8c;font-size:10px;margin-top:5px;font-weight:700}.field-warning.visible{display:block}
#profileForm .field.invalid .field-warning.visible{margin-top:7px}
#profileForm .field.invalid input,
#profileForm .field.invalid select{border-color:rgba(255,105,125,.88);background:rgba(55,19,35,.34);box-shadow:0 0 0 1px rgba(255,105,125,.16)}
#profileForm .field.invalid input:focus,
#profileForm .field.invalid select:focus{border-color:#ff7187;box-shadow:0 0 0 3px rgba(255,105,125,.17);background:rgba(55,19,35,.42)}
#profileForm .field-error{display:block;min-height:0;margin-top:5px;color:#ff8798;font-size:10px;line-height:1.45;font-weight:600}
.file-edit{transition:border-color .18s,background .18s}.file-edit:focus-within{border-color:rgba(146,135,255,.5);background:rgba(143,130,255,.045)}
.attachment-row{min-height:34px}.attachment-row span{font-weight:600}.attachment-row small{overflow-wrap:anywhere}
.file-edit input::file-selector-button{border:1px solid rgba(174,191,230,.2);border-radius:7px;padding:6px 9px;margin-right:8px;background:rgba(255,255,255,.08);color:#e6edfb;cursor:pointer}
.file-edit input::file-selector-button:hover{background:rgba(143,130,255,.16)}
.attachment-row{display:flex;gap:12px}.attachment-description{min-width:0;display:grid;gap:3px}.attachment-description span{font-weight:700}.attachment-description small{overflow-wrap:anywhere;text-align:left}.attachment-view{flex:0 0 auto;align-self:center;border:1px solid rgba(143,130,255,.28);border-radius:8px;background:rgba(143,130,255,.12);color:#dedaff;padding:6px 11px;font:700 10px 'DM Sans',sans-serif;cursor:pointer}.attachment-view:hover{background:rgba(143,130,255,.24);border-color:rgba(169,155,255,.55)}
.attachment-dialog{width:min(900px,calc(100vw - 28px));max-width:900px;max-height:min(90vh,900px);padding:20px;border:1px solid rgba(174,191,230,.2);border-radius:18px;background:linear-gradient(145deg,#172541,#0b1629);color:#edf2ff;box-shadow:0 30px 100px rgba(0,0,0,.62)}.attachment-dialog::backdrop{background:rgba(2,7,16,.78);backdrop-filter:blur(6px)}.attachment-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:13px;border-bottom:1px solid rgba(174,191,230,.12)}.attachment-dialog-head h2{font:700 16px Manrope;margin:5px 0 0;overflow-wrap:anywhere}.attachment-preview{display:grid;place-items:center;min-height:200px;max-height:calc(90vh - 150px);overflow:auto;margin:15px 0;border-radius:12px;background:rgba(4,11,22,.62)}.attachment-preview img{display:block;max-width:100%;max-height:calc(90vh - 190px);object-fit:contain}.attachment-preview iframe{width:100%;height:min(70vh,680px);border:0;background:#fff}.attachment-preview .empty-editor{margin:20px}.attachment-dialog-actions{display:flex;justify-content:flex-end}.attachment-dialog-actions a{text-decoration:none;display:inline-flex;align-items:center;justify-content:center;font:700 11px 'DM Sans',sans-serif}
@media(max-width:480px){.attachment-dialog{padding:14px}.attachment-dialog-head h2{font-size:13px}}
.editor-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px}.editor-head-actions .secondary{white-space:nowrap;padding:9px 12px;font-size:10px}
@media(max-width:520px){.editor-head-actions{gap:7px;flex-direction:column-reverse;align-items:flex-end}.editor-head-actions .secondary{padding:8px 10px}}

/* Fluid layouts for desktop, tablet, and narrow/mobile viewports. */
html,body{width:100%;min-width:320px;overflow-x:clip}
.topbar{width:100%;padding-inline:max(clamp(14px,3.5vw,52px),calc((100vw - 1600px)/2))}
.shell{width:min(100%,1680px);padding-inline:clamp(14px,3.5vw,52px)}
.layout,.auth-layout,.panel,.form-section,.file-edit,.attachment-dialog{min-width:0}
.layout{grid-template-columns:minmax(260px,.72fr) minmax(0,1.38fr);gap:clamp(12px,1.5vw,22px)}
.form-sections{max-height:min(78dvh,1000px)}
.field input,.field select,.search,.auth-card input{min-width:0;max-width:100%}
.attachment-summary,.attachment-description{min-width:0;overflow-wrap:anywhere}
.profile-row{min-width:0}
.row-actions{flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end}
.editor-card .section-head>div:first-child,.welcome>div{min-width:0}
.editor-head-actions{min-width:0;flex-wrap:wrap}
.attachment-dialog{width:min(900px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:hidden}
.attachment-preview{max-height:calc(100dvh - 180px)}
.attachment-preview img{max-height:calc(100dvh - 230px)}
.attachment-preview iframe{height:min(68dvh,680px)}

@media(max-width:1100px){
  .shell{padding-top:clamp(28px,4vw,46px)}
  .layout{grid-template-columns:minmax(230px,.68fr) minmax(0,1.32fr);gap:14px}
  .panel{padding:clamp(16px,2vw,22px)}
  .form-section{padding:14px}
  .fields{gap:10px}
}

@media(max-width:900px){
  .layout{grid-template-columns:minmax(0,1fr);}
  .scan-card,.editor-card,.profiles-card{grid-column:1;grid-row:auto}
  .scan-card{order:1}.editor-card{order:2}.profiles-card{order:3}
  .form-sections{max-height:min(72dvh,850px)}
  .auth-layout{grid-template-columns:minmax(0,1fr) minmax(280px,.8fr);gap:clamp(20px,4vw,48px)}
}

@media(max-width:680px){
  .topbar{height:auto;min-height:60px;padding-block:10px;gap:10px}
  .account{min-width:0}
  .account #accountLabel{max-width:48vw}
  .shell{padding:24px 14px 24px}
  .welcome{align-items:stretch}
  .welcome h1{font-size:clamp(27px,7vw,36px);overflow-wrap:anywhere}
  .welcome p{font-size:12px}
  .welcome .secondary{width:100%;}
  .section-head{align-items:flex-start;gap:9px}
  .section-head h2{overflow-wrap:anywhere}
  .editor-head-actions{justify-content:flex-end}
  .editor-state,.step{white-space:normal}
  .form-sections{max-height:none;overflow:visible;padding-right:0}
  .fields{grid-template-columns:minmax(0,1fr)}
  .field input,.field select{font-size:16px;min-height:44px}
  .auth-layout{grid-template-columns:minmax(0,1fr);margin:20px auto;gap:18px}
  .intro h1{font-size:clamp(32px,9vw,42px)}
  .privacy-note{margin-top:18px}
  .profile-row{align-items:flex-start;flex-wrap:wrap}
  .profile-info{flex-basis:calc(100% - 4px)}
  .row-actions{width:100%;justify-content:flex-start}
  .row-actions button{min-height:34px;padding-inline:11px}
  .file-edit input{font-size:12px}
  .editor-actions{position:static}
  .editor-actions .primary,.editor-actions .quiet{min-width:0;min-height:42px;flex:1}
  .attachment-row{align-items:flex-start;flex-wrap:wrap}
  .attachment-view{margin-left:auto}
  .attachment-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:14px;border-radius:15px}
  .attachment-preview{min-height:140px;max-height:calc(100dvh - 170px)}
  .attachment-preview img{max-height:calc(100dvh - 220px)}
}

@media(max-width:400px){
  .topbar{padding-inline:10px}
  .brand{gap:8px}
  .brand-mark{width:32px;height:32px}
  .brand b{font-size:12px}
  .brand small{font-size:9px}
  .account{font-size:9px}
  .shell{padding-inline:10px}
  .panel{padding:14px;border-radius:15px}
  .section-head h2{font-size:15px}
  .editor-head-actions{flex-direction:row;align-items:center}
  .editor-head-actions .secondary{white-space:normal;max-width:150px}
  .form-section{padding:12px}
  .editor-actions{gap:7px}
  .editor-actions button{padding-inline:9px}
}

@media(max-height:600px) and (min-width:901px){
  .shell{padding-top:24px}
  .auth-layout{margin-block:24px}
  .form-sections{max-height:68dvh}
}
