@charset "UTF-8";
/* =========================================================
   AI Media Lab — main stylesheet
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --aml-accent: #2563eb;
  --aml-accent-dark: #1d4ed8;
  --aml-accent-soft: #eff6ff;
  --aml-accent-2: #0ea5e9;
  --aml-ink: #0f172a;
  --aml-body: #334155;
  --aml-muted: #64748b;
  --aml-line: #e2e8f0;
  --aml-line-soft: #f1f5f9;
  --aml-bg: #f7f9fc;
  --aml-surface: #ffffff;
  --aml-warn-bg: #fff7ed;
  --aml-warn-line: #fdba74;
  --aml-warn-ink: #9a3412;
  --aml-tip-bg: #ecfdf5;
  --aml-tip-line: #6ee7b7;
  --aml-tip-ink: #065f46;
  --aml-code-bg: #0f172a;
  --aml-radius: 14px;
  --aml-radius-sm: 8px;
  --aml-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --aml-shadow-hover: 0 2px 4px rgba(15, 23, 42, .06), 0 16px 40px rgba(15, 23, 42, .10);
  --aml-max: 1180px;
  --aml-font: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Noto Sans JP", "Yu Gothic", "Meiryo", "Segoe UI", Roboto, sans-serif;
  --aml-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--aml-font);
  font-size: 16px;
  line-height: 1.9;
  color: var(--aml-body);
  background: var(--aml-bg);
  font-feature-settings: "palt" 1;
  overflow-wrap: break-word;
  word-break: normal;
  line-break: strict;
}

img, svg, video { max-width: 100%; height: auto; vertical-align: middle; }

a { color: var(--aml-accent); text-decoration: none; transition: color .15s ease, opacity .15s ease; }
a:hover { color: var(--aml-accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--aml-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 { color: var(--aml-ink); line-height: 1.5; margin: 0; font-weight: 700; }
p { margin: 0 0 1.4em; }
ul, ol { margin: 0 0 1.5em; padding-left: 1.6em; }
li { margin-bottom: .5em; }
figure { margin: 0; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--aml-ink); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Layout ---------- */
.aml-container { width: 100%; max-width: var(--aml-max); margin-inline: auto; padding-inline: 20px; }

.aml-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
  padding-block: 40px 72px;
}
.aml-layout--full { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 960px) {
  .aml-layout { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-block: 28px 56px; }
}

/* ---------- Header ---------- */
.aml-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--aml-line);
}
body.admin-bar .aml-header { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .aml-header { top: 46px; } }

.aml-header__inner {
  display: flex; align-items: center; gap: 24px;
  min-height: 68px;
}
.aml-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.aml-brand__mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--aml-accent) 0%, var(--aml-accent-2) 100%);
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em;
}
.aml-brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.aml-brand__title { font-size: 17px; font-weight: 800; color: var(--aml-ink); letter-spacing: .01em; }
.aml-brand__title a { color: inherit; }
.aml-brand__tagline { font-size: 11px; color: var(--aml-muted); letter-spacing: .02em; }
@media (max-width: 600px) { .aml-brand__tagline { display: none; } }

.aml-nav { margin-left: auto; }
.aml-nav ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.aml-nav li { margin: 0; position: relative; }
.aml-nav a {
  display: block; padding: 8px 0; font-size: 13.5px; font-weight: 600; color: var(--aml-ink);
  position: relative; white-space: nowrap;
}
.aml-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--aml-accent); border-radius: 2px; transform: scaleX(0);
  transform-origin: left; transition: transform .18s ease;
}
.aml-nav a:hover::after,
.aml-nav .current-menu-item > a::after { transform: scaleX(1); }

.aml-nav .sub-menu {
  position: absolute; left: 0; top: 100%; min-width: 200px; flex-direction: column; gap: 0;
  background: #fff; border: 1px solid var(--aml-line); border-radius: 10px;
  box-shadow: var(--aml-shadow); padding: 6px; display: none;
}
.aml-nav li:hover > .sub-menu, .aml-nav li:focus-within > .sub-menu { display: flex; }
.aml-nav .sub-menu a { padding: 8px 12px; border-radius: 6px; font-weight: 500; white-space: normal; }
.aml-nav .sub-menu a:hover { background: var(--aml-accent-soft); }
.aml-nav .sub-menu a::after { display: none; }

