/* Hylē v4 · workspace-settings lane · shared parts (files, share, trash, notifications, feedback, components, settings, account, project-settings, billing).
   Dialog + sheet, member rows, link box and the forest-plot miniature live here so Share and Project settings stay identical.
   Type, colour and radius come only from system tokens. */

/* ================= Confirm dialog + bottom sheet (focus trap, Esc and focus return come from HyleUI.openModal) ================= */
.ws-dialog { position: fixed; z-index: var(--z-dialog); inset: 0; margin: auto; width: min(440px, calc(100vw - 32px)); height: fit-content; padding: 24px; border-radius: var(--r-xl); background: var(--raised); box-shadow: var(--e-4); }
.ws-dialog[hidden], .ws-sheet[hidden] { display: none; }
.ws-dialog .t-heading { margin: 4px 0 8px; }
.ws-dialog .dlg-ico { width: 44px; height: 44px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--danger-tint); color: var(--danger); }
.ws-dialog .dlg-ico.is-neutral { background: var(--sunken); color: var(--ink-2); }
.ws-dialog .dlg-ico:empty { display: none; }
.ws-dialog .dlg-ico svg { width: 20px; height: 20px; }
.ws-dialog .dialog-actions { margin-top: 24px; }
.ws-dialog .dlg-extra { margin-top: 16px; }
.dlg-word { font-family: var(--font-mono); font-size: var(--fs-ui); font-weight: 500; letter-spacing: .06em; color: var(--danger); }
.ws-sheet { position: fixed; z-index: var(--z-dialog); left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow: auto; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--raised); box-shadow: var(--e-4); }
.ws-sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--hairline-strong); margin: 0 auto 16px; }
.ws-sheet .t-heading { margin-bottom: 12px; }
.btn-quiet-danger { color: var(--danger); background: transparent; }
.btn-quiet-danger:hover { background: var(--danger-tint); color: var(--danger); }
.btn-quiet-danger:disabled { color: var(--ink-3); opacity: .6; }
.btn-danger:hover { background: #9c3b30; }
.btn-danger { box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(181,71,58,.3); }
@media (max-width: 640px) {
  .ws-dialog { inset: auto 0 0 0; width: auto; margin: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
  .ws-dialog .dialog-actions { flex-direction: column-reverse; }
  .ws-dialog .dialog-actions .btn { width: 100%; }
}

/* ================= Kind tiles (files, trash, notifications) ================= */
.kico { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink-2); }
.kico svg { width: 18px; height: 18px; }
.kico[data-k="data"] { background: var(--info-tint); color: var(--accent-ink); }
.kico[data-k="notes"] { background: var(--warning-tint); color: var(--warning); }
.kico[data-k="doc"] { background: var(--sunken); color: var(--ink-2); }
.kico[data-k="study"] { background: var(--success-tint); color: var(--success); }
.kico[data-k="job"] { background: var(--info-tint); color: var(--accent-ink); }
.kico[data-k="share"] { background: var(--success-tint); color: var(--success); }
.kico[data-k="system"] { background: var(--sunken); color: var(--ink-2); }

/* ================= Member rows: one treatment for Share and Project settings ================= */
.mrows { display: flex; flex-direction: column; }
.mrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) 132px 40px; align-items: center; gap: 4px 14px; min-height: 68px; padding: 14px 20px; border-top: 1px solid var(--hairline); transition: background var(--d-2); }
.mrow:first-child { border-top: 0; }
.mrow .avatar { width: 40px; height: 40px; font-size: var(--fs-ui); }
.mrow-who { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mrow-who b { display: flex; align-items: center; gap: 8px; font-size: var(--fs-ui); font-weight: 600; color: var(--ink); }
.mrow-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-small); color: var(--ink-2); }
.mrow-you { flex: none; font-size: var(--fs-small); font-weight: 500; color: var(--ink-2); }
.mrow-role { justify-self: end; width: 132px; }
.mrow-role .select-trigger { min-width: 0; width: 100%; min-height: 40px; }
.mrow-role .listbox { left: auto; right: 0; min-width: 180px; }
.mrow-static { display: block; padding-right: 14px; text-align: right; font-size: var(--fs-ui); color: var(--ink-2); }
.mrow .icon-btn { justify-self: end; color: var(--ink-3); }
.mrow .icon-btn:hover { color: var(--danger); background: var(--danger-tint); }
.mrow.is-pending .mrow-who span::before { content: "Invited · "; color: var(--warning); font-weight: 500; }
.mrows-empty { padding: 28px 20px; text-align: center; font-size: var(--fs-ui); color: var(--ink-2); }
.minvite { display: grid; grid-template-columns: minmax(0, 1fr) 132px auto; gap: 8px; align-items: start; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.minvite .control { min-height: 40px; }
.minvite .control input { height: 38px; font-size: var(--fs-ui); }
.minvite .select-trigger { min-height: 40px; min-width: 0; width: 100%; }
.minvite .btn { --btn-h: 40px; }
.minvite-err { grid-column: 1 / -1; font-size: var(--fs-small); color: var(--danger); }
.minvite-err[hidden] { display: none; }
@media (max-width: 640px) {
  .mrow { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 12px 16px; row-gap: 8px; }
  .mrow-role { grid-column: 2; grid-row: 2; justify-self: start; width: 100%; max-width: 200px; }
  .mrow-static { grid-column: 2; grid-row: 2; text-align: left; padding: 0; }
  .mrow .icon-btn { grid-column: 3; grid-row: 1; }
  .mrow .select-trigger { min-height: 44px; }
  .minvite { grid-template-columns: minmax(0, 1fr) auto; padding: 16px; }
  .minvite .control { min-height: 48px; grid-column: 1 / -1; }
  .minvite .select { grid-column: 1; }
  .minvite .btn { grid-column: 2; }
  .minvite .control input { height: 46px; }
  .minvite .btn { --btn-h: 44px; }
  .minvite .select-trigger { min-height: 44px; }
}

/* ================= Link box: the view-only link, identical on Share and Project settings ================= */
.linkbox { display: flex; flex-direction: column; gap: 12px; }
.linkbox-field { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 5px 5px 5px 16px; border-radius: var(--r-md); background: var(--sunken); box-shadow: inset 0 0 0 1px rgba(20,20,19,.06); transition: background var(--d-3), box-shadow var(--d-3); }
.linkbox-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: var(--fs-ui); font-weight: 500; letter-spacing: 0; transition: opacity var(--d-3); }
.linkbox-host { color: var(--ink-3); }
.linkbox-token { color: var(--ink); }
.linkbox-copy { --btn-h: 42px; min-width: 128px; }
.linkbox-copy .in { display: inline-flex; align-items: center; gap: 8px; }
.linkbox-copy.is-done { background: var(--success); }
.linkbox-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-desc); color: var(--ink-2); }
.linkbox-foot .link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 4px; font-size: var(--fs-ui); font-weight: 500; color: var(--accent-ink); border-radius: var(--r-sm); }
.linkbox-foot .link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.linkbox-foot .link-btn svg { width: 14px; height: 14px; }
.linkbox-foot .link-btn[aria-disabled="true"], .linkbox-foot .link-btn:disabled { color: var(--ink-3); pointer-events: none; opacity: .6; }
.linkbox-foot .note { margin-left: auto; }
.linkbox.is-off .linkbox-field { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hairline-strong); }
.linkbox.is-off .linkbox-url { opacity: .5; text-decoration: line-through; text-decoration-color: var(--ink-3); }
@media (max-width: 640px) {
  .linkbox-field { flex-direction: column; align-items: stretch; padding: 14px 14px 6px; gap: 10px; }
  .linkbox-url { white-space: normal; overflow-wrap: anywhere; }
  .linkbox-copy { --btn-h: 44px; width: 100%; }
  .linkbox-foot .link-btn { min-height: 44px; }
  .linkbox-foot .note { margin-left: 0; flex-basis: 100%; }
}

