:root {
  color-scheme: light;
  --ink: #202c28;
  --muted: #4e5b55;
  --green: #174a3c;
  --line: #ccd8cd;
  --paper: #f5f6f0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 "Yu Gothic", "Meiryo", system-ui, sans-serif;
}
a { color: var(--green); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: .2rem solid #2260ab; outline-offset: .15rem;
}
.wrap { width: min(72rem, calc(100% - 2rem)); margin-inline: auto; }
.masthead { background: var(--green); color: white; }
.masthead .wrap, .masthead nav, .page-title {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.35rem;
}
.masthead .wrap { min-height: 4rem; padding-block: .7rem; }
.masthead a { color: white; font-weight: 700; }
.masthead .wrap > a { text-decoration: none; }
main { min-height: 65vh; padding-block: 2rem 3.25rem; }
.hero { padding: clamp(1.25rem, 4vw, 3rem); background: #e5eee4; border: 1px solid var(--line); border-radius: .75rem; }
h1, h2, h3, p { margin: 0 0 .7rem; }
h1 { font-size: clamp(1.55rem, 4vw, 2.6rem); line-height: 1.26; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; line-height: 1.4; }
.eyebrow, .required { font-weight: 700; }
.eyebrow { color: var(--green); font-size: .9rem; }
.categories, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-block: 1.15rem; }
.categories a { padding: .45rem .85rem; background: white; border: 1px solid var(--line); border-radius: 2rem; font-size: .9rem; }
.group { margin-top: 1.8rem; scroll-margin-top: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: .85rem; }
.card, .sheet { background: white; border: 1px solid var(--line); border-radius: .65rem; padding: 1.2rem; }
.card { display: flex; flex-direction: column; align-items: flex-start; }
.card p { color: var(--muted); flex: 1; }
.card-grid:has(.card:only-child) { grid-template-columns: minmax(0,1fr); }
.button {
  display: inline-flex; align-items: center; gap: .55em; justify-content: center; min-height: 2.7rem;
  padding: .55rem .9rem; background: var(--green); border: 1px solid var(--green); border-radius: .38rem;
  color: white; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button:hover { background: #23634e; }
.button.secondary { background: white; color: var(--green); }
.button.secondary:hover { background: #e5eee4; }
.button:disabled { opacity: .55; cursor: default; }
.state { display: inline-block; font-size: .88rem; font-weight: 700; color: var(--muted); background: #eef1eb; border-radius: .35rem; padding: .25rem .6rem; }
.back { margin-bottom: 1rem; }
.sheet { max-width: 48rem; margin: 0 auto; padding: clamp(1rem, 4vw, 2rem); }
.description, dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.field { margin: 0 0 1.05rem; }
label, legend, dt { font-weight: 700; }
.field label:not(.check), .field-editor label:not(.check) { display: block; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .4rem; padding: .55rem .8rem; }
input:not([type=checkbox]), select, textarea {
  width: 100%; padding: .48rem .6rem; font: inherit; color: var(--ink); background: white;
  border: 1px solid #899b8e; border-radius: .3rem; margin-top: .25rem;
}
textarea { resize: vertical; }
.required { font-size: .76em; color: #8d2e23; margin-left: .3rem; }
.check { display: flex; align-items: baseline; gap: .5em; margin: .46rem 0; }
.privacy { margin-block: 1.3rem; }
.details { display: grid; grid-template-columns: minmax(7rem,.8fr) minmax(0,2fr); gap: .7rem; }
dd { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem 1rem; }
.field-editor { display: grid; grid-template-columns: 2fr 1fr auto; gap: .6rem; margin-bottom: .75rem; }
.field-editor .wide { grid-column: 1 / -1; }
.field-editor .button { justify-self: start; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: .45rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .8rem; border-bottom: 1px solid var(--line); }
th { background: #e5eee4; }
tr:last-child td { border: 0; }
.alert, #login-message:not(:empty), .success { border-radius: .35rem; padding: .65rem; font-weight: 700; background: #ffebe5; color: #78291f; }
.success { background: #e0f0e7; color: #194737; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; padding-block: .9rem 1.6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
@media (max-width: 40rem) {
  .two, .field-editor { grid-template-columns: 1fr; }
  .details { display: block; }
  dd { margin-bottom: .75rem; }
}
