:root {
  color-scheme: dark;
  --bg: #09090b;
  --card: #151518;
  --card2: #1b1b20;
  --text: #f5f5f7;
  --muted: #96969e;
  --orange: #ff8a00;
  --orange2: #ffb13b;
  --line: #2a2a30;
  --danger: #ff453a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  min-height: 100vh;
}

.app {
  max-width: 700px;
  margin: auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 36px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 2px 18px;
}

.eyebrow {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

h1 {
  margin: 5px 0 0;
  font-size: 30px;
  letter-spacing: -0.8px;
}

.card {
  background: linear-gradient(180deg, #17171b, #121215);
  border: 1px solid var(--line);
  border-radius: 22px;
  margin-bottom: 14px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.hero {
  text-align: center;
  padding: 25px 18px;
}

.fuel-icon {
  font-size: 34px;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.hero-value {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin: 5px 0;
}

.primary, .secondary, .icon-button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.primary {
  width: 100%;
  background: var(--orange);
  color: #111;
  border-radius: 16px;
  padding: 15px 18px;
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 14px;
}

.primary:active { transform: scale(.99); }

.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--orange);
  color: #111;
  font-size: 28px;
  font-weight: 500;
}

.section-title {
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 14px;
}

.chart {
  height: 190px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 10px 4px 2px;
  border-bottom: 1px solid var(--line);
}

.bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bar {
  width: 100%;
  max-width: 42px;
  min-height: 4px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--orange2), var(--orange));
}

.bar-label {
  color: var(--muted);
  font-size: 11px;
}

.month-row, .fuel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.month-row:last-child, .fuel-row:last-child { border-bottom: 0; }

.round-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,138,0,.12);
  color: var(--orange);
  flex: 0 0 auto;
}

.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; }
.row-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.row-price { font-weight: 800; white-space: nowrap; }

dialog {
  width: min(92vw, 480px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #17171b;
  color: var(--text);
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.65);
}

dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h2 { margin: 0; font-size: 22px; }

.close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 30px;
  cursor: pointer;
}

label {
  display: block;
  font-weight: 700;
  margin: 16px 0;
}

input {
  width: 100%;
  margin-top: 8px;
  background: #0e0e11;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 13px;
  padding: 14px;
  font: inherit;
  outline: none;
}

input:focus { border-color: var(--orange); }

.price-input {
  position: relative;
}

.price-input input { padding-right: 38px; }
.price-input span {
  position: absolute;
  right: 14px;
  top: 21px;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.dialog-actions .primary, .dialog-actions .secondary {
  margin: 0;
  flex: 1;
}

.secondary {
  padding: 15px;
  border-radius: 16px;
  background: var(--card2);
  color: var(--text);
  font-weight: 700;
}

.month-total {
  font-size: 38px;
  font-weight: 850;
  margin-bottom: 2px;
}

.month-list { margin-top: 14px; }

.edit-delete {
  display: flex;
  gap: 7px;
}

.small-btn {
  border: 0;
  background: var(--card2);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 9px;
  cursor: pointer;
}

.delete-btn { color: var(--danger); }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 22px 5px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: #f5f5f7;
  color: #111;
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 700;
  transition: .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 380px) {
  h1 { font-size: 27px; }
  .hero-value { font-size: 38px; }
}
