:root {
  --ink: #172b3a;
  --muted: #5c6b75;
  --brand: #173f5f;
  --brand-2: #24638f;
  --accent: #16856d;
  --accent-dark: #0f6b58;
  --surface: #ffffff;
  --surface-soft: #f4f8fa;
  --surface-warm: #fff9eb;
  --line: #dbe4e9;
  --focus: #f3ae2b;
  --shadow: 0 16px 40px rgba(19, 52, 74, 0.08);
  --radius: 14px;
  --content-width: 720px;
}

html {
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f5f7f8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  text-rendering: optimizeLegibility;
}

a {
  color: #155f91;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #0e466c;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 5px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-160%);
  padding: 9px 15px;
  color: #fff;
  background: var(--brand);
  border-radius: 8px;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */
header.sitehead {
  position: sticky;
  top: 0;
  z-index: 100;
  display: block;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.sitehead-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

header.sitehead a.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 188px;
  margin: 0;
  color: var(--brand);
  font-size: inherit;
  text-decoration: none;
}

header.sitehead a.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(23, 95, 158, 0.18);
}

header.sitehead a.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

header.sitehead a.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}

nav.sitemenu {
  display: flex;
  align-items: stretch;
  font-size: 13px;
}

nav.sitemenu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 10px;
  color: #344a59;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

nav.sitemenu a:hover {
  color: var(--brand);
  background: var(--surface-soft);
  text-decoration: none;
}

nav.sitemenu a[aria-current="page"] {
  color: var(--brand);
  background: #eaf3f8;
}

.mobile-menu {
  display: none;
  position: relative;
}

