:root {
  color-scheme: light;
  --green: #123d35;
  --green-dark: #0d302a;
  --mint: #e6f0e8;
  --ink: #20322b;
  --muted: #4e6259;
  --sand: #f5f1e7;
  --paper: #fffdf8;
  --line: #d7ddd2;
  --rust: #833221;
  --error: #ffefeb;
  --focus: #275fab;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--sand);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, select, textarea, input { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .65; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
p + p { margin-top: .45rem; }
h1 { font-size: clamp(1.75rem, 5.5vw, 2.6rem); line-height: 1.18; }
h2 { font-size: 1.08rem; }
h3 { font-size: 1rem; }
img { display: block; max-width: 100%; }

.wrap { width: min(100% - 2rem, 48rem); margin-inline: auto; }
.masthead { background: var(--green); color: #fffdf8; padding: 2rem 0 1.65rem; }
.site-name { font-size: .85rem; color: #d1e7da; letter-spacing: .08em; margin-bottom: .42rem; }
.lede { color: #e0eee7; margin-top: .65rem; max-width: 34rem; font-size: .94rem; }
.lede:empty { display: none; }
.content { padding-block: 1rem 2rem; }
.notice { padding: .7rem .8rem; border-radius: .55rem; background: var(--mint); color: var(--green-dark); overflow-wrap: anywhere; }
.notice.error { background: var(--error); color: var(--rust); }
.content > .notice, #app > .notice { margin-bottom: .75rem; }
.labels { display: grid; gap: .9rem; }
.control { display: grid; gap: .28rem; min-width: 0; }
.control label, label.control { font-size: .88rem; font-weight: 650; }
select, textarea { width: 100%; padding: .62rem .7rem; border: 1px solid #9bae9f; border-radius: .45rem; background: #fff; color: var(--ink); }
select { min-height: 2.75rem; }
textarea { min-height: 6rem; resize: vertical; }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: .78rem; margin-bottom: .75rem; padding: .85rem; }
.help, .meta { color: var(--muted); font-size: .86rem; }
.form-fields { padding: 0; margin: 0; border: 0; min-width: 0; }
.form-fields > .surface { margin-bottom: .8rem; }

.group { background: var(--paper); border: 1px solid var(--line); border-radius: .7rem; margin-bottom: .65rem; }
.group summary { list-style: none; padding: .8rem; display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.group summary::-webkit-details-marker { display: none; }
.group summary::before { content: "›"; width: .75rem; flex: none; color: var(--green); font-size: 1.25rem; line-height: 1; }
.group[open] summary::before { transform: rotate(90deg); }
.group-name { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.priority { flex: none; padding: .14rem .42rem; border-radius: .35rem; color: var(--green); background: var(--mint); font-size: .75rem; }
.group-body { padding: 0 .8rem .2rem; }
.question { border-top: 1px solid var(--line); }
.question-label { display: flex; gap: .6rem; min-height: 2.75rem; align-items: flex-start; padding: .75rem 0 .6rem; cursor: pointer; }
.question-label input { margin: .2rem .18rem 0 .1rem; width: 1.15rem; height: 1.15rem; accent-color: var(--green); flex: none; }
.question-label strong { font-weight: 650; }
.question-label .meta { display: block; margin-top: .08rem; }
.question-body { margin-left: 1.95rem; padding: 0 0 .85rem; }
.question-body textarea { margin-top: .45rem; }
.question-body .photo-controls { margin-top: .65rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.thumbnail { margin-top: .55rem; max-height: 9rem; border-radius: .45rem; object-fit: contain; }
.question-body .photo-status { margin-top: .45rem; }

.button { min-height: 2.75rem; padding: .54rem .78rem; border: 1px solid #9bae9f; border-radius: .48rem; background: var(--paper); color: var(--green-dark); font-weight: 650; }
.button:hover:not(:disabled) { background: var(--mint); }
.button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--green-dark); }
.actions { position: sticky; bottom: 0; z-index: 1; padding: .65rem 0 max(.65rem, env(safe-area-inset-bottom)); background: var(--sand); border-top: 1px solid var(--line); }
.actions .notice { margin-bottom: .5rem; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.padding-top { margin-top: .5rem; }
.admin-history { margin-top: .7rem; }
.admin-history summary { cursor: pointer; padding-block: .4rem; color: var(--green-dark); font-weight: 650; }
.admin-history .reply { border-top: 1px solid var(--line); padding-top: .65rem; margin-top: .45rem; }
.reply .answer { margin: .38rem 0 .55rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply .button { margin-top: .4rem; }
.answer-mark { margin-left: .4rem; font-size: .75rem; font-weight: 550; color: var(--green); }
dialog { max-width: min(90vw, 50rem); max-height: 90vh; max-height: 90dvh; overflow: auto; border: 0; border-radius: .7rem; padding: .8rem; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #071f1acc; }
dialog img { max-height: 70vh; margin: .65rem auto 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 36rem) {
  .wrap { width: min(100% - 3rem, 48rem); }
  .labels { grid-template-columns: 1fr 1fr; }
  .surface, .group summary { padding: 1rem; }
  .group-body { padding-inline: 1rem; }
}
