:root {
  color-scheme: light;
  --ink: #1d2528;
  --muted: #627174;
  --line: #d7dfdc;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --sea: #006d77;
  --coral: #d85b48;
  --moss: #5e7b41;
  --gold: #d7a539;
  --shadow: 0 18px 48px rgba(30, 47, 50, 0.14);
  font-family:
    Inter, "Yu Gothic", Meiryo, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(0, 109, 119, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(215, 165, 57, 0.1), transparent 30%),
    var(--paper);
  color: var(--ink);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(29, 37, 40, 0.08);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--sea);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

h2 {
  font-size: 1rem;
}

.stats {
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  text-align: right;
}

.stats-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stats strong {
  display: block;
  font-size: 1.35rem;
}

.stats[hidden] {
  display: none;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 28px;
  align-items: center;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 4px;
}

.intro-copy {
  max-width: 760px;
  min-width: 0;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.badges span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(0, 109, 119, 0.26);
  border-radius: 999px;
  background: #fff;
  color: var(--sea);
  font-size: 0.82rem;
  font-weight: 850;
}

.intro h2 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(1.55rem, 3vw, 2.7rem);
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.intro p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

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

.steps li {
  min-height: 62px;
  padding: 12px;
  border-left: 4px solid var(--sea);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sample-card {
  margin: 0;
  min-width: 0;
}

.sample-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(29, 37, 40, 0.1);
  box-shadow: var(--shadow);
}

.sample-card figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-align: right;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 24px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 40px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.editor {
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.14);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  color: var(--ink);
}

.check {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  min-height: 24px;
}

.check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--sea);
}

.field-note,
.notice {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.6;
}

.notice {
  border-color: rgba(216, 91, 72, 0.35);
  background: rgba(216, 91, 72, 0.06);
  color: #6d443c;
}

.workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, rgba(29, 37, 40, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(29, 37, 40, 0.035) 25%, transparent 25%),
    #eef2ef;
  background-size: 28px 28px;
}

canvas {
  display: block;
  width: min(100%, 960px);
  height: auto;
  aspect-ratio: 10 / 7;
  border: 1px solid rgba(29, 37, 40, 0.1);
  background: #fff;
  box-shadow: var(--shadow);
}

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

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--sea);
  border-radius: 6px;
  background: var(--sea);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  filter: brightness(0.95);
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 12px;
  color: var(--ink);
  line-height: 1.45;
}

#plainText {
  font-family: "Yu Gothic", Meiryo, ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
}

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

  .sample-card {
    max-width: 560px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .editor {
    position: static;
    max-height: none;
  }

  .preview-stage {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats {
    width: 100%;
    text-align: left;
  }

  .grid-two,
  fieldset {
    grid-template-columns: 1fr;
  }

  .intro {
    padding-top: 20px;
  }

  .intro p {
    font-size: 0.94rem;
    line-height: 1.62;
  }

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

  .sample-card {
    max-width: 390px;
  }

  .sample-card figcaption {
    text-align: left;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
