:root {
  color-scheme: light;
  --background: #f6f7f2;
  --surface: #ffffff;
  --ink: #24362e;
  --muted: #627168;
  --line: #dce3db;
  --accent: #286747;
  --accent-hover: #1b5035;
  --focus: #a7cc7b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, textarea, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.page {
  width: min(100%, 660px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.page-header { margin-bottom: 24px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
h1 { margin: 14px 0 8px; font-size: clamp(28px, 7.8vw, 36px); line-height: 1.15; letter-spacing: -.04em; font-weight: 750; }
h2 { margin: 0 0 10px; font-size: 23px; line-height: 1.2; letter-spacing: -.025em; }
p { line-height: 1.5; }
.intro { margin: 0; color: var(--muted); font-size: 16px; }
.ask-form > label { display: block; margin-bottom: 10px; font-size: 15px; font-weight: 650; }
textarea {
  display: block;
  width: 100%;
  min-height: 156px;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 6px rgb(36 54 46 / 3%);
  font-size: 17px;
  line-height: 1.55;
  scroll-margin-top: 20px;
}
textarea::placeholder { color: #78877d; opacity: 1; }
textarea[aria-invalid="true"] { border-color: #b15e47; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
textarea:focus { border-color: var(--accent); outline: 3px solid #dcebcf; outline-offset: 1px; }
.text-tools { margin-top: 10px; }
.text-tools > .button { min-height: 44px; padding: 9px 14px; gap: 8px; font-size: 14px; }
.field-help { margin: 11px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.button {
  display: inline-flex;
  min-height: 50px;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  touch-action: manipulation;
}
.button-primary { color: #fff; background: var(--accent); }
.button-secondary { color: var(--ink); background: #edf1e9; border-color: var(--line); }
.ask-form > .button { width: 100%; }
.button[disabled] { opacity: .65; cursor: wait; }
.keyboard-hint { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.page-footer { margin-top: 30px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; }
.page-footer a { display: inline-block; padding: 10px; color: var(--muted); text-underline-offset: 4px; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.notice-success { color: #25543c; background: #eaf2e3; border-color: #d4e4c7; }
.notice-error { color: #803d2b; background: #fff1ea; border-color: #efd3c5; }
.notice-icon { font-weight: 750; }
.notice strong { font-weight: 700; }

dialog {
  width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 20px 70px rgb(20 38 25 / 20%);
}
dialog::backdrop { background: rgb(24 39 30 / 48%); }
dialog > p, .confirmation-card > p { margin: 0; color: var(--muted); font-size: 14px; }
.question-preview {
  margin: 20px 0;
  padding: 14px 16px;
  border-left: 3px solid #aacb97;
  border-radius: 0 10px 10px 0;
  background: var(--background);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.55;
}
dialog .question-preview { max-height: 35dvh; overflow-y: auto; }
.button-row { display: flex; gap: 10px; }
.button-row > .button { flex: 1; }
.confirmation-card { margin-top: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }

.title-row { display: flex; align-items: center; gap: 14px; }
.title-row h1 { flex: 1; }
.count { margin-top: 8px; min-width: 35px; padding: 6px 10px; border-radius: 10px; background: #e1ebda; color: var(--accent); text-align: center; font-size: 15px; font-weight: 700; }
.question-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.question-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.question-label { display: flex; align-items: flex-start; gap: 15px; min-height: 74px; padding: 20px 18px; cursor: pointer; touch-action: manipulation; }
.answer-checkbox { flex: 0 0 24px; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.question-text { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.5; }
.fallback-answer-button { margin: 0 18px 18px 57px; }
.answer-form[aria-busy="true"] { opacity: .55; pointer-events: none; }
.empty-state { padding: 44px 20px; border: 1px dashed #cbd8c5; border-radius: 18px; text-align: center; }
.empty-icon { display: flex; width: 48px; height: 48px; margin: 0 auto 18px; align-items: center; justify-content: center; border-radius: 50%; color: var(--accent); background: #e1ebda; font-size: 23px; }
.empty-state h2 { font-size: 24px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 15px; }

@media (min-width: 600px) {
  .page { padding-top: 48px; }
  .ask-form > .button { min-height: 54px; }
  textarea { min-height: 180px; }
}
@media (hover: hover) {
  .button-primary:hover { background: var(--accent-hover); }
  .button-secondary:hover { background: #e3eadc; }
  .question-label:hover { background: #fafbf7; }
}
@media (max-width: 350px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .button-row { flex-direction: column-reverse; }
  dialog { padding: 20px; }
}
