/**
 * Stage 3 — Profile tab layout only.
 * Scope: #f7-app-root #tab-settings …
 *
 * Field chrome contract:
 *   .f7-profile-card        — section container (may keep card bg/border)
 *   .f7-profile-card--field — label + field row; NO outer box (input owns chrome)
 *   .f7-profile-field-row    — flex row for input + button
 *   input.inp               — single liquid-glass field (F7 reset override)
 *   .f7-profile-inp-inset   — flat field inside a card (card owns outer box)
 */

#f7-app-root #tab-settings {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-left: max(0px, calc(var(--tab-hdr-px, 16px) - var(--safe-x-left, 0px)));
  padding-right: max(0px, calc(var(--tab-hdr-px, 16px) - var(--safe-x-right, 0px)));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#f7-app-root #tab-settings::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

#f7-app-root #tab-settings #settings-tab-header {
  margin-left: calc(-1 * max(0px, calc(var(--tab-hdr-px, 16px) - var(--safe-x-left, 0px))));
  margin-right: calc(-1 * max(0px, calc(var(--tab-hdr-px, 16px) - var(--safe-x-right, 0px))));
  padding-left: max(0px, calc(var(--tab-hdr-px, 16px) - var(--safe-x-left, 0px)));
  padding-right: max(0px, calc(var(--tab-hdr-px, 16px) - var(--safe-x-right, 0px)));
}

body.f7-profile-tab-active #f7-app-root #tab-settings.tab-active {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

body.f7-profile-tab-active #f7-app-root #tab-settings #settings-tab-header {
  position: relative;
  z-index: 2;
}

/* F7 shell — Profile exit button (tabbar hidden on Profile; carousel handler removed) */
body.f7-shell-settled #f7-app-root #tab-settings #settings-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body.f7-shell-settled #f7-app-root #tab-settings #settings-back-btn:active {
  opacity: 0.85;
}

#f7-app-root #tab-settings .f7-profile-card {
  max-width: 100%;
  box-sizing: border-box;
}

/* Field section: label only; strip inline card chrome so input is the only boxed field */
#f7-app-root #tab-settings .f7-profile-card--field {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 10px;
}

#f7-app-root .swiper-slide[data-tab-panel="tab-settings"] {
  overflow: hidden;
}

#f7-app-root .swiper-slide[data-tab-panel="tab-settings"] #tab-settings {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  padding-bottom: var(--navh, 60px);
}

#f7-app-root #tab-settings .f7-profile-field-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/*
 * Base F7 input reset fix — specificity beats input[type=text] from F7 bundle.
 * One border/background owner for standalone fields (.f7-profile-card--field).
 */
#f7-app-root #tab-settings input.inp {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  box-sizing: border-box;
  margin: 0;
  outline: none;
  color: var(--t1);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  padding: 11px 14px;
  backdrop-filter: blur(10px) saturate(200%);
  -webkit-backdrop-filter: blur(10px) saturate(200%);
}

#f7-app-root #tab-settings input.inp:focus {
  border-color: rgba(255, 106, 0, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

/* Inside a section card: flat inset field — card owns outer border, not input */
#f7-app-root #tab-settings input.f7-profile-inp-inset {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  border-radius: 12px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

#f7-app-root #tab-settings input.f7-profile-inp-inset:focus {
  background: rgba(255, 255, 255, 0.1);
  border: none;
}

#f7-app-root #tab-settings #set-name-inp {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: 100%;
}

/* F7 button reset uses width:100%; min-width:0; flex-shrink:1 — reserve readable save btn */
#f7-app-root #tab-settings #set-name-save-btn {
  flex: 0 0 auto;
  flex-shrink: 0;
  width: max-content;
  min-width: 96px;
  max-width: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  box-sizing: border-box;
}

/* F7 global button{width:100%} — restore compact orange photo button */
#f7-app-root #tab-settings #set-av-change-btn {
  width: auto;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 106, 0, 0.12);
  border: 1px solid rgba(255, 106, 0, 0.28);
  border-radius: 14px;
  padding: 7px 18px;
  color: #ff9040;
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
}

#f7-app-root #tab-settings #set-mood-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

#f7-app-root #tab-settings #set-mood-row .set-mood-chip,
#f7-app-root #tab-settings button.set-mood-chip {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
}
