/* Personal page: public profile first, existing creator tools stay in edit mode. */
.dashboard-content {
  min-height: calc(100vh - 136px);
  padding-bottom: 72px;
}
.profile-view-mode {
  width: min(100%, 860px);
  margin: 26px auto 0;
}
.profile-page { padding: 48px 0 80px; }
.profile-page .public-card { width: min(calc(100% - 32px), 860px); }
.profile-view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}
.profile-view-heading h1 {
  margin: 20px 0 10px;
  font: 900 clamp(2.8rem, 6vw, 5.4rem)/.98 "Noto Serif TC", serif;
  letter-spacing: -.055em;
}
.profile-view-heading p { margin: 0; max-width: 500px; color: var(--muted); }
.profile-view-heading .button { flex: 0 0 auto; }
.profile-public-card {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 34px 10px 34px 10px;
  background: #fffefa;
  box-shadow: 12px 12px 0 var(--ink);
}
.profile-public-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 126px;
  padding: 24px 28px;
  background:
    radial-gradient(circle at 78% 35%, transparent 0 42px, var(--acid) 43px 45px, transparent 46px),
    var(--ink);
  color: var(--acid);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .1em;
}
.profile-public-banner strong {
  padding: 8px 12px;
  background: var(--acid);
  color: var(--ink);
  transform: rotate(4deg);
  letter-spacing: 0;
}
.profile-public-body { padding: 0 clamp(24px, 5vw, 48px) 34px; }
.profile-public-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: -48px;
}
.profile-public-head > div:last-child { min-width: 0; }
.profile-public-avatar {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background-color: var(--acid);
  background-position: center;
  background-size: cover;
  color: var(--ink);
  font: 900 2.8rem/1 "Noto Serif TC", serif;
  box-shadow: 0 0 0 8px #fffefa;
  overflow: hidden;
}
.profile-public-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile-public-head h1,
.profile-public-head h2 { margin: 38px 0 2px; font: 900 clamp(1.9rem, 4vw, 3rem)/1.05 "Noto Serif TC", serif; }
.profile-public-head p { margin: 0; color: var(--muted); font: 700 .92rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.profile-public-bio { max-width: 700px; margin: 30px 0 24px; font-size: 1.08rem; white-space: pre-wrap; }
.profile-public-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #b9be8a;
  border-radius: 14px;
  background: #f2f7b7;
}
.profile-public-status::before { content: ""; width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); }
.profile-public-status.is-ready::before { background: #32723a; }
.profile-public-status span { min-width: 0; color: #41452f; font-size: .9rem; overflow-wrap: anywhere; }
.profile-public-section { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.profile-public-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.profile-public-section-heading h2 { margin: 12px 0 0; font: 900 clamp(1.45rem, 3vw, 2rem)/1.15 "Noto Serif TC", serif; }
.profile-public-count { color: var(--muted); font-size: .82rem; font-weight: 800; white-space: nowrap; }
.profile-public-accounts { display: grid; gap: 10px; margin-top: 18px; }
.profile-public-account {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f9f8f1;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.profile-public-account:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); background: #fff; }
.profile-public-account-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  font-size: .68rem;
  font-weight: 900;
}
.profile-public-account-icon.instagram { background: #c93665; }
.profile-public-account-icon.youtube { background: #c51f1f; }
.profile-public-account-content { display: grid; min-width: 0; }
.profile-public-account-content strong { font-size: .96rem; }
.profile-public-account-content span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.profile-public-account-content small { color: #32723a; font-size: .76rem; font-weight: 800; }
.profile-public-account-arrow { color: var(--muted); font-size: 1.2rem; }
.profile-public-empty { margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.profile-public-share {
  margin-top: 34px;
  padding: clamp(22px, 4vw, 32px);
  border-radius: 22px 7px 22px 7px;
  background: var(--ink);
  color: white;
}
.profile-public-share .eyebrow { border-color: rgba(255,255,255,.55); }
.profile-public-share h2 { margin: 14px 0 6px; font: 900 clamp(1.6rem, 3vw, 2.5rem)/1.1 "Noto Serif TC", serif; }
.profile-public-share p { margin: 0; color: rgba(255,255,255,.75); }
.profile-public-url-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 8px 8px 8px 16px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 13px;
  background: rgba(255,255,255,.08);
}
.profile-public-url-row code { min-width: 0; flex: 1 1 auto; color: var(--acid); font: 800 .9rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.profile-public-share .form-actions { flex-wrap: wrap; }
.profile-public-share .button:not(.primary) { border-color: rgba(255,255,255,.7); color: white; }
.profile-public-share .button:hover { box-shadow: 4px 4px 0 var(--acid); }
.profile-public-note { margin: 22px 2px 0; color: var(--muted); font-size: .86rem; }
.profile-owner-tools { margin-top: 22px; }
.profile-owner-tools .profile-public-share { margin-top: 0; }
.profile-public-subscription {
  margin-top: 34px;
  padding: clamp(22px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 22px 7px 22px 7px;
  background: #f7f6ef;
}
.profile-public-subscription .eyebrow { width: max-content; }
.profile-public-subscription h2 {
  margin: 14px 0 6px;
  font: 900 clamp(1.45rem, 3vw, 2.2rem)/1.1 "Noto Serif TC", serif;
}
.profile-public-subscription > p { margin: 0; color: var(--muted); }
.profile-public-subscription .subscription-form {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}
.profile-public-subscription .subscription-form .button { width: 100%; }
.profile-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0 24px;
}
.profile-editor-topbar p { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }

/* The editor follows the reviewed prototype: one page, one primary save action,
   and the public page itself is the only preview. */
.dashboard-editor {
  width: min(100%, 940px);
  margin: 26px auto 0;
  color: var(--ink);
}
.profile-editor-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}
.profile-editor-heading h1 {
  margin: 20px 0 10px;
  font: 900 clamp(2.5rem, 5.5vw, 4.8rem)/.98 "Noto Serif TC", serif;
  letter-spacing: -.055em;
}
.profile-editor-heading p { margin: 0; color: var(--muted); }
.profile-editor-heading-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 0 auto; }
.profile-editor-heading-actions .button { min-width: 132px; }
.profile-editor-heading-actions {
  position: sticky;
  top: 88px;
  z-index: 15;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(242, 240, 232, .94);
  box-shadow: 4px 4px 0 rgba(18, 19, 15, .12);
  backdrop-filter: blur(12px);
}
.profile-editor-heading-actions .editor-logout {
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}
.profile-editor-page {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 34px 10px 34px 10px;
  background: #fffefa;
  box-shadow: 12px 12px 0 var(--ink);
}
.profile-editor-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 126px;
  padding: 24px 40px;
  background:
    radial-gradient(circle at 78% 35%, transparent 0 42px, var(--acid) 43px 45px, transparent 46px),
    var(--ink);
  color: var(--acid);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .1em;
}
.profile-editor-banner strong {
  padding: 8px 12px;
  background: var(--acid);
  color: var(--ink);
  transform: rotate(4deg);
  letter-spacing: 0;
}
.profile-editor-form { padding: 40px; }
.profile-editor-identity {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 52px);
  align-items: start;
}
.profile-editor-avatar-column { display: grid; justify-items: center; text-align: center; }
.profile-editor-avatar {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 8px #fffefa;
}
.profile-editor-avatar-image,
.profile-editor-avatar-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-editor-avatar-placeholder {
  display: grid;
  place-items: center;
  color: var(--ink);
  font: 900 3.2rem/1 "Noto Serif TC", serif;
}
.avatar-action { margin-top: 20px; min-height: 42px; padding-inline: 15px; font-size: .84rem; }
.profile-editor-avatar-column .field-note { max-width: 150px; margin: 12px 0 0; line-height: 1.5; }
.profile-editor-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 18px;
}
.profile-editor-page .field { gap: 8px; margin-top: 0; }
.profile-editor-page .field label,
.profile-editor-page .section-label { font-size: .9rem; font-weight: 900; }
.profile-editor-page .field input,
.profile-editor-page .field textarea,
.profile-editor-page .field select {
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid rgba(18, 19, 15, .28);
  border-radius: 12px;
  background: #fffefa;
  color: var(--ink);
}
.profile-editor-page .field input:focus,
.profile-editor-page .field textarea:focus,
.profile-editor-page .field select:focus {
  border-color: var(--ink);
  outline: 3px solid rgba(255, 92, 53, .38);
  outline-offset: 2px;
}
.profile-editor-page .field-note,
.profile-editor-page .field-footer,
.profile-editor-page .editor-subheading span { color: var(--muted); font-size: .82rem; }
.profile-editor-page .field-note { margin: 0; }
.required-mark { color: var(--orange); font-size: .72rem; font-weight: 900; }
.field-error {
  min-height: 1.35em;
  margin: 0;
  color: #9c1b00;
  font-size: .82rem;
  font-weight: 800;
}
.field-error:empty { display: none; }
.profile-editor-page .field input[aria-invalid="true"] {
  border-color: #b83213;
  outline: 3px solid rgba(184, 50, 19, .18);
}
.field-with-prefix {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
}
.field-prefix {
  display: grid;
  place-items: center;
  border: 2px solid rgba(18, 19, 15, .28);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #f2f0e8;
  font-weight: 900;
}
.field-with-prefix input { border-radius: 0 12px 12px 0 !important; }
.profile-editor-bio {
  margin-top: 40px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.profile-editor-bio textarea { display: block; width: 100%; min-height: 136px !important; resize: vertical; line-height: 1.7; }
.profile-editor-field-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 9px;
}
.profile-editor-field-footer span:last-child { white-space: nowrap; }
.profile-editor-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 14px 16px;
  border: 1px solid #b9be8a;
  border-radius: 14px;
  background: #f2f7b7;
  color: #41452f;
  font-size: .9rem;
}
.profile-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: #244a28;
  font-weight: 900;
}
.profile-status-chip span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: #32723a;
  color: white;
  font-size: .75rem;
}
.profile-status-chip.is-saved { color: #244a28; }
.profile-status-chip.is-dirty {
  color: #8a2d18;
  background: #fff0ea;
  border-color: #d86b4e;
}
.profile-save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.profile-save-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.profile-save-actions > span { color: var(--muted); font-size: .84rem; }
.profile-save-bar [role="status"],
.account-bind-block [role="status"],
.manual-account-details [role="status"],
.profile-editor-safety [role="status"] { min-height: 1.5em; margin: 0; }
.profile-editor-section,
.profile-share-section {
  margin: 0 40px;
  padding: 38px 0;
  border-top: 1px solid var(--line);
}
.profile-editor-section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.profile-editor-section-heading h2 {
  margin: 14px 0 7px;
  font: 900 clamp(1.6rem, 3.3vw, 2.5rem)/1.1 "Noto Serif TC", serif;
  letter-spacing: -.035em;
}
.profile-editor-section-heading p { margin: 0; color: var(--muted); }
.section-number { color: var(--muted); font: 900 2.6rem/1 "Noto Serif TC", serif; opacity: .38; }
.editor-account-list { display: grid; gap: 10px; }
.editor-account-list:empty { display: none; }
.editor-account-list p {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f9f8f1;
}
.editor-account-list p a {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-account-list p::before {
  content: "@";
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  font-size: .82rem;
  font-weight: 900;
}
.account-bind-block {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7f6ef;
}
.editor-subheading { display: grid; gap: 2px; }
.editor-subheading strong { font-size: 1rem; }
.compact-field { max-width: 260px; margin-top: 16px !important; }
.editor-connect-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.editor-connect-grid .button { min-width: 0; padding-inline: 12px; }
.manual-account-details { margin-top: 18px; border-top: 1px solid var(--line); }
.manual-account-details summary { margin-top: 18px; font-weight: 900; }
.manual-account-details form { padding: 2px 10px 0; }
.manual-account-details h3 { margin: 22px 0 0; font-size: 1rem; }
.profile-share-section {
  margin-inline: 0;
  padding-inline: 40px;
  background: var(--ink);
  color: white;
}
.profile-share-section .eyebrow { border-color: rgba(255,255,255,.6); }
.profile-share-section .profile-editor-section-heading p,
.profile-share-note { color: rgba(255,255,255,.74); }
.profile-share-section .section-number { color: rgba(255,255,255,.62); }
.editor-public-url-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 13px;
  background: rgba(255,255,255,.08);
}
.editor-public-url-row code {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  color: var(--acid);
  font: 800 .9rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.profile-share-section .button:not(.primary) { border-color: rgba(255,255,255,.72); color: white; }
.profile-share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.profile-share-actions .button { flex: 1 1 150px; }
.profile-share-section .qr-panel { background: white; color: var(--ink); }
.profile-share-note { margin: 20px 2px 0; font-size: .86rem; }
.profile-editor-safety { padding-bottom: 46px; }
.profile-editor-safety .incident-card { margin-top: 24px; }
.profile-editor-safety .incident-list { margin-top: 22px; }
.profile-safety-details {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7f6ef;
}
.profile-safety-details summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}
.profile-safety-details summary::-webkit-details-marker { display: none; }
.profile-safety-details summary::after {
  content: "+";
  color: var(--orange);
  font-size: 1.35rem;
  line-height: 1;
}
.profile-safety-details[open] summary { border-bottom: 1px solid var(--line); }
.profile-safety-details[open] summary::after { content: "−"; }
.profile-safety-details > form { padding: 0 22px 22px; }
.profile-editor-safety .form-actions { flex-wrap: wrap; }
.profile-editor-page .form-actions { align-items: center; }
.profile-editor-page .error { color: #9c1b00; }
.profile-editor-page .success { color: #315d16; }

@media (max-width: 820px) {
  .profile-view-heading { align-items: start; flex-direction: column; }
  .profile-view-heading .button { width: 100%; }
  .profile-public-card { box-shadow: 7px 7px 0 var(--ink); }
  .profile-editor-topbar { align-items: start; flex-direction: column; }
  .profile-editor-topbar .button { width: 100%; }
  .profile-editor-heading { align-items: start; flex-direction: column; }
  .profile-editor-heading-actions { width: 100%; }
  .profile-editor-heading-actions .button { flex: 1 1 180px; }
  .profile-editor-fields { grid-template-columns: 1fr; }
  .editor-connect-grid { grid-template-columns: 1fr; }
  .profile-editor-form { padding: 30px; }
  .profile-editor-section, .profile-share-section { margin-inline: 30px; }
  .profile-share-section { margin-inline: 0; padding-inline: 30px; }
}
@media (max-width: 560px) {
  .dashboard-editor { margin-top: 18px; }
  .profile-editor-heading { margin-bottom: 24px; }
  .profile-editor-heading h1 { font-size: 2.7rem; }
  .profile-editor-heading-actions {
    top: 74px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .profile-editor-heading-actions #profile-top-save { grid-column: 1 / -1; grid-row: 1; }
  .profile-editor-heading-actions #return-profile-view { grid-column: 1; grid-row: 2; }
  .profile-editor-heading-actions #logout { grid-column: 2; grid-row: 2; }
  .profile-editor-heading-actions .button { min-width: 0; width: 100%; }
  .profile-editor-page { box-shadow: 7px 7px 0 var(--ink); }
  .profile-editor-banner { min-height: 104px; padding: 18px; }
  .profile-editor-form { padding: 24px 18px; }
  .profile-editor-identity { grid-template-columns: 1fr; gap: 28px; }
  .profile-editor-avatar-column { justify-items: start; text-align: left; }
  .profile-editor-avatar-column .field-note { max-width: 240px; }
  .profile-editor-bio { margin-top: 32px; padding-top: 28px; }
  .profile-editor-field-footer { align-items: start; flex-direction: column; gap: 4px; }
  .profile-editor-status { align-items: start; flex-direction: column; gap: 5px; }
  .profile-save-bar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .profile-save-actions { align-items: flex-start; flex-direction: column; gap: 8px; }
  .profile-editor-section, .profile-share-section { margin-inline: 18px; padding-block: 30px; }
  .profile-share-section { margin-inline: 0; padding-inline: 18px; }
  .profile-editor-section-heading { flex-direction: column; gap: 10px; }
  .section-number { display: none; }
  .editor-public-url-row { align-items: stretch; flex-direction: column; padding: 14px; }
  .editor-public-url-row .button { width: 100%; }
  .profile-share-actions { display: grid; grid-template-columns: 1fr; }
  .profile-share-actions .button { width: 100%; }
  .account-bind-block { padding: 18px; }
  .profile-public-banner { min-height: 104px; padding: 18px; }
  .profile-public-body { padding-inline: 18px; }
  .profile-public-head { gap: 14px; margin-top: -36px; }
  .profile-public-avatar { width: 82px; height: 82px; box-shadow: 0 0 0 6px #fffefa; font-size: 2.1rem; }
  .profile-public-head h1,
  .profile-public-head h2 { margin-top: 28px; font-size: 1.65rem; }
  .profile-public-head p { font-size: .76rem; }
  .profile-public-status { align-items: start; flex-direction: column; gap: 4px; padding-left: 14px; }
  .profile-public-status::before { display: none; }
  .profile-public-section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .profile-public-url-row { align-items: stretch; flex-direction: column; padding: 14px; }
  .profile-public-url-row .button { width: 100%; }
  .profile-public-share .form-actions { display: grid; grid-template-columns: 1fr; }
  .profile-public-share .button, .profile-public-share a.button { width: 100%; }
  .profile-public-subscription { margin-top: 28px; padding: 18px; }
  .profile-safety-details > form { padding-inline: 18px; }
}
