:root {
  --ink: #18201c;
  --muted: #5b655f;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --line: #d9dfd7;
  --green: #1e7a54;
  --green-dark: #14533b;
  --blue: #276a8a;
  --gold: #d8a441;
  --bot: #edf6ef;
  --user: #e7f1f7;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

.matsuda-page {
  min-height: 100vh;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(30, 122, 84, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(39, 106, 138, 0.14), transparent 44%),
    var(--paper);
}

.matsuda-hero {
  width: min(1120px, 100%);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 40px;
  align-items: center;
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.13;
  letter-spacing: 0;
}

.lead {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sample-button {
  min-height: 42px;
  border: 1px solid rgba(30, 122, 84, 0.22);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
}

.sample-button:hover,
.sample-button:focus-visible {
  border-color: var(--green);
  outline: none;
}

.chat-shell {
  width: 100%;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(24, 32, 28, 0.14);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.chat-label {
  margin-bottom: 4px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.chat-header h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.25;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--green-dark);
  background: #e8f3ea;
  font-size: 12px;
  font-weight: 700;
}

.chat-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbf8);
}

.message {
  width: fit-content;
  max-width: min(86%, 360px);
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.75;
  font-size: 15px;
}

.message p {
  margin-bottom: 0;
}

.message.bot {
  align-self: flex-start;
  background: var(--bot);
}

.message.user {
  align-self: flex-end;
  background: var(--user);
}

.message.loading {
  color: var(--muted);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.input-wrap {
  position: relative;
  min-height: 50px;
}

textarea {
  width: 100%;
  min-height: 50px;
  max-height: 128px;
  resize: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: transparent;
  line-height: 1.55;
  outline: none;
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 122, 84, 0.12);
}

.prompt-ghost {
  pointer-events: none;
  position: absolute;
  left: 15px;
  right: 15px;
  top: 13px;
  overflow: hidden;
  color: #7d8982;
  line-height: 1.55;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.prompt-ghost.visible {
  opacity: 1;
  transform: translateY(0);
}

.prompt-ghost.hidden {
  opacity: 0;
  transform: translateY(-4px);
}

.send-button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 700;
  cursor: pointer;
}

.send-button:hover,
.send-button:focus-visible {
  background: var(--green-dark);
  outline: none;
}

.send-button:disabled {
  cursor: wait;
  background: #91a89b;
}

.input-help {
  margin: -6px 14px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.line-cta {
  width: min(1120px, 100%);
  margin: 24px auto 0;
  padding: 0 0 18px;
}

.line-cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 24px;
  align-items: center;
  border: 1px solid rgba(30, 122, 84, 0.18);
  border-radius: 8px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(24, 32, 28, 0.08);
}

