/* The Sophron® account page (1 Oct 2026): one page, side tabs, every profile editable here.
   Loads after sophron-account.css (palette, .field/.row/.chips/.types form controls) and
   before sph-nav.css. Prefix: .sa-  */
:root { --burg: #66100c; --burg-h: #4d0c09; --deep: #1c0503; --paper: #fbf9f5; --line: rgba(3,2,72,.14); }

/* A centred column like the AIC account page; the panels fill the block next to the rail (Vincent, 2 Oct 2026:
   "wide enough to fill the block where it shows the content", not the whole window). */
.sa { flex: 1 0 auto; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 40px 72px; box-sizing: border-box; }

/* ---- header: who is signed in, and the two things they do most ---- */
.sa-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 8px 0 28px; border-bottom: 1px solid var(--line); margin: 0 0 28px; }
.sa-id { display: flex; align-items: center; gap: 20px; min-width: 0; }
.sa-av { position: relative; width: 76px; height: 76px; border-radius: 50%; background: var(--deep); color: #f0c9c5; display: grid; place-items: center; font: 400 1.7rem 'Cardo', Georgia, serif; overflow: hidden; flex: none; }
.sa-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }   /* over the initials, never under them */
.sa-eyebrow { display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--burg); margin: 0 0 6px; }
.sa-h1 { font-family: 'Cardo', Georgia, serif; font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 700; line-height: 1.1; margin: 0 0 16px; color: var(--ink); letter-spacing: -.01em; }
.sa-meta { display: flex; flex-wrap: wrap; gap: 6px 0; font-size: .88rem; color: var(--body-soft); line-height: 1.5; }
.sa-meta span { display: inline-flex; align-items: center; }
.sa-meta span + span::before { content: ''; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-faint); margin: 0 12px; }
.sa-acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- buttons ---- */
.sa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 700 .76rem 'Chivo', system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color .2s, color .2s, background .2s; }
.sa-btn:hover { border-color: var(--burg); color: var(--burg); }
.sa-btn--p { background: var(--burg); border-color: var(--burg); color: var(--cream); }
.sa-btn--p:hover { background: var(--burg-h); border-color: var(--burg-h); color: var(--cream); }
.sa-btn--sm { min-height: 38px; padding: 8px 14px; font-size: .76rem; letter-spacing: .12em; }
.sa-btn[disabled] { opacity: .55; cursor: default; }
.sa-btn svg { width: 14px; height: 14px; }
.sa-link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sa-link:hover { color: var(--burg); }
.sa-msg { font-size: .88rem; line-height: 1.5; margin: 12px 0 0; min-height: 1.3em; }
.sa-msg.ok { color: var(--green); }
.sa-msg.err { color: var(--error); }