.aml-header__search { flex-shrink: 0; }
.aml-header__actions { display: flex; align-items: center; gap: 12px; margin-left: 16px; }

.aml-menu-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border: 1px solid var(--aml-line); background: #fff;
  border-radius: 10px; cursor: pointer; padding: 0;
}
.aml-menu-toggle span {
  display: block; width: 18px; height: 2px; background: var(--aml-ink); margin: 3px auto; border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.aml-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.aml-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.aml-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 860px) {
  .aml-menu-toggle { display: block; }
  .aml-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--aml-line); box-shadow: var(--aml-shadow);
    padding: 12px 20px 20px;
  }
  .aml-nav.is-open { display: block; }
  .aml-nav ul { flex-direction: column; gap: 0; }
  .aml-nav > div > ul > li { border-bottom: 1px solid var(--aml-line-soft); }
  .aml-nav a { padding: 13px 0; }
  .aml-nav .sub-menu { position: static; display: flex; border: 0; box-shadow: none; padding: 0 0 8px 14px; }
  .aml-header__actions { display: none; }
}

/* ---------- Category strip ---------- */
.aml-catbar { background: #fff; border-bottom: 1px solid var(--aml-line); }
.aml-catbar__inner { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px; scrollbar-width: thin; }
.aml-catbar__inner::-webkit-scrollbar { height: 4px; }
.aml-catbar__inner::-webkit-scrollbar-thumb { background: var(--aml-line); border-radius: 4px; }
.aml-catbar a {
  white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--aml-body);
  padding: 6px 14px; border-radius: 999px; background: var(--aml-bg); border: 1px solid var(--aml-line);
}
.aml-catbar a:hover { background: var(--aml-accent-soft); border-color: #bfdbfe; color: var(--aml-accent-dark); }

/* ---------- Hero ---------- */
.aml-hero {
  background:
    radial-gradient(1200px 400px at 15% -10%, rgba(37, 99, 235, .16), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(14, 165, 233, .14), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--aml-bg) 100%);
  border-bottom: 1px solid var(--aml-line);
}
.aml-hero__inner { padding-block: 56px 48px; }
.aml-hero__eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--aml-accent-dark); background: #fff; border: 1px solid #bfdbfe;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.aml-hero__title {
  font-size: clamp(26px, 4vw, 40px); line-height: 1.4; letter-spacing: -.01em;
  margin-bottom: 14px; max-width: 24em;
}
.aml-hero__lead { font-size: 15px; color: var(--aml-muted); max-width: 46em; margin-bottom: 26px; }
.aml-hero__search { max-width: 520px; }

/* ---------- Search form ---------- */
.aml-search { display: flex; gap: 8px; }
.aml-search input[type="search"] {
  flex: 1; min-width: 0; padding: 11px 16px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--aml-line); border-radius: 10px; background: #fff; color: var(--aml-ink);
}
.aml-search input[type="search"]::placeholder { color: #94a3b8; }
.aml-search button {
  padding: 11px 20px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer;
  border: 0; border-radius: 10px; background: var(--aml-accent); color: #fff;
  transition: background .15s ease;
}
.aml-search button:hover { background: var(--aml-accent-dark); }
.aml-header__search .aml-search input[type="search"] { padding: 8px 14px; width: 180px; }
.aml-header__search .aml-search button { padding: 8px 14px; }
@media (max-width: 1279px) { .aml-header__search { display: none; } }

/* ---------- Section heading ---------- */
.aml-section { margin-bottom: 52px; }
.aml-section__head {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px;
  padding-bottom: 12px; border-bottom: 2px solid var(--aml-line);
}
.aml-section__title { font-size: 20px; letter-spacing: .01em; position: relative; }
.aml-section__title::before {
  content: ""; display: inline-block; width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--aml-accent), var(--aml-accent-2));
  margin-right: 10px; vertical-align: -2px;
}
.aml-section__more { margin-left: auto; font-size: 13px; font-weight: 700; }
.aml-section__more::after { content: " →"; }

