/* Financial profile and savings targets. */

#profile {
  max-width: 680px;
}
.profile-shell {
  --chapter-tint: #dae6fc;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  overflow: hidden;
}
.profile-shell[data-chapter="investments"],
#profile-tab-investments {
  --chapter-tint: #fce9c9;
}
.profile-shell[data-chapter="assets"],
#profile-tab-assets {
  --chapter-tint: #d4eee3;
}
.profile-shell[data-chapter="cards"],
#profile-tab-cards {
  --chapter-tint: #e6e0fa;
}
.profile-shell[data-chapter="debts"],
#profile-tab-debts {
  --chapter-tint: #fbdedb;
}
.profile-shell[data-chapter="receivables"],
#profile-tab-receivables {
  --chapter-tint: #d4eeef;
}
.profile-shell[data-chapter="incomes"],
#profile-tab-incomes {
  --chapter-tint: #e6f0d4;
}
#profile .profile-tabs {
  margin: 0;
  border-radius: 0;
  padding: 7px 10px;
  justify-content: space-between;
  background: var(--surface);
}
#profile .profile-tabs button {
  min-height: 44px;
  min-width: 3.25rem;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
#profile .profile-tabs button[aria-selected="true"] {
  background: color-mix(in srgb, var(--chapter-tint) 76%, var(--surface));
  color: #182942;
  font-weight: 700;
}
#profile .profile-tabs button[data-icon]::before {
  content: attr(data-icon) / "";
  font-size: 15px;
}
.profile-hero {
  min-height: 172px;
  padding: clamp(17px, 3.4vw, 27px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--chapter-tint);
  color: #182942;
  border-radius: 0 0 34% 10px / 0 0 19px 10px;
}
.profile-hero h2 {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}
.profile-hero strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(23px, 5vw, 37px);
  line-height: 1.12;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.profile-hero p {
  margin: 7px 0 0;
  font-size: 12px;
  color: #42546c;
}
.profile-hero-icon {
  flex: none;
  display: grid;
  place-items: center;
  background: #ffffff55;
  width: clamp(55px, 12vw, 96px);
  aspect-ratio: 1;
  border: 1px solid #ffffff9c;
  border-radius: 23px;
  font-size: clamp(28px, 6vw, 48px);
  transform: rotate(-7deg);
}
.profile-add,
#goals .goals-heading > .primary {
  background: #255bc5;
  border-color: #255bc5;
  color: white;
  font-weight: 650;
}
.profile-hero .profile-add {
  margin-top: 15px;
}
.profile-body {
  min-height: 200px;
  padding: 19px clamp(13px, 3vw, 26px) 23px;
}
.profile-body > p,
.profile-account-history p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 12px;
}
.profile-empty {
  min-height: 275px;
  display: grid;
  place-items: center;
  justify-content: center;
  align-content: center;
  gap: 9px;
  text-align: center;
}
.profile-empty > span {
  display: grid;
  place-items: center;
  font-size: 43px;
  width: 75px;
  aspect-ratio: 1;
  border-radius: 22px;
  background: var(--chapter-tint);
}
.profile-empty h3 {
  font-size: 17px;
}
.profile-empty p {
  max-width: 36ch;
  margin: 0;
}
.profile-empty button {
  margin-top: 5px;
}
.profile-account-history {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 13px;
}
.profile-account-history summary,
.profile-records summary {
  cursor: pointer;
  font-weight: 600;
}
.profile-account-ribbon {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin: 8px 0 17px;
}
.profile-account-ribbon button {
  border: 0;
  min-width: 76px;
  min-height: 58px;
  flex: var(--account-weight, 1) 1 0;
  margin: 2px;
  text-align: start;
  overflow: hidden;
  background: #216654;
  color: white;
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.profile-account-ribbon button[data-tone="1"] {
  background: #27579d;
}
.profile-account-ribbon button[data-tone="2"] {
  background: #3d5b72;
}
.profile-account-ribbon small {
  display: block;
  font-weight: 500;
}
.profile-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
  padding: 9px 0 5px;
  color: var(--muted);
  font-size: 12px;
}
.profile-records {
  margin: 0;
}
#profile .profile-records li {
  padding: 13px 6px;
  gap: 7px 20px;
  flex-wrap: wrap;
}
#profile .profile-records li > div {
  flex: 1 1 180px;
}
#profile .profile-records li > span {
  font-size: 15px;
}
#profile .profile-records li[data-highlighted="true"] {
  border-radius: 8px;
  background: var(--soft);
  outline: 1px solid #4274b0;
}
.profile-records details {
  font-size: 12px;
  margin: 10px 0 0;
}
.profile-records img {
  display: block;
  max-height: 72px;
  margin-top: 7px;
  object-fit: cover;
  border-radius: 8px;
}
.profile-card-rail {
  display: flex;
  overflow-x: auto;
  align-items: stretch;
  scroll-snap-type: x mandatory;
  padding: 4px;
  gap: 10px;
  scrollbar-width: thin;
}
.profile-card-rail .profile-credit-card {
  flex: 0 0 min(254px, 83%);
  min-height: 145px;
  scroll-snap-align: start;
  display: grid;
  justify-items: start;
  align-content: space-between;
  gap: 8px;
  overflow-wrap: anywhere;
  text-align: left;
  border: 1px solid #163e66;
  border-radius: 15px;
  background: linear-gradient(137deg, #2e5681, #0c2442);
  color: white;
  font-weight: 650;
  box-shadow: inset -20px -10px 25px #ffffff10;
}
.profile-card-rail .profile-credit-card[data-tone="1"] {
  background: linear-gradient(140deg, #7d3c3e, #4a1222);
}
.profile-card-rail .profile-credit-card[data-tone="2"] {
  background: linear-gradient(140deg, #285c54, #193b30);
}
.profile-card-rail .profile-credit-card[aria-pressed="true"] {
  outline: 2px solid #588bde;
}
.profile-credit-card small {
  color: #e0eaff;
}
.profile-credit-card .profile-credit-chip {
  width: 28px;
  height: 20px;
  border: 1px solid #ae8037;
  border-radius: 5px;
  background: linear-gradient(130deg, #f6dda4, #b79041);
}
.profile-timeline {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
#profile .profile-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-left: 8px;
  padding: 9px 6px 9px 20px;
  border-top: 0;
  border-inline-start: 2px solid var(--line);
}
.profile-timeline li::before {
  content: "";
  position: absolute;
  width: 9px;
  aspect-ratio: 1;
  inset: 17px auto auto -6px;
  background: #255bc5;
  border-radius: 50%;
}
.profile-timeline li[data-direction="in"]::before {
  background: #168062;
}
.profile-timeline li[data-direction="out"]::before {
  background: #c34454;
}
.profile-timeline li button {
  justify-self: start;
  padding: 4px 8px;
}
.profile-timeline li time {
  color: var(--muted);
  font-size: 11px;
}
.profile-timeline li[data-direction] time {
  grid-column: 1/-1;
}

.goals-layout {
  display: grid;
  gap: 15px;
}
.goals-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px 16px;
}
.goals-heading details {
  min-width: 0;
}
.goals-heading details summary {
  display: inline list-item;
  cursor: pointer;
  color: var(--ink);
}
.goals-heading details p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.goals-heading > button {
  flex: 0 0 auto;
}
.goals-summary {
  padding: clamp(16px, 3vw, 27px);
  border-radius: 16px;
  background:
    radial-gradient(circle at 95% 4%, #3a577a75, transparent 42%),
    linear-gradient(115deg, #152034, #25394b);
  color: #f2f6ff;
}
.goals-summary h2 {
  font-size: 13px;
  color: #e2eaf7;
}
.goals-summary > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-size: 12px;
}
.goals-summary strong {
  font-size: 34px;
  line-height: 1;
}
.goals-summary p {
  margin: 8px 0;
  font-size: 13px;
  color: #d1ddec;
}
#goals progress {
  accent-color: var(--goal-color, #36bac4);
  width: 100%;
  height: 12px;
}
.goal-empty {
  text-align: center;
  padding: 30px 16px;
}
.goal-empty p {
  color: var(--muted);
}
.goals-toolbar {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  margin: 0;
}
.goals-toolbar label {
  margin: 0;
  min-width: 0;
  gap: 5px;
  font-size: 12px;
}
.goals-toolbar input,
.goals-toolbar select {
  min-width: 0;
  font-size: 13px;
}
.goals-count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.goal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}
.goal-grid > p {
  grid-column: 1/-1;
  color: var(--muted);
}
.goal-card {
  display: grid;
  gap: 12px;
  margin: 0;
  min-width: 0;
}
.goal-card > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.goal-card > header button {
  padding: 5px 8px;
  font-size: 11px;
}
.goal-mode {
  margin-right: auto;
  border-radius: 20px;
  background: var(--soft);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.goal-overview {
  display: grid;
  grid-template-columns: minmax(68px, 0.55fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(9px, 2vw, 19px);
}
.goal-gauge {
  position: relative;
  width: min(100%, 118px);
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  border-radius: 50%;
  isolation: isolate;
  background: conic-gradient(
    var(--goal-color) var(--goal-progress, 0%),
    var(--line) 0
  );
}
.goal-gauge::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: -1;
  border-radius: 50%;
  background: var(--surface);
}
.goal-gauge span {
  font-size: clamp(16px, 3vw, 24px);
}
.goal-gauge strong {
  font-size: clamp(17px, 3vw, 25px);
}
.goal-overview h3 {
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.goal-overview small {
  color: var(--muted);
  font-size: 11px;
}
.goal-overview dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 6px;
  margin: 8px 0 0;
  font-size: 12px;
}
.goal-overview dt {
  color: var(--muted);
}
.goal-overview dd {
  margin: 0;
  text-align: end;
  overflow-wrap: anywhere;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.goal-pace,
.goal-warning {
  margin: 0;
  padding: 9px 11px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.4;
}
.goal-warning {
  color: var(--ink);
  border: 1px solid #c47938;
}
.goal-card .goal-allocate {
  background: var(--goal-color);
  border-color: var(--goal-color);
  color: white;
  font-weight: 650;
}
.goal-trajectory {
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.goal-trajectory summary {
  cursor: pointer;
  font-weight: 650;
}
.goal-trajectory > p {
  color: var(--muted);
  line-height: 1.5;
}
.goal-trajectory ol {
  list-style: none;
  margin: 4px 0 6px;
  padding: 0;
}
.goal-trajectory li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
}
.goal-allocation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.goal-allocation p {
  margin: 0;
  overflow-wrap: anywhere;
}
.goal-allocation button {
  padding: 5px 8px;
  font-size: 11px;
}

#household .feature-grid {
  grid-template-columns: minmax(0, 1fr);
}
.household-notes .household-tabs {
  overflow-x: auto;
  margin: 12px 0;
}
.household-notes .household-tabs button {
  flex: 0 0 auto;
}
.household-daybar {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin: 9px 0;
  padding: 3px;
}
.household-daybar button {
  flex: 0 0 auto;
  min-width: 50px;
  min-height: 44px;
}
.household-daybar button[aria-pressed="true"] {
  background: #1a6e65;
  color: white;
}
#household .household-notes > article {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
#household .household-notes > article h3 {
  overflow-wrap: anywhere;
}
#household .household-notes > article p {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.household-notes .household-shopping-toggle {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 7px;
  align-items: center;
  margin: 0 0 0 12px;
}
.household-shopping-toggle input {
  width: auto;
  accent-color: #1a6e65;
}

@media (max-width: 680px) {
  #profile .profile-tabs {
    justify-content: flex-start;
  }
  #profile .profile-tabs button {
    min-height: 40px;
    min-width: 36px;
    gap: 3px;
  }
  #profile .profile-tabs button:not([aria-selected="true"]) {
    font-size: 0;
  }
  .goals-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .goal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

[data-theme="dark"] .profile-hero {
  background: color-mix(in srgb, var(--chapter-tint) 24%, var(--surface));
  color: var(--ink);
}
[data-theme="dark"] .profile-hero p {
  color: #e0e8f0;
}
[data-theme="dark"] .profile-hero-icon {
  background: #ffffff11;
  border-color: #ffffff27;
}