/* ---- shell: the side tabs and the panel ---- */
.sa-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.sa-content > .sa-panel, #mp-host, #rp-host { width: 100%; }
.sa-menu { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 4px; align-self: start; }
.sa-tab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink-soft); font: 600 .8rem 'Chivo', system-ui, sans-serif; letter-spacing: .06em; text-align: left; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.sa-tab svg { width: 18px; height: 18px; flex: none; }
.sa-tab:hover { background: rgba(3,2,72,.05); color: var(--ink); }
.sa-tab.is-active { background: #fff; border-color: var(--line); color: var(--burg); }
.sa-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sa-tab__n { margin-left: auto; font-size: .76rem; font-weight: 700; letter-spacing: .08em; color: var(--ink-faint); }
.sa-content { min-width: 0; min-height: calc(100vh - 92px); }   /* a short panel never collapses the page: the scroll and the sticky rail stay put on a tab switch */
.sa-panel { display: flex; flex-direction: column; gap: 20px; }
.sa-panel[hidden] { display: none !important; }

/* ---- cards ---- */
.sa-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.sa-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.sa-card__head > div { min-width: 0; flex: 1 1 320px; }
.sa-card h2 { font: 700 1.35rem/1.2 'Cardo', Georgia, serif; color: var(--ink); margin: 0 0 6px; }
.sa-card__sub { font-size: .9rem; color: var(--body-soft); line-height: 1.55; margin: 0; }
.sa-card__sub a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.sa-sec { font-size: .76rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); margin: 26px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.sa-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sa-note { font: italic 1rem/1.6 'Cardo', Georgia, serif; color: var(--body-soft); margin: 0; }
.sa-note a { color: var(--burg); }

.sa-kv { display: grid; grid-template-columns: 180px 1fr; gap: 14px 20px; font-size: .95rem; margin: 0; }
.sa-kv dt { color: var(--ink-soft); font-weight: 600; }
.sa-kv dd { margin: 0; overflow-wrap: anywhere; }
.sa-kv .sa-btn--sm { margin-left: 12px; vertical-align: middle; }

.sa-form .field { margin-bottom: 18px; }
.sa-form .field[hidden] { display: none; }   /* .field is display:flex, which would beat the hidden attribute */
.sa-form .field label { font-size: .76rem; letter-spacing: .16em; }
.sa-form .field input, .sa-form .field select, .sa-form .field textarea { font-size: .95rem; padding: 11px 13px; border-radius: 8px; }
.sa-form .field input:focus, .sa-form .field select:focus, .sa-form .field textarea:focus { outline: none; border-color: var(--burg); }
.sa-form .types { margin-bottom: 18px; }
.sa-form .types label:has(input:checked) { border-color: var(--burg); background: #fff8f7; box-shadow: 0 0 0 2px rgba(102,16,12,.12); }
.sa-form .chips label:has(input:checked) { border-color: var(--burg); background: #fff8f7; }
.sa-form .chips input { accent-color: var(--burg); }
.sa-check { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; line-height: 1.5; margin: 6px 0 18px; cursor: pointer; }
.sa-check input { margin-top: 3px; accent-color: var(--burg); width: 17px; height: 17px; flex: none; }
.sa-acts-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---- lists (events, applications) ---- */
.sa-list { display: flex; flex-direction: column; }
.sa-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.sa-row:first-child { border-top: 0; padding-top: 0; }
.sa-row:last-child { padding-bottom: 0; }
.sa-row__t { font: 400 1.1rem/1.3 'Cardo', Georgia, serif; color: var(--ink); }
a.sa-row:hover .sa-row__t { color: var(--burg); }
.sa-row__s { font-size: .84rem; color: var(--body-soft); margin-top: 4px; }
.sa-pill { display: inline-block; flex: none; font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 6px 11px; border-radius: 2px; border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap; }
.sa-pill--ok { color: var(--green); border-color: rgba(4,72,21,.25); background: rgba(4,72,21,.06); }
.sa-pill--wait { color: #7a5a10; border-color: rgba(218,165,32,.4); background: rgba(218,165,32,.1); }
.sa-pill--sel { color: var(--burg); border-color: rgba(102,16,12,.3); background: #fff8f7; }
.sa-pill--off { color: var(--ink-faint); }
.sa-empty { font: italic 1rem/1.6 'Cardo', Georgia, serif; color: var(--body-soft); margin: 0; }

/* ---- clubs and programs ---- */
.sa-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.sa-tile { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--paper); }
.sa-tile b { font: 400 1.15rem/1.25 'Cardo', Georgia, serif; color: var(--ink); }
.sa-tile p { font-size: .88rem; color: var(--body-soft); line-height: 1.5; margin: 0; flex: 1; }
.sa-tile__acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.sa-tile__acts .sa-btn { white-space: normal; text-align: center; }

/* ---- certificates ---- */
.sa-certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.sa-cert { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; text-align: left; padding: 0; cursor: pointer; font: inherit; color: inherit; transition: transform .2s, box-shadow .2s; }
.sa-cert:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(28,5,3,.45); }
.sa-cert__img { position: relative; container-type: inline-size; background: #f3efe8; }
.sa-cert__img img { width: 100%; display: block; }
.sa-cert__name { position: absolute; left: 0; right: 0; text-align: center; white-space: nowrap; font-family: 'Cardo', Georgia, serif; font-weight: 700; color: #111; line-height: 1; }
.sa-cert__foot { padding: 14px 16px 16px; }
.sa-cert__t { font: 400 1rem/1.3 'Cardo', Georgia, serif; color: var(--ink); }
.sa-cert__m { font-size: .8rem; color: var(--body-soft); margin-top: 4px; }

/* ---- CV ---- */
.sa-cv-pages { margin-top: 18px; }
.sa-cv-pages canvas { background: #fff; }
.sa-cv-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 34px 20px; text-align: center; cursor: pointer; font-size: .92rem; color: var(--body-soft); background: var(--paper); margin-top: 18px; transition: border-color .2s; }
.sa-cv-drop:hover, .sa-cv-drop.is-over { border-color: var(--burg); }
.ed-cv-loading { font: italic 1rem 'Cardo', Georgia, serif; color: var(--body-soft); padding: 8px 0; }

/* ---- danger zone ---- */
.sa-danger { margin-top: 8px; text-align: center; }
.sa-danger .sa-link { font-size: .8rem; color: var(--ink-faint); }
.sa-danger__box { display: none; max-width: 360px; margin: 14px auto 0; text-align: left; }
.sa-danger__box.is-open { display: block; }
.sa-danger__box input { width: 100%; box-sizing: border-box; font: inherit; font-size: .95rem; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.sa-danger__box .sa-btn--danger { background: var(--error); border-color: var(--error); color: #fff; }

@media (max-width: 1080px) { .sa { padding-left: 24px; padding-right: 24px; } .sa-menu { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; } }
/* ---- phones and tablets ---- */
@media (max-width: 900px) {
  .sa-shell { grid-template-columns: 1fr; gap: 20px; }
  .sa-content { min-height: calc(100vh - 60px); }
  .sa-menu { position: sticky; top: 60px; z-index: 5; flex-direction: row; gap: 6px; overflow-x: auto; padding: 10px 0; margin: 0 -40px; padding-left: 40px; padding-right: 40px; background: var(--cream); scrollbar-width: none; }
  .sa-menu::-webkit-scrollbar { display: none; }
  .sa-tab { width: auto; flex: none; white-space: nowrap; padding: 10px 14px; }
  .sa-tab__n { margin-left: 6px; }
  .sa-kv { grid-template-columns: 1fr; gap: 6px 0; }
  .sa-kv dt { margin-top: 12px; }
  .sa-kv dt:first-child { margin-top: 0; }
}
@media (max-width: 600px) {
  .sa { padding: 20px 16px 56px; }
  .sa-head { padding-bottom: 22px; margin-bottom: 20px; }
  .sa-av { width: 60px; height: 60px; font-size: 1.3rem; }
  .sa-id { gap: 14px; }
  .sa-card { padding: 20px 18px; }
  .sa-menu { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .sa-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sa-meta { flex-direction: column; gap: 4px; }
  .sa-meta span + span::before { display: none; }
  .sa-acts { width: 100%; }
  .sa-acts .sa-btn { flex: 1 1 auto; }
}

/* My profile and Research profile: each block is its own card with air between them (2 Oct 2026). */
#mp-host, #rp-host { display: flex; flex-direction: column; gap: 22px; }
.mp-vis .mp-sw { padding-bottom: 18px; }
.mp-vis .mp-sw + .sa-form, .mp-vis .sa-form + .sa-check { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 0; }
.mp-vis .sa-form { padding-bottom: 6px; }