/* ---------- Post cards ---------- */
.aml-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.aml-grid--2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.aml-card {
  background: var(--aml-surface); border: 1px solid var(--aml-line); border-radius: var(--aml-radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.aml-card:hover { transform: translateY(-3px); box-shadow: var(--aml-shadow-hover); border-color: #cbd5e1; }
.aml-card__thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--aml-line-soft); }
.aml-thumb-link { position: absolute; inset: 0; display: block; }
.aml-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.aml-card:hover .aml-card__thumb img { transform: scale(1.04); }
.aml-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.aml-card__title {
  font-size: 16px; line-height: 1.6; margin-bottom: 10px; letter-spacing: .005em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.aml-card__title a { color: var(--aml-ink); }
.aml-card__title a:hover { color: var(--aml-accent); }
.aml-card__excerpt {
  font-size: 13px; color: var(--aml-muted); line-height: 1.8; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.aml-card__meta {
  margin-top: auto; display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--aml-muted);
}

/* Placeholder thumbnail (no featured image) */
.aml-thumb-ph {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 18px;
  background: linear-gradient(135deg, var(--ph-a, #2563eb) 0%, var(--ph-b, #0ea5e9) 100%);
}
.aml-thumb-ph::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(420px 160px at 10% 0%, rgba(255,255,255,.28), transparent 60%),
    radial-gradient(300px 200px at 100% 100%, rgba(0,0,0,.18), transparent 60%);
}
.aml-thumb-ph__label {
  position: relative; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.25); line-height: 1.6;
}

/* Category badge */
.aml-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 999px; background: var(--aml-accent-soft);
  color: var(--aml-accent-dark); border: 1px solid #dbeafe;
}
.aml-card__thumb .aml-badge,
.aml-listitem__thumb .aml-badge {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  background: rgba(255, 255, 255, .94); border-color: transparent; backdrop-filter: blur(4px);
}
.aml-card__thumb .aml-badge:hover,
.aml-listitem__thumb .aml-badge:hover { background: #fff; color: var(--aml-accent-dark); }
.aml-badge--lg { font-size: 12px; padding: 5px 13px; }

.aml-readtime::before { content: "🕒"; margin-right: 4px; font-size: 11px; }
.aml-date::before { content: ""; }

/* ---------- List style posts (archive) ---------- */
.aml-list { display: flex; flex-direction: column; gap: 18px; }
.aml-listitem {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px;
  background: var(--aml-surface); border: 1px solid var(--aml-line); border-radius: var(--aml-radius);
  padding: 16px; transition: box-shadow .18s ease, border-color .18s ease;
}
.aml-listitem:hover { box-shadow: var(--aml-shadow-hover); border-color: #cbd5e1; }
.aml-listitem__thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; display: block; background: var(--aml-line-soft); }
.aml-listitem__thumb img { width: 100%; height: 100%; object-fit: cover; }
.aml-listitem__title { font-size: 18px; line-height: 1.6; margin-bottom: 8px; }
.aml-listitem__title a { color: var(--aml-ink); }
.aml-listitem__title a:hover { color: var(--aml-accent); }
.aml-listitem__excerpt { font-size: 13.5px; color: var(--aml-muted); margin-bottom: 12px; }
.aml-listitem__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--aml-muted); }
@media (max-width: 640px) {
  .aml-listitem { grid-template-columns: minmax(0, 1fr); }
  .aml-listitem__title { font-size: 16px; }
}

/* ---------- Page header (archive / single) ---------- */
.aml-pagehead { background: #fff; border-bottom: 1px solid var(--aml-line); }
.aml-pagehead__inner { padding-block: 34px 30px; }
.aml-pagehead__title { font-size: clamp(22px, 3vw, 30px); margin-bottom: 10px; }
.aml-pagehead__desc { font-size: 14px; color: var(--aml-muted); max-width: 60em; margin: 0; }
.aml-pagehead__count { font-size: 13px; color: var(--aml-muted); margin-top: 8px; }

/* ---------- Breadcrumb ---------- */
.aml-breadcrumb { font-size: 12px; color: var(--aml-muted); padding-block: 14px; }
.aml-breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.aml-breadcrumb li { margin: 0; display: flex; align-items: center; gap: 8px; }
.aml-breadcrumb li:not(:last-child)::after { content: "›"; color: #cbd5e1; }
.aml-breadcrumb a { color: var(--aml-muted); }
.aml-breadcrumb a:hover { color: var(--aml-accent); }

/* ---------- Single article ---------- */
.aml-article {
  background: var(--aml-surface); border: 1px solid var(--aml-line);
  border-radius: var(--aml-radius); padding: 36px 40px 44px; box-shadow: var(--aml-shadow);
}
@media (max-width: 640px) { .aml-article { padding: 24px 20px 32px; border-radius: 10px; } }

.aml-article__head { margin-bottom: 28px; }
.aml-article__terms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.aml-article__title {
  font-size: clamp(23px, 3.4vw, 33px); line-height: 1.5; letter-spacing: -.005em; margin-bottom: 16px;
}
.aml-article__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  font-size: 13px; color: var(--aml-muted);
  padding-bottom: 20px; border-bottom: 1px solid var(--aml-line-soft);
}
.aml-article__thumb { margin: 0 0 28px; border-radius: 12px; overflow: hidden; }

/* Reading progress bar */
.aml-progress {
  position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 200;
  background: transparent; pointer-events: none;
}
.aml-progress__bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--aml-accent), var(--aml-accent-2));
  transition: width .1s linear;
}

