@font-face {
  font-family: "Gilroy";
  src: url("font/Gilroy-Regular.woff") format("woff");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "Gilroy Bold";
  src: url("font/Gilroy-Bold.woff") format("woff");
  font-weight: bold;
  font-style: normal;
}

body {
  margin: 0;
  background-color: #222;
  font-family: "Gilroy";
  /* Use min-height so content longer than the viewport can scroll naturally
     and the dynamic-viewport unit smooths over the address-bar resize that
     causes the inconsistent purple gap between mobile browsers. */
  min-height: 100vh;
  min-height: 100dvh;
}

* {
  font-family: "Gilroy";
  list-style: none;
  text-decoration: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* REMOVE SPINNERS FROM NUMBER INPUT */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

.budget-container {
  position: relative;
  width: 360px;
  margin: 0 auto;
  /* Flex column so the dashboard keeps its natural size and the footer
     absorbs whatever vertical space the viewport contributes — turning the
     previously inconsistent purple gap into intentional, branded chrome. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #2a0355;
  box-sizing: border-box;
}

/* On taller screens, render the app like a phone mockup: content-sized
   card, rounded corners, and a soft shadow framed by the dark page bg. */
@media (min-height: 900px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
    box-sizing: border-box;
  }
  .budget-container {
    margin: 0;
    min-height: 0;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  }
}

.budget-container .app-title {
  margin-top: 20px;
  margin-left: 20px;
}

/* Language switcher — segmented pill in the top-right of the app card.
   Two flavours are shipped: the default (dark surface, used on the purple
   container) and `.lang-switcher-light` for white surfaces like the privacy
   policy card. */
.lang-switcher {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  z-index: 5;
}

.lang-switcher .lang-option {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78em;
  font-family: "Gilroy Bold";
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switcher .lang-option:hover {
  color: #fff;
}

.lang-switcher .lang-option.active {
  background-color: #fff;
  color: #2a0355;
}

.lang-switcher .lang-option:focus-visible {
  outline: 2px solid #f7b801;
  outline-offset: 2px;
}

.lang-switcher-light {
  background-color: #efe7fb;
}

.lang-switcher-light .lang-option {
  color: #2a0355;
}

.lang-switcher-light .lang-option:hover {
  color: #1a0034;
}

.lang-switcher-light .lang-option.active {
  background-color: #2a0355;
  color: #fff;
}

.budget-container .app-title a {
  color: #fff;
}
.budget-container .app-title a b {
  font-family: "Gilroy Bold";
}

.budget-header {
}

.budget-header .balance {
  margin-top: 25px;
  margin-left: 20px;
}

.budget-header .balance .title {
  color: #fff;
  font-size: 1em;
  font-family: "Gilroy Bold";
}

.budget-header .balance .value {
  color: #fff;
  font-size: 2em;
  margin-top: 10px;
  font-family: "Gilroy Bold";
}

.budget-header .account {
  display: block;
  width: 310px;
  margin: 25px auto 0;
  line-height: 1.7em;
  text-align: center;
}

.budget-header .account .income,
.chart,
.outcome {
  height: 50px;
  display: inline-block;
  width: 100px;
  vertical-align: middle;
}

.budget-header .account .income .title {
  color: #fff;
  opacity: 0.5;
}
.budget-header .account .income .income-total {
  color: #fff;
  font-family: "Gilroy Bold";
}

.budget-header .account .outcome .title {
  color: #fff;
  opacity: 0.5;
}
.budget-header .account .outcome .outcome-total {
  color: #f0624d;
  font-family: "Gilroy Bold";
}

/**************   DASHBOARD    ***********/
.budget-dashboard {
  display: block;
  width: 360px;
  min-height: 470px;
  background-color: #fff;
  margin-top: 35px;
  border-radius: 30px 30px 0 0;
}

.budget-dashboard .dash-title {
  display: inline-block;
  color: #1a0034;
  font-size: 1.7em;
  margin-left: 20px;
  margin-top: 30px;
  font-family: "Gilroy Bold";
}

.toggle {
  display: block;
  margin-top: 30px;
  margin-left: 20px;
}

.toggle .first-tab,
.toggle .second-tab,
.toggle .third-tab {
  display: inline-block;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 1.1em;
  color: #1a0034;
  font-family: "Gilroy Bold";
  opacity: 0.4;
}

.toggle .second-tab,
.third-tab {
  margin-left: 10px;
}

.focus {
  opacity: 1 !important;
}

.toggle button:focus-visible,
.budget-dashboard .input button:focus-visible,
.budget-dashboard ul.list li .action-btn:focus-visible,
.modal-overlay .modal-ok:focus-visible {
  outline: 3px solid #f7b801;
  outline-offset: 3px;
}

.hide {
  display: none;
}

.budget-dashboard input {
  /* MAKE INPUT SELECTABLE */
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

/* Modal alert dialog — surfaces validation feedback as a popup instead of
   inline UI noise. Fixed positioning with a flex centering pattern so it
   sits over everything regardless of viewport size. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.modal-overlay.hide {
  display: none;
}

.modal-overlay .modal {
  background-color: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 320px;
  padding: 24px 24px 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  text-align: center;
  box-sizing: border-box;
}

.modal-overlay .modal-title {
  margin: 0 0 12px;
  color: #1a0034;
  font-family: "Gilroy Bold";
  font-size: 1.2em;
}

.modal-overlay .modal-message {
  margin: 0 0 20px;
  color: #1a0034;
  font-family: "Gilroy";
  font-size: 1em;
  line-height: 1.4;
  word-wrap: break-word;
}

.modal-overlay .modal-ok {
  display: inline-block;
  min-width: 100px;
  padding: 10px 20px;
  background-color: #2a0355;
  color: #fff;
  font-family: "Gilroy Bold";
  font-size: 1em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.modal-overlay .modal-ok:hover,
.modal-overlay .modal-ok:focus {
  background-color: #3d0a78;
  outline: none;
}

.cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-radius: 20px;
  background-color: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  z-index: 1100;
  box-sizing: border-box;
}

.cookie-banner.hide,
.cookie-banner[hidden] {
  display: none;
}

.cookie-banner-copy {
  max-width: 620px;
}

.cookie-banner-title {
  margin: 0 0 8px;
  color: #1a0034;
  font-family: "Gilroy Bold";
  font-size: 1.15em;
}

.cookie-banner-description {
  margin: 0;
  color: #35244e;
  font-size: 0.96em;
  line-height: 1.5;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-btn {
  min-width: 108px;
  padding: 11px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.95em;
  font-family: "Gilroy Bold";
}

.cookie-btn-primary {
  background-color: #2a0355;
  color: #fff;
}

.cookie-btn-secondary {
  background-color: #efe9f8;
  color: #2a0355;
}

.cookie-btn:hover,
.cookie-btn:focus-visible {
  filter: brightness(0.97);
}

/* ////////// ALL ///////////// */
.budget-dashboard #all {
  width: 360px;
  height: auto;
  position: relative;
}
.budget-dashboard #all ul {
  width: 360px;
  height: 270px;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: 20px;
  overflow-x: auto;
}

.budget-dashboard #all ul.list li {
  position: relative;
  font-size: 1em;
}

