:root {
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #17201d;
  background: #f4f7f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, #dff3e8, transparent 35%),
    #f4f7f5;
}

.container {
  width: min(100% - 32px, 960px);
  margin: 0 auto;
  padding: 64px 0;
}

header {
  margin-bottom: 40px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #23815a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1.1;
}

.subtitle {
  max-width: 620px;
  margin: 20px 0 0;
  color: #65716c;
  font-size: 18px;
  line-height: 1.7;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card,
.panel {
  border: 1px solid #dbe4df;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(34, 63, 50, 0.06);
}

.summary-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.summary-card span {
  color: #65716c;
  font-size: 14px;
}

.summary-card strong {
  font-size: 28px;
}

.panel {
  padding: 28px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.panel p {
  margin: 0;
  color: #65716c;
}

@media (max-width: 680px) {
  .container {
    padding: 36px 0;
  }

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

  .summary-card {
    padding: 20px;
  }
}
.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.panel-heading h2 {
  margin: 4px 0 0;
}

.panel-heading > p {
  max-width: 320px;
  text-align: right;
  font-size: 14px;
}

.section-label {
  color: #23815a !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #34413c;
  font-size: 14px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfdad4;
  border-radius: 12px;
  padding: 0 14px;
  color: #17201d;
  background: #ffffff;
  font: inherit;
  font-weight: 400;
  outline: none;
}

input:focus,
select:focus {
  border-color: #23815a;
  box-shadow: 0 0 0 4px rgba(35, 129, 90, 0.12);
}

.money-input {
  position: relative;
}

.money-input span {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  transform: translateY(-50%);
  color: #65716c;
}

.money-input input {
  padding-left: 34px;
}

.full-width {
  width: 100%;
}

button {
  align-self: flex-start;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 0 22px;
  color: white;
  background: #23815a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #196b49;
}

button:active {
  transform: translateY(1px);
}

@media (max-width: 680px) {
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-heading > p {
    text-align: left;
  }

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

  button {
    width: 100%;
  }
}
.records-panel {
  margin-top: 24px;
}

.empty-state {
  border: 1px dashed #cfdad4;
  border-radius: 14px;
  padding: 28px;
  color: #65716c;
  text-align: center;
}

.expense-list {
  display: flex;
  flex-direction: column;
}

.expense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid #e4ebe7;
  padding: 20px 0;
}

.expense-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.expense-item:last-child {
  padding-bottom: 0;
}

.expense-item-main {
  min-width: 0;
}

.expense-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.expense-item-top strong {
  font-size: 17px;
}

.expense-details {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.necessity-tag {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.necessity-tag.required {
  color: #376252;
  background: #e4f1eb;
}

.necessity-tag.optional {
  color: #826619;
  background: #fff2c8;
}

.expense-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.expense-amount {
  white-space: nowrap;
  font-size: 18px;
}

.delete-button {
  align-self: auto;
  min-height: auto;
  border: 1px solid #e5c7c7;
  border-radius: 9px;
  padding: 8px 12px;
  color: #a33b3b;
  background: #fff5f5;
  font-size: 13px;
}

.delete-button:hover {
  color: #8e2525;
  background: #ffe8e8;
}

@media (max-width: 680px) {
  .expense-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .expense-actions {
    width: 100%;
    justify-content: space-between;
  }

  .delete-button {
    width: auto;
  }
}
.budget-panel {
  margin-bottom: 24px;
}

.budget-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 28px;
}

.budget-form button {
  align-self: end;
}

.budget-progress {
  margin-bottom: 24px;
}

.budget-progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: #65716c;
  font-size: 14px;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e7edea;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #23815a;
  transition:
    width 300ms ease,
    background 300ms ease;
}

.progress-fill.warning {
  background: #d59425;
}

.progress-fill.danger {
  background: #c64d4d;
}

.budget-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.budget-stats article {
  border: 1px solid #e0e8e4;
  border-radius: 14px;
  padding: 18px;
  background: #f8faf9;
}

.budget-stats span {
  display: block;
  margin-bottom: 10px;
  color: #65716c;
  font-size: 13px;
}

.budget-stats strong {
  font-size: 19px;
}

.budget-message {
  border-radius: 12px;
  padding: 14px 16px;
  color: #53615b;
  background: #eef3f0;
  font-size: 14px;
  line-height: 1.6;
}

.budget-message.safe {
  color: #286247;
  background: #e4f3eb;
}

.budget-message.warning {
  color: #755b16;
  background: #fff3cf;
}

.budget-message.danger {
  color: #923c3c;
  background: #ffebeb;
}

@media (max-width: 780px) {
  .budget-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .budget-form {
    grid-template-columns: 1fr;
  }

  .budget-form button {
    width: 100%;
  }
}

@media (max-width: 440px) {
  .budget-stats {
    grid-template-columns: 1fr;
  }
}
.analysis-panel {
  margin-top: 24px;
}

.secondary-button {
  min-height: 42px;
  border: 1px solid #cfdad4;
  color: #34413c;
  background: #ffffff;
}

.secondary-button:hover {
  border-color: #23815a;
  color: #196b49;
  background: #f3faf6;
}

.category-analysis {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.category-row {
  display: grid;
  gap: 9px;
}

.category-row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.category-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.category-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #23815a;
}

.category-values {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.category-percentage {
  color: #65716c;
  font-size: 13px;
}

.category-bar-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e7edea;
}

.category-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #23815a;
  transition: width 300ms ease;
}

@media (max-width: 680px) {
  .analysis-panel .panel-heading {
    align-items: stretch;
  }

  .secondary-button {
    width: 100%;
  }

  .category-row-heading {
    align-items: flex-start;
  }

  .category-values {
    align-items: flex-end;
    flex-direction: column;
    gap: 2px;
  }
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.header-top .eyebrow {
  margin: 0;
}

.language-control {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 10px;
  color: #65716c;
  font-size: 12px;
  font-weight: 600;
}

.language-control select {
  width: auto;
  min-height: 38px;
  border-radius: 10px;
  padding: 0 34px 0 12px;
  background: white;
}

@media (max-width: 680px) {
  .header-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .language-control {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .language-control select {
    width: 100%;
  }
}
.form-grid > label {
  min-width: 0;
}

#expense-date {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

@supports (-webkit-touch-callout: none) {
  #expense-date {
    height: 48px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 48px;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
  }

  #expense-date::-webkit-date-and-time-value {
    width: 100%;
    margin: 0;
    text-align: center;
  }
}