/* ---------- Table of contents ---------- */
.aml-toc {
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fe 100%);
  border: 1px solid #dbeafe; border-radius: 12px;
  padding: 20px 24px; margin: 0 0 34px;
}
.aml-toc__head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
  font-size: 15px; font-weight: 800; color: var(--aml-ink);
}
.aml-toc__head::before {
  content: "≡"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  background: var(--aml-accent); color: #fff; font-size: 14px; line-height: 1;
}
.aml-toc__toggle {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--aml-accent);
  background: none; border: 0; cursor: pointer; font-family: inherit; padding: 4px 6px;
}
.aml-toc ol { list-style: none; counter-reset: toc; margin: 12px 0 0; padding: 0; }
.aml-toc > ol > li { counter-increment: toc; margin-bottom: 8px; }
.aml-toc > ol > li > a { font-weight: 700; color: var(--aml-ink); font-size: 14.5px; }
.aml-toc > ol > li > a::before {
  content: counter(toc); display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-right: 9px; border-radius: 6px;
  background: #fff; border: 1px solid #bfdbfe; color: var(--aml-accent-dark);
  font-size: 11px; font-weight: 800; vertical-align: 1px;
}
.aml-toc ol ol { margin: 8px 0 12px 32px; }
.aml-toc ol ol li { margin-bottom: 5px; }
.aml-toc ol ol a { font-size: 13.5px; color: var(--aml-body); position: relative; padding-left: 14px; }
.aml-toc ol ol a::before {
  content: ""; position: absolute; left: 0; top: .75em; width: 7px; height: 1px; background: #94a3b8;
}
.aml-toc a:hover { color: var(--aml-accent); }
.aml-toc.is-collapsed ol { display: none; }

/* ---------- Article content typography ---------- */
.aml-content { font-size: 16px; line-height: 2.0; color: var(--aml-body); }
.aml-content > *:first-child { margin-top: 0; }

