/* ===== DESIGN SYSTEM ===== */
:root {
  --white: #ffffff;
  --paper: #ffffff;
  --warm-gray-50: #f9f9f9;
  --warm-gray-100: #efefef;
  --warm-gray-200: #e0e0e0;
  --warm-gray-300: #c0c0c0;
  --warm-gray-400: #999999;
  --warm-gray-500: #777777;
  --warm-gray-600: #555555;
  --warm-gray-700: #333333;
  --ink: #111111;
  --shu: #1a5276;
  --shu-light: #2471a3;
  --indigo: #1a5276;
  --indigo-light: #2471a3;
  --teal: #34A853;
  --violet: #FBBC05;
  --sidebar-w: 272px;
  --font-serif: 'Shippori Mincho', 'Georgia', serif;
  --font-sans: 'DM Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-jp: 'Noto Sans JP', sans-serif;
  --g-blue: #1a5276;
  --g-red: #EA4335;
  --g-yellow: #FBBC05;
  --g-green: #34A853;
  --g-purple: #7B61FF;
}

/* ===== PASSWORD GATE ===== */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 1;
  transition: opacity .5s ease;
}
.pw-gate.fade-out {
  opacity: 0;
  pointer-events: none;
}
.pw-gate.hidden { display: none; }
.pw-gate-inner {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}
.pw-gate-title {
  font-family: 'Shippori Mincho', 'Georgia', serif;
  font-size: 32px;
  font-weight: 600;
  color: #111111;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.pw-gate-sub {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: #999999;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 48px;
}
.pw-gate-line {
  display: block;
  width: 40px;
  height: 2px;
  background: #1a5276;
  margin: 16px auto 48px;
}
.pw-gate-input {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  outline: none;
  text-align: center;
  letter-spacing: .1em;
  transition: border-color .2s;
  background: #ffffff;
  color: #333333;
}
.pw-gate-input:focus {
  border-color: #1a5276;
}
.pw-gate-input::placeholder {
  color: #c0c0c0;
}
.pw-gate-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  background: #1a5276;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: .08em;
  transition: background .2s;
}
.pw-gate-btn:hover {
  background: #2471a3;
}
.pw-gate-error {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: #EA4335;
  margin-top: 12px;
  min-height: 20px;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-jp);
  font-weight: 400;
  background: var(--paper);
  color: var(--warm-gray-700);
  line-height: 1.85;
  font-size: 22px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== PROGRESS BAR ===== */
#progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 0; height: 2px;
  background: var(--shu);
  transition: width 80ms linear;
  pointer-events: none;
}

/* ===== LAYOUT: SIDEBAR + MAIN ===== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-width: 200px;
  background: var(--white);
  border-right: 1px solid var(--warm-gray-100);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

/* ===== RESIZE HANDLE ===== */
.resize-handle {
  position: fixed;
  top: 0; bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 150;
  background: transparent;
  transition: background .15s ease;
}
.resize-handle:hover,
.resize-handle.active {
  background: var(--shu);
  opacity: .3;
}
.resize-handle.active {
  opacity: .5;
}
body.resizing {
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}
body.resizing .sidebar { transition: none; }
body.resizing .main { transition: none; }
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--warm-gray-200); border-radius: 3px; }

/* Sidebar brand */
.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--warm-gray-100);
  flex-shrink: 0;
}
.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 30px; height: 30px;
  background: var(--ink);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--shu);
}
.brand-mark span {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 600;
  color: var(--white);
  letter-spacing: -.5px;
}
.brand-text {
  font-family: var(--font-jp);
  font-size: 17px; font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.brand-text small {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 500;
  color: var(--warm-gray-400);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Sidebar nav */
.sidebar-nav {
  padding: 12px 0 24px;
  flex: 1;
}

/* Category group */
.nav-cat {
  margin-bottom: 2px;
}
.nav-cat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 18px 9px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-jp);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  line-height: 1.4;
  transition: background .15s ease;
  border-left: 3px solid transparent;
}
.nav-cat-toggle:hover {
  background: var(--warm-gray-50);
}
.nav-cat-toggle .cat-count {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--warm-gray-400);
  flex-shrink: 0;
  margin-left: 6px;
}
.nav-cat-toggle .chevron {
  font-size: 14px;
  color: var(--warm-gray-300);
  transition: transform .25s ease;
  flex-shrink: 0;
  margin-left: 4px;
}
.nav-cat.open .nav-cat-toggle .chevron {
  transform: rotate(90deg);
}
.nav-cat.open .nav-cat-toggle {
  border-left-color: var(--shu);
}

/* Article links in sidebar */
.nav-links {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1);
}
.nav-cat.open > .nav-links {
  max-height: 1200px;
}
.nav-link-item a {
  display: block;
  padding: 6px 18px 6px 28px;
  font-size: 17px;
  font-weight: 400;
  color: var(--warm-gray-500);
  line-height: 1.55;
  transition: color .15s ease, background .15s ease;
  border-left: 3px solid transparent;
}
.nav-link-item a:hover {
  color: var(--ink);
  background: var(--warm-gray-50);
}
.nav-link-item a.active {
  color: var(--shu);
  background: rgba(91, 127, 245, .04);
  border-left-color: var(--shu);
  font-weight: 500;
}

/* Sidebar Read Status Toggle */
.nav-link-item {
  display: flex;
  align-items: center;
  padding-left: 12px;
}
.search-hidden {
  display: none !important;
}
.read-status-toggle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--warm-gray-200);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-right: 8px;
  padding: 0;
  color: transparent;
}
.read-status-toggle:hover {
  border-color: var(--g-blue);
  background: rgba(66,133,244,0.05);
  color: rgba(66,133,244,0.5);
}
.read-status-toggle.is-read {
  background: var(--g-green);
  border-color: var(--g-green);
  color: white;
}
.read-status-toggle.is-read:hover {
  opacity: 0.8;
}
.nav-link-item a {
  flex: 1;
  padding-left: 8px !important; /* adjust for toggle */
  border-left: none !important;
}

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

/* ===== GLOBAL NAV ===== */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 51;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--warm-gray-100);
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.global-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.global-nav-home {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 600;
  color: var(--warm-gray-500);
  text-decoration: none;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--warm-gray-100);
  border-radius: 8px;
  background: var(--white);
  transition: all .2s ease;
}
.global-nav-home svg {
  width: 16px;
  height: 16px;
  stroke: var(--g-blue);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.global-nav-home:hover {
  border-color: var(--g-blue);
  color: var(--g-blue);
  background: rgba(66,133,244,.04);
  box-shadow: 0 1px 4px rgba(66,133,244,.12);
}
.global-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.global-nav-link {
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 500;
  color: var(--warm-gray-500);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--warm-gray-100);
  border-radius: 8px;
  background: var(--white);
  transition: all .2s ease;
  white-space: nowrap;
}
.global-nav-link:hover {
  border-color: var(--g-blue);
  color: var(--g-blue);
  background: rgba(66,133,244,.04);
  box-shadow: 0 1px 4px rgba(66,133,244,.12);
}
.global-nav-brand {
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: 500;
  color: var(--warm-gray-400);
  display: none;
}