/* ================= Forest-plot miniature: the real R-042 figure (Share viewer lens, Notifications receipt) ================= */
.fp { width: 100%; height: auto; overflow: visible; }
.fp-band { fill: var(--sunken); }
.fp-grid { stroke: var(--hairline); stroke-width: 1; }
.fp-null { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.fp-ci { stroke: var(--success); stroke-width: 2; stroke-linecap: butt; fill: none; }
.fp-cap { stroke: var(--success); stroke-width: 2; }
.fp-pt { fill: var(--success); }
.fp-row.is-gap .fp-ci, .fp-row.is-gap .fp-cap { stroke: var(--brand-orange-deep); stroke-dasharray: 4 3; }
.fp-row.is-gap .fp-pt { fill: var(--brand-orange); }
.fp-lab { font-family: var(--font-sans); font-size: var(--fs-small); fill: var(--ink); }
.fp-ax { font-family: var(--font-mono); font-size: var(--fs-mono); fill: var(--ink-3); }
.fp-dir { font-family: var(--font-sans); font-size: var(--fs-mono); fill: var(--ink-3); }

/* =====================================================================================================
   Audit fix · Stage B · settings lane. Figure type on one sans tabular scale, a continuous grid, an axis title and key;
   people avatars carry a muted per-person hue; roster rows share one grid (avatar · who · role · action).
   ===================================================================================================== */
.fp-grid { stroke: rgba(20,20,19,.09); }
.fp-axis { stroke: rgba(20,20,19,.18); stroke-width: 1; }
.fp-null { stroke: var(--ink-2); stroke-dasharray: 3 3; }
.fp-row.is-gap .fp-cap { stroke-dasharray: none; }
.fp-ax { font-family: var(--font-sans); font-size: 12px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.fp-dir { font-family: var(--font-sans); font-size: 12px; fill: var(--ink-2); }
.fp-ttl { font-family: var(--font-sans); font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.fp-key text { font-family: var(--font-sans); font-size: 12px; fill: var(--ink-2); }
.fp-k { stroke: var(--success); stroke-width: 2; }
.fp-k.is-gap { stroke: var(--brand-orange-deep); stroke-dasharray: 4 3; }
.fp-lab { font-weight: 500; }

.avatar.av-p, .av-stack .avatar[data-avatar-color] { background: var(--av); color: #fff; box-shadow: none; text-shadow: none; }
.mrow .avatar.av-p { box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.mrow { grid-template-columns: 40px minmax(0, 1fr) 132px 36px; }
.mrow-you { padding: 2px 7px; border-radius: var(--r-pill); background: var(--sunken); font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 16px; }
.mrow-static { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; padding-right: 12px; color: var(--ink); font-weight: 500; }
.mrow-static svg { width: 14px; height: 14px; color: var(--brand-orange-deep); }
.mrow .icon-btn.rm { width: 36px; height: 36px; border-radius: var(--r-sm); color: var(--ink-2); }
.mrow .icon-btn.rm svg { width: 16px; height: 16px; }
.mrow-lock { justify-self: end; display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink-3); }
.mrow-lock svg { width: 14px; height: 14px; }
.mrow-who span.email, .mrow-who > span { color: var(--ink-2); }
@media (max-width: 640px) {
  .mrow { grid-template-columns: 40px minmax(0, 1fr) auto 44px; grid-template-rows: auto; row-gap: 0; column-gap: 12px; min-height: 64px; padding: 10px 12px 10px 16px; }
  .mrow-role { grid-column: 3; grid-row: 1; width: auto; max-width: none; justify-self: end; }
  .mrow-role .select-trigger { width: auto; min-width: 0; min-height: 44px; padding: 0 8px 0 12px; border-color: transparent; background: var(--sunken); font-weight: 500; }
  .mrow-static { grid-column: 3; grid-row: 1; justify-content: flex-end; padding: 0 8px; }
  .mrow .icon-btn, .mrow-lock { grid-column: 4; grid-row: 1; width: 44px; height: 44px; }
}


/* Deterministic roster palette, shared by Share and Project settings. */
.avatar[data-avatar-color="#24507a"]{--av:#24507a}
.avatar[data-avatar-color="#2f6b55"]{--av:#2f6b55}
.avatar[data-avatar-color="#8a4a2c"]{--av:#8a4a2c}
.avatar[data-avatar-color="#5a4a8c"]{--av:#5a4a8c}
.avatar[data-avatar-color="#8a3d52"]{--av:#8a3d52}
.avatar[data-avatar-color="#3b6170"]{--av:#3b6170}
.avatar[data-avatar-color="#6b5a1f"]{--av:#6b5a1f}
