:root {
  --sav-ink: #08172f;
  --sav-muted: #5d6877;
  --sav-line: #d9e2ea;
  --sav-soft-line: #edf2f6;
  --sav-bg: #f6fafc;
  --sav-paper: #fff;
  --sav-green: #0b9f59;
  --sav-green-dark: #067042;
  --sav-green-soft: #eaf8f1;
  --sav-blue: #1f72d8;
  --sav-blue-soft: #edf5ff;
  --sav-yellow: #f5b32f;
  --sav-yellow-soft: #fff6df;
  --sav-red: #e5533d;
  --sav-red-soft: #fff0eb;
  --sav-shadow: 0 14px 34px rgba(8, 23, 47, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.sav-page {
  margin: 0;
  background: linear-gradient(180deg, #fbfdfc 0, var(--sav-bg) 360px, #f7fafc 100%);
  color: var(--sav-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.65;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sav-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--sav-line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px);
}

.sav-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 950;
}

.sav-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--sav-green-soft);
  flex: 0 0 auto;
}

.sav-mark::before {
  content: "";
  width: 18px;
  height: 13px;
  border-radius: 3px 8px 8px 3px;
  background: var(--sav-green);
  box-shadow: -8px 3px 0 -2px var(--sav-green);
}

.sav-mark::after {
  content: "";
  position: absolute;
  right: 7px;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: var(--sav-green);
  box-shadow: -5px -4px 0 -1px var(--sav-green), -5px 4px 0 -1px var(--sav-green);
}

.sav-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sav-header nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--sav-line);
  border-radius: 8px;
  background: #fff;
  color: #2d3a4c;
  font-weight: 900;
}

main {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: clamp(18px, 2.5vw, 34px) clamp(14px, 2.6vw, 30px) 0;
}

.sav-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 420px);
  align-items: end;
  gap: 28px;
  margin-bottom: 22px;
}

.sav-kicker {
  width: fit-content;
  margin: 0 0 8px;
  padding: 5px 12px;
  border: 1px solid #bfe8d2;
  border-radius: 999px;
  background: var(--sav-green-soft);
  color: var(--sav-green-dark);
  font-size: 15px;
  font-weight: 950;
}

.sav-hero h1 {
  margin: 0;
  color: var(--sav-ink);
  font-size: clamp(40px, 4vw, 62px);
  line-height: 1.08;
  font-weight: 950;
}

.sav-lead {
  max-width: 980px;
  margin: 10px 0 0;
  color: #243247;
  font-size: clamp(18px, 1.55vw, 23px);
  font-weight: 780;
}

.sav-hero-actions {
  display: grid;
  gap: 12px;
}

.sav-hero-primary,
.sav-hero-secondary {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 950;
}

.sav-hero-primary {
  background: var(--sav-green);
  color: #fff;
  box-shadow: 0 14px 30px rgba(11, 159, 89, .24);
}

.sav-hero-secondary {
  border: 1px solid var(--sav-line);
  background: #fff;
  color: var(--sav-blue);
}

.sav-workbench {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(470px, 1.25fr) minmax(360px, .85fr);
  gap: 12px;
}

.sav-panel,
.sav-template-panel,
.sav-tips,
.sav-faq {
  min-width: 0;
  border: 1px solid var(--sav-line);
  border-radius: 8px;
  background: var(--sav-paper);
  box-shadow: var(--sav-shadow);
}

.sav-panel {
  padding: clamp(16px, 2vw, 24px);
}

.sav-step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sav-step-title.with-action {
  justify-content: space-between;
}

.sav-step-title.with-action > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sav-step-title span,
.sav-tip-grid span {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sav-green);
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  flex: 0 0 auto;
}

.sav-step-title h2,
.sav-block-head h2,
.sav-faq h2 {
  margin: 0;
  color: var(--sav-ink);
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.22;
  font-weight: 950;
}

.sav-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.sav-type {
  min-height: 78px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--sav-line);
  border-radius: 8px;
  background: #fff;
  color: var(--sav-ink);
  text-align: left;
}

.sav-type:hover,
.voice-style:hover,
.sav-template-grid button:hover,
.sav-tip-grid article:hover {
  transform: translateY(-1px);
  border-color: #a8bdd0;
}

.sav-type.is-active {
  border-color: var(--sav-green);
  background: #fbfffd;
  box-shadow: inset 0 0 0 2px rgba(11, 159, 89, .18);
}

.type-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--sav-blue-soft);
}

.type-icon::before {
  content: "";
  display: block;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 3px solid var(--sav-blue);
}

.type-icon.sale {
  background: var(--sav-yellow-soft);
}

.type-icon.sale::before {
  border-color: var(--sav-yellow);
  transform: rotate(45deg);
}

