:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #1d252c;
  --muted: #68747e;
  --line: #dce1e5;
  --navy: #263b4a;
  --navy-2: #172a36;
  --mint: #56bfa5;
  --mint-soft: #e7f6f1;
  --amber: #d99b32;
  --amber-soft: #fff5df;
  --red: #d45f62;
  --red-soft: #fff0f0;
  --shadow: 0 16px 45px rgba(29, 45, 56, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Sans", Meiryo, system-ui, sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(220, 225, 229, 0.9);
  background: rgba(247, 248, 250, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy-2);
  font-size: 0.96rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
}

.privacy-badge,
.usage-count,
.overall-label {
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.privacy-badge {
  padding: 7px 10px;
  background: var(--mint-soft);
  color: #277861;
}

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

.checker-frame-section {
  margin-bottom: 44px;
}

.frame-privacy-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid #bfe1d6;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--mint-soft);
  color: #276e5b;
}

.frame-privacy-note strong {
  font-size: 0.82rem;
}

.frame-privacy-note span {
  font-size: 0.72rem;
}

.checker-frame {
  display: block;
  width: 100%;
  height: 1450px;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: var(--bg);
}

.embedded-checker .site-header,
.embedded-checker .intro,
.embedded-checker .knowledge-section,
.embedded-checker .site-footer {
  display: none;
}

.embedded-checker main {
  width: min(1080px, calc(100% - 24px));
  padding-top: 18px;
}

.embedded-checker .notice-band {
  margin-bottom: 20px;
}

