body, html {
  background: linear-gradient(180deg, #1c2433 0%, #222836 100%);
  font-family: 'Quicksand', 'Comic Sans MS', cursive, sans-serif;
  margin: 0;
  min-height: 100vh;
  color: #e4eaf4;
  height: 100vh;
  width: 100vw;
  box-sizing: border-box;
}

/* Landing absolutely covers everything until CSV uploaded */
#landing {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  z-index: 20;
  background: linear-gradient(180deg, #1c2433 0%, #222836 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  box-sizing: border-box;
}

.landing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  height: auto;
  justify-content: center;
}
.cute-graphic {
  font-size: 2.1rem;
  margin-bottom: 0.1rem;
}
.landing-title {
  font-size: 1.15rem;
  color: #b6e2ff;
  font-weight: bold;
  margin-bottom: 0;
}
.landing-desc {
  font-size: 0.98rem;
  color: #c9d8ee;
}

/* CSV upload close to landing content */
#landing .csv-upload-wrapper {
  margin-top: 1.1rem;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: center;
}
#csvFile {
  margin: 0.5rem 0 0 0;
  padding: 0.3rem 1rem;
  background: #232736;
  border-radius: 12px;
  box-shadow: 0 2px 6px 0 #202942;
  border: 1px solid #39486b;
  color: #e4eaf4;
  font-size: 1rem;
  display: block;
}

.cloud-header {
  background: linear-gradient(90deg, #27344d 30%, #232736 100%);
  border-radius: 0;
  box-shadow: 0 4px 30px 0 #10131d90;
  text-align: center;
  padding: 0.3rem 1rem 0.3rem 1rem;
  position: relative;
  z-index: 2;
  max-width: 100vw;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.cloud-header h1 {
  margin-top: 0.5rem;
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
  color: #a6d6fa;
  text-shadow: 0 1px 0 #172137, 0 -1px 0 #203d5c;
  display: block;
  transition: opacity 0.2s;
}
/* Hide the title when CSV is uploaded */
body.csv-uploaded .cloud-header h1 {
  opacity: 0;
  pointer-events: none;
  display: none;
  height: 0;
  margin: 0;
  padding: 0;
}

/* Hide landing, show app view after CSV upload */
body.csv-uploaded #landing {
  display: none !important;
}
body.landing #calendar,
body.landing #month-picker {
  display: none !important;
}

/* Hide the CSV upload input after uploading */
body.csv-uploaded #csvFile {
  display: none !important;
}

#month-picker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.1rem;
  margin: 0.6rem 0 0.3rem 0;
}
#monthLabel {
  font-weight: bold;
  font-size: 1rem;
  color: #91cbfd;
  padding: 0.18rem 0.5rem;
  background: #232f48;
  border-radius: 1rem;
  box-shadow: 0 2px 6px #11151d60;
}
#prevMonth, #nextMonth {
  background: #252e41;
  border: none;
  font-size: 1.2rem;
  border-radius: 50%;
  width: 1.7rem;
  height: 1.7rem;
  box-shadow: 0 1px 8px 0 #1a233070;
  cursor: pointer;
  color: #b3c6e5;
  transition: background 0.2s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#prevMonth:hover, #nextMonth:hover {
  background: #374c6a;
}

.calendar {
  margin: 0 auto 0 auto;
  width: 100vw;
  max-width: 100vw;
  min-width: 320px;
  background: #242b3a;
  border-radius: 0;
  box-shadow: 0 6px 60px 0 #0e122080;
  padding: 1vw 2vw 1vw 2vw;
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  height: calc(100vh - 80px - 2vw);
  box-sizing: border-box;
}

