/* Papercraft test theme — kept separate so this visual experiment stays reversible. */
:root {
  --canvas: #eadfce;
  --canvas-pink: #f3dedb;
  --paper: #fffaf0;
  --paper-bright: #fffef9;
  --paper-deep: #eadbc7;
  --ink: #3d443f;
  --ink-soft: #6d746d;
  --forest: #496b58;
  --forest-deep: #304e42;
  --sage: #9fbd92;
  --coral: #d77f77;
  --butter: #e9ba55;
  --sky: #82b7c4;
  --lavender: #a48bc3;
  --recurring: #65a17c;
  --income: #5ca7b7;
  --credit: #d79c3f;
  --saving: #9276bd;
  --danger: #b86162;
  --line: #d8c9b6;
  --line-light: #eee3d3;
  --paper-shadow: 0 5px 0 rgba(112, 84, 55, .08), 0 16px 34px rgba(82, 61, 39, .13);
  --lift-shadow: 0 8px 0 rgba(112, 84, 55, .08), 0 24px 42px rgba(82, 61, 39, .16);
}

html { background: var(--canvas); }

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18px 18px, rgba(109, 116, 109, .09) 1.3px, transparent 1.5px) 0 0 / 36px 36px,
    linear-gradient(112deg, rgba(243, 222, 219, .9), transparent 33%),
    linear-gradient(252deg, rgba(208, 225, 199, .78), transparent 35%),
    var(--canvas);
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  width: 430px;
  height: 110px;
  background: url('/assets/floral-garland.svg') center / contain no-repeat;
  content: "";
  opacity: .55;
  pointer-events: none;
}

body::before { top: -14px; left: -72px; transform: rotate(-7deg); }
body::after { right: -98px; bottom: -20px; transform: rotate(172deg); }

.app-shell {
  z-index: 1;
  max-width: 1900px;
  padding: 26px 48px 96px;
  overflow: visible;
}

.app-shell::before,
.app-shell::after { display: none; }

.topbar {
  position: relative;
  min-height: 92px;
  padding: 18px 30px;
  margin: 0 12px 22px;
  border: 1px solid rgba(184, 151, 116, .35);
  border-radius: 7px 19px 8px 17px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .38) 1px, transparent 1px) 0 0 / 28px 100%,
    #fff7e8;
  box-shadow: var(--paper-shadow);
  transform: rotate(-.2deg);
}

.topbar::before,
.topbar::after {
  position: absolute;
  top: -12px;
  width: 86px;
  height: 24px;
  background: rgba(239, 210, 160, .72);
  box-shadow: 0 1px 2px rgba(80, 58, 33, .12);
  content: "";
}

.topbar::before { left: 8%; transform: rotate(-5deg); }
.topbar::after { right: 9%; transform: rotate(4deg); }

.brand-mark {
  width: 55px;
  height: 55px;
  border: 2px dashed #ca746e;
  border-radius: 50%;
  background: #f6c8bd;
  box-shadow: 0 4px 0 rgba(174, 100, 91, .15);
}

.brand-mark::before { font-size: 30px; }

