:root {
  color-scheme: light;
  --bg: #f5f2ec;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #6d675f;
  --line: #ded7cc;
  --gold: #f36f21;
  --gold-dark: #c24b12;
  --bad: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea,
.upload-button {
  font: inherit;
}

.mobile-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  background: #fff;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 3;
}

.mobile-header img {
  width: min(42vw, 190px);
  height: auto;
  display: block;
}

.mobile-header p,
.mobile-header h1,
.section-title h2 {
  margin: 0;
}

.mobile-header p {
  color: var(--gold-dark);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mobile-header h1 {
  font-size: 1.2rem;
}

main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.08);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  font-size: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.field:last-child {
  margin-bottom: 0;
}

.day-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.day-row:last-child {
  border-bottom: 0;
}

.day-name {
  font-weight: 800;
  padding-top: 0;
}

.day-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.day-inputs label {
  display: grid;
  gap: 0.32rem;
  color: var(--muted);
  font-size: 0.86rem;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffdf9;
  color: var(--ink);
  padding: 0.68rem 0.72rem;
  min-height: 2.9rem;
}

textarea {
  resize: vertical;
  min-height: 4.4rem;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(243, 111, 33, 0.3);
  border-color: var(--gold);
}

button,
.upload-button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 0.72rem 0.85rem;
  font-weight: 750;
  text-align: center;
}

button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--gold);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.section-note {
  margin: -0.25rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.receipt-list {
  display: grid;
  gap: 0.75rem;
}

.receipt-row {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffdf9;
}

.receipt-name {
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.receipt-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.receipt-actions {
  display: flex;
  justify-content: flex-end;
}

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

.holiday-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.calendar-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffdf9;
  padding: 0.85rem;
}

.calendar-header {
  display: grid;
  grid-template-columns: 2.8rem 1fr 2.8rem;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  text-align: center;
}

.calendar-header button {
  padding: 0.55rem 0;
}

.calendar-weekdays,
.holiday-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.28rem;
}

.calendar-weekdays {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.35rem;
}

.calendar-day {
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-items: center;
  font-weight: 750;
}

.calendar-day.empty {
  border-color: transparent;
  background: transparent;
}

.calendar-day.in-range {
  border-color: rgba(243, 111, 33, 0.38);
  background: rgba(243, 111, 33, 0.16);
}

.calendar-day.range-edge {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.calendar-summary {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

pre {
  margin: 0;
  min-height: 8rem;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink);
  font-size: 0.82rem;
}

#status {
  color: var(--muted);
  font-size: 0.86rem;
}

.error {
  color: var(--bad);
}

.warning-sheet {
  border-color: var(--gold);
  color: var(--gold-dark);
  font-weight: 750;
}

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

  .day-row,
  .day-inputs,
  .actions,
  .holiday-fields {
    grid-template-columns: 1fr;
  }

  .day-name {
    padding-top: 0;
  }
}