.budget-dashboard #all ul.list li * {
  display: inline-block;
  height: 30px;
  vertical-align: middle;
}

.budget-dashboard #all ul.list li .entry {
  width: 250px;
  height: auto;
  padding-left: 20px;
  margin-bottom: 10px;
  word-wrap: break-word;
  font-family: "Gilroy Bold";
}

.budget-dashboard #all ul.list li .action-btn.edit {
  visibility: hidden;
}

.budget-dashboard #all ul.list li .action-btn {
  border: none;
  background-color: transparent;
  padding: 0;
}

.budget-dashboard #all ul.list li .action-btn.delete {
  position: absolute;
  width: 20px;
  height: 20px;
  right: 20px;
  cursor: pointer;
  background-image: url("icon/trash.png");
  background-size: 20px 20px;
  background-repeat: no-repeat;
}

.budget-dashboard #all ul.list li .action-btn.delete:disabled,
.budget-dashboard #all ul.list li .action-btn.edit:disabled {
  cursor: default;
}

.budget-dashboard #all ul.list li.income {
}
.budget-dashboard #all ul.list li.expense {
  color: #f0624d;
}

/* //////// EXPENSE ////////// */
.budget-dashboard #expense {
  width: 360px;
  min-height: 339px;
  position: relative;
}