/* Breadcrumb header */
.main-header {
  padding: 8px 32px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--warm-gray-50);
}
.breadcrumbs {
  font-size: 18px;
  color: var(--warm-gray-400);
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumbs a {
  color: var(--warm-gray-400);
  transition: color .15s ease;
}
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { color: var(--warm-gray-300); font-size: 15px; }
.breadcrumbs .current { color: var(--warm-gray-600); font-weight: 500; }

/* Font size switcher */
.font-size-sw {
  display: flex; align-items: center; gap: 2px;
  margin-left: auto; flex-shrink: 0;
}
.font-size-sw button {
  background: none; border: 1px solid var(--warm-gray-200);
  border-radius: 4px; cursor: pointer;
  color: var(--warm-gray-500);
  font-family: var(--font-sans);
  font-weight: 600;
  transition: all .15s;
  line-height: 1;
  padding: 4px 0;
  width: 32px; text-align: center;
}
.font-size-sw button:hover { border-color: var(--warm-gray-300); color: var(--ink); }
.font-size-sw button.active {
  background: var(--ink); color: var(--white);
  border-color: var(--ink);
}
.font-size-sw .fs-s { font-size: 11px; }
.font-size-sw .fs-m { font-size: 14px; }
.font-size-sw .fs-l { font-size: 17px; }

/* Highly Visible Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
  border: none;
  font-family: var(--font-jp);
}
.btn-primary {
  background: var(--g-blue);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(66,133,244,0.4);
}
.btn-primary:hover {
  background: #1a73e8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66,133,244,0.6);
}
.btn-secondary {
  background: var(--warm-gray-50);
  color: var(--ink) !important;
  border: 1px solid var(--warm-gray-200);
}
.btn-secondary:hover {
  background: #fff;
  border-color: var(--g-blue);
  color: var(--g-blue) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.btn-red {
  background: var(--g-red) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(234,67,53,0.4);
}
.btn-red:hover {
  background: #d93025 !important;
  box-shadow: 0 6px 20px rgba(234,67,53,0.6);
}

/* Clickable Large Link Cards */
.link-card-huge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px;
  background: var(--white);
  border: 2px solid var(--warm-gray-100);
  border-radius: 20px;
  text-decoration: none !important;
  transition: all 0.3s ease;
  margin: 24px 0;
}
.link-card-huge:hover {
  border-color: var(--g-blue);
  background: rgba(66,133,244,0.02);
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}
.lch-content h3 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--ink);
}
.lch-content p {
  font-size: 16px;
  color: var(--warm-gray-500);
  margin: 0;
}
.lch-icon {
  font-size: 40px;
}

/* Font size modes - uses zoom to scale all fixed px sizes */
.article-content.fs-small { zoom: 0.65; }
.article-content.fs-medium { zoom: 0.75; }
.article-content.fs-large { zoom: 1; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px; height: 32px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 200;
}
.hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform .25s ease, opacity .2s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .25);
  z-index: 90;
}

/* ===== ARTICLE CONTENT ===== */
.article-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

/* Hero */
.article-hero {
  padding: 48px 0 0;
  opacity: 0; transform: translateY(14px);
  animation: up .55s cubic-bezier(.25,.46,.45,.94) .1s forwards;
}
.article-cat-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--shu);
  background: rgba(91, 127, 245, .05);
  border: 1px solid rgba(91, 127, 245, .15);
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
/* date removed */
.article-hero h1 {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: .03em;
  margin-bottom: 12px;
}
.article-hero-line {
  display: block;
  width: 36px; height: 2px;
  background: var(--shu);
  border-radius: 1px;
}

/* Sections */
.welcome-section {
  padding-top: 40px;
}
.welcome-section h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  letter-spacing: .02em;
}
.welcome-section h3 {
  font-family: var(--font-jp);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  margin-top: 28px;
  line-height: 1.5;
}
.welcome-section p {
  font-size: 22px;
  color: var(--warm-gray-600);
  line-height: 1.9;
  margin-bottom: 16px;
}
.welcome-greeting {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 36px;
}
.welcome-greeting p {
  margin-bottom: 12px;
}
.welcome-greeting p:last-child {
  margin-bottom: 0;
}
.greeting-name {
  font-weight: 600;
  color: var(--ink);
}

/* Highlight list */
.highlight-list {
  list-style: none;
  margin: 12px 0 28px;
}
.highlight-list li {
  padding: 8px 0;
  font-size: 21px;
  color: var(--warm-gray-600);
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.7;
}
.highlight-list li::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--shu);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  top: 6px;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0 40px;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 8px;
  padding: 22px 20px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.feature-card:hover {
  border-color: var(--warm-gray-200);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .03);
}
.feature-icon {
  font-size: 33px;
  margin-bottom: 14px;
}
.feature-card h3 {
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.4;
}
.feature-card p {
  font-size: 19px;
  color: var(--warm-gray-500);
  line-height: 1.7;
  margin-bottom: 0;
}

/* Learning path */
.learning-path {
  margin: 24px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 8px;
  padding: 22px 24px;
  transition: border-color .2s ease;
}
.step-card:hover {
  border-color: var(--warm-gray-200);
}
.step-num {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 600;
  color: var(--white);
  flex-shrink: 0;
}
.step-num.s1 { background: var(--indigo); }
.step-num.s2 { background: var(--teal); }
.step-num.s3 { background: var(--violet); }
.step-body h3 {
  font-family: var(--font-jp);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.4;
}
.step-body p {
  font-size: 20px;
  color: var(--warm-gray-500);
  line-height: 1.7;
  margin-bottom: 0;
}

/* Summary / CTA */
.summary-box {
  background: var(--warm-gray-50);
  border: 1px solid var(--warm-gray-100);
  border-radius: 8px;
  padding: 28px;
  margin-top: 12px;
  text-align: center;
}
.summary-box p {
  font-size: 21px;
  color: var(--warm-gray-600);
  line-height: 1.85;
  margin-bottom: 0;
}
.summary-box .cta-text {
  display: block;
  margin-top: 14px;
  font-weight: 600;
  color: var(--ink);
  font-size: 22px;
}

/* Concept box (ai-not-perfect) */
.concept-box {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 8px;
  padding: 24px 28px;
  margin: 20px 0 28px;
}
.concept-box-title {
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}
.concept-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.concept-box ul li {
  padding: 6px 0;
  font-size: 21px;
  color: var(--warm-gray-600);
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.7;
}
.concept-box ul li::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--shu);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  top: 6px;
}
.concept-box.good {
  border-left: 4px solid var(--teal);
}
.concept-box.bad {
  border-left: 4px solid #EA4335;
}
.concept-box.warning {
  border-left: 4px solid var(--violet);
}

/* Code blocks (base) */
.welcome-section pre {
  background: var(--warm-gray-50);
  border: 1px solid var(--warm-gray-100);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 16px 0 24px;
  overflow-x: auto;
  font-size: 18px;
  line-height: 1.7;
}
.welcome-section pre code {
  font-family: 'SFMono-Regular', 'SF Mono', 'Consolas', 'Liberation Mono', 'Menlo', 'Monaco', monospace;
  font-size: 18px;
  color: var(--warm-gray-700);
  background: none;
  padding: 0;
}

