@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500;700&family=DM+Sans:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;600;700;800;900&display=swap');

:root { font-family: 'DM Sans', 'Noto Sans JP', sans-serif; color: #202520; background: #f7f4ed; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #646cf4; outline-offset: 3px; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
.page { max-width: 1880px; margin: auto; padding: 36px clamp(18px, 3vw, 48px) 28px; }
.hero { padding: 16px 10px 34px; }
.eyebrow, .section-heading p, .section-kicker, .workspace-head p, .inspector-head > p, .explanation-label, .code-title > span, .guide article > span, .page-footer, .heading-pill, .preview-measure, .workspace-foot { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .11em; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 13px; color: #007f69; }
.brand-mark { display: inline-block; width: 20px; height: 20px; margin-right: 4px; border: 2px solid #007d68; border-radius: 5px; box-shadow: 5px 5px 0 #b5ff32; }
.hero h1 { margin: 0; font-size: clamp(38px, 5.15vw, 78px); font-weight: 800; line-height: 1.04; letter-spacing: 0; }
.hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 23px; }
.lead { margin: 0; font-size: clamp(16px, 1.45vw, 21px); font-weight: 700; line-height: 1.65; white-space: nowrap; }
.lead strong { color: #6169f2; }
.hero-actions { display: flex; gap: 10px; flex: none; }
.hero-actions button { min-height: 45px; padding: 12px 17px; border: 1px solid #d4d8cf; border-radius: 13px; background: #fff; font-size: 12px; font-weight: 800; transition: transform .18s, box-shadow .18s; }
.hero-actions button:last-child { color: #fff; background: #202520; border-color: #202520; }
.hero-actions button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #dbe2d9; }

.lab, .guide { overflow: hidden; border: 1px solid #cad1c9; border-radius: 27px; background: #fffdf8; box-shadow: 0 13px 40px rgb(31 42 34 / 4%); }
.section-heading { display: flex; align-items: center; gap: 18px; min-height: 98px; padding: 19px 26px; border-bottom: 1px solid #cad1c9; }
.section-number { display: grid; place-items: center; flex: none; width: 51px; height: 51px; border-radius: 14px; color: #fff; background: #ff6956; font: 800 13px 'DM Mono', monospace; }
.section-number.blue { background: #646cf4; }
.section-heading p { margin: 0 0 5px; color: #00806b; }
.section-heading h2 { margin: 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.25; }
.heading-pill { margin-left: auto; padding: 8px 11px; border-radius: 99px; color: #007b67; background: #e9f5ee; white-space: nowrap; }
.lab-grid { display: grid; grid-template-columns: minmax(255px, 280px) minmax(0, 1fr) minmax(315px, 355px); align-items: stretch; }

.controls { border-right: 1px solid #cad1c9; }
.control-section { padding: 23px 21px; border-bottom: 1px solid #d9ddd6; }
.control-section:last-child { border-bottom: 0; }
.section-kicker { margin: 0 0 8px; color: #007d69; }
.control-section h3 { margin: 0 0 17px; font-size: 16px; line-height: 1.3; }
.pattern-list { display: grid; gap: 8px; }
.pattern-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 65px; padding: 9px; border: 1px solid #ccd4cc; border-radius: 12px; background: #fff; text-align: left; transition: transform .17s, box-shadow .17s; }
.pattern-list button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #e0e7df; }
.pattern-list button[aria-pressed='true'] { border-color: #202520; color: #fff; background: #202520; }
.pattern-number { display: grid; place-items: center; flex: none; width: 33px; height: 33px; border-radius: 9px; color: #202520; background: #e9efeb; font: 800 11px 'DM Mono', monospace; }
.pattern-list button[aria-pressed='true'] .pattern-number { background: #b5ff32; }
.pattern-list button > span:last-child { display: grid; gap: 2px; min-width: 0; }
.pattern-list b { font-size: 13px; }
.pattern-list small { color: #657068; font: 700 10px 'DM Mono', monospace; }
.pattern-list button[aria-pressed='true'] small { color: #d5e2d5; }
.range-label { display: block; }
.range-label > span { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 800; }
.range-label output { color: #626af3; font-family: 'DM Mono', monospace; }
.range-label input { width: 100%; margin: 12px 0 0; accent-color: #626af3; }
.range-label input:disabled { opacity: .4; }
.width-presets, .segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.width-presets button, .segmented button { min-height: 35px; padding: 5px 6px; border: 1px solid #ccd4cc; border-radius: 9px; background: #fff; font: 800 10px 'DM Mono', monospace; transition: transform .17s, background-color .17s; }
.width-presets button:not(:disabled):hover, .segmented button:hover { transform: translateY(-2px); }
.width-presets button[aria-pressed='true'], .segmented button[aria-pressed='true'] { border-color: #202520; color: #fff; background: #202520; }
.width-presets button:disabled { opacity: .4; }
.segmented { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
.control-note { margin: 12px 0 0; color: #5e6b61; font-size: 10px; font-weight: 600; line-height: 1.7; }
.breakpoint-section.is-inactive { background: #f5f6f1; }

.workspace { display: flex; flex-direction: column; min-width: 0; background: #eaf0ec; }
.workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 24px 18px; }
.workspace-head p { margin: 0 0 6px; color: #007d69; }
.workspace-head h3 { margin: 0; font-size: 19px; }
.workspace-head > span { padding: 8px 10px; border-radius: 99px; color: #fff; background: #007e6b; font: 700 10px 'DM Mono', monospace; white-space: nowrap; }
.preview-stage { display: flex; align-items: center; flex-direction: column; flex: 1; min-height: 670px; margin: 0 18px; padding: 19px 14px 27px; border: 1px solid #ccd6cd; border-radius: 18px; background-color: #fcfdf9; background-image: linear-gradient(#dce4dc 1px, transparent 1px), linear-gradient(90deg, #dce4dc 1px, transparent 1px); background-size: 24px 24px; }
.preview-measure { display: flex; justify-content: space-between; width: 100%; max-width: 820px; margin-bottom: 18px; color: #5e6c62; }
.preview-measure b { color: #626af3; }
.preview-window { overflow: clip; width: 620px; max-width: 100%; min-width: 0; min-height: 420px; border: 2px solid #202520; border-radius: 18px; background: #fff; box-shadow: 10px 12px 0 rgb(24 34 25 / 15%); transition: width .18s ease; }
.preview-mount { width: 100%; }
.preview-body { min-height: 340px; padding: 36px clamp(20px, 4vw, 50px); border-top: 2px solid #202520; }
.preview-body > span { color: #00816d; font: 800 10px 'DM Mono', monospace; letter-spacing: .13em; }
.preview-body h4 { margin: 13px 0 8px; font-size: clamp(27px, 3vw, 38px); line-height: 1.1; }
.preview-body p { max-width: 450px; margin: 0; color: #657269; font-size: 12px; font-weight: 600; line-height: 1.65; }
.content-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 27px; }
.content-cards i { display: block; height: 86px; border: 1px solid #ced9ce; border-radius: 11px; background: #b5ff32; }
.content-cards i:nth-child(2) { background: #7a83ff; }
.content-cards i:nth-child(3) { background: #ffad84; }
.workspace-foot { display: flex; justify-content: space-between; gap: 16px; padding: 19px 22px 23px; color: #66746b; line-height: 1.6; letter-spacing: 0; }
.workspace-foot span:first-child { color: #007d69; }
.workspace-foot span:last-child { white-space: nowrap; }

.inspector { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid #202520; color: #f7faf5; background: #252923; }
.inspector-head { padding: 25px 22px 19px; border-bottom: 1px solid #454d43; }
.inspector-head > p { margin: 0 0 7px; color: #a9bbb0; }
.inspector-head h3 { display: inline-block; margin: 0; font-size: 21px; }
.inspector-head > span { float: right; padding: 7px 9px; border-radius: 99px; color: #202520; background: #b5ff32; font: 800 10px 'DM Mono', monospace; }
.inspector-head > span.needs-js { color: #fff; background: #ff6956; }
.inspector-explanation { padding: 18px 22px; border-bottom: 1px solid #454d43; }
.explanation-label { margin: 0 0 5px; color: #acbbad; }
.inspector-explanation p:not(.explanation-label) { margin: 0 0 15px; font-size: 12px; font-weight: 700; line-height: 1.65; }
.inspector-explanation p:last-child { margin-bottom: 0; }
.code-tabs { display: flex; gap: 5px; padding: 20px 21px 0; }
.code-tabs button { flex: 1; min-height: 39px; border: 1px solid #606b5f; border-radius: 9px; color: #dbe6d9; background: #323a30; font: 800 11px 'DM Mono', monospace; }
.code-tabs button:hover:not(:disabled) { background: #495449; }
.code-tabs button[aria-selected='true'] { border-color: #b5ff32; color: #1d2717; background: #b5ff32; }
.code-tabs button:disabled { opacity: .35; }
.code-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 10px; }
.code-title > span { color: #adbeae; }
.code-title button { flex: none; padding: 9px 10px; border: 0; border-radius: 8px; background: #fff; font-size: 10px; font-weight: 900; }
.code-title button:hover { background: #b5ff32; }
.code-block { overflow: auto; max-height: 640px; margin: 0 14px; padding: 16px 14px; border: 1px solid #465047; border-radius: 12px; color: #dcf2ce; background: #171d17; font: 500 10px/1.65 'DM Mono', monospace; tab-size: 2; white-space: pre; }
.code-footnote { margin: 0; padding: 17px 22px 22px; color: #adbdac; font-size: 10px; line-height: 1.7; }

.guide { margin-top: 22px; }
.guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 20px; }
.guide article { min-width: 0; padding: 19px; border: 1px solid #d4dcd3; border-radius: 16px; background: #fff; }
.guide article > span { color: #626af3; }
.guide h3 { margin: 14px 0 8px; font-size: 16px; }
.guide p { margin: 0; color: #5e6b61; font-size: 11px; line-height: 1.65; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 4px 0; color: #647168; }
.toast { position: fixed; z-index: 100; bottom: 22px; left: 50%; padding: 12px 18px; border-radius: 99px; color: #fff; background: #202520; box-shadow: 0 10px 28px #0003; font-size: 12px; font-weight: 800; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .18s, transform .18s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1350px) {
  .lab-grid { grid-template-columns: minmax(240px, 270px) minmax(0, 1fr); }
  .inspector { grid-column: 1 / -1; border-top: 1px solid #202520; border-left: 0; }
  .code-block { max-height: 360px; }
}
@media (max-width: 1200px) {
  .hero-bottom { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 900px) {
  .lab-grid { grid-template-columns: 1fr; }
  .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-right: 0; }
  .control-section:nth-child(odd) { border-right: 1px solid #d9ddd6; }
  .workspace { grid-row: auto; }
  .inspector { grid-column: auto; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .page { padding: 18px 12px 20px; }
  .hero { padding: 15px 4px 25px; }
  .hero h1 { font-size: clamp(36px, 9.5vw, 55px); }
  .lead { font-size: 15px; white-space: normal; }
  .hero-actions { width: 100%; }
  .hero-actions button { flex: 1; padding: 11px 8px; }
  .lab, .guide { border-radius: 20px; }
  .section-heading { min-height: 84px; padding: 16px; }
  .section-heading h2 { font-size: 18px; }
  .section-number { width: 44px; height: 44px; border-radius: 12px; }
  .heading-pill { display: none; }
  .controls { display: block; }
  .control-section, .control-section:nth-child(odd) { padding: 20px 18px; border-right: 0; }
  .workspace-head { padding: 19px 16px; }
  .workspace-head h3 { font-size: 17px; }
  .preview-stage { min-height: 570px; margin: 0 9px; padding: 14px 10px 22px; }
  .preview-measure { gap: 12px; font-size: 10px; }
  .preview-measure span:last-child { text-align: right; }
  .preview-body { padding: 28px 20px; }
  .preview-body h4 { font-size: 25px; }
  .content-cards { grid-template-columns: repeat(2, 1fr); }
  .content-cards i:last-child { display: none; }
  .workspace-foot { flex-direction: column; gap: 5px; padding: 16px; font-size: 10px; }
  .guide-grid { grid-template-columns: 1fr; padding: 13px; }
  .page-footer { flex-direction: column; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
