:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --ink: #20231f;
  --muted: #6b7068;
  --line: #dfe3d8;
  --panel: #ffffff;
  --green: #1f7a5b;
  --green-dark: #155840;
  --gold: #d89b28;
  --rose: #c94f5b;
  --shadow: 0 16px 38px rgba(39, 46, 37, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef3ed 0%, var(--bg) 42%, #fff 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--green-dark);
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.rate-card {
  display: grid;
  grid-template-columns: auto auto 42px;
  align-items: center;
  gap: 10px;
  min-width: 270px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

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

.rate-card button,
.calendar-head button {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 20px;
}

.grid,
.planner {
  display: grid;
  gap: 16px;
}

.grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.planner {
  grid-template-columns: 360px minmax(0, 1fr);
  margin-top: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.converter,
.summary,
.form-panel,
.calendar-panel,
.list-panel {
  padding: 18px;
}

.panel-head,
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  outline: 0;
}

input {
  height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.13);
}

.calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.summary dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.summary dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7ef;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dd {
  margin: 0;
  font-size: 22px;
  font-weight: 850;
}

form {
  display: grid;
  gap: 12px;
}

form button {
  height: 46px;
  margin-top: 2px;
}

.calendar-head {
  margin-bottom: 12px;
}

.weekdays,
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar {
  margin-top: 8px;
}

.day {
  position: relative;
  min-height: 106px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  overflow: hidden;
}

.day.outside {
  background: #f0f2ec;
  color: #a2a99e;
}

.day.today {
  border-color: var(--green);
}

.day strong {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
}

.pill {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(31, 122, 91, 0.12);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-total {
  position: absolute;
  right: 8px;
  bottom: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.list-panel {
  margin-top: 16px;
}

.list-panel .panel-head button {
  min-height: 38px;
  padding: 0 12px;
  background: #eef1e8;
  color: var(--muted);
}

.event-list {
  display: grid;
  gap: 10px;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.event-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.event-date {
  color: var(--green);
  font-weight: 900;
}

.event-main h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.event-main p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.event-cost {
  min-width: 130px;
  text-align: right;
}

.event-cost strong {
  display: block;
  font-size: 17px;
}

.event-cost span {
  color: var(--muted);
  font-size: 12px;
}

.delete {
  margin-top: 8px;
  min-height: 32px;
  padding: 0 10px;
  background: rgba(201, 79, 91, 0.1);
  color: var(--rose);
}

.delete:hover {
  background: rgba(201, 79, 91, 0.18);
}

@media (max-width: 820px) {
  .topbar,
  .grid,
  .planner {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: stretch;
  }

  .rate-card {
    min-width: 0;
  }

  .calc-row,
  .event-item {
    grid-template-columns: 1fr;
  }

  .day {
    min-height: 82px;
    padding: 7px;
  }

  .pill:nth-of-type(n + 3) {
    display: none;
  }

  .event-cost {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 16px;
  }

  .converter,
  .summary,
  .form-panel,
  .calendar-panel,
  .list-panel {
    padding: 14px;
  }

  .weekdays,
  .calendar {
    gap: 4px;
  }

  .day {
    min-height: 70px;
  }

  .day-total {
    display: none;
  }
}
