/* Profile & Brand (Imprint). Scoped under #profileView so the legacy
   .field/.submit-btn/.form-card rules used by the old tool forms stay
   untouched. */

/* The legacy rule in index.html sets max-width:500px + margin/padding on
   #profileView for the old narrow form. Reset all of it explicitly. */
#profileView {
  max-width: none;
  margin: 0;
  padding: 0;
  animation: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--ivory);
  color: var(--l-ink);
  min-height: 100vh;
}

#profileView .pf-wrap { max-width: 1280px; margin: 0 auto; padding: 58px 40px 150px; }

#profileView .pf-top { margin-bottom: 56px; }
#profileView .pf-back {
  font-size: 12.5px; font-weight: 600; color: var(--l-mid); background: none; border: none;
  padding: 0; margin-bottom: 18px; display: block; cursor: pointer; font-family: inherit;
}
#profileView .pf-back:hover { color: var(--coral-d); }
#profileView .pf-title {
  font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
  font-size: 4.4rem; line-height: .98; letter-spacing: -.02em; color: var(--l-ink); margin: 0;
}
#profileView .pf-title em { font-style: italic; color: var(--coral); }

#profileView .pf-grid {
  display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
  gap: 74px; align-items: start;
}

/* living artifact */
#profileView .pf-sticky { position: sticky; top: 36px; }
#profileView .pf-card {
  background: #fff; border-radius: 4px; overflow: hidden;
  box-shadow: 0 44px 90px rgba(15,15,13,.22), 0 4px 10px rgba(15,15,13,.06);
}
#profileView .pf-bands { display: flex; height: 14px; }
#profileView .pf-bands i { flex: 1; transition: background .3s; }
#profileView .pf-cardbody { padding: 34px 34px 30px; }
#profileView .pf-chead { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
#profileView .pf-cphoto {
  width: 78px; height: 78px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--ivory3);
}
#profileView .pf-cname { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.85rem; line-height: 1.02; }
#profileView .pf-crole {
  font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--l-mid); margin-top: 6px;
}
#profileView .pf-crule { height: 1px; background: var(--ivory3); margin-bottom: 22px; }
#profileView .pf-cspec {
  font-family: 'Instrument Serif', Georgia, serif; font-size: 1.24rem; line-height: 1.46;
  color: var(--l-ink2); margin-bottom: 22px; min-height: 92px; transition: opacity .2s;
}
#profileView .pf-cspec.pf-fade { opacity: .2; }
#profileView .pf-cmeta { display: flex; flex-wrap: wrap; gap: 4px 15px; font-size: 11.5px; color: var(--l-mid); }
#profileView .pf-cfoot {
  margin: 26px -34px -30px; padding: 15px 34px; display: flex; justify-content: space-between;
  align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #fff; transition: background .3s;
}
#profileView .pf-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11.5px; color: var(--l-mid); margin-top: 18px;
}
#profileView .pf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); animation: pfPulse 2s infinite; }
@keyframes pfPulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* chapters */
#profileView .pf-chapter { margin-bottom: 64px; }
#profileView .pf-chnum { display: flex; align-items: baseline; gap: 16px; margin-bottom: 30px; }
#profileView .pf-chnum span { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.5rem; color: var(--coral); line-height: 1; }
#profileView .pf-chnum h3 { font-family: 'Instrument Serif', Georgia, serif; font-size: 2.1rem; font-weight: 400; line-height: 1; margin: 0; color: var(--l-ink); }

#profileView .pf-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 34px; }
#profileView .pf-f { margin-bottom: 28px; }
#profileView .pf-f label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--l-mid); margin-bottom: 10px;
}
#profileView .pf-f input, #profileView .pf-f textarea {
  width: 100%; border: none; border-bottom: 1.5px solid var(--ivory3); background: transparent;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 17px; color: var(--l-ink);
  padding: 6px 0 11px; outline: none; transition: border-color .18s; border-radius: 0;
}
#profileView .pf-f input:focus, #profileView .pf-f textarea:focus { border-bottom-color: var(--coral); box-shadow: none; }
#profileView .pf-f input::placeholder { color: #B9B4AA; }
#profileView .pf-opt { font-weight: 500; letter-spacing: 0; text-transform: none; color: #B9B4AA; font-size: 11px; margin-left: 6px; }