/* Unordered / ordered lists in article */
.welcome-section ul {
  list-style: none;
  margin: 12px 0 20px;
}
.welcome-section ul li {
  padding: 6px 0;
  font-size: 21px;
  color: var(--warm-gray-600);
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.7;
}
.welcome-section ul li::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--shu);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  top: 6px;
}
.welcome-section ol {
  margin: 12px 0 28px;
  padding-left: 28px;
}
.welcome-section ol li {
  padding: 6px 0;
  font-size: 21px;
  color: var(--warm-gray-600);
  line-height: 1.9;
}

/* Section reveal */
.rv {
  opacity: 0; transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}
.rv.vis { opacity: 1; transform: translateY(0); }

@keyframes up { to { opacity: 1; transform: translateY(0); } }

/* ===== ENHANCED ARTICLE STYLES ===== */

/* --- Pull Quotes --- */
.pull-quote {
  position: relative;
  margin: 40px 0;
  padding: 32px 36px 32px 40px;
  border-left: 4px solid var(--g-blue);
  background: linear-gradient(135deg, rgba(66,133,244,.03) 0%, rgba(52,168,83,.03) 100%);
  border-radius: 0 12px 12px 0;
}
.pull-quote::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: 12px;
  font-family: Georgia, serif;
  font-size: 72px;
  color: var(--g-blue);
  opacity: .2;
  line-height: 1;
}
.pull-quote p {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
  letter-spacing: .02em;
}
.pull-quote .pq-author {
  display: block;
  margin-top: 12px;
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 400;
  color: var(--warm-gray-400);
  letter-spacing: .05em;
}
.pull-quote .pq-sub {
  display: block;
  margin-top: 10px;
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: 400;
  color: var(--warm-gray-500);
  letter-spacing: .03em;
}

/* --- Callout Boxes --- */
.callout {
  position: relative;
  margin: 24px 0;
  padding: 20px 24px 20px 56px;
  border-radius: 8px;
  border-left: 4px solid;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .5s ease, transform .5s ease;
}
.callout.vis {
  opacity: 1;
  transform: translateX(0);
}
.callout-icon {
  position: absolute;
  left: 18px;
  top: 20px;
  font-size: 22px;
  line-height: 1;
}
.callout-title {
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}
.callout p, .callout ul {
  font-size: 20px;
  line-height: 1.8;
  margin-bottom: 0;
}
.callout ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.callout ul li {
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
  color: var(--warm-gray-600);
}
.callout ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .4;
}
.callout.tip {
  background: rgba(66,133,244,.05);
  border-left-color: var(--g-blue);
}
.callout.tip .callout-title { color: var(--g-blue); }
.callout.warning {
  background: rgba(251,188,5,.08);
  border-left-color: var(--g-yellow);
}
.callout.warning .callout-title { color: #e8a600; }
.callout.success {
  background: rgba(52,168,83,.05);
  border-left-color: var(--g-green);
}
.callout.success .callout-title { color: var(--g-green); }
.callout.danger {
  background: rgba(234,67,53,.05);
  border-left-color: var(--g-red);
}
.callout.danger .callout-title { color: var(--g-red); }
.callout.key {
  background: rgba(123,97,255,.05);
  border-left-color: var(--g-purple);
}
.callout.key .callout-title { color: var(--g-purple); }
.callout.info {
  background: rgba(123,97,255,.05);
  border-left-color: var(--g-purple);
}
.callout.info .callout-title { color: var(--g-purple); }

/* --- Before/After Comparison Cards --- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 28px 0 36px;
}
.compare-card {
  border-radius: 12px;
  padding: 24px;
  border: 1px solid;
  transition: transform .25s ease, box-shadow .25s ease;
}
.compare-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.compare-card.bad,
.compare-card.compare-bad {
  background: rgba(234,67,53,.03);
  border-color: rgba(234,67,53,.2);
}
.compare-card.good,
.compare-card.compare-good {
  background: rgba(52,168,83,.03);
  border-color: rgba(52,168,83,.2);
}
.compare-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-jp);
  font-size: 15px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.compare-card.bad .compare-label,
.compare-card.compare-bad .compare-label {
  background: rgba(234,67,53,.1);
  color: var(--g-red);
}
.compare-card.good .compare-label,
.compare-card.compare-good .compare-label {
  background: rgba(52,168,83,.1);
  color: var(--g-green);
}
.compare-card h4,
.compare-card h3 {
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.4;
}
.compare-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.compare-card ul li {
  font-size: 19px;
  color: var(--warm-gray-600);
  line-height: 1.7;
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
}
.compare-card.bad ul li::before,
.compare-card.compare-bad ul li::before {
  content: '\2715';
  position: absolute;
  left: 0;
  color: var(--g-red);
  font-size: 14px;
  top: 7px;
}
.compare-card.good ul li::before,
.compare-card.compare-good ul li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--g-green);
  font-weight: bold;
  font-size: 14px;
  top: 7px;
}
.compare-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--warm-gray-300);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 0 -9px;
  position: relative;
  z-index: 1;
}

/* --- Compare Card Extended Styles --- */
.compare-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.compare-icon {
  font-size: 28px;
  line-height: 1;
}
.compare-header h3 {
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}
.compare-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.compare-result {
  display: block;
  font-size: 14px;
  color: var(--warm-gray-400, #999);
  margin-top: 2px;
  padding-left: 0;
}

/* --- Animated Step Timeline --- */
.step-timeline {
  position: relative;
  margin: 32px 0 40px;
  padding-left: 48px;
}
.step-timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--warm-gray-200);
}
.tl-step {
  position: relative;
  margin-bottom: 32px;
  padding: 24px 28px;
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity .5s ease, transform .5s ease, box-shadow .25s ease;
}
.tl-step.vis {
  opacity: 1;
  transform: translateX(0);
}
.tl-step:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.05);
}
.tl-step:last-child {
  margin-bottom: 0;
}
.tl-dot {
  position: absolute;
  left: -37px;
  top: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.tl-dot.c-blue { background: var(--g-blue); }
.tl-dot.c-red { background: var(--g-red); }
.tl-dot.c-yellow { background: var(--g-yellow); color: var(--ink); }
.tl-dot.c-green { background: var(--g-green); }
.tl-dot.c-purple { background: var(--g-purple); }
.tl-step .tl-time {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-gray-400);
  background: var(--warm-gray-50);
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.tl-step h3 {
  font-family: var(--font-jp);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  margin-top: 0;
  line-height: 1.4;
}
.tl-step p {
  font-size: 20px;
  color: var(--warm-gray-600);
  line-height: 1.8;
  margin-bottom: 0;
}
.tl-step .tl-emoji {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}

/* --- Code Block with Copy Button --- */
.code-block {
  position: relative;
  margin: 16px 0 28px;
  border-radius: 10px;
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #2d2d2d;
  border-bottom: 1px solid #3a3a3a;
}
.code-block-label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: #999;
  letter-spacing: .04em;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 4px 12px;
  font-family: var(--font-jp);
  font-size: 13px;
  color: #bbb;
  cursor: pointer;
  transition: all .2s ease;
}
.copy-btn:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.copy-btn.copied {
  background: rgba(52,168,83,.2);
  border-color: rgba(52,168,83,.3);
  color: var(--g-green);
}
.code-block pre {
  margin: 0;
  padding: 20px 22px;
  background: #1e1e1e;
  border: none;
  border-radius: 0;
  overflow-x: auto;
  font-size: 17px;
  line-height: 1.7;
}
.code-block pre code {
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 17px;
  color: #e0e0e0;
}
.code-block pre code .cm-comment { color: #6a9955; }
.code-block pre code .cm-string { color: #ce9178; }
.code-block pre code .cm-keyword { color: #569cd6; }

/* --- Reason Cards --- */
.reason-cards,
.reason-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 28px 0 36px;
}
.reason-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.reason-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
}
.reason-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.reason-icon.ri-1 { background: rgba(66,133,244,.1); }
.reason-icon.ri-2 { background: rgba(234,67,53,.1); }
.reason-icon.ri-3 { background: rgba(52,168,83,.1); }
.reason-num {
  font-family: var(--font-sans, 'DM Sans', sans-serif);
  font-size: 12px;
  font-weight: 600;
  color: var(--shu, #1a5276);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.reason-card > h3 {
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}
.reason-card > p {
  font-size: 15px;
  color: var(--warm-gray-500, #777);
  line-height: 1.8;
  margin: 0;
}
.reason-body h3 {
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px 0;
  line-height: 1.4;
}
.reason-body p {
  font-size: 19px;
  color: var(--warm-gray-500);
  line-height: 1.8;
  margin: 0;
}

/* --- Tables --- */
.table-wrap {
  margin: 24px 0 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-jp);
  font-size: 15px;
}
.table-wrap thead th {
  background: var(--g-blue);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
  text-align: left;
  letter-spacing: .03em;
}
.table-wrap thead th:first-child {
  border-radius: 8px 0 0 0;
}
.table-wrap thead th:last-child {
  border-radius: 0 8px 0 0;
}
.table-wrap tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--warm-gray-100);
  color: var(--ink);
  line-height: 1.6;
}
.table-wrap tbody tr:nth-child(even) {
  background: var(--warm-gray-50);
}
.table-wrap tbody tr:hover {
  background: rgba(66,133,244,.05);
}
.table-wrap tbody tr:last-child td {
  border-bottom: none;
}
.table-wrap tbody td strong {
  color: var(--g-red);
}
@media (max-width: 600px) {
  .table-wrap thead th,
  .table-wrap tbody td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* --- Ranking List --- */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 28px 0 36px;
}
.ranking-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 14px;
  padding: 22px 26px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.ranking-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
