:root {
  --pt-primary: #6c5ce7;
  --pt-primary-dark: #5a4bd6;
  --pt-bg: #f3f4f8;
  --pt-card: #ffffff;
  --pt-text: #17171c;
  --pt-muted: #8a8d99;
  --pt-border: #e6e7ee;
  --pt-danger: #e5484d;
}

html, body { min-height: 100%; }

.pt-body {
  background: var(--pt-bg);
  color: var(--pt-text);
  font-family: "Tajawal", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- top bar ---- */
.pt-topbar {
  position: sticky; top: 0; z-index: 10;
  height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pt-border);
}
.pt-logo {
  font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; direction: ltr;
  color: var(--pt-text); text-decoration: none;
}
.pt-logo span { color: var(--pt-primary); }

.pt-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 16px 24px;
}

/* ---- profile header ---- */
.pt-profile { margin-bottom: 20px; }
.pt-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe 55%, #fd79a8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2.5rem; font-weight: 800;
  box-shadow: 0 0 0 4px #fff, 0 6px 20px rgba(108, 92, 231, .3);
  overflow: hidden;
}
.pt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pt-name { font-size: 1.5rem; font-weight: 800; margin: 14px 0 0; }
.pt-handle { color: var(--pt-muted); font-weight: 500; }
.pt-bio { margin: 10px auto 0; max-width: 380px; color: #4a4d57; }

/* ---- tell box ---- */
.pt-tellbox {
  background: var(--pt-card);
  border: 1px solid var(--pt-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 4px 24px rgba(23, 23, 28, .06);
}
.pt-tellbox-title {
  display: block;
  font-weight: 700; font-size: 1rem;
  margin-bottom: 10px;
}
.pt-textarea {
  width: 100%;
  border: none; outline: none; resize: none;
  background: var(--pt-bg);
  border-radius: 14px;
  padding: 14px;
  font-size: 1.05rem; line-height: 1.45;
  color: var(--pt-text);
  transition: box-shadow .15s;
}
.pt-textarea:focus { box-shadow: 0 0 0 2px var(--pt-primary); background: #fff; }
.pt-textarea::placeholder { color: var(--pt-muted); }

.pt-tellbox-footer {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px;
}
.pt-count { margin-inline-start: auto; color: var(--pt-muted); font-size: .85rem; }

.pt-icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--pt-border);
  background: #fff; color: var(--pt-primary);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.pt-icon-btn:hover { background: #f0eeff; }

/* ---- buttons ---- */
.pt-btn {
  display: inline-block;
  border: none; border-radius: 999px;
  padding: 10px 26px;
  font-weight: 700; font-size: .95rem;
  text-decoration: none; text-align: center;
  transition: background .15s, opacity .15s;
}
.pt-btn-sm { padding: 6px 16px; font-size: .85rem; }
.pt-btn-primary { background: var(--pt-primary); color: #fff; }
.pt-btn-primary:hover { background: var(--pt-primary-dark); color: #fff; }
.pt-btn-primary:disabled { opacity: .5; }
.pt-btn-ghost { background: var(--pt-bg); color: var(--pt-text); }
.pt-btn-ghost:hover { background: var(--pt-border); }

/* ---- camera ---- */
.pt-cam { margin-top: 12px; text-align: center; }
.pt-cam video, .pt-cam img {
  width: 100%; max-width: 320px; aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 16px;
  transform: scaleX(-1);   /* mirror like a selfie camera */
}
.pt-cam img { transform: none; }
.pt-cam-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }

/* ---- misc ---- */
.pt-error { color: var(--pt-danger); font-size: .85rem; margin-top: 6px; }
.pt-error ul { list-style: none; padding: 0; margin: 0 0 8px; }
.pt-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--pt-muted); font-size: .85rem; margin-top: 14px;
}

.pt-modal { border: none; border-radius: 22px; }
.pt-modal-icon { font-size: 2.2rem; text-align: center; margin-bottom: 6px; }
.pt-consent-list {
  background: var(--pt-bg); border-radius: 14px;
  padding: 12px; padding-inline-start: 30px; font-size: .9rem; margin-bottom: 12px;
}
.pt-consent-list li + li { margin-top: 4px; }
.form-check-input:checked { background-color: var(--pt-primary); border-color: var(--pt-primary); }

.pt-sent-check {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  background: var(--pt-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 800;
}

.pt-privacy h2 { margin-top: 18px; }
.pt-privacy ul, .pt-privacy p { color: #4a4d57; font-size: .95rem; }

.pt-footer {
  text-align: center; color: var(--pt-muted); font-size: .8rem;
  padding: 8px 16px 28px;
}
.pt-footer a { color: var(--pt-muted); }

/* =========================================================
   Profile page (tp-*)
   ========================================================= */
.pt-topbar-title {
  font-weight: 700; font-size: 1.15rem;
  color: var(--pt-text); text-decoration: none;
}

/* hero: gradient band + white curve + big photo */
.tp-hero {
  position: relative;
  height: 230px;
  margin: -28px -16px 0;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #fd79a8 100%);
  overflow: hidden;                          /* fallback */
  overflow-x: clip; overflow-y: visible;     /* clip the curve sideways, let the photo shadow spill down */
}
.tp-hero::after {
  content: "";
  position: absolute; left: -15%; right: -15%; bottom: -1px;
  height: 95px;
  background: #fff;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.tp-photo {
  position: absolute; z-index: 1;
  left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 176px; height: 176px; border-radius: 50%;
  background: linear-gradient(135deg, #6c5ce7, #fd79a8);
  border: 5px solid #fff;
  box-shadow: 0 10px 30px rgba(23, 23, 28, .18);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 4rem; font-weight: 800;
}
.tp-photo img { width: 100%; height: 100%; object-fit: cover; }

/* name, badge, bio, stats, buttons */
.tp-info {
  background: #fff;
  margin: 0 -16px;
  padding: 8px 20px 22px;
}
.tp-name {
  font-size: 1.7rem; font-weight: 800;
  margin: 0 0 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tp-verified { width: 22px; height: 22px; color: #1d9bf0; flex-shrink: 0; }
.tp-verified-sm { width: 16px; height: 16px; }
.tp-badge {
  display: inline-block;
  background: var(--pt-primary); color: #fff;
  font-size: .8rem; font-weight: 600;
  padding: 3px 12px; border-radius: 6px;
}
.tp-bio { margin: 14px auto 0; max-width: 420px; color: #2b2d35; white-space: pre-line; }

.tp-stats {
  display: flex; justify-content: center;
  margin: 18px auto 0; max-width: 300px;
}
.tp-stats > div {
  flex: 1; display: flex; flex-direction: column;
  padding: 0 10px;
}
.tp-stats > div + div { border-inline-start: 1px solid var(--pt-border); }
.tp-stats b { font-size: 1.2rem; font-weight: 800; }
.tp-stats span { color: #4f7a99; font-size: .85rem; }

.tp-actions {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin-top: 18px;
}
.tp-pill {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 9px 24px;
  font-weight: 700; font-size: .95rem;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s, opacity .15s;
}
.tp-pill-sm { padding: 5px 16px; font-size: .85rem; }
.tp-pill-primary { background: var(--pt-primary); color: #fff; }
.tp-pill-primary:hover { background: var(--pt-primary-dark); color: #fff; }
.tp-pill-primary:disabled { opacity: .5; }
.tp-pill-outline { background: #fff; color: var(--pt-text); border-color: #2b2d35; }
.tp-pill-outline:hover { background: var(--pt-bg); }
.tp-round {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #d9dbe3; color: #fff;
}

/* send box: underline input that expands */
.tp-send {
  background: #fff;
  margin: 0 -16px;
  padding: 6px 24px 20px;
  border-bottom: 1px solid var(--pt-border);
}
.tp-input {
  width: 100%;
  border: none; outline: none; resize: none; overflow: hidden;
  border-bottom: 2px solid var(--pt-primary);
  padding: 10px 2px;
  font-size: 1.15rem; line-height: 1.4;
  background: transparent; color: var(--pt-text);
}
.tp-input::placeholder { color: #9aa0ad; }
.tp-send-extras { margin-top: 10px; }
.tp-send-footer { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

.pt-icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--pt-border);
  background: #fff; color: var(--pt-primary);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.pt-icon-btn:hover { background: #f0eeff; }

/* ---- buttons ---- */
.pt-btn {
  display: inline-block;
  border: none; border-radius: 999px;
  padding: 10px 26px;
  font-weight: 700; font-size: .95rem;
  text-decoration: none; text-align: center;
  transition: background .15s, opacity .15s;
}
.pt-btn-sm { padding: 6px 16px; font-size: .85rem; }
.pt-btn-primary { background: var(--pt-primary); color: #fff; }
.pt-btn-primary:hover { background: var(--pt-primary-dark); color: #fff; }
.pt-btn-primary:disabled { opacity: .5; }
.pt-btn-ghost { background: var(--pt-bg); color: var(--pt-text); }
.pt-btn-ghost:hover { background: var(--pt-border); }

/* ---- camera ---- */
.pt-cam { margin-top: 12px; text-align: center; }
.pt-cam video, .pt-cam img {
  width: 100%; max-width: 320px; aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 16px;
  transform: scaleX(-1);   /* mirror like a selfie camera */
}
.pt-cam img { transform: none; }
.pt-cam-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }

/* ---- misc ---- */
.pt-error { color: var(--pt-danger); font-size: .85rem; margin-top: 6px; }
.pt-error ul { list-style: none; padding: 0; margin: 0 0 8px; }
.pt-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--pt-muted); font-size: .85rem; margin-top: 14px;
}

.pt-modal { border: none; border-radius: 22px; }
.pt-modal-icon { font-size: 2.2rem; text-align: center; margin-bottom: 6px; }
.pt-consent-list {
  background: var(--pt-bg); border-radius: 14px;
  padding: 12px; padding-inline-start: 30px; font-size: .9rem; margin-bottom: 12px;
}
.pt-consent-list li + li { margin-top: 4px; }
.form-check-input:checked { background-color: var(--pt-primary); border-color: var(--pt-primary); }

.pt-sent-check {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  background: var(--pt-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 800;
}

.pt-privacy h2 { margin-top: 18px; }
.pt-privacy ul, .pt-privacy p { color: #4a4d57; font-size: .95rem; }

.pt-footer {
  text-align: center; color: var(--pt-muted); font-size: .8rem;
  padding: 8px 16px 28px;
}
.pt-footer a { color: var(--pt-muted); }

/* =========================================================
   Profile page (tp-*)
   ========================================================= */
.pt-topbar-title {
  font-weight: 700; font-size: 1.15rem;
  color: var(--pt-text); text-decoration: none;
}

/* hero: gradient band + white curve + big photo */
.tp-hero {
  position: relative;
  height: 230px;
  margin: -28px -16px 0;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #fd79a8 100%);
  overflow: hidden;                          /* fallback */
  overflow-x: clip; overflow-y: visible;     /* clip the curve sideways, let the photo shadow spill down */
}
.tp-hero::after {
  content: "";
  position: absolute; left: -15%; right: -15%; bottom: -1px;
  height: 95px;
  background: #fff;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.tp-photo {
  position: absolute; z-index: 1;
  left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 176px; height: 176px; border-radius: 50%;
  background: linear-gradient(135deg, #6c5ce7, #fd79a8);
  border: 5px solid #fff;
  box-shadow: 0 10px 30px rgba(23, 23, 28, .18);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 4rem; font-weight: 800;
}
.tp-photo img { width: 100%; height: 100%; object-fit: cover; }

/* name, badge, bio, stats, buttons */
.tp-info {
  background: #fff;
  margin: 0 -16px;
  padding: 8px 20px 22px;
}
.tp-name {
  font-size: 1.7rem; font-weight: 800;
  margin: 0 0 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tp-verified { width: 22px; height: 22px; color: #1d9bf0; flex-shrink: 0; }
.tp-verified-sm { width: 16px; height: 16px; }
.tp-badge {
  display: inline-block;
  background: var(--pt-primary); color: #fff;
  font-size: .8rem; font-weight: 600;
  padding: 3px 12px; border-radius: 6px;
}
.tp-bio { margin: 14px auto 0; max-width: 420px; color: #2b2d35; white-space: pre-line; }

.tp-stats {
  display: flex; justify-content: center;
  margin: 18px auto 0; max-width: 300px;
}
.tp-stats > div {
  flex: 1; display: flex; flex-direction: column;
  padding: 0 10px;
}
.tp-stats > div + div { border-inline-start: 1px solid var(--pt-border); }
.tp-stats b { font-size: 1.2rem; font-weight: 800; }
.tp-stats span { color: #4f7a99; font-size: .85rem; }

.tp-actions {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin-top: 18px;
}
.tp-pill {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 9px 24px;
  font-weight: 700; font-size: .95rem;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s, opacity .15s;
}
.tp-pill-sm { padding: 5px 16px; font-size: .85rem; }
.tp-pill-primary { background: var(--pt-primary); color: #fff; }
.tp-pill-primary:hover { background: var(--pt-primary-dark); color: #fff; }
.tp-pill-primary:disabled { opacity: .5; }
.tp-pill-outline { background: #fff; color: var(--pt-text); border-color: #2b2d35; }
.tp-pill-outline:hover { background: var(--pt-bg); }
.tp-round {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #d9dbe3; color: #fff;
}

/* send box: underline input that expands */
.tp-send {
  background: #fff;
  margin: 0 -16px;
  padding: 6px 24px 20px;
  border-bottom: 1px solid var(--pt-border);
}
.tp-input {
  width: 100%;
  border: none; outline: none; resize: none; overflow: hidden;
  border-bottom: 2px solid var(--pt-primary);
  padding: 10px 2px;
  font-size: 1.15rem; line-height: 1.4;
  background: transparent; color: var(--pt-text);
}
.tp-input::placeholder { color: #9aa0ad; }
.tp-send-extras { margin-top: 10px; }
.tp-send-footer { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

/* answered tells feed */
.tp-feed { padding-top: 18px; }
.tp-feed-title {
  font-size: 1rem; font-weight: 800; margin: 0 4px 12px;
  display: flex; align-items: center; gap: 8px;
}
.tp-feed-title span {
  background: var(--pt-border); color: #4a4d57;
  font-size: .75rem; padding: 2px 8px; border-radius: 999px;
}
.tp-empty {
  text-align: center; color: var(--pt-muted);
  background: #fff; border-radius: 18px; padding: 32px 16px;
  border: 1px solid var(--pt-border);
}
.tp-empty-icon { font-size: 2rem; margin-bottom: 6px; }

.tp-post {
  background: #fff;
  border: 1px solid var(--pt-border);
  border-radius: 18px;
  padding: 14px 16px 16px;
  margin-bottom: 12px;
}
.tp-post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tp-post-avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--pt-primary); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.tp-post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tp-post-name { font-weight: 700; display: flex; align-items: center; gap: 4px; }
.tp-post-meta time { color: var(--pt-muted); font-size: .8rem; }

.tp-tell {
  background: var(--pt-bg);
  border-radius: 14px;
  padding: 10px 14px;
}
.tp-tell-label {
  color: var(--pt-primary); font-size: .75rem; font-weight: 700;
  margin-bottom: 2px;
}
.tp-tell p, .tp-reply { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.tp-reply { margin-top: 12px; font-size: 1.02rem; }

/* =========================================================
   Responsive
   ========================================================= */
.pt-main { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.tp-input { font-size: max(16px, 1.15rem); }   /* >=16px stops iOS zoom on focus */

/* small phones */
@media (max-width: 380px) {
  .pt-main { padding-left: 12px; padding-right: 12px; }
  .tp-hero, .tp-info, .tp-send { margin-left: -12px; margin-right: -12px; }
  .tp-hero { height: 190px; }
  .tp-hero::after { height: 75px; }
  .tp-photo { width: 140px; height: 140px; border-width: 4px; }
  .tp-name { font-size: 1.4rem; }
  .tp-verified { width: 19px; height: 19px; }
  .tp-bio { font-size: .92rem; }
  .tp-pill { padding: 8px 18px; font-size: .9rem; }
  .tp-send { padding-left: 16px; padding-right: 16px; }
  .tp-post { padding: 12px; border-radius: 16px; }
  .tp-tell { padding: 9px 12px; }
}

/* tablets / desktop: profile becomes one floating card */
@media (min-width: 768px) {
  .pt-topbar { height: 64px; }
  .pt-main { max-width: 640px; padding-top: 32px; }

  .tp-hero, .tp-info, .tp-send { margin-left: 0; margin-right: 0; }
  .tp-hero {
    margin-top: 0;
    height: 260px;
    border-radius: 28px 28px 0 0;
  }
  .tp-hero::after { height: 110px; }
  .tp-photo { width: 200px; height: 200px; bottom: 10px; }

  .tp-info { padding: 12px 40px 26px; }
  .tp-name { font-size: 2rem; }
  .tp-verified { width: 26px; height: 26px; }
  .tp-bio { font-size: 1.05rem; }
  .tp-stats { max-width: 340px; }

  .tp-send {
    padding: 8px 40px 28px;
    border-bottom: none;
    border-radius: 0 0 28px 28px;
  }
  .tp-hero, .tp-info, .tp-send { box-shadow: 0 12px 40px -12px rgba(23, 23, 28, .12); }
  .tp-info, .tp-send { clip-path: inset(0 -40px -40px -40px); }   /* keep side/bottom shadow, hide seams */

  .tp-feed { padding-top: 28px; }
  .tp-post { padding: 18px 22px 20px; }
  .tp-post:hover { box-shadow: 0 6px 24px rgba(23, 23, 28, .07); }
}

/* wide screens */
@media (min-width: 1200px) {
  .pt-main { max-width: 680px; }
}

/* modals on phones: full width bottom sheet feel */
@media (max-width: 575.98px) {
  .modal-dialog-centered { align-items: flex-end; min-height: 100%; margin: 0; }
  .modal-dialog { max-width: none; }
  .pt-modal { border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
