body{
  background:linear-gradient(135deg,#120024,#220044,#001f3f,#002b36);
  color:white;
  font-family:Arial,sans-serif;
  padding:20px;
  margin:0;
  min-height:100vh;
}
.wrap{max-width:1200px;margin:auto}
h1{text-shadow:0 0 15px #ff4df8}
.hero,.card{
  background:rgba(255,255,255,.08);
  padding:20px;
  border-radius:18px;
  box-shadow:0 0 20px rgba(255,0,255,.3);
  margin-bottom:20px;
}
.label{letter-spacing:2px;font-weight:bold}
.amount{font-size:60px;color:#67f7ff;font-weight:bold;margin:8px 0 12px}
.negative{color:#ff6b6b}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}
label{display:block;font-size:13px;font-weight:bold;margin:10px 4px 5px;color:#d9faff}
input,select{
  padding:9px 10px;
  margin:0 0 4px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.15);
  box-sizing:border-box;
  max-width:100%;
}
input[type=number]{width:160px}
input[type=text]{width:100%}
select{width:100%}
.input-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.currency{font-weight:bold;color:#67f7ff}
button{
  border:1px solid rgba(255,255,255,.18);
  border-radius:11px;
  color:white;
  font-weight:700;
  cursor:pointer;
  transition:transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease;
  letter-spacing:.2px;
}
button:active{transform:translateY(1px)}
.primary-btn{
  min-height:42px;
  padding:0 16px;
  background:linear-gradient(135deg,#ff22c8,#b72cff 48%,#18dff5);
  box-shadow:0 8px 18px rgba(255,34,200,.22),0 0 14px rgba(24,223,245,.14);
}
.primary-btn:hover{
  filter:brightness(1.08);
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(255,34,200,.30),0 0 18px rgba(24,223,245,.20);
}
.action-btn{
  min-height:28px;
  padding:3px 8px;
  font-size:12px;
  border-radius:8px;
  margin-left:8px;
  background:rgba(7,18,36,.55);
  border:1px solid rgba(103,247,255,.35);
  color:#dffcff;
  box-shadow:inset 0 0 10px rgba(103,247,255,.06);
}
.action-btn:hover{
  background:rgba(255,34,200,.16);
  border-color:rgba(255,34,200,.60);
}
.secondary-btn{
  margin-top:10px;
  min-height:38px;
  padding:0 14px;
  background:rgba(14,22,43,.60);
  border:1px solid rgba(103,247,255,.36);
  color:#dffcff;
  box-shadow:inset 0 0 16px rgba(103,247,255,.05);
}
.secondary-btn:hover{
  background:rgba(103,247,255,.12);
  border-color:rgba(103,247,255,.65);
  box-shadow:0 0 14px rgba(103,247,255,.15);
}

.hidden{display:none}
.category-manager{
  margin-top:14px;
  padding:14px;
  border-radius:12px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(103,247,255,.18);
}
.category-manager h3{margin-top:0}
.category-manager h4{margin-bottom:6px;color:#67f7ff}
.category-manager ul{margin-top:6px}
li{margin:7px 0}

/* v4.4.2 layout polish */
.card h2{
  margin-top:0;
  margin-bottom:10px;
  white-space:nowrap;
  font-size:22px;
}
.grid{
  align-items:start;
}
.card{
  min-height:220px;
}
.card .input-row{
  min-height:44px;
}

.input-row{
  min-height:44px;
  align-items:center;
}
.input-row .primary-btn{
  flex:0 0 auto;
}

/* v4.4.5 layout polish */
.card{
  display:flex;
  flex-direction:column;
}
.card ul{
  margin-bottom:0;
}
.category-bottom-btn{
  align-self:flex-start;
  margin-top:auto;
  width:auto;
}

.paycheck-add-btn{margin-top:8px;width:max-content}
.list-heading{
  margin-top:16px;
  font-size:13px;
  font-weight:800;
  letter-spacing:.7px;
  color:#67f7ff;
  text-transform:uppercase;
}
.history-btn{width:100%;margin-top:12px}
.history-panel{
  margin-top:10px;
  padding:12px;
  border-radius:12px;
  background:rgba(0,0,0,.16);
  border:1px solid rgba(103,247,255,.16);
}
.history-month{
  margin-bottom:14px;
  padding-bottom:10px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.history-month:last-child{border-bottom:0;margin-bottom:0}
.history-title{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-weight:800;
  color:#dffcff;
}
.history-total{color:#67f7ff}
.history-note{font-size:12px;opacity:.75;margin-top:4px}

/* v4.5.1 button outline polish */
button{
  border:2px solid #000 !important;
}

/* v4.5.3 category manager button */
.category-add-btn{
  min-height:42px;
  padding:0 16px;
  background:linear-gradient(135deg,#ff22c8,#b72cff 48%,#18dff5);
  box-shadow:0 8px 18px rgba(255,34,200,.22),0 0 14px rgba(24,223,245,.14);
}
.category-add-btn:hover{
  filter:brightness(1.08);
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(255,34,200,.30),0 0 18px rgba(24,223,245,.20);
}

/* v4.5.4 quick money adjustments */
.quick-adjustment{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.13);
}
.adjustment-title{
  font-size:15px;
  font-weight:800;
  color:#dffcff;
  margin-bottom:2px;
}
.quick-adjustment label{
  margin-bottom:6px;
}
.adjust-add-btn,.adjust-sub-btn{
  min-height:38px;
  padding:0 12px;
}
.adjust-sub-btn{
  background:linear-gradient(135deg,#ff5b5b,#ff277c,#9b2cff);
  box-shadow:0 8px 18px rgba(255,65,125,.20),0 0 14px rgba(155,44,255,.13);
}
.adjust-sub-btn:hover{
  filter:brightness(1.08);
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(255,65,125,.28),0 0 18px rgba(155,44,255,.20);
}
.adjustment-list{
  margin-top:10px;
  font-size:13px;
}
.adjustment-item{
  display:flex;
  align-items:center;
  gap:6px;
  margin:6px 0;
}
.adjustment-positive{color:#67f7ff}
.adjustment-negative{color:#ff8a8a}

/* v4.5.5 edit controls */
.edit-btn{
  color:#67f7ff;
}

/* v4.5.6 bank balance controls */
.balance-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.balance-actions .primary-btn{
  min-height:38px;
  padding:0 12px;
}
.balance-add-btn{
  background:linear-gradient(135deg,#18dff5,#2b8cff,#7a2cff);
  box-shadow:0 8px 18px rgba(24,223,245,.20),0 0 14px rgba(122,44,255,.13);
}
.balance-sub-btn{
  background:linear-gradient(135deg,#ff5b5b,#ff277c,#9b2cff);
  box-shadow:0 8px 18px rgba(255,65,125,.20),0 0 14px rgba(155,44,255,.13);
}
.field-help{
  margin-top:8px;
  font-size:12px;
  line-height:1.4;
  color:rgba(223,252,255,.75);
}

/* v4.5.7 monthly financial snapshot */
.hero{
  overflow:hidden;
}
.hero-top{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);
  gap:26px;
  align-items:stretch;
}
.hero-left{
  min-width:0;
}
.monthly-snapshot{
  align-self:stretch;
  padding:18px;
  border-radius:16px;
  background:rgba(5,12,32,.36);
  border:1px solid rgba(103,247,255,.20);
  box-shadow:inset 0 0 24px rgba(103,247,255,.035);
}
.snapshot-heading{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:baseline;
  margin-bottom:15px;
  color:#dffcff;
  font-size:13px;
  font-weight:800;
  letter-spacing:1.4px;
}
#snapshotMonth{
  color:rgba(103,247,255,.72);
  letter-spacing:.4px;
  font-size:12px;
  white-space:nowrap;
}
.snapshot-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.snapshot-stat{
  min-height:86px;
  padding:14px;
  border-radius:13px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.08);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.snapshot-label{
  color:rgba(223,252,255,.72);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.8px;
}
.snapshot-stat strong{
  font-size:24px;
  color:#67f7ff;
  text-shadow:0 0 10px rgba(103,247,255,.14);
}
.snapshot-net{
  margin-top:12px;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  border-radius:13px;
  background:linear-gradient(90deg,rgba(255,34,200,.10),rgba(24,223,245,.08));
  border:1px solid rgba(255,255,255,.09);
  color:#dffcff;
  font-weight:700;
}
.snapshot-net strong{
  font-size:20px;
  color:#67f7ff;
}
.snapshot-net.negative strong{
  color:#ff8a8a;
}
@media (max-width:900px){
  .hero-top{
    grid-template-columns:1fr;
  }
}
@media (max-width:560px){
  .snapshot-grid{
    grid-template-columns:1fr;
  }
}

.snapshot-live{
  display:inline-flex;
  align-items:center;
  padding:3px 7px;
  margin-left:6px;
  border-radius:999px;
  font-size:9px;
  letter-spacing:1px;
  color:#dffcff;
  background:rgba(24,223,245,.10);
  border:1px solid rgba(24,223,245,.35);
}

/* Zero Out */
.reset-row{
  display:flex;
  justify-content:flex-end;
  margin-top:-4px;
  margin-bottom:8px;
}
.reset-btn{
  min-height:34px;
  padding:0 12px;
  border-radius:10px;
  background:rgba(55,10,25,.58);
  color:#ffb0b8;
  border:2px solid #000 !important;
  box-shadow:inset 0 0 12px rgba(255,91,91,.05);
  font-size:12px;
}
.reset-btn:hover{
  background:rgba(255,55,95,.12);
  color:#ffd9de;
  border-color:#000 !important;
  box-shadow:0 0 14px rgba(255,91,91,.18);
}

/* v4.5.8 zero-out spacing polish */
.reset-row{
  display:flex;
  justify-content:flex-end;
  padding-top:14px;
  margin-top:2px;
}
.reset-btn{
  margin-right:2px;
}

/* ============================================================
   Mobile-optimized layout
   PC layout remains unchanged above 700px.
   ============================================================ */
@media (max-width:700px){
  body{
    padding:10px;
    overflow-x:hidden;
  }

  .wrap{
    width:100%;
    max-width:none;
    box-sizing:border-box;
  }

  h1{
    font-size:28px;
    margin:6px 2px 14px;
  }

  .hero,
  .card{
    padding:16px;
    border-radius:16px;
    margin-bottom:14px;
    box-sizing:border-box;
  }

  .hero{
    width:100%;
  }

  .amount{
    font-size:48px;
    line-height:1.05;
    margin:8px 0 12px;
    word-break:break-word;
  }

  #breakdown{
    font-size:13px;
    line-height:1.5;
  }

  .quick-adjustment{
    margin-top:15px;
    padding-top:14px;
  }

  .quick-adjustment .input-row{
    display:grid;
    grid-template-columns:18px minmax(0,1fr);
    gap:6px;
    align-items:center;
  }

  .quick-adjustment .input-row .adjust-add-btn,
  .quick-adjustment .input-row .adjust-sub-btn{
    grid-column:1 / -1;
    width:100%;
    min-height:44px;
    margin:0;
  }

  input,
  select{
    min-height:42px;
    font-size:16px;
  }

  input[type=number],
  input[type=text],
  select{
    width:100%;
    max-width:none;
  }

  .input-row{
    gap:6px;
    flex-wrap:nowrap;
  }

  .input-row .primary-btn{
    min-height:44px;
  }

  .currency{
    min-width:18px;
    text-align:center;
  }

  button{
    min-height:42px;
    font-size:14px;
  }

  .primary-btn{
    width:100%;
    min-height:44px;
  }

  .secondary-btn{
    width:100%;
    min-height:42px;
  }

  .balance-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .balance-actions .primary-btn{
    width:100%;
    min-height:44px;
  }

  .field-help{
    font-size:11px;
    line-height:1.45;
  }

  .grid{
    display:grid;
    grid-template-columns:1fr;
    gap:14px;
    width:100%;
  }

  .grid > .card{
    min-width:0;
    width:100%;
    margin:0;
  }

  .card h2{
    font-size:20px;
    white-space:normal;
    line-height:1.2;
  }

  .list-heading{
    margin-top:13px;
  }

  .history-btn{
    margin-top:10px;
  }

  li{
    margin:8px 0;
    line-height:1.45;
    overflow-wrap:anywhere;
  }

  .action-btn{
    min-height:32px;
    padding:4px 8px;
    font-size:12px;
    margin-left:4px;
  }

  .category-manager{
    padding:12px;
  }

  .category-manager .input-row{
    display:grid;
    grid-template-columns:1fr;
  }

  .category-manager .input-row .category-add-btn{
    width:100%;
    min-height:42px;
  }

  .reset-row{
    justify-content:center;
    padding-top:14px;
  }

  .reset-btn{
    width:100%;
    max-width:none;
    min-height:42px;
  }

  /* Keep the Financial Snapshot usable if it is re-enabled later. */
  .hero-top{
    grid-template-columns:1fr;
    gap:14px;
  }

  .snapshot-grid{
    grid-template-columns:1fr 1fr;
  }

  .monthly-snapshot{
    padding:14px;
  }

  .snapshot-stat{
    min-height:74px;
    padding:11px;
  }

  .snapshot-stat strong{
    font-size:20px;
  }

  .snapshot-heading{
    font-size:12px;
    letter-spacing:1px;
  }
}

@media (max-width:390px){
  body{padding:8px}
  .hero,.card{padding:14px}
  h1{font-size:25px}
  .amount{font-size:43px}
  .snapshot-grid{grid-template-columns:1fr}
}

/* Financial explanation panel */
.how-we-got-there{
  margin-top:14px;
  padding:14px 16px 13px;
  border-radius:15px;
  background:linear-gradient(135deg,rgba(255,255,255,.045),rgba(103,247,255,.035));
  border:1px solid rgba(103,247,255,.16);
  box-shadow:inset 0 0 22px rgba(103,247,255,.025),0 0 18px rgba(122,44,255,.06);
}
.how-heading{margin-bottom:9px;color:#67f7ff;font-size:11px;font-weight:900;letter-spacing:1.6px}
.money-line{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 0}
.money-label{color:rgba(223,252,255,.84);font-size:13px;font-weight:700}
.money-icon{display:inline-flex;width:21px;justify-content:center;margin-right:5px}
.money-line strong{color:#e9ffff;font-size:14px;letter-spacing:.2px;white-space:nowrap}
.money-line:nth-of-type(4) strong,.money-line:nth-of-type(5) strong{color:#67f7ff}
.money-divider{height:1px;margin:7px 0 8px;background:linear-gradient(90deg,rgba(255,34,200,.08),rgba(103,247,255,.35),rgba(255,34,200,.08))}
.money-total{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 11px;border-radius:11px;background:linear-gradient(90deg,rgba(255,34,200,.09),rgba(24,223,245,.09));border:1px solid rgba(255,255,255,.08);color:#fff;font-size:13px;font-weight:900}
.money-total strong{color:#67f7ff;font-size:19px;text-shadow:0 0 11px rgba(103,247,255,.18);white-space:nowrap}
.money-total.negative strong{color:#ff8a8a;text-shadow:0 0 11px rgba(255,98,120,.16)}
@media (max-width:700px){
  .how-we-got-there{padding:13px 12px 12px}
  .money-line{padding:7px 0}
  .money-label{font-size:12px}
  .money-line strong{font-size:13px}
  .money-total strong{font-size:18px}
}


.brand-header{
 display:flex;
 align-items:center;
 gap:12px;
 margin-bottom:18px;
}
.brand-logo{
 width:56px;height:56px;
 display:flex;align-items:center;justify-content:center;
 font-size:32px;
 border-radius:14px;
 background:rgba(103,247,255,.08);
 border:1px solid rgba(103,247,255,.35);
 box-shadow:0 0 12px rgba(103,247,255,.25);
}
.brand-title{
 font-size:2rem;
 font-weight:800;
 color:white;
}
.brand-tagline{
 color:#67f7ff;
 letter-spacing:2px;
 font-size:.75rem;
}


.brand-logo{
  width:56px;
  height:56px;
  overflow:hidden;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.brand-logo img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:12px;
}

.brand-title{
  letter-spacing:0.5px;
}


.budget-word{
  color:#67f7ff;
  text-shadow:0 0 8px rgba(103,247,255,.7),
              0 0 16px rgba(103,247,255,.35);
  font-weight:800;
}

.duck-word{
  color:#ffffff;
  font-weight:800;
}


#budgetduck-splash{
 position:fixed;
 inset:0;
 z-index:99999;
 background:#000;
 display:flex;
 align-items:center;
 justify-content:center;
 transition:opacity .5s ease;
}
#budgetduck-splash img{
 max-width:80%;
 max-height:80%;
}

.brand-logo img{
 width:48px;
 height:48px;
 object-fit:cover;
 border-radius:12px;
}

.budget-word{
 color:#72d972;
 text-shadow:0 0 3px rgba(76,255,76,.25),0 0 6px rgba(76,255,76,.12);
}


.card ul{
 list-style:none;
 padding-left:0;
 margin-left:0;
}
.item-row{
 display:flex;
 justify-content:space-between;
 align-items:center;
 gap:12px;
 margin:10px 0;
}
.item-text{
 flex:1;
 min-width:0;
}
.item-actions{
 display:flex;
 gap:8px;
 flex-shrink:0;
 align-items:center;
}
.item-actions .action-btn{
 margin-left:0;
}


/* Real alignment fix */
.card ul{
  width:100%;
}
.item-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  width:100% !important;
}
.item-text{
  overflow:hidden;
}
.item-actions{
  justify-self:end !important;
  min-width:64px !important;
}


.item-row{
 display:flex;
 align-items:center;
 width:100%;
}
.item-text{
 flex:1;
}
.item-actions{
 margin-left:auto;
 display:flex;
 gap:8px;
 min-width:64px;
 justify-content:flex-end;
}


/* ===== Midnight Mode Launch Candidate ===== */
body{
  background:#0d1117 !important;
  color:#e6edf3 !important;
}

.card,.panel,.widget,.section{
  background:#161b22 !important;
  border-color:#30363d !important;
}

input,select,textarea{
  background:#0f141b !important;
  color:#e6edf3 !important;
  border:1px solid #30363d !important;
}

button{
  border-color:#30363d !important;
}



/* ===== Midnight Button Refresh ===== */

button,
.btn,
input[type="button"],
input[type="submit"]{
    background: linear-gradient(180deg,#7b2cff,#5a1fd1) !important;
    color:#ffffff !important;
    border:1px solid #a56cff !important;
    border-radius:12px !important;
    box-shadow:0 0 8px rgba(165,108,255,.35) !important;
    transition:all .2s ease !important;
}

button:hover,
.btn:hover,
input[type="button"]:hover,
input[type="submit"]:hover{
    box-shadow:0 0 14px rgba(165,108,255,.55) !important;
    transform:translateY(-1px);
}

.delete-btn,
.btn-delete,
button.delete{
    background:#1b1b1f !important;
    border:1px solid #ff5c7a !important;
    color:#ff8ca1 !important;
}



/* Midnight Mode Date Picker Visibility Fix */
input[type="date"]::-webkit-calendar-picker-indicator{
    filter: invert(1) brightness(2);
    cursor:pointer;
}