.type-icon.call::before {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.type-icon.child {
  background: #f4f0ff;
}

.type-icon.child::before {
  border-color: #6d55d8;
  border-radius: 50% 50% 45% 45%;
}

.type-icon.notice {
  background: var(--sav-red-soft);
}

.type-icon.notice::before {
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 22px solid var(--sav-red);
  border-top: 0;
  border-radius: 0;
}

.type-icon.hours {
  background: var(--sav-green-soft);
}

.type-icon.hours::before {
  border-color: var(--sav-green);
  border-radius: 50%;
}

.sav-type b {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 950;
}

.sav-form {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--sav-soft-line);
}

.sav-form h3,
.sav-subhead {
  margin: 0;
  color: var(--sav-ink);
  font-size: 18px;
  font-weight: 950;
}

.sav-field {
  display: grid;
  gap: 6px;
  color: #26364c;
  font-size: 14px;
  font-weight: 950;
}

.sav-field input,
.sav-field textarea,
#vgScript {
  width: 100%;
  border: 1px solid #c5d0dc;
  border-radius: 8px;
  background: #fff;
  color: var(--sav-ink);
  font-weight: 760;
}

.sav-field input {
  min-height: 42px;
  padding: 0 12px;
}

.sav-field textarea {
  min-height: 78px;
  padding: 11px 12px;
  resize: vertical;
}

.sav-field input:focus,
.sav-field textarea:focus,
#vgScript:focus {
  border-color: var(--sav-green);
  outline: 3px solid rgba(11, 159, 89, .16);
}

.sav-clear,
.sav-mini,
.sav-copy,
.sav-editor-meta button,
.sav-phrase-row button {
  min-height: 38px;
  border: 1px solid var(--sav-line);
  border-radius: 8px;
  background: #fff;
  color: #2e3c50;
  font-size: 14px;
  font-weight: 900;
}

.sav-clear {
  width: 100%;
}

.sav-mini {
  padding: 0 14px;
  color: var(--sav-blue);
}

#vgScript {
  min-height: 350px;
  padding: 18px;
  font-size: 18px;
  line-height: 1.85;
  resize: vertical;
}

.sav-editor-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.sav-editor-meta small {
  margin-right: auto;
  color: var(--sav-muted);
  font-weight: 900;
}

.sav-editor-meta button,
.sav-phrase-row button {
  padding: 0 12px;
}

.sav-phrase-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.sav-phrase-row b {
  width: 100%;
  color: var(--sav-ink);
  font-weight: 950;
}

.sav-phrase-row button {
  border-radius: 999px;
}

.sav-copy {
  width: 100%;
  margin-top: 16px;
  border-color: var(--sav-blue);
  color: var(--sav-blue);
}

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

.voice-style {
  min-height: 86px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  padding: 12px;
  border: 1px solid var(--sav-line);
  border-radius: 8px;
  background: #fff;
  color: var(--sav-ink);
  text-align: left;
}

.voice-style span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sav-blue-soft);
  color: var(--sav-blue);
  font-size: 17px;
  font-weight: 950;
}

.voice-style b {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 950;
}

.voice-style small {
  color: var(--sav-muted);
  font-size: 12px;
  font-weight: 780;
}

.voice-style.is-active {
  border-color: var(--sav-green);
  background: #fbfffd;
  box-shadow: inset 0 0 0 2px rgba(11, 159, 89, .18);
}

.voice-style.is-active span {
  background: var(--sav-green);
  color: #fff;
}

.sav-speed {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.sav-speed b {
  font-size: 18px;
  font-weight: 950;
}

.speed-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #c5d0dc;
  border-radius: 8px;
  background: #fff;
}

.speed-row button {
  min-height: 46px;
  border: 0;
  border-right: 1px solid #c5d0dc;
  background: #fff;
  color: #27364a;
  font-size: 15px;
  font-weight: 920;
}

.speed-row button:last-child {
  border-right: 0;
}

.speed-row button.is-active {
  background: var(--sav-green);
  color: #fff;
}

.sav-hp {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sav-primary {
  width: 100%;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--sav-green);
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(11, 159, 89, .24);
}

.sav-player {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--sav-line);
  border-radius: 8px;
  background: #fff;
}

.sav-player-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.sav-player-head b {
  display: block;
  color: #4b596b;
  font-size: 14px;
  font-weight: 950;
}

.sav-player-head strong {
  display: block;
  color: var(--sav-ink);
  font-size: 19px;
  font-weight: 950;
}

.sav-player-head small {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sav-green-soft);
  color: var(--sav-green-dark);
  font-size: 12px;
  font-weight: 950;
}

.sav-empty {
  display: grid;
  place-items: center;
  min-height: 72px;
  margin: 0;
  padding: 12px;
  border: 1px dashed #c8d6e2;
  border-radius: 8px;
  background: #f8fbff;
  color: #536275;
  text-align: center;
  font-size: 14px;
  font-weight: 850;
}

