.annotation-dialog{width:min(540px,calc(var(--nav-viewport-width,100vw) - 24px));height:calc(var(--nav-viewport-height,100dvh) - 24px);max-height:calc(var(--nav-viewport-height,100dvh) - 24px);position:fixed;top:calc(var(--nav-viewport-y,0px) + 12px);bottom:auto;left:auto;right:calc(100vw - var(--nav-viewport-x,0px) - var(--nav-viewport-width,100vw) + 12px);margin:0;padding:20px;overflow:auto;overscroll-behavior:contain;scroll-padding-block:70px;min-width:0}
.annotation-dialog>.dialog-heading{position:sticky;top:-1px;z-index:3;margin-bottom:14px;background:var(--surface);box-shadow:0 -20px 0 var(--surface);min-height:38px}.annotation-dialog .dialog-heading h2{font-size:18px;overflow-wrap:anywhere}
.annotation-body,.annotation-metadata,.annotation-body form{min-width:0}.annotation-metadata{display:grid;gap:9px;margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.annotation-metadata>strong{font-size:17px;overflow-wrap:anywhere}.annotation-metadata>a{font-size:12px;color:var(--accent);overflow-wrap:anywhere}.annotation-metadata>small,.annotation-metadata>p{font-size:12px;line-height:1.65;color:var(--muted);overflow-wrap:anywhere}
.annotation-metadata dl{display:grid;gap:8px;margin:3px 0 0;font-size:12px}.annotation-metadata dl>div{display:grid;grid-template-columns:78px minmax(0,1fr);gap:8px}.annotation-metadata dt{color:var(--muted)}.annotation-metadata dd{margin:0;overflow-wrap:anywhere}
.annotation-body textarea{resize:vertical;min-width:0;max-width:100%;font:inherit;line-height:1.6}.annotation-body textarea[name=note]{min-height:180px;max-height:400px}
.annotation-body input:not([type=checkbox]),.annotation-body select{width:100%;min-width:0}.annotation-pinned{display:flex!important;align-items:center;gap:7px!important}.annotation-pinned input{width:16px;height:16px;accent-color:var(--accent)}
.annotation-merge-warning,.annotation-remote{padding:12px;border:1px solid var(--line);border-radius:10px;margin-bottom:16px;background:var(--surface-soft);min-width:0}.annotation-merge-warning>strong{font-size:13px}.annotation-merge-warning p,.annotation-remote>p{font-size:12px;line-height:1.65;margin:8px 0;color:var(--muted)}
.annotation-merge-warning label,.annotation-conflict-values label{display:grid;gap:6px;font-size:12px;margin:10px 0;min-width:0}.annotation-merge-warning details{margin:12px 0}.annotation-merge-warning summary{cursor:pointer;font-size:12px}.annotation-merge-warning textarea,.annotation-conflict-values textarea{width:100%;min-height:120px;max-height:250px;font-size:12px}
.annotation-merge-warning>button{padding:8px 10px;min-height:36px}.annotation-remote[hidden]{display:none}.annotation-conflict-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.annotation-body .form-actions{flex-wrap:wrap;gap:8px}.annotation-body .form-actions>button{min-height:36px;padding:8px 10px}.annotation-login-hint{font-size:13px;color:var(--muted);line-height:1.7;padding:12px 0}
.annotation-list{display:grid;gap:10px}.annotation-list-row{display:grid;text-align:left;gap:6px;border:1px solid var(--line);border-radius:10px;padding:13px;min-width:0;background:var(--surface)}.annotation-list-row>strong{font-size:13px;overflow-wrap:anywhere}.annotation-list-row>small,.annotation-list-row>span{font-size:12px;color:var(--muted);line-height:1.5;overflow-wrap:anywhere}
[data-color-protection=true] :is(.annotation-dialog,.annotation-dialog>.dialog-heading,.annotation-merge-warning,.annotation-remote,.annotation-list-row){background:var(--theme-safe-surface);color:var(--theme-safe-text)}
[data-color-protection=true] .annotation-dialog>.dialog-heading{box-shadow:0 -20px 0 var(--theme-safe-surface)}
[data-color-protection=true] .annotation-dialog :is(input,textarea,select){background:var(--theme-safe-surface);color:var(--theme-safe-text)}
[data-color-protection=true] .annotation-dialog :is(p,small,dt),[data-color-protection=true] .annotation-list-row>span{color:var(--theme-safe-muted)}
[data-color-protection=true] .annotation-dialog .primary-button{background:var(--theme-safe-button);color:white}
@media(max-width:700px){
 .annotation-dialog{top:auto;bottom:var(--nav-viewport-bottom,0px);left:var(--nav-viewport-x,0px);right:auto;width:var(--nav-viewport-width,100vw);height:auto;max-width:var(--nav-viewport-width,100vw);max-height:calc(var(--nav-viewport-height,100dvh) - 12px);padding:18px max(14px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));border-radius:22px 22px 0 0}
 .annotation-dialog>.dialog-heading{box-shadow:0 -18px 0 var(--surface)}.annotation-body textarea[name=note]{min-height:150px;max-height:300px}.annotation-conflict-values{grid-template-columns:minmax(0,1fr)}
}