#profileView .pf-photorow { display: flex; align-items: center; gap: 20px; margin-bottom: 34px; }
#profileView .pf-photobig {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  position: relative; flex-shrink: 0; cursor: pointer;
}
#profileView .pf-photobig::after {
  content: 'Replace'; position: absolute; inset: 0; background: rgba(11,31,16,.62); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  opacity: 0; transition: opacity .18s;
}
#profileView .pf-photobig:hover::after { opacity: 1; }
#profileView .pf-photocopy { font-size: 13px; color: var(--l-mid); line-height: 1.6; }
#profileView .pf-photocopy b { display: block; color: var(--l-ink); font-size: 14px; margin-bottom: 3px; }
#profileView .pf-textbtn {
  background: none; border: none; padding: 0; margin-top: 6px; font-family: inherit;
  font-size: 12px; font-weight: 600; color: var(--coral-d); cursor: pointer;
}
#profileView .pf-textbtn:hover { text-decoration: underline; }

#profileView .pf-drop {
  border: 1.5px dashed var(--ivory3); border-radius: 3px; padding: 22px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--l-mid); cursor: pointer; transition: all .16s;
}
#profileView .pf-drop:hover { border-color: var(--coral); color: var(--coral-d); background: rgba(255,75,59,.03); }
#profileView .pf-drop small { display: block; font-weight: 500; color: #B9B4AA; font-size: 11.5px; margin-top: 4px; }

/* 02 Your style */
#profileView .pf-style {
  background: var(--forest); border-radius: 20px; padding: 44px 42px 40px;
  margin-bottom: 64px; color: var(--ivory);
}
#profileView .pf-style .pf-chnum { margin-bottom: 8px; }
#profileView .pf-style .pf-chnum span { color: var(--coral-l); }
#profileView .pf-style .pf-chnum h3 { color: var(--ivory); }
#profileView .pf-style-sub { font-size: 14px; color: rgba(245,242,233,.5); margin-bottom: 32px; }

#profileView .pf-words { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 38px; }
#profileView .pf-word {
  font-family: 'Instrument Serif', Georgia, serif; font-size: 2.5rem; line-height: 1.06;
  background: none; border: none; padding: 0; cursor: pointer; position: relative;
  color: rgba(245,242,233,.26); transition: color .18s;
}
#profileView .pf-word:hover { color: rgba(245,242,233,.62); }
#profileView .pf-word.pf-on { color: var(--coral-l); }
#profileView .pf-word.pf-on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px;
  height: 2px; background: var(--coral); border-radius: 2px;
}

#profileView .pf-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 34px; align-items: start; }
#profileView .pf-style label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: rgba(245,242,233,.5); margin-bottom: 12px;
}
#profileView .pf-style textarea {
  width: 100%; background: rgba(0,0,0,.2); border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 16px 18px; color: var(--ivory);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14.5px; line-height: 1.6;
  min-height: 132px; resize: vertical; outline: none;
}
#profileView .pf-style textarea:focus { border-color: var(--coral-l); box-shadow: none; }
#profileView .pf-style textarea::placeholder { color: rgba(245,242,233,.3); }
#profileView .pf-dropdark {
  border: 1.5px dashed rgba(255,255,255,.2); border-radius: 12px; padding: 18px; text-align: center;
  color: rgba(245,242,233,.6); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .16s;
}
#profileView .pf-dropdark:hover { border-color: var(--coral-l); color: var(--coral-l); }
#profileView .pf-tiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin-top: 11px; }
#profileView .pf-tile {
  aspect-ratio: 3/4; border-radius: 8px; position: relative; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column;
  justify-content: flex-end; padding: 9px; cursor: pointer;
}
#profileView .pf-tile:hover { border-color: rgba(255,255,255,.32); }
#profileView .pf-tile b { font-size: 9px; color: rgba(245,242,233,.8); font-weight: 600; line-height: 1.3; word-break: break-word; }
#profileView .pf-tlines { position: absolute; left: 9px; right: 9px; top: 11px; display: flex; flex-direction: column; gap: 4px; }
#profileView .pf-tlines i { height: 2px; background: rgba(255,255,255,.16); border-radius: 99px; }
#profileView .pf-tile-link {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 9px; text-decoration: none; color: inherit;
}
#profileView .pf-tile-link:hover b { text-decoration: underline; }
#profileView .pf-tile-x {
  z-index: 2;
  position: absolute; top: 5px; right: 6px; background: none; border: none; cursor: pointer;
  color: rgba(245,242,233,.55); font-size: 15px; line-height: 1; padding: 2px 4px;
}
#profileView .pf-tile-x:hover { color: #fff; }