.line-cta-label {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.line-cta h2 {
  margin-bottom: 10px;
  font-size: 26px;
  line-height: 1.35;
}

.line-cta-copy p:last-child,
.line-cta-action p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.line-signup-panel {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(6, 199, 85, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.line-qr-card {
  width: 124px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.qr-placeholder,
.line-qr-image {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--green-dark);
  background:
    linear-gradient(90deg, rgba(24, 32, 28, 0.12) 2px, transparent 2px) 0 0 / 14px 14px,
    linear-gradient(rgba(24, 32, 28, 0.12) 2px, transparent 2px) 0 0 / 14px 14px,
    #f8fbf8;
}

.qr-placeholder span {
  display: block;
  width: 48px;
  border-radius: 6px;
  padding: 4px 0;
  background: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.qr-placeholder small {
  display: block;
  width: 82px;
  border-radius: 999px;
  padding: 3px 0;
  background: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

.qr-placeholder[hidden] {
  display: none;
}

.line-qr-image {
  display: block;
  object-fit: contain;
}

.line-qr-image[hidden] {
  display: none;
}

.line-cta-action {
  display: grid;
  gap: 8px;
}

.line-add-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 20px;
  color: #ffffff;
  background: #06c755;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(6, 199, 85, 0.22);
}

.line-add-button:hover,
.line-add-button:focus-visible {
  background: #05b64e;
  outline: none;
}

.line-cta-action p {
  font-size: 12px;
}

.line-url {
  overflow-wrap: anywhere;
  color: var(--green-dark);
  font-weight: 700;
}

.ad-preview {
  width: min(1120px, 100%);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  border-top: 1px solid rgba(30, 122, 84, 0.2);
  padding-top: 28px;
}

.ad-preview-heading h2 {
  margin-bottom: 10px;
  font-size: 27px;
  line-height: 1.35;
}

.ad-preview-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.ad-banner-list {
  display: grid;
  gap: 12px;
}

.ad-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(24, 32, 28, 0.07);
}

.ad-banner-primary {
  border-color: rgba(30, 122, 84, 0.38);
  background: linear-gradient(90deg, rgba(30, 122, 84, 0.1), #ffffff 42%);
}

.ad-label {
  display: inline-flex;
  width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.ad-banner h3 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.3;
}

.ad-banner p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.ad-banner a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--green-dark);
  background: #edf6ef;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.ad-banner a:hover,
.ad-banner a:focus-visible {
  background: #dceee1;
  outline: none;
}

.sponsor-teaser {
  width: min(1120px, 100%);
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  border-top: 1px solid rgba(30, 122, 84, 0.2);
  padding: 24px 0 6px;
}

.sponsor-teaser h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.35;
}

.sponsor-teaser p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 700;
  text-decoration: none;
}

.primary-link {
  color: #ffffff;
  background: var(--green);
}

.primary-link:hover,
.primary-link:focus-visible {
  background: var(--green-dark);
  outline: none;
}

.secondary-link {
  border: 1px solid rgba(30, 122, 84, 0.28);
  color: var(--green-dark);
  background: #ffffff;
}

.secondary-link:hover,
.secondary-link:focus-visible {
  border-color: var(--green);
  outline: none;
}

.sponsor-page {
  min-height: 100vh;
  padding: 24px 32px 56px;
  background:
    linear-gradient(135deg, rgba(30, 122, 84, 0.1), transparent 36%),
    linear-gradient(315deg, rgba(216, 164, 65, 0.16), transparent 46%),
    var(--paper);
}

.sponsor-nav {
  width: min(1120px, 100%);
  margin: 0 auto 32px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.sponsor-nav a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}

.sponsor-hero {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 52px 0 42px;
}

.sponsor-hero h1 {
  max-width: 860px;
}

.sponsor-hero .lead {
  max-width: 780px;
}

.sponsor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sponsor-band,
.sponsor-grid,
.rules-section,
.contact-section {
  width: min(1120px, 100%);
  margin: 24px auto 0;
}

.sponsor-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: 28px;
  border: 1px solid rgba(30, 122, 84, 0.18);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.78);
}

.sponsor-band h2,
.section-heading h2,
.contact-section h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.35;
}

.sponsor-band p:last-child,
.contact-section p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.85;
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.section-heading {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.sponsor-card {
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
}

.sponsor-card.featured {
  border-color: rgba(30, 122, 84, 0.55);
  box-shadow: 0 18px 42px rgba(24, 32, 28, 0.1);
}

.sponsor-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.sponsor-card p {
  color: var(--muted);
  line-height: 1.75;
}

.sponsor-card .price {
  margin-bottom: 14px;
  color: var(--green-dark);
  font-size: 24px;
  font-weight: 700;
}

.rules-section {
  border-top: 1px solid rgba(30, 122, 84, 0.2);
  padding-top: 28px;
}

.rules-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.rules-list li {
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
  line-height: 1.75;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  border: 1px solid rgba(39, 106, 138, 0.2);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.82);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .matsuda-page {
    padding: 18px;
  }

  .matsuda-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
  }

  h1 {
    font-size: 36px;
  }

  .lead {
    font-size: 16px;
  }

  .chat-shell {
    min-height: 590px;
  }

  .line-cta-inner {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .line-cta h2 {
    font-size: 22px;
  }

  .sponsor-teaser,
  .ad-preview,
  .sponsor-band,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .sponsor-page {
    padding: 18px;
  }

  .sponsor-grid,
  .rules-list {
    grid-template-columns: 1fr;
  }

  .sponsor-band h2,
  .section-heading h2,
  .contact-section h2 {
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .matsuda-page {
    padding: 12px;
  }

  h1 {
    font-size: 30px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .send-button {
    width: 100%;
  }

  .message {
    max-width: 92%;
  }

  .line-cta {
    margin-top: 16px;
    padding-bottom: 6px;
  }

  .line-cta-inner {
    padding: 18px;
  }

  .line-add-button {
    width: 100%;
    min-height: 52px;
  }

  .line-signup-panel {
    grid-template-columns: 1fr;
  }

  .line-qr-card {
    width: 146px;
    justify-self: center;
  }

  .ad-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ad-banner a {
    grid-column: 1 / -1;
    width: 100%;
  }

  .sponsor-actions,
  .sponsor-teaser .secondary-link,
  .contact-section .primary-link {
    width: 100%;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }
}