h1 { font-size: 31px; }
h2 { font-size: clamp(32px, 4vw, 52px); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.eyebrow { color: #8c4346; }

.today-label {
  padding: 10px 15px 9px;
  border: 1px dashed #cba8a2;
  border-radius: 5px 11px 5px 10px;
  background: #f8d9d3;
  color: #765b58;
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 12px;
  transform: rotate(1.2deg);
}

.tabs {
  gap: 5px;
  width: calc(100% - 38px);
  margin: 0 19px 30px;
  padding: 0 10px;
  overflow: visible;
  border: 0;
  border-bottom: 3px solid #b99c7f;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tab-button {
  min-height: 47px;
  margin-bottom: -3px;
  padding: 0 21px;
  border: 1px solid #cdb9a2;
  border-bottom-width: 3px;
  border-radius: 13px 13px 2px 2px;
  background: #f8e1d7;
  color: #704e4c;
  box-shadow: inset 0 -3px 0 rgba(125, 91, 66, .08);
  font-size: 13px;
  transform: none;
}

.tab-button:nth-child(2) { background: #f6e7bd; color: #6d592b; }
.tab-button:nth-child(3) { background: #dcebd8; color: #42604a; }
.tab-button:nth-child(4) { background: #e6dcf1; color: #5c4b76; }
.tab-button:hover { background: #fff7e9; color: var(--forest-deep); transform: translateY(-3px); }
.tab-button.is-active {
  z-index: 1;
  border-bottom-color: var(--paper);
  background: var(--paper);
  color: var(--forest-deep);
  box-shadow: 0 -5px 12px rgba(90, 67, 44, .08);
  transform: translateY(-4px);
}
.tab-button.is-active::before { content: "✿"; }

.tab-panel {
  padding: 34px 38px 42px;
  border: 1px solid rgba(175, 145, 111, .45);
  border-radius: 8px 18px 10px 20px;
  background:
    linear-gradient(rgba(101, 161, 124, .08) 1px, transparent 1px) 0 43px / 100% 29px,
    var(--paper);
  box-shadow: var(--lift-shadow);
}

.tab-panel::before {
  top: 20px;
  right: 27px;
  color: rgba(215, 127, 119, .48);
  content: "✿";
  font-size: 34px;
}

.tab-panel::after {
  position: absolute;
  right: -6px;
  bottom: 38px;
  width: 22px;
  height: 92px;
  border-radius: 3px 0 0 3px;
  background: repeating-linear-gradient(0deg, #d7b8a0 0 9px, #efdcc9 9px 18px);
  content: "";
  opacity: .55;
}

.section-heading { position: relative; z-index: 2; margin-bottom: 30px; }
.section-heading .muted { max-width: 62ch; }
.calendar-heading::after {
  position: absolute;
  right: 230px;
  bottom: -5px;
  color: #d17d76;
  content: "~~~~~~";
  font-family: "Segoe Print", cursive;
  font-size: 19px;
  letter-spacing: 2px;
  opacity: .65;
  transform: rotate(-2deg);
}

.month-controls {
  padding: 8px;
  border: 1px dashed #c6ad94;
  border-radius: 8px 14px 8px 14px;
  background: #f7e8c6;
  box-shadow: 4px 5px 0 rgba(126, 94, 57, .1);
  transform: rotate(.5deg);
}

.month-picker input,
input,
select {
  border: 1px solid #ccbba6;
  border-radius: 5px 10px 5px 10px;
  background: #fffdf7;
  box-shadow: inset 0 2px 0 rgba(101, 79, 54, .04);
}

.icon-button,
.close-button {
  border-color: #c9af94;
  border-radius: 8px 12px 7px 11px;
  background: #fffaf0;
  box-shadow: 3px 3px 0 rgba(114, 83, 50, .12);
}

.primary-button,
.secondary-button {
  border-radius: 6px 12px 6px 11px;
  box-shadow: 4px 4px 0 rgba(69, 76, 66, .14);
}
.primary-button { border: 1px solid #385447; background: #567a63; }
.primary-button:hover { background: #385447; transform: translate(-1px, -2px); }
.income-action-button { border-color: #2f6573; background: #39798a; }
.income-action-button:hover { background: #2f6573; }
.secondary-button { background: #f8e7c8; }

.planner-sheet {
  position: relative;
  z-index: 1;
  padding: 33px 25px 26px;
  border: 1px solid #d2bd9f;
  border-radius: 5px 11px 6px 13px;
  background:
    linear-gradient(90deg, transparent 44px, rgba(221, 134, 135, .23) 45px, rgba(221, 134, 135, .23) 47px, transparent 48px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(95, 151, 166, .13) 31px 32px),
    #fffdf7;
  box-shadow: var(--paper-shadow);
}

.paper-tape {
  position: absolute;
  z-index: 4;
  top: -14px;
  width: 112px;
  height: 31px;
  background: rgba(238, 200, 129, .72);
  box-shadow: 0 2px 3px rgba(80, 57, 33, .1);
  clip-path: polygon(2% 9%, 100% 0, 96% 94%, 0 100%);
}
.paper-tape-left { left: 17%; transform: rotate(-4deg); }
.paper-tape-right { right: 14%; transform: rotate(5deg); }

.planner-flower {
  position: absolute;
  z-index: 5;
  width: 112px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 3px rgba(70, 54, 38, .14));
}
.planner-flower-left { top: -62px; left: -33px; transform: rotate(-18deg); }
.planner-flower-right { right: -28px; bottom: -43px; transform: rotate(156deg); }

.calendar-summary {
  grid-template-columns: 1.12fr 1.12fr .88fr .88fr;
  gap: 13px;
  margin-bottom: 18px;
}

.summary-chip {
  min-height: 88px;
  border: 1px solid rgba(141, 111, 77, .23);
  border-radius: 5px 13px 6px 11px;
  background: #f6dfda;
  box-shadow: 4px 5px 0 rgba(121, 85, 55, .09);
  transform: rotate(-.35deg);
}
.summary-chip:nth-child(2) { background: #f5e4b7; transform: rotate(.45deg); }
.summary-chip:nth-child(3) { background: #d9ebd5; transform: rotate(-.2deg); }
.summary-chip:nth-child(4) { background: #e2d8ee; transform: rotate(.3deg); }
.summary-chip.metric::before,
.summary-chip.compact::before { top: 0; bottom: 0; width: 7px; border-radius: 5px 0 0 5px; }
.summary-chip.metric strong { font-family: Georgia, serif; font-size: 25px; }
.summary-chip.compact strong { font-family: Georgia, serif; font-size: 20px; }

.legend { margin: 0 0 18px 42px; }
.legend span {
  border: 1px dashed rgba(119, 103, 85, .2) !important;
  border-radius: 5px 9px 5px 8px;
  box-shadow: 2px 2px 0 rgba(94, 71, 46, .05);
}

.calendar-wrap {
  border: 2px solid #aa8f72;
  border-radius: 4px 9px 5px 10px;
  background: #fffdf8;
  box-shadow: 5px 7px 0 rgba(112, 84, 55, .1);
}
.calendar-wrap::after { display: none; }

.weekday-row {
  gap: 1px;
  padding: 8px 7px 0;
  background: #fffdf8;
  color: var(--forest-deep);
}
.weekday-row span {
  margin: 0 2px -1px;
  padding: 10px 5px 11px;
  border: 1px solid rgba(86, 74, 60, .18);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f6d3cc;
  text-align: center;
}
.weekday-row span:nth-child(2) { background: #f4e0a9; }
.weekday-row span:nth-child(3) { background: #d7e7d0; }
.weekday-row span:nth-child(4) { background: #cfe7e9; }
.weekday-row span:nth-child(5) { background: #e2d7ee; }
.weekday-row span:nth-child(6) { background: #f3d5e2; }
.weekday-row span:nth-child(7) { background: #efd8b9; }

.calendar-grid { gap: 1px; padding: 1px 7px 8px; background: #d3c3ae; }
.day-cell {
  position: relative;
  min-height: 142px;
  border: 0;
  background: #fffdf8 !important;
  box-shadow: inset 0 -1px 0 rgba(104, 138, 157, .12);
}
.day-cell::after {
  position: absolute;
  right: 7px;
  bottom: 5px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(122, 104, 82, .18);
  border-bottom: 1px solid rgba(122, 104, 82, .18);
  content: "";
}
.day-cell.is-other-month { background: #f2eadf !important; }
.day-cell.is-today { background: #edf5e9 !important; box-shadow: inset 0 0 0 3px #d77f77; }
.day-number span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #f1e6d5;
  color: #665d52;
  font-family: Georgia, serif;
}
.is-today .day-number span { background: #974a50; color: white; }

.event {
  margin: 0 1px 6px;
  border: 1px solid rgba(89, 72, 55, .12);
  border-left-width: 4px;
  border-radius: 4px 9px 4px 8px;
  box-shadow: 2px 3px 0 rgba(91, 66, 42, .07);
  transform: rotate(-.25deg);
}
.event:nth-of-type(even) { transform: rotate(.35deg); }

.content-grid { gap: 32px; }
.form-stack { position: sticky; top: 22px; }
.list-card,
.saving-card,
.credit-card,
.form-card {
  border: 1px solid #d5c0a4;
  border-radius: 6px 14px 7px 13px;
  background:
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(103, 151, 165, .09) 30px 31px),
    #fffdf7;
  box-shadow: var(--paper-shadow);
}
.list-card::before,
.saving-card::before,
.credit-card::before {
  position: absolute;
  z-index: 2;
  width: 82px;
  height: 22px;
  background: rgba(234, 193, 117, .68);
  content: "";
  pointer-events: none;
}
.list-card { position: relative; }
.list-card::before { top: -11px; right: 12%; transform: rotate(4deg); }
.saving-card,
.credit-card { position: relative; overflow: visible; }
.saving-card::before,
.credit-card::before { top: -12px; left: 50%; transform: translateX(-50%) rotate(-3deg); }
.credit-card { overflow: visible; border-top: 1px solid #d5c0a4; }
.credit-card-head { border-radius: 6px 14px 0 0; background: #f8e6bd; }
.saving-card-head { border-radius: 6px 14px 0 0; background: #e6dcf1; }
.credit-card-head::before { content: "✿"; }

.saving-option.is-active {
  border-radius: 4px 8px 4px 8px;
  background: #eadff4;
  box-shadow: 3px 3px 0 rgba(96, 72, 120, .08);
}
.soft-icon,
.count-badge { border-radius: 6px 10px 6px 9px; }
.notice,
.form-error { border-radius: 4px 9px 4px 8px; box-shadow: 3px 3px 0 rgba(83, 69, 53, .07); }

.modal::backdrop { background: rgba(62, 67, 60, .48); backdrop-filter: blur(4px); }
.modal-card { position: relative; border-radius: 7px 17px 8px 15px; }
.modal-card::before,
.modal-card::after {
  position: absolute;
  z-index: 3;
  top: -12px;
  width: 82px;
  height: 24px;
  background: rgba(239, 204, 137, .74);
  content: "";
}
.modal-card::before { left: 28px; transform: rotate(-6deg); }
.modal-card::after { right: 28px; transform: rotate(5deg); }

@media (max-width: 1050px) {
  .app-shell { padding-inline: 24px; }
  .tab-panel { padding-inline: 26px; }
  .calendar-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-heading::after { display: none; }
  .day-cell { min-height: 122px; }
  .is-today .day-number::after { content: "•"; font-size: 18px; letter-spacing: 0; }
}

@media (max-width: 760px) {
  body::before { width: 280px; opacity: .35; }
  body::after { display: none; }
  .app-shell { padding: 17px 10px 45px; }
  .topbar { min-height: 82px; margin-inline: 5px; padding: 14px 16px; }
  .brand-mark { width: 46px; height: 46px; }
  h1 { font-size: 25px; }
  .today-label { margin-left: 60px; }
  .tabs {
    width: calc(100% - 10px);
    margin-inline: 5px;
    padding-inline: 4px;
    overflow-x: auto;
  }
  .tab-button { min-height: 44px; padding-inline: 13px; }
  .tab-panel { padding: 28px 13px 31px; border-radius: 7px 13px; }
  .tab-panel::after { display: none; }
  .month-controls { width: 100%; transform: none; }
  .planner-sheet { padding: 27px 8px 11px; }
  .paper-tape { width: 76px; height: 24px; }
  .planner-flower { width: 76px; }
  .planner-flower-left { top: -41px; left: -14px; }
  .planner-flower-right { right: -11px; bottom: -28px; }
  .calendar-summary { grid-template-columns: 1fr; gap: 9px; }
  .summary-chip { min-height: 73px; transform: none !important; }
  .legend { margin-left: 0; }
  .weekday-row { padding-inline: 3px; }
  .weekday-row span { margin-inline: 0; padding-inline: 1px; font-size: 9px; }
  .calendar-grid { padding-inline: 3px; }
  .day-cell { min-height: 82px; padding: 6px 3px; }
  .day-number span { width: 23px; height: 23px; }
  .event { padding: 5px 3px; }
  .event strong { font-size: 9px; }
  .content-grid,
  .savings-grid { grid-template-columns: 1fr; }
  .form-stack { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