.ranking-medal {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 12px;
  background: var(--warm-gray-100);
}
.ranking-1st .ranking-medal {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  box-shadow: 0 3px 12px rgba(255,165,0,.3);
}
.ranking-2nd .ranking-medal {
  background: linear-gradient(135deg, #E0E0E0, #B0B0B0);
  box-shadow: 0 3px 12px rgba(160,160,160,.3);
}
.ranking-3rd .ranking-medal {
  background: linear-gradient(135deg, #E8A06C, #CD7F32);
  box-shadow: 0 3px 12px rgba(205,127,50,.3);
}
.ranking-1st .ranking-medal .ranking-num,
.ranking-2nd .ranking-medal .ranking-num,
.ranking-3rd .ranking-medal .ranking-num {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.ranking-medal-plain {
  background: var(--warm-gray-50) !important;
  border: 2px solid var(--warm-gray-200);
  box-shadow: none !important;
}
.ranking-medal-plain .ranking-num {
  color: var(--warm-gray-500);
}
.ranking-num {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--warm-gray-500);
}
.ranking-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: inherit;
}
.ranking-1st .ranking-label,
.ranking-2nd .ranking-label,
.ranking-3rd .ranking-label {
  color: rgba(255,255,255,.85);
}
.ranking-medal-plain .ranking-label {
  color: var(--warm-gray-400);
}
.ranking-body {
  flex: 1;
  min-width: 0;
}
.ranking-title {
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 6px;
}
.ranking-effect {
  margin-bottom: 8px;
}
.ranking-effect-badge {
  display: inline-block;
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: .02em;
}
.effect-high {
  background: rgba(234,67,53,.1);
  color: #d93025;
}
.effect-mid {
  background: rgba(66,133,244,.1);
  color: #1a73e8;
}
.effect-low {
  background: rgba(52,168,83,.1);
  color: #1e8e3e;
}
.ranking-desc {
  font-size: 14px;
  color: var(--warm-gray-500);
  line-height: 1.7;
}
.ranking-1st {
  border-left: 4px solid #FFD700;
}
.ranking-2nd {
  border-left: 4px solid #B0B0B0;
}
.ranking-3rd {
  border-left: 4px solid #CD7F32;
}
@media (max-width: 600px) {
  .ranking-item {
    gap: 14px;
    padding: 18px 16px;
  }
  .ranking-medal {
    width: 44px;
    height: 44px;
    padding-top: 9px;
  }
  .ranking-num {
    font-size: 20px;
  }
  .ranking-label {
    font-size: 10px;
  }
  .ranking-title {
    font-size: 16px;
  }
}

/* --- Mindset Cards --- */
.mindset-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 28px 0 36px;
}

/* --- Progress / Score Bars --- */
.score-bars {
  margin: 28px 0 36px;
}
.score-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.score-label {
  font-family: var(--font-jp);
  font-size: 17px;
  font-weight: 600;
  color: var(--warm-gray-600);
  min-width: 60px;
  text-align: right;
}
.score-track {
  flex: 1;
  height: 32px;
  background: var(--warm-gray-50);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--warm-gray-100);
}
.score-fill {
  height: 100%;
  border-radius: 16px;
  width: 0;
  transition: width 1.2s cubic-bezier(.25,.46,.45,.94);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  position: relative;
}
.score-fill.animated {
  /* width set by JS */
}
.score-fill.c-blue { background: linear-gradient(90deg, rgba(66,133,244,.7), var(--g-blue)); }
.score-fill.c-red { background: linear-gradient(90deg, rgba(234,67,53,.7), var(--g-red)); }
.score-fill.c-yellow { background: linear-gradient(90deg, rgba(251,188,5,.7), var(--g-yellow)); }
.score-fill.c-green { background: linear-gradient(90deg, rgba(52,168,83,.7), var(--g-green)); }
.score-fill.c-purple { background: linear-gradient(90deg, rgba(123,97,255,.7), var(--g-purple)); }
.score-value {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
  white-space: nowrap;
}
.score-row:last-child .score-label {
  color: var(--ink);
}
.score-badge {
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 600;
  color: var(--g-green);
  background: rgba(52,168,83,.1);
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: 8px;
  white-space: nowrap;
}

