/* Profile (#3454, design epic #3432; Nov-4 Figma 21:28716 read, 21:28987
 * edit): the header, Personal Details, Roles & access, the Danger zone and
 * the footnote; the connected agents and email notifications below them
 * take the same card. profile.ts draws it. Tokens only; dark from tokens.css.
 * The email's pencil opens the verification flow; there is no inline edit.
 * Linked before app.css and console.css, so each rule here is scoped under
 * .prof-page to out-specify theirs. Figma greys mapped to AA tokens: the read
 * value #a1aec1 (2.3:1) -> --fg-muted, the danger label #ef4444 (3.8:1) ->
 * --danger-fg. */

/* The page uses the main column's width (Figma: 1158 of 1238, 32 top, 40 sides). */
.content:has(.prof-page) { padding: 32px 40px var(--space-7); }
.page:has(> .prof-page) { max-width: none; }
.prof-page { display: flex; flex-direction: column; gap: 36px; }
.prof-sections { display: flex; flex-direction: column; gap: var(--space-6); }

/* ---- Header (21:28879): 22 SemiBold, the subtitle 7 under it ---- */
.prof-page .prof-header h1 { margin: 0; font: 600 22px/27px var(--font-sans); letter-spacing: normal; color: var(--fg-strong); }
.prof-page .prof-header p { margin: 7px 0 0; font: 400 13px/16px var(--font-sans); color: var(--fg-muted); }

/* ---- Section heading (21:28888): 15/22.5 SemiBold, 16 to the card ---- */
.prof-page .prof-section { display: flex; flex-direction: column; gap: var(--space-4); }
.prof-page .prof-section h2 { margin: 0; font: 600 15px/22.5px var(--font-sans); color: var(--fg-strong); }

/* ---- Personal Details card (21:28889): radius 32, padding 32 ---- */
.prof-page .prof-card {
  padding: 32px; background: var(--surface); border: 1px solid var(--border-card);
  border-radius: 32px; box-shadow: var(--shadow-card);
}
.prof-page .prof-card > p { margin: 0 0 var(--space-3); }
.prof-page .prof-card > .prof-note { margin: var(--space-4) 0 0; }
.prof-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); align-items: start; }
@media (max-width: 960px) { .prof-fields { grid-template-columns: minmax(0, 1fr); } }
.prof-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.prof-label { font: 700 13px/19.5px var(--font-mono); color: var(--fg); }