/* file buckets, rendered by JS once the endpoints answer */
#profileView .pf-dropzone-off {
  border: 1.5px dashed var(--ivory3); border-radius: 3px; padding: 20px; text-align: center;
  font-size: 12.5px; font-weight: 600; color: var(--l-mid); opacity: .55; cursor: default;
}
#profileView .pf-style .pf-dropzone-off {
  border-color: rgba(255,255,255,.18); color: rgba(245,242,233,.5); border-radius: 12px;
}
#profileView .pf-adddrop {
  border: 1.5px dashed var(--ivory3); border-radius: 3px; padding: 20px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--l-mid); cursor: pointer; transition: all .16s;
}
#profileView .pf-adddrop:hover { border-color: var(--coral); color: var(--coral-d); background: rgba(255,75,59,.03); }
#profileView .pf-style .pf-adddrop {
  border-color: rgba(255,255,255,.2); border-radius: 12px; padding: 18px; color: rgba(245,242,233,.6);
}
#profileView .pf-style .pf-adddrop:hover { border-color: var(--coral-l); color: var(--coral-l); background: transparent; }
#profileView .pf-cap { font-size: 11.5px; color: var(--l-mid); margin-top: 8px; }
#profileView .pf-style .pf-cap { color: rgba(245,242,233,.5); }

/* light-surface variant of the document tile, for the templates bucket */
#profileView .pf-f .pf-tile { background: #fff; border-color: var(--ivory3); }
#profileView .pf-f .pf-tile b { color: var(--l-ink2); }
#profileView .pf-f .pf-tlines i { background: var(--ivory3); }
#profileView .pf-f .pf-tile-x { color: var(--l-mid); }
#profileView .pf-f .pf-tile-x:hover { color: var(--coral-d); }

/* 03 Your look */
#profileView .pf-swrow { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
#profileView .pf-slot { position: relative; }
#profileView .pf-plate {
  width: 100%; height: 118px; border-radius: 3px; border: none; padding: 0; display: block;
  cursor: pointer; transition: transform .18s, box-shadow .18s;
}
#profileView .pf-slot:hover .pf-plate { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(15,15,13,.2); }
#profileView .pf-sname {
  font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--l-mid); margin-top: 12px;
}
#profileView .pf-shex { font-size: 13px; color: var(--l-ink2); margin-top: 2px; }
#profileView .pf-pop {
  display: none; position: absolute; top: calc(100% + 10px); left: 0; width: 326px; background: #fff;
  border: 1px solid var(--ivory3); border-radius: 4px; box-shadow: 0 26px 60px rgba(15,15,13,.22);
  padding: 16px; z-index: 40;
}
#profileView .pf-pop.pf-open { display: block; }
#profileView .pf-pop.pf-up { top: auto; bottom: calc(100% + 10px); }
#profileView .pf-slot:last-child .pf-pop { left: auto; right: 0; }
#profileView .pf-popfam {
  font-size: 9.5px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--l-mid); margin-bottom: 9px;
}
#profileView .pf-spectrum { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; margin-bottom: 14px; }
#profileView .pf-spectrum i { aspect-ratio: 1; border-radius: 2px; cursor: pointer; transition: transform .1s; }
#profileView .pf-spectrum i:hover { transform: scale(1.5); z-index: 2; position: relative; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px var(--l-ink); }
#profileView .pf-pophex { display: flex; gap: 8px; border-top: 1px solid var(--ivory2); padding-top: 13px; }
#profileView .pf-pophex input {
  flex: 1; border: 1.5px solid var(--ivory3); border-radius: 2px; padding: 8px 10px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; outline: none; background: #fff; color: var(--l-ink);
}
#profileView .pf-pophex input:focus { border-color: var(--coral); box-shadow: none; }
#profileView .pf-pophex button {
  background: var(--forest); border: none; color: var(--ivory); font-family: inherit;
  font-size: 12px; font-weight: 700; padding: 9px 15px; border-radius: 2px; cursor: pointer;
}
#profileView .pf-extract {
  width: 100%; margin-top: 20px; background: transparent; border: 1.5px dashed var(--ivory3);
  color: var(--l-mid); font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 14px; border-radius: 3px; cursor: pointer; transition: all .16s;
}
#profileView .pf-extract:hover { border-color: var(--coral); color: var(--coral-d); background: rgba(255,75,59,.03); }

/* the logo library, sharing the chapter with the colour plates because a mark
   and a palette are the same decision */
#profileView .pf-logowrap { margin-top: 52px; }
#profileView .pf-logolede {
  font-size: 13px; color: var(--l-mid); line-height: 1.5; margin: 0 0 4px; max-width: 62ch;
}
/* Same columns and gap as .pf-swrow above it, so a logo tile sits exactly
   under a colour plate rather than a few pixels off it. */
