:root {
  color-scheme: light;
  --ink: #24312f;
  --muted: #63706d;
  --line: #dce7df;
  --paper: #fffdf7;
  --mint: #dff4e8;
  --mint-strong: #71c59b;
  --sky: #dff2ff;
  --coral: #ff8f78;
  --sun: #ffd877;
  --leaf: #2f8f6b;
  --shadow: 0 18px 50px rgba(51, 95, 79, 0.14);
  font-family: "BIZ UDPGothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hero {
  background: linear-gradient(135deg, #f8fff6 0%, #e3f7ff 52%, #fff5eb 100%);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8vw -12vh -8vw;
  height: 22vh;
  background: #ffffff;
  border-radius: 50% 50% 0 0;
}

.hero-inner {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding: 54px 0 96px;
}

.hero-copy,
.section-heading {
  text-align: center;
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--leaf);
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1,
.section-heading h2 {
  font-family: "Kiwi Maru", serif;
  letter-spacing: 0;
  line-height: 1.24;
}

.hero h1 {
  font-size: clamp(2.35rem, 5.2vw, 4.5rem);
  margin: 0 auto;
  max-width: 820px;
}

.lead {
  max-width: 760px;
  color: #40504d;
  font-size: 1.08rem;
  margin: 24px auto 0;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.primary-link,
.secondary-link,
.form-actions button,
#refreshButton,
.app-toast button {
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.primary-link,
.form-actions button,
.app-toast button {
  background: white;
  color: var(--leaf);
  padding: 12px 18px;
  box-shadow: 0 8px 20px rgba(36, 49, 47, 0.08);
}

.primary-link,
.secondary-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
}

.secondary-link,
.primary-link,
#refreshButton,
.form-actions button,
.app-toast button,
.form-actions .quiet-button {
  background: white;
  color: var(--leaf);
  border: 1px solid rgba(47, 143, 107, 0.24);
  box-shadow: none;
}

#needsForm .form-actions button[type="submit"] {
  background: var(--ink);
  color: white;
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(36, 49, 47, 0.16);
}

.hero-illustration {
  width: min(100%, 660px);
  margin: 28px auto 0;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  background: white;
  border: 1px solid rgba(47, 143, 107, 0.18);
  box-shadow: 0 14px 34px rgba(68, 92, 86, 0.08);
}

.hero-illustration img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-panel {
  width: min(100%, 660px);
  margin: 22px auto 0;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  text-align: left;
}

.hero-panel p {
  margin: 10px 0;
  font-weight: 700;
}

.hero-panel .panel-label {
  color: var(--coral);
  font-size: 0.9rem;
}

.intro-band,
.form-section,
.manage-section,
.ideas-section {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.intro-band {
  padding: 28px 0 70px;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.intro-grid article,
.needs-form,
.idea-card,
.my-posts-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(68, 92, 86, 0.08);
}

.intro-grid article {
  padding: 22px;
}

.step {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  font-weight: 700;
}

.intro-grid h2 {
  margin: 14px 0 6px;
  font-size: 1.1rem;
}

.intro-grid p {
  margin: 0;
  color: var(--muted);
}

.form-section,
.manage-section,
.ideas-section {
  padding: 70px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.section-heading p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.compact-heading h2 {
  font-size: 1.45rem;
}

.inline-heading {
  max-width: none;
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

#refreshButton {
  min-width: 86px;
  padding: 10px 16px;
}

.needs-form,
.my-posts-panel {
  padding: 28px;
}

.form-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff8e1;
  border: 1px solid #f2d27a;
  color: #76530f;
  font-weight: 700;
}

.field-note {
  display: none;
}

.public-name-field {
  margin-top: 18px;
}

.private-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 18px;
  color: var(--leaf);
  font-weight: 700;
}

.private-divider::before,
.private-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.private-divider span {
  white-space: nowrap;
}

.private-fields {
  padding: 18px;
  border-radius: 8px;
  background: #fbfffc;
  border: 1px solid var(--line);
}

.manage-form {
  background: #fffefa;
}

.my-posts-panel {
  margin-top: 24px;
}

.my-posts-list {
  display: grid;
  gap: 16px;
}

.manage-post {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(68, 92, 86, 0.08);
  overflow: hidden;
}

.manage-post summary {
  display: grid;
  grid-template-columns: minmax(170px, auto) 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.manage-post summary::-webkit-details-marker {
  display: none;
}

.manage-post summary::after {
  content: "開く";
  justify-self: end;
  min-width: 56px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--mint);
  color: #27614c;
  text-align: center;
  font-size: 0.86rem;
}

.manage-post[open] summary::after {
  content: "閉じる";
}

.manage-post-date {
  color: var(--leaf);
  font-variant-numeric: tabular-nums;
}

.manage-post-title {
  color: var(--ink);
}

.manage-card {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.inline-manage-form {
  display: grid;
  gap: 14px;
}

.inline-message,
#formMessage,
#manageMessage {
  margin: 0;
  color: var(--leaf);
  font-weight: 700;
}

.field-error {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff1ed;
  color: #b94f38;
  border: 1px solid rgba(185, 79, 56, 0.2);
  font-size: 0.88rem;
  font-weight: 700;
}

[aria-invalid="true"] {
  border-color: #d67258;
  box-shadow: 0 0 0 4px rgba(214, 114, 88, 0.12);
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 24px;
}

legend,
label > span,
.wide-field > span {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.visibility-fieldset,
.field-grid,
.field-grid.compact,
.field-grid.single-field {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: none;
}

.visibility-fieldset legend {
  grid-column: 1 / -1;
}

.choice-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfffc;
}

.choice-card input {
  margin-top: 5px;
  accent-color: var(--leaf);
}

.choice-card small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cddbd4;
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 150px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 4px rgba(113, 197, 155, 0.18);
}

