:root {
  --ink: #172126;
  --muted-ink: #526267;
  --paper: #fbfcfb;
  --soft: #eef3f1;
  --line: #d7e1dc;
  --teal: #16666b;
  --teal-dark: #0e474b;
  --coral: #c65f45;
  --gold: #b18728;
  --green: #4d7c45;
  --danger: #a44235;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(23, 33, 38, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 82px;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(238, 243, 241, 0.9), rgba(251, 252, 251, 0.96) 420px),
    var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  line-height: 1.7;
  max-width: 100%;
  overflow-x: hidden;
}

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

button,
input {
  font: inherit;
}

.tool-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  color: var(--white);
  background: rgba(14, 28, 30, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 700;
  white-space: nowrap;
}

.tool-nav {
  display: flex;
  gap: clamp(12px, 2vw, 26px);
  font-size: 0.92rem;
  overflow-x: auto;
}

.tool-nav a {
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

.tool-nav a:hover,
.tool-nav a:focus-visible {
  color: var(--white);
}

main {
  width: calc(100% - clamp(36px, 8vw, 112px));
  max-width: 1180px;
  margin: 0 auto;
}

.hero {
  padding: clamp(52px, 9vw, 92px) 0 clamp(36px, 6vw, 64px);
}

.hero-inner {
  width: 100%;
  max-width: 900px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 20px;
  color: var(--teal-dark);
  font-size: clamp(2.2rem, 5.2vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.title-line {
  display: block;
}

section,
aside {
  scroll-margin-top: 88px;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.24;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.34;
  letter-spacing: 0;
}

.lead {
  max-width: 780px;
  margin-bottom: 24px;
  color: var(--muted-ink);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
}

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

.hero-status span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
}

.notice,
.next-note {
  display: grid;
  grid-template-columns: minmax(220px, 0.44fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: start;
  margin-bottom: 28px;
  padding: 24px clamp(20px, 4vw, 34px);
  border: 1px solid rgba(198, 95, 69, 0.26);
  border-radius: 8px;
  background: #fff8f5;
}

.notice p:last-child,
.next-note p:last-child {
  margin-bottom: 0;
  color: var(--muted-ink);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.panel {
  margin-bottom: 24px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.guide-panel {
  margin-bottom: 28px;
}

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

.guide-card {
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.guide-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted-ink);
}

.guide-card li {
  margin-bottom: 8px;
}

.guide-card li:last-child {
  margin-bottom: 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-heading p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted-ink);
}

.section-heading.compact {
  max-width: 560px;
}

.field-hint,
.action-note {
  display: block;
  color: var(--muted-ink);
  font-size: 0.86rem;
  line-height: 1.6;
}

.field-hint {
  margin-top: 7px;
}

.action-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: #fff9e8;
}

.action-note.inline {
  flex: 0 1 260px;
  margin: 0;
  padding: 10px 12px;
  line-height: 1.45;
}

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

.form-grid.one-column {
  grid-template-columns: 1fr;
}

.input-group {
  margin-top: 24px;
}

.group-heading {
  margin-bottom: 14px;
}

.group-heading p {
  margin-bottom: 0;
  color: var(--muted-ink);
}

label {
  min-width: 0;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(22, 102, 107, 0.22);
  outline-offset: 2px;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  color: var(--white);
  background: var(--coral);
}

.button.primary:hover {
  background: #b85039;
}

.button.ghost {
  color: var(--teal-dark);
  border-color: var(--line);
  background: var(--white);
}

.button.ghost:hover {
  border-color: var(--teal);
}

.helper-text {
  min-height: 28px;
  margin: 18px 0 0;
  padding: 0;
  color: var(--teal-dark);
  font-weight: 700;
}

.helper-text.error {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--danger);
  background: #f9e8e2;
}

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

.summary-grid article {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.summary-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.summary-grid strong {
  display: block;
  color: var(--teal-dark);
  font-size: clamp(1.25rem, 4vw, 1.9rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.summary-grid strong.negative,
.hero-status span.negative {
  color: var(--danger);
}

.meter-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.meter-row {
  display: grid;
  gap: 8px;
}

.meter-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-ink);
  font-weight: 700;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

.meter span.caution {
  background: var(--gold);
}

.meter span.danger {
  background: var(--danger);
}

.warning-list,
.review-list {
  display: grid;
  gap: 12px;
}

.warning-item,
.review-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.warning-item {
  border-left: 4px solid var(--teal);
}

.warning-item.caution {
  border-left-color: var(--gold);
  background: #fff9e8;
}

.warning-item.danger {
  border-left-color: var(--danger);
  background: #f9e8e2;
}

.warning-item h3,
.review-item h3 {
  margin-bottom: 6px;
}

.warning-item p,
.review-item p {
  margin-bottom: 0;
  color: var(--muted-ink);
}

.review-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.review-item strong {
  color: var(--teal-dark);
  white-space: nowrap;
}

.next-note {
  margin-top: 24px;
  margin-bottom: 0;
  background: var(--soft);
  border-color: var(--line);
}

.tool-footer {
  margin-top: 36px;
  padding: 28px clamp(18px, 5vw, 72px);
  color: rgba(255, 255, 255, 0.78);
  background: var(--ink);
}

.tool-footer p {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .workspace,
  .notice,
  .review-columns,
  .guide-grid,
  .next-note {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tool-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  main {
    width: calc(100% - 36px);
  }

  .form-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .action-note.inline {
    flex-basis: 100%;
  }
}

@media (max-width: 480px) {
  main *,
  .tool-header *,
  .tool-footer * {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
    line-break: anywhere;
  }

  h1 {
    font-size: 2rem;
  }

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

  .panel,
  .notice,
  .next-note {
    padding: 20px 16px;
  }

  .review-item {
    grid-template-columns: 1fr;
  }
}
