:root {
  --base: #f6f8f8;
  --surface: #ffffff;
  --surface-soft: #eef5f6;
  --line: #d8e2e4;
  --text: #25333a;
  --muted: #5f7078;
  --primary: #286274;
  --primary-dark: #1f4f60;
  --accent: #4f8583;
  --success: #31705b;
  --warning: #9b6233;
  --danger: #a64a4a;
  --focus: #6aa4b6;
  --shadow: 0 10px 24px rgba(33, 55, 64, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: "Yu Gothic", "Meiryo", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

button,
textarea,
input {
  font: inherit;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(180deg, #ffffff 0%, #edf4f5 100%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  padding: 42px 0 34px;
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: #1f3f4c;
  font-size: clamp(1.9rem, 1.6rem + 1vw, 2.55rem);
  line-height: 1.35;
}

h2 {
  margin: 0;
  color: #243f49;
  font-size: 1.28rem;
  line-height: 1.45;
}

.lead {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.main-layout {
  display: grid;
  gap: 22px;
  padding: 28px 0 36px;
}

.notice-card,
.tool-card,
.result-card,
.guide-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.notice-card,
.guide-card {
  padding: 24px 26px;
}

.notice-card ul,
.guide-card ol {
  margin: 12px 0 0;
  padding-left: 1.45em;
}

.tool-card {
  padding: 0;
}

.form-section {
  padding: 26px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-of-type {
  border-bottom: 0;
}

.section-heading,
.field-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.field-heading label {
  display: block;
  color: #243f49;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.45;
}

.hint,
.support-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.check-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 58px;
  padding: 15px 16px;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.check-option:hover {
  background: var(--surface-soft);
  border-color: #b9ced4;
}

.check-option input {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

textarea {
  display: block;
  width: 100%;
  min-height: 170px;
  margin-top: 14px;
  padding: 15px 16px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #cbd8db;
  border-radius: 8px;
  resize: vertical;
  line-height: 1.75;
}

textarea:focus,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(106, 164, 182, 0.42);
  outline-offset: 2px;
}

.support-text {
  padding: 0 26px 18px;
}

.message {
  margin: 0 26px 18px;
  padding: 12px 14px;
  border-radius: 8px;
}

.message-warning {
  color: #6c421d;
  background: #fff6eb;
  border: 1px solid #edd2b2;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px 26px 26px;
  background: #f9fbfb;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}

button {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button,
.voice-button,
.link-button {
  color: var(--primary-dark);
  background: #eaf3f4;
  border-color: #bdd3d8;
}

.secondary-button:hover,
.voice-button:hover,
.link-button:hover {
  background: #dcecee;
}

.ghost-button {
  color: #33464e;
  background: #ffffff;
  border-color: #cbd8db;
}

.ghost-button:hover {
  background: #eef3f3;
}

.voice-button {
  min-width: 140px;
  white-space: nowrap;
}

.voice-button.is-recording {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.voice-button.is-processing {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.voice-button:disabled {
  color: #6f7b80;
  background: #edf0f1;
  border-color: #d6dcde;
  cursor: not-allowed;
}

.result-card {
  padding: 26px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid #bdd3d8;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.link-button:focus-visible {
  outline: 3px solid rgba(106, 164, 182, 0.42);
  outline-offset: 2px;
}

.result-output {
  min-height: 420px;
  background: #f3f7f8;
  font-family: "Yu Gothic", "Meiryo", ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

.copy-status {
  display: block;
  min-height: 1.6em;
  margin-top: 8px;
  color: var(--success);
  font-weight: 700;
}

.site-footer {
  padding: 24px 0 32px;
  color: var(--muted);
  background: #edf2f3;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .wrap {
    width: min(100% - 22px, 1120px);
  }

  .header-inner {
    padding: 32px 0 26px;
  }

  .notice-card,
  .guide-card,
  .form-section,
  .result-card {
    padding: 20px;
  }

  .section-heading,
  .field-heading {
    display: grid;
    gap: 12px;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .support-text {
    padding: 0 20px 16px;
  }

  .message {
    margin: 0 20px 16px;
  }

  .action-row {
    display: grid;
    padding: 20px;
  }

  .action-row button,
  .voice-button,
  .result-actions button,
  .link-button {
    width: 100%;
  }

  .result-actions {
    justify-content: stretch;
  }

  .result-output {
    min-height: 360px;
  }
}
