:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #607080;
  --line: #d8dee6;
  --accent: #0b6f6a;
  --accent-dark: #075c58;
  --danger: #b42318;
  --success: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 16px;
}

.shell {
  width: min(100%, 720px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.brand {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.subhead {
  margin: 8px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 48px rgba(24, 32, 42, 0.08);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

label {
  font-weight: 650;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

input[type="file"] {
  min-height: 48px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

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

.button.secondary {
  background: #fff;
  color: var(--accent);
  border-color: var(--line);
}

.button.secondary:hover {
  background: #eef7f6;
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.status {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.status[hidden] {
  display: none;
}

.status.success {
  border-color: rgba(6, 118, 71, 0.35);
  color: var(--success);
}

.status.error {
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--danger);
}

.receipts-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.email-chip {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  background: #fff;
}

.receipt-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.receipt {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.receipt h2 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.receipt-meta {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.93rem;
}

.receipt-notes {
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.empty {
  color: var(--muted);
  margin: 14px 0 0;
}

@media (max-width: 620px) {
  .page {
    padding: 20px 12px;
  }

  .topbar,
  .receipts-header {
    display: grid;
  }

  .panel {
    padding: 18px;
  }

  .button {
    width: 100%;
  }
}
