﻿:root {
  --bg: #f5efe5;
  --bg-deep: #e7dac5;
  --panel: rgba(255, 251, 244, 0.82);
  --ink: #1d1a16;
  --muted: #786d61;
  --accent: #ae492c;
  --accent-dark: #85361f;
  --secondary: #365b56;
  --line: rgba(29, 26, 22, 0.1);
  --soft: rgba(29, 26, 22, 0.05);
  --warn: #8f2e2e;
  --shadow: 0 22px 50px rgba(71, 48, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Sans GB", "PingFang SC", "Yu Gothic", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(174, 73, 44, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(54, 91, 86, 0.16), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg-deep));
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.84), transparent);
}

.shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.hero,
.panel {
  animation: rise 520ms ease-out;
}

.hero {
  padding: 16px 2px 26px;
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif CJK SC", "Hiragino Mincho ProN", serif;
}

h1 {
  max-width: 11em;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.06;
}

h3 {
  font-size: 1.05rem;
}

.intro {
  max-width: 62rem;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.44);
  backdrop-filter: blur(18px);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 18px;
}

[hidden] {
  display: none !important;
}

.service-entry-panel {
  margin-top: 12px;
  transition: padding 180ms ease, margin 180ms ease;
}

.service-entry-panel.compact {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px;
  margin-top: 8px;
}

.service-entry-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  transition: gap 180ms ease;
}

.service-entry-panel.compact .section-head {
  display: none;
}

.service-entry-panel.compact .service-entry-list {
  gap: 8px;
}

