:root {
  --bg: #eaf1f3;
  --ink: #20343B;
  --muted: #5E7780;
  --panel: #ffffff;
  --line: #d7e3e7;
  --brand: #7FA5AE;
  --brand-strong: #5C8893;
  --chip: #ecf4f6;
  --note: #f5f9fa;
  --danger: #b00020;
  --radius: 14px;
  --shadow: 0 6px 18px rgba(32, 52, 59, .08);
  --shadow-sm: 0 2px 8px rgba(32, 52, 59, .06);
  --gutter: 16px;
}
* {
  box-sizing: border-box
}
html, body {
  height: 100%
}
body {
  margin: 0;
  padding-bottom: 40px;
  background: #73b0bf;
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
}
/* Header */
.header {
  max-width: 1080px;
  margin: 24px auto 8px;
  padding: 0 20px;
}
.h1 {
  font-weight: 800;
  letter-spacing: .02em;
  margin: 0 0 6px;
  font-size: clamp(22px, 2vw + 16px, 34px);
  color: #fff;
}
.sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
}
/* Card */
.card {
  max-width: 1080px;
  margin: 0 auto 28px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card {
  margin-top: 18px
}
@media (max-width:600px) {
  .header {
    margin: 24px var(--gutter) 8px;
  }
  .card {
    margin: 0 var(--gutter) 24px;
  }
}
/* Sections */
.section-body {
  display: grid;
  gap: 14px
}
/* Inputs */
input[type="text"], input[type="email"], input[type="number"], input[type="date"] {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border .15s ease, box-shadow .2s ease;
}

@media (max-width:600px) {
  input[name="name"], input[name="email"] {
    width: 100%;
  }
}
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(127, 165, 174, .25)
}
label {
  display: block;
  font-weight: 600;
  color: var(--muted);
  font-size: 14px
}
.control {
  display: grid;
  gap: 6px
}
/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px
}
/* Choice */
.choice {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none
}
.choice .chip {
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--chip);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-sm);
  transition: transform .04s ease, border .15s ease, background .15s ease;
}
.choice input:checked + .chip {
  border-color: var(--brand-strong);
  background: #fff
}
/* Table */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: none;
  margin-top: 10px;
}
.table-wrap {
  display: none;
}
.table-wrap.active {
  display: block
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  background: #fff;
}
.table th, .table td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.table thead th {
  background: var(--chip);
  text-align: right;
  font-weight: 700
}
.table th:first-child, .table td:first-child {
  text-align: left
}
/* Notes */
.note {
  background: var(--note);
  border: 1px dashed var(--line);
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
}
.note :where(p, ul, ol) {
  margin: 0 0 10px
}
.note :where(ul, ol) {
  padding-left: 1.2em
}
.note :where(li) {
  margin: .2em 0
}
.note :where(p:last-child, ul:last-child, ol:last-child) {
  margin-bottom: 0
}
.note ul {
  list-style: none;
  padding-left: 0;
  margin: 0
}
.note li.heading {
  padding-top: 10px;
  font-size: 120%;
  font-weight: 700;
}
.err {
  background: #ffecec;
  color: var(--danger);
  border: 1px solid #ffc6c6;
  padding: 12px;
  border-radius: 10px
}
/* Buttons */
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 14px;
}
.actions button + button {
  margin-left: 12px
}
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
}
.btn:hover {
  filter: brightness(1.05)
}
.btn:active {
  transform: translateY(1px)
}
/* Totals */
.total {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.small {
  font-size: 13px;
  color: var(--muted)
}
hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0
}
.spacer {
  height: 20px
}
.results-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}