.intro {
  max-width: 670px;
  padding: 64px 0 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #2e8b73;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

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

h1 {
  margin-bottom: 14px;
  color: var(--navy-2);
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.intro > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.checker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

.editor-panel,
.result-section,
.mini-guide,
.notice-band,
.policy-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-panel {
  padding: 28px;
}

.panel-heading,
.result-heading,
.rewrite-heading,
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  margin-bottom: 26px;
}

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

.panel-heading h2,
.result-heading h2,
.rewrite-heading h3 {
  margin-bottom: 0;
  letter-spacing: 0;
}

.step-label {
  color: var(--mint);
  font-size: 0.8rem;
  font-weight: 900;
}

.usage-count {
  padding: 7px 10px;
  background: #eef1f3;
  color: var(--muted);
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.field-label,
.field-label-row {
  color: var(--navy-2);
  font-size: 0.85rem;
  font-weight: 900;
}

.field-label-row > span:last-child {
  color: var(--muted);
  font-size: 0.72rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(290px, 100%);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f3f5;
}

.segment {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.segment.active {
  background: var(--surface);
  color: var(--navy-2);
  box-shadow: 0 2px 8px rgba(34, 51, 62, 0.09);
}

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

select {
  min-height: 48px;
  padding: 0 13px;
}

textarea {
  min-height: 190px;
  padding: 14px;
  resize: vertical;
  line-height: 1.75;
}

select:focus,
textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(86, 191, 165, 0.14);
}

textarea[aria-invalid="true"] {
  border-color: var(--red);
}

.character-count {
  justify-self: end;
  color: var(--muted);
  font-size: 0.75rem;
}

.ocr-area {
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 148px;
  padding: 20px;
  border: 1px dashed #aeb8bf;
  border-radius: 8px;
  background: #fafbfc;
  cursor: pointer;
  text-align: center;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 7px;
  border-radius: 50%;
  background: var(--mint-soft);
  color: #277861;
  font-size: 1.3rem;
}

.upload-zone small {
  margin-top: 5px;
  color: var(--muted);
}

.image-preview-wrap {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-preview-wrap img {
  display: block;
  max-width: 100%;
  max-height: 330px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.primary-button,
.secondary-button,
.icon-text-button {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  background: var(--navy);
  color: #fff;
}

.primary-button:hover {
  background: var(--navy-2);
}

.secondary-button {
  width: 100%;
  min-height: 46px;
  background: var(--mint-soft);
  color: #236c58;
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.local-note,
.status-text {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
  text-align: center;
}

.side-column {
  display: grid;
  gap: 18px;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #f0f2f4;
  color: #8a949b;
  text-align: center;
}

.ad-slot span {
  padding: 3px 6px;
  border: 1px solid #b8c0c5;
  font-size: 0.65rem;
}

.ad-slot p {
  margin: 8px 0 0;
  font-size: 0.78rem;
}

.mini-guide {
  padding: 20px;
}

.mini-guide strong {
  color: var(--navy-2);
}

.mini-guide ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.result-section {
  margin-top: 28px;
  padding: 28px;
  scroll-margin-top: 80px;
}

.result-heading {
  margin-bottom: 20px;
}

.overall-label {
  padding: 8px 12px;
}

.overall-label.low {
  background: var(--mint-soft);
  color: #277861;
}

.overall-label.medium {
  background: var(--amber-soft);
  color: #90620f;
}

.overall-label.high {
  background: var(--red-soft);
  color: #a13e42;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.score-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.score-card span {
  display: block;
  min-height: 36px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.score-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.65rem;
}

.score-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8ecef;
}

.score-bar i {
  display: block;
  height: 100%;
}

.score-card.safe i {
  background: var(--mint);
}

.score-card.caution i {
  background: var(--amber);
}

.score-card.danger i {
  background: var(--red);
}

.result-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.result-block {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.result-block h3 {
  margin-bottom: 15px;
  font-size: 1rem;
}

.findings-list {
  display: grid;
  gap: 10px;
}

.finding {
  padding-left: 12px;
  border-left: 3px solid var(--amber);
}

.finding strong {
  font-size: 0.87rem;
}

.finding p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.rewrite-block textarea {
  min-height: 170px;
}

.rewrite-block > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.icon-text-button {
  min-height: 34px;
  padding: 0 11px;
  background: var(--mint-soft);
  color: #236c58;
  font-size: 0.75rem;
}

.ad-slot-wide {
  min-height: 110px;
  margin-top: 28px;
}

.notice-band {
  margin: 28px 0 50px;
  padding: 22px;
  box-shadow: none;
}

.knowledge-section {
  margin: 0 0 54px;
}

.knowledge-heading {
  margin-bottom: 16px;
}

.knowledge-heading h2 {
  margin-bottom: 0;
  color: var(--navy-2);
  font-size: 1.35rem;
}

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

.article-card {
  display: block;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(29, 45, 56, 0.06);
  text-decoration: none;
}

.article-card:hover {
  border-color: #9fcfbe;
}

.article-card span {
  display: inline-block;
  margin-bottom: 18px;
  color: #2c8069;
  font-size: 0.72rem;
  font-weight: 900;
}

.article-card strong {
  display: block;
  color: var(--navy-2);
  line-height: 1.55;
}

.article-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.7;
}

.notice-band p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.75;
}

.text-link {
  display: inline-block;
  margin-top: 12px;
  color: #26755f;
  font-size: 0.8rem;
  font-weight: 900;
}

.site-footer {
  padding: 28px max(20px, calc((100vw - 1120px) / 2));
  border-top: 1px solid var(--line);
  background: #eef1f3;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.site-footer a {
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.site-footer small {
  font-size: 0.7rem;
}

dialog {
  width: min(390px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 25px 80px rgba(24, 39, 48, 0.28);
}

dialog::backdrop {
  background: rgba(18, 30, 38, 0.55);
}

.dialog-content {
  padding: 26px;
}

.dialog-content p {
  margin: 10px 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.policy-main {
  min-height: calc(100vh - 180px);
}

.policy-page {
  max-width: 820px;
  margin: 46px auto;
  padding: 34px;
}

.policy-page h1 {
  font-size: 2rem;
}

.policy-page h2 {
  margin: 30px 0 10px;
  color: var(--navy-2);
  font-size: 1.05rem;
}

.policy-page p,
.policy-page li {
  color: #53616b;
  font-size: 0.9rem;
  line-height: 1.9;
}

.policy-page .updated {
  color: var(--muted);
  font-size: 0.76rem;
}

.policy-page .example-box {
  margin: 14px 0;
  padding: 16px;
  border-left: 3px solid var(--mint);
  background: #f4faf8;
}

.policy-page .example-box p:last-child {
  margin-bottom: 0;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 10px;
  padding: 0 16px;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 58px;
    padding: 9px 16px;
  }

  .brand {
    font-size: 0.88rem;
  }

  .privacy-badge {
    font-size: 0.65rem;
  }

  main {
    width: min(100% - 24px, 620px);
  }

  .intro {
    padding: 38px 2px 24px;
  }

  .frame-privacy-note {
    display: grid;
    gap: 4px;
  }

  h1 {
    font-size: 2.15rem;
  }

  .checker-layout,
  .result-columns,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    order: 2;
  }

  .editor-panel,
  .result-section {
    padding: 20px;
  }

  .score-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .score-card:last-child {
    grid-column: span 2;
  }

  .ad-slot {
    min-height: 100px;
  }

  .policy-page {
    margin: 24px auto;
    padding: 24px 20px;
  }
}

@media (min-width: 900px) {
  .ocr-area {
    display: none;
  }
}
