/* ─── About You page ─────────────────────────────────────────────────────────
   Self-profile under Settings. Uses the app's design tokens (light + dark) and
   the app's default type stack — intentionally NOT the mock's display fonts. */

.ay-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  /* No own background: the app base is the body's fixed --kith-bg-grad
     (main.css). A flat var(--kith-bg) fill here differed from that gradient,
     drawing a horizontal seam where the page starts below #app's safe-area
     top inset. Transparent = continuous with every other page. */
  color: var(--kith-text);
  display: flex;
  flex-direction: column;
}

.ay-loading {
  padding: 120px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--kith-text-muted);
}

/* Header */
.ay-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  /* No safe-area term here: #app owns the top inset (main.css) — repeating
     it on this element stacked the status-bar gap twice in the iOS app. */
  padding: 18px 18px 6px;
  flex-shrink: 0;
}

/* Unified back-pill chrome (matches .yw-back-btn, circles.css) */
.ay-back-btn {
  width: 40px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--kith-border);
  background: var(--kith-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kith-text);
  box-shadow: 0 1px 6px rgba(60, 34, 24, 0.08);
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ay-back-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(60, 34, 24, 0.1);
}

.ay-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Body */
.ay-body {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  /* Nav is route-hidden on About You, so #app reclaims the nav clearance
     (nav.css) — only a small gap is needed, matching Settings' .st-body. */
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Identity hero */
.ay-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px 2px;
  cursor: pointer;
}

.ay-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--kith-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  flex-shrink: 0;
}

.ay-hero-text { flex: 1; min-width: 0; }

.ay-hero-name {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ay-hero-sub {
  font-size: 13px;
  color: var(--kith-text-muted);
  margin-top: 3px;
}

/* Keith hero card */
.ay-keith-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 18px;
  background: var(--kith-surface);
  box-shadow: var(--kith-shadow);
}

.ay-keith-glow {
  position: absolute;
  top: -50px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--kith-gold-soft) 0%, transparent 70%);
  pointer-events: none;
}

.ay-keith-headline {
  position: relative;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.ay-keith-copy {
  position: relative;
  font-size: 13px;
  color: var(--kith-text-muted);
  margin-top: 4px;
  line-height: 1.45;
}

.ay-keith-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--kith-gold) 0%, #B68E2C 100%);
  box-shadow: 0 4px 14px var(--kith-gold-soft), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-size: 14.5px;
  font-weight: 600;
}

.ay-keith-hint {
  position: relative;
  margin-top: 10px;
  font-size: 12px;
  font-style: italic;
  color: var(--kith-text-faint);
}

/* Section cards */
.ay-card {
  background: var(--kith-surface);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--kith-shadow-soft);
}

.ay-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.ay-card-title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--kith-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.ay-card-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--kith-gold);
  opacity: 0.8;
}

/* Value rows */
.ay-rows { display: flex; flex-direction: column; }

.ay-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 11px 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--kith-line-soft);
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.ay-row--first { border-top: none; }

.ay-row-label {
  width: 70px;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--kith-text-muted);
}

.ay-row-value {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--kith-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ay-row-value--empty {
  font-weight: 400;
  font-style: italic;
  color: var(--kith-text-faint);
}

.ay-row-chevron {
  color: var(--kith-text-faint);
  flex-shrink: 0;
}

/* Tag chips */
.ay-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
}

.ay-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--kith-bg);
  color: var(--kith-text);
  border: 1px solid var(--kith-line-soft);
}

.ay-chip--add {
  color: var(--kith-green);
  background: transparent;
  border: 1px dashed var(--kith-line);
  font-weight: 500;
}

.ay-chip--pet { padding: 8px 13px; }
.ay-chip-strong { font-weight: 600; }
.ay-chip-soft { color: var(--kith-text-muted); font-style: italic; }

.ay-chip-x {
  border: none;
  background: transparent;
  color: var(--kith-text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
}

.ay-tags-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px dashed var(--kith-line);
  cursor: pointer;
  background: transparent;
  text-align: left;
  font: inherit;
}

.ay-tags-plus {
  color: var(--kith-green);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.ay-tags-empty-label {
  flex: 1;
  font-style: italic;
  font-size: 13.5px;
  color: var(--kith-text-faint);
}

/* Files — the existing contact_files feature on the self-contact */
.ay-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ay-file-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ay-file-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--kith-bg);
  border: 1px solid var(--kith-line-soft);
  color: var(--kith-text);
  text-decoration: none;
  font-size: 13.5px;
}

.ay-file-link .ph { color: var(--kith-green); font-size: 17px; flex-shrink: 0; }

.ay-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ay-file-size {
  font-size: 11.5px;
  color: var(--kith-text-muted);
  flex-shrink: 0;
}

.ay-file-x {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--kith-text-muted);
  font-size: 17px;
  line-height: 1;
  padding: 8px;
  flex-shrink: 0;
}

.ay-files-empty {
  font-style: italic;
  font-size: 13.5px;
  color: var(--kith-text-faint);
}

.ay-file-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  cursor: pointer;
  padding: 7px 2px;
  color: var(--kith-text);
  font-size: 13.5px;
}

.ay-file-add-label { color: var(--kith-text-faint); }

/* Interests groups */
.ay-interests { display: flex; flex-direction: column; gap: 14px; }

.ay-interest-label {
  font-size: 11px;
  color: var(--kith-text-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Dates */
.ay-dates {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
}

.ay-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.ay-date-label { font-weight: 500; }
.ay-date-value { color: var(--kith-text-muted); }

/* Footer */
.ay-footer-note {
  text-align: center;
  padding: 8px 30px 0;
  font-size: 12px;
  font-style: italic;
  color: var(--kith-text-faint);
  line-height: 1.5;
}

/* ─── Edit sheets ──────────────────────────────────────────────────────────── */

#ay-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}

#ay-overlay.open { pointer-events: auto; }

.ay-sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#ay-overlay.open .ay-sheet-scrim { opacity: 1; }

.ay-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--kith-surface);
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  box-shadow: var(--kith-shadow);
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  overflow-y: auto;
}

#ay-overlay.open .ay-sheet { transform: translateY(0); }

.ay-sheet-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}

.ay-sheet-label {
  display: block;
  font-size: 12px;
  color: var(--kith-text-muted);
  margin-bottom: 6px;
}

.ay-sheet-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--kith-line);
  background: var(--kith-bg);
  color: var(--kith-text);
  font: inherit;
  font-size: 14.5px;
  margin-bottom: 12px;
  -webkit-appearance: none;
}

.ay-sheet-input:focus {
  outline: none;
  border-color: var(--kith-green);
}

textarea.ay-sheet-input { resize: none; }

.ay-sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.ay-sheet-empty {
  font-size: 13px;
  font-style: italic;
  color: var(--kith-text-faint);
}

.ay-sheet-addrow {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.ay-sheet-addrow .ay-sheet-input { flex: 1; margin-bottom: 0; }

.ay-sheet-add-btn {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--kith-line);
  background: transparent;
  color: var(--kith-green);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.ay-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.ay-sheet-cancel {
  flex: 1;
  padding: 13px;
  border-radius: 999px;
  border: 1px solid var(--kith-line);
  background: transparent;
  color: var(--kith-text-muted);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

.ay-sheet-save {
  flex: 1;
  padding: 13px;
  border-radius: 999px;
  border: none;
  background: var(--kith-green);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

.ay-sheet-save:disabled { opacity: 0.6; }
