:root {
  --ink: #1f2937;
  --muted: #667085;
  --line: #e4e7ec;
  --soft: #f7f8fa;
  --gold: #9a6b08;
  --gold-dark: #704d00;
  --gold-soft: #fff6dc;
  --navy: #142338;
  --white: #ffffff;
  --danger-soft: #fff1f0;
  --danger: #b42318;
  --success-soft: #ecfdf3;
  --success: #067647;
  --shadow: 0 12px 36px rgba(20, 35, 56, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
}
.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255,255,255,.13);
  background: rgba(20, 35, 56, 0.97);
  color: var(--white);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1180px;
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: var(--gold);
  font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { color: #d0d5dd; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.header-actions a { color: #eaecf0; text-decoration: none; font-weight: 650; }
.header-actions a:hover { color: var(--white); }
.header-actions .bot-link {
  padding: 10px 15px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--gold-soft);
}

.hero {
  color: var(--white);
  background:
    radial-gradient(circle at 80% 20%, rgba(154,107,8,.5), transparent 34%),
    linear-gradient(135deg, #142338 0%, #213754 56%, #142338 100%);
}
.hero-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 82px 24px 72px;
  text-align: center;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #f9d77e; }
.hero h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.18; }
.hero-copy { max-width: 680px; margin: 18px auto 28px; color: #eaecf0; font-size: 1.08rem; }
.search-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px;
  display: flex;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(0,0,0,.22);
}
.search-panel input {
  min-width: 0;
  flex: 1;
  padding: 14px 16px;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
}
.search-panel button, .primary-link {
  padding: 13px 20px;
  border: 0;
  border-radius: 11px;
  color: var(--white);
  background: var(--gold);
  font-weight: 800;
  text-decoration: none;
}
.search-panel button:hover, .primary-link:hover { background: var(--gold-dark); }
.quick-questions { margin-top: 16px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.quick-questions button {
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  color: #f2f4f7;
  background: rgba(255,255,255,.08);
}
.quick-questions button:hover { background: rgba(255,255,255,.17); }

.section { max-width: 1180px; margin: 0 auto; padding: 68px 24px; }
.muted-section { max-width: none; padding-left: max(24px, calc((100vw - 1180px)/2 + 24px)); padding-right: max(24px, calc((100vw - 1180px)/2 + 24px)); background: var(--soft); }
.section-heading {
  margin-bottom: 26px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.section-heading h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.28; }
.section-heading > p { max-width: 520px; margin: 0; color: var(--muted); }
.section-heading a, .text-button { color: var(--gold-dark); font-weight: 800; text-decoration: none; }
.text-button { padding: 0; border: 0; background: none; }

.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.role-card {
  min-height: 210px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}
.role-card:hover { transform: translateY(-4px); border-color: #c9a653; }
.role-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--gold-soft); font-size: 1.35rem; font-weight: 900; }
.role-card h3 { margin: 20px 0 4px; font-size: 1.2rem; }
.role-card p { margin: 0; color: var(--muted); }
.role-card .role-link { margin-top: auto; padding-top: 18px; color: var(--gold-dark); font-weight: 800; }
.role-card.is-coming { opacity: .68; box-shadow: none; }

.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.article-card {
  min-height: 198px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(20,35,56,.05);
}
.article-card:hover { border-color: #c9a653; box-shadow: var(--shadow); }
.article-card .tag { align-self: flex-start; padding: 4px 9px; border-radius: 999px; color: var(--gold-dark); background: var(--gold-soft); font-size: .76rem; font-weight: 800; }
.article-card h3 { margin: 14px 0 8px; line-height: 1.45; }
.article-card p { margin: 0; color: var(--muted); }
.article-card .read-more { margin-top: auto; padding-top: 16px; color: var(--gold-dark); font-weight: 800; }

.trouble-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.trouble-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); text-decoration: none; }
.trouble-card strong { display: block; margin-bottom: 4px; }
.trouble-card span { color: var(--muted); font-size: .92rem; }

.search-results-section { border-top: 1px solid var(--line); }
.no-results { padding: 38px; border-radius: 16px; text-align: center; background: var(--soft); }
.no-results h3 { margin-top: 0; }

