    /* ============================================================ base */
    .p3-body { margin: 0; background: var(--paper); color: var(--ink); }
    .p3-shell { max-width: 1200px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 36px); }

    /* ============================================================ top bar */
    .p3-bar { border-bottom: 1px solid var(--line); background: var(--paper); }
    .p3-bar-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      min-height: 64px;
    }
    .p3-bar-logo {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: var(--ink);
      font-weight: 800;
      font-size: 16.5px;
      letter-spacing: -.01em;
      text-decoration: none;
    }
    .p3-bar-url {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      min-height: 44px;
      padding: 0 15px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #fff;
      color: var(--muted);
      font: inherit;
      font-size: 12.5px;
      font-weight: 700;
      cursor: pointer;
      transition: border-color .15s ease, color .15s ease;
    }
    .p3-bar-url strong { color: var(--ink); font-weight: 800; }
    .p3-bar-url .ic { width: 14px; height: 14px; color: var(--green); }
    .p3-bar-url:hover { border-color: rgba(17,19,15,.3); color: var(--ink); }

    /* ============================================================ profile head */
    .p3-head { padding: clamp(24px, 4vw, 44px) 0 clamp(20px, 3vw, 32px); }
    .p3-head-card {
      display: flex;
      align-items: flex-start;
      gap: clamp(20px, 3.5vw, 40px);
      padding: clamp(20px, 3.5vw, 36px);
      border: 1px solid var(--line);
      border-radius: 22px;
      background: #fff;
      box-shadow: 0 14px 44px rgba(17,19,15,.07);
    }
    .p3-avatar {
      flex: 0 0 auto;
      width: clamp(104px, 12vw, 148px);
      height: clamp(104px, 12vw, 148px);
      border-radius: 50%;
      object-fit: cover;
      object-position: 50% 27%;
      border: 4px solid #fff;
      outline: 1px solid var(--line);
      box-shadow: 0 10px 30px rgba(17,19,15,.14);
    }
    .p3-head-main { flex: 1; min-width: 0; }
    .p3-head-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
    }
    .p3-name-block h1 {
      margin: 0;
      font-family: var(--pm-serif);
      font-weight: 480;
      font-size: clamp(28px, 3.4vw, 40px);
      line-height: 1.05;
      letter-spacing: -.02em;
    }
    .p3-handle {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px 12px;
      margin: 8px 0 0;
      font-size: 13.5px;
    }
    .p3-handle b { color: var(--green); font-weight: 800; }
    .p3-handle span { color: var(--muted); font-weight: 600; }
    .p3-head-actions { display: flex; gap: 10px; }
    .p3-head-actions .dash-btn { min-height: 44px; border-radius: 999px; padding-inline: 20px; }
    .p3-bio { margin: 16px 0 0; max-width: 660px; color: #42483f; font-size: 15px; line-height: 1.65; }
    .p3-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0; }
    .p3-meta span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
    .p3-meta .ic { width: 15px; height: 15px; color: var(--green); }

    .p3-head-foot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      flex-wrap: wrap;
      margin-top: 20px;
      padding-top: 20px;
      border-top: 1px solid var(--line);
    }
    .p3-stats { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
    .p3-stats div { display: flex; flex-direction: column; gap: 1px; }
    .p3-stats strong { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
    .p3-stats span { color: var(--muted); font-size: 12px; font-weight: 700; }
    .p3-socials { display: flex; gap: 8px; }
    /* profile.php renders these as <a>, so anchors had none of this and the
       social icons showed as bare 17px glyphs with no circle. */
    .p3-socials button, .p3-socials a {
      width: 44px; height: 44px;
      text-decoration: none;
      display: grid; place-items: center;
      border: 1px solid var(--line);
      border-radius: 50%;
      background: #fff;
      color: #42483f;
      cursor: pointer;
      transition: transform .15s ease, border-color .15s ease, color .15s ease;
    }
    .p3-socials button:hover, .p3-socials a:hover { transform: translateY(-1px); border-color: var(--green); color: var(--green); }
    .p3-socials .ic { width: 17px; height: 17px; }

    /* ============================================================ tabs */
    .p3-tabs {
      position: sticky;
      top: 0;
      z-index: 30;
      display: flex;
      justify-content: center;
      gap: clamp(24px, 5vw, 56px);
      border-bottom: 1px solid var(--line);
      background: color-mix(in srgb, var(--paper) 90%, transparent);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
    .p3-tabs button {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin: 0;
      padding: 17px 4px;
      border: 0;
      background: none;
      color: var(--muted);
      font: inherit;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .1em;
      text-transform: uppercase;
      cursor: pointer;
      transition: color .15s ease;
    }
    .p3-tabs button .ic { width: 16px; height: 16px; }
    .p3-tabs button i {
      font-style: normal;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(17,19,15,.07);
      font-size: 11px;
    }
    .p3-tabs button::after {
      content: "";
      position: absolute;
      inset: auto 0 -1px;
      height: 2px;
      background: var(--green);
      transform: scaleX(0);
      transition: transform .25s var(--pm-ease);
    }
    .p3-tabs button:hover { color: var(--ink); }
    .p3-tabs button.active { color: var(--ink); border: 0; }
    .p3-tabs button.active i { background: #eef3e9; color: var(--green); }
    .p3-tabs button.active::after { transform: scaleX(1); }

    /* ============================================================ panels */
    .p3-panel { display: none; padding: clamp(26px, 4vw, 40px) 0 clamp(56px, 7vw, 88px); }
    .p3-panel.active { display: block; animation: p3-panel-in .3s var(--pm-ease); }
    @keyframes p3-panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

    /* ============================================================ portfolio grid */
    .p3-grid { columns: 280px; column-gap: 14px; }
    .p3-grid .pf-tile {
      position: relative;
      display: block;
      width: 100%;
      margin: 0 0 14px;
      padding: 0;
      border: 0;
      border-radius: 14px;
      overflow: hidden;
      break-inside: avoid;
      background: #e7e3da;
      cursor: zoom-in;
    }
    .p3-grid .pf-tile img {
      width: 100%;
      height: auto;
      display: block;
      transition: transform .7s var(--pm-ease);
    }
    .p3-grid .pf-tile::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(0deg, rgba(17,19,15,.42), rgba(17,19,15,0) 40%);
      opacity: 0;
      transition: opacity .3s ease;
    }
    .p3-grid .pf-tile:hover img { transform: scale(1.04); }
    .p3-grid .pf-tile:hover::after { opacity: 1; }
    .p3-grid .pf-tile-meta {
      position: absolute;
      left: 12px;
      bottom: 12px;
      inset-inline-end: auto;
      top: auto;
      z-index: 1;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 7px 13px;
      border-radius: 999px;
      background: rgba(255,255,255,.92);
      color: var(--ink);
      font-size: 12.5px;
      font-weight: 800;
      opacity: 0;
      transform: translateY(6px);
      transition: opacity .25s ease, transform .25s var(--pm-ease);
    }
    .p3-grid .pf-tile:hover .pf-tile-meta { opacity: 1; transform: none; }
    .p3-grid .pf-tile-meta .ic { width: 14px; height: 14px; color: #c2453a; }

    /* ============================================================ about */
    .p3-about {
      display: grid;
      grid-template-columns: .8fr 1.2fr;
      gap: clamp(28px, 5vw, 64px);
      align-items: start;
      padding: clamp(22px, 3.5vw, 40px);
      border: 1px solid var(--line);
      border-radius: 22px;
      background: #fff;
      box-shadow: var(--pm-ring);
    }
    /* T6/T14: no about photo -> text-only, but the card keeps the SAME full
       width as the with-photo version; only the copy's line length is capped. */
    .p3-about.no-portrait { grid-template-columns: 1fr; }
    .p3-about.no-portrait .p3-about-copy { max-width: 720px; }
    .p3-about-portrait { overflow: hidden; border-radius: 16px; aspect-ratio: 4 / 5; }
    .p3-about-portrait img { width: 100%; height: 100%; object-fit: cover; }
    .p3-about-copy h2 {
      margin: 0 0 18px;
      font-family: var(--pm-serif);
      font-weight: 480;
      font-size: clamp(26px, 3vw, 38px);
      line-height: 1.12;
      letter-spacing: -.02em;
      color: var(--ink);
    }
    .p3-about-copy p { margin: 0 0 16px; color: #42483f; font-size: 16px; line-height: 1.72; }
    .p3-about-copy p:last-child { margin-bottom: 0; }

    /* ============================================================ contact */
    .p3-contact { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(20px, 3vw, 28px); align-items: stretch; }
    .p3-card {
      padding: clamp(22px, 3.5vw, 36px);
      border: 1px solid var(--line);
      border-radius: 22px;
      background: #fff;
      box-shadow: var(--pm-ring);
    }
    .p3-contact-form h2 {
      margin: 0 0 8px;
      font-family: var(--pm-serif);
      font-weight: 480;
      font-size: clamp(24px, 2.6vw, 32px);
      letter-spacing: -.02em;
    }
    .p3-contact-form > p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
    .p3-contact-form label { display: block; margin-top: 14px; font-size: 13px; font-weight: 700; color: #42483f; }
    .p3-field {
      width: 100%;
      margin-top: 7px;
      min-height: 48px;
      padding: 12px 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
      color: var(--ink);
      font: inherit;
      font-size: 14px;
    }
    textarea.p3-field { min-height: auto; resize: vertical; }
    .p3-field:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(48,71,32,.13); }
    .p3-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .p3-contact-form .dash-btn { margin-top: 18px; min-height: 50px; border-radius: 999px; padding-inline: 24px; }
    .p3-contact-info { display: flex; flex-direction: column; }
    .p3-contact-info h3 { margin: 0 0 16px; font-size: 17px; font-weight: 800; }
    .p3-contact-info ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
    .p3-contact-info li { display: flex; align-items: center; gap: 13px; }
    .p3-contact-info li i {
      flex: 0 0 auto;
      width: 40px; height: 40px;
      display: grid; place-items: center;
      border-radius: 11px;
      background: #eef3e9;
      color: var(--green);
    }
    .p3-contact-info li .ic { width: 18px; height: 18px; }
    .p3-contact-info li span { display: flex; flex-direction: column; font-size: 14px; color: #42483f; }
    .p3-contact-info li strong { color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .p3-contact-note {
      /* The form note is a <small> (inline by default): without display:block
         it wraps beside the submit button and the padded background shatters
         across line boxes (the PR4 misalignment). */
      display: block;
      margin: 22px 0 0;
      padding: 14px 16px;
      border-radius: 13px;
      background: var(--paper);
      color: var(--muted);
      font-size: 12.5px;
      line-height: 1.55;
    }
    .p3-contact-note b { color: var(--ink); }

    /* ============================================================ footer */
    .p3-foot { border-top: 1px solid var(--line); }
    .p3-foot-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      flex-wrap: wrap;
      /* padding-block only — the old shorthand zeroed .p3-shell's inline padding */
      padding-block: 24px;
    }
    .p3-foot-name { font-family: var(--pm-serif); font-weight: 480; font-size: 16px; }
    .p3-foot-made { color: var(--muted); font-size: 12.5px; }

    /* ============================================================ responsive */
    @media (max-width: 900px) {
      .p3-about { grid-template-columns: 1fr; }
      .p3-about-portrait { aspect-ratio: 3 / 2; }
      .p3-contact { grid-template-columns: 1fr; }
    }
    @media (max-width: 720px) {
      .p3-bar-url span { display: none; }
      .p3-head-card { flex-direction: column; align-items: center; text-align: center; }
      .p3-head-top { flex-direction: column; align-items: center; }
      .p3-handle { justify-content: center; }
      .p3-meta { justify-content: center; }
      .p3-head-foot { flex-direction: column; }
      /* Keep tab labels on phones — icon-only tabs are unguessable. */
      /* Left-aligned with a hidden-scrollbar overflow: a centred row that
         doesn't quite fit clips both edges and can't be scrolled back. */
      .p3-tabs { gap: 10px; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
      .p3-tabs::-webkit-scrollbar { display: none; }
      .p3-tabs button { gap: 5px; padding-inline: 5px; font-size: 10.5px; letter-spacing: .04em; white-space: nowrap; }
      .p3-tabs button .ic { width: 14px; height: 14px; }
      .p3-field-row { grid-template-columns: 1fr; }
    }
    /* Phone-width: drop the tab icons so all four labelled tabs fit without
       scrolling (labels beat icons — icon-only tabs are unguessable). */
    @media (max-width: 440px) {
      .p3-tabs button .ic { display: none; }
    }
    @media (prefers-reduced-motion: reduce) {
      .p3-panel.active { animation: none; }
      .p3-grid .pf-tile img { transition: none; }
    }

    /* Not-yet-filled values still hold their real position, so the layout being
       edited is the layout that publishes — the text is just visibly a prompt. */
    .p3-unset { color: #9a9689; font-style: italic; font-weight: 400; }

    /* Embedded in the dashboard: the shell's page gutter is the dashboard's job,
       and doubling it wasted most of a phone's width. */
    .p3-embed .p3-shell { padding-inline: 0; }
    .p3-embed .p3-head { padding-top: 14px; }
    @media (max-width: 700px) {
      .p3-embed .p3-head-card { padding: 16px; }
      .p3-embed .p3-panel { padding-top: 16px; }
    }

    /* Portfolio editing in place (owner, framed only). */
    .p3-drop {
      display: block;
      margin-bottom: 16px;
      padding: 22px 16px;
      border: 1.5px dashed rgba(17,19,15,.22);
      border-radius: 16px;
      background: #fff;
      text-align: center;
      cursor: pointer;
      transition: border-color .15s ease, background .15s ease;
    }
    .p3-drop:hover, .p3-drop:focus-visible, .p3-drop.is-over { border-color: var(--green); background: #f7faf4; outline: none; }
    .p3-drop strong { display: block; font-size: 14.5px; }
    .p3-drop small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
    .p3-drop-status { margin: -8px 0 14px; color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: center; }
    .p3-tile-x {
      position: absolute;
      top: 8px; right: 8px;
      z-index: 2;
      width: 30px; height: 30px;
      display: grid; place-items: center;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: rgba(17,19,15,.62);
      color: #fff;
      cursor: pointer;
      opacity: 0;
      transition: opacity .15s ease, background .15s ease;
    }
    .p3-tile-x .ic { width: 15px; height: 15px; }
    .pf-tile:hover .p3-tile-x, .p3-tile-x:focus-visible { opacity: 1; }
    .p3-tile-x:hover { background: #b23b3b; }
    /* Touch has no hover, so the control has to be there from the start. */
    @media (pointer: coarse) { .p3-tile-x { opacity: 1; } }

    /* Embedded: the shell gutter is the dashboard's job, but the footer has no
       card of its own, so without this its text sat flush to the frame edge. */
    .p3-embed .p3-foot-inner { padding-inline: 14px; }

    /* Framed and measured: the parent grows the iframe to fit, so our own
       scrollbar would be a second, wrong one. Applied only after the first
       height report — without JS the page still scrolls normally. */
    .p3-embed.p3-embed-sized { overflow-y: hidden; }