.budget-dashboard #expense .input {
  position: absolute;
  display: block;
  width: 360px;
  bottom: 0;
  border-top: 1px solid #ccc;
}

.budget-dashboard #expense .input * {
  display: inline-block;
  vertical-align: middle;
}

.budget-dashboard #expense .input input#expense-title-input {
  height: 40px;
  width: 150px;
  padding-left: 10px;
  font-size: 1.2em;
  font-family: "Gilroy";
  margin: 5px;
  margin-left: 10px;
  border-radius: 10px 0 0 10px;
  border: none;
}

.budget-dashboard #expense .input input#expense-amount-input {
  height: 40px;
  width: 110px;
  padding-left: 10px;
  font-size: 1.2em;
  font-family: "Gilroy";
  margin: 5px;
  margin-left: -10px;
  border-radius: 0 10px 10px 0;
  border: none;
}

.budget-dashboard #expense .input .add-expense,
.budget-dashboard #income .input .add-income {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.budget-dashboard #expense .input .add-expense img {
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.budget-dashboard #expense ul {
  width: 360px;
  min-height: 285px;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: 20px;
  overflow-x: auto;
}

.budget-dashboard #expense ul.list li {
  position: relative;
  font-size: 1em;
}

.budget-dashboard #expense ul.list li * {
  display: inline-block;
  height: 30px;
  vertical-align: middle;
}

.budget-dashboard #expense ul.list li .entry {
  width: 250px;
  height: auto;
  padding-left: 20px;
  margin-bottom: 10px;
  word-wrap: break-word;
  font-family: "Gilroy Bold";
  color: #f0624d;
}

.budget-dashboard #expense ul.list li .action-btn,
.budget-dashboard #income ul.list li .action-btn {
  border: none;
  background-color: transparent;
  padding: 0;
}

.budget-dashboard #expense ul.list li .action-btn.edit {
  position: absolute;
  width: 20px;
  height: 20px;
  right: 50px;
  cursor: pointer;
  background-image: url("icon/edit.png");
  background-size: 20px 20px;
  background-repeat: no-repeat;
}

.budget-dashboard #expense ul.list li .action-btn.delete {
  position: absolute;
  width: 20px;
  height: 20px;
  right: 20px;
  cursor: pointer;
  background-image: url("icon/trash.png");
  background-size: 20px 20px;
  background-repeat: no-repeat;
}

/* /////// INCOME //////// */
.budget-dashboard #income {
  width: 360px;
  min-height: 339px;
  position: relative;
}

.budget-dashboard #income .input {
  position: absolute;
  display: block;
  width: 360px;
  bottom: 0;
  border-top: 1px solid #ccc;
}

.budget-dashboard #income .input * {
  display: inline-block;
  vertical-align: middle;
}

.budget-dashboard #income .input input#income-title-input {
  height: 40px;
  width: 150px;
  padding-left: 10px;
  font-size: 1.2em;
  font-family: "Gilroy";
  margin: 5px;
  margin-left: 10px;
  border-radius: 10px 0 0 10px;
  border: none;
}

.budget-dashboard #income .input input#income-amount-input {
  height: 40px;
  width: 110px;
  padding-left: 10px;
  font-size: 1.2em;
  font-family: "Gilroy";
  margin: 5px;
  margin-left: -10px;
  border-radius: 0 10px 10px 0;
  border: none;
}

.budget-dashboard #income .input .add-income img {
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.budget-dashboard #income ul {
  width: 360px;
  height: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: 20px;
  overflow-x: auto;
}

.budget-dashboard #income ul.list li {
  position: relative;
  font-size: 1em;
}

.budget-dashboard #income ul.list li * {
  display: inline-block;
  height: 30px;
  vertical-align: middle;
}