.listing-header { padding: 34px; border-radius: 22px; color: var(--white); background: linear-gradient(135deg, var(--navy), #294362); }
.listing-header h1 { margin: 5px 0 8px; }
.listing-header p { margin: 0; color: #eaecf0; }
.listing-toolbar { margin: 28px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.category-tabs button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.category-tabs button.active { border-color: var(--gold); color: var(--gold-dark); background: var(--gold-soft); font-weight: 800; }

.article-view { max-width: 980px; margin: 0 auto; padding: 54px 24px 80px; }
.breadcrumbs { margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .92rem; }
.breadcrumbs a { color: var(--gold-dark); text-decoration: none; }
.article-hero { padding: 34px; border-radius: 22px; color: var(--white); background: linear-gradient(135deg, var(--navy), #294362); }
.article-hero .article-role { color: #f9d77e; font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.article-hero h1 { margin: 8px 0 10px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.25; }
.article-hero p { margin: 0; max-width: 720px; color: #eaecf0; font-size: 1.05rem; }
.article-layout { margin-top: 30px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.article-body section { margin-bottom: 30px; }
.article-body h2 { margin-bottom: 12px; font-size: 1.45rem; }
.article-body ol, .article-body ul { padding-left: 1.35rem; }
.article-body li { margin: 8px 0; }
.callout { padding: 18px 20px; border-left: 4px solid var(--gold); border-radius: 10px; background: var(--gold-soft); }
.callout.warning { border-left-color: #dc6803; background: #fff4e5; }
.callout.success { border-left-color: var(--success); background: var(--success-soft); }
.callout p { margin: 0; }
.article-side { position: sticky; top: 94px; }
.side-card { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); box-shadow: 0 8px 24px rgba(20,35,56,.05); }
.side-card h3 { margin: 0 0 10px; }
.side-card a { color: var(--gold-dark); font-weight: 750; text-decoration: none; }
.side-card ul { margin: 0; padding-left: 1.2rem; }

.screen-demo { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #eef1f5; }
.screen-demo-label { padding: 9px 14px; color: #5f4504; background: #fff1bd; font-size: .82rem; font-weight: 800; }
.screen-demo-window { margin: 18px; border: 1px solid #cbd5e1; border-radius: 12px; background: var(--white); box-shadow: 0 10px 24px rgba(20,35,56,.12); }
.screen-demo-bar { padding: 10px 14px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.screen-demo-bar span { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.screen-demo-content { display: grid; grid-template-columns: 150px 1fr; min-height: 250px; }
.screen-demo-nav { padding: 16px 10px; border-right: 1px solid var(--line); background: var(--navy); color: #e5e7eb; }
.screen-demo-nav div { padding: 7px 9px; border-radius: 7px; font-size: .78rem; }
.screen-demo-nav .active { background: var(--gold); color: var(--white); font-weight: 800; }
.screen-demo-main { padding: 20px; }
.screen-demo-title { height: 18px; width: 48%; margin-bottom: 18px; border-radius: 5px; background: #d0d5dd; }
.screen-demo-row { margin: 10px 0; padding: 12px; display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 9px; }
.screen-demo-row strong { color: var(--navy); }
.screen-demo-action { align-self: center; padding: 6px 9px; border-radius: 6px; color: var(--white); background: var(--gold); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.screen-demo-note { padding: 0 18px 18px; color: var(--muted); font-size: .85rem; }

.site-footer { padding: 34px max(24px, calc((100vw - 1180px)/2 + 24px)); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #d0d5dd; background: var(--navy); }
.site-footer p { margin: 4px 0 0; }
.site-footer a { color: #f9d77e; font-weight: 800; text-decoration: none; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

body.is-embedded .skip-link,
body.is-embedded .site-header,
body.is-embedded .site-footer {
  display: none;
}

body.is-embedded .article-side {
  top: 22px;
}

@media (max-width: 980px) {
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .trouble-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .article-side { position: static; }
}

@media (max-width: 720px) {
  .header-inner { align-items: flex-start; }
  .header-actions { display: none; }
  .hero-inner { padding-top: 56px; }
  .search-panel { flex-direction: column; }
  .search-panel button { width: 100%; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .listing-header { padding: 26px 20px; }
  .listing-header h1 { font-size: clamp(1.75rem, 8vw, 2.15rem); word-break: keep-all; }
  .listing-toolbar { align-items: stretch; flex-direction: column; }
  .listing-toolbar .primary-link { width: 100%; text-align: center; }
  .category-tabs { width: 100%; }
  .role-grid, .article-grid, .trouble-grid { grid-template-columns: 1fr; }
  .screen-demo-content { grid-template-columns: 1fr; }
  .screen-demo-nav { display: flex; overflow-x: auto; border-right: 0; }
  .screen-demo-nav div { white-space: nowrap; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}
