/* Halfpix v1.2.20 — Me workspace. Loaded after popup-v1218.css.
   Uses the --ui-* tokens from unified-ui.css; no new colours. */

/* ---- Buttons ---- */
.hp-button.hp-button--danger {
  border: 1px solid var(--ui-danger);
  background: var(--ui-danger);
  color: #fff;
  box-shadow: none;
}
.hp-button.hp-button--danger:hover:not(:disabled) {
  border-color: #7d4038;
  background: #7d4038;
}
.hp-main .hp-button.hp-button--danger:disabled,
.hp-main .hp-button.hp-button--danger[disabled] {
  border-color: var(--ui-danger) !important;
  background: var(--ui-danger) !important;
  color: #fff !important;
  box-shadow: none !important;
  opacity: .45;
  cursor: not-allowed;
}

/* ---- Section head: actions stay beside the title, never under the copy ---- */
.hp-me-stage .hp-me-section-head,
.hp-main .hp-address-workspace .hp-me-section-head,
.hp-main .hp-orders-workspace .hp-me-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.hp-me-section-head > div:first-child { min-width: 0; }
.hp-me-section-actions { flex: 0 0 auto; }
.hp-me-section-actions .hp-button,
.hp-me-section-actions .hp-chip { white-space: nowrap; }
.hp-me-section-actions .hp-chip { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; }
.hp-me-section-actions .hp-chip .app-icon { width: 15px; height: 15px; }

/* ---- Stats: six numbers, the two community ones are read-only ---- */
.hp-me-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp-me-stat.is-static { cursor: default; }
.hp-me-stat.is-static:hover { transform: none; border-color: var(--ui-line); box-shadow: var(--ui-shadow-xs); }

