:root {
  --paper: #f4f0e7;
  --panel: #fffdf8;
  --ink: #16211d;
  --muted: #69756f;
  --line: #d7d8d0;
  --green: #08a57c;
  --green-dark: #08745a;
  --green-soft: #def5ed;
  --blue: #3f75f2;
  --blue-dark: #2859bc;
  --blue-soft: #e7eeff;
  --coral: #f36d53;
  --coral-dark: #b44735;
  --coral-soft: #ffe1d8;
  --yellow: #f2c44d;
  --yellow-dark: #8b6814;
  --yellow-soft: #fff1c7;
  --shadow: 0 22px 60px rgb(38 43 38 / 12%);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 4%, rgb(8 165 124 / 14%), transparent 25%),
    radial-gradient(circle at 100% 5%, rgb(243 109 83 / 17%), transparent 28%),
    var(--paper);
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 4px solid rgb(63 117 242 / 24%);
  outline-offset: 3px;
}
.page { width: min(1560px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 40px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(420px, .75fr);
  align-items: end;
  gap: 12px 28px;
  padding: 0 4px 24px;
}
.hero-title { grid-column: 1 / -1; min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 9px; color: var(--green-dark); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.eyebrow i { position: relative; width: 27px; height: 22px; border: 2px solid currentColor; border-radius: 5px; }
.eyebrow i::before, .eyebrow i::after { position: absolute; right: -11px; width: 15px; height: 2px; background: var(--coral); border-radius: 2px; content: ""; }
.eyebrow i::before { top: 5px; rotate: -28deg; }
.eyebrow i::after { bottom: 4px; rotate: 28deg; }
h1 { margin: 0; font-family: "Arial Black", Inter, sans-serif; font-size: clamp(50px, 6vw, 92px); line-height: .95; letter-spacing: normal; }
h1 span { color: var(--coral-dark); }
.lead { margin: 0; color: var(--muted); font-size: clamp(16px, 1.35vw, 23px); font-weight: 800; line-height: 1.5; }
.lead strong { color: var(--ink); }
.hero-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.support-badge, .utility-button { display: inline-flex; align-items: center; min-height: 44px; border-radius: 13px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.support-badge { gap: 8px; padding: 0 14px; color: var(--green-dark); background: var(--green-soft); border: 1px solid #99d8c5; }
.support-badge i { width: 9px; height: 9px; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 4px rgb(8 165 124 / 13%); }
.utility-button { justify-content: center; padding: 0 15px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.utility-button--dark { color: #fff; background: var(--ink); border-color: var(--ink); }

.studio { display: grid; grid-template-columns: minmax(340px, .72fr) minmax(0, 1.65fr); gap: 18px; align-items: stretch; }
.control-card, .route-card, .guide-card, .code-card { overflow: hidden; background: rgb(255 253 248 / 97%); border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--shadow); }
.control-card { grid-column: 1; grid-row: 1; }
.route-card { grid-column: 2; grid-row: 1; min-width: 0; }
.guide-card { grid-column: 1; grid-row: 2; }
.code-card { grid-column: 2; grid-row: 2; min-width: 0; color: #f8fbf9; background: #101a16; border-color: #101a16; }

.panel-head { display: flex; align-items: center; min-height: 78px; gap: 12px; padding: 16px 20px; background: rgb(255 253 248 / 97%); border-bottom: 1px solid var(--line); }
.panel-head > div { min-width: 0; }
.panel-head p, .code-head span { margin: 0 0 3px; color: var(--coral-dark); font-size: 10px; font-weight: 900; letter-spacing: .11em; }
.panel-head h2, .code-head h2 { margin: 0; font-size: clamp(18px, 1.45vw, 25px); line-height: 1.15; }
.section-mark { display: grid; flex: 0 0 47px; width: 47px; height: 47px; place-items: center; color: #fff; border-radius: 15px; font-size: 11px; font-weight: 900; }
.section-mark--green { background: var(--green); }
.section-mark--blue { background: var(--blue); }
.section-mark--coral { background: var(--coral); }
.same-form-badge { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 8px 11px; color: var(--blue-dark); background: var(--blue-soft); border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.same-form-badge i { width: 15px; height: 8px; border: 2px solid currentColor; border-radius: 50%; }

.control-section { padding: 21px 20px; border-bottom: 1px solid var(--line); }
.control-label { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 13px; }
.control-label div { display: grid; gap: 4px; }
.control-label span, .form-rule > span { color: var(--green-dark); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.control-label b { font-size: 16px; }
.control-label output { color: var(--green-dark); font-size: 11px; font-weight: 900; }
.sample-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #eeede7; border: 1px solid #d1d2cc; border-radius: 14px; }
.sample-switch button { z-index: 1; display: grid; gap: 2px; min-height: 57px; padding: 7px; background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.sample-switch button span { color: var(--muted); font-size: 10px; font-weight: 900; }
.sample-switch button b { font-size: 12px; }
.sample-indicator { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border: 1px solid #d8d8d2; border-radius: 10px; box-shadow: 0 4px 10px rgb(35 40 36 / 9%); transition: translate .35s var(--ease); }
.sample-switch button:nth-child(2)[aria-pressed="true"] ~ .sample-indicator { translate: 100% 0; }
.control-help { margin: 9px 0 0; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.55; }

.form-preview { margin: 18px; overflow: hidden; background: #f7f8f5; border: 1px solid var(--line); border-radius: 18px; }
.mini-browser { display: flex; align-items: center; gap: 5px; height: 31px; padding: 0 11px; background: #e8e7e1; border-bottom: 1px solid var(--line); }
.mini-browser i { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.mini-browser i:nth-child(2) { background: var(--yellow); }
.mini-browser i:nth-child(3) { background: var(--green); }
.mini-browser span { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 800; }
.form-preview form { display: grid; gap: 11px; padding: 16px; }
.form-preview label { display: grid; gap: 6px; }
.form-preview label span { font-size: 11px; font-weight: 900; }
.form-preview em { color: var(--coral-dark); font-size: 10px; font-style: normal; }
.form-preview input, .form-preview select { width: 100%; min-height: 42px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #bfc4bd; border-radius: 11px; font-size: 12px; }
.form-preview select { appearance: none; padding-right: 3em; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2316211d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right 1em center; background-repeat: no-repeat; background-size: 1em auto; }
.form-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.action-button { display: grid; align-content: center; gap: 3px; min-width: 0; min-height: 57px; padding: 6px 4px; border: 1px solid; border-radius: 11px; cursor: pointer; }
.action-button span { font-size: 10px; font-weight: 900; white-space: nowrap; }
.action-button small { font-size: 10px; font-weight: 800; white-space: nowrap; }
.action-button--draft { color: var(--coral-dark); background: var(--coral-soft); border-color: #ef9988; }
.action-button--preview { color: var(--blue-dark); background: var(--blue-soft); border-color: #a8bdf4; }
.action-button--publish { color: #fff; background: var(--ink); border-color: var(--ink); }
.form-rule { margin: 0 18px 18px; padding: 15px; background: var(--yellow-soft); border: 1px solid #e5c261; border-radius: 15px; }
.form-rule > span { color: var(--yellow-dark); }
.form-rule code { display: block; margin: 7px 0 5px; color: var(--coral-dark); font-size: 11px; font-weight: 900; }
.form-rule p { margin: 0; color: #786a4c; font-size: 10px; font-weight: 700; line-height: 1.5; }

.route-stage { position: relative; display: grid; grid-template-columns: minmax(120px, .42fr) minmax(300px, 1fr); min-height: 430px; gap: 22px; align-items: center; padding: 22px; background-image: linear-gradient(#e7e8e2 1px, transparent 1px), linear-gradient(90deg, #e7e8e2 1px, transparent 1px); background-size: 24px 24px; }
.source-form { z-index: 2; display: grid; gap: 8px; align-content: center; min-height: 170px; padding: 19px; background: var(--panel); border: 2px solid var(--ink); border-radius: 19px; box-shadow: 9px 9px 0 rgb(22 33 29 / 11%); }
.source-form span { color: var(--green-dark); font-size: 10px; font-weight: 900; }
.source-form b { margin-bottom: 6px; font-size: 17px; }
.source-form i { display: block; height: 13px; background: #e7e9e5; border-radius: 5px; }
.source-form i:nth-of-type(2) { width: 78%; }
.source-form i:nth-of-type(3) { width: 54%; }
.route-lines { position: absolute; inset: 22px; z-index: 1; pointer-events: none; }
.route-lines svg { width: 100%; height: 100%; overflow: visible; }
.path { fill: none; stroke: #bfc6c1; stroke-width: 4; stroke-linecap: round; transition: stroke .25s, stroke-width .25s; }
.packet { position: absolute; top: calc(50% - 19px); left: 21%; display: grid; width: 48px; height: 38px; place-items: center; opacity: 0; color: #fff; background: var(--ink); border: 3px solid var(--panel); border-radius: 11px; box-shadow: 0 7px 16px rgb(22 33 29 / 20%); }
.packet span { font-size: 10px; font-style: normal; font-weight: 900; }
.destinations { z-index: 2; display: grid; gap: 10px; }
.destination { min-width: 0; padding: 14px 15px; background: rgb(255 253 248); border: 2px solid var(--line); border-radius: 17px; transition: border-color .25s, box-shadow .25s, scale .25s var(--ease); }
.destination > span { font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.destination h3 { margin: 3px 0 10px; font-size: 21px; }
.destination dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0; }
.destination dl div { padding: 7px 8px; background: #f2f2ed; border-radius: 9px; }
.destination dt { color: var(--muted); font-size: 10px; font-weight: 900; }
.destination dd { margin: 3px 0 0; font-size: 10px; font-weight: 900; }
.destination--draft > span { color: var(--coral-dark); }
.destination--preview > span { color: var(--blue-dark); }
.destination--publish > span { color: var(--green-dark); }
.route-stage[data-route="draft"] .path--draft { stroke: var(--coral); stroke-width: 6; }
.route-stage[data-route="preview"] .path--preview { stroke: var(--blue); stroke-width: 6; }
.route-stage[data-route="publish"] .path--publish { stroke: var(--green); stroke-width: 6; }
.route-stage[data-route="draft"] .destination--draft { border-color: var(--coral); box-shadow: 0 10px 28px rgb(243 109 83 / 19%); scale: 1.015; }
.route-stage[data-route="preview"] .destination--preview { border-color: var(--blue); box-shadow: 0 10px 28px rgb(63 117 242 / 19%); scale: 1.015; }
.route-stage[data-route="publish"] .destination--publish { border-color: var(--green); box-shadow: 0 10px 28px rgb(8 165 124 / 19%); scale: 1.015; }
.route-stage.is-running .packet { opacity: 1; animation-duration: .78s; animation-timing-function: var(--ease); animation-fill-mode: both; }
.route-stage.is-running[data-route="draft"] .packet { background: var(--coral-dark); animation-name: packetDraft; }
.route-stage.is-running[data-route="preview"] .packet { background: var(--blue-dark); animation-name: packetPreview; }
.route-stage.is-running[data-route="publish"] .packet { background: var(--green-dark); animation-name: packetPublish; }
.route-stage.is-blocked .packet { opacity: 1; left: 48%; color: var(--ink); background: var(--yellow); animation: blockedShake .35s ease both; }
@keyframes packetDraft { 0% { left: 21%; top: calc(50% - 19px); scale: .7; } 20% { scale: 1; } 100% { left: 71%; top: calc(12% - 19px); scale: .9; } }
@keyframes packetPreview { 0% { left: 21%; top: calc(50% - 19px); scale: .7; } 20% { scale: 1; } 100% { left: 71%; top: calc(50% - 19px); scale: .9; } }
@keyframes packetPublish { 0% { left: 21%; top: calc(50% - 19px); scale: .7; } 20% { scale: 1; } 100% { left: 71%; top: calc(88% - 19px); scale: .9; } }
@keyframes blockedShake { 25% { translate: -8px 0; } 50% { translate: 7px 0; } 75% { translate: -4px 0; } }

.result-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 18px; }
.result-strip > div { display: flex; align-items: end; justify-content: space-between; gap: 8px; min-height: 58px; padding: 11px 13px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.result-strip span { color: var(--blue-dark); font-size: 10px; font-weight: 900; }
.result-strip b { overflow: hidden; font-size: clamp(11px, 1.05vw, 16px); text-align: right; text-overflow: ellipsis; }

.panel-head--compact { min-height: 73px; }
.override-list { display: grid; gap: 9px; padding: 17px 17px 10px; }
.override-list > div { display: grid; grid-template-columns: minmax(98px, auto) minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 59px; padding: 8px 10px; background: #f7f8f4; border: 1px solid var(--line); border-radius: 13px; }
.override-list code { color: var(--blue-dark); font-size: 11px; font-weight: 900; }
.override-list p { display: grid; gap: 2px; margin: 0; }
.override-list b { font-size: 11px; }
.override-list small { color: var(--muted); font-size: 10px; }
.override-list > div > span { padding: 6px 8px; color: var(--coral-dark); background: var(--coral-soft); border-radius: 8px; font-size: 10px; font-weight: 900; }
.guide-answer { margin: 0 17px 17px; padding: 15px; color: var(--green-dark); background: var(--green-soft); border: 1px solid #9bd9c7; border-radius: 15px; }
.guide-answer span { font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.guide-answer p { margin: 7px 0 8px; color: var(--ink); font-size: 11px; font-weight: 700; }
.guide-answer code { font-size: 12px; font-weight: 900; }

.code-head { display: flex; justify-content: space-between; align-items: center; min-height: 73px; gap: 14px; padding: 14px 18px; border-bottom: 1px solid rgb(255 255 255 / 13%); }
.code-head span { color: var(--yellow); }
.code-head button { min-height: 40px; padding: 0 14px; color: #fff; background: var(--coral); border: 0; border-radius: 11px; cursor: pointer; font-size: 10px; font-weight: 900; }
.code-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(245px, .64fr); gap: 13px; padding: 14px; }
.code-layout > pre { min-height: 338px; margin: 0; overflow: auto; padding: 18px; background: #07100c; border: 1px solid rgb(255 255 255 / 12%); border-radius: 15px; }
.code-layout code { color: #e5eee9; font: 700 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.code-layout aside { padding: 18px; background: #1c273f; border: 1px solid #35466c; border-radius: 15px; }
.code-layout aside > span { color: #9db7ff; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.code-layout aside h3 { margin: 10px 0 12px; font-size: 21px; line-height: 1.2; }
.code-layout aside pre { margin: 0 0 13px; overflow: auto; padding: 13px; background: #101728; border-radius: 11px; }
.code-layout aside pre code { color: #cbd8ff; font-size: 10px; }
.code-layout aside p { margin: 0; color: #b8c3bd; font-size: 10px; font-weight: 700; line-height: 1.6; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; padding: 12px 16px; color: #fff; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; translate: 0 12px; pointer-events: none; font-size: 11px; font-weight: 900; transition: .25s var(--ease); }
.toast[data-visible="true"] { opacity: 1; translate: 0 0; }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; flex-wrap: wrap; }
  .studio { grid-template-columns: 1fr; }
  .control-card, .route-card, .guide-card, .code-card { grid-column: 1; grid-row: auto; }
  .control-card { order: 1; }
  .route-card { order: 2; }
  .guide-card { order: 3; }
  .code-card { order: 4; }
}
@media (max-width: 700px) {
  .page { width: min(100% - 20px, 620px); padding-top: 17px; }
  .hero { gap: 10px; padding-bottom: 17px; }
  h1 { font-size: clamp(36px, 11vw, 54px); }
  .support-badge { display: none; }
  .same-form-badge { display: none; }
  .route-stage { grid-template-columns: 1fr; min-height: auto; padding: 14px; }
  .source-form { min-height: 120px; }
  .route-lines { display: none; }
  .destination { padding: 12px; }
  .destination h3 { font-size: 18px; }
  .result-strip { grid-template-columns: 1fr 1fr; }
  .code-layout { grid-template-columns: 1fr; }
  .panel-head { padding-inline: 14px; }
}
@media (max-width: 440px) {
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .utility-button { width: 100%; padding-inline: 8px; }
  .form-actions { grid-template-columns: 1fr; }
  .action-button { min-height: 47px; }
  .result-strip { grid-template-columns: 1fr; }
  .override-list > div { grid-template-columns: 1fr auto; }
  .override-list p { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
