:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #3c0d5b;
  background: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --purple: #3c0d5b;
  --purple-dark: #320b4c;
  --field: #f0f0f0;
  --muted: #6f6b71;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 0;
  background: #fff;
}

.top-bar {
  display: flex;
  width: min(100%, 405px);
  height: 40px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
}

.back-button {
  display: grid;
  width: 32px;
  height: 36px;
  place-items: center;
  margin-left: -5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #262329;
  cursor: pointer;
}

.back-button:active {
  background: #f3f0f5;
}

.back-button svg {
  width: 21px;
  height: 21px;
}

.brand {
  display: inline-flex;
  width: 30px;
  height: 32px;
  align-items: center;
  justify-content: center;
}

.form-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: 12px;
}

h1 {
  margin: 0 0 21px;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.35px;
}

#expense-form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.field-group label {
  font-size: 12px;
  font-weight: 500;
  line-height: 15px;
}

.select-wrap,
.input-wrap,
.date-control {
  position: relative;
  display: flex;
  width: 100%;
  height: 43px;
  align-items: center;
  border: 0;
  border-radius: 9px;
  background: var(--field);
  color: #29252c;
}

.field-icon {
  display: grid;
  width: 39px;
  flex: 0 0 39px;
  place-items: center;
  color: var(--purple);
}

.field-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.select-wrap select {
  width: 100%;
  height: 100%;
  appearance: none;
  padding: 0 35px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 450;
  cursor: pointer;
}

.select-chevron {
  position: absolute;
  right: 10px;
  width: 15px;
  height: 15px;
  color: #716d73;
  pointer-events: none;
}

.input-wrap {
  padding: 0 12px;
}

.currency-prefix {
  color: #343038;
  font-size: 13px;
}

.input-wrap input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #29252c;
  font-size: 13px;
}

.select-wrap:focus-within,
.input-wrap:focus-within,
.date-control:focus-visible {
  outline: 2px solid rgb(70 18 115 / 28%);
  outline-offset: 1px;
}

.date-control {
  justify-content: flex-start;
  padding: 0 12px;
  color: #6f6b71;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.date-control.has-date {
  color: #29252c;
}

.date-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--purple);
  font-size: 12px;
  line-height: 18px;
}

.form-message.is-error {
  color: #b42318;
}

.form-footer {
  display: flex;
  flex: 1;
  align-items: flex-end;
  padding-bottom: max(45px, env(safe-area-inset-bottom));
}

.save-button {
  width: 100%;
  min-height: 49px;
  border: 0;
  border-radius: 28px;
  background: var(--purple);
  box-shadow: 0 3px 9px rgb(45 14 70 / 24%);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.save-button:hover {
  background: var(--purple-dark);
}

.save-button:active {
  transform: translateY(1px);
}

.save-button:focus-visible,
.back-button:focus-visible {
  outline: 2px solid #8f65b3;
  outline-offset: 3px;
}

@media (max-height: 700px) {
  .app-shell {
    min-height: 700px;
  }

  .form-footer {
    padding-top: 10px;
    padding-bottom: 24px;
  }
}
