.md-module {
  --md-ink: #132c53;
  --md-mint: #b8ebd2;
  color: var(--md-ink);
}
.md-module * {
  box-sizing: border-box;
}
.md-module h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin: 8px 0 18px;
}
.md-module h2 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 0 0 12px;
}
.md-module p {
  line-height: 1.6;
}
.md-module :is(button, .md-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 800;
  min-height: 48px;
  border: 2px solid var(--md-ink);
  border-radius: 13px;
  color: var(--md-ink);
  background: #ffe443;
  box-shadow: 3px 3px 0 var(--md-ink);
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
}
.md-module :is(button, .md-button):hover:not(:disabled) {
  transform: translateY(-2px);
}
.md-module :is(button, .md-button):active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.md-module button:disabled {
  cursor: default;
  background: var(--md-mint);
  box-shadow: none;
  opacity: 1;
}
.md-module button.md-secondary {
  background: #fffdf5;
}
.md-module :is(button, a, summary, input, select):focus-visible {
  outline: 4px solid #2176bd;
  outline-offset: 4px;
}
.md-module summary {
  font-weight: 800;
  cursor: pointer;
  padding: 12px 0;
  line-height: 1.45;
}
.md-module a {
  color: #165a8c;
}
.md-hero {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 28px;
  align-items: center;
  border: 3px solid var(--md-ink);
  border-radius: 24px;
  background: var(--md-mint);
  padding: 30px;
  box-shadow: 7px 7px 0 var(--md-ink);
  margin: 12px 7px 26px 0;
}
.md-eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  font-weight: 900;
}
.md-notebook {
  background: #fffdf5;
  transform: rotate(4deg);
  border: 3px solid var(--md-ink);
  border-radius: 12px;
  padding: 24px 14px;
  box-shadow: 6px 6px 0 var(--md-ink);
}
.md-notebook span {
  display: block;
  padding: 12px 7px;
  border-bottom: 2px solid #b7d6de;
  font-weight: 900;
  font-size: 1rem;
  white-space: nowrap;
}
.md-note {
  padding: 14px 18px;
  background: #fff7ce;
  border-left: 5px solid #d39b11;
  border-radius: 8px;
}
.md-balances {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 5px 24px 0;
}
.md-card {
  border: 2px solid var(--md-ink);
  border-radius: 19px;
  padding: 24px;
  background: #fffdf5;
  box-shadow: 4px 4px 0 var(--md-ink);
  min-width: 0;
  margin-bottom: 22px;
}
.md-balances .md-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}
.md-balances .md-card:nth-child(2) {
  background: #dcf6e8;
}
.md-balances .md-card:nth-child(3) {
  background: #e4efff;
}
.md-balances strong {
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.md-balances small,
.md-small {
  font-size: 0.87rem;
  line-height: 1.5;
}
.md-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
  margin-right: 5px;
}
.md-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.md-form label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-weight: 800;
  min-width: 0;
}
.md-form label small {
  font-weight: 400;
  font-size: 0.82rem;
}
.md-form input,
.md-form select {
  font: inherit;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid #667e93;
  border-radius: 10px;
  background: #fff;
  color: var(--md-ink);
}
.md-form select {
  font-size: 0.95rem;
}
.md-wide {
  grid-column: 1/-1;
}
.md-goal-name {
  font-size: 1.3rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.md-goal progress {
  display: block;
  width: 100%;
  height: 22px;
  margin: 20px 0 10px;
  accent-color: #269363;
  border-radius: 10px;
}
.md-habit {
  background: #e9f7ef;
  margin-right: 5px;
}
.md-tracker {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 6px;
  margin: 24px 0 12px;
}
.md-day {
  border: 2px solid #b8c9d0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  padding: 8px 2px;
  gap: 3px;
  font-size: 0.85rem;
}
.md-day b {
  font-size: 1.2rem;
  line-height: 1.1;
}
.md-day.is-done {
  background: #b8ebd2;
  border-color: #36825e;
}
.md-day.is-today {
  outline: 3px solid #132c53;
  outline-offset: 2px;
}
.md-status:empty {
  display: none;
}
.md-status {
  border: 2px solid #276d52;
  background: #e0f6ea;
  border-radius: 12px;
  padding: 15px;
}
.md-status.is-error,
.md-conflict {
  border: 2px solid #a15a17;
  background: #fff0ce;
  border-radius: 12px;
  padding: 15px;
  line-height: 1.5;
}
.md-conflict {
  margin: 12px 0 22px;
}
.md-history {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 650px;
  overflow-y: auto;
}
.md-entry {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid #c5d2db;
}
.md-entry div {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.md-entry span,
.md-entry small {
  font-size: 0.88rem;
  line-height: 1.5;
}
.md-entry button {
  flex: none;
  font-size: 0.85rem;
  padding: 9px 12px;
}
.md-entry.is-cancelled {
  color: #5c6977;
}
.md-entry.is-cancelled strong {
  text-decoration: line-through;
}
.md-entry.is-conflict {
  border-left: 4px solid #d18b32;
  padding-left: 14px;
}
.md-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 22px 0;
}
.md-calendar {
  margin-right: 5px;
  background: #eef3ff;
}
.md-calendar form {
  max-width: 650px;
}
.md-calendar form button {
  grid-column: 1/-1;
}
.md-report {
  border-top: 2px solid #c7d8dd;
  padding-top: 24px;
  margin-top: 28px;
}
.md-report .md-card {
  padding: 18px;
}
@media (max-width: 760px) {
  .md-hero {
    grid-template-columns: 1fr;
    padding: 23px;
  }
  .md-notebook {
    display: none;
  }
  .md-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .md-balances {
    gap: 10px;
  }
  .md-balances .md-card {
    padding: 16px 10px;
  }
  .md-balances small {
    font-size: 0.75rem;
  }
  .md-tracker {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 9px;
  }
  .md-card {
    padding: 20px;
  }
  .md-entry {
    align-items: flex-start;
  }
  .md-habit button {
    width: 100%;
  }
}
@media (max-width: 440px) {
  .md-balances {
    grid-template-columns: 1fr;
  }
  .md-balances .md-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 16px;
  }
  .md-balances strong {
    text-align: right;
  }
  .md-balances small {
    grid-column: 1/-1;
  }
  .md-form {
    grid-template-columns: 1fr;
  }
  .md-entry {
    flex-direction: column;
    gap: 10px;
  }
  .md-entry button {
    align-self: flex-end;
  }
  .md-actions > * {
    width: 100%;
  }
  .md-hero {
    padding: 21px;
  }
  .md-module h1 {
    font-size: 1.9rem;
  }
}