.mobile-menu summary {
  display: grid;
  place-items: center;
  width: 52px;
  min-height: 48px;
  padding-top: 5px;
  cursor: pointer;
  list-style: none;
  color: var(--brand);
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu summary > span:first-child,
.mobile-menu summary > span:first-child::before,
.mobile-menu summary > span:first-child::after {
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.mobile-menu summary > span:first-child {
  position: relative;
}

.mobile-menu summary > span:first-child::before,
.mobile-menu summary > span:first-child::after {
  content: "";
  position: absolute;
  left: 0;
}

.mobile-menu summary > span:first-child::before { top: -7px; }
.mobile-menu summary > span:first-child::after { top: 7px; }

.mobile-menu .menu-label {
  font-size: 9px;
  font-weight: 700;
}

.mobile-menu nav {
  position: absolute;
  top: 54px;
  right: 0;
  width: min(310px, calc(100vw - 32px));
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.mobile-menu nav a {
  display: block;
  min-height: 46px;
  padding: 8px 12px;
  color: var(--ink);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.mobile-menu nav a:hover,
.mobile-menu nav a[aria-current="page"] {
  color: var(--brand);
  background: #edf5f8;
}

/* Breadcrumb and page frame */
.breadcrumb {
  width: min(1180px, calc(100% - 40px));
  margin: 17px auto 0;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  margin: 0;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: #9aa7af;
}

.breadcrumb a {
  color: inherit;
}

.breadcrumb [aria-current="page"] {
  max-width: 56ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagelayout {
  width: min(var(--content-width), calc(100% - 40px));
  margin: 25px auto 72px;
  display: grid;
  grid-template-columns: minmax(0, var(--content-width));
  justify-content: center;
  gap: 64px;
}

.pagelayout.has-toc {
  width: min(1180px, calc(100% - 40px));
  grid-template-columns: 248px minmax(0, var(--content-width));
}

.pagelayout main,
.pagelayout.has-toc main {
  min-width: 0;
  padding: 0;
}

/* Table of contents */
nav.toc {
  width: auto;
  max-height: calc(100vh - 118px);
  overflow: auto;
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 4px 4px 20px;
  font-size: 13px;
}

nav.toc .toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

nav.toc ul {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

nav.toc li {
  margin: 0;
}

nav.toc li.toc-h3 {
  padding-left: 12px;
}

nav.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 10px 6px 14px;
  color: #536672;
  border-left: 3px solid transparent;
  line-height: 1.55;
  text-decoration: none;
}

nav.toc a:hover,
nav.toc a.active {
  color: var(--brand);
  background: #eef6f5;
  border-left-color: var(--accent);
}

.toc-mobile {
  display: none;
}

/* Article typography */
.prose {
  overflow-wrap: break-word;
}

.prose h1 {
  margin: 4px 0 22px;
  color: #102f46;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.prose h1 > span[style] {
  color: var(--accent-dark) !important;
}

.prose .pubdate {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.prose h2 {
  margin: 72px 0 24px;
  padding: 0 0 11px;
  color: #123b59;
  border-bottom: 2px solid #dfe9ee;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  line-height: 1.48;
}

.prose h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 0.95em;
  margin-right: 12px;
  background: var(--accent);
  border-radius: 4px;
  vertical-align: -0.08em;
}

.prose h3 {
  margin: 42px 0 16px;
  color: #24485f;
  font-size: 1.22rem;
  line-height: 1.55;
}

.prose h4 {
  margin: 34px 0 13px;
  color: #31566e;
  font-size: 1.08rem;
}

.prose p {
  margin: 0 0 1.55em;
}

.prose ul,
.prose ol {
  padding-left: 1.45em;
}

.prose li {
  margin: 0.34em 0;
}

.prose strong {
  color: #163e58;
}

.prose img {
  height: auto;
  border-radius: 10px;
}

.prose p.figure,
.prose .catchimg {
  max-width: 420px;
  margin: 26px auto;
  color: var(--muted);
  font-size: 12px;
}

.prose .lead-block {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 28px;
  align-items: center;
  margin: 26px 0 28px;
  padding: 26px;
  background: linear-gradient(135deg, #eef7f6, #f5f9fc);
  border: 1px solid #d8e8e7;
  border-radius: var(--radius);
}

.prose .lead-block .lead-text {
  min-width: 0;
}

.prose .lead-block .lead-image {
  width: 230px;
}

.prose .lead-block .lead-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(23, 63, 95, 0.12);
}

.prose .lead-block p.lead_top {
  margin-bottom: 0.4em;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.prose .intermission_box,
.prose .complement,
.prose .summary_box,
.notebox,
.alert-box,
.stepbox,
.delitan {
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: 12px;
}

.prose .intermission_box,
.stepbox {
  color: #40535f;
  background: var(--surface-soft);
  border: 1px solid #e1e9ed;
}

.prose .intermission_box:has(> strong:first-child > a:first-child) {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 5px 18px rgba(23, 63, 95, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.prose .intermission_box:has(> strong:first-child > a:first-child):hover {
  transform: translateY(-2px);
  border-color: #8fb6ca;
  box-shadow: 0 9px 22px rgba(23, 63, 95, 0.08);
}

.prose .complement,
.notebox {
  color: #485b66;
  background: var(--surface-warm);
  border: 1px solid #efdfb7;
}

.prose .summary_box,
.alert-box,
.delitan {
  background: #eef8f5;
  border: 1px solid #cfe8df;
}

.prose .summary_box > :last-child,
.prose .intermission_box > :last-child,
.prose .complement > :last-child,
.alert-box > :last-child,
.notebox > :last-child,
.delitan > :last-child {
  margin-bottom: 0;
}

.prose .marker_yellow,
.marker,
.wordcard .core b {
  background: linear-gradient(transparent 58%, #f8e67d 58%);
}

.prose .marker_lime {
  background: linear-gradient(transparent 58%, #bfe9ce 58%);
}

/* Cards, lists and word content */
.article-card {
  margin: 18px 0;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 7px 22px rgba(23, 63, 95, 0.05);
}

.article-card h3 {
  margin: 0 0 9px;
  font-size: 1.18rem;
}

.article-card h3 a {
  color: #155f91;
  text-decoration: underline;
  text-decoration-color: transparent;
}

.article-card h3 a:hover {
  text-decoration-color: currentColor;
}

.article-card .card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 22px;
  align-items: start;
}

.article-card .card-image {
  width: 190px;
}

.article-card .card-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

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

ul.wordlist li {
  margin: 0;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

ul.wordlist li .gloss {
  display: block;
  margin: 3px 0 0;
}

.wordcard {
  padding: 22px;
  background: linear-gradient(135deg, #eaf8f4, #f5fafc);
  border: 1px solid #cce7de;
  border-radius: var(--radius);
}

ul.examples li {
  background: #f7fafb;
  border-left-color: var(--brand-2);
  border-radius: 0 9px 9px 0;
}

.prose ul.faq-list {
  margin: 18px 0 34px;
  padding: 8px 18px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.prose ul.faq-list li {
  margin: 0;
  padding: 12px 2px;
  border-bottom: 1px solid #e8eef1;
}

.prose ul.faq-list li:last-child {
  border-bottom: 0;
}

.prose ul.faq-list a {
  display: block;
  font-weight: 650;
}

/* Tables */
.prose table.plain,
table.compare {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 24px 0 30px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 1.7;
}

.prose table.plain tbody,
table.compare tbody {
  display: table;
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.prose table.plain th,
.prose table.plain td,
table.compare th,
table.compare td {
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prose table.plain th:last-child,
.prose table.plain td:last-child,
table.compare th:last-child,
table.compare td:last-child {
  border-right: 0;
}

.prose table.plain tr:last-child td,
table.compare tr:last-child td {
  border-bottom: 0;
}

.prose table.plain th,
table.compare th {
  color: var(--brand);
  background: #edf4f7;
}

/* Buttons and forms */
a.btn,
button.btn {
  min-height: 44px;
  padding: 9px 18px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 5px 14px rgba(22, 133, 109, 0.18);
}

a.btn:hover,
button.btn:hover {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

form.contact-form {
  margin: 26px 0;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

form.contact-form label {
  color: #29495e;
  font-size: 14px;
}

form.contact-form input[type="text"],
form.contact-form input[type="email"],
form.contact-form textarea,
form.contact-form select {
  width: 100%;
  max-width: none;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #aebdc6;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
}

form.contact-form textarea {
  min-height: 160px;
  resize: vertical;
}

form.contact-form .form-note {
  color: var(--muted);
  font-size: 12px;
}

/* Home and service pages */
.home-page > h1,
.home-hero h1 {
  margin-top: 26px;
  font-size: clamp(2.5rem, 7vw, 4.3rem);
  text-align: center;
}

.home-page > h1 + p,
.home-hero p {
  max-width: 540px;
  margin: 0 auto 48px;
  color: #425966;
  font-size: 1.08rem;
  text-align: center;
}

.home-hero {
  position: relative;
  margin: 20px 0 52px;
  padding: 40px 24px 1px;
  background: radial-gradient(circle at 50% -10%, #e4f4f0 0, #f4f8fa 58%, #fff 100%);
  border: 1px solid #dde9e9;
  border-radius: 20px;
}

.article-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 30px;
}

.prose p.article-link-card {
  margin: 14px 0;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 5px 16px rgba(23, 63, 95, 0.05);
}

.article-link-grid p.article-link-card {
  margin: 0;
}

.article-link-card a {
  display: block;
  color: #155f91;
  font-weight: 750;
}

.compact-card p:last-child {
  margin-bottom: 0;
}

.home-page > h2:first-of-type {
  margin-top: 48px;
}

.service-page > h1 {
  padding: 26px;
  background: linear-gradient(135deg, #eef7f6, #f4f8fb);
  border: 1px solid #d7e7e7;
  border-radius: var(--radius);
}

.prose .usersvoices p,
.prose .letter {
  padding: 18px 20px;
  background: #fffaf0;
  border: 1px solid #eadfca;
  border-radius: 11px;
  font-size: 0.94em;
}

.prose .contact-line {
  color: var(--accent-dark);
}

/* Footer */
.sitefooter-promo {
  margin-top: 0;
  padding: 44px 20px;
  background: #edf2f4;
}

.sitefooter-promo-inner {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
}

.author-note {
  margin: 0 0 20px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 7px 20px rgba(23, 63, 95, 0.05);
}

.follow-cta a {
  min-height: 44px;
  padding: 9px 20px;
  background: var(--brand);
  border-radius: 9px;
}

.follow-cta span,
.course-note,
ul.trust-info {
  color: var(--muted);
  font-size: 13px;
}

footer {
  margin: 0;
  padding: 42px 20px;
  color: #dce8ee;
  background: #16384f;
  font-size: 12px;
  text-align: left;
}

.footer-inner {
  width: min(1060px, 100%);
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: #fff;
  font-size: 17px;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-menu {
  justify-content: flex-start;
  gap: 9px 20px;
  margin-bottom: 18px;
}

.footer-menu a,
footer a {
  color: #e7f2f7;
}

a.backtotop {
  position: fixed;
  right: max(18px, calc((100vw - 1240px) / 2));
  bottom: 18px;
  z-index: 70;
  float: none;
  width: 48px;
  height: 48px;
  margin: 0;
  color: #fff;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-weight: 800;
}

@media (max-width: 1020px) {
  nav.sitemenu a { padding-right: 7px; padding-left: 7px; }
  .pagelayout.has-toc { grid-template-columns: 220px minmax(0, var(--content-width)); gap: 38px; }
}

@media (max-width: 900px) {
  nav.sitemenu { display: none; }
  .mobile-menu { display: block; }
  .pagelayout.has-toc {
    width: min(var(--content-width), calc(100% - 40px));
    grid-template-columns: minmax(0, var(--content-width));
    gap: 20px;
  }
  nav.toc.toc-desktop { display: none; }
  .toc-mobile {
    display: block;
    margin: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .toc-mobile summary {
    min-height: 48px;
    padding: 9px 16px;
    cursor: pointer;
    color: var(--brand);
    font-size: 14px;
    font-weight: 800;
  }
  .toc-mobile ul {
    margin: 0;
    padding: 0 16px 16px 34px;
  }
  .toc-mobile li { margin: 5px 0; }
  .toc-mobile li.toc-h3 { margin-left: 15px; }
  .toc-mobile a { font-size: 14px; }
}

@media (max-width: 680px) {
  body {
    background: #fff;
    font-size: 16px;
  }
  .sitehead-inner,
  .breadcrumb,
  .pagelayout,
  .pagelayout.has-toc {
    width: min(100% - 32px, var(--content-width));
  }
  .sitehead-inner { min-height: 64px; }
  header.sitehead a.brand img { width: 38px; height: 38px; }
  .breadcrumb { margin-top: 12px; }
  .breadcrumb [aria-current="page"] { max-width: 28ch; }
  .pagelayout,
  .pagelayout.has-toc { margin-top: 18px; margin-bottom: 54px; }
  .prose h1 { font-size: clamp(1.8rem, 8.2vw, 2.35rem); }
  .prose h2 { margin-top: 58px; font-size: 1.45rem; }
  .prose h3 { margin-top: 36px; font-size: 1.16rem; }
  .prose .lead-block {
    grid-template-columns: 1fr;
    padding: 19px;
  }
  .prose .lead-block .lead-image {
    order: -1;
    width: 100%;
  }
  .prose .lead-block .lead-image img { max-height: 220px; }
  .prose .intermission_box,
  .prose .complement,
  .prose .summary_box,
  .notebox,
  .alert-box,
  .stepbox,
  .delitan { padding: 16px; }
  .article-card { padding: 17px; }
  .article-card .card-body { grid-template-columns: 1fr; }
  .article-card .card-image {
    order: -1;
    width: 100%;
  }
  .article-card .card-image img { max-height: 220px; }
  ul.wordlist { grid-template-columns: 1fr; }
  form.contact-form { padding: 18px; }
  .home-page > h1,
  .home-hero h1 { margin-top: 20px; font-size: 2.65rem; }
  .home-page > h1 + p,
  .home-hero p { margin-bottom: 36px; }
  .home-hero { margin-top: 10px; padding: 22px 16px 1px; border-radius: 15px; }
  .article-link-grid { grid-template-columns: 1fr; }
  .service-page > h1 { padding: 20px; }
  .sitefooter-promo { padding: 36px 16px; }
  footer { padding: 36px 16px 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