/* --- Accordion FAQ --- */
.faq-list {
  margin: 28px 0 36px;
}
.faq-item {
  border: 1px solid var(--warm-gray-100);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.faq-item:hover {
  border-color: var(--warm-gray-200);
}
.faq-item.open {
  border-color: rgba(66,133,244,.3);
  box-shadow: 0 2px 12px rgba(66,133,244,.06);
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 22px;
  background: var(--white);
  border: none;
  cursor: pointer;
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  line-height: 1.5;
  gap: 16px;
  transition: background .15s ease;
}
.faq-question:hover {
  background: var(--warm-gray-50);
}
.faq-q-label {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--g-blue);
  margin-right: 10px;
  flex-shrink: 0;
}
.faq-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--warm-gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .3s ease, background .2s ease;
}
.faq-item.open .faq-toggle {
  transform: rotate(45deg);
  background: rgba(66,133,244,.1);
}
.faq-toggle::before {
  content: '+';
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  color: var(--warm-gray-400);
  line-height: 1;
}
.faq-item.open .faq-toggle::before {
  color: var(--g-blue);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1);
}
.faq-item.open .faq-answer {
  max-height: 2000px;
}
.faq-answer-inner {
  padding: 0 22px 20px;
  border-top: 1px solid var(--warm-gray-100);
}
.faq-answer-inner p {
  font-size: 19px;
  color: var(--warm-gray-600);
  line-height: 1.85;
  margin-top: 16px;
  margin-bottom: 0;
}

/* --- Key Takeaway Box --- */
.takeaway-box {
  position: relative;
  margin: 36px 0;
  padding: 32px;
  border-radius: 14px;
  background: var(--white);
  border: 2px solid transparent;
  background-clip: padding-box;
  overflow: hidden;
}
.takeaway-box::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--g-blue), var(--g-red), var(--g-yellow), var(--g-green));
  z-index: -1;
}
.takeaway-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: var(--white);
  z-index: -1;
}
.takeaway-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.takeaway-header h3 {
  font-family: var(--font-jp);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}
.takeaway-icon {
  font-size: 26px;
}
.takeaway-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.takeaway-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 20px;
  color: var(--warm-gray-600);
  line-height: 1.7;
}
.takeaway-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--g-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
  opacity: 0;
  transform: scale(0);
  transition: opacity .4s ease, transform .4s cubic-bezier(.34,1.56,.64,1);
}
.takeaway-check.vis {
  opacity: 1;
  transform: scale(1);
}
.takeaway-check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--white);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Image Frame --- */
.image-frame {
  margin: 28px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--warm-gray-200);
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  position: relative;
  background: var(--warm-gray-50);
}
.image-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.image-frame-caption {
  padding: 12px 18px;
  font-family: var(--font-jp);
  font-size: 15px;
  color: var(--warm-gray-500);
  text-align: center;
  background: var(--warm-gray-50);
  border-top: 1px solid var(--warm-gray-100);
}

/* --- Image Frames (alt) --- */
.img-frame {
  margin: 24px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--warm-gray-100);
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  transition: box-shadow .3s ease, transform .3s ease;
}
.img-frame:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  transform: translateY(-2px);
}
.img-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.img-caption {
  padding: 10px 16px;
  background: var(--warm-gray-50);
  font-size: 15px;
  color: var(--warm-gray-500);
  text-align: center;
  border-top: 1px solid var(--warm-gray-100);
}

/* --- Article Images (cursor-install) --- */
.article-image {
  margin: 28px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--warm-gray-100);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  transition: transform .3s ease, box-shadow .3s ease;
}
.article-image:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,.1);
}
.article-image img {
  width: 100%;
  height: auto;
  display: block;
}
.article-image figcaption {
  font-size: 16px;
  color: var(--warm-gray-400);
  text-align: center;
  padding: 12px 16px;
  background: var(--warm-gray-50);
  font-style: italic;
}

/* --- Quote Cards --- */
.quote-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 28px 0 36px;
}
.quote-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  padding: 24px 28px;
  border-left: 4px solid var(--g-purple);
  transition: opacity .5s ease, transform .5s ease, box-shadow .25s ease;
  opacity: 0;
  transform: translateX(-12px);
}
.quote-card.vis {
  opacity: 1;
  transform: translateX(0);
}
.quote-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
}
.quote-card .qc-speech {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 500;
  color: var(--g-purple);
  line-height: 1.6;
  margin-bottom: 10px;
}
.quote-card .qc-explain {
  font-size: 19px;
  color: var(--warm-gray-500);
  line-height: 1.8;
  margin: 0;
  padding-left: 16px;
  border-left: 2px solid var(--warm-gray-200);
}

/* --- Key Point Cards --- */
.key-point-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0 36px;
}
.key-point-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  padding: 22px 20px;
  border-top: 3px solid;
  transition: transform .25s ease, box-shadow .25s ease;
}
.key-point-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
}
.key-point-card:nth-child(1) { border-top-color: var(--g-blue); }
.key-point-card:nth-child(2) { border-top-color: var(--g-red); }
.key-point-card:nth-child(3) { border-top-color: var(--g-yellow); }
.key-point-card:nth-child(4) { border-top-color: var(--g-green); }
.kp-icon {
  font-size: 30px;
  margin-bottom: 10px;
}
.key-point-card h4 {
  font-family: var(--font-jp);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.4;
}
.key-point-card p {
  font-size: 17px;
  color: var(--warm-gray-500);
  line-height: 1.7;
  margin-bottom: 0;
}

/* --- Completion Box --- */
.completion-box {
  margin: 32px 0;
  padding: 28px 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(52,168,83,.06) 0%, rgba(66,133,244,.04) 100%);
  border: 2px solid rgba(52,168,83,.25);
  text-align: center;
}
.completion-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.completion-box h3 {
  font-family: var(--font-jp);
  font-size: 24px;
  font-weight: 700;
  color: var(--g-green);
  margin-bottom: 8px;
}
.completion-box p {
  font-size: 20px;
  color: var(--warm-gray-600);
  line-height: 1.8;
  margin-bottom: 0;
}

/* --- Next Step Card --- */
.next-step-card {
  margin: 32px 0;
  padding: 28px 32px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  box-shadow: 0 4px 16px rgba(66,133,244,.08);
  transition: transform .25s ease, box-shadow .25s ease;
}
.next-step-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(66,133,244,.12);
}
.next-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.next-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--g-blue);
  background: rgba(66,133,244,.1);
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: .04em;
}
.next-step-card h3 {
  font-family: var(--font-jp);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px 0;
  line-height: 1.4;
}
.next-step-card ol {
  margin: 0 0 0 24px;
  padding: 0;
}
.next-step-card ol li {
  padding: 6px 0;
  font-size: 20px;
  color: var(--warm-gray-600);
  line-height: 1.7;
}