.wide-field {
  display: block;
  margin-top: 18px;
}

.consent-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  color: var(--muted);
}

.consent-line input {
  width: auto;
  margin-top: 7px;
  accent-color: var(--leaf);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.form-actions button {
  min-width: 160px;
  min-height: 50px;
}

.submit-frame {
  width: 0;
  height: 0;
  border: 0;
  position: absolute;
  left: -9999px;
}

.ideas-section {
  padding-bottom: 96px;
}

.ideas-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.idea-card {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.idea-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.idea-card p {
  margin: 0;
  color: var(--muted);
}

.idea-meta,
.idea-route,
.idea-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.idea-meta span,
.idea-tags span,
.idea-route span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--mint);
  color: #27614c;
  font-size: 0.86rem;
  font-weight: 700;
}

.idea-route span {
  background: var(--sky);
  color: #28617f;
}

.empty-state,
.config-warning {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  border-radius: 8px;
  border: 1px dashed #b7cbc1;
  background: #fbfffc;
  color: var(--muted);
}

.config-warning {
  color: #8a5a11;
  background: #fff8e1;
  border-color: #f2d27a;
}

.app-toast {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(36, 49, 47, 0.22);
  backdrop-filter: blur(3px);
}

.app-toast[hidden] {
  display: none;
}

.app-toast-dialog {
  width: min(420px, 100%);
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(36, 49, 47, 0.22);
  padding: 30px 26px 26px;
  text-align: center;
  animation: toast-pop 180ms ease-out;
}

.app-toast-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e9f8ef;
  border: 2px solid rgba(47, 143, 107, 0.24);
  color: var(--leaf);
  position: relative;
  animation: toast-icon-pop 420ms cubic-bezier(.18, .89, .32, 1.28);
}

.app-toast-icon::before,
.app-toast-icon::after,
.app-toast-icon-mark {
  content: "";
  position: absolute;
  display: block;
}

.app-toast-icon-success .app-toast-icon-mark,
.app-toast-icon-mail .app-toast-icon-mark {
  width: 28px;
  height: 15px;
  left: 50%;
  top: 48%;
  border-left: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
  transform: translate(-50%, -50%) rotate(-45deg) scaleX(0);
  transform-origin: center;
  animation: toast-check 360ms ease-out 180ms forwards;
}

.app-toast-icon-mail {
  background: #eff8ff;
  border-color: rgba(73, 132, 178, 0.24);
  color: #4f8db7;
}

.app-toast-icon-mail::before {
  width: 34px;
  height: 23px;
  left: 50%;
  top: 50%;
  border: 3px solid currentColor;
  border-radius: 4px;
  opacity: 0.28;
  transform: translate(-50%, -50%);
}

.app-toast-icon-mail::after {
  width: 22px;
  height: 22px;
  left: 50%;
  top: 45%;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  opacity: 0.28;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.app-toast-icon-edit {
  background: #fff8df;
  border-color: rgba(216, 166, 44, 0.28);
  color: #b68416;
}

.app-toast-icon-edit .app-toast-icon-mark {
  width: 32px;
  height: 7px;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-34deg) scaleX(0);
  transform-origin: center;
  animation: toast-pencil 360ms ease-out 170ms forwards;
}

.app-toast-icon-edit::after {
  width: 0;
  height: 0;
  left: 50%;
  top: 50%;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 9px solid currentColor;
  transform: translate(14px, -14px) rotate(-34deg) scale(0);
  animation: toast-pencil-tip 240ms ease-out 330ms forwards;
}

.app-toast-icon-cancel {
  background: #fff1ed;
  border-color: rgba(211, 108, 83, 0.25);
  color: #c46248;
}

.app-toast-icon-cancel::before,
.app-toast-icon-cancel::after {
  width: 34px;
  height: 4px;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg) scaleX(0);
  animation: toast-cross 280ms ease-out 180ms forwards;
}

.app-toast-icon-cancel::after {
  transform: translate(-50%, -50%) rotate(-45deg) scaleX(0);
  animation-delay: 260ms;
}

.app-toast-kicker {
  margin: 0 0 6px;
  color: var(--leaf);
  font-weight: 700;
}

#appToastMessage {
  margin: 0 0 18px;
  color: var(--ink);
}

.app-toast button {
  min-width: 120px;
  min-height: 44px;
}

@keyframes toast-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-icon-pop {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes toast-check {
  to {
    transform: translate(-50%, -50%) rotate(-45deg) scaleX(1);
  }
}

@keyframes toast-pencil {
  to {
    transform: translate(-50%, -50%) rotate(-34deg) scaleX(1);
  }
}

@keyframes toast-pencil-tip {
  to {
    transform: translate(14px, -14px) rotate(-34deg) scale(1);
  }
}

@keyframes toast-cross {
  to {
    transform: translate(-50%, -50%) rotate(45deg) scaleX(1);
  }
}

.app-toast-icon-cancel::after {
  animation-name: toast-cross-alt;
}

@keyframes toast-cross-alt {
  to {
    transform: translate(-50%, -50%) rotate(-45deg) scaleX(1);
  }
}

footer {
  background: #263330;
  color: white;
  padding: 28px 16px;
  text-align: center;
}

footer p {
  margin: 4px 0;
}

@media (max-width: 860px) {
  .inline-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .needs-form,
  .my-posts-panel {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .hero-inner,
  .intro-band,
  .form-section,
  .manage-section,
  .ideas-section {
    width: min(100% - 22px, 920px);
  }

  .hero h1 {
    font-size: 2.28rem;
  }

  .hero-links a {
    width: 100%;
  }

  .manage-post summary {
    grid-template-columns: 1fr;
  }

  .manage-post summary::after {
    justify-self: start;
  }
}