.calendar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0.5rem;
  table-layout: fixed;
  height: 100%;
}
.calendar-table th, .calendar-table td {
  width: 14.285%;
  text-align: left;
  vertical-align: top;
  padding: 0;
  min-width: 90px;
}
.calendar-table th {
  color: #7ca0e1;
  font-weight: 600;
  font-size: 1.15rem;
  padding-bottom: 0.2rem;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 0 #171c2e;
  text-align: center;
  height: auto;
  border: none;
}
.calendar-table tr,
.calendar-table tbody tr {
  height: 1fr;
}
.calendar-table td {
  height: auto;
  min-height: 0;
  border: none;
  padding: 0.15rem;
}
.day-bubble {
  background: linear-gradient(135deg, #293b54 75%, #2b3142 100%);
  border-radius: 16px;
  box-shadow: 0 3px 14px 0 #161b2440, 0 2px 0 #383f57;
  padding: 0.4rem 0.4rem 0.3rem 0.4rem;
  transition: box-shadow 0.18s;
  position: relative;
  overflow: visible;
  border: 2px solid #303b53;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  height: 230px;
  min-height: 130px;
  max-height: 300px;
}
.day-header {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 0.15rem;
  min-height: 2.1rem;
}
.day-num {
  font-size: 1.1rem;
  color: #7ecbff;
  font-weight: bold;
  text-shadow: 0 1px 0 #222c43;
  padding: 0.2rem 0.5rem 0.2rem 0.1rem;
  border-radius: 1rem;
  display: inline-block;
}
.spending-total {
  font-size: 1.09rem;
  color: #ff92bb;
  font-weight: bold;
  background: #232f48;
  border-radius: 0.7rem;
  padding: 0.07rem 0.5rem 0.07rem 0.5rem;
  margin-left: 0.2rem;
  margin-right: 0.1rem;
  text-shadow: 0 1px 0 #2c263a;
  display: inline-block;
}
.spending-total.no-spend {
  color: #384e6a;
  background: #282f43;
}
.transactions-list {
  margin: 0.2rem 0 0 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  max-height: 12em;
  overflow-y: auto;
}
.transactions-list li {
  font-size: 0.97rem;
  color: #bfcbe6;
  margin: 0.12rem 0;
  background: #232a3e;
  border-radius: 10px;
  padding: 0.12rem 0.6rem 0.12rem 0.35rem;
  box-shadow: 0 1px 2px #211e381f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
}
.cloud-bg {
  position: absolute;
  z-index: 0;
  width: 100%;
  height: 100%;
  left: 0; top: 0;
  pointer-events: none;
  background: url('data:image/svg+xml;utf8,<svg width="340" height="140" xmlns="http://www.w3.org/2000/svg"><ellipse cx="80" cy="70" rx="85" ry="35" fill="%232b3950" /><ellipse cx="170" cy="55" rx="60" ry="30" fill="%23314f6b" /><ellipse cx="280" cy="90" rx="70" ry="38" fill="%232c3b52" /></svg>')
    repeat-x 0 82%;
  opacity: 0.18;
  animation: cloudmove 70s linear infinite;
}
@keyframes cloudmove {
  from { background-position-x: 0; }
  to { background-position-x: 100vw; }
}
.calendar:before, .calendar:after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.13;
  pointer-events: none;
}
.calendar:before {
  width: 220px; height: 200px;
  background: radial-gradient(circle at 60% 40%, #33486f 0%, #26304a 85%);
  left: -100px; top: 80px;
  z-index: 0;
}
.calendar:after {
  width: 170px; height: 150px;
  background: radial-gradient(circle at 30% 70%, #483976 0%, #2a3046 85%);
  right: -60px; bottom: 28px;
  z-index: 0;
}
@media (max-width: 1100px) {
  .calendar { padding: 1.1rem 0.2rem 1.2rem 0.2rem; }
  .calendar-table th, .calendar-table td { font-size: 0.99rem; min-width: 60px;}
  .day-bubble { min-height: 80px; height: 140px; max-height: 200px;}
  .cloud-header { padding: 0.5rem 0.8rem 0.25rem 0.8rem; }
  .cloud-header h1 { font-size: 1rem;}
}
@media (max-width: 700px) {
  .calendar { padding: 0.2rem 0.01rem 1.1rem 0.01rem; }
  .calendar-table th, .calendar-table td { font-size: 0.89rem; min-width: 40px;}
  .day-bubble { min-height: 55px; padding: 0.14rem 0.08rem 0.09rem 0.13rem; height:100px; max-height:150px;}
  .day-header { min-height: 1.1rem; }
  .cloud-header { padding: 0.3rem 0.3rem 0.15rem 0.3rem; }
  .cloud-header h1 { font-size: 0.83rem; }
}