:root {
  color-scheme: dark;
  --ink: #131a24;
  --surface: #18212d;
  --surface-2: #1d2836;
  --wool: #f1e7d6;
  --wool-dim: #d9cfc0;
  --muted: #aab6c4;
  --muted-2: #8492a3;
  --gold: #d6a34a;
  --gold-bright: #e8c27e;
  --gold-deep: #9a6b24;
  --red: #c6533c;
  --green: #5e9b7c;
  --line: rgba(241, 231, 214, 0.13);
  --line-strong: rgba(241, 231, 214, 0.22);
  --cream-ink: #1b2430;
  --cream-muted: #5e5b52;
  --cream-line: rgba(27, 36, 48, 0.17);
  --font-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Archivo", sans-serif;
  --shadow-board: 0 34px 80px -48px rgba(0, 0, 0, 0.8);
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--ink);
  background-image:
    radial-gradient(900px 520px at 8% -10%, rgba(214, 163, 74, 0.085), transparent 62%),
    radial-gradient(800px 500px at 96% 4%, rgba(94, 155, 124, 0.055), transparent 60%),
    repeating-linear-gradient(104deg, transparent 0 4px, rgba(241, 231, 214, 0.014) 4px 5px);
  background-attachment: fixed;
  color: var(--wool);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.entry-card :focus-visible,
.dialog :focus-visible,
.setup-card :focus-visible {
  outline-color: #7c4b12;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 4px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(19, 26, 36, 0.97);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  max-width: 1400px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 32px;
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1;
  text-decoration: none;
}

.brand span {
  color: var(--gold);
}

.tagline {
  color: var(--muted-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(241, 231, 214, 0.025);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--wool-dim);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.icon-btn:hover {
  background: rgba(241, 231, 214, 0.07);
  border-color: var(--line);
  color: var(--wool);
}

.month-label {
  min-width: 142px;
  padding: 0 6px;
  color: var(--wool);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 580;
  letter-spacing: -0.01em;
  text-align: center;
  text-transform: capitalize;
}

.today-btn {
  min-height: 28px;
  margin-left: 2px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.today-btn:hover {
  background: rgba(214, 163, 74, 0.12);
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 0.72rem;
  white-space: nowrap;
}

.save-indicator i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(94, 155, 124, 0.13);
}

.save-indicator.is-saving i {
  background: var(--gold);
  animation: blink 900ms ease-in-out infinite;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--wool);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn:hover {
  border-color: var(--wool-dim);
  background: rgba(241, 231, 214, 0.06);
}

.btn-quiet {
  color: var(--wool-dim);
}

.btn-primary,
.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  font-weight: 700;
  transition: background-color 140ms ease, transform 140ms ease;
}

.btn-primary {
  background: var(--gold);
  color: #1a2028;
}

.btn-primary:hover {
  background: var(--gold-bright);
}

.btn-dark {
  background: var(--cream-ink);
  color: var(--wool);
}

.btn-dark:hover {
  background: #2b3949;
}

.btn-primary:active,
.btn-dark:active {
  transform: translateY(1px);
}

.btn-primary .icon,
.btn-dark .icon {
  width: 18px;
  height: 18px;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  background: #b84934;
  color: #fff8f2;
  font-weight: 700;
}

.btn-danger:hover {
  background: #a13f2c;
}

.btn-quiet.on-cream {
  border-color: var(--cream-line);
  color: var(--cream-ink);
}

.btn-quiet.on-cream:hover {
  background: rgba(27, 36, 48, 0.07);
  border-color: rgba(27, 36, 48, 0.35);
}

.text-btn {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--gold-bright);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
}

.text-btn:hover {
  color: var(--wool);
}

.text-btn.danger {
  color: var(--muted);
}

.text-btn.danger:hover {
  color: var(--red);
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.setup {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.72fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  min-height: calc(100vh - 77px);
  padding: 64px 0 72px;
}

.setup-copy h1 {
  max-width: 12ch;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6.2vw, 5.6rem);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 0.94;
  text-wrap: balance;
}

.setup-copy h1 .accent {
  color: var(--gold);
}