/* Read (21:28894): 40 tall, sunken, the action 12 from the right. */
.prof-box {
  position: relative; display: flex; align-items: center; gap: var(--space-2); box-sizing: border-box;
  height: 40px; padding: 0 36px 0 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.prof-value { overflow: hidden; font: 700 13px/19.5px var(--font-mono); color: var(--fg-muted); text-overflow: ellipsis; white-space: nowrap; }
.prof-value.is-empty { font-weight: 400; }
.prof-page .prof-avatar { flex: none; width: 20px; height: 20px; font-size: 10px; }
.prof-icon-btn {
  position: absolute; top: 50%; right: 8px; display: inline-grid; place-items: center; width: 22px; height: 22px;
  padding: 0; transform: translateY(-50%); background: none; border: 0; border-radius: var(--radius-sm); color: var(--fg-muted); cursor: pointer;
}
.prof-icon-btn svg { width: 14px; height: 14px; }
.prof-icon-btn:hover { color: var(--fg-strong); background: var(--hover-tint); }
.prof-icon-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.prof-page .prof-note { margin: 0; font: var(--type-meta); color: var(--fg-muted); }
.prof-page .prof-note:empty { display: none; }
/* #4036: Stop all is set; Turn back on sits under the line. */
.prof-mail-off { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.prof-mail-off .field-error:empty { display: none; }

/* ---- Roles & access (21:28918): heading + count chip, 12 to the table ---- */
.prof-page .prof-section:has(.prof-table-card) { gap: var(--space-3); }
.prof-section-head { display: flex; align-items: center; gap: var(--space-2); }
.prof-count {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 22px; height: 21px; padding: 0 6px; background: var(--surface-sunken); border-radius: 5px;
  font: 400 11px/normal var(--font-sans); color: var(--fg-muted);
}
.prof-table-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); }
.prof-table { width: 100%; border-collapse: collapse; }
.prof-table th {
  box-sizing: border-box; height: 56px; padding: 0 20px; text-align: left; background: var(--surface-header); border-bottom: 1px solid var(--border-strong);
  font: 700 11px/16.5px var(--font-sans); text-transform: uppercase; letter-spacing: 0.08px; color: var(--fg-muted);
}
.prof-table td { padding: 16px 20px; border-bottom: 1px solid var(--border-strong); vertical-align: middle; }
.prof-table tbody tr:last-child td { border-bottom: 0; }
.prof-table .prof-col-org { width: 200px; }
.prof-table th.prof-col-org, .prof-table tr > td:first-child { padding-right: 0; }
.prof-table .prof-col-action { width: 100px; text-align: right; }
.prof-org { display: flex; align-items: center; gap: var(--space-3); }
.prof-page .prof-org-avatar { flex: none; width: 28px; height: 28px; border-radius: var(--radius-md); font: 700 11px/16.5px var(--font-sans); }
.prof-org-name { overflow: hidden; font: 600 14px/21px var(--font-sans); color: var(--fg-strong); text-overflow: ellipsis; white-space: nowrap; }
.prof-action { display: inline-flex; align-items: center; gap: 4px; font: 700 11px/16px var(--font-sans); color: var(--primary-text); text-decoration: none; white-space: nowrap; }
.prof-actions { display: inline-flex; align-items: center; gap: 12px; }
.prof-action:hover { text-decoration: underline; }
.prof-action:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---- Danger zone (21:28965): the red eyebrow and its rule, 24 to the card ---- */
.prof-danger { display: flex; flex-direction: column; gap: var(--space-6); }
.prof-danger-head { display: flex; align-items: center; gap: var(--space-3); }
.prof-danger-head::after { content: ""; flex: 1; height: 1px; background: var(--danger-bg); }
.prof-page .prof-danger-head h2 { margin: 0; font: var(--type-eyebrow); letter-spacing: 2px; text-transform: uppercase; color: var(--danger-fg); }
.prof-danger-card {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  padding: 20px; background: var(--surface); border: 1px solid var(--danger-bg); border-radius: var(--radius-lg);
}
.prof-danger-name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 4px; font: 600 14px/21px var(--font-sans); color: var(--fg-strong); }
.prof-danger-desc { margin: 0; font: 400 12px/18px var(--font-sans); color: var(--fg-muted); }
.prof-page .prof-delete { flex: none; width: 156px; }
.prof-delete svg { width: 16px; height: 16px; }

/* ---- Footnote (21:28983): info 12, 7 to the text ---- */
.prof-footnote { display: flex; align-items: center; gap: 7px; margin: 0; font: 400 11px/1.5 var(--font-sans); color: var(--fg-muted); }
.prof-footnote svg { flex: none; width: 12px; height: 12px; }

/* ---- Connected agents and Email notifications, kept below (Q26): the
 * Roles & access table card (#3441: border, radius 10). ---- */
.prof-page .card { border-color: var(--border-strong); border-radius: var(--radius-lg); box-shadow: none; }
.prof-page .card-header { padding: 0 20px; min-height: 56px; background: var(--surface-header); border-bottom-color: var(--border-strong); }
.prof-page .card:not(.card-flush) > .card-header { margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) var(--space-4); }
.prof-page .card-header h2 { font: 600 15px/22.5px var(--font-sans); color: var(--fg-strong); }
.prof-page .toggle-list li { padding: 16px 20px; border-bottom-color: var(--border-strong); }
.prof-page .notify-email { padding: var(--space-4) 20px 0; }
.prof-page [data-notify-form] > .form-actions, .prof-page [data-notify-form] > .form-note { padding: 0 20px var(--space-4); }

@media (max-width: 720px) {
  .content:has(.prof-page) { padding: var(--space-5) var(--space-4) var(--space-6); }
  .prof-danger-card { flex-direction: column; align-items: flex-start; }
  .prof-table .prof-col-org { width: auto; }
}

/* ---- Leave (a member's row, #3503, Figma 21:29541) ---- */
.prof-page .prof-action-btn { padding: 0; border: 0; background: none; cursor: pointer; }
.acct-leave-text { margin: 0; font: 400 13px/1.55 var(--font-sans); color: var(--fg-muted); }

