.profile-only {
  display: none;
}

.profile-page {
  gap: 16px;
  padding-bottom: 96px;
}

body.view-settings:not(.settings-import) #wardProfile.profile-page {
  display: grid !important;
}

.profile-meeting-controls{display:grid;grid-template-columns:118px minmax(160px,1fr);gap:8px;align-items:center}.profile-meeting-controls input,.profile-meeting-controls select{width:100%;box-sizing:border-box}
.profile-bishopric-controls{display:grid;grid-template-columns:repeat(2,minmax(140px,1fr));gap:8px}.profile-bishopric-controls label{display:grid;gap:5px;color:#6e7075;font-size:.72rem;font-weight:740}.profile-bishopric-controls input,.profile-bishopric-controls select{width:100%;box-sizing:border-box}.profile-bishopric-controls select{grid-column:1/-1}
@media(max-width:620px){.profile-meeting-controls,.profile-bishopric-controls{grid-template-columns:1fr}.profile-meeting-controls input,.profile-meeting-controls select,.profile-bishopric-controls input,.profile-bishopric-controls select{min-height:44px}.profile-bishopric-controls select{grid-column:auto}}

.profile-hero,
.profile-knowledge,
.profile-section {
  margin: 0;
}

.profile-hero-grid,
.profile-knowledge-head,
.profile-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.8rem, 5vw, 2.65rem);
}

.profile-intro,
.profile-section-head p,
.profile-knowledge-head p,
.profile-side-note {
  margin: 0;
  color: #6e6e73;
  line-height: 1.45;
}

.profile-completion {
  min-width: 90px;
  padding: 13px;
  border-radius: 17px;
  background: #eef6fd;
  text-align: center;
}

.profile-completion strong,
.profile-completion span {
  display: block;
}

.profile-completion strong {
  color: #1769aa;
  font-size: 1.35rem;
}

.profile-completion span {
  margin-top: 2px;
  color: #58748a;
  font-size: .72rem;
  font-weight: 750;
}

.profile-save-state,
.profile-save-floating {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6e6e73;
  font-size: .76rem;
}

.profile-save-state {
  margin-top: 12px;
}

.profile-save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #35a168;
}

.profile-save-state.saving .profile-save-dot,
.profile-save-floating.saving .profile-save-dot {
  background: #d4932c;
}

.profile-save-state.error .profile-save-dot,
.profile-save-floating.error .profile-save-dot {
  background: #b7473d;
}

.profile-knowledge {
  display: grid;
  gap: 13px;
}

.profile-rule-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6fd;
  color: #1769aa;
  font-size: .73rem;
  font-weight: 760;
  white-space: nowrap;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.knowledge-grid > * {
  padding: 11px 12px;
  border-radius: 14px;
  background: #f7f8fa;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-sidebar {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
}

.profile-search input,
.profile-setting-row input:not([type="checkbox"]),
.profile-setting-row select,
.profile-setting-row textarea,
.profile-selection-search {
  width: 100%;
  border: 1px solid #d7d7dc;
  border-radius: 12px;
  padding: 10px 11px;
  background: #fff;
  color: inherit;
  font: inherit;
}

.profile-side-nav {
  display: grid;
  overflow: hidden;
  border: 1px solid #e4e4e8;
  border-radius: 16px;
  background: #fff;
}

.profile-side-nav button {
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid #ededf0;
  padding: 9px 12px;
  background: transparent;
  color: #4f5963;
  text-align: left;
  font: inherit;
  font-size: .78rem;
  font-weight: 720;
}

.profile-side-nav button:last-child {
  border-bottom: 0;
}

.profile-side-nav button.active {
  background: #eef6fd;
  color: #1769aa;
}

.profile-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.profile-section {
  padding: 0;
  overflow: hidden;
}

.profile-section-head {
  padding: 17px 18px 13px;
}

.profile-section-head h3,
.profile-knowledge h3 {
  margin: 0 0 4px;
}

.profile-setting-list {
  border-top: 1px solid #ececef;
}

.profile-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 42%);
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
}

.profile-setting-row + .profile-setting-row {
  border-top: 1px solid #ececef;
}

.profile-setting-copy strong,
.profile-setting-copy small {
  display: block;
}

.profile-setting-copy small {
  margin-top: 3px;
  color: #73737a;
  font-size: .76rem;
  line-height: 1.35;
}

.profile-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.profile-control textarea {
  min-height: 78px;
  resize: vertical;
}

.profile-value-note,
.profile-future {
  color: #717178;
  font-size: .72rem;
}

.profile-future {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f0f0f3;
  font-weight: 760;
}

.profile-switch {
  position: relative;
  display: inline-flex;
  flex: none;
}

.profile-switch input {
  position: absolute;
  opacity: 0;
}

.profile-switch span {
  position: relative;
  width: 45px;
  height: 27px;
  border-radius: 999px;
  background: #d5d5da;
}

.profile-switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transition: transform .16s;
}

.profile-switch input:checked + span {
  background: #4f9edb;
}

.profile-switch input:checked + span::after {
  transform: translateX(18px);
}

.profile-action,
.profile-multi-select {
  min-height: 40px;
  border: 1px solid rgba(23, 105, 170, .16);
  border-radius: 12px;
  padding: 9px 12px;
  background: #eef6fd;
  color: #1769aa;
  font: inherit;
  font-weight: 760;
}

.profile-multi-select {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.profile-multi-select strong,
.profile-multi-select small {
  display: block;
}

.profile-multi-select small {
  margin-top: 2px;
  color: #657b8b;
}

.profile-action.destructive {
  color: #983f37;
  background: #fff1ef;
}

.profile-restore-input {
  display: none;
}

.profile-save-floating {
  position: sticky;
  bottom: calc(72px + env(safe-area-inset-bottom));
  justify-self: center;
  z-index: 7;
  padding: 8px 13px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  backdrop-filter: blur(14px);
}

.profile-dialog-body {
  display: grid;
  gap: 14px;
  min-width: min(520px, calc(100vw - 42px));
}

.profile-selection-list,
.profile-history-list {
  display: grid;
  gap: 7px;
  max-height: 55vh;
  overflow: auto;
}

.profile-selection-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e5e5e8;
  border-radius: 12px;
}

.profile-selection-item strong,
.profile-selection-item small {
  display: block;
}

.profile-selection-item small {
  color: #73737a;
}

@media (max-width: 760px) {
  .profile-hero-grid,
  .profile-knowledge-head {
    align-items: flex-start;
  }

  .knowledge-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    position: static;
  }

  .profile-side-nav {
    display: flex;
    overflow-x: auto;
    border-radius: 14px;
    scrollbar-width: none;
  }

  .profile-side-nav button {
    flex: none;
    border-bottom: 0;
    border-right: 1px solid #ededf0;
    white-space: nowrap;
  }

  .profile-side-note {
    display: none;
  }

  .profile-setting-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 13px 15px;
  }

  .profile-control {
    justify-content: flex-start;
  }

  .profile-control > input:not([type="checkbox"]),
  .profile-control > select,
  .profile-control > textarea {
    width: 100%;
  }
}