.setup-lead {
  max-width: 49ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.setup-steps dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--wool);
  font-size: 0.8rem;
  font-weight: 700;
}

.setup-steps dt span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.7rem;
}

.setup-steps dd {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 0.76rem;
  line-height: 1.5;
}

.setup-cord {
  max-width: 560px;
  margin-top: 38px;
  opacity: 0.85;
}

.setup-cord svg {
  width: 100%;
  height: auto;
}

.setup-card {
  position: relative;
  padding: 34px 32px 28px;
  border-radius: var(--radius);
  background-color: var(--wool);
  background-image: repeating-linear-gradient(92deg, transparent 0 5px, rgba(27, 36, 48, 0.016) 5px 6px);
  color: var(--cream-ink);
  box-shadow: var(--shadow-board);
}

.setup-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(27, 36, 48, 0.22);
  border-radius: 2px;
  pointer-events: none;
}

.setup-card > * {
  position: relative;
  z-index: 1;
}

.setup-card h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1;
}

.setup-card-sub {
  margin-top: 7px;
  color: var(--cream-muted);
  font-size: 0.82rem;
}

.setup-card form {
  margin-top: 26px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field + .field {
  margin-top: 16px;
}

.field label,
.cat-fieldset legend {
  color: var(--cream-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.field .optional {
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
}

.money-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid rgba(27, 36, 48, 0.26);
  border-radius: 3px;
  background: rgba(255, 252, 245, 0.56);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.money-input:focus-within {
  border-color: #8b5d19;
  box-shadow: 0 0 0 3px rgba(154, 107, 36, 0.13);
}

.money-input span {
  color: #5b574d;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.money-input input {
  width: 100%;
  min-width: 0;
  padding: 13px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cream-ink);
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 620;
  letter-spacing: -0.03em;
}

.money-input input::placeholder {
  color: #6f675c;
}

.chip-btn {
  margin-top: 13px;
  padding: 6px 10px;
  border: 1px dashed rgba(27, 36, 48, 0.35);
  border-radius: 3px;
  background: transparent;
  color: #574329;
  font-size: 0.73rem;
  font-weight: 600;
}

.chip-btn:hover {
  border-style: solid;
  background: rgba(214, 163, 74, 0.13);
}

.field-hint {
  margin-top: 14px;
  color: var(--cream-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.form-error {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(198, 83, 60, 0.42);
  border-radius: 3px;
  background: rgba(198, 83, 60, 0.09);
  color: #8f3627;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
}

.setup-card .btn-primary {
  margin-top: 20px;
}

.demo-link {
  display: block;
  width: 100%;
  margin-top: 13px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #6a5130;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-link:hover {
  color: var(--cream-ink);
}

.privacy-note {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--cream-line);
  color: #625d52;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

#dashboardView {
  animation: rise-in 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  padding: 6px 16px;
  border: 1px solid rgba(214, 163, 74, 0.35);
  border-radius: 4px;
  background: rgba(214, 163, 74, 0.09);
  color: var(--wool-dim);
  font-size: 0.78rem;
}

.demo-banner strong {
  color: var(--gold-bright);
}

.demo-banner .btn {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 0.72rem;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(340px, 0.82fr);
  gap: 26px;
  padding-top: 24px;
}

.board-main {
  min-width: 0;
}

.lead-block {
  padding: 4px 2px 18px;
}

.hero-line {
  max-width: 15ch;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.5vw, 4.3rem);
  font-weight: 480;
  letter-spacing: -0.04em;
  line-height: 0.96;
  text-wrap: balance;
}

.hero-line strong {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 1.48em;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 0.84;
  font-variant-numeric: tabular-nums;
}

.hero-line.is-over strong {
  color: #e47a61;
}

.hero-sub {
  max-width: 52ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.hero-sub strong {
  color: var(--wool);
  font-weight: 600;
  white-space: nowrap;
}

.quick-add {
  display: none;
}

.cord-card {
  position: relative;
  overflow: hidden;
  padding: 18px 24px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  background-image:
    linear-gradient(180deg, rgba(241, 231, 214, 0.035), transparent 26%),
    repeating-linear-gradient(97deg, transparent 0 6px, rgba(241, 231, 214, 0.012) 6px 7px);
  box-shadow: var(--shadow-board);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.card-head h2,
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.card-sub {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 0.75rem;
  line-height: 1.45;
}

.cord-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 13px;
  padding-top: 2px;
  color: var(--muted-2);
  font-size: 0.7rem;
  white-space: nowrap;
}

.cord-legend li {
  display: flex;
  align-items: center;
  gap: 5px;
}

.key {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.key-gold {
  background: var(--gold);
}

.key-red {
  background: var(--red);
}

.key-empty {
  border: 1px solid var(--muted-2);
}

.quipu-wrap {
  position: relative;
  margin: 10px -6px 2px;
}

.quipu-hint {
  display: none;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 0.7rem;
  text-align: right;
}

.quipu-hint span {
  color: var(--gold);
}

.quipu {
  width: 100%;
  min-height: 206px;
}

.quipu svg {
  width: 100%;
  height: auto;
  max-height: 210px;
  overflow: visible;
}

.quipu .quipu-label {
  fill: var(--muted-2);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
}

.quipu .quipu-label.is-today {
  fill: var(--gold-bright);
  font-weight: 700;
}

.quipu .quipu-amount {
  fill: var(--wool-dim);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 650;
}

.quipu .quipu-amount.is-over {
  fill: #e47a61;
}

.quipu .quipu-goal {
  stroke: rgba(214, 163, 74, 0.6);
  stroke-dasharray: 2 5;
}

.quipu .quipu-goal-label {
  fill: var(--gold-bright);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.quipu .quipu-string {
  transition: opacity 160ms ease;
}

.quipu .quipu-day:hover .quipu-string {
  opacity: 0.72;
}

.cord-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.figures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px clamp(20px, 3.4vw, 44px);
}

.figure {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.figure-label {
  color: var(--muted-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.figure-value {
  color: var(--wool);
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 610;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.figure-accent {
  color: var(--gold-bright);
}

.figure-value.is-negative {
  color: #e47a61;
}

.status-stamp {
  display: inline-block;
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
  transform: rotate(-1.6deg);
}

.status-stamp.tone-warn {
  color: var(--gold);
}

.status-stamp.tone-bad {
  color: #df7158;
}

.status-stamp.tone-neutral,
.status-stamp.tone-done {
  color: var(--muted);
}

.status-stamp.tone-reached {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.cord-note {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 0.75rem;
  line-height: 1.45;
}

.today-block {
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-meta {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.movement-list {
  border-top: 1px solid var(--line);
}

.movement-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}

.movement-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold-bright);
}

.movement-icon .icon {
  width: 15px;
  height: 15px;
}

.movement-meta {
  min-width: 0;
}

.movement-title {
  overflow: hidden;
  color: var(--wool-dim);
  font-size: 0.84rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-title .movement-cat {
  color: var(--muted-2);
  font-weight: 400;
}

.movement-sub {
  color: var(--muted-2);
  font-size: 0.75rem;
}

.movement-amount {
  color: var(--wool);
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.movement-delete {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, background-color 120ms ease;
}

.movement-row:hover .movement-delete,
.movement-delete:focus-visible {
  opacity: 1;
}

.movement-delete:hover {
  background: rgba(198, 83, 60, 0.12);
  color: #e47a61;
}

.movement-delete .icon {
  width: 15px;
  height: 15px;
}

.movement-spacer {
  display: block;
  width: 30px;
  height: 30px;
}

.empty-state {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 0.8rem;
  line-height: 1.55;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 2px;
  color: var(--wool-dim);
  font-weight: 600;
}

.empty-state .empty-mark {
  margin-bottom: 3px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
}

.empty-today {
  padding: 22px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.board-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.entry-card {
  position: relative;
  padding: 18px 22px 14px;
  border-radius: var(--radius);
  background-color: var(--wool);
  background-image: repeating-linear-gradient(92deg, transparent 0 5px, rgba(27, 36, 48, 0.018) 5px 6px);
  color: var(--cream-ink);
  box-shadow: var(--shadow-board);
}

.entry-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(27, 36, 48, 0.2);
  border-radius: 2px;
  pointer-events: none;
}

.entry-card > * {
  position: relative;
  z-index: 1;
}

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.entry-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1;
}

.entry-date {
  color: #625d52;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: lowercase;
}

.entry-card form {
  margin-top: 12px;
}

.cat-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.cat-fieldset legend {
  margin-bottom: 6px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.cat-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.cat-option:last-child {
  grid-column: span 1;
}

.cat-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.cat-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid rgba(27, 36, 48, 0.17);
  border-radius: 3px;
  background: rgba(255, 252, 245, 0.42);
  color: #5a574f;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease;
}

.cat-face .icon {
  width: 16px;
  height: 16px;
}

.cat-option:hover .cat-face {
  border-color: rgba(27, 36, 48, 0.42);
  background: rgba(255, 252, 245, 0.72);
}

.cat-option input:checked + .cat-face {
  border-color: var(--cream-ink);
  background: var(--cream-ink);
  color: var(--wool);
}

.cat-option input:checked + .cat-face .icon {
  color: var(--gold);
}

.cat-option input:focus-visible + .cat-face {
  outline: 2px solid #7c4b12;
  outline-offset: 2px;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.entry-card .field + .field {
  margin-top: 8px;
}

.entry-card .field label {
  color: #5a574f;
}

.entry-card .field input,
.entry-card .field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid rgba(27, 36, 48, 0.24);
  border-radius: 3px;
  outline: 0;
  background: rgba(255, 252, 245, 0.54);
  color: var(--cream-ink);
  font-size: 0.82rem;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.entry-card .field input:focus,
.entry-card .field select:focus {
  border-color: #8b5d19;
  box-shadow: 0 0 0 3px rgba(154, 107, 36, 0.13);
}

.entry-card .field input::placeholder {
  color: #6f675c;
}

.field-amount .money-input {
  min-height: 46px;
  padding: 0 10px;
}

.entry-card .field-amount .money-input {
  border-color: rgba(27, 36, 48, 0.24);
  background: rgba(255, 252, 245, 0.54);
}

.entry-card .field-amount .money-input input {
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.45rem;
  box-shadow: none;
}

.entry-card .field-date input {
  min-height: 46px;
  font-family: var(--font-ui);
  font-size: 0.76rem;
}

.entry-card .btn-dark {
  width: 100%;
  margin-top: 11px;
}

.form-foot {
  margin-top: 8px;
  color: #625d52;
  font-size: 0.75rem;
  text-align: center;
}

.readonly-note {
  margin-top: 14px;
  padding: 9px 10px;
  border: 1px dashed rgba(27, 36, 48, 0.28);
  border-radius: 2px;
  background: rgba(255, 252, 245, 0.38);
  color: #625c50;
  font-size: 0.75rem;
  line-height: 1.45;
}

.entry-card.is-readonly form {
  opacity: 0.55;
}

.entry-card.is-readonly .cat-face,
.entry-card.is-readonly .field label {
  cursor: not-allowed;
}

.entry-card .btn-dark:disabled,
.entry-card .btn-dark[disabled] {
  cursor: not-allowed;
}

.entry-card .form-error {
  margin-top: 12px;
}

.plan-card {
  padding: 12px 2px 4px;
  border-top: 1px solid var(--line);
}

.plan-card .card-head {
  align-items: baseline;
  padding: 0 2px 6px;
}

.plan-card .card-head > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.plan-card h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.plan-list {
  border-top: 1px solid var(--line);
}

.plan-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.plan-swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.plan-swatch.is-red {
  background: var(--red);
}

.plan-swatch.is-green {
  background: var(--green);
}

.plan-swatch.is-cream {
  background: var(--wool-dim);
}

.plan-swatch.is-muted {
  border: 1px solid var(--muted-2);
  background: transparent;
}

.plan-name {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--wool-dim);
}

.plan-name .plan-share {
  color: var(--muted-2);
  font-size: 0.69rem;
}

.plan-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--wool);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-spent {
  font-weight: 650;
}

.plan-row.is-over .plan-spent {
  color: #e47a61;
}

.plan-limit {
  color: var(--muted-2);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
}

.plan-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px 2px;
}

.plan-foot > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-foot-right {
  text-align: right;
}

.mini-label {
  color: var(--muted-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-foot strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 630;
  letter-spacing: -0.02em;
}

#goalPercent {
  color: var(--wool-dim);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 550;
}

.tip-card {
  position: relative;
  display: flex;
  gap: 12px;
  overflow: hidden;
  padding: 12px 16px 11px 15px;
  border-radius: var(--radius);
  background-color: var(--gold);
  background-image: repeating-linear-gradient(95deg, transparent 0 4px, rgba(71, 45, 0, 0.035) 4px 5px);
  color: #2d2415;
}

.tip-card::after {
  content: "∿";
  position: absolute;
  right: 10px;
  bottom: -17px;
  color: rgba(45, 36, 21, 0.12);
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  transform: rotate(-8deg);
  pointer-events: none;
}

.tip-spool {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  border: 1px solid rgba(45, 36, 21, 0.45);
  border-radius: 50%;
}

.tip-spool::before,
.tip-spool::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(45, 36, 21, 0.35);
  border-radius: 50%;
}

.tip-spool::after {
  inset: 13px;
  border-color: rgba(45, 36, 21, 0.55);
}

.tip-label {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(45, 36, 21, 0.24);
  color: #4c3b1f;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tip-card h2 {
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.tip-card > div > p:not(.tip-label) {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: #3e321f;
  font-size: 0.75rem;
  line-height: 1.5;
}

.lower {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
  gap: 26px;
  margin: 34px 0 0;
}

.pulse-card,
.history-card {
  min-width: 0;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.history-card {
  background: rgba(24, 33, 45, 0.62);
}

.streak {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: right;
}

.streak strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.streak-flame {
  position: relative;
  width: 11px;
  height: 15px;
  border-radius: 50% 50% 50% 2px;
  background: var(--gold);
  transform: rotate(-42deg);
}

.streak-flame::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 2px;
  width: 5px;
  height: 7px;
  border-radius: 50% 50% 50% 2px;
  background: var(--surface);
}

.week-chart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
  min-height: 156px;
  margin-top: 18px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.week-chart::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(214, 163, 74, 0.14), rgba(214, 163, 74, 0.46) 24%, rgba(214, 163, 74, 0.46) 76%, rgba(214, 163, 74, 0.14));
}

.week-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  height: 138px;
  min-width: 0;
  text-align: center;
}

.week-bar-area {
  display: flex;
  flex: 1;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 70px;
}

.week-bar {
  position: relative;
  width: 2px;
  height: 2px;
  min-height: 2px;
  border-radius: 0 0 2px 2px;
  color: rgba(241, 231, 214, 0.23);
  background: currentColor;
  transition: height 400ms cubic-bezier(0.2, 0.7, 0.2, 1), color 160ms ease;
}

.week-bar::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
  transform: translateX(-50%);
}

.week-col.has-spend .week-bar {
  color: #a3834e;
}

.week-col.is-today .week-bar {
  color: var(--gold-bright);
}

.week-col.is-over .week-bar {
  color: var(--red);
}

.week-col.is-today .week-day-label {
  color: var(--gold-bright);
  font-weight: 700;
}

.week-day-label {
  color: var(--muted-2);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
}

.week-day-amount {
  display: flex;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.69rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}



.week-col.is-today .week-day-amount {
  color: var(--wool-dim);
}

.wk-prefix {
  color: var(--muted-2);
  font-family: var(--font-ui);
  font-size: 0.69rem;
  font-weight: 500;
}

.week-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.week-foot strong {
  color: var(--wool);
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 630;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.week-foot span {
  color: var(--muted-2);
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: right;
}

.filter-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.filter-field select {
  min-height: 34px;
  max-width: 132px;
  padding: 4px 24px 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background-color: var(--surface-2);
  color: var(--wool-dim);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.history-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.history-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-group {
  border-bottom: 1px solid var(--line);
}

.history-group:last-child {
  border-bottom: 0;
}

.history-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 7px;
}

.history-date {
  color: var(--muted-2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-day-total {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.73rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.history-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 2px;
  border-top: 1px solid rgba(241, 231, 214, 0.06);
}

.history-row .movement-icon {
  width: 24px;
  height: 24px;
  border: 0;
  background: rgba(241, 231, 214, 0.05);
}

.history-row .movement-icon .icon {
  width: 13px;
  height: 13px;
}

.history-row .movement-title {
  font-size: 0.78rem;
}

.history-row .movement-sub {
  font-size: 0.7rem;
}

.history-row .movement-amount {
  font-size: 0.82rem;
}

.history-row .movement-delete {
  width: 28px;
  height: 28px;
}

.history-card .empty-state {
  margin-top: 18px;
}

.dialog {
  width: min(590px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--cream-ink);
}

.dialog::backdrop {
  background: rgba(8, 12, 17, 0.76);
  backdrop-filter: blur(3px);
}

.dialog[open] {
  animation: dialog-in 200ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.dialog-small {
  width: min(430px, calc(100vw - 32px));
}

.dialog-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  background-color: var(--wool);
  background-image: repeating-linear-gradient(92deg, transparent 0 5px, rgba(27, 36, 48, 0.016) 5px 6px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-head h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 730;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dialog .icon-btn {
  color: var(--cream-ink);
}

.dialog .icon-btn:hover {
  border-color: var(--cream-line);
  background: rgba(27, 36, 48, 0.07);
}

.dialog-copy {
  max-width: 48ch;
  margin-top: 10px;
  color: var(--cream-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.dialog form {
  margin-top: 22px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dialog-grid .field + .field {
  margin-top: 0;
}

.dialog .money-input {
  min-height: 50px;
}

.dialog .money-input input {
  font-size: 1.45rem;
}

.plan-preview {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid var(--cream-line);
  border-radius: 3px;
  background: rgba(255, 252, 245, 0.4);
  color: var(--cream-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.plan-preview strong {
  color: var(--cream-ink);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 650;
}

.plan-preview .preview-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0;
}

.plan-preview .preview-row + .preview-row {
  border-top: 1px dotted rgba(27, 36, 48, 0.17);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--cream-line);
}

.dialog-actions .btn {
  min-height: 44px;
}

.dialog-actions .btn-primary {
  min-height: 44px;
  padding: 0 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px 12px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #263241;
  color: var(--wool);
  font-size: 0.78rem;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s;
}

.toast-undo {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
}

.toast-undo:hover {
  color: var(--wool);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 44px;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.69rem;
}

.noscript {
  max-width: 620px;
  margin: 32px auto;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--wool-dim);
  font-size: 0.88rem;
  text-align: center;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@media (max-width: 1180px) {
  .topbar-inner,
  main {
    padding-left: 24px;
    padding-right: 24px;
  }

  .board {
    grid-template-columns: minmax(0, 1.42fr) minmax(330px, 0.88fr);
    gap: 22px;
  }

  .lower {
    gap: 22px;
  }

  .tagline {
    display: none;
  }

  .hero-line {
    font-size: clamp(2.45rem, 4.7vw, 3.9rem);
  }
}

@media (max-width: 1000px) {
  .board {
    display: flex;
    flex-direction: column;
  }

  .board-main,
  .board-side {
    display: contents;
  }

  .lead-block {
    order: 1;
    padding-bottom: 22px;
  }

  .cord-card {
    order: 2;
  }

  .entry-card {
    order: 3;
  }

  .today-block {
    order: 4;
    margin-top: 26px;
  }

  .plan-card {
    order: 5;
    margin-top: 4px;
  }

  .tip-card {
    order: 6;
  }

  .board {
    gap: 22px;
    padding-top: 26px;
  }

  .board-side {
    gap: 0;
  }

  .entry-card {
    margin-top: 0;
  }

  .entry-card form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 18px;
  }

  .entry-card .cat-fieldset {
    grid-row: span 3;
  }

  .entry-row {
    margin-top: 0;
    align-self: end;
  }

  .entry-card form > .field {
    grid-column: 2;
  }

  .entry-card form > .field + .field {
    margin-top: 0;
  }

  .entry-card .btn-dark {
    grid-column: 1 / -1;
    margin-top: 6px;
  }

  .entry-card .form-error,
  .entry-card .form-foot {
    grid-column: 1 / -1;
  }

  .entry-card .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .cat-face {
    flex-direction: row;
    min-height: 48px;
    gap: 7px;
    font-size: 0.73rem;
  }

  .cat-option:last-child {
    grid-column: span 1;
  }

  .cat-option:first-child {
    grid-column: span 2;
  }

  .entry-head {
    margin-bottom: 16px;
  }

  .lower {
    grid-template-columns: 1fr;
    margin-top: 26px;
  }

  .week-col {
    height: 156px;
  }

  .setup {
    grid-template-columns: 1fr;
    gap: 42px;
    min-height: 0;
    padding: 46px 0 60px;
  }

  .setup-copy h1 {
    max-width: 13ch;
    font-size: clamp(3rem, 10vw, 5.2rem);
  }

  .setup-cord {
    display: none;
  }

  .setup-steps {
    max-width: 660px;
  }

  .setup-card {
    width: min(560px, 100%);
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    min-height: 0;
    padding: 10px 16px 9px;
  }

  .topbar-left {
    grid-column: 1;
    grid-row: 1;
  }

  .brand {
    font-size: 1.55rem;
  }

  .topbar-right {
    grid-column: 2;
    grid-row: 1;
    gap: 8px;
  }

  .save-indicator {
    display: none;
  }

  .topbar-right .btn {
    min-height: 34px;
    padding: 0 10px;
    border-color: transparent;
    font-size: 0.72rem;
  }

  .topbar-right .btn .icon {
    width: 16px;
    height: 16px;
  }

  .month-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    width: 100%;
    padding: 3px;
  }

  .month-label {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
  }

  .icon-btn {
    width: 35px;
    height: 35px;
  }

  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .demo-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding: 11px 13px;
  }

  .demo-banner .btn {
    min-height: 32px;
  }

  .board {
    padding-top: 22px;
    gap: 18px;
  }

  .lead-block {
    padding: 4px 0 18px;
  }

  .hero-line {
    margin-top: 9px;
    font-size: clamp(2.25rem, 10vw, 3.4rem);
  }

  .hero-line strong {
    margin-top: 7px;
    font-size: 1.48em;
  }

  .hero-sub {
    margin-top: 13px;
    font-size: 0.81rem;
  }

  .quick-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    margin-top: 13px;
    padding: 0 13px;
    border: 1px solid rgba(214, 163, 74, 0.55);
    border-radius: 3px;
    color: var(--gold-bright);
    font-size: 0.75rem;
    font-weight: 650;
    text-decoration: none;
  }

  .quick-add:hover {
    background: rgba(214, 163, 74, 0.1);
  }

  .quick-add .icon {
    width: 15px;
    height: 15px;
  }

  .cord-card {
    padding: 17px 14px 15px;
  }

  .card-head {
    gap: 10px;
  }

  .card-head h2 {
    font-size: 1.03rem;
  }

  .card-sub {
    font-size: 0.75rem;
  }

  .cord-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding-top: 3px;
    font-size: 0.7rem;
  }

  .quipu-wrap {
    margin: 8px -8px 0;
    padding-bottom: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(214, 163, 74, 0.45) transparent;
  }

  .quipu-wrap::-webkit-scrollbar {
    height: 4px;
  }

  .quipu-wrap::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(214, 163, 74, 0.45);
  }

  .quipu {
    width: 640px;
    min-height: 0;
  }

  .quipu svg {
    width: 640px;
    max-width: none;
  }

  .quipu .quipu-label {
    font-size: 13.5px;
  }

  .quipu .quipu-goal-label {
    font-size: 13.5px;
  }

  .quipu-hint {
    display: block;
  }

  .cord-foot {
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 13px;
  }

  .figures {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .figure-label {
    font-size: 0.7rem;
  }

  .figure-value {
    font-size: 1.1rem;
  }

  .status-stamp {
    margin-left: auto;
    font-size: 0.7rem;
  }

  .cord-note {
    margin-top: 11px;
    font-size: 0.75rem;
  }

  .today-block {
    margin-top: 22px;
  }

  .movement-row {
    grid-template-columns: 30px minmax(0, 1fr) auto 30px;
    gap: 9px;
    min-height: 56px;
  }

  .movement-icon {
    width: 29px;
    height: 29px;
  }

  .movement-delete {
    opacity: 1;
  }

  .entry-card {
    padding: 21px 16px 16px;
  }

  .entry-card::after {
    inset: 5px;
  }

  .entry-head h2 {
    font-size: 1.38rem;
  }

  .entry-card form {
    display: flex;
    flex-direction: column;
    margin-top: 17px;
  }

  .entry-card .cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .entry-card .cat-face {
    flex-direction: column;
    min-height: 54px;
    gap: 4px;
    font-size: 0.7rem;
  }

  .cat-option:first-child {
    grid-column: span 1;
  }

  .cat-option:last-child {
    grid-column: span 2;
  }

  .entry-row {
    margin-top: 15px;
  }

  .entry-card .field + .field {
    margin-top: 14px;
  }

  .entry-card .btn-dark {
    margin-top: 16px;
  }

  .plan-card {
    margin-top: 2px;
  }

  .plan-card .card-head {
    padding-bottom: 8px;
  }

  .plan-row {
    min-height: 40px;
  }

  .tip-card {
    padding: 18px 16px;
  }

  .tip-card h2 {
    font-size: 1rem;
  }

  .lower {
    margin-top: 22px;
    gap: 18px;
  }

  .pulse-card,
  .history-card {
    padding: 18px 14px 15px;
  }

  .week-chart {
    gap: 3px;
    min-height: 148px;
    margin-top: 14px;
  }

  .week-col {
    height: 144px;
    gap: 5px;
  }

  .week-bar {
    width: 2px;
  }

  .week-day-label {
    font-size: 0.7rem;
  }

  .week-day-amount {
    font-size: 0.69rem;
  }

  .week-foot {
    margin-top: 9px;
  }

  .week-foot span {
    max-width: 58%;
    font-size: 0.75rem;
  }

  .history-card .card-head {
    align-items: flex-end;
  }

  .filter-field {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 0.7rem;
  }

  .filter-field select {
    min-height: 32px;
    max-width: 120px;
    font-size: 0.75rem;
  }

  .history-list {
    margin-top: 14px;
  }

  .history-row {
    grid-template-columns: 24px minmax(0, 1fr) auto 28px;
    gap: 8px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    margin-top: 30px;
    padding: 20px 0 28px;
  }

  .setup {
    padding: 34px 0 48px;
    gap: 34px;
  }

  .setup-copy h1 {
    font-size: clamp(2.9rem, 13vw, 4rem);
  }

  .setup-lead {
    margin-top: 16px;
    font-size: 0.9rem;
  }

  .setup-steps {
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 25px;
    padding-top: 19px;
  }

  .setup-steps dd {
    margin-top: 2px;
  }

  .setup-card {
    width: 100%;
    padding: 27px 20px 22px;
  }

  .setup-card h2 {
    font-size: 1.65rem;
  }

  .setup-card form {
    margin-top: 22px;
  }

  .money-input {
    min-height: 52px;
  }

  .dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .dialog-card {
    padding: 22px 17px 19px;
  }

  .dialog-head h2 {
    font-size: 1.5rem;
  }

  .dialog-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dialog-grid .field + .field {
    margin-top: 0;
  }

  .dialog-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .dialog-actions .btn,
  .dialog-actions .btn-primary {
    width: 100%;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
    transform: translateY(16px);
  }

  .toast.is-visible {
    transform: translateY(0);
  }
}

@media (max-width: 390px) {
  .entry-card .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cat-option:last-child {
    grid-column: span 1;
  }

  .cat-option:first-child {
    grid-column: span 2;
  }

  .entry-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

}

@media (hover: none) {
  .movement-delete {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
