/* ================================================
     DESIGN TOKENS — TWU Pioneer maroon + White
  ================================================ */
  :root {
    --maroon:       #850928;
    --maroon-deep:  #341a5e;
    --maroon-mid:   #5c36a0;
    --maroon-tint:  #f2eefb;
    --gold:         #a8002a;
    --gold-light:   #a8002a;
    --gold-pale:    #a8002a;
    --cream:        #f6f4f0;
    --white:        #ffffff;
    --black:        #000000;
    --text:         #1a1a2e;
    --text-soft:    #46465a;
    --muted:        #8a8aa8;
    --border:       #e2ddf0;
    --radius:       5px;
    --shadow-sm:    0 2px 8px rgba(75,38,131,0.08);
    --shadow-md:    0 6px 24px rgba(75,38,131,0.13);
  }

  /* ================================================
     GLOBAL RESET
  ================================================ */
  *, *::before, *::after { box-sizing: border-box; }

  /* ================================================
     SCOPED ISOLATION RESET
  ================================================ */
  #dm-web-profile-root ul,
  #dm-web-profile-root ol {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: 0 !important;
  }

  #dm-web-profile-root li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: 0 !important;
    float: none !important;
  }

  #dm-web-profile-root h1,
  #dm-web-profile-root h2,
  #dm-web-profile-root h3,
  #dm-web-profile-root h4,
  #dm-web-profile-root h5,
  #dm-web-profile-root h6 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: none !important;
    background: none;
    text-transform: none;
    letter-spacing: normal;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
  }

  #dm-web-profile-root p {
    margin: 0 0 12px !important;
    padding: 0 !important;
  }
  #dm-web-profile-root p:last-child {
    margin-bottom: 0 !important;
  }

  #dm-web-profile-root a {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    display: inline;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none !important;
  }

  #dm-web-profile-root img {
    border: 0 !important;
    max-width: 100%;
    height: auto;
    display: block;
    float: none !important;
  }

  #dm-web-profile-root table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    margin: 0 !important;
  }

  #dm-web-profile-root style {
    display: none !important;
  }

  p { margin: 0 0 12px; }
  p:last-child { margin-bottom: 0; }

  a { color: var(--maroon-mid); text-decoration: none; transition: color .15s; }
  a:hover { color: var(--gold); text-decoration: none; }

  [style*="font-family:Arial"],
  [style*="font-family: Arial"] {
    font-family: 'Montserrat', sans-serif !important;
  }
  .dm-profile-activity span[style*="font-size"],
  .dm-profile-activity span[style*="font-weight"] {
    font-size: inherit !important;
    font-weight: inherit !important;
  }

  /* ================================================
     PAGE SHELL
  ================================================ */
  #dm-web-profile-root {
    display: block;
    min-height: 100vh;
    padding-bottom: 2rem;
  }

  .dm-profile {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* ================================================
     HEADER — .dm-profile-preamble
  ================================================ */
  .dm-profile-preamble {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-image: url('https://twu.edu/media/images/twu-home/flowers-background.jpg');
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    background-color: #700a1c;
  }

  .dm-profile-preamble::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(112, 10, 28, 0.82);
    pointer-events: none;
    z-index: 0;
  }

  .dm-profile-preamble .dm-profile-report-section {
    position: relative;
    z-index: 1;
  }

  .dm-profile-preamble::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 20%, var(--gold-light) 50%, var(--gold) 80%, transparent 100%);
    z-index: 2;
  }

  .dm-profile-preamble .dm-profile-report-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
  }

  .dm-profile-preamble .dm-profile-heading--level-2 {
    display: none;
  }

  .dm-profile-preamble .dm-profile-contents {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    padding: 36px 48px 16px;
    gap: 36px;
  }

  .dm-profile-preamble .dm-profile-text {
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 0 !important;
    line-height: 0;
    border-style: solid;
    border-color: white;
    border-width: 5px;
    padding: 5px;
  }

  .dm-profile-preamble .dm-profile-text p {
    margin: 0 !important;
    line-height: 0;
  }

  .dm-profile-preamble .dm-profile-text p:not(:has(img)) {
    display: none;
  }

  .dm-profile-image {
    display: block;
    width: 140px !important;
    height: 140px;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--radius) var(--radius) 0 0;
    border: 3px solid rgba(255,255,255,0.2);
    border-bottom: none;
    background: var(--maroon-deep);
  }

  .dm-profile-preamble .dm-profile-content:has(.dm-profile-activities) {
    flex: 1;
    min-width: 0;
    padding-bottom: 28px;
  }

  #dm-web-profile-root .dm-profile-preamble .dm-profile-activities {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
  }

  #dm-web-profile-root .dm-profile-preamble .dm-profile-activity {
    padding: 0;
    border: none;
  }

  #dm-web-profile-root .dm-profile-preamble .dm-profile-activity::before {
    display: none;
  }

  .dm-profile-preamble .dm-profile-activity::before {
    display: block;
    content: 'Texas Woman\'s University';
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
  }

  #dm-web-profile-root .dm-profile-preamble .dm-profile-activity > span:first-child {
    display: block;
    font-family: 'adelle',serif !important;
    font-size: 34px !important;
    font-weight: 400 !important;
    color: var(--white) !important;
    line-height: 1.15;
    margin-bottom: 8px;
  }

  .dm-profile-preamble .dm-profile-activity {
    font-size: 14px;
    color: var(--white);
    line-height: 1.7;
  }

  /* Credentials/suffix displayed smaller than the main name */
  #dm-web-profile-root .dm-profile-preamble .twu-preamble-suffix {
    font-size: 0.58em !important;
    font-weight: 300 !important;
    opacity: 0.88;
    letter-spacing: 0.01em;
  }

  #dm-web-profile-root .dm-profile-preamble .dm-profile-activity a {
    color: var(--white);
  }
  #dm-web-profile-root .dm-profile-preamble .dm-profile-activity a:hover { color: #fff; }

  /* ================================================
     TAB STRIP
  ================================================ */
  #dm-web-profile-root .dm-profile-sections section.dm-profile-section,
  #dm-web-profile-root .dm-profile-sections section.dm-profile-section .dm-profile-report-section {
    display: contents !important;
  }

  #dm-web-profile-root .dm-profile-sections .dm-profile-heading--level-2 {
    display: block !important;
    order: 0;
    flex-shrink: 0;
    cursor: pointer;
    padding: 13px 22px 15px !important;
    font-family: 'adelle',serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: var(--white) !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: var(--radius) var(--radius) 0 0;
    margin: 0 !important;
    line-height: 1 !important;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
  }

  #dm-web-profile-root .dm-profile-sections .dm-profile-heading--level-2:hover {
    color: rgba(255,255,255,0.88) !important;
    background: rgba(255,255,255,0.07) !important;
  }

  #dm-web-profile-root .dm-profile-sections section.dm-profile-section.dm-tab-active .dm-profile-heading--level-2 {
    color: var(--black) !important;
    background: var(--white) !important;
    border-bottom-color: var(--white) !important;
    border-left: 1px solid var(--border) !important;
    border-right: 1px solid var(--border) !important;
    border-top: 2px solid var(--gold) !important;
  }

  /* ================================================
     SECTIONS WRAPPER
  ================================================ */
  #dm-web-profile-root .dm-profile-sections {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    justify-content: center !important;
    width: 100% !important;
    background: var(--maroon) !important;
  }

  /* ================================================
     CONTENT PANELS
  ================================================ */
  #dm-web-profile-root .dm-profile-sections .dm-profile-contents {
    order: 1;
    width: 100%;
    display: none !important;
    background: var(--white);
  }

  #dm-web-profile-root .dm-profile-sections section.dm-profile-section.dm-tab-active .dm-profile-contents {
    display: block !important;
  }

  @keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ================================================
     CONTENT PANEL INNER LAYOUT
     All dm-profile-content blocks sit flat — no
     individual boxes. Max-width centered as a group.
  ================================================ */

  /* Outer wrapper: max-width column, top+bottom padding */
  #dm-web-profile-root .dm-profile-sections .dm-profile-contents > * {
    max-width: 1004px;
    width: calc(100% - 96px);
    margin: 0 auto;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    padding: 0;
  }

  /* First content block: top breathing room */
  #dm-web-profile-root .dm-profile-sections .dm-profile-content:first-child {
    margin-top: 40px;
  }

  /* Last content block: bottom breathing room */
  #dm-web-profile-root .dm-profile-sections .dm-profile-content:last-child {
    margin-bottom: 56px;
  }

  /* ── HEADING BLOCKS (dm-profile-text only, no activities) ─────────
     These are section label rows: "Brief Biography", "Scholarly
     Interests", etc. Style them like UTA — colored heading with
     underline, no box.
  ────────────────────────────────────────────────────────────────── */
  #dm-web-profile-root .dm-profile-sections
    .dm-profile-content:has(> .dm-profile-text):not(:has(.dm-profile-activities)) {
    margin-top: 40px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--maroon);
  }

  /* First heading in a panel: less top space */
  #dm-web-profile-root .dm-profile-sections
    .dm-profile-content:first-child:has(> .dm-profile-text):not(:has(.dm-profile-activities)) {
    margin-top: 40px;
  }

  /* The heading text itself */
  #dm-web-profile-root .dm-profile-sections
    .dm-profile-content:has(> .dm-profile-text):not(:has(.dm-profile-activities))
    .dm-profile-text p {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--maroon) !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    line-height: 1 !important;
  }

  /* Neutralize the <span> and <strong> Watermark inlines inside headings */
  #dm-web-profile-root .dm-profile-sections
    .dm-profile-content:has(> .dm-profile-text):not(:has(.dm-profile-activities))
    .dm-profile-text p strong,
  #dm-web-profile-root .dm-profile-sections
    .dm-profile-content:has(> .dm-profile-text):not(:has(.dm-profile-activities))
    .dm-profile-text p span {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
  }

  /* ── CONTENT BLOCKS (with activities) ────────────────────────────
     Sit directly below their heading with a small top gap.
  ────────────────────────────────────────────────────────────────── */
  #dm-web-profile-root .dm-profile-sections
    .dm-profile-content:has(.dm-profile-activities) {
    margin-top: 12px;
    padding: 0;
  }

  /* Empty panel message */
  #dm-web-profile-root .dm-profile-sections .dm-profile-contents:empty::after {
    content: 'No entries have been added yet.';
    display: block;
    font-size: 14px;
    color: var(--muted);
    font-style: italic;
    padding: 40px 0;
    max-width: 1004px;
    width: calc(100% - 96px);
    margin: 0 auto;
  }

  /* ================================================
     SECTION INTERNALS
  ================================================ */

  /* Content inner padding (content blocks only) */
  #dm-web-profile-root .dm-profile-sections .dm-profile-content:has(.dm-profile-activities) {
    padding: 0;
  }

  /* ---- Text blocks inside content areas ---- */
  #dm-web-profile-root .dm-profile-text p {
    font-size: 15px;
    color: var(--text-soft);
    line-height: 1.82;
    margin-bottom: 12px;
  }
  #dm-web-profile-root .dm-profile-text p:last-child { margin-bottom: 0; }

  /* ---- Activity lists ---- */
  #dm-web-profile-root .dm-profile-sections .dm-profile-activities {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    font-family: adelle, serif !important;
  }

  #dm-web-profile-root .dm-profile-sections .dm-profile-activity {
    padding: 13px 0 13px 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.0625rem;
    font-family: adelle, serif !important;
    color: var(--text);
    line-height: 1.65;
    position: relative;
  }

  #dm-web-profile-root .dm-profile-sections .dm-profile-activity:first-child {
    padding-top: 0;
  }

  #dm-web-profile-root .dm-profile-sections .dm-profile-activity:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  #dm-web-profile-root .dm-profile-sections .dm-profile-activity i,
  .dm-profile-sections .dm-profile-activity em {
    font-style: italic;
  }

  #dm-web-profile-root .dm-profile-sections .dm-profile-activity a {
    color: var(--maroon);
    font-size: 13px;
  }
  #dm-web-profile-root .dm-profile-sections .dm-profile-activity a:hover { color: var(--gold); }

  /* ---- First section (contact / overview): name card style ---- */
  #dm-web-profile-root section.dm-profile-section:first-child .dm-profile-activity > span:first-child {
    display: block;
    font-family: 'adelle',serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--maroon);
    line-height: 1.2;
    margin-bottom: 6px;
  }

  #dm-web-profile-root section.dm-profile-section:first-child .dm-profile-activity {
    padding-left: 0;
    border-bottom: none;
  }

  #dm-web-profile-root section.dm-profile-section:first-child .dm-profile-activity::before {
    display: none;
  }

  section.dm-profile-section:first-child .dm-profile-activity {
    font-size: 14.5px;
    color: var(--text-soft);
    line-height: 1.75;
  }

  /* ================================================
     SECTION CONTENT LABEL
  ================================================ */
  .dm-section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px 0;
    margin-bottom: -8px;
  }

  .dm-section-label-text {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .dm-section-label-line {
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  /* ================================================
     MOBILE DROPDOWN
  ================================================ */
  .dm-tab-dropdown {
    display: none;
    order: 0;
    width: 100%;
    background: var(--maroon);
    padding: 14px 16px;
  }

  .dm-tab-dropdown select {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    background: var(--white);
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234B2683' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
  }

  /* ================================================
     RESPONSIVE — TABLET (≤ 960px)
  ================================================ */
  @media (max-width: 960px) {

    .dm-profile-preamble .dm-profile-contents {
      padding: 28px 32px 0;
      gap: 26px;
    }

    #dm-web-profile-root .dm-profile-sections .dm-profile-contents > * {
      width: calc(100% - 64px);
    }

    .dm-profile-image {
      width: 118px !important;
      height: 118px;
    }

    .dm-profile-preamble .dm-profile-activity > span:first-child {
      font-size: 28px !important;
    }
  }

  /* ================================================
     RESPONSIVE — MOBILE (≤ 640px)
  ================================================ */
  @media (max-width: 640px) {

    .dm-profile-preamble .dm-profile-contents {
      flex-direction: column;
      align-items: flex-start;
      padding: 24px 20px 0;
      gap: 16px;
    }

    .dm-profile-preamble .dm-profile-text {
      align-self: auto;
    }

    .dm-profile-image {
      width: 90px !important;
      height: 90px;
      border-radius: 50% !important;
      border: 3px solid rgba(255,255,255,0.25) !important;
      object-fit: cover;
    }

    .dm-profile-preamble .dm-profile-content:has(.dm-profile-activities) {
      padding-bottom: 20px;
    }

    .dm-profile-preamble .dm-profile-activity > span:first-child {
      font-size: 24px !important;
    }

    .dm-profile-preamble .dm-profile-activity {
      font-size: 13px;
    }

    #dm-web-profile-root .dm-profile-sections .dm-profile-heading--level-2 {
      display: none !important;
    }

    #dm-web-profile-root .dm-tab-dropdown {
      display: block !important;
    }

    section.dm-profile-section {
      border-radius: var(--radius);
    }

    #dm-web-profile-root .dm-profile-sections .dm-profile-contents > * {
      width: calc(100% - 32px);
    }

    #dm-web-profile-root .dm-profile-sections
      .dm-profile-content:has(> .dm-profile-text):not(:has(.dm-profile-activities)) {
      margin-top: 28px;
    }

    #dm-web-profile-root .dm-profile-sections
      .dm-profile-content:first-child:has(> .dm-profile-text):not(:has(.dm-profile-activities)) {
      margin-top: 24px;
    }

    #dm-web-profile-root .dm-profile-sections .dm-profile-content:last-child {
      margin-bottom: 36px;
    }

    .dm-section-label {
      padding: 14px 18px 0;
    }

    #dm-web-profile-root .dm-profile-sections .dm-profile-activity {
      font-size: 13.5px;
      padding: 11px 0;
    }

    .dm-profile-text p {
      font-size: 14px;
    }
  }

  /* ================================================
     RESPONSIVE — SMALL PHONE (≤ 400px)
  ================================================ */
  @media (max-width: 400px) {

    .dm-profile-preamble .dm-profile-contents {
      padding: 18px 16px 0;
      gap: 12px;
    }

    .dm-profile-image {
      width: 72px !important;
      height: 72px;
    }

    .dm-profile-preamble .dm-profile-activity > span:first-child {
      font-size: 20px !important;
    }

    .dm-profile-preamble .dm-profile-activity {
      font-size: 12px;
    }

    .dm-profile-preamble .dm-profile-activity::before {
      font-size: 9px;
      letter-spacing: 0.14em;
    }

    #dm-web-profile-root .dm-profile-sections .dm-profile-contents > * {
      width: calc(100% - 24px);
    }

    #dm-web-profile-root .dm-profile-sections .dm-profile-activity {
      font-size: 13px;
      padding: 9px 0;
    }
  }

  /* ================================================
     FORMATTED ENTRY BLOCKS
     Injected by formatJsonActivities() / processActivityList()
     Matches UTA-style: colored subgroup headings + bullet lists
  ================================================ */

  /* Wrapper div that holds one group's heading + ul */
  #dm-web-profile-root .twu-entries-formatted {
    margin: 0;
    padding: 0;
  }

  /* Subgroup heading — e.g. "Journal Article", "College", "Department" */
  #dm-web-profile-root .twu-subgroup-heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--maroon);
    margin: 20px 0 8px;
    padding: 0;
    border: none;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
  }

  #dm-web-profile-root .twu-entries-formatted:first-child .twu-subgroup-heading:first-child {
    margin-top: 4px;
  }

  /* Bullet list of entries under each subgroup */
  #dm-web-profile-root .twu-entry-list {
    list-style: none !important;
    padding-left: 18px !important;
    margin: 0 0 16px !important;
  }

  #dm-web-profile-root .twu-entry-list li {
    font-size: 1.0625rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 10px !important;
    padding: 0 0 0 10px !important;
    display: block !important;
    position: relative;
  }

  /* Pseudo-element bullet — immune to list-style overrides */
  #dm-web-profile-root .twu-entry-list li::before {
    content: '\2022';
    position: absolute;
    left: -4px;
    top: 0;
    color: var(--maroon);
    font-size: 14px;
    line-height: 1.6;
  }

  /* em inside entries = journal/venue name, matches UTA italic journal style */
  #dm-web-profile-root .twu-entry-list li em {
    font-style: italic;
  }

  /* strong inside entries = bold title */
  #dm-web-profile-root .twu-entry-list li strong {
    font-weight: 600;
  }

  /* Watermark activity-group headings (e.g. "Published", "In Press")
     styled to match .twu-subgroup-heading */
  #dm-web-profile-root .dm-profile-sections .dm-profile-heading--level-3 {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--maroon) !important;
    margin: 20px 0 8px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.3 !important;
  }

  /* Links inside formatted entry lists */
  #dm-web-profile-root .twu-entry-list li a {
    color: var(--maroon);
    text-decoration: underline !important;
    word-break: break-all;
  }
  #dm-web-profile-root .twu-entry-list li a:hover { color: var(--gold); }

  /* Legacy classes kept for safety — hidden since new renderer doesn't use them */
  #dm-web-profile-root .twu-entry-title,
  #dm-web-profile-root .twu-entry-meta,
  #dm-web-profile-root .twu-entry-detail {
    display: none;
  }
