/* ============ Read-only links ============ */
/* owner: the share window */
.modal.share-modal { width: min(480px, calc(100vw - 32px)); }
.sh h3 { display: flex; align-items: center; gap: 9px; }
.sh h3 svg.i { color: var(--accent); }
.sh-lead { margin: 0 0 14px; color: var(--text-2); line-height: 1.5; }
.sh-row { display: flex; gap: 8px; }
.sh-url {
  flex: 1; min-width: 0; height: 36px; padding: 0 11px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-size: 13px; font-family: "Cascadia Mono", Consolas, monospace; outline: 0;
}
.sh-url:focus { border-color: var(--accent); }
.sh-row .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sh-row .btn svg.i, .sh .modal-actions .btn svg.i { width: 15px; height: 15px; }
.sh .modal-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.sh .modal-actions [data-a="off"] { margin-right: auto; }

/* viewer: a banner says what this is; everything that edits is gone */
#viewBanner {
  position: fixed; top: 14px; left: 14px; z-index: 18; max-width: calc(100vw - 300px);
  display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 14px; border-radius: 13px;
  background: var(--glass); backdrop-filter: blur(20px); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  font-size: 13px; color: var(--text-2);
}
#viewBanner[hidden] { display: none; }
#viewBanner > svg.i { flex: none; color: var(--accent); }
#viewBanner.bad > svg.i { color: var(--danger); }
#viewBanner span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#viewBanner b { color: var(--text); font-weight: 650; }
#viewBanner small { margin-left: 8px; font-size: 12px; color: var(--text-3); }
.vb-own { flex: none; padding: 6px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.vb-own:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }

body.readonly #sidebar, body.readonly #sbOpen, body.readonly #hint, body.readonly #ghost,
body.readonly #addBtn, body.readonly #planBtn, body.readonly #undoBtn, body.readonly #redoBtn, body.readonly #toolbar .split,
body.readonly #groupBtn, body.readonly #selDelete, body.readonly #tourBtn, body.readonly #toolbar > .tb-sep:first-of-type,
body.readonly #pAddField, body.readonly #pDelete, body.readonly .md-tools,
body.readonly .field-remove, body.readonly .field-bell,
body.readonly #ganttAdd, body.readonly .g-link, body.readonly #kanbanAdd, body.readonly .k-add { display: none !important; }
/* the note's fields and look can be read, not changed; links in its text still open */
body.readonly #panel .p-group:not(.grow):not(.p-comments), body.readonly #pTitle { pointer-events: none; }
body.readonly #pBody { cursor: default; }
body.readonly #pBody a { pointer-events: auto; }
body.readonly .g-bar, body.readonly .g-ms, body.readonly .k-card, body.readonly .node-hit { cursor: pointer; }
body.readonly .g-top, body.readonly .k-top { padding-left: 12px; }
body.readonly #gantt, body.readonly #kanban { top: 64px; }

@media (max-width: 640px) {
  #viewBanner { top: calc(10px + env(safe-area-inset-top)); left: 10px; max-width: calc(100vw - 240px); }
  #viewBanner small { display: none; }
  body.readonly #gantt, body.readonly #kanban { top: calc(58px + env(safe-area-inset-top)); }
}

/* the sidebar's link button glows while the open project is shared */
#shareBtn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* the access window: editors */
.sh-sec + .sh-sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.sh-sec h4 { margin: 0 0 4px; font-size: 13px; font-weight: 650; }
.sh-note { margin: 0 0 10px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.sh-members { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.sh-member { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 9px; }
.sh-member:hover { background: var(--hover); }
.sh-ava { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--on-accent); background: var(--accent); }
.sh-mail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sh-mail i { font-style: normal; color: var(--text-3); }
.sh-tag { flex: none; font-size: 12px; color: var(--text-3); }
.sh-loading, .sh-empty { padding: 6px 4px; font-size: 12.5px; color: var(--text-3); }
.sh-invite.busy { opacity: .6; pointer-events: none; }
.sh-error { min-height: 0; margin-top: 6px; font-size: 12.5px; color: var(--danger); }
.sh-error:empty { display: none; }
.sh-make { display: inline-flex; align-items: center; gap: 6px; }
.sh-make svg.i { width: 15px; height: 15px; }
.sh-off { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--danger); }
.sh-off:hover { text-decoration: underline; }
.sh .modal-actions .btn.danger { margin-right: auto; }

/* a project edited together with other accounts */
.project-item .p-shared { display: none; color: var(--text-3); }
.project-item .p-shared svg.i { width: 14px; height: 14px; }
.project-item.shared .p-shared { display: grid; }

/* a viewer or commenter of a project (applyAccess in app.js): the same calm, read-only map,
   but the sidebar stays, so the other projects are one click away */
body.role-readonly #addBtn, body.role-readonly #planBtn, body.role-readonly #undoBtn, body.role-readonly #redoBtn, body.role-readonly #toolbar .split,
body.role-readonly #groupBtn, body.role-readonly #selDelete, body.role-readonly #ghost, body.role-readonly #hint,
body.role-readonly #pAddField, body.role-readonly #pDelete, body.role-readonly .md-tools,
body.role-readonly .field-remove, body.role-readonly .field-bell, body.role-readonly #newTag,
body.role-readonly #ganttAdd, body.role-readonly .g-link, body.role-readonly #kanbanAdd, body.role-readonly .k-add { display: none !important; }
body.role-readonly #panel .p-group:not(.grow):not(.p-comments), body.role-readonly #pTitle { pointer-events: none; }
body.role-readonly #pBody { cursor: default; }
body.role-readonly #pBody a { pointer-events: auto; }
body.role-readonly .g-bar, body.role-readonly .g-ms, body.role-readonly .k-card, body.role-readonly .node-hit { cursor: pointer; }
.project-item .p-role { font-size: 10.5px; color: var(--text-3); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; }

/* roles and groups in the access tab */
.sh-role { height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12.5px; }
.sh-role:focus { outline: 2px solid var(--text); outline-offset: 1px; }
.sh-member .sh-role { height: 28px; font-size: 12px; }
.sh-chip { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--active); color: var(--text-2); font-size: 11px; font-style: normal; }
.sh-groups { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.sh-group { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.sh-group-head { display: flex; align-items: center; gap: 8px; }
.sh-group-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sh-group-people { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.sh-pick { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.sh-pick input { accent-color: var(--text); }
