/* Settings / Profile / Feedback */
/* 5. Shared components */
/* ========= Icons ========= */
.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 7. Settings / Profile / Feedback */
#settings-screen{
  position: fixed;
  inset: 0;
  z-index: 3001;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  color: var(--text-color);
  overflow: hidden;
}

.settings-page{
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#settings-screen.hidden{
  display: none !important;
}

.settings-html, body, button, a, [role="button"], input, textarea {
  -webkit-tap-highlight-color: transparent;
}


.settings-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px var(--page-pad-x) 0;
}

.settings-body::-webkit-scrollbar{
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.settings-body > .settings-group + .settings-group{
  margin-top: 18px;
}

.settings-group{
  display: flex;
  flex-direction: column;
  gap: 0;
  background: transparent;
  border: 0;
  overflow: visible;
}

.settings-group-title{
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--tg-hint-color, #8e8e93);
  padding: 0 8px 10px;
  background: transparent;
}

.settings-row{
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: none;
  background: var(--tg-secondary-bg-color, rgba(255,255,255,.88));
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
}
body.dark .settings-row{
  background: var(--tg-secondary-bg-color, rgba(255,255,255,.06));
}
.settings-group > .settings-row:first-of-type,
.settings-group > label.settings-row:first-of-type{
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}
.settings-group > .settings-row:last-of-type,
.settings-group > label.settings-row:last-of-type{
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
}
.settings-group .settings-row + .settings-row,
.settings-group .settings-row + label.settings-row,
.settings-group label.settings-row + .settings-row,
.settings-group label.settings-row + label.settings-row{
  margin-top: 0;
}
.settings-group .settings-row + .settings-row::before,
.settings-group .settings-row + label.settings-row::before,
.settings-group label.settings-row + .settings-row::before,
.settings-group label.settings-row + label.settings-row::before{
  content: '';
  position: absolute;
  left: 72px;
  right: 18px;
  top: 0;
  height: 1px;
  background: rgba(60,60,67,.12);
}
body.dark .settings-group .settings-row + .settings-row::before,
body.dark .settings-group .settings-row + label.settings-row::before,
body.dark .settings-group label.settings-row + .settings-row::before,
body.dark .settings-group label.settings-row + label.settings-row::before{
  background: rgba(84,84,88,.35);
}
.settings-row-left{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.settings-icon-badge{
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,.18);
}
.settings-icon-badge .icon{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
  color: #fff !important;
  fill: #fff;
  stroke: #fff;
}
.settings-icon-badge svg,
.settings-icon-badge svg *,
.settings-icon-badge .icon,
.settings-icon-badge .icon *{
  color: #fff !important;
  fill: currentColor;
  stroke: none;
}
.settings-icon-badge{
  line-height: 0;
}
.settings-icon-badge.badge-gray{ background: #8e8e93; }
.settings-icon-badge.badge-green{ background: #34c759; }
.settings-icon-badge.badge-blue{ background: #0a84ff; }
.settings-icon-badge.badge-purple{ background: #af52de; }
.settings-icon-badge.badge-indigo{ background: #5856d6; }
.settings-icon-badge.badge-orange{ background: #ff9f0a; }
.settings-row-left > span:last-child{
  min-width: 0;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.25;
}
.settings-row .icon{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--tg-hint-color, #8e8e93);
}
.settings-row-arrow{
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
  color: var(--tg-hint-color, #c7c7cc);
  opacity: 1;
}
.settings-row:active{ opacity: .82; }
.settings-row:focus,
.settings-row:focus-visible{
  outline: none;
  box-shadow: none;
}
.settings-row select.setting-select{ margin-left: auto; }
.setting-select,
.setting-button{
  appearance: none;
  -webkit-appearance: none;
  border: none;
  min-width: 96px;
  height: 32px;
  padding: 0 18px 0 8px;
  border-radius: 0;
  background: transparent;
  color: var(--tg-hint-color, #8e8e93);
  font-size: 17px;
  font-weight: 400;
  text-align: right;
  box-shadow: none;
}
.setting-select{
  text-align-last: right;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 8px) 14px, calc(100% - 3px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.setting-select option{ text-align: left; }
.setting-button{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.setting-select:focus,
.setting-select:focus-visible,
.setting-button:focus,
.setting-button:focus-visible{
  outline: none;
  box-shadow: none;
  background-color: transparent;
}

.settings-row-value{
  margin-left: auto;
  color: var(--tg-hint-color, #8e8e93);
  font-size: 17px;
  font-weight: 400;
  text-align: right;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-group{ gap: 0; }
.settings-picker-list{ display:flex; flex-direction:column; gap:0; }
.settings-picker-row{
  appearance:none; -webkit-appearance:none; width:100%; min-height:56px; padding: 0 16px;
  border:none; background: var(--tg-secondary-bg-color, rgba(255,255,255,.88)); color: var(--text-color);
  display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left;
  border-radius:0; box-shadow:none; position:relative;
}
body.dark .settings-picker-row{ background: var(--tg-secondary-bg-color, rgba(255,255,255,.06)); }
.settings-picker-list > .settings-picker-row:first-child{ border-top-left-radius:22px; border-top-right-radius:22px; }
.settings-picker-list > .settings-picker-row:last-child{ border-bottom-left-radius:22px; border-bottom-right-radius:22px; }
.settings-picker-list > .settings-picker-row + .settings-picker-row::before{
  content:''; position:absolute; left:16px; right:16px; top:0; height:1px; background: rgba(60,60,67,.12);
}
body.dark .settings-picker-list > .settings-picker-row + .settings-picker-row::before{ background: rgba(84,84,88,.35); }
.settings-picker-main{ min-width:0; display:flex; flex-direction:column; gap:2px; }
.settings-picker-title{ font-size:17px; line-height:1.22; font-weight:400; color:var(--text-color); }
.settings-picker-subtitle{ font-size:17px; line-height:1.22; font-weight:400; color:var(--tg-hint-color, #8e8e93); }
.settings-picker-check{ color: var(--tg-link-color, var(--accent-color)); font-size: 24px; line-height:1; opacity:0; }
.settings-picker-row.is-selected .settings-picker-check{ opacity:1; }
.settings-picker-row:active{ opacity:1; }
.settings-picker-row:focus, .settings-picker-row:focus-visible{ outline:none; box-shadow:none; }

.settings-legal{
  flex: 0 0 auto;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  color: var(--tg-hint-color, #8e8e93);
  padding: 8px 8px calc(12px + var(--tg-bottom, 0px) + env(safe-area-inset-bottom, 0px));
  opacity: .9;
  margin-top: 0;
}

.app-screen,
#settings-screen,
#profile-screen,
#feedback-screen,
#theme-screen,
#language-screen {
  position: fixed;
  inset: 0;
  z-index: 3001;
  background: var(--app-bg);
  color: var(--text-color);
}

.profile-page-card,
.feedback-page-card {
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

.profile-page-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding-top: 8px;
}
.profile-info-group{
  width: 100%;
  max-width: 100%;
}
.profile-info-row{
  min-height: 56px;
  padding: 0 16px;
  background: var(--tg-secondary-bg-color, rgba(255,255,255,.88));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}
.profile-info-group > .profile-info-row:first-of-type{
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}
.profile-info-group > .profile-info-row:last-of-type{
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
}
.profile-info-group .profile-info-row + .profile-info-row::before{
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 1px;
  background: rgba(60,60,67,.12);
}
.profile-info-label{
  color: var(--tg-hint-color, #8e8e93);
  font-size: 17px;
  font-weight: 400;
}
.profile-info-value{
  color: var(--text-color);
  font-size: 17px;
  font-weight: 400;
  text-align: right;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.dark .profile-info-row{
  background: var(--tg-secondary-bg-color, rgba(255,255,255,.06));
}
body.dark .profile-info-group .profile-info-row + .profile-info-row::before{
  background: rgba(84,84,88,.35);
}

.tg-avatar.tg-avatar-lg{
  width: 72px;
  height: 72px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(127,127,127,.16);
  display: grid;
  place-items: center;
}
.tg-avatar.tg-avatar-lg img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.tg-avatar-fallback{
  width: 100%;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 32px;
  font-weight: 700;
}
.account-display-name, #profile-name{
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
}
.tg-username{
  font-size: 18px;
  color: #2f7cf6;
}
.account-meta{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
}
.tg-id-value-clickable{ cursor: pointer; }
.tg-id-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 17px;
  flex-wrap: wrap;
}
.tg-id-label{
  color: var(--text-color);
  font-weight: 400;
}
.tg-id-value{
  font-weight: 400;
}
.feedback-page-card{
  background: var(--tg-secondary-bg-color, rgba(255,255,255,.88));
  border-radius: 22px;
  padding: 14px 16px;
}
.feedback-page-card textarea {
  width: 100%;
  min-height: 220px;
  resize: none;
  border: 0;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  font: inherit;
  font-size: 17px;
  line-height: 1.35;
  background: transparent;
  color: var(--text-color);
}
.feedback-page-card textarea:focus,
.feedback-page-card textarea:focus-visible{
  outline: none;
  box-shadow: none;
  border: 0;
}
body.dark .feedback-page-card textarea{
  background: transparent;
  border-color: transparent;
}
.feedback-page-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}
.feedback-group{ gap: 0; }
.account-share-btn{
  min-width: 220px;
  border: 0;
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--tg-button-color, #2f7cf6);
  color: var(--tg-button-text-color, #fff);
  border: none;
  box-shadow: none;
}
body.dark .account-share-btn{
  background: var(--tg-button-color, #2f7cf6);
  border-color: transparent;
}
.account-share-btn:active{ transform: scale(.985); }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #323232;
  color: #fff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 999;
}

.toast.show { opacity: 1; }