/* ---- Delete account (#3825, Figma 21:29541; account-delete.ts) ---- */
/* The card 21:29542: 440 wide, radius 16, Figma's shadow; the body on the card white. */
.acct-del {
  --ad-red: var(--meter-red);
  border-radius: var(--radius-2xl); background: var(--surface);
  box-shadow: 0 20px 40px -8px color-mix(in srgb, var(--ink) 19%, transparent);
}
.acct-del-message { display: grid; justify-items: center; gap: var(--space-4); padding: 32px 28px var(--space-6); overflow: auto; }
.acct-del-art { display: block; overflow: visible; }
.acct-del-heading { display: grid; gap: 6px; width: 100%; }
/* Figma breaks the title after "to": 300 wide holds that line, not "delete" with it. */
.acct-del-heading h2 { max-width: 300px; margin: 0 auto; font: 700 20px/28px var(--font-mono); letter-spacing: -0.4px; text-align: center; color: var(--fg-strong); }
/* The info box 21:29568: sunken, radius 8, 16 padding, the icon 12 from the text.
   Text: Figma's #6b7280 is 4.3:1 on the sunken grey; --fg-muted keeps AA. */
.acct-del-info { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border-radius: 8px; background: var(--surface-sunken); }
.acct-del-info > svg { flex: none; width: 12px; height: 12px; margin-top: 3px; color: var(--fg-muted); }
.acct-del-info > div { display: grid; gap: var(--space-2); min-width: 0; }
.acct-del-info-text { margin: 0; font: 400 12px/1.55 var(--font-sans); color: var(--fg-muted); }
/* Proposed, not in Figma (#3810): the sole-Admin note on the danger tint, then
   one row per org -- name and balance, the outcome, its typed name -- as a
   card on the dialog white, the DS text field at 36 high. */
.acct-del-info.is-blocked { background: var(--danger-bg); }
.acct-del-info.is-blocked > svg, .acct-del-info.is-blocked .acct-del-info-text { color: var(--danger-fg); }
.acct-del-rows:empty { display: none; }
.acct-del-rows { display: grid; gap: var(--space-3); width: 100%; }
.acct-del-orgs { display: grid; gap: var(--space-3); width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.acct-del-row { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.acct-del-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.acct-del-org { min-width: 0; overflow-wrap: anywhere; font: 600 13px/1.4 var(--font-mono); color: var(--fg-strong); }
.acct-del-balance { flex: none; font: 400 12px/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.acct-del-outcome { margin: 0; font: 400 12px/1.55 var(--font-sans); color: var(--fg); }
.acct-del-field { display: grid; gap: var(--space-1); }
.acct-del-field label { font: 400 12px/1.55 var(--font-sans); color: var(--fg-muted); }
.acct-del-field label strong { font-weight: 600; color: var(--fg-strong); overflow-wrap: anywhere; }
.acct-del-field input[readonly] { background: var(--surface-disabled); color: var(--fg-muted); }
.acct-del .acct-del-field .field-error { text-align: left; font-size: 12px; }
.acct-del-org-link { display: inline-flex; align-items: center; gap: var(--space-1); justify-self: start; font: 600 12px/1.55 var(--font-sans); color: var(--fg-strong); }
.acct-del-done { width: 100%; padding: var(--space-3) var(--space-4); border-radius: 8px; background: var(--surface-sunken); text-align: left; }
.acct-del-done-list { display: grid; gap: var(--space-1); margin: var(--space-1) 0 0; padding: 0; list-style: none; font: 400 12px/1.55 var(--font-sans); color: var(--fg); }
.acct-del .field-error:empty { display: none; }
.acct-del .field-error { margin: 0; text-align: center; }
/* Footer 21:29573: the raised grey, Cancel 125 wide, the confirm fills the rest. */
.acct-del-foot { background: var(--surface-raised); }
/* The illustration 21:29545: the danger red over the card's white. */
.ad-halo { fill: color-mix(in srgb, var(--ad-red) 7%, var(--surface)); }
.ad-tile { fill: var(--surface); stroke: var(--ad-red); stroke-width: 2; filter: drop-shadow(0 1px 1px color-mix(in srgb, var(--ink) 5%, transparent)); }
.ad-glyph { fill: var(--ad-red); }
.ad-badge { fill: var(--ad-red); stroke: var(--surface); stroke-width: 2; filter: drop-shadow(0 4px 3px color-mix(in srgb, var(--ink) 10%, transparent)); }
.ad-bang { fill: var(--btn-on-fill); }
.ad-spark { fill: none; stroke-linecap: round; }
.ad-spark-1 { stroke: color-mix(in srgb, var(--ad-red) 80%, var(--surface)); stroke-width: 2; }
.ad-spark-2 { stroke: color-mix(in srgb, var(--ad-red) 50%, var(--surface)); stroke-width: 1.83; }
.ad-spark-3 { stroke: color-mix(in srgb, var(--ad-red) 30%, var(--surface)); stroke-width: 1.6; }
.ad-dot { fill: var(--fg-strong); }
