:root {
  color-scheme: light;
  --ink: #17312b;
  --muted: #60716d;
  --paper: #f7f5ee;
  --surface: #fffef9;
  --line: #d8ded8;
  --green: #176b55;
  --green-dark: #104b3d;
  --green-soft: #dcefe7;
  --gold: #bf7a21;
  --gold-soft: #faecd5;
  --red: #9e4036;
  --red-soft: #f8e4df;
  --blue: #326b87;
  --blue-soft: #e0eff5;
  --shadow: 0 18px 50px rgb(23 49 43 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgb(191 122 33 / 10%), transparent 23rem),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(50 107 135 / 35%);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.app-header,
main {
  width: min(1460px, calc(100% - 2rem));
  margin-inline: auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.25rem 0 1.75rem;
}

.header-actions {
  display: grid;
  gap: 0.4rem;
}

.header-actions small {
  color: var(--muted);
  font-size: 0.75rem;
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.button,
.icon-button {
  border: 0;
  border-radius: 0.7rem;
  cursor: pointer;
  font-weight: 750;
}

.button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
}

.button--primary {
  color: white;
  background: var(--green);
  box-shadow: 0 7px 18px rgb(23 107 85 / 20%);
}

.button--primary:hover {
  background: var(--green-dark);
}

.button--quiet {
  color: var(--ink);
  background: #edf0ea;
}

.button--quiet:hover {
  background: #e0e6df;
}

.button--expense {
  color: white;
  background: var(--red);
  box-shadow: 0 7px 18px rgb(158 64 54 / 18%);
}

.button--expense:hover {
  background: #7f332c;
}

.button--danger {
  color: var(--red);
  background: var(--red-soft);
}

.icon-button {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  padding: 0;
  place-items: center;
  background: #edf0ea;
  font-size: 1.2rem;
}

.icon-button:hover {
  background: #e0e6df;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-card--balance {
  border-color: #b6d2c8;
  background: var(--green-soft);
}

.summary-card {
  min-width: 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(255 254 249 / 80%);
}

.summary-card--due {
  color: white;
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.summary-card p {
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.summary-card strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.summary-card small {
  color: var(--muted);
}

.summary-card--due small {
  color: #c6ddd6;
}

.status-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.status-totals > span + span {
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}

.status-totals small {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 750;
}

.status-totals strong {
  font-family: inherit;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 800;
}

.balance-field {
  display: grid;
  gap: 0.25rem;
  margin: 0.45rem 0 0.55rem;
  font-size: 0.76rem;
  font-weight: 750;
}

.balance-input {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.15rem;
  padding-left: 0.55rem;
  color: var(--muted);
  border: 1px solid #bdc8c2;
  border-radius: 0.5rem;
  background: white;
}

.balance-input input {
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  color: var(--ink);
  border: 0;
  background: transparent;
  outline: 0;
}

.balance-input:focus-within {
  outline: 3px solid rgb(50 107 135 / 35%);
  outline-offset: 2px;
}

.calendar-panel,
.schedule-panel {
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 0.7rem;
}

.month-navigation {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.month-navigation h2 {
  min-width: 12rem;
  text-align: center;
}

.calendar-hint {
  margin: 0;
  padding: 0 1.25rem 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.calendar-scroll {
  border-top: 1px solid var(--line);
}

.calendar {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar th {
  height: 2.5rem;
  padding: 0.55rem;
  color: var(--muted);
  border-right: 1px solid var(--line);
  background: #f4f4ed;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar th:last-child,
.calendar td:last-child {
  border-right: 0;
}

.short-day {
  display: none;
}

.calendar td {
  height: 8.2rem;
  padding: 0.45rem;
  vertical-align: top;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.calendar tbody tr:first-child td {
  border-top: 0;
}

.calendar td.is-outside {
  background: #f7f6f0;
}

.calendar td.is-today {
  box-shadow: inset 0 0 0 2px var(--green);
}

.day-number {
  display: grid;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin-bottom: 0.35rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}

.day-number:hover {
  color: white;
  background: var(--green);
}

.is-outside .day-number {
  color: #929d99;
}

.is-today .day-number {
  color: white;
  background: var(--green);
}

.day-items {
  display: grid;
  gap: 0.3rem;
}

.occurrence {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0.32rem 0.42rem;
  color: var(--ink);
  border: 0;
  border-left: 3px solid currentColor;
  border-radius: 0.35rem;
  background: var(--gold-soft);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.occurrence:hover {
  filter: brightness(0.96);
}

.occurrence--paycheck,
.occurrence--income {
  color: var(--blue);
  background: var(--blue-soft);
}

.occurrence--bill {
  color: var(--gold);
}

.occurrence--tithe {
  color: var(--red);
  background: var(--red-soft);
}

.occurrence--expense {
  color: var(--red);
  background: var(--red-soft);
}

.occurrence.is-paid {
  color: var(--muted);
  border-left-color: var(--green);
  background: #e7ebe7;
  text-decoration: line-through;
}

.occurrence strong {
  color: inherit;
}

.schedule-panel {
  display: grid;
  grid-template-columns: minmax(12rem, 0.25fr) 1fr;
  gap: 2rem;
  margin: 1rem 0 3rem;
  padding: 1.4rem;
}

.schedule-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.75rem;
}

.schedule-item,
.empty-state {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #faf9f3;
}

.schedule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.schedule-item > div {
  min-width: 0;
}

.schedule-item p {
  overflow: hidden;
  margin-bottom: 0.2rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-item small,
.empty-state {
  color: var(--muted);
}

.delete-schedule {
  flex: 0 0 auto;
  color: var(--red);
  background: transparent;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  border-style: dashed;
}
