/* Visual composition based on the recorded MELD screens. */
:root {
  --surface: #fff;
  --soft: #f0efec;
  --line: #e6e4df;
  --muted: #7b7d77;
  --ink: #24282a;
  --amber: #f6ba2d;
  --pink: #eb3f80;
  --blue: #2563eb;
}
body {
  background: #f7f6f2;
  color: var(--ink);
}
button {
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
button:hover:not(:disabled) {
  border-color: #c8cec8;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
.sidebar {
  width: 254px;
  padding: 22px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
}
.brand {
  gap: 13px;
  padding: 0 4px 25px;
  font-size: 20px;
}
.brand b {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(145deg, #143c37, #1e5950);
  color: #a8e6d3;
  font-size: 32px;
  box-shadow: 0 0 0 5px #edf5f0;
}
.brand small {
  font-size: 11px;
  margin-top: 4px;
}
.sidebar nav {
  border-top: 1px solid #efefeb;
  gap: 5px;
  padding-top: 20px;
}
.sidebar nav button {
  min-height: 47px;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  gap: 12px;
  background: transparent;
  align-items: center;
}
.sidebar nav button[aria-current] {
  background: #fff5e2;
  color: #aa7314;
  box-shadow: inset 2px 0 var(--amber);
}
.sidebar nav button::before {
  content: "◇";
  width: 21px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  color: #626760;
  text-align: center;
}
.sidebar nav button:has(i)::before {
  display: none;
}
.sidebar nav i {
  display: block;
  font-size: 21px;
  color: #626760;
}
.sidebar nav [data-view="profile"]::before {
  content: "▣";
}
.sidebar nav [data-view="plan"]::before {
  content: "◎";
}
.sidebar nav [data-view="household"]::before {
  content: "⌂";
}
.sidebar nav [data-view="maintenance"]::before {
  content: "⚒";
}
.sidebar nav [data-view="subscriptions"]::before {
  content: "↻";
}
.sidebar nav [data-view="reports"]::before {
  content: "▥";
}
.sidebar nav [data-view="health"]::before {
  content: "♡";
}
.sidebar nav [data-view="charts"]::before {
  content: "▤";
}
.sidebar nav [data-view="settings"]::before {
  content: "⚙";
}
.topbar {
  margin-left: 254px;
  height: 69px;
  padding: 0 32px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
#connection {
  font-size: 12px;
  color: #737a73;
  display: flex;
  align-items: center;
  gap: 8px;
}
#connection::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9bfb8;
}
body[data-connection="online"] #connection::before {
  background: #2ebf8c;
}
body[data-connection="offline"] #connection::before {
  background: #e89b34;
}
.topbar #household-switch {
  border-radius: 14px;
  border: 1px solid #c9cfc8;
  padding: 8px 16px;
  font-weight: 700;
  color: #234b41;
}
main {
  margin-left: 254px;
  max-width: 1700px;
  padding: 25px 31px 100px;
}
.heading {
  min-height: 45px;
  margin-bottom: 20px;
  align-items: center;
  gap: 14px;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.8px;
  line-height: 1.2;
}
#greeting {
  font-size: 12px;
  margin-bottom: 7px;
  color: #8b8b80;
}
#transaction-count {
  font-size: 12px;
  margin-top: 5px;
}
body:not([data-view="history"]) #transaction-count,
body:not([data-view="history"]) #history-switcher {
  display: none;
}
#simple {
  border-radius: 25px;
  background: #fff;
  font-size: 11px;
  letter-spacing: 0.3px;
  padding: 7px 12px;
  color: #757b70;
}
#simple[aria-pressed="true"] {
  background: #def4e9;
  color: #0f7a60;
}
.period {
  gap: 9px;
  align-items: center;
  margin-bottom: 15px;
}
.period > select {
  width: 140px;
  max-width: 140px;
  padding: 7px 13px;
  background: #edede9;
  border-radius: 20px;
  font-size: 12px;
}
.period > div:not(#period-tabs) {
  border-radius: 20px;
  background: #edede9;
  min-height: 34px;
  flex: 1;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.period #month {
  font-size: 12px;
  padding: 6px 14px;
}
.period button {
  border: 0;
  background: transparent;
}
.period #prev,
.period #next {
  font-size: 22px;
  color: #797f77;
  padding: 2px 11px;
}
.segmented-control {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #eeede9;
  border-radius: 11px;
  padding: 4px;
}
.segmented-control button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  padding: 7px 13px;
  white-space: nowrap;
}
.segmented-control button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 1px 4px #0000000a;
}
#period-tabs {
  display: none;
}
body[data-view="history"] .period {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
body[data-view="history"] #period-mode {
  display: none;
}
body[data-view="history"] #period-tabs {
  display: flex;
  width: 100%;
  margin-bottom: 0;
}
#period-tabs button {
  flex: 1;
}
body[data-view="history"] .period > div:not(#period-tabs) {
  background: transparent;
  flex: 0 1 auto;
  min-width: 240px;
}
body[data-view="history"] .period #month {
  text-decoration: underline dotted #b6b9af;
  text-underline-offset: 5px;
}
#home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
#home > * {
  grid-column: 1/-1;
  grid-row: auto;
  margin: 0;
}
.balance {
  min-height: 320px;
  border: 2.5px solid #eac04b;
  border-radius: 28px;
  padding: 24px 25px 20px;
  background: linear-gradient(125deg, #121c2e, #223143);
  box-shadow: 0 1px 12px #c9a12723;
}
.balance > .panel-head {
  justify-content: start;
  gap: 9px;
  margin-bottom: 15px;
}
.balance > .panel-head > p {
  margin-right: auto;
  letter-spacing: 1px;
  font-size: 11px;
  color: #c9d4df;
}
.balance .dark-button {
  padding: 4px 9px;
  font-size: 10px;
  background: #243246;
  border-color: #3b4858;
  color: #d3dbe6;
}
.balance > strong {
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: -1.3px;
  margin: 15px 0 10px;
}
.saving {
  font-size: 11px;
}
.saving b {
  color: #56dcaf;
  background: #124d45;
  border-radius: 6px;
  padding: 2px 6px;
}
.cash-net {
  margin-top: 19px;
  border-radius: 12px;
  padding: 13px;
  background: #ffffff09;
  border-color: #ffffff19;
}
.pair {
  gap: 8px;
  margin-top: 8px;
}
.pair > div {
  padding: 13px;
  border-radius: 13px;
  border-color: #ffffff19;
  background: #ffffff07;
}
.pair b {
  font-size: 20px;
  margin-top: 6px;
}
.pair small {
  font-size: 10px;
  letter-spacing: 0.5px;
}
.worth-breakdown {
  font-size: 11px;
  color: #abbacb;
  margin-top: 13px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 1px 3px #20282004;
}
.panel-head {
  margin-bottom: 14px;
}
h2 {
  font-size: 16px;
  letter-spacing: -0.2px;
}
h3 {
  font-size: 14px;
}
.link {
  font-size: 12px;
  color: #4c6e9b;
}
.wallet #wallet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.wallet #wallet li {
  padding: 16px;
  border: 1px solid #e6e9e1;
  border-radius: 12px;
  background: #fbfcf9;
}
.wallet #wallet li > span {
  font-size: 16px;
}
.wallet #wallet li b {
  font-size: 13px;
}
.summary {
  background: linear-gradient(110deg, #202c3c, #111a2c);
  padding: 17px 12px;
  border-radius: 13px;
  font-size: 11px;
  margin: 0;
}
.summary > div + div {
  border-left: 1px solid #ffffff17;
}
.summary b {
  font-size: 20px;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.heatmap-control {
  margin-bottom: 8px;
}
.heatmap-control > button {
  width: min(365px, 100%);
  padding: 7px 12px;
  text-align: left;
  font-size: 12px;
  background: #fff;
  border-color: #eee;
  border-radius: 10px;
}
.heatmap-control > button::before {
  content: "♨";
  background: #ff9062;
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  margin-right: 8px;
}
.heatmap-control > button[aria-pressed="true"] {
  background: #fff1e8;
  border-color: #e7be98;
}
.transaction-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  margin-top: 8px;
}
.transaction-toolbar > label {
  flex: 1;
  margin: 0;
  font-size: 11px;
  gap: 4px;
}
.transaction-toolbar input {
  height: 39px;
  font-size: 13px;
  background: #fafaf8;
}
.transaction-toolbar button {
  flex: none;
  font-size: 12px;
  padding: 9px 12px;
  background: #f0f0eb;
  border: 0;
}
.transaction-toolbar #share-period {
  background: #0d8d79;
  color: #fff;
}
.history-tools {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0;
}
.history-tools label {
  grid-column: auto !important;
  font-size: 12px;
  margin: 0;
}
.history-tools input,
.history-tools select {
  font-size: 13px;
}
.tx {
  border-radius: 12px;
  border: 1px solid #eae5e1;
  padding: 15px 14px;
  gap: 13px;
  margin-bottom: 7px;
}
.tx.expense {
  background: #fcf5f3;
}
.tx.income {
  background: #f0f8f1;
}
.tx.transfer {
  background: #f1f5fb;
}
.tx > .mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 17px;
  background: #ffffffc9;
  border: 1px solid #e4e7da;
  color: #747c62;
}
.tx > div {
  min-width: 0;
  flex: 1;
}
.transaction-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}
.tx > span {
  flex: none;
  font-size: 15px;
  font-weight: 700;
}
.tx small {
  font-size: 10px;
  margin-top: 6px;
  line-height: 1.7;
  background: transparent;
  padding: 0;
  color: #7d837b;
}
.day {
  font-size: 11px;
  color: #61685e;
  gap: 10px;
  margin: 15px 0 10px;
  padding: 0;
  white-space: nowrap;
}
.day::before {
  content: "▦";
  color: #a0a594;
}
.day::after {
  content: "";
  flex: 1;
  border-top: 1px solid #e1e0d7;
}
.activity .tx:last-child {
  margin-bottom: 0;
}
.mark.bank {
  background: #e8f2ec;
}
#entry {
  --entry-accent: #ea3f82;
  --entry-soft: #fff2f5;
  width: min(574px, calc(100vw - 26px));
  padding: 19px;
  border-radius: 19px;
  border: 0;
  border-top: 6px solid var(--entry-accent);
}
#entry[data-kind="income"] {
  --entry-accent: #12a87a;
  --entry-soft: #edf9f3;
}
#entry[data-kind="transfer"] {
  --entry-accent: #3c7adf;
  --entry-soft: #f0f6ff;
}
dialog::backdrop {
  background: #17201c70;
  backdrop-filter: blur(3px);
}
.entry-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.entry-heading h2 {
  font-size: 17px;
}
.entry-heading > button {
  font-size: 23px;
  line-height: 1;
  padding: 5px 9px;
  background: #f1f0ed;
  border: 0;
}
.types {
  margin: 0 0 14px;
  padding: 4px;
  background: #f0efeb;
  border-radius: 10px;
}
.types label {
  font-size: 12px;
  padding: 9px 3px;
}
.types label:has(:checked) {
  background: var(--entry-accent);
  color: #fff;
  border-radius: 8px;
  box-shadow: none;
}
.entry-amount {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--entry-accent) 28%, white);
  background: var(--entry-soft);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
}
.entry-amount > small {
  position: absolute;
  right: 16px;
  top: 13px;
  color: var(--entry-accent);
  font-size: 11px;
  font-weight: 700;
}
.entry-amount > label {
  margin: 0;
  color: var(--entry-accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.entry-amount input {
  font-size: 27px;
  padding: 9px 12px;
  line-height: 1.25;
  background: #fff;
  border-color: #e5dce0;
  font-weight: 650;
}
.entry-amount .actions {
  margin: 8px 0 0;
  gap: 5px;
}
.entry-amount .actions button {
  font-size: 10px;
  padding: 4px 7px;
  background: #ffffff91;
  border-color: #f0dce4;
  color: var(--entry-accent);
}
#entry form > label,
#entry .field-grid label {
  font-size: 11px;
  color: #7b7f75;
  font-weight: 500;
  gap: 6px;
  margin: 14px 0;
}
#entry select,
#entry input:not([type="radio"]) {
  background: #f8f8f5;
  border-color: #e2e4de;
  font-size: 13px;
  border-radius: 11px;
  min-height: 41px;
}
#entry .entry-amount input {
  background: #fff;
  font-size: 27px;
}
#entry .field-grid {
  grid-template-columns: 1fr 125px;
  gap: 8px;
}
.entry-footer {
  position: sticky;
  bottom: -19px;
  display: flex;
  gap: 8px;
  padding: 12px 0 5px;
  background: var(--surface);
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.entry-footer .primary {
  flex: 1;
  background: var(--entry-accent);
  border-color: var(--entry-accent);
  font-weight: 650;
}
.entry-footer #close {
  background: #f3f3ee;
}
#record > button[type="button"] {
  font-size: 11px;
  margin: 3px 4px 0 0;
}
#generic-dialog {
  border-radius: 18px;
  padding: 22px;
  width: min(540px, 94vw);
}
#generic-fields label {
  font-size: 12px;
}
#generic-fields .actions {
  margin-bottom: 0;
}
dialog > form > h2 {
  font-size: 18px;
}
#profile {
  max-width: 850px;
  margin: 0 auto;
}
#profile .profile-tabs {
  gap: 5px;
  padding: 6px;
  border-radius: 14px;
  background: #eeefe8;
  scrollbar-width: thin;
  margin: 14px 0;
}
#profile .profile-tabs button {
  font-size: 12px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
}
#profile .profile-tabs .primary {
  background: #e0e9ff;
  color: #315bb7;
  font-weight: 700;
}
#profile > article:first-child {
  background: linear-gradient(115deg, #edf1fe, #f0f4f7);
  border-color: #dde4f1;
}
#profile > article:first-child p {
  font-size: 12px;
  color: #73808e;
  margin-bottom: 0;
}
#profile .profile-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}
#profile .profile-actions button {
  font-size: 11px;
  padding: 5px 9px;
}
#profile li {
  padding: 17px 4px;
  align-items: flex-start;
}
#profile li > div {
  min-width: 0;
  flex: 1;
}
#profile li > span {
  font-size: 17px;
  white-space: nowrap;
}
#profile li small {
  margin-top: 4px;
  color: #8b9188;
  font-size: 11px;
}
#profile .panel-head > .primary {
  background: var(--blue);
  border-color: var(--blue);
}
.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 17px;
  align-items: start;
}
.feature-grid > .panel {
  margin: 0;
  min-width: 0;
}
.feature-grid .panel > p {
  font-size: 12px;
  line-height: 1.65;
  color: #7b837a;
}
.feature-grid button {
  font-size: 12px;
  padding: 7px 11px;
}
.feature-grid .report-row {
  padding: 13px 0;
}
.feature-grid h2 {
  font-size: 17px;
}
.feature-grid table {
  font-size: 11px;
}
.feature-grid details {
  font-size: 12px;
  margin: 10px 0;
}
.feature-grid summary {
  cursor: pointer;
  color: #63705d;
}
.calendar-grid button {
  border-radius: 12px;
  min-height: 96px;
}
.calendar-grid > b {
  color: #93988b;
}
#home-insights h3 {
  margin-top: 21px;
}
#home-insights p {
  font-size: 12px;
  color: #7a8278;
}
.fab {
  width: 62px;
  height: 62px;
  font-size: 34px;
  background: linear-gradient(140deg, #ffd448, #ffb900);
  border: 3px solid #ffe494;
  color: #724500;
  box-shadow:
    0 0 0 4px #f6bd2940,
    0 3px 15px #b6953c35;
  right: 28px;
  bottom: 27px;
}
.inline-add {
  width: auto;
  height: auto;
  border-radius: 12px;
  font-size: 25px;
}
footer {
  font-size: 10px;
  color: #999e93;
  margin-top: 30px;
}
#notice {
  font-size: 12px;
}
[data-theme="dark"] {
  --surface: #202d39;
  --soft: #293643;
  --line: #394852;
  --ink: #e5ebe8;
  --muted: #a2ada5;
}
[data-theme="dark"] body {
  background: #131d25;
  color: var(--ink);
}
[data-theme="dark"] .sidebar,
[data-theme="dark"] .topbar,
[data-theme="dark"] .transaction-toolbar,
[data-theme="dark"] .history-tools {
  background: var(--surface);
}
[data-theme="dark"] .segmented-control,
[data-theme="dark"] .entry-heading > button {
  background: #293643;
}
[data-theme="dark"] #entry {
  --entry-soft: #342a33;
}
[data-theme="dark"] #entry input,
[data-theme="dark"] #entry select,
[data-theme="dark"] .transaction-toolbar input {
  background: #253440;
  color: #e4ebe5;
}
[data-theme="dark"] #profile > article:first-child {
  background: #273749;
}
[data-theme="dark"] .wallet #wallet li {
  background: #25362f;
  border-color: #38493f;
}
@media (max-width: 960px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 0;
    border: 0;
  }
  .brand {
    display: none;
  }
  .sidebar nav {
    position: fixed;
    inset: auto 0 0;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    background: var(--surface);
    gap: 0;
    padding: 5px 6px max(5px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    overflow-x: auto;
    z-index: 10;
  }
  .sidebar nav button {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 76px;
    flex: 0 0 auto;
    padding: 5px 7px;
    font-size: 10px;
    border-radius: 8px;
    min-height: 52px;
  }
  .sidebar nav button::before,
  .sidebar nav i {
    font-size: 20px;
    width: auto;
    height: 22px;
    display: block;
  }
  .sidebar nav button:has(i)::before {
    display: none;
  }
  .sidebar nav button[aria-current] {
    box-shadow: none;
    background: #fff7e9;
  }
  .topbar {
    margin-left: 0;
    height: 57px;
    padding: 0 15px;
  }
  #connection {
    font-size: 10px;
  }
  .topbar #household-switch {
    font-size: 12px;
    padding: 6px 10px;
  }
  main {
    margin-left: 0;
    padding: 20px 14px 105px;
  }
  .heading {
    margin-bottom: 17px;
  }
  h1 {
    font-size: 25px;
  }
  #greeting {
    font-size: 11px;
  }
  .balance {
    padding: 20px 18px 17px;
    border-radius: 26px;
    min-height: 0;
  }
  .balance > strong {
    font-size: 35px;
  }
  .balance > .panel-head {
    gap: 5px;
  }
  .balance .dark-button {
    font-size: 9px;
    padding: 3px 6px;
  }
  .pair b {
    font-size: 18px;
  }
  .panel {
    padding: 16px;
  }
  .wallet #wallet {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .wallet #wallet li {
    padding: 13px;
    font-size: 12px;
  }
  .wallet #wallet li > span {
    font-size: 14px;
  }
  .summary b {
    font-size: 16px;
  }
  .segmented-control button {
    padding: 6px 10px;
    font-size: 11px;
  }
  .period {
    gap: 6px;
  }
  .period > select {
    max-width: 110px;
  }
  .transaction-toolbar {
    flex-wrap: wrap;
    padding: 9px;
    gap: 6px;
  }
  .transaction-toolbar > label {
    flex-basis: 100%;
    min-width: 0;
  }
  .transaction-toolbar button {
    font-size: 11px;
    padding: 7px 11px;
    flex: 1;
  }
  .history-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tx {
    padding: 13px 10px;
    gap: 9px;
  }
  .transaction-name {
    font-size: 13px;
  }
  .tx > span {
    font-size: 13px;
  }
  .tx > .mark {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .tx small {
    font-size: 10px;
  }
  .fab {
    width: 57px;
    height: 57px;
    right: 17px;
    bottom: 85px;
  }
  #entry {
    padding: 15px;
    border-radius: 17px;
    width: calc(100vw - 20px);
    max-height: 92vh;
  }
  #entry .entry-amount input {
    font-size: 25px;
  }
  .entry-footer {
    bottom: -15px;
  }
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .calendar-grid > button {
    min-height: 69px;
  }
  .calendar-grid small {
    font-size: 9px;
  }
  .profile-actions {
    gap: 4px;
  }
  #profile .profile-tabs button {
    font-size: 11px;
    padding: 8px 10px;
  }
}

body[data-view="history"] #period-tabs {
  flex: 0 0 100%;
}
.sidebar nav {
  scrollbar-width: none;
}
.sidebar nav::-webkit-scrollbar {
  display: none;
}
@media (max-width: 960px) {
  #entry {
    width: min(574px, calc(100vw - 20px));
  }
}
