.profile-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  text-align: left;
}
.profile-card,
.profile-backup-card,
.profile-tab-settings-card,
.profile-custom-tabs-card {
  background: #1f1f1f;
  border: 1px solid #3a3a3a;
  border-radius: 16px;
  padding: 18px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.22);
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-avatar-wrap {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  position: relative;
}
.profile-avatar,
.profile-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid #555;
  background: #303030;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  color: #aaa;
  font-size: 1.5rem;
  font-weight: 900;
}
.profile-avatar.hidden,
.profile-avatar-fallback.hidden {
  display: none;
}
.profile-copy {
  min-width: 0;
}
.profile-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
}
.profile-user-info {
  font-size: 0.9rem;
  color: #c7c7c7;
  line-height: 1.45;
  word-break: break-word;
}
.profile-actions,
.profile-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-action-btn {
  background: #3a3a3a;
  border: 1px solid #555;
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
}
.profile-action-btn:hover {
  background: #4a4a4a;
  transform: translateY(-1px);
}
.profile-action-btn.primary {
  background: #2563eb;
  border-color: #3b82f6;
}
.profile-action-btn.primary:hover {
  background: #1d4ed8;
}
.profile-backup-title {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
}
.profile-backup-desc {
  margin: 4px 0 12px;
  color: #aaa;
  font-size: 0.85rem;
  line-height: 1.45;
}
.profile-tab-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-tab-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid #3f3f3f;
  border-radius: 12px;
  background: #292929;
}
.profile-tab-setting-name {
  color: #e8e8e8;
  font-size: 0.88rem;
  font-weight: 800;
}
.profile-tab-setting-row > button {
  padding: 6px 10px;
  border: 1px solid #505050;
  border-radius: 8px;
  background: #363636;
  color: #d8d8d8;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}
.profile-tab-setting-row > button:hover {
  background: #484848;
  color: #fff;
}
.profile-tab-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.profile-tab-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.profile-toggle-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: #555;
  transition: background 0.18s;
}
.profile-toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s;
}
.profile-tab-toggle input:checked + .profile-toggle-switch {
  background: #2563eb;
}
.profile-tab-toggle input:checked + .profile-toggle-switch::after {
  transform: translateX(16px);
}
.profile-tab-toggle input:focus-visible + .profile-toggle-switch {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.profile-tab-settings-card > .profile-action-btn {
  margin-top: 12px;
}
.profile-custom-tab-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.profile-custom-tab-empty {
  padding: 12px;
  border: 1px dashed #444;
  border-radius: 12px;
  color: #888;
  font-size: 0.84rem;
  text-align: center;
}
.profile-custom-tab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #3f3f3f;
  border-radius: 12px;
  background: #292929;
}
.profile-custom-tab-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.profile-custom-tab-info > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: #bdbdbd;
}
.profile-custom-tab-info > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-custom-tab-info strong,
.profile-custom-tab-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-custom-tab-info span {
  max-width: 430px;
  color: #909090;
  font-size: 0.76rem;
}
.profile-custom-tab-actions {
  display: flex;
  gap: 6px;
}
.profile-custom-tab-actions button {
  padding: 6px 9px;
  border: 1px solid #505050;
  border-radius: 8px;
  background: #363636;
  color: #ddd;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}
.profile-custom-tab-actions button:hover {
  background: #464646;
}
.main-custom-tab-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}
.main-custom-tab-modal.hidden {
  display: none;
}
.main-custom-tab-dialog {
  width: min(100%, 460px);
  padding: 20px;
  border: 1px solid #484848;
  border-radius: 16px;
  background: #242424;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.main-custom-tab-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.main-custom-tab-dialog-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
}
.main-custom-tab-dialog-header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #383838;
  color: #ddd;
  font-size: 1.35rem;
  cursor: pointer;
}
.main-custom-tab-field,
.main-custom-tab-icon-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}
.main-custom-tab-field > span,
.main-custom-tab-icon-field legend {
  color: #cfcfcf;
  font-size: 0.82rem;
  font-weight: 800;
}
.main-custom-tab-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #4b4b4b;
  border-radius: 10px;
  outline: none;
  background: #171717;
  color: #fff;
}
.main-custom-tab-field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.main-custom-tab-icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-top: 7px;
}
.main-custom-tab-icon-option {
  aspect-ratio: 1;
  border: 1px solid #494949;
  border-radius: 10px;
  background: #303030;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.main-custom-tab-icon-option svg {
  width: 21px;
  height: 21px;
}
.main-custom-tab-icon-option:hover,
.main-custom-tab-icon-option.active {
  border-color: #3b82f6;
  background: #1d3b68;
  color: #fff;
}
.main-custom-tab-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.main-custom-tab-section.active {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
body.custom-tab-view-active {
  height: 100dvh;
  overflow-y: hidden;
}
body.custom-tab-view-active .site-footer {
  display: none;
}
body.custom-tab-view-active .main-custom-tab-section.active {
  position: fixed;
  top: 55px;
  bottom: 16px;
  left: 50%;
  z-index: 1;
  width: calc(100% - 32px);
  max-height: none;
  transform: translateX(-50%);
}
.main-custom-tab-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid #3a3a3a;
  background: #202020;
  text-align: left;
}
.main-custom-tab-view-header > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.main-custom-tab-view-header strong,
.main-custom-tab-view-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main-custom-tab-view-header strong {
  color: #fff;
  font-size: 0.92rem;
}
.main-custom-tab-view-header span {
  color: #888;
  font-size: 0.72rem;
}
.main-custom-tab-view-header button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 8px;
  border: 1px solid #494949;
  border-radius: 10px;
  background: #303030;
  color: #ccc;
  cursor: pointer;
}
.main-custom-tab-view-header button:hover {
  background: #414141;
  color: #fff;
}
.main-custom-tab-view-header svg {
  width: 100%;
  height: 100%;
}
#mainCustomTabFrame {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  border: 0;
  background: #111;
  color-scheme: dark;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scrollbar-width: thin;
}
@media (max-width: 520px) {
  .profile-custom-tab-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .profile-custom-tab-info,
  .profile-custom-tab-info > div,
  .profile-custom-tab-info span {
    width: 100%;
    max-width: none;
  }
  .profile-custom-tab-actions {
    align-self: flex-end;
  }
}
