* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #f3f2ec;
  color: #183c34;
  font: 16px/1.6 system-ui, sans-serif;
}
header, main, footer { max-width: 1180px; margin: auto; padding: 20px 24px; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid #d4dad3;
}
header nav { display: flex; flex-wrap: wrap; gap: 8px; }
header nav a {
  text-decoration: none;
  color: #214c3d;
  background: #e9eee6;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.9rem;
  font-weight: 650;
}
header nav a[aria-current="page"] { background: #16483e; color: #fff; }
.brand {
  font-size: 1.45rem;
  font-weight: 800;
  text-decoration: none;
  color: #16483e;
}
a { color: #226451; }
h1 {
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  margin: 12px 0 20px;
}
h2 { font-size: 1.3rem; margin: 0 0 16px; }
.hero { padding: 28px 0 12px; max-width: 720px; }
.hero .button { margin-top: 8px; }
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  font-weight: 750;
  color: #647c52;
  margin: 0;
}
.disclaimer {
  max-width: none;
  margin: 0;
  padding: 10px 24px;
  background: #16483e;
  color: #f3f2ec;
  font-size: 0.92rem;
  font-weight: 650;
  position: sticky;
  top: 0;
  z-index: 5;
  text-align: center;
}
.notice {
  background: #ece8d4;
  border-left: 4px solid #96863b;
  padding: 16px;
  font-size: 0.92rem;
}
.panel {
  background: #fffef9;
  border: 1px solid #dbe1d7;
  border-radius: 18px;
  padding: 24px;
  margin: 24px 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  flex-wrap: wrap;
}
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  width: min(100%, 720px);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 10px;
}
.stats span { display: block; font-size: 0.8rem; color: #68766d; }
.stats strong { display: block; font-size: clamp(1.05rem, 2.6vw, 1.8rem); }
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 650;
  margin-bottom: 15px;
}
input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 11px;
  border: 1px solid #bdcbbd;
  border-radius: 8px;
  background: white;
  color: #163a30;
  margin-top: 5px;
}
input[type="checkbox"] { width: auto; margin-top: 0; }
input[type="file"] { font-size: 0.8rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset {
  border: 1px solid #dbe1d7;
  border-radius: 12px;
  margin: 0 0 18px;
  padding: 16px;
}
legend { font-weight: 700; padding: 0 6px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 650; }
.check input { margin-top: 4px; }
button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 650;
  border: 0;
  border-radius: 8px;
  padding: 11px 17px;
  background: #16483e;
  color: white;
  cursor: pointer;
  text-decoration: none;
}
.secondary { background: #e9eee6; color: #214c3d; }
.danger { background: #8b2e2e; color: #fff; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.import { margin: 0; }
.import input { max-width: 260px; }
.muted { font-size: 0.86rem; color: #67766c; }
.receipt {
  border-top: 1px solid #dce3d8;
  padding: 18px 0;
}
.receipt h3 { margin: 0; font-size: 1rem; }
.receipt p { margin: 6px 0; overflow-wrap: anywhere; }
.receipt .amount { font-weight: 750; font-size: 1.2rem; }
.receipt img, #preview-image {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  display: block;
}
#preview-pdf {
  width: 100%;
  min-height: 220px;
  border: 1px solid #dbe1d7;
  border-radius: 8px;
  background: #fff;
}
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e9eee6;
  color: #214c3d;
  margin-right: 6px;
}
.badge.warn { background: #ece8d4; color: #6b5a1d; }
.category-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #eee;
  padding: 7px 0;
  font-size: 0.85rem;
  gap: 10px;
}
.guidance-card, .prompt-card {
  border-top: 1px solid #dce3d8;
  padding: 16px 0;
}
.guidance-card h3, .prompt-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.source { font-size: 0.82rem; }
.meta-list { display: grid; grid-template-columns: 12rem 1fr; gap: 8px 16px; }
.meta-list dt { font-weight: 650; color: #3d5a50; }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }
#status:not(:empty) {
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 14px 24px;
  background: #e2eddf;
  border-radius: 8px;
}
footer { font-size: 0.8rem; color: #68766d; }
:focus-visible { outline: 3px solid #b88121; outline-offset: 3px; }
button:hover, .button:hover { filter: brightness(0.92); }
button:disabled { opacity: 0.65; cursor: wait; }
@media (max-width: 800px) {
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  header, main, footer { padding-left: 16px; padding-right: 16px; }
  .disclaimer { padding-left: 16px; padding-right: 16px; }
  .panel { padding: 18px; }
  .fields { grid-template-columns: 1fr; }
  .meta-list { grid-template-columns: 1fr; }
}