/* --- Keyboard Shortcut Cards --- */
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 28px 0 36px;
}
.shortcut-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  padding: 20px 24px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .2s ease;
  opacity: 0;
  transform: translateY(12px);
}
.shortcut-card.vis {
  opacity: 1;
  transform: translateY(0);
}
.shortcut-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
  border-color: var(--warm-gray-200);
}
.shortcut-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--shu);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.shortcut-keys {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 6px 12px;
  background: linear-gradient(180deg, #fafafa 0%, #e8e8e8 100%);
  border: 1px solid #d0d0d0;
  border-bottom: 3px solid #b8b8b8;
  border-radius: 6px;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  white-space: nowrap;
}
.kbd-plus {
  font-size: 14px;
  color: var(--warm-gray-400);
  font-weight: 400;
}
.shortcut-body {
  flex: 1;
  min-width: 0;
}
.shortcut-body h4 {
  font-family: var(--font-jp);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.4;
}
.shortcut-body p {
  font-size: 17px;
  color: var(--warm-gray-500);
  line-height: 1.6;
  margin: 0;
}
.shortcut-win {
  font-size: 14px;
  color: var(--warm-gray-400);
  display: block;
  margin-top: 2px;
}

/* --- Phrase Cards --- */
.phrase-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 28px 0 36px;
}
.phrase-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .2s ease;
  cursor: default;
  opacity: 0;
  transform: translateX(-12px);
}
.phrase-card.vis {
  opacity: 1;
  transform: translateX(0);
}
.phrase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-color: rgba(66,133,244,.3);
}
.phrase-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.phrase-icon.pi-1 { background: rgba(66,133,244,.1); }
.phrase-icon.pi-2 { background: rgba(234,67,53,.1); }
.phrase-icon.pi-3 { background: rgba(52,168,83,.1); }
.phrase-icon.pi-4 { background: rgba(251,188,5,.1); }
.phrase-icon.pi-5 { background: rgba(123,97,255,.1); }
.phrase-body h4 {
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.4;
}
.phrase-body p {
  font-size: 18px;
  color: var(--warm-gray-500);
  line-height: 1.7;
  margin: 0;
}
.phrase-example {
  display: inline-block;
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 600;
  color: var(--shu);
  background: rgba(66,133,244,.06);
  padding: 2px 10px;
  border-radius: 6px;
  margin-top: 6px;
}

/* --- Feature Cards Grid (feat-card) --- */
.feature-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0 36px;
}
.feat-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  padding: 24px 22px;
  transition: opacity .5s ease, transform .5s ease, box-shadow .25s ease, border-color .25s ease;
  opacity: 0;
  transform: translateY(16px);
}
.feat-card.vis {
  opacity: 1;
  transform: translateY(0);
}
.feat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-color: var(--warm-gray-200);
}
.feat-card-icon {
  font-size: 36px;
  margin-bottom: 14px;
  display: block;
}
.feat-card h3 {
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px 0;
  line-height: 1.4;
}
.feat-card p {
  font-size: 18px;
  color: var(--warm-gray-500);
  line-height: 1.7;
  margin: 0;
}

/* --- Recommend Person Cards --- */
.recommend-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 28px 0 36px;
}
.rec-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .5s ease, transform .5s ease, box-shadow .25s ease;
}
.rec-card.vis {
  opacity: 1;
  transform: translateX(0);
}
.rec-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  transform: translateY(-2px);
}
.rec-card:nth-child(1) { border-left-color: var(--shu); }
.rec-card:nth-child(2) { border-left-color: #EA4335; }
.rec-card:nth-child(3) { border-left-color: var(--violet); }
.rec-card:nth-child(4) { border-left-color: var(--teal); }
.rec-card:nth-child(5) { border-left-color: #7B61FF; }
.rec-card-icon {
  font-size: 30px;
  flex-shrink: 0;
}
.rec-card-text {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.5;
}

/* --- CTA Button --- */
.cta-btn {
  display: inline-block;
  background: var(--shu);
  color: var(--white);
  padding: 18px 44px;
  text-decoration: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-jp);
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.cta-btn:hover {
  background: var(--shu-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(66, 133, 244, 0.5);
  color: var(--white);
}
.cta-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  transition: left .5s ease;
}
.cta-btn:hover::after {
  left: 100%;
}
.cta-center {
  text-align: center;
  margin: 36px 0;
}

/* Reference links */
.ref-links {
  margin: 16px 0 28px;
  list-style: none;
}
.ref-links li {
  padding: 4px 0;
  font-size: 20px;
  color: var(--warm-gray-600);
  line-height: 1.7;
}
.ref-links li a {
  color: var(--shu);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ref-links li a:hover {
  color: var(--shu-light);
}

/* --- Stagger animation for grouped items --- */
.stagger-1 { transition-delay: .05s; }
.stagger-2 { transition-delay: .1s; }
.stagger-3 { transition-delay: .15s; }
.stagger-4 { transition-delay: .2s; }
.stagger-5 { transition-delay: .25s; }
.stagger-6 { transition-delay: .3s; }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--warm-gray-100);
  padding: 24px 32px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--warm-gray-300);
  margin-top: 20px;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9000;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--g-blue);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(66,133,244,.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease, background .2s ease;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: #3367d6;
  box-shadow: 0 4px 16px rgba(66,133,244,.45);
}

/* ===== SIDEBAR SEARCH ===== */
.sidebar-search {
  position: relative;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}
.sidebar-search-input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  font-family: var(--font-jp);
  font-size: 13px;
  border: 1px solid var(--warm-gray-200);
  border-radius: 6px;
  outline: none;
  background: var(--warm-gray-50);
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.sidebar-search-input:focus {
  border-color: var(--g-blue);
  box-shadow: 0 0 0 2px rgba(66,133,244,.15);
  background: var(--white);
}
.sidebar-search-input::placeholder {
  color: var(--warm-gray-400);
}
.sidebar-search-clear {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--warm-gray-400);
  padding: 2px 4px;
  line-height: 1;
  transition: color .15s;
}
.sidebar-search-clear:hover {
  color: var(--ink);
}

/* ===== SUBCATEGORY STYLES ===== */
.nav-links-subcats {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1);
}
.nav-cat.open .nav-links-subcats {
  max-height: 3000px;
}
.nav-subcat {
  margin-bottom: 1px;
}
.nav-subcat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 18px 7px 28px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-gray-600);
  text-align: left;
  line-height: 1.4;
  transition: background .15s ease, color .15s ease;
  border-left: 2px solid transparent;
}
.nav-subcat-toggle:hover {
  background: var(--warm-gray-50);
  color: var(--ink);
}
.nav-subcat-toggle .chevron {
  font-size: 11px;
  color: var(--warm-gray-300);
  transition: transform .25s ease;
  flex-shrink: 0;
  margin-left: 4px;
}
.nav-subcat.open .nav-subcat-toggle .chevron {
  transform: rotate(90deg);
}
.nav-subcat.open .nav-subcat-toggle {
  border-left-color: var(--g-green);
  color: var(--ink);
}
.nav-links-sub {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.4,0,.2,1);
}
.nav-subcat.open .nav-links-sub {
  max-height: 1200px;
}
.nav-links-sub .nav-link-item a {
  padding-left: 16px !important;
  font-size: 15px;
}