/* ---- Toolbar: search grows, filter chips stay on one line ---- */
.hp-me-list-toolbar { flex-wrap: wrap; }
.hp-me-search { flex: 1 1 240px; width: auto; max-width: 420px; }
.hp-me-filter {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.hp-me-filter::-webkit-scrollbar { display: none; }
.hp-me-filter .hp-chip { flex: 0 0 auto; white-space: nowrap; }

/* ---- Content rows ---- */
.hp-main .hp-me-item {
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px;
}
.hp-main .hp-me-item__thumb { width: 84px; height: 84px; }
.hp-main .hp-me-item__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hp-main .hp-me-item__copy h3 {
  display: -webkit-box;
  margin: 6px 0 3px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hp-main .hp-me-item__copy a:hover h3 { color: var(--ui-primary-strong); }
.hp-main .hp-me-item__copy p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.hp-main .hp-me-item__copy small { font-size: 11.5px; }
.hp-main .hp-me-item__actions:empty { display: none; }
.hp-main .hp-me-item:has(.hp-me-item__actions:empty) { grid-template-columns: 84px minmax(0, 1fr); }

.hp-me-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.hp-me-status .app-icon { width: 12px; height: 12px; }
.hp-me-status.is-public { background: var(--ui-success-soft); color: var(--ui-success); }
.hp-me-status.is-private { background: #eef1f0; color: var(--ui-muted); }
.hp-me-status.is-draft { background: var(--ui-clay-soft); color: var(--ui-clay, #9a5d3f); }

.hp-me-list-footer { display: grid; justify-items: center; gap: 10px; margin-top: 14px; }
.hp-me-list-footer:empty { display: none; }
.hp-me-count { color: var(--ui-faint); font-size: 11.5px; }
.hp-me-more .hp-button { min-width: 160px; }
.hp-me-stage > .hp-me-collection > .hp-alert:first-child { margin-bottom: 14px; }

/* ---- Following: follow state is not a destructive action ---- */
.hp-follow-toggle { min-width: 96px; justify-content: center; }
.hp-follow-toggle[aria-pressed="true"] { border-color: var(--ui-line-strong); background: #fff; color: var(--ui-ink); }
.hp-follow-toggle[aria-pressed="true"]:hover { border-color: rgb(154 81 72 / .3); background: var(--ui-danger-soft); color: var(--ui-danger); }
.hp-follow-toggle.is-off { border-color: var(--ui-primary); background: var(--ui-primary); color: #fff; }
.hp-following-card[hidden] { display: none !important; }

/* ---- Comments ---- */
.hp-me-comment { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; }
.hp-me-comment__post {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--ui-surface-soft, #eef3f1);
  color: var(--ui-primary);
}
.hp-me-comment__post img { width: 100%; height: 100%; object-fit: cover; }
.hp-me-comment__body { min-width: 0; }
.hp-me-comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; color: var(--ui-muted); font-size: 12px; }
.hp-me-comment__meta small { width: 100%; }
.hp-me-comment__body > p { margin: 8px 0 10px; line-height: 1.6; overflow-wrap: anywhere; }
.hp-me-comment__media { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.hp-me-comment__media img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }

/* ---- Post editor: audience choice ---- */
.hp-me-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.hp-me-choices legend { margin-bottom: 8px; padding: 0; color: var(--ui-ink); font-size: 13px; font-weight: 700; }
.hp-me-choice { position: relative; display: block; cursor: pointer; }
.hp-me-choice input { position: absolute; opacity: 0; pointer-events: none; }
.hp-me-choice > span {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 14px;
  background: #fff;
}
.hp-me-choice > span > span { display: grid; gap: 2px; }
.hp-me-choice .app-icon { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; color: var(--ui-muted); }
.hp-me-choice strong { font-size: 13px; }
.hp-me-choice small { color: var(--ui-muted); font-size: 11.5px; line-height: 1.4; }
.hp-me-choice input:checked + span { border-color: var(--ui-primary); background: var(--ui-primary-soft); box-shadow: 0 0 0 1px var(--ui-primary); }
.hp-me-choice input:checked + span .app-icon { color: var(--ui-primary); }
.hp-me-choice input:focus-visible + span { outline: 2px solid var(--ui-form-focus, var(--ui-primary)); outline-offset: 2px; }

/* ---- Security & danger zone ---- */
.hp-security-row.is-danger { margin-top: 10px; border-top: 1px solid var(--ui-line); }
.hp-security-row.is-danger .app-icon { color: var(--ui-danger); }
.hp-security-row.is-danger small { max-width: 520px; }
.hp-security-row .hp-button[hidden] { display: none; }
.hp-delete-account {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid rgb(154 81 72 / .25);
  border-radius: 14px;
  background: var(--ui-danger-soft);
}
.hp-delete-account[hidden] { display: none; }
.hp-delete-account p { margin: 0; color: #6f3a33; }
.hp-delete-account kbd { padding: 1px 6px; border: 1px solid rgb(154 81 72 / .3); border-radius: 6px; background: #fff; font: 700 12px/1.4 var(--hp-font-sans, inherit); }
.hp-delete-account .hp-field { max-width: 280px; }
.hp-delete-account .hp-profile-actions { margin: 0; }

/* ---- Addresses inside the shared panel ---- */
.hp-main .hp-address-workspace { display: block; }
.hp-main .hp-address-workspace .hp-address-editor:not(:empty) { margin-bottom: 14px; }
.hp-main .hp-address-workspace .hp-address { min-height: 0; box-shadow: none; }
.hp-main .hp-address-workspace .hp-address-form { box-shadow: none; }

/* ---- Public profile ---- */
.hp-public-profile__stats { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.hp-public-profile__stats > span { display: grid; gap: 1px; }
.hp-public-profile__stats strong { font-size: 1.15rem; line-height: 1.1; }
.hp-public-profile__stats small { color: var(--ui-muted); font-size: 11.5px; }
.hp-public-profile .hp-meta { margin: 0 0 6px; }
.hp-public-profile span.hp-profile-avatar { display: grid; place-items: center; }
.hp-public-profile .hp-follow.is-following { border: 1px solid var(--ui-line-strong); background: #fff; color: var(--ui-ink); }
.hp-public-profile .hp-profile-actions { justify-content: flex-end; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hp-me-choices { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .hp-me-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-me-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-me-quick-grid > a { align-items: flex-start; }
  .hp-me-stage .hp-me-section-head,
  .hp-main .hp-address-workspace .hp-me-section-head,
  .hp-main .hp-orders-workspace .hp-me-section-head { display: flex; }
  .hp-me-section-head p { font-size: 13px; }
  .hp-me-list-toolbar { flex-direction: column; align-items: stretch; }
  .hp-me-search { max-width: none; flex-basis: auto; }
  .hp-main .hp-me-item { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .hp-main .hp-me-item__thumb { width: 72px; height: 72px; }
  .hp-main .hp-me-item__actions { grid-column: 2; justify-content: flex-start; }
  .hp-main .hp-me-item:has(.hp-me-item__actions:empty) { grid-template-columns: 72px minmax(0, 1fr); }
  .hp-me-comment { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .hp-me-comment__post { width: 52px; height: 52px; }
  .hp-following-card { align-items: center; }
  .hp-public-profile .hp-profile-actions { grid-column: 1 / -1; justify-content: stretch; }
  .hp-public-profile .hp-profile-actions > * { flex: 1 1 0; }
}
@media (max-width: 420px) {
  .hp-me-section-actions .hp-button { padding-inline: 12px; }
}