#profileView .pf-logos {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin-top: 13px;
}
#profileView .pf-logo {
  position: relative; background: #fff; border: 1px solid var(--ivory3); border-radius: 3px;
  padding: 13px; transition: border-color .16s;
}
#profileView .pf-logo:hover { border-color: #D8D2C6; }
/* White and a fixed height on purpose: same idea as the renderer, which drops
   each logo into a fixed-height box, so a squat mark and a wide wordmark sit
   together here the way they will in the header. Not pixel-identical -- the
   tile is narrower than a report header, so a very wide mark runs out of width
   before it runs out of height -- but it answers "will these look right side by
   side", which is the question an agent has. */
#profileView .pf-logo-box {
  height: 86px; display: flex; align-items: center; justify-content: center;
  background: #fff; margin-bottom: 12px;
}
#profileView .pf-logo-img { max-height: 100%; max-width: 100%; object-fit: contain; display: block; }
#profileView .pf-logo-broken .pf-logo-img { display: none; }
#profileView .pf-logo-broken::after {
  content: 'Preview unavailable'; font-size: 11px; color: var(--l-mid); opacity: .7;
}
#profileView .pf-logo-pos {
  font-size: 9.5px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--l-mid);
}
#profileView .pf-logo b {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--l-ink2); line-height: 1.35;
  margin-top: 3px; word-break: break-word;
}
#profileView .pf-logo-move { display: flex; gap: 6px; margin-top: 11px; }
#profileView .pf-logo-move button {
  flex: 1; background: transparent; border: 1px solid var(--ivory3); border-radius: 2px;
  color: var(--l-ink2); font-family: inherit; font-size: 13px; line-height: 1;
  padding: 6px 0; cursor: pointer; transition: all .16s;
}
#profileView .pf-logo-move button:hover:not(:disabled) { border-color: var(--coral); color: var(--coral-d); }
#profileView .pf-logo-move button:disabled { opacity: .28; cursor: default; }
#profileView .pf-logo-order { margin-top: 3px; }

/* 04 Password, deliberately the quietest chapter */
#profileView .pf-pass-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
#profileView .pf-passbtn {
  margin-top: 6px; background: transparent; border: 1.5px solid var(--ivory3); color: var(--l-ink2);
  font-family: inherit; font-size: 13px; font-weight: 600; padding: 11px 22px;
  border-radius: 99px; cursor: pointer; transition: all .16s;
}
#profileView .pf-passbtn:hover { border-color: var(--forest); color: var(--forest); }

#profileView .pf-err {
  display: none; background: rgba(255,75,59,.08); border: 1px solid rgba(255,75,59,.25);
  color: var(--coral-d); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}

/* save bar */
#profileView .pf-savebar {
  position: fixed; bottom: 0; left: 0; right: 0; background: rgba(11,31,16,.97);
  backdrop-filter: blur(10px); padding: 15px 40px; display: flex; align-items: center;
  justify-content: space-between; z-index: 100;
}
#profileView .pf-savebar p { color: rgba(245,242,233,.7); font-size: 13px; margin: 0; }
#profileView .pf-savebar div { display: flex; gap: 10px; }
#profileView .pf-ghost {
  background: transparent; border: 1.5px solid rgba(245,242,233,.25); color: rgba(245,242,233,.8);
  font-family: inherit; font-size: 13px; font-weight: 600; padding: 10px 20px; border-radius: 99px; cursor: pointer;
}
#profileView .pf-primary {
  background: var(--coral); border: none; color: #fff; font-family: inherit;
  font-size: 13px; font-weight: 700; padding: 11px 26px; border-radius: 99px; cursor: pointer;
}
#profileView .pf-primary:hover { background: var(--coral-d); }

@media (max-width: 1080px) {
  #profileView .pf-grid { grid-template-columns: 1fr; gap: 44px; }
  #profileView .pf-sticky { position: static; }
  #profileView .pf-wrap { padding: 40px 22px 140px; }
  #profileView .pf-row, #profileView .pf-split, #profileView .pf-pass-row { grid-template-columns: 1fr; gap: 0; }
  #profileView .pf-split > div:first-child { margin-bottom: 28px; }
  #profileView .pf-title { font-size: 3rem; }
  #profileView .pf-word { font-size: 2rem; }
  #profileView .pf-style { padding: 32px 24px; }
  #profileView .pf-savebar { padding: 14px 22px; }
  /* Stays three across, like the colour plates above it: at three items the
     row is the order, and stacking would lose that. Just tighter. The gap is
     left alone so the tiles keep tracking the plates. */
  #profileView .pf-logo { padding: 9px; }
  #profileView .pf-logo-box { height: 58px; margin-bottom: 9px; }
  #profileView .pf-logo-move { gap: 4px; margin-top: 8px; }
}