/* ===== CATEGORY PROGRESS BADGE ===== */
.cat-progress-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--warm-gray-400);
  background: var(--warm-gray-50);
  border: 1px solid var(--warm-gray-200);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: auto;
  margin-right: 6px;
  flex-shrink: 0;
  line-height: 1.5;
}
.nav-subcat-toggle .cat-progress-badge {
  font-size: 10px;
  padding: 0px 6px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show,
  .sidebar-overlay.active {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .hamburger {
    display: flex;
  }
  .article-content {
    padding: 0 24px 60px;
  }
  .global-nav { padding: 10px 20px; }
  .global-nav-brand { display: block; }
  .main-header {
    padding: 8px 20px;
  }
}
@media (max-width: 640px) {
  .article-hero { padding-top: 32px; }
  .article-hero h1 { font-size: 34px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-cards-grid { grid-template-columns: 1fr; }
  .key-point-grid { grid-template-columns: 1fr; }
  .step-card { flex-direction: column; gap: 12px; }
  .article-content { padding: 0 18px 48px; }
  .global-nav { padding: 8px 16px; }
  .main-header { padding: 6px 16px; }
  .welcome-greeting { padding: 20px 20px; }
  .compare-grid { grid-template-columns: 1fr; }
  .reason-cards,
  .reason-grid { grid-template-columns: 1fr; }
  .pull-quote p { font-size: 23px; }
  .step-timeline { padding-left: 40px; }
  .tl-dot { left: -30px; width: 30px; height: 30px; font-size: 14px; }
  .step-timeline::before { left: 14px; }
  .score-row { flex-direction: column; gap: 6px; align-items: stretch; }
  .score-label { text-align: left; min-width: auto; }
  .shortcut-card { flex-direction: column; gap: 12px; align-items: flex-start; }
  .shortcut-keys { order: -1; }
  .phrase-card { flex-direction: column; gap: 10px; }
  .rec-card { flex-direction: column; gap: 10px; align-items: flex-start; }
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* --- Codelabs Style Navigation --- */
.codelabs-nav {
  margin: 80px 0 40px;
  padding-top: 40px;
  border-top: 1px solid var(--warm-gray-100);
}
.codelabs-nav-inner {
  display: flex;
  flex-direction: row;
  gap: 24px;
}
.nav-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.nav-col-prev { align-items: flex-start; }
.nav-col-next { align-items: flex-end; }
.codelabs-nav .nav-label {
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-gray-400);
  margin-bottom: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.nav-next-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding: 24px 32px;
  background: var(--white);
  border: 1px solid var(--warm-gray-200);
  border-radius: 12px;
  min-width: 320px;
  max-width: 100%;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  text-decoration: none !important;
}
.nav-next-btn:hover {
  border-color: var(--g-blue);
  background: rgba(66,133,244,.02);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(66,133,244,.12);
}
.nav-next-btn .next-title {
  font-family: var(--font-jp);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
}
.nav-next-btn .next-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--g-blue);
  letter-spacing: .02em;
}

/* --- Prev Button (mirror of next) --- */
.nav-prev-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 32px;
  border: 1px solid var(--warm-gray-100);
  border-radius: 16px;
  background: #fff;
  transition: all .3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  text-decoration: none !important;
}
.nav-prev-btn:hover {
  border-color: var(--g-blue);
  background: rgba(66,133,244,.02);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(66,133,244,.12);
}
.nav-prev-btn .prev-title {
  font-family: var(--font-jp);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 8px;
  line-height: 1.4;
}
.nav-prev-btn .prev-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--g-blue);
  letter-spacing: .02em;
}

/* --- Prev/Next Mobile --- */
@media (max-width: 768px) {
  .codelabs-nav-inner {
    flex-direction: column;
  }
  .nav-prev-btn .prev-title,
  .nav-next-btn .next-title {
    font-size: 18px;
  }
}

/* Sidebar Read Check */
.read-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-size: 12px;
  color: var(--g-green);
  opacity: .8;
}
.nav-link-item a {
  display: flex;
  align-items: center;
}

/* --- Dashboard Styles --- */
.db-hero {
  padding: 60px 0 40px;
  text-align: center;
}
.db-hero h1 {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
}

/* Latest Articles Section */
.db-new-section {
  margin-bottom: 48px;
}
.db-section-header {
  margin-bottom: 20px;
}
.db-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.db-new-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.db-new-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  transition: all .2s ease;
  text-decoration: none !important;
}
.db-new-card:hover {
  border-color: var(--g-blue);
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
  transform: translateY(-2px);
}
.db-new-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: var(--g-red);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  letter-spacing: .05em;
}
.db-new-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.4;
}
.db-new-card p {
  font-size: 13px;
  color: var(--warm-gray-500);
  margin: 0;
  line-height: 1.5;
}

.db-progress-container {
  max-width: 600px;
  margin: 0 auto 40px;
  background: var(--warm-gray-50);
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--warm-gray-100);
}
.db-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.db-progress-text {
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 600;
  color: var(--warm-gray-500);
}
.db-progress-pct {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 700;
  color: var(--g-blue);
}
.db-progress-bar-bg {
  height: 12px;
  background: var(--warm-gray-200);
  border-radius: 6px;
  overflow: hidden;
}
.db-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--g-blue), var(--g-purple));
  width: 0%;
  transition: width 1.5s cubic-bezier(.25,.46,.45,.94);
  border-radius: 6px;
}

.db-steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 60px;
}
.db-step-card {
  display: flex;
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 20px;
  overflow: hidden;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  text-decoration: none !important;
}
.db-step-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.08);
  border-color: var(--g-blue);
}
.db-step-num {
  width: 100px;
  background: var(--warm-gray-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  border-right: 1px solid var(--warm-gray-100);
  transition: background .3s;
}
.db-step-card:hover .db-step-num {
  background: rgba(66,133,244,.05);
}
.db-step-num .step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--warm-gray-400);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.db-step-num .step-val {
  font-size: 40px;
  font-weight: 800;
  color: var(--warm-gray-300);
  line-height: 1;
}
.db-step-card:hover .step-val {
  color: var(--g-blue);
}
.db-step-content {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.db-step-cat {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--g-blue);
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.db-step-title {
  font-family: var(--font-jp);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.4;
}
.db-step-desc {
  font-size: 18px;
  color: var(--warm-gray-500);
  line-height: 1.6;
  margin: 0;
}
.db-step-arrow {
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-gray-200);
  transition: all .3s;
}
.db-step-card:hover .db-step-arrow {
  color: var(--g-blue);
  transform: translateX(4px);
}

.db-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}
.db-quick-card {
  padding: 24px;
  background: var(--warm-gray-50);
  border-radius: 16px;
  text-align: center;
  transition: all .2s;
}
.db-quick-card:hover {
  background: var(--white);
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
}
.db-quick-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}
.db-quick-title {
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 768px) {
  .db-quick-grid { grid-template-columns: 1fr; }
  .db-new-grid { grid-template-columns: 1fr; }
  .db-hero h1 { font-size: 32px; }
  .db-progress-container { padding: 20px; }
  .db-step-num { width: 70px; }
  .db-step-val { font-size: 30px; }
  .db-step-content { padding: 20px; }
  .db-step-arrow { width: 50px; }
}

/* ===== PREREQUISITE BANNER ===== */
.prereq-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #EFF6FF;
  border-left: 4px solid #3B82F6;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.prereq-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.prereq-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 1.6;
  color: var(--warm-gray-700);
}
.prereq-text strong {
  font-size: 15px;
  color: var(--ink);
}
.prereq-text a {
  color: #2563EB;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prereq-text a:hover {
  color: #1D4ED8;
}

/* ===== WEEKLY TIPS SECTION (Dashboard) ===== */
.db-tips-section {
  margin-bottom: 48px;
}
.db-tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.db-tips-card {
  background: var(--white);
  border: 1px solid var(--warm-gray-100);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  transition: all .2s ease;
}
.db-tips-card:hover {
  border-color: #FFC107;
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
  transform: translateY(-2px);
}
.db-tips-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #333;
  background: #FFC107;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 8px;
  letter-spacing: .5px;
}
.db-tips-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.4;
}
.db-tips-card p {
  font-size: 13px;
  color: var(--warm-gray-500);
  margin: 0;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .db-tips-grid { grid-template-columns: 1fr; }
}