.sav-empty[hidden],
.sav-player audio[hidden],
.sav-player a[hidden] {
  display: none !important;
}

.sav-player audio {
  width: 100%;
  min-width: 0;
}

.sav-player a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sav-blue);
  border-radius: 8px;
  color: var(--sav-blue);
  font-weight: 950;
}

.sav-check {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #f2d58d;
  border-radius: 8px;
  background: var(--sav-yellow-soft);
}

.sav-check b {
  display: block;
  color: #7a5200;
  font-size: 16px;
  font-weight: 950;
}

.sav-check p {
  margin: 6px 0 0;
  color: #5e4b22;
  font-size: 13px;
  font-weight: 780;
}

body[data-voice-state="processing"] .sav-primary {
  opacity: .72;
  cursor: wait;
}

body[data-voice-state="done"] .sav-player {
  border-color: rgba(11, 159, 89, .55);
  box-shadow: 0 12px 28px rgba(11, 159, 89, .12);
}

body[data-voice-state="error"] .sav-player {
  border-color: rgba(198, 48, 48, .45);
}

.sav-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 12px;
  margin-top: 12px;
}

.sav-template-panel,
.sav-tips,
.sav-faq {
  padding: clamp(16px, 2vw, 24px);
}

.sav-block-head {
  margin-bottom: 14px;
}

.sav-block-head p {
  margin: 0 0 3px;
  color: var(--sav-green-dark);
  font-size: 14px;
  font-weight: 950;
}

.sav-template-grid,
.sav-tip-grid {
  display: grid;
  gap: 12px;
}

.sav-template-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sav-template-grid button,
.sav-tip-grid article {
  min-width: 0;
  border: 1px solid var(--sav-line);
  border-radius: 8px;
  background: #fff;
  color: var(--sav-ink);
  text-align: left;
}

.sav-template-grid button {
  min-height: 104px;
  padding: 16px;
}

.sav-template-grid b,
.sav-tip-grid b {
  display: block;
  color: var(--sav-ink);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 950;
}

.sav-template-grid small,
.sav-tip-grid p {
  display: block;
  margin-top: 8px;
  color: var(--sav-muted);
  font-size: 13px;
  font-weight: 780;
}

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

.sav-tip-grid article {
  padding: 16px;
}

.sav-tip-grid span {
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  background: var(--sav-blue-soft);
  color: var(--sav-blue);
  font-size: 17px;
}

.sav-faq {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.sav-faq details {
  border: 1px solid var(--sav-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.sav-faq summary {
  cursor: pointer;
  padding: 16px;
  font-size: 17px;
  font-weight: 950;
}

.sav-faq p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--sav-muted);
  font-weight: 760;
}

.sav-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 34px 16px 48px;
  color: var(--sav-muted);
  font-size: 14px;
  font-weight: 850;
}

@media (max-width: 1220px) {
  .sav-hero,
  .sav-workbench,
  .sav-lower {
    grid-template-columns: minmax(0, 1fr);
  }

  .sav-hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sav-type-grid,
  .voice-style-grid,
  .sav-template-grid,
  .sav-tip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sav-header {
    min-height: 56px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .sav-brand {
    font-size: 18px;
  }

  .sav-header nav {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sav-header nav a {
    flex: 0 0 auto;
    min-width: 82px;
  }

  main {
    padding: 14px 10px 0;
  }

  .sav-hero {
    gap: 14px;
    margin-bottom: 14px;
  }

  .sav-hero h1 {
    font-size: 34px;
    line-height: 1.13;
  }

  .sav-lead {
    font-size: 16px;
  }

  .sav-hero-actions,
  .sav-type-grid,
  .voice-style-grid,
  .sav-template-grid,
  .sav-tip-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sav-hero-primary,
  .sav-hero-secondary {
    min-height: 52px;
    font-size: 16px;
  }

  .sav-panel,
  .sav-template-panel,
  .sav-tips,
  .sav-faq {
    padding: 12px;
  }

  .sav-step-title h2,
  .sav-block-head h2,
  .sav-faq h2 {
    font-size: 24px;
  }

  .sav-type {
    min-height: 68px;
  }

  #vgScript {
    min-height: 260px;
    padding: 14px;
    font-size: 16px;
    line-height: 1.78;
  }

  .sav-editor-meta {
    align-items: stretch;
  }

  .sav-editor-meta small,
  .sav-editor-meta button {
    width: 100%;
  }

  .sav-phrase-row button {
    flex: 1 1 calc(50% - 8px);
  }

  .voice-style {
    min-height: 76px;
  }

  .sav-primary {
    min-height: 62px;
    font-size: 20px;
  }

  .sav-player-head {
    flex-direction: column;
  }
}
