:root {
  color-scheme: light;
  font-family: "Inter", "Noto Sans TC", system-ui, sans-serif;
  color: #142d31;
  background: #f4f6f3;
  font-size: 16px;
  line-height: 1.55;
  --muted: #506669;
  --border: #d8e3df;
  --accent: #0c6452;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100dvh;
}
button,
select,
textarea {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid #2e8d79;
  outline-offset: 3px;
}
.wrap {
  width: min(100% - 36px, 680px);
  margin-inline: auto;
}
.masthead {
  background: radial-gradient(ellipse at 90% 0%, #2b6352 0, transparent 55%), #172d32;
  color: #f3fff7;
  padding: calc(29px + env(safe-area-inset-top)) 0 64px;
}
.brand {
  color: #a8d6c6;
  font-size: 0.85rem;
  letter-spacing: 0.035em;
  font-weight: 650;
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(1.92rem, 7vw, 2.85rem);
  color: #fff;
  line-height: 1.15;
  margin: 0 0 10px;
}
.intro {
  margin: 0;
  color: #dcece4;
  overflow-wrap: anywhere;
}
.content {
  margin-top: -38px;
  padding-bottom: calc(26px + env(safe-area-inset-bottom));
}
.card {
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid #dbe6df;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px #183b2d12;
}
.section-mark {
  width: 32px;
  height: 4px;
  background: #1a8066;
  border-radius: 4px;
  margin: 0 0 14px;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 0 0 6px;
}
p {
  margin: 0 0 14px;
}
.card p {
  color: var(--muted);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: start;
  gap: 8px 20px;
  margin-bottom: 18px;
}
.section-heading p {
  margin: 0;
  font-size: 0.88rem;
}
label {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
  margin: 0 0 7px;
}
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f9fbfa;
  color: inherit;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.91rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.primary {
  background: var(--accent);
  color: white;
}
.primary:hover {
  background: #075241;
}
.secondary {
  color: #174e43;
  background: #fff;
  border-color: #cddbd6;
}
.secondary:hover {
  background: #f1f6f3;
}
.compact {
  font-size: 0.82rem;
  min-height: 40px;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.prompt-preview {
  font-size: 0.86rem;
  color: var(--muted);
}
summary {
  cursor: pointer;
}
textarea {
  display: block;
  padding: 9px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #142d31;
  background: #fafcfb;
  width: 100%;
  resize: vertical;
  font-size: 0.84rem;
}
.feedback {
  margin: 10px 0 0;
  font-size: 0.85rem;
}
.feedback:empty {
  display: none;
}
.text-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 650;
  text-underline-offset: 3px;
}
.support {
  display: flex;
  align-items: stretch;
  gap: 11px;
  margin: 20px 2px 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.support-line {
  width: 3px;
  border-radius: 3px;
  background: #87aa9d;
  flex: 0 0 3px;
}
.support p {
  margin: 0;
}
.support strong {
  color: #264745;
  margin-right: 4px;
}
@media (max-width: 340px) {
  .wrap {
    width: calc(100% - 24px);
  }
  .actions .button {
    width: 100%;
  }
}

.mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.mode-picker .mode {
  min-width: 0;
  white-space: normal;
  line-height: 1.35;
  padding-inline: 10px;
}
.mode[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.fields select,
.fields input {
  min-width: 0;
}
.payout-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px;
  gap: 8px;
  background: #f4f7f5;
  border-radius: 10px;
  margin: 16px 0 0;
}
.payout-summary .full {
  grid-column: 1 / -1;
}
.payout-summary dt {
  color: var(--muted);
  font-size: 0.82rem;
}
.payout-summary dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
#new-form input,
#new-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: inherit;
  background: #f9fbfa;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
}
#new-form > label,
#new-preview,
#query-result .prompt-preview {
  margin-top: 14px;
}
select:disabled {
  cursor: default;
  opacity: 0.6;
}
@media (max-width: 540px) {
  .fields {
    grid-template-columns: 1fr;
  }
}