/* ===== QUIZ SECTION ===== */
.quiz-section {
  max-width: 100%;
}
.quiz-section h2 {
  margin-bottom: 24px;
}
.quiz-card {
  background: var(--warm-gray-50);
  border: 1px solid var(--warm-gray-100);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
.quiz-question {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.5;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 400;
  color: var(--warm-gray-700);
  background: var(--white);
  border: 1.5px solid var(--warm-gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s ease;
  line-height: 1.5;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--g-blue);
  background: rgba(66,133,244,.04);
  color: var(--ink);
}
.quiz-option:disabled {
  cursor: default;
  opacity: .7;
}
.quiz-option.correct {
  border-color: var(--g-green);
  background: rgba(52,168,83,.08);
  color: var(--ink);
  font-weight: 500;
  opacity: 1;
}
.quiz-option.incorrect {
  border-color: var(--g-red);
  background: rgba(234,67,53,.08);
  color: var(--g-red);
  opacity: 1;
}
.quiz-result {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  min-height: 24px;
}
.quiz-result-correct {
  color: var(--g-green);
}
.quiz-result-incorrect {
  color: var(--g-red);
}

/* ===== DIAGNOSTIC TEST ===== */
.diag-progress {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  padding: 14px 0 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--warm-gray-100);
}
.diag-progress span {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  color: var(--warm-gray-500);
}
.diag-progress-bg {
  height: 8px;
  background: var(--warm-gray-100);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}
.diag-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1a5276, #34A853);
  border-radius: 4px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
/* Question Card */
.diag-q-card {
  background: var(--white);
  border: 2px solid var(--warm-gray-100);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
  transition: border-color .3s, box-shadow .3s;
}
.diag-q-card:has(.diag-option.selected) {
  border-color: rgba(66,133,244,.3);
  box-shadow: 0 4px 20px rgba(66,133,244,.08);
}
.diag-q-head {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 16px;
}
.diag-q-num {
  font-family: var(--font-en);
  font-size: 32px;
  font-weight: 800;
  color: var(--g-blue);
  line-height: 1;
}
.diag-q-of {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-gray-300);
}
.diag-q-text {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 24px;
}
/* Option Buttons - Card style with ABC label */
.diag-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.diag-option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 18px 22px;
  font-family: var(--font-jp);
  font-size: 16px;
  color: var(--warm-gray-700);
  background: var(--white);
  border: 2px solid var(--warm-gray-150, #e8e8e8);
  border-radius: 14px;
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  line-height: 1.6;
  position: relative;
}
.diag-abc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: var(--warm-gray-50);
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 700;
  color: var(--warm-gray-400);
  transition: all .25s;
}
.diag-opt-text {
  flex: 1;
}
.diag-check {
  display: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--g-blue);
  margin-left: auto;
}
.diag-option:hover {
  border-color: var(--g-blue);
  background: rgba(66,133,244,.03);
  transform: translateX(4px);
}
.diag-option:hover .diag-abc {
  background: rgba(66,133,244,.1);
  color: var(--g-blue);
}
.diag-option.selected {
  border-color: var(--g-blue);
  background: rgba(66,133,244,.06);
  color: var(--ink);
  box-shadow: 0 2px 12px rgba(66,133,244,.12);
}
.diag-option.selected .diag-abc {
  background: var(--g-blue);
  color: var(--white);
}
.diag-option.selected .diag-check {
  display: block;
}
/* Submit */
.diag-submit-wrap {
  text-align: center;
  padding: 40px 0;
}
.diag-submit-btn {
  display: inline-block;
  padding: 20px 72px;
  font-family: var(--font-jp);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--white);
  background: linear-gradient(135deg, #1a5276, #143d54);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 6px 24px rgba(66,133,244,.3);
}
.diag-submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(66,133,244,.4);
}
.diag-submit-btn:active {
  transform: translateY(-1px);
}
/* Result */
.diag-result {
  margin-top: 16px;
  animation: diagFadeIn .7s cubic-bezier(.4,0,.2,1);
}
@keyframes diagFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.diag-result-inner {
  text-align: center;
  padding: 48px 24px;
}
.diag-score-circle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  border: 8px solid var(--g-blue);
  border-radius: 50%;
  margin-bottom: 28px;
  background: var(--white);
  box-shadow: 0 8px 40px rgba(66,133,244,.15);
}
.diag-score-emoji {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 2px;
}
.diag-score-num {
  font-family: var(--font-en);
  font-size: 60px;
  font-weight: 800;
  line-height: 1;
  color: var(--g-blue);
}
.diag-score-unit {
  font-size: 16px;
  color: var(--warm-gray-500);
  margin-top: 4px;
  font-weight: 500;
}
.diag-level-label {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}
.diag-level-msg {
  font-size: 17px;
  color: var(--warm-gray-600);
  line-height: 1.9;
  max-width: 540px;
  margin: 0 auto 36px;
}
.diag-result-box {
  background: linear-gradient(135deg, rgba(66,133,244,.04) 0%, rgba(52,168,83,.04) 100%);
  border: 1px solid rgba(66,133,244,.12);
  border-radius: 20px;
  padding: 32px 36px;
  text-align: left;
  max-width: 580px;
  margin: 0 auto 32px;
}
.diag-result-box h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.diag-result-box p {
  font-size: 15px;
  color: var(--warm-gray-700);
  line-height: 1.9;
  margin-bottom: 8px;
}
.diag-recommend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.diag-rec-link {
  display: inline-block;
  padding: 14px 28px;
  background: var(--white);
  border: 2px solid var(--warm-gray-200);
  border-radius: 12px;
  color: var(--g-blue);
  font-weight: 600;
  font-size: 15px;
  transition: all .25s;
}
.diag-rec-link:hover {
  background: rgba(66,133,244,.05);
  border-color: var(--g-blue);
  transform: translateX(4px);
}
.diag-retry-btn {
  padding: 14px 36px;
  font-family: var(--font-jp);
  font-size: 15px;
  font-weight: 600;
  color: var(--warm-gray-600);
  background: var(--white);
  border: 2px solid var(--warm-gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all .25s;
}
.diag-retry-btn:hover {
  border-color: var(--warm-gray-400);
  color: var(--ink);
  transform: translateY(-2px);
}
@media (max-width: 768px) {
  .diag-q-card { padding: 24px 20px; }
  .diag-q-num { font-size: 26px; }
  .diag-q-text { font-size: 17px; }
  .diag-option { font-size: 15px; padding: 16px 16px; gap: 12px; }
  .diag-abc { width: 32px; height: 32px; min-width: 32px; font-size: 13px; border-radius: 8px; }
  .diag-submit-btn { padding: 18px 48px; font-size: 18px; }
  .diag-score-circle { width: 160px; height: 160px; border-width: 6px; }
  .diag-score-num { font-size: 48px; }
  .diag-level-label { font-size: 22px; }
  .diag-result-box { padding: 24px 20px; }
}