.budget-dashboard #income ul.list li .entry {
  width: 250px;
  height: auto;
  padding-left: 20px;
  margin-bottom: 10px;
  word-wrap: break-word;
  font-family: "Gilroy Bold";
}

.budget-dashboard #income ul.list li .action-btn.edit {
  position: absolute;
  width: 20px;
  height: 20px;
  right: 50px;
  cursor: pointer;
  background-image: url("icon/edit.png");
  background-size: 20px 20px;
  background-repeat: no-repeat;
}

.budget-dashboard #income ul.list li .action-btn.delete {
  position: absolute;
  width: 20px;
  height: 20px;
  right: 20px;
  cursor: pointer;
  background-image: url("icon/trash.png");
  background-size: 20px 20px;
  background-repeat: no-repeat;
}

/* /////// FOOTER //////// */
/* Sits inside the purple container after the white dashboard. `flex: 1`
   makes it absorb the leftover viewport height that previously rendered as
   an awkward, browser-dependent purple gap, while `min-height` guarantees
   space for the logo on short viewports. */
.budget-footer {
  flex: 1 0 auto;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 24px;
  color: rgba(255, 255, 255, 0.55);
  font-family: "Gilroy";
  font-size: 0.82em;
  letter-spacing: 0.04em;
  box-sizing: border-box;
}

.budget-footer .footer-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.budget-footer .footer-text {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
  flex: 1 1 auto;
}

.budget-footer .footer-brand {
  color: rgba(255, 255, 255, 0.92);
  font-family: "Gilroy";
  font-size: 1.05em;
  letter-spacing: 0.02em;
}

.budget-footer .footer-brand b {
  font-family: "Gilroy Bold";
}

.budget-footer .footer-meta {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.06em;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-link {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9em;
  font-family: "Gilroy";
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: #fff;
}

.policy-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(122, 72, 199, 0.28), transparent 34%),
    linear-gradient(180deg, #160124 0%, #25113f 100%);
  color: #1a0034;
}

.policy-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 20px 56px;
  box-sizing: border-box;
}

.policy-card {
  position: relative;
  background-color: #fff;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 36px 32px;
}

.policy-card .lang-switcher {
  top: 24px;
  right: 24px;
}

.policy-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 20px;
  color: #2a0355;
  font-family: "Gilroy Bold";
}

.policy-title {
  margin: 0 0 8px;
  font-size: 2rem;
  color: #1a0034;
  font-family: "Gilroy Bold";
}

.policy-updated {
  margin: 0 0 28px;
  color: #5d4e74;
  font-size: 0.98em;
}

.policy-lead {
  margin: 0 0 28px;
  color: #2f2145;
  font-size: 1rem;
  line-height: 1.7;
}

.policy-section + .policy-section {
  margin-top: 28px;
}

.policy-section h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: #1a0034;
  font-family: "Gilroy Bold";
}

.policy-section p,
.policy-section li {
  color: #312448;
  line-height: 1.7;
}

