:root {
  --ink: #182022;
  --muted: #697173;
  --paper: #f6f3ec;
  --surface: #fffcf6;
  --line: #d9d6cd;
  --accent: #ff5d3a;
  --accent-dark: #d94022;
  --mint: #bce6d9;
  --green: #125d4a;
  --shadow: 0 22px 55px rgba(46, 44, 37, .09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(188, 230, 217, .55), transparent 26rem),
    radial-gradient(circle at 94% 42%, rgba(255, 93, 58, .09), transparent 25rem),
    var(--paper);
  font-family: "Noto Sans JP", sans-serif;
  min-height: 100vh;
}

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

.site-header {
  width: min(1180px, calc(100% - 40px));
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 32, 34, .12);
}

.site-header p {
  color: var(--muted);
  font-size: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  letter-spacing: -.03em;
}

.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: 24px 0 24px;
  text-align: center;
}

.adsbygoogle {
  margin-top: 16px;
}

.eyebrow {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 20px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
}

.eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(40px, 5.1vw, 68px);
  line-height: 1.17;
  letter-spacing: -.065em;
}

h1 em {
  position: relative;
  color: var(--accent);
  font-style: normal;
}

h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: -2%;
  bottom: -5px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'%3E%3Cpath d='M2 8C44 1 106 11 198 3' fill='none' stroke='%23ff5d3a' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.lead {
  margin: 29px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px minmax(0, 1fr);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel, .controls { padding: 30px; }
.controls {
  background: #efede6;
  border-inline: 1px solid var(--line);
}

.panel {
  display: flex;
  flex-direction: column;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.panel-heading > div, .control-block > label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step {
  color: var(--accent);
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

h2 {
  margin: 0;
  font-size: 15px;
}

.counter, .result-count {
  color: var(--muted);
  font-size: 11px;
}

.result-count {
  padding: 5px 9px;
  border-radius: 30px;
  color: var(--green);
  background: var(--mint);
  font-weight: 700;
}

textarea {
  width: 100%;
  color: var(--ink);
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  line-height: 1.9;
}

.panel > textarea {
  min-height: 365px;
  flex: 1;
  font-size: 15px;
}

textarea::placeholder { color: #aaa9a3; }

.control-block { margin-bottom: 25px; }
.control-block > label, legend {
  margin-bottom: 11px;
  font-size: 12px;
  font-weight: 700;
}

.compact-textarea, #maskChar {
  border: 1px solid #cfccc3;
  border-radius: 10px;
  background: var(--surface);
  transition: border .2s, box-shadow .2s;
}

.compact-textarea {
  padding: 11px 12px;
  line-height: 1.55;
}

.compact-textarea:focus, #maskChar:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 93, 58, .12);
}

.hint {
  margin: 7px 0 0;
  color: #858681;
  font-size: 10px;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
}

.mask-picker { display: flex; flex-direction: column; gap: 8px; }

#maskChar {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  text-align: center;
  font-size: 18px;
  outline: 0;
}

.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.preset {
  height: 28px;
  border: 1px solid #d2cfc6;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}
.preset:hover, .preset.active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

legend { padding: 0; }

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 9px;
  cursor: pointer;
}

.radio-card input { accent-color: var(--accent); margin-top: 3px; }
.radio-card span { display: flex; flex-direction: column; }
.radio-card b { font-size: 11px; }
.radio-card small { color: var(--muted); font-size: 9px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -3px 0 21px;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.check-row input { accent-color: var(--accent); }

.primary-button, .copy-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 49px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 93, 58, .22);
  transition: transform .2s, background .2s;
}

.primary-button:hover { background: var(--accent-dark); transform: translateY(-2px); }
.primary-button:active, .copy-button:active { transform: translateY(0); }

.output-panel {
  position: relative;
  background:
    linear-gradient(rgba(255, 252, 246, .86), rgba(255, 252, 246, .86)),
    repeating-linear-gradient(0deg, transparent 0, transparent 29px, #e8e4da 30px);
}

.output-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 17px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.seo-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  margin: 72px auto 10px;
  padding: 52px 58px;
  border-top: 1px solid var(--line);
}

.section-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
}

.seo-content h2 {
  margin-bottom: 18px;
  font-size: 21px;
}

.seo-content p {
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  padding: 15px 28px 15px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.faq details p {
  margin: -3px 0 15px;
  font-size: 12px;
}

.text-button {
  padding: 8px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.text-button:hover { color: var(--ink); }

.copy-button {
  justify-content: center;
  gap: 9px;
  width: auto;
  height: 39px;
  padding: 0 16px;
  background: var(--ink);
  box-shadow: none;
  font-size: 11px;
}
.copy-button:hover:not(:disabled) { transform: translateY(-2px); }
.copy-button:disabled { opacity: .35; cursor: not-allowed; }

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 28px auto 0;
  padding: 0 2px 30px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

footer a {
  color: inherit;
  text-underline-offset: 3px;
}

footer a:hover {
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  z-index: 10;
  padding: 11px 17px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--accent-dark); }

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

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr 1fr; }
  .controls {
    grid-column: 1 / -1;
    grid-row: 1;
    border-inline: 0;
    border-bottom: 1px solid var(--line);
  }
  .input-panel { border-right: 1px solid var(--line); }
  .panel > textarea { min-height: 300px; }
  .control-row { grid-template-columns: 1fr 1fr; }
  .seo-content { gap: 42px; padding-inline: 20px; }
}

@media (max-width: 620px) {
  .site-header, main, footer { width: min(100% - 28px, 1180px); }
  .site-header { height: 68px; }
  .site-header p { display: none; }
  .hero { padding: 36px 0 40px; }
  h1 { font-size: 39px; }
  .lead { font-size: 13px; }
  .desktop-only { display: none; }
  .workspace { display: block; border-radius: 16px; }
  .panel, .controls { padding: 24px 20px; }
  .controls { border-bottom: 1px solid var(--line); }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel > textarea { min-height: 260px; }
  .control-row { gap: 14px; }
  .seo-content {
    display: block;
    margin-top: 50px;
    padding: 38px 6px 16px;
  }
  .faq { margin-top: 42px; }
  footer { display: block; text-align: center; }
}
