:root {
  color-scheme: light;
  --ink: #142033;
  --muted: #5d6b7d;
  --line: #dce5ee;
  --soft: #f4f7fa;
  --paper: #ffffff;
  --blue: #1265e8;
  --blue-dark: #0a3e9b;
  --blue-pale: #eaf2ff;
  --green: #16805c;
  --amber: #a65a00;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(23, 42, 74, 0.09);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #eef3f8; color: var(--ink); line-height: 1.7; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }

.skip-link { position: fixed; left: 12px; top: -80px; z-index: 20; padding: 10px 16px; color: white; background: var(--ink); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.preview-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 32px; background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.preview-actions { display: flex; align-items: center; gap: 16px; }
.preview-actions > a { color: #155bd7; font-weight: 800; font-size: 12px; }
.eyebrow { margin: 0; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.brand-title { margin: 1px 0 0; font-size: 20px; font-weight: 800; }
.pilot-mark { padding: 6px 12px; color: var(--blue-dark); background: var(--blue-pale); border: 1px solid #bad3ff; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: .08em; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1500px; min-height: calc(100vh - 76px); margin: 0 auto; }
.course-sidebar { position: sticky; top: 76px; height: calc(100vh - 76px); overflow-y: auto; padding: 30px 22px; background: #142033; color: white; }
.sidebar-intro { padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.16); }
.sidebar-title { margin: 0 0 6px; font-weight: 800; }
.sidebar-intro p:last-child { margin: 0; color: #bdc9d9; font-size: 13px; }
.lesson-nav { display: grid; gap: 8px; margin-top: 20px; }
.lesson-link { display: grid; gap: 2px; width: 100%; padding: 13px 14px; text-align: left; color: #c4cfdd; background: transparent; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.lesson-link span { font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.lesson-link strong { color: inherit; font-size: 15px; }
.lesson-link:hover { color: white; background: rgba(255,255,255,.07); }
.lesson-link.is-active { color: white; background: var(--blue); border-color: #71a7ff; box-shadow: 0 12px 28px rgba(0,0,0,.2); }
.sidebar-note { display: grid; gap: 5px; margin-top: 28px; padding: 14px; color: #d8e1eb; background: rgba(255,255,255,.07); border-radius: 12px; font-size: 12px; }
.sidebar-note strong { color: white; }

.course-main { min-width: 0; padding: 42px clamp(24px, 5vw, 72px) 80px; }
#app { max-width: 1080px; margin: 0 auto; }
.noscript { margin: 20px; padding: 16px; background: #fff3cd; border: 1px solid #ffe69c; }
.public-preview-notice { display: flex; gap: 14px; align-items: center; max-width: 1080px; margin: 0 auto 18px; padding: 13px 16px; color: #173c63; background: #eaf2ff; border: 1px solid #b7d1f7; border-radius: 12px; font-size: 12px; }
.public-preview-notice strong { flex: 0 0 auto; color: white; background: var(--blue); padding: 3px 9px; border-radius: 999px; }

.lesson-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr); gap: 36px; align-items: end; padding: clamp(30px, 5vw, 54px); color: white; background: linear-gradient(135deg, #0f2e61, #1265e8 72%, #4b92ff); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.lesson-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -100px; top: -100px; border: 45px solid rgba(255,255,255,.09); border-radius: 50%; }
.hero-copy, .hero-outcomes { min-width: 0; position: relative; z-index: 1; }
.hero-label { margin: 0 0 12px; color: #bcd6ff; font-size: 12px; font-weight: 900; letter-spacing: .14em; }
.lesson-hero h1 { max-width: 700px; margin: 0; font-size: clamp(36px, 3.8vw, 50px); line-height: 1.18; letter-spacing: -.03em; line-break: strict; word-break: auto-phrase; text-wrap: balance; }
.hero-lead { max-width: 680px; margin: 20px 0 0; color: #e6efff; font-size: clamp(16px, 2vw, 20px); line-break: strict; word-break: auto-phrase; text-wrap: pretty; }
.hero-meta { display: flex; gap: 8px; margin-top: 24px; }
.hero-meta span { padding: 5px 10px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; font-size: 12px; font-weight: 800; }
.hero-outcomes { padding: 22px; background: rgba(8,36,79,.56); border: 1px solid rgba(255,255,255,.2); border-radius: 18px; backdrop-filter: blur(8px); }
.hero-outcomes p { margin: 0 0 10px; color: #bcd6ff; font-size: 12px; font-weight: 800; }
.hero-outcomes ol { display: grid; gap: 10px; margin: 0; padding-left: 24px; }
.hero-outcomes li { padding-left: 4px; font-weight: 700; line-break: strict; word-break: auto-phrase; }

.warning-banner { display: flex; gap: 18px; align-items: center; margin: 18px 0 34px; padding: 16px 20px; color: #6d3d00; background: #fff5df; border: 1px solid #f2cf87; border-radius: 14px; }
.warning-banner strong { flex: 0 0 auto; padding: 3px 9px; color: white; background: var(--amber); border-radius: 999px; font-size: 11px; }

.section-block { margin-top: 26px; padding: clamp(24px, 4vw, 40px); background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 8px 30px rgba(25,46,77,.04); }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 26px; }
.section-heading.compact { align-items: center; }
.section-heading h2 { margin: 2px 0 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.25; letter-spacing: -.02em; }
.section-heading > p { max-width: 420px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.section-kicker { margin: 0; color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .12em; }

.step-rail { display: grid; grid-template-columns: repeat(var(--step-count), 1fr); gap: 8px; margin-bottom: 20px; }
.step-dot { display: grid; place-items: center; gap: 4px; min-height: 68px; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.step-dot span { display: grid; place-items: center; width: 26px; height: 26px; color: white; background: #9aa8b8; border-radius: 50%; font-size: 12px; font-weight: 900; }
.step-dot small { font-size: 10px; }
.step-dot.is-past { color: var(--green); background: #eaf8f2; border-color: #a9ddca; }
.step-dot.is-past span { background: var(--green); }
.step-dot.is-active { color: var(--blue-dark); background: var(--blue-pale); border-color: #8bb8ff; box-shadow: 0 6px 16px rgba(18,101,232,.12); }
.step-dot.is-active span { background: var(--blue); }
.step-panel { padding: clamp(22px, 4vw, 36px); background: #fbfcfe; border: 1px solid var(--line); border-radius: 18px; animation: panel-in .28s ease both; }
.step-panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.step-panel-head p { margin: 0 0 3px; color: var(--blue); font-size: 12px; font-weight: 800; }
.step-panel h3 { margin: 0; font-size: clamp(22px, 3vw, 30px); }
.step-number { color: #d9e4f2; font-size: 54px; font-weight: 900; line-height: 1; }
.step-description { max-width: 760px; margin: 18px 0; color: var(--muted); font-size: 16px; }
.plain-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plain-list li { min-width: 0; position: relative; padding: 11px 14px 11px 42px; background: white; border: 1px solid #e5ebf1; border-radius: 10px; }
.plain-list li::before { content: "✓"; position: absolute; left: 14px; color: var(--blue); font-weight: 900; }
.inline-caution { display: flex; gap: 12px; margin-top: 16px; padding: 13px 15px; color: #6d3d00; background: #fff5df; border-radius: 10px; }
.inline-caution strong { font-size: 12px; }
.command-box { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 16px; padding: 14px 16px; color: #d9e7ff; background: #17253b; border-radius: 10px; }
.command-box button { color: white; background: transparent; border: 1px solid #6f84a3; border-radius: 7px; cursor: pointer; }
.step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.primary-button, .secondary-button { min-height: 44px; padding: 9px 18px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.primary-button { color: white; background: var(--blue); border: 1px solid var(--blue); }
.secondary-button { color: var(--ink); background: white; border: 1px solid var(--line); }
.primary-button:disabled, .secondary-button:disabled { opacity: .35; cursor: not-allowed; }

.feature-block { border-color: #bcd3f5; }
.segmented-control { display: inline-flex; padding: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.segmented-control button { min-width: 120px; padding: 9px 14px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-weight: 800; }
.segmented-control button.is-active { color: white; background: var(--blue); }
.environment-demo { display: grid; grid-template-columns: .65fr 1.35fr; gap: 20px; margin-top: 18px; }
.launch-card { display: flex; flex-direction: column; justify-content: center; padding: 24px; background: var(--blue-pale); border: 1px solid #a8c8f7; border-radius: 16px; }
.launch-card span { color: var(--blue-dark); font-size: 11px; font-weight: 900; }
.launch-card strong { margin-top: 8px; overflow-wrap: anywhere; font-size: 18px; }
.launch-card p { margin: 8px 0 0; color: var(--muted); }
.terminal-card { overflow: hidden; color: #dfe9f8; background: #142033; border-radius: 16px; box-shadow: 0 14px 30px rgba(20,32,51,.22); }
.terminal-bar { display: flex; gap: 6px; align-items: center; padding: 11px 14px; background: #22314a; }
.terminal-bar i { width: 9px; height: 9px; background: #60708a; border-radius: 50%; }
.terminal-bar span { margin-left: 6px; color: #aab9cc; font-size: 11px; }
.terminal-lines { padding: 18px; }
.terminal-lines p { margin: 0 0 7px; opacity: 0; animation: terminal-line .35s ease forwards; animation-delay: calc(var(--line-index) * .12s); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.terminal-lines span { margin-right: 9px; color: #5ee0a3; }

.workbook-window { overflow: hidden; border: 1px solid #b8c8db; border-radius: 16px; box-shadow: var(--shadow); }
.workbook-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; color: white; background: #174f82; font-size: 12px; }
.workbook-toolbar i { padding: 1px 8px; color: #173c63; background: #dff2e9; border-radius: 999px; font-style: normal; font-weight: 800; }
.sheet-canvas { padding: 22px; background: #f8fafc; }
.sheet-summary { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 14px; }
.sheet-summary p { margin: 0; color: var(--muted); }
.sheet-summary strong { padding: 5px 10px; color: var(--blue-dark); background: var(--blue-pale); border-radius: 999px; font-size: 12px; }
.sheet-table-wrap { overflow-x: auto; background: white; border: 1px solid #cfd9e4; }
.sheet-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 11px; }
.sheet-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sheet-table th { padding: 10px 9px; color: #24435f; background: #dce8f3; border-right: 1px solid #c8d6e3; text-align: left; white-space: nowrap; }
.sheet-table td { padding: 10px 9px; color: #34465a; border-right: 1px solid #e4eaf0; border-bottom: 1px solid #e4eaf0; white-space: nowrap; }
.sheet-table tr.is-highlight td { background: #fff5ce; }
.sheet-table td.is-link { color: var(--blue); font-weight: 900; text-decoration: underline; text-underline-offset: 2px; }
.sheet-detail { margin: 16px 0 0; color: var(--ink); }
.sheet-tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: #edf2f7; border-top: 1px solid #cfd9e4; }
.sheet-tabs button { min-height: 54px; padding: 8px; color: #526276; background: transparent; border: 0; border-right: 1px solid #d5dfe9; cursor: pointer; font-size: 11px; font-weight: 800; }
.sheet-tabs button.is-active { color: var(--blue-dark); background: white; box-shadow: inset 0 4px 0 var(--blue); }

.metrics-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.metric-card { min-width: 0; display: grid; gap: 3px; padding: 18px 10px; text-align: center; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.metric-card strong { color: var(--blue); font-size: 34px; line-height: 1; }
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 800; }

.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.role-card { padding: 22px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 16px; }
.role-card > span { display: inline-grid; place-items: center; min-width: 52px; height: 28px; color: white; background: var(--blue); border-radius: 999px; font-size: 12px; font-weight: 900; }
.role-card:nth-child(2) > span { background: #7257c7; }
.role-card:nth-child(3) > span { background: var(--green); }
.role-card h3 { margin: 14px 0 6px; font-size: 18px; }
.role-card p { margin: 0; color: var(--muted); font-size: 13px; }

.completion-block { background: #f9fcfb; border-color: #b9dfd2; }
.completion-count { color: var(--muted); }
.completion-count strong { color: var(--green); font-size: 28px; }
.completion-progress { height: 9px; overflow: hidden; margin-bottom: 18px; background: #dfebe7; border-radius: 999px; }
.completion-progress span { display: block; height: 100%; background: var(--green); transition: width .25s ease; }
.check-list { display: grid; gap: 9px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; background: white; border: 1px solid #d9e8e2; border-radius: 10px; cursor: pointer; }
.check-item input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); }
.reset-note { margin: 14px 0 0; color: var(--muted); font-size: 11px; }

.download-list { display: grid; gap: 9px; }
.download-item { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 13px 15px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 10px; }
.download-copy { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; }
.download-copy span { display: grid; place-items: center; width: 40px; height: 28px; color: white; background: var(--red); border-radius: 6px; font-size: 10px; font-weight: 900; }
.download-copy strong { overflow-wrap: anywhere; }
.download-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.download-actions a { min-width: 100px; padding: 7px 11px; border-radius: 8px; text-align: center; text-decoration: none; font-size: 11px; font-weight: 900; }
.download-actions a:hover { box-shadow: 0 5px 18px rgba(18,101,232,.12); }
.drive-link { color: white; background: var(--blue); border: 1px solid var(--blue); }
.local-link { color: var(--blue-dark); background: white; border: 1px solid #a9c6ef; }
.restricted-label { flex: 0 0 auto; padding: 6px 10px; color: #5d4b00; background: #fff4bd; border: 1px solid #ead47a; border-radius: 999px; font-size: 11px; font-weight: 900; }
.download-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; }

.preview-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 32px; color: #627085; background: white; border-top: 1px solid var(--line); font-size: 11px; }
.text-button { color: var(--blue); background: transparent; border: 0; cursor: pointer; font-weight: 800; }

.site-footer {
  padding: 38px 0;
  color: rgba(255, 255, 255, .76);
  background: #0b2529;
  border-top: 1px solid rgba(169, 120, 43, .2);
  font-size: 13px;
}
.site-footer .container { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
.site-footer .footer-groups {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, minmax(0, 1fr));
  gap: 34px;
}
.site-footer .footer-brand { color: #fff; font-size: 17px; font-weight: 900; }
.site-footer p { margin: 8px 0 0; color: rgba(255, 255, 255, .76); }
.site-footer .footer-group strong { display: block; margin-bottom: 10px; color: #fff; }
.site-footer .footer-group a {
  display: block;
  margin: 7px 0;
  color: rgba(255, 255, 255, .76);
  text-decoration: none;
}
.site-footer .footer-group a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes terminal-line { to { opacity: 1; } }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .course-sidebar { position: static; height: auto; overflow: hidden; padding: 14px 18px 10px; }
  .sidebar-intro, .sidebar-note { display: none; }
  .lesson-nav { display: flex; gap: 8px; margin: 0; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scrollbar-width: none; }
  .lesson-nav::-webkit-scrollbar { display: none; }
  .lesson-link { flex: 0 0 132px; padding: 10px 12px; text-align: center; scroll-snap-align: start; }
  .course-main { padding: 24px 18px 60px; }
  .lesson-hero { grid-template-columns: 1fr; }
  .environment-demo { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .site-footer .footer-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .preview-header { padding: 12px 16px; }
  .brand-title { font-size: 16px; }
  .pilot-mark { font-size: 10px; }
  .lesson-hero { padding: 28px 22px; border-radius: 18px; }
  .lesson-hero h1 { font-size: clamp(30px, 8vw, 33px); line-height: 1.2; }
  .warning-banner { align-items: flex-start; }
  .public-preview-notice { display: grid; }
  .section-block { padding: 22px 16px; border-radius: 16px; }
  .section-heading { display: grid; gap: 8px; }
  .section-heading > p { text-align: left; }
  .step-rail { overflow-x: auto; grid-template-columns: repeat(var(--step-count), 64px); padding-bottom: 5px; }
  .step-panel { min-width: 0; }
  .step-panel-head { align-items: center; }
  .step-number { font-size: 38px; }
  .sheet-tabs { grid-template-columns: 1fr 1fr; }
  .download-item { display: grid; }
  .download-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .download-actions a { min-width: 0; }
  .role-grid { grid-template-columns: 1fr; }
  .plain-list { min-width: 0; }
  .plain-list li { overflow-wrap: anywhere; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { padding-inline: 6px; }
  .metric-card strong { font-size: clamp(26px, 8vw, 32px); }
  .preview-footer { display: grid; padding: 18px; }
  .site-footer .container { width: min(100% - 32px, 1160px); }
  .site-footer .footer-groups { grid-template-columns: 1fr; gap: 24px; }
  .site-footer .footer-bottom { flex-direction: column; gap: 8px; }
}

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

@media print {
  .site-header, .preview-header, .course-sidebar, .preview-footer, .site-footer, .step-actions, .segmented-control { display: none !important; }
  body { background: white; }
  .app-shell { display: block; }
  .course-main { padding: 0; }
  .lesson-hero { color: black; background: white; border: 2px solid #333; box-shadow: none; }
  .hero-lead, .hero-outcomes { color: black; }
  .hero-outcomes { background: white; border-color: #999; }
  .section-block { break-inside: avoid; box-shadow: none; }
}
