:root {
  color-scheme: light;
  --page: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --ink: #17243a;
  --muted: #667184;
  --navy: #1f3048;
  --navy-soft: #e9edf2;
  --orange: #aa4b20;
  --orange-soft: #fff3ed;
  --line: #d9dee6;
  --line-strong: #bfc7d2;
  --shadow: 0 12px 32px rgba(23, 36, 58, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  background: var(--page);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 4px;
  background: var(--orange);
}

button,
input {
  font: inherit;
}

a {
  color: #a3421d;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

a:hover {
  color: #702c12;
}

[hidden],
.is-hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  width: min(980px, calc(100% - 40px));
  min-height: 70px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}

.brand-copy {
  display: grid;
  line-height: 1.3;
}

.brand-copy strong {
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.75rem;
}

.header-label {
  padding: 6px 11px;
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.site-shell {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.document-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 34px;
  padding: 34px 36px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-top: 5px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow,
.search-label,
.toc-heading p {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.hero-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 22px;
}

.hero-logo {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  object-fit: contain;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.document-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.hero-description {
  max-width: 570px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.meta-card {
  margin: 0;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.meta-card > div {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}

.meta-card > div:last-child {
  border-bottom: 0;
}

.meta-card dt,
.contact-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.meta-card dd,
.contact-list dd {
  min-width: 0;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.search-panel h2,
.toc-heading h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.document-card {
  padding: 0;
}

.policy-intro {
  margin: 0 0 22px;
  padding: 20px 22px;
  color: #364256;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 10px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 16px 30px;
  padding: 24px 26px;
  align-items: center;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-panel .search-label {
  color: #ffab84;
}

.search-panel p {
  margin: 5px 0 0;
  color: #d7deea;
  font-size: 0.88rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-input {
  width: 100%;
  min-height: 46px;
  padding: 9px 13px;
  color: var(--ink);
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  outline: none;
}

.search-input:focus {
  border-color: #ff9a6c;
  box-shadow: 0 0 0 3px rgba(233, 97, 43, 0.25);
}

.search-clear {
  min-height: 46px;
  padding: 9px 15px;
  color: #fff;
  font-weight: 800;
  background: transparent;
  border: 1px solid #8491a4;
  border-radius: 8px;
  cursor: pointer;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.1);
}

.search-status {
  grid-column: 1 / -1;
  margin: 0 !important;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.no-results {
  margin: 18px 0;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.toc {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  margin: 24px 0 28px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toc-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 22px;
  margin: 0;
  padding-left: 24px;
}

.toc-list li {
  padding-left: 3px;
  color: var(--muted);
}

.toc-list a {
  display: inline-block;
  padding: 3px 2px;
  color: #3d4b60;
  font-size: 0.84rem;
  line-height: 1.55;
  text-decoration: none;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--orange);
  text-decoration: underline;
}

.document-sections,
.policy-sections {
  display: grid;
  gap: 14px;
}

.clause,
.policy-section {
  scroll-margin-top: 92px;
  padding: 25px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(23, 36, 58, 0.035);
}

.clause::before,
.policy-section::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin-bottom: 13px;
  background: var(--orange);
  border-radius: 99px;
}

.clause h2,
.policy-section h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 1.2rem;
  line-height: 1.45;
}

.clause h3,
.policy-section h3 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 0.92rem;
  line-height: 1.5;
}

.clause p,
.policy-section p {
  margin: 10px 0;
}

.clause ul,
.clause ol,
.policy-section ul,
.policy-section ol {
  margin: 8px 0;
  padding-left: 1.55rem;
}

.clause li,
.policy-section li {
  margin: 7px 0;
}

.clause li::marker,
.policy-section li::marker {
  color: var(--orange);
  font-weight: 800;
}

.clause li > ul,
.clause li > ol,
.policy-section li > ul,
.policy-section li > ol {
  margin-top: 7px;
}

.legal-note {
  margin-top: 16px !important;
  padding: 12px 14px;
  color: #4c586a;
  font-size: 0.86rem;
  background: var(--orange-soft);
  border: 1px solid #f2cbb9;
  border-radius: 8px;
}

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

.definition-grid > div {
  padding: 15px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.definition-grid p {
  margin: 0;
  color: #48566b;
  font-size: 0.88rem;
  line-height: 1.7;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 0 !important;
  list-style: none;
}

.service-list li {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.service-list span {
  color: var(--muted);
  font-size: 0.84rem;
}

.contact-box {
  margin-top: 14px;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.contact-box > p:first-child {
  margin-top: 0;
}

.contact-list {
  margin: 14px 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-list > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}

.contact-list > div:last-child {
  border-bottom: 0;
}

.contact-note {
  margin-bottom: 0 !important;
  color: var(--muted);
  font-size: 0.84rem;
}

.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.external-links a {
  padding: 5px 9px;
  color: var(--navy);
  font-size: 0.77rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.external-links a:hover {
  border-color: var(--orange);
}

.revision-box {
  margin-top: 15px;
  padding: 13px 16px;
  color: var(--muted);
  font-size: 0.82rem;
  background: var(--surface-soft);
  border-left: 3px solid var(--navy);
}

.revision-box p {
  margin: 2px 0;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 28px;
  margin-top: 18px;
  padding: 24px 4px 0;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--line-strong);
}

.site-footer p {
  margin: 0;
}

.footer-brand {
  color: var(--navy);
  font-weight: 900;
}

.footer-meta {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 16px;
  justify-self: end;
  padding-top: 3px;
  color: #697386;
  font-size: 0.74rem;
  text-align: right;
}

.footer-meta strong {
  color: #475367;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: 46px;
  height: 46px;
  padding: 0;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  background: var(--navy);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(23, 36, 58, 0.22);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.2s ease;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .document-hero,
  .search-panel,
  .toc,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .toc-list {
    grid-template-columns: 1fr;
  }

  .search-status {
    grid-column: 1;
  }

  .footer-meta {
    grid-column: 1;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .header-inner,
  .site-shell {
    width: min(100% - 24px, 980px);
  }

  .header-label {
    display: none;
  }

  .site-shell {
    padding-top: 20px;
  }

  .document-hero {
    gap: 22px;
    padding: 24px 20px;
  }

  .hero-title-row {
    align-items: flex-start;
    gap: 14px;
  }

  .hero-logo {
    width: 68px;
    height: 68px;
    border-radius: 14px;
  }

  .search-panel,
  .toc,
  .clause,
  .policy-section {
    padding: 20px 18px;
  }

  .definition-grid,
  .service-list {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-clear {
    min-height: 42px;
  }

  .contact-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

@media print {
  body {
    background: #fff;
  }

  body::before,
  .site-header,
  .search-panel,
  .back-to-top {
    display: none !important;
  }

  .site-shell {
    width: 100%;
    padding: 0;
  }

  .document-hero,
  .toc,
  .clause,
  .policy-section {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* Shared, restrained layout for the three independent Workers. */
:focus-visible { outline: 3px solid #aa4b20; outline-offset: 4px; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 1000; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.review-banner { padding: 9px 20px; text-align: center; font-size: .8rem; color: #48566b; background: #e9edf2; }
.document-hero { display: block; padding: 34px 0 28px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.hero-logo { width: 64px; height: 64px; }
.document-meta { margin: 20px 0 0; color: var(--muted); font-size: .84rem; }
.document-meta span { padding: 0 7px; }
.legal-note { color: #48566b; background: #f4f5f7; border-color: var(--line); }
.footer-links { display: flex; gap: 12px 20px; flex-wrap: wrap; }
.feedback-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 30px; align-items: start; }
.form-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 30px; min-width: 0; }
.form-card h2 { margin: 0 0 8px; font-size: 1.45rem; }
.form-aside section { margin: 0 0 28px; padding: 4px 0 24px; border-bottom: 1px solid var(--line); }
.form-aside h2 { font-size: 1rem; }
.form-aside p { font-size: .85rem; color: #536174; }
.field { display: grid; gap: 8px; margin: 24px 0; }
.field > label, legend { font-weight: 700; }
.field small, .small { font-size: .8rem; color: #536174; }
.muted { color: #536174; font-size: .88rem; }
.required { margin-left: 5px; font-size: .7rem; font-weight: 700; color: #aa4b20; }
input, textarea, select, button { font: inherit; }
input:not([type=radio]):not([type=checkbox]), select, textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #a7b1bf; background: #fff; border-radius: 7px; color: var(--ink); }
textarea { resize: vertical; line-height: 1.8; }
input[type=file] { font-size: .82rem; overflow: hidden; }
button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); cursor: pointer; }
button:hover:not(:disabled) { background: #eef1f5; }
button:disabled { cursor: not-allowed; opacity: .55; }
button.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
button.primary:hover:not(:disabled) { background: #2f4765; }
fieldset { min-width: 0; margin: 24px 0; padding: 0; border: 0; }
fieldset fieldset { margin: 20px 0; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; line-height: 1.7; font-size: .91rem; }
.choice input { margin-top: 6px; width: 18px; height: 18px; accent-color: var(--navy); flex-shrink: 0; }
.consent { padding: 18px 0; border-top: 1px solid var(--line); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.form-actions select { width: auto; }
.notice { padding: 14px 18px; background: #e9edf2; border-left: 3px solid var(--navy); border-radius: 0 7px 7px 0; font-size: .9rem; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.safety-note { margin: 32px 0; padding: 28px 0; border-top: 1px solid var(--line); }
.safety-note h2 { font-size: 1.35rem; }.safety-note p { max-width: 74ch; }
.admin-filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }.admin-filters .field { margin: 0; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 20px 0; }
.submission { display: grid; grid-template-columns: 1fr auto; padding: 18px; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; margin: 12px 0; }
.submission button { grid-column: 1 / -1; justify-self: start; }.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 24px 0; }
.detail-fields dt { margin-top: 20px; font-weight: 700; }.detail-fields dd { margin-left: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-link { display: block; margin: 12px 0; }.admin-shell #detail { scroll-margin-top: 100px; }
@media (max-width: 820px) { .feedback-layout { grid-template-columns: 1fr; }.form-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }.admin-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .form-card { padding: 22px 18px; }.form-aside { display: block; }.document-hero h1 { font-size: 1.85rem; }.hero-logo { display: none; }.brand-copy strong { font-size: .92rem; }.admin-filters { grid-template-columns: 1fr; }.footer-meta { justify-self: start; text-align: left; justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .review-banner,.footer-links,.skip-link,.form-aside { display: none; }.document-hero { padding: 0; }.document-meta { color: #333; } }