.aml-content h2 {
  font-size: 22px; line-height: 1.55; margin: 56px 0 20px; padding: 14px 0 14px 18px;
  border-left: 5px solid var(--aml-accent); background: linear-gradient(90deg, #f4f8ff 0%, rgba(244,248,255,0) 90%);
  border-radius: 0 8px 8px 0; scroll-margin-top: 90px;
}
.aml-content h3 {
  font-size: 18.5px; line-height: 1.6; margin: 38px 0 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--aml-line); scroll-margin-top: 90px;
}
.aml-content h4 { font-size: 16.5px; margin: 30px 0 12px; scroll-margin-top: 90px; }
.aml-content p { margin: 0 0 1.6em; }
.aml-content strong { color: var(--aml-ink); font-weight: 700; background: linear-gradient(transparent 62%, #fef08a 62%); padding: 0 1px; }
.aml-content em { font-style: normal; color: var(--aml-accent-dark); font-weight: 600; }
.aml-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.aml-content ul, .aml-content ol { margin: 0 0 1.8em; padding-left: 0; list-style: none; }
.aml-content ul > li, .aml-content ol > li { position: relative; padding-left: 1.8em; margin-bottom: .7em; }
.aml-content ul > li::before {
  content: ""; position: absolute; left: .45em; top: .82em; width: 7px; height: 7px;
  background: var(--aml-accent); border-radius: 50%;
}
.aml-content ol { counter-reset: aml-ol; }
.aml-content ol > li { counter-increment: aml-ol; }
.aml-content ol > li::before {
  content: counter(aml-ol); position: absolute; left: 0; top: .38em;
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  background: var(--aml-accent); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1;
}
.aml-content li > ul, .aml-content li > ol { margin: .7em 0 0; }

.aml-content blockquote {
  margin: 0 0 1.8em; padding: 18px 22px; border-left: 4px solid #cbd5e1;
  background: var(--aml-line-soft); border-radius: 0 10px 10px 0; color: var(--aml-body);
}
.aml-content blockquote p:last-child { margin-bottom: 0; }

/* Tables */
.aml-tablewrap { overflow-x: auto; margin: 0 0 2em; -webkit-overflow-scrolling: touch; }
.aml-content table {
  width: 100%; min-width: 480px; border-collapse: separate; border-spacing: 0;
  font-size: 14.5px; line-height: 1.75;
  border: 1px solid var(--aml-line); border-radius: 10px; overflow: hidden; background: #fff;
}
.aml-content thead th {
  background: linear-gradient(180deg, #1e40af 0%, #2563eb 100%);
  color: #fff; font-weight: 700; text-align: left; white-space: nowrap;
}
.aml-content th, .aml-content td {
  padding: 12px 14px; border-bottom: 1px solid var(--aml-line); vertical-align: top;
}
.aml-content tbody tr:last-child td { border-bottom: 0; }
.aml-content tbody tr:nth-child(even) { background: #f8fafc; }
.aml-content tbody th { background: #f1f5f9; font-weight: 700; color: var(--aml-ink); white-space: nowrap; }

/* Code */
.aml-content code {
  font-family: var(--aml-font-mono); font-size: .88em;
  background: #eef2f7; color: #b91c1c; padding: .15em .45em; border-radius: 5px;
}
.aml-content pre {
  background: var(--aml-code-bg); color: #e2e8f0; padding: 18px 20px; border-radius: 10px;
  overflow-x: auto; margin: 0 0 1.8em; font-size: 13.5px; line-height: 1.85;
}
.aml-content pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ---------- Custom content boxes ---------- */
.aml-content .ai-point {
  background: linear-gradient(180deg, #f5faff 0%, #eef6ff 100%);
  border: 1px solid #bfdbfe; border-radius: 12px; padding: 22px 26px; margin: 0 0 2em;
}
.aml-content .ai-point__title {
  font-size: 15px; font-weight: 800; color: var(--aml-accent-dark); margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.aml-content .ai-point__title::before {
  content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--aml-accent); color: #fff; font-size: 12px; flex-shrink: 0;
}
.aml-content .ai-point ul { margin: 0; }
.aml-content .ai-point li { margin-bottom: .5em; font-size: 15px; }
.aml-content .ai-point li:last-child { margin-bottom: 0; }
.aml-content .ai-point li::before { background: var(--aml-accent-2); }

.aml-content .ai-note {
  background: var(--aml-warn-bg); border: 1px solid var(--aml-warn-line);
  border-left-width: 5px; border-radius: 0 10px 10px 0; padding: 18px 22px; margin: 0 0 2em;
}
.aml-content .ai-note__title {
  font-size: 14.5px; font-weight: 800; color: var(--aml-warn-ink); margin: 0 0 8px;
  display: flex; align-items: center; gap: 7px;
}
.aml-content .ai-note__title::before { content: "!"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #f97316; color: #fff; font-size: 12px; font-weight: 800; }
.aml-content .ai-note p:last-child, .aml-content .ai-note ul:last-child { margin-bottom: 0; }

.aml-content .ai-tip {
  background: var(--aml-tip-bg); border: 1px solid var(--aml-tip-line);
  border-left-width: 5px; border-radius: 0 10px 10px 0; padding: 18px 22px; margin: 0 0 2em;
}
.aml-content .ai-tip__title {
  font-size: 14.5px; font-weight: 800; color: var(--aml-tip-ink); margin: 0 0 8px;
  display: flex; align-items: center; gap: 7px;
}
.aml-content .ai-tip__title::before { content: "★"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #10b981; color: #fff; font-size: 11px; }
.aml-content .ai-tip p:last-child, .aml-content .ai-tip ul:last-child { margin-bottom: 0; }

.aml-content .ai-prompt {
  border: 1px solid #334155; border-radius: 12px; overflow: hidden; margin: 0 0 2em; background: var(--aml-code-bg);
}
.aml-content .ai-prompt__title {
  margin: 0; padding: 11px 18px; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: #cbd5e1; background: #1e293b; border-bottom: 1px solid #334155;
  display: flex; align-items: center; gap: 8px;
}
.aml-content .ai-prompt__title::before { content: "❯"; color: #38bdf8; font-weight: 800; }
.aml-content .ai-prompt pre { margin: 0; border-radius: 0; background: transparent; }
.aml-prompt-copy {
  margin-left: auto; font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
  background: #334155; color: #e2e8f0; border: 1px solid #475569; border-radius: 6px; padding: 4px 10px;
  transition: background .15s ease;
}
.aml-prompt-copy:hover { background: #475569; }
.aml-prompt-copy.is-done { background: #059669; border-color: #059669; color: #fff; }

.aml-content .ai-faq { margin: 0 0 2em; border: 1px solid var(--aml-line); border-radius: 12px; overflow: hidden; background: #fff; }
.aml-content .ai-faq h3 {
  margin: 0; padding: 16px 20px 16px 52px; font-size: 15.5px; border-bottom: 0;
  background: #f8fafc; position: relative; line-height: 1.65;
}
.aml-content .ai-faq h3::before {
  content: "Q"; position: absolute; left: 18px; top: 15px;
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px;
  background: var(--aml-accent); color: #fff; font-size: 12.5px; font-weight: 800;
}
.aml-content .ai-faq p {
  margin: 0; padding: 16px 20px 20px 52px; position: relative; font-size: 15px;
  border-bottom: 1px solid var(--aml-line);
}
.aml-content .ai-faq p::before {
  content: "A"; position: absolute; left: 18px; top: 15px;
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px;
  background: #e2e8f0; color: var(--aml-ink); font-size: 12.5px; font-weight: 800;
}
.aml-content .ai-faq > *:last-child { border-bottom: 0; }

/* 目次は本文内に挿入されるため、本文のリスト装飾を打ち消す */
.aml-content .aml-toc ol { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: toc; }
.aml-content .aml-toc > ol > li { counter-increment: toc; padding-left: 0; margin-bottom: 8px; }
.aml-content .aml-toc ol ol { margin: 8px 0 12px 32px; }
.aml-content .aml-toc ol ol > li { counter-increment: none; padding-left: 0; margin-bottom: 5px; }
.aml-content .aml-toc li::before { content: none !important; display: none !important; }
.aml-content .aml-toc a { text-decoration: none; }
.aml-content .aml-toc > ol > li > a::before {
  content: counter(toc); display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-right: 9px; border-radius: 6px;
  background: #fff; border: 1px solid #bfdbfe; color: var(--aml-accent-dark);
  font-size: 11px; font-weight: 800; vertical-align: 1px;
}
.aml-content .aml-toc ol ol a::before {
  content: ""; position: absolute; left: 0; top: .75em; width: 7px; height: 1px;
  background: #94a3b8; display: block; border: 0; margin: 0; border-radius: 0;
}

/* ---------- CTA ---------- */
.aml-cta {
  margin: 44px 0 0; padding: 30px 32px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0ea5e9 100%);
  position: relative; overflow: hidden;
}
.aml-cta::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255, 255, 255, .10);
}
.aml-cta__label { font-size: 12px; font-weight: 700; letter-spacing: .08em; opacity: .85; margin-bottom: 8px; }
.aml-cta__title { font-size: 20px; color: #fff; margin-bottom: 10px; line-height: 1.5; position: relative; }
.aml-cta__text { font-size: 14px; opacity: .92; margin-bottom: 20px; position: relative; }
.aml-cta__btn {
  display: inline-block; background: #fff; color: var(--aml-accent-dark);
  font-weight: 800; font-size: 14.5px; padding: 12px 28px; border-radius: 999px; position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.aml-cta__btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .18); color: var(--aml-accent-dark); }
@media (max-width: 640px) { .aml-cta { padding: 24px 20px; } }

/* ---------- Share / tags / author ---------- */
.aml-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 36px; }
.aml-share__label { font-size: 13px; font-weight: 700; color: var(--aml-ink); }
.aml-share a, .aml-share button {
  font-size: 12.5px; font-weight: 700; font-family: inherit; cursor: pointer;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--aml-line);
  background: #fff; color: var(--aml-body);
}
.aml-share a:hover, .aml-share button:hover { border-color: var(--aml-accent); color: var(--aml-accent); }

.aml-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.aml-tags a {
  font-size: 12.5px; color: var(--aml-muted); background: var(--aml-line-soft);
  padding: 5px 12px; border-radius: 6px; border: 1px solid transparent;
}
.aml-tags a::before { content: "#"; margin-right: 2px; color: #94a3b8; }
.aml-tags a:hover { background: var(--aml-accent-soft); color: var(--aml-accent-dark); border-color: #bfdbfe; }

.aml-postnav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.aml-postnav a {
  display: block; padding: 16px 18px; background: #fff; border: 1px solid var(--aml-line);
  border-radius: 12px; font-size: 14px; color: var(--aml-ink); line-height: 1.6;
}
.aml-postnav a:hover { border-color: var(--aml-accent); box-shadow: var(--aml-shadow); }
.aml-postnav__label { display: block; font-size: 11.5px; color: var(--aml-muted); font-weight: 700; margin-bottom: 6px; }
.aml-postnav__next { text-align: right; }
@media (max-width: 640px) { .aml-postnav { grid-template-columns: 1fr; } }

/* ---------- Related ---------- */
.aml-related { margin-top: 52px; }

/* ---------- Sidebar ---------- */
.aml-sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 22px; }
body.admin-bar .aml-sidebar { top: 124px; }
@media (max-width: 960px) { .aml-sidebar, body.admin-bar .aml-sidebar { position: static; } }

.aml-widget {
  background: var(--aml-surface); border: 1px solid var(--aml-line);
  border-radius: 12px; padding: 20px 22px;
}
.aml-widget__title {
  font-size: 14.5px; font-weight: 800; color: var(--aml-ink); margin: 0 0 16px;
  padding-bottom: 11px; border-bottom: 2px solid var(--aml-line); display: flex; align-items: center; gap: 8px;
}
.aml-widget__title::before {
  content: ""; width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--aml-accent), var(--aml-accent-2));
}
.aml-widget ul { list-style: none; margin: 0; padding: 0; }
.aml-widget li { margin: 0; }
.aml-widget > ul > li { border-bottom: 1px solid var(--aml-line-soft); }
.aml-widget > ul > li:last-child { border-bottom: 0; }
.aml-widget > ul > li > a { display: block; padding: 9px 0; font-size: 13.5px; color: var(--aml-body); }
.aml-widget > ul > li > a:hover { color: var(--aml-accent); }
.aml-widget .count { color: var(--aml-muted); font-size: 12px; }

.aml-rank { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.aml-rank li {
  counter-increment: rank; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--aml-line-soft);
}
.aml-rank li:first-child { padding-top: 0; }
.aml-rank li:last-child { border-bottom: 0; padding-bottom: 0; }
.aml-rank li::before {
  content: counter(rank); display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; background: var(--aml-line-soft); color: var(--aml-muted);
  font-size: 12px; font-weight: 800;
}
.aml-rank li:nth-child(1)::before { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff; }
.aml-rank li:nth-child(2)::before { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #fff; }
.aml-rank li:nth-child(3)::before { background: linear-gradient(135deg, #b45309, #d97706); color: #fff; }
.aml-rank a { font-size: 13.5px; line-height: 1.7; color: var(--aml-ink); }
.aml-rank a:hover { color: var(--aml-accent); }
.aml-rank__meta { display: block; font-size: 11.5px; color: var(--aml-muted); margin-top: 3px; }

.aml-widget .aml-tags { margin-top: 0; }

.aml-widget--cta {
  background: linear-gradient(150deg, #0f172a 0%, #1e3a8a 100%); border-color: transparent; color: #cbd5e1;
}
.aml-widget--cta .aml-widget__title { color: #fff; border-bottom-color: rgba(255,255,255,.18); }
.aml-widget--cta p { font-size: 13px; line-height: 1.85; margin-bottom: 16px; }
.aml-widget--cta .aml-cta__btn { font-size: 13.5px; padding: 10px 22px; }

.aml-morelink { text-align: center; margin: 8px 0 0; }
.aml-morelink__btn {
  display: inline-block; background: var(--aml-accent); color: #fff; font-weight: 800;
  font-size: 14.5px; padding: 13px 32px; border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.aml-morelink__btn:hover { background: var(--aml-accent-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37,99,235,.28); }

/* ---------- Pagination ---------- */
.aml-pagination { margin-top: 40px; }
.aml-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.aml-pagination .page-numbers {
  min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 12px;
  background: #fff; border: 1px solid var(--aml-line); border-radius: 10px;
  font-size: 14px; font-weight: 700; color: var(--aml-body);
}
.aml-pagination .page-numbers:hover { border-color: var(--aml-accent); color: var(--aml-accent); }
.aml-pagination .page-numbers.current { background: var(--aml-accent); border-color: var(--aml-accent); color: #fff; }
.aml-pagination .page-numbers.dots { border-color: transparent; background: transparent; }

/* ---------- Footer ---------- */
.aml-footer { background: #0f172a; color: #94a3b8; margin-top: auto; }
.aml-footer a { color: #cbd5e1; }
.aml-footer a:hover { color: #fff; }
.aml-footer__main {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-block: 48px 36px;
}
@media (max-width: 800px) { .aml-footer__main { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 520px) { .aml-footer__main { grid-template-columns: 1fr; } }
.aml-footer__brand { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.aml-footer__desc { font-size: 13px; line-height: 1.9; max-width: 34em; }
.aml-footer__title { font-size: 13px; font-weight: 800; color: #fff; margin-bottom: 14px; letter-spacing: .04em; }
.aml-footer ul { list-style: none; margin: 0; padding: 0; }
.aml-footer li { margin-bottom: 9px; font-size: 13px; }
.aml-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .10); padding-block: 20px;
  font-size: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}

/* ---------- Back to top ---------- */
.aml-totop {
  position: fixed; right: 20px; bottom: 24px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--aml-accent); color: #fff; font-size: 18px; line-height: 1;
  box-shadow: 0 6px 20px rgba(37, 99, 235, .35);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.aml-totop.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.aml-totop:hover { background: var(--aml-accent-dark); }

/* ---------- Page / 404 / search ---------- */
.aml-page { background: #fff; border: 1px solid var(--aml-line); border-radius: var(--aml-radius); padding: 36px 40px 44px; }
@media (max-width: 640px) { .aml-page { padding: 24px 20px 32px; } }
.aml-empty { background: #fff; border: 1px dashed var(--aml-line); border-radius: 12px; padding: 48px 24px; text-align: center; }
.aml-empty__title { font-size: 19px; margin-bottom: 10px; }
.aml-empty p { color: var(--aml-muted); font-size: 14px; }
.aml-404 { text-align: center; padding-block: 60px; }
.aml-404__code { font-size: 76px; font-weight: 800; line-height: 1; color: var(--aml-accent); letter-spacing: -.03em; }

/* ---------- Comments ---------- */
.aml-comments { margin-top: 44px; background: #fff; border: 1px solid var(--aml-line); border-radius: var(--aml-radius); padding: 28px 32px; }
.aml-comments__title { font-size: 17px; margin-bottom: 20px; }
.aml-comments .comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.aml-comments .comment-list li { border-bottom: 1px solid var(--aml-line-soft); padding: 16px 0; }
.aml-comments input[type="text"], .aml-comments input[type="email"], .aml-comments input[type="url"], .aml-comments textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--aml-line); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: #fff;
}
.aml-comments .submit {
  background: var(--aml-accent); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 26px; font-weight: 700; font-family: inherit; font-size: 14px; cursor: pointer;
}
@media (max-width: 640px) { .aml-comments { padding: 22px 18px; } }

/* ---------- Utility ---------- */
.aml-site { display: flex; flex-direction: column; min-height: 100vh; }
.aml-main:focus { outline: none; }
.aml-main { flex: 1; }
.alignwide { max-width: none; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, .aml-caption { font-size: 12.5px; color: var(--aml-muted); text-align: center; margin-top: 8px; }
.sticky .aml-card__title::before { content: "📌 "; }

@media print {
  .aml-header, .aml-sidebar, .aml-footer, .aml-cta, .aml-totop, .aml-share, .aml-related, .aml-progress { display: none !important; }
  .aml-article { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; }
}

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