.policy-section ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.policy-section li + li {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-actions {
    width: 100%;
    justify-content: stretch;
  }

  .cookie-btn {
    flex: 1 1 0;
  }

  .budget-footer {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .footer-links {
    width: 100%;
    justify-content: flex-start;
  }

  .policy-card {
    padding: 28px 22px;
  }
}

/* Refined app UI: keeps the original purple budget-card identity while
   tightening spacing, depth, and controls for a more polished product feel. */
:root {
  --app-ink: #180d26;
  --app-muted: #776c86;
  --app-purple: #2a0355;
  --app-purple-deep: #180128;
  --app-purple-soft: #f3eff8;
  --app-coral: #f0624d;
  --app-green: #45b980;
  --app-gold: #f7b801;
  --app-surface: #ffffff;
  --app-line: #ece6f2;
}

body:not(.policy-page) {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  background:
    linear-gradient(135deg, rgba(247, 184, 1, 0.08) 0%, transparent 28%),
    linear-gradient(180deg, #17131e 0%, #21152f 54%, #121017 100%);
  color: var(--app-ink);
  box-sizing: border-box;
}

body:not(.policy-page) * {
  box-sizing: border-box;
}

.budget-container {
  width: min(100%, 390px);
  min-height: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09) 0%, transparent 34%),
    linear-gradient(180deg, #310464 0%, #230148 46%, #181027 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

@media (min-width: 440px) and (min-height: 820px) {
  body:not(.policy-page) {
    align-items: center;
    padding: 24px 0;
  }

  .budget-container {
    border-radius: 30px;
  }
}

.budget-container .app-title {
  margin: 20px 22px 0;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.budget-container .app-title a {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: rgba(255, 255, 255, 0.94);
}

.lang-switcher {
  top: 16px;
  right: 20px;
  gap: 3px;
  padding: 4px;
  background-color: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.lang-switcher .lang-option {
  min-width: 42px;
  padding: 6px 10px;
  letter-spacing: 0;
}

.budget-header {
  padding: 0 22px 18px;
}

.budget-header .balance {
  margin: 20px 0 0;
  padding: 14px 18px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.budget-header .balance .title,
.budget-header .account .income .title,
.budget-header .account .outcome .title {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.budget-header .balance .value {
  margin-top: 6px;
  color: #fff;
  font-size: 2.35rem;
  line-height: 1;
  letter-spacing: 0;
}

.budget-header .balance .value small,
.budget-header .account small {
  font-size: 0.52em;
  opacity: 0.82;
}

.budget-header .account {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 12px 0 0;
  line-height: 1.3;
}

.budget-header .account .income,
.budget-header .account .chart,
.budget-header .account .outcome {
  display: flex;
  width: auto;
  height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.budget-header .account .income,
.budget-header .account .outcome {
  flex-direction: column;
  gap: 6px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.budget-header .account .chart {
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.budget-header .account .chart canvas {
  width: 46px;
  height: 46px;
}

.budget-header .account .income .income-total {
  color: #ffffff;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.budget-header .account .outcome .outcome-total {
  color: #ff8a76;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.budget-dashboard {
  width: 100%;
  min-height: 250px;
  margin-top: 0;
  padding: 22px 20px 14px;
  border-radius: 24px 24px 0 0;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbf9fd 100%);
  box-shadow: 0 -18px 42px rgba(15, 4, 28, 0.18);
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.budget-dashboard .dash-title {
  display: block;
  margin: 0;
  color: var(--app-ink);
  font-size: 1.58rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.clear-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #f4c9c1;
  border-radius: 8px;
  background-color: #fff4f1;
  color: #be3f30;
  font-family: "Gilroy Bold";
  font-size: 0.82rem;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.clear-all-btn::before {
  content: "";
  width: 15px;
  height: 15px;
  background-color: currentColor;
  -webkit-mask: url("icon/trash.png") center / contain no-repeat;
  mask: url("icon/trash.png") center / contain no-repeat;
}

.clear-all-btn:hover:not(:disabled),
.clear-all-btn:focus-visible {
  background-color: #ffe9e3;
  border-color: #ec9d90;
  transform: translateY(-1px);
}

.clear-all-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 18px 0 0;
  padding: 4px;
  border-radius: 8px;
  background-color: var(--app-purple-soft);
  border: 1px solid var(--app-line);
}

.toggle .first-tab,
.toggle .second-tab,
.toggle .third-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0;
  border-radius: 7px;
  color: #6b5b7b;
  font-size: 0.95rem;
  opacity: 1;
  letter-spacing: 0;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.toggle .first-tab:hover,
.toggle .second-tab:hover,
.toggle .third-tab:hover {
  color: var(--app-ink);
}

.toggle .focus {
  color: #fff;
  background-color: var(--app-ink);
  box-shadow: 0 8px 18px rgba(24, 13, 38, 0.18);
}

.toggle button:focus-visible,
.budget-dashboard .input button:focus-visible,
.budget-dashboard ul.list li .action-btn:focus-visible,
.modal-overlay .modal-ok:focus-visible,
.clear-all-btn:focus-visible {
  outline: 3px solid var(--app-gold);
  outline-offset: 3px;
}

.budget-dashboard input {
  color: var(--app-ink);
}

.budget-dashboard #all,
.budget-dashboard #expense,
.budget-dashboard #income {
  width: 100%;
  position: relative;
}

.budget-dashboard #all,
.budget-dashboard #expense,
.budget-dashboard #income {
  min-height: 272px;
}

.budget-dashboard #expense,
.budget-dashboard #income {
  padding-bottom: 62px;
}

.budget-dashboard #all ul,
.budget-dashboard #expense ul,
.budget-dashboard #income ul {
  width: 100%;
  height: auto;
  max-height: 168px;
  min-height: 48px;
  margin: 14px 0 0;
  padding: 2px 0 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d5c9df transparent;
}

.budget-dashboard #expense ul,
.budget-dashboard #income ul {
  max-height: 150px;
}

.budget-dashboard ul.list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin: 0 0 8px;
  padding: 9px 12px 9px 14px;
  border: 1px solid var(--app-line);
  border-left: 4px solid var(--app-green);
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 10px 22px rgba(34, 18, 54, 0.07);
  color: var(--app-ink);
  font-size: 0.98rem;
}

.budget-dashboard ul.list li.expense {
  border-left-color: var(--app-coral);
}

.budget-dashboard #all ul.list li *,
.budget-dashboard #expense ul.list li *,
.budget-dashboard #income ul.list li * {
  display: inline-flex;
  height: auto;
  vertical-align: initial;
}

.budget-dashboard #all ul.list li .entry,
.budget-dashboard #expense ul.list li .entry,
.budget-dashboard #income ul.list li .entry {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding-left: 0;
  margin-bottom: 0;
  color: inherit;
  font-family: "Gilroy Bold";
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.budget-dashboard #all ul.list li.expense .entry,
.budget-dashboard #expense ul.list li.expense .entry {
  color: #c94838;
}

.budget-dashboard #all ul.list li .action-btn,
.budget-dashboard #expense ul.list li .action-btn,
.budget-dashboard #income ul.list li .action-btn {
  position: static;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: #f6f2fb;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 17px 17px;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.budget-dashboard #all ul.list li .action-btn:hover,
.budget-dashboard #expense ul.list li .action-btn:hover,
.budget-dashboard #income ul.list li .action-btn:hover {
  transform: translateY(-1px);
  background-color: #efe7f8;
  border-color: #ded0eb;
}