.service-entry-button {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.service-entry-panel.compact .service-entry-button {
  min-height: 42px;
  padding: 9px 12px;
  font-size: 0.92rem;
}

.service-entry-button:hover,
.service-entry-button.selected {
  border-color: rgba(174, 73, 44, 0.46);
  background: rgba(174, 73, 44, 0.09);
  box-shadow: 0 8px 18px rgba(33, 39, 46, 0.08);
  transform: translateY(-1px);
}

.service-entry-button.selected {
  color: var(--accent-dark);
}

.category-button-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.category-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.category-button:hover {
  border-color: rgba(47, 111, 104, 0.5);
  background: rgba(47, 111, 104, 0.09);
  transform: translateY(-1px);
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.service-intro {
  grid-column: 1 / -1;
  padding-bottom: 4px;
}

.service-intro .intro:first-child {
  margin-top: 0;
}

.mode-panel,
.form-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

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

.mode-group {
  display: grid;
  gap: 10px;
}

.mode-group-heading {
  padding: 0 2px;
}

.mode-group-heading h3 {
  font-size: 1rem;
}

.mode-group-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.mode-group-list {
  display: grid;
  gap: 10px;
}

.mode-button {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mode-button:hover,
.mode-button.active {
  transform: translateY(-1px);
  border-color: rgba(174, 73, 44, 0.42);
  background: rgba(174, 73, 44, 0.08);
}

.mode-button span {
  display: block;
}

.mode-tag {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 7px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(54, 91, 86, 0.1);
  color: var(--secondary);
  font-size: 0.76rem;
  font-weight: 700;
}

.mode-name {
  font-weight: 700;
}

.mode-meta {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

.notice-strip,
.notice-box,
.meta {
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.75;
}

.notice-strip {
  padding: 14px 16px;
  margin-bottom: 18px;
}

.collector-form {
  display: grid;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.card-title {
  font-size: 0.92rem;
  color: var(--muted);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

input[readonly] {
  background: rgba(29, 26, 22, 0.05);
  color: #5c5248;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(174, 73, 44, 0.54);
  box-shadow: 0 0 0 4px rgba(174, 73, 44, 0.12);
  transform: translateY(-1px);
}

.field-help {
  font-size: 0.84rem;
  color: var(--muted);
}

.converter-row,
.action-row,
.summary-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.meta {
  margin-top: 14px;
  padding: 14px 16px;
}

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

.card {
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(29, 26, 22, 0.08);
}

.card-title {
  font-size: 0.92rem;
  color: var(--muted);
}

.kana {
  margin: 8px 0 0;
  min-height: 38px;
  font-size: 1.1rem;
  line-height: 1.6;
  word-break: break-word;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fffaf5;
  font-weight: 700;
}

.ghost-button {
  background: rgba(29, 26, 22, 0.06);
  color: var(--ink);
}

.ghost-button.danger {
  color: var(--warn);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.submissions-panel {
  margin-top: 20px;
}

.notice-box {
  padding: 14px 16px;
}

.submission-pre {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: rgba(29, 26, 22, 0.05);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
}

.empty-state {
  padding: 18px;
  border-radius: 8px;
  background: rgba(29, 26, 22, 0.04);
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .flow-list {
    grid-template-columns: 1fr;
  }

  .flow-root {
    width: 160px;
  }

  .flow-root::after {
    display: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1220px);
    padding-top: 20px;
  }

  .panel {
    padding: 18px;
    border-radius: 10px;
  }

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

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

  .service-entry-button {
    min-height: 56px;
    padding: 10px 8px;
    font-size: 0.88rem;
  }

  .service-entry-panel.compact .service-entry-button {
    min-height: 38px;
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  .category-button-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-method-options {
    grid-template-columns: 1fr;
  }

  .submission-head {
    flex-direction: column;
  }

  h1 {
    max-width: none;
  }
}

.flow-list {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  overflow-x: auto;
  padding: 8px 2px 12px;
}

.flow-root,
.flow-node {
  min-height: 58px;
  border: 2px solid #2b3035;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(35, 40, 45, 0.08);
}

.flow-root {
  display: grid;
  place-items: center;
  position: relative;
  padding: 13px 16px;
  font-size: 1.08rem;
  font-weight: 800;
  text-align: center;
}

.flow-root::after,
.flow-column:not(:last-child) .flow-node.selected::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -24px;
  width: 24px;
  height: 2px;
  background: #2b3035;
  transform: translateY(-50%);
}

.flow-columns {
  display: flex;
  align-items: center;
  gap: 42px;
  min-width: max-content;
}

.flow-column {
  position: relative;
  display: grid;
  gap: 16px;
  min-width: 148px;
}

.flow-column:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 29px;
  bottom: 29px;
  left: -22px;
  width: 2px;
  background: rgba(35, 40, 45, 0.52);
}

.flow-column:not(:first-child) .flow-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -22px;
  width: 22px;
  height: 2px;
  background: #2b3035;
  transform: translateY(-50%);
}

.flow-node {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  cursor: pointer;
  text-align: center;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.flow-node:hover,
.flow-node.selected {
  background: #f2f6f5;
  box-shadow: 0 8px 18px rgba(35, 40, 45, 0.12);
  transform: translateY(-1px);
}

.flow-node.selected {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.flow-node.leaf.selected {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
}

.flow-label {
  white-space: pre-line;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.flow-hint,
.flow-cue {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.flow-node.leaf.selected .flow-hint,
.flow-node.leaf.selected .flow-cue {
  color: rgba(255, 255, 255, 0.78);
}

.flow-cue {
  justify-self: center;
  padding: 2px 7px;
  border: 1px solid rgba(35, 40, 45, 0.18);
  background: rgba(255, 255, 255, 0.6);
}

.flow-node.leaf.selected .flow-cue {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.16);
}



@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .flow-list {
    grid-template-columns: 1fr;
  }

  .flow-root {
    width: 160px;
  }

  .flow-root::after {
    display: none;
  }
}

@media (max-width: 720px) {
  .flow-columns {
    gap: 34px;
  }

  .flow-column {
    min-width: 136px;
  }

  .flow-label {
    font-size: 0.94rem;
  }
}


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

.choice-summary {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(47, 111, 104, 0.08);
}

.choice-summary span,
.choice-level-title,
.choice-hint,
.choice-badge {
  color: var(--muted);
  font-size: 0.82rem;
}

.choice-summary strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.choice-level {
  display: grid;
  gap: 8px;
}

.choice-level-title {
  font-weight: 700;
}

.choice-options {
  display: grid;
  gap: 8px;
}

.choice-button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.choice-button:hover,
.choice-button.selected {
  border-color: rgba(47, 111, 104, 0.5);
  background: rgba(47, 111, 104, 0.09);
  box-shadow: 0 8px 18px rgba(33, 39, 46, 0.08);
  transform: translateY(-1px);
}

.choice-label {
  white-space: pre-line;
  font-weight: 800;
  line-height: 1.35;
}

.choice-hint {
  grid-column: 1 / -1;
  line-height: 1.45;
}

.choice-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(174, 73, 44, 0.08);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.payment-method-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.payment-method-section h3 {
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 800;
}

.payment-method-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-method-button {
  display: grid;
  gap: 6px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.payment-method-button span {
  font-weight: 800;
}

.payment-method-button small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.payment-method-button:hover,
.payment-method-button.selected {
  border-color: rgba(47, 111, 104, 0.5);
  background: rgba(47, 111, 104, 0.09);
  box-shadow: 0 8px 18px rgba(33, 39, 46, 0.08);
  transform: translateY(-1px);
}

.choice-badge {
  align-self: start;
  padding: 2px 7px;
  border: 1px solid rgba(47, 111, 104, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* Hide non-essential helper text and preview blocks. */
.mode-panel > .section-head,
.form-panel > .section-head,
.notice-strip,
#statusOutput,
.compact-preview,
.choice-summary,
.choice-level-title,
.choice-badge {
  display: none !important;
}

.choice-list {
  gap: 10px;
}

.choice-button {
  grid-template-columns: minmax(0, 1fr);
}

.form-panel {
  padding-top: 0;
}

.choice-level + .choice-level {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}

/* Separate choice area from the form and keep only one copy action. */
#copyDraftButton,
#copyResultButton {
  display: none !important;
}

.form-panel {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

@media (max-width: 980px) {
  .form-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 22px;
    margin-top: 8px;
  }
}

.inline-copy-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(47, 111, 104, 0.28);
  border-radius: 8px;
  padding: 4px 8px;
  margin: 0 2px;
  background: rgba(47, 111, 104, 0.1);
  color: var(--accent-dark);
  font-weight: 800;
  cursor: pointer;
}

.inline-copy-button:hover {
  background: rgba(47, 111, 104, 0.16);
}

.result-copy-button {
  display: inline-flex !important;
}

#copyResultButton.result-copy-button {
  display: inline-flex !important;
}