.budget-dashboard #all ul.list li .action-btn.edit {
  display: none;
  visibility: hidden;
}

.budget-dashboard #all ul.list li .action-btn.delete,
.budget-dashboard #expense ul.list li .action-btn.delete,
.budget-dashboard #income ul.list li .action-btn.delete {
  background-image: url("icon/trash.png");
}

.budget-dashboard #expense ul.list li .action-btn.edit,
.budget-dashboard #income ul.list li .action-btn.edit {
  background-image: url("icon/edit.png");
}

.budget-dashboard #expense .input,
.budget-dashboard #income .input {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 46px;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background-color: #f8f5fb;
  box-shadow: 0 -8px 20px rgba(34, 18, 54, 0.06);
}

.budget-dashboard #expense .input *,
.budget-dashboard #income .input * {
  display: block;
  vertical-align: initial;
}

.budget-dashboard #expense .input input#expense-title-input,
.budget-dashboard #expense .input input#expense-amount-input,
.budget-dashboard #income .input input#income-title-input,
.budget-dashboard #income .input input#income-amount-input {
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #e4dce9;
  border-radius: 8px;
  background-color: #fff;
  font-size: 0.98rem;
  font-family: "Gilroy";
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.budget-dashboard #expense .input input:focus,
.budget-dashboard #income .input input:focus {
  border-color: #a98bc9;
  box-shadow: 0 0 0 3px rgba(169, 139, 201, 0.18);
}

.budget-dashboard #expense .input .add-expense,
.budget-dashboard #income .input .add-income {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 42px;
  border: none;
  border-radius: 8px;
  background: var(--app-purple);
  box-shadow: 0 10px 18px rgba(42, 3, 85, 0.22);
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.budget-dashboard #expense .input .add-expense:hover,
.budget-dashboard #income .input .add-income:hover {
  transform: translateY(-1px);
  background-color: #3a0874;
}

.budget-dashboard #expense .input .add-expense img,
.budget-dashboard #income .input .add-income img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.budget-footer {
  min-height: 62px;
  padding: 12px 22px;
  background-color: rgba(12, 7, 20, 0.12);
  letter-spacing: 0;
}

.budget-footer .footer-logo {
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.09);
}

.budget-footer .footer-meta,
.budget-footer .footer-brand,
.footer-link {
  letter-spacing: 0;
}

.modal-overlay .modal,
.cookie-banner {
  border-radius: 8px;
}

@media (max-width: 420px) {
  .budget-container {
    width: 100%;
  }

  .budget-header {
    padding-left: 18px;
    padding-right: 18px;
  }

  .budget-dashboard {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dashboard-head {
    align-items: flex-start;
  }

  .clear-all-btn {
    min-width: 98px;
    padding: 0 10px;
  }

  .budget-header .account {
    grid-template-columns: 1fr 58px 1fr;
    gap: 8px;
  }

  .budget-dashboard #expense .input,
  .budget-dashboard #income .input {
    grid-template-columns: minmax(0, 1fr) 86px 44px;
    padding: 10px;
  }
}

/* Final UI refinement layer: fix selected-tab hover contrast and add a
   cleaner card rhythm without touching tested DOM structure. */
.budget-container {
  position: relative;
}

.budget-container::before {
  content: "";
  position: absolute;
  inset: 82px -26% auto;
  height: 176px;
  background: radial-gradient(
    circle,
    rgba(247, 184, 1, 0.18) 0%,
    rgba(247, 184, 1, 0) 70%
  );
  pointer-events: none;
}

.budget-header .balance {
  backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 30px rgba(10, 3, 20, 0.16);
}

.budget-header .balance .title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.budget-header .account .income,
.budget-header .account .outcome,
.budget-header .account .chart {
  box-shadow: 0 12px 24px rgba(18, 8, 30, 0.14);
}

.budget-dashboard {
  position: relative;
}

.budget-dashboard::before {
  content: "";
  position: absolute;
  inset: 0 20px auto;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(42, 3, 85, 0.14),
    transparent
  );
}

.dashboard-head {
  margin-bottom: 2px;
}

.toggle .first-tab,
.toggle .second-tab,
.toggle .third-tab {
  font-family: "Gilroy Bold";
  transition:
    color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.toggle .first-tab:hover,
.toggle .second-tab:hover,
.toggle .third-tab:hover {
  color: var(--app-ink);
  background-color: rgba(255, 255, 255, 0.68);
  transform: translateY(-1px);
}

.toggle .focus,
.toggle .focus:hover,
.toggle .focus:focus-visible {
  color: #fff4c4;
  background: linear-gradient(180deg, #28163d 0%, #180d26 100%);
  box-shadow:
    0 10px 18px rgba(24, 13, 38, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.toggle .focus:hover,
.toggle .focus:focus-visible {
  transform: translateY(0);
}

.budget-dashboard #all ul,
.budget-dashboard #expense ul,
.budget-dashboard #income ul {
  padding-right: 4px;
}

.budget-dashboard ul.list li {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.budget-dashboard ul.list li:hover {
  transform: translateY(-1px);
  border-color: #e2d6ec;
  box-shadow: 0 14px 28px rgba(34, 18, 54, 0.1);
}

.budget-dashboard ul.list li .entry {
  letter-spacing: 0.01em;
}

.budget-dashboard #expense .input,
.budget-dashboard #income .input {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 245, 251, 0.96));
  backdrop-filter: blur(16px);
}

.budget-dashboard #expense .input input::placeholder,
.budget-dashboard #income .input input::placeholder {
  color: #9d92ab;
}

.budget-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.budget-footer .footer-text {
  display: grid;
  gap: 2px;
}

.budget-footer .footer-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-link {
  opacity: 0.88;
  transition: opacity 0.16s ease, color 0.16s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  opacity: 1;
  color: #fff6d5;
}

@media (max-width: 420px) {
  .budget-footer {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .budget-footer .footer-links {
    gap: 10px;
    flex-wrap: wrap;
  }
}
