:root {
  --header-height: 72px;
  --drawer-width: 296px;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --soft-line: #e8eaed;
  --surface: #ffffff;
  --subtle: #f8f9fa;
  --code: #202124;
  --code-surface: #f1f3f4;
  --android: #3ddc84;
  --android-dark: #146c43;
  --link: #0b57d0;
  --warning: #f9ab00;
  --danger: #b3261e;
  --danger-soft: #fce8e6;
  --note-soft: #e8f0fe;
  --shadow: 0 8px 28px rgba(60, 64, 67, 0.16);
  font-family: Roboto, "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  margin: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

code,
pre {
  font-family: "Roboto Mono", "SFMono-Regular", Consolas, monospace;
}

code {
  font-size: 0.92em;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--ink);
  color: white;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.android-mark {
  position: relative;
  width: 34px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 16px 16px 6px 6px;
  background: var(--android);
}

.android-mark::before,
.android-mark::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: var(--android-dark);
}

.android-mark::before {
  left: 8px;
  transform: rotate(-28deg);
}

.android-mark::after {
  right: 8px;
  transform: rotate(28deg);
}

.android-mark span::before,
.android-mark span::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink);
}

.android-mark span::before { left: 9px; }
.android-mark span::after { right: 9px; }

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 17px;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
}

.header-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 13px;
}

.header-meta a {
  font-weight: 700;
  text-decoration: none;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.icon-button:hover {
  background: var(--subtle);
}

.icon-button:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(11, 87, 208, 0.28);
  outline-offset: 2px;
}

.menu-button {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.menu-button span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.top-progress {
  position: fixed;
  z-index: 110;
  top: calc(var(--header-height) - 3px);
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}

.top-progress span {
  display: block;
  width: 10%;
  height: 100%;
  background: var(--android);
  transition: width 220ms ease;
}

.app-shell {
  min-height: 100vh;
  padding-top: var(--header-height);
}

.step-drawer {
  position: fixed;
  z-index: 50;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: var(--drawer-width);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  scrollbar-width: thin;
}

.drawer-intro {
  padding: 30px 24px 20px;
}

.eyebrow,
.step-kicker,
.section-label {
  margin: 0;
  color: var(--android-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.drawer-intro h2 {
  margin: 10px 0 16px;
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.drawer-intro > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.step-list {
  list-style: none;
  margin: 0 0 36px;
  padding: 0 12px;
}

.step-list li {
  margin: 2px 0;
}

.step-list button {
  position: relative;
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: left;
}

.step-list button:hover {
  background: var(--subtle);
}

.step-list button[aria-current="step"] {
  background: #e6f4ea;
}

.step-list button[aria-current="step"]::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px -12px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--android-dark);
}

.step-list button > span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bdc1c6;
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.step-list button.is-complete > span {
  border-color: var(--android-dark);
  background: var(--android-dark);
  color: white;
}

.step-list button[aria-current="step"] > span {
  border-color: var(--android);
  background: var(--android);
  color: var(--ink);
}

.step-list b,
.step-list small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-list b {
  align-self: end;
  font-size: 14px;
  line-height: 1.3;
}

.step-list small {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.lesson {
  min-width: 0;
  margin-left: var(--drawer-width);
}

.lesson-content {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 64px 64px 24px;
}

.codelab-step[hidden] {
  display: none;
}

.codelab-step {
  animation: step-in 220ms ease both;
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.lesson-header {
  margin-bottom: 52px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.lesson-header h1 {
  max-width: 820px;
  margin: 15px 0 20px;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.lead {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.7;
  letter-spacing: -0.015em;
}

.lesson-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.lesson-facts span::before {
  content: "";
  width: 5px;
  height: 5px;
  display: inline-block;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: var(--android-dark);
}

.codelab-step section {
  margin: 0 0 48px;
}

.codelab-step h2 {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.codelab-step p,
.codelab-step li {
  color: #3c4043;
  font-size: 16px;
  line-height: 1.85;
}

.codelab-step p code,
.codelab-step li code,
.caption code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--code-surface);
  color: var(--code);
}

.source-strip,
.resource-list {
  border-top: 1px solid var(--line);
}

.source-strip a,
.resource-list a {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.source-strip a:hover,
.resource-list a:hover {
  color: var(--link);
}

.source-strip b,
.resource-list b {
  font-size: 15px;
}

.source-strip span,
.resource-list span {
  color: var(--muted);
  font-size: 14px;
}

.classification-list {
  border-top: 1px solid var(--line);
}

.classification-list > div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.classification-list .number {
  color: var(--android-dark);
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  font-weight: 700;
}

.classification-list b {
  font-size: 18px;
}

.classification-list p {
  margin: 6px 0 0;
  font-size: 15px;
}

.operation-stack {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.operation-stack > div {
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: white;
}

.operation-stack > div + div {
  border-top: 1px solid var(--line);
}

.operation-stack .header-op {
  background: #e6f4ea;
}

.operation-stack .root-op {
  border-left: 4px solid var(--android-dark);
}

.operation-stack span,
.state-update-path span {
  color: var(--android-dark);
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  font-weight: 800;
}

.operation-stack b {
  display: block;
  font-size: 16px;
}

.operation-stack small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.operation-tree {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.operation-tree > div {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  position: relative;
}

.operation-tree > div::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.operation-tree .depth-0 { padding-left: 8px; }
.operation-tree .depth-1 { padding-left: 38px; }
.operation-tree .depth-2 { padding-left: 68px; }
.operation-tree .depth-3 { padding-left: 98px; }
.operation-tree .depth-0::before { display: none; }
.operation-tree .depth-1::before { left: 20px; }
.operation-tree .depth-2::before { left: 50px; }
.operation-tree .depth-3::before { left: 80px; }

.operation-tree code {
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--code-surface);
  overflow-wrap: anywhere;
}

.operation-tree span {
  color: var(--muted);
  font-size: 13px;
}

.numbered-process {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.numbered-process li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.numbered-process li > span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.numbered-process b {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.numbered-process p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.source-footnote {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px !important;
  font-weight: 700;
}

.state-triad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.state-triad > div {
  min-width: 0;
  padding: 24px 18px;
}

.state-triad > div + div {
  border-left: 1px solid var(--line);
}

.state-triad span {
  display: block;
  margin-bottom: 10px;
  color: var(--android-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.state-triad b {
  display: block;
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.state-triad p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.state-update-path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.state-update-path > div {
  min-width: 0;
  padding: 20px 16px;
}

.state-update-path > div + div {
  border-left: 1px solid var(--line);
}

.state-update-path b,
.state-update-path small {
  display: block;
}

.state-update-path b {
  margin-top: 10px;
  font-size: 14px;
}

.state-update-path small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.selector-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle);
}

.selector-example code,
.selector-example b {
  overflow-wrap: anywhere;
}

.selector-example code:nth-of-type(2),
.selector-example code:nth-of-type(2) ~ * {
  margin-top: 8px;
}

.callout {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 22px;
  margin: 38px 0 48px;
  padding: 24px;
  border-left: 4px solid;
  background: var(--subtle);
}

.callout > span {
  padding-top: 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.callout b {
  display: block;
  font-size: 16px;
  line-height: 1.5;
}

.callout p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.callout-warning {
  border-color: var(--warning);
  background: #fef7e0;
}

.callout-note {
  border-color: var(--link);
  background: var(--note-soft);
}

.callout-danger {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.check-row {
  min-height: 54px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--soft-line);
  color: #3c4043;
  font-size: 15px;
  line-height: 1.65;
  cursor: pointer;
}

.check-row:first-of-type {
  border-top: 1px solid var(--soft-line);
}

.check-row input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--android-dark);
}

.code-block {
  position: relative;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid #c7c9cc;
  border-radius: 8px;
  background: var(--code-surface);
}

.code-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid #c7c9cc;
  background: white;
}

.evidence-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.evidence-badge.public {
  background: #ceead6;
  color: #0d652d;
}

.evidence-badge.source {
  background: #d2e3fc;
  color: #174ea6;
}

.evidence-badge.custom {
  background: #feefc3;
  color: #7a4d00;
}

.evidence-badge.restricted {
  background: #ffe1d7;
  color: #7a2c15;
}

.copy-button {
  min-width: 88px;
  min-height: 36px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #bdc1c6;
  border-radius: 4px;
  background: white;
  color: var(--link);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.copy-button:hover {
  border-color: var(--link);
  background: #f8fbff;
}

.copy-button.is-copied {
  border-color: var(--android-dark);
  color: var(--android-dark);
}

.code-block pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  color: #202124;
  font-size: 14px;
  line-height: 1.75;
  tab-size: 4;
}

.code-block code {
  font-size: inherit;
}

.code-block.muted {
  border-color: #e3c06b;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
  line-height: 1.65;
}

th {
  color: var(--muted);
  background: var(--subtle);
  font-weight: 700;
}

.comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.comparison > div {
  padding: 24px 20px;
}

.comparison > div + div {
  border-left: 1px solid var(--line);
}

.comparison p {
  margin: 8px 0 0;
  font-size: 14px;
}

.ownership-flow,
.event-path {
  display: grid;
  align-items: stretch;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ownership-flow {
  grid-template-columns: 1fr auto 1fr auto 1fr;
}

.ownership-flow > div {
  padding: 24px 14px;
}

.ownership-flow i {
  align-self: center;
  color: #9aa0a6;
  font-style: normal;
  font-size: 20px;
}

.ownership-flow span,
.event-path span {
  display: block;
  margin-bottom: 8px;
  color: var(--android-dark);
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  font-weight: 700;
}

.ownership-flow b,
.event-path b {
  display: block;
  font-size: 15px;
}

.ownership-flow p {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.event-path {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.event-path > div {
  min-width: 0;
  padding: 22px 16px;
}

.event-path > div + div {
  border-left: 1px solid var(--line);
}

.event-path small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.poc-section {
  padding: 32px;
  border: 1px solid #e3c06b;
  background: #fffaf0;
}

.poc-section .section-label {
  color: #7a4d00;
  margin-bottom: 10px;
}

.caption {
  color: var(--muted) !important;
  font-size: 13px !important;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-right: 8px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.status.yes {
  background: #ceead6;
  color: #0d652d;
}

.status.no {
  background: #fce8e6;
  color: #a50e0e;
}

.finish-panel {
  margin: 58px 0 20px;
  padding: 42px;
  background: var(--ink);
  color: white;
}

.finish-panel p {
  margin: 0 0 12px;
  color: var(--android);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.finish-panel h2 {
  max-width: 720px;
  margin: 0 0 26px;
  font-size: 28px;
  line-height: 1.4;
}

.finish-panel button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid #9aa0a6;
  border-radius: 4px;
  color: white;
  font-weight: 700;
}

.finish-panel button:hover {
  border-color: white;
}

.lesson-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.nav-button,
.complete-button {
  min-height: 58px;
  border-radius: 4px;
  font-weight: 700;
}

.nav-button {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid #bdc1c6;
  text-align: left;
}

.nav-button.primary {
  align-items: flex-end;
  border-color: var(--android-dark);
  background: var(--android-dark);
  color: white;
  text-align: right;
}

.nav-button.secondary:hover:not(:disabled) {
  border-color: var(--link);
  color: var(--link);
}

.nav-button.primary:hover:not(:disabled) {
  background: #0b5736;
}

.nav-button:disabled {
  opacity: 0.45;
}

.nav-button span {
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 500;
}

.nav-button b {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.complete-button {
  min-width: 134px;
  padding: 0 16px;
  border: 1px solid #bdc1c6;
  color: var(--link);
}

.complete-button:hover {
  border-color: var(--link);
  background: #f8fbff;
}

.complete-button.is-complete {
  border-color: var(--android-dark);
  color: var(--android-dark);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: 1.5;
}

.drawer-overlay {
  position: fixed;
  z-index: 40;
  inset: var(--header-height) 0 0 0;
  background: rgba(32, 33, 36, 0.45);
}

@media (max-width: 900px) {
  .menu-button {
    display: inline-flex;
  }

  .site-header {
    padding: 0 14px;
    gap: 10px;
  }

  .version-chip,
  .header-meta span {
    display: none;
  }

  .header-meta {
    margin-left: auto;
  }

  .step-drawer {
    z-index: 60;
    width: min(88vw, 320px);
    transform: translateX(-102%);
    box-shadow: var(--shadow);
    transition: transform 180ms ease;
  }

  body.drawer-open .step-drawer {
    transform: translateX(0);
  }

  .lesson {
    margin-left: 0;
  }

  .lesson-content {
    padding: 52px 34px 22px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    gap: 6px;
    padding: 0 8px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small,
  .header-meta {
    display: none;
  }

  .android-mark {
    width: 30px;
    height: 23px;
  }

  .lesson-content {
    padding: 38px 20px 18px;
  }

  .lesson-header {
    margin-bottom: 38px;
    padding-bottom: 30px;
  }

  .lesson-header h1 {
    margin-top: 12px;
    font-size: 36px;
    line-height: 1.16;
  }

  .lead {
    font-size: 17px;
    line-height: 1.65;
  }

  .codelab-step h2 {
    font-size: 24px;
  }

  .codelab-step p,
  .codelab-step li {
    font-size: 15px;
  }

  .source-strip a,
  .resource-list a {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .callout {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px;
  }

  .code-toolbar {
    min-height: 52px;
    padding-left: 10px;
  }

  .evidence-badge {
    max-width: calc(100% - 100px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .copy-button {
    min-width: 84px;
    padding: 0 10px;
  }

  .code-block pre {
    padding: 20px 16px;
    font-size: 13px;
  }

  .comparison,
  .ownership-flow,
  .event-path,
  .state-triad,
  .state-update-path {
    grid-template-columns: 1fr;
  }

  .comparison > div + div,
  .event-path > div + div,
  .state-triad > div + div,
  .state-update-path > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .operation-stack > div {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 14px;
  }

  .operation-tree > div {
    grid-template-columns: 1fr;
    gap: 3px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .operation-tree .depth-1 { padding-left: 30px; }
  .operation-tree .depth-2 { padding-left: 50px; }
  .operation-tree .depth-3 { padding-left: 70px; }
  .operation-tree .depth-1::before { left: 14px; }
  .operation-tree .depth-2::before { left: 34px; }
  .operation-tree .depth-3::before { left: 54px; }

  .selector-example {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .selector-example > span {
    display: none;
  }

  .selector-example b + code {
    margin-top: 12px;
  }

  .ownership-flow i {
    display: none;
  }

  .ownership-flow > div + div {
    border-top: 1px solid var(--line);
  }

  .poc-section {
    margin-right: -4px;
    margin-left: -4px;
    padding: 24px 16px;
  }

  .finish-panel {
    padding: 28px 22px;
  }

  .lesson-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .complete-button {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .nav-button {
    min-height: 62px;
    padding: 8px 12px;
  }

  .site-footer {
    flex-direction: column;
    gap: 10px;
  }
}

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

/* Beginner path: result-first visuals and one idea per diagram. */
.screenshot-story {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.screenshot-story figure {
  min-width: 0;
  margin: 0;
}

.screenshot-story img {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: block;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--subtle);
  box-shadow: 0 10px 24px rgba(60, 64, 67, 0.12);
}

.screenshot-story figcaption {
  display: grid;
  gap: 5px;
  padding: 14px 4px 0;
}

.screenshot-story figcaption b {
  font-size: 15px;
}

.screenshot-story figcaption span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.one-sentence {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: 26px;
  border: 1px solid #b7dfc5;
  border-radius: 12px;
  background: #f1f9f4;
}

.one-sentence > span {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--android-dark);
  color: white;
  font-size: 18px;
  font-weight: 800;
}

.one-sentence p {
  margin: 0;
}

.sdui-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.sdui-compare > div {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--subtle);
}

.sdui-compare > .is-remote {
  border-color: #9ed3b2;
  background: #f1f9f4;
}

.compare-label {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.is-remote .compare-label {
  color: var(--android-dark);
}

.mini-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, .65fr);
  align-items: center;
  gap: 8px;
}

.mini-flow b {
  min-width: 0;
  padding: 12px 8px;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.mini-flow i,
.beginner-definition > i,
.simple-pipeline > i,
.host-action-story > i,
.screen-selector > i,
.final-flow > i {
  color: #9aa0a6;
  font-style: normal;
  font-weight: 800;
}

.sdui-compare p {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.beginner-definition,
.host-action-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.beginner-definition > div,
.host-action-story > div,
.ownership-simple > div {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.beginner-definition span,
.host-action-story span,
.ownership-simple span,
.screen-selector span {
  display: block;
  margin-bottom: 9px;
  color: var(--android-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.beginner-definition b,
.host-action-story b,
.ownership-simple b,
.screen-selector b {
  display: block;
  font-size: 15px;
  line-height: 1.5;
}

.beginner-definition p,
.host-action-story p,
.ownership-simple p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.simple-pipeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.simple-pipeline > div {
  min-width: 0;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--subtle);
}

.simple-pipeline > div > span {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.simple-pipeline b {
  font-size: 14px;
}

.simple-pipeline small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.simple-pipeline.compact > div {
  min-height: 120px;
}

.screen-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

.screen-selector > div {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.screen-selector > .is-active {
  border-color: #9ed3b2;
  background: #f1f9f4;
}

.screen-selector small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.host-action-story {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
}

.host-action-story code {
  overflow-wrap: anywhere;
}

.ownership-simple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.final-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid #9ed3b2;
  border-radius: 10px;
  background: #f1f9f4;
}

.final-flow.return {
  margin-top: 12px;
  border-color: #aecbfa;
  background: var(--note-soft);
}

.final-flow b {
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 760px) {
  .screenshot-story {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .screenshot-story figure {
    width: min(100%, 320px);
    margin-inline: auto;
  }

  .sdui-compare,
  .ownership-simple {
    grid-template-columns: 1fr;
  }

  .beginner-definition,
  .simple-pipeline,
  .host-action-story,
  .final-flow {
    grid-template-columns: 1fr;
  }

  .beginner-definition > i,
  .simple-pipeline > i,
  .host-action-story > i,
  .final-flow > i {
    transform: rotate(90deg);
    text-align: center;
  }

  .simple-pipeline > div {
    min-height: 0;
  }

  .simple-pipeline > div > span {
    margin-bottom: 12px;
  }

  .final-flow b {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .version-chip {
    display: none;
  }

  .brand-copy strong {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .one-sentence {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .mini-flow {
    grid-template-columns: 1fr;
  }

  .mini-flow i {
    transform: rotate(90deg);
    text-align: center;
  }

  .screen-selector {
    grid-template-columns: 1fr;
  }

  .screen-selector > i {
    transform: rotate(90deg);
    text-align: center;
  }
}

.state-worlds {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.frontend-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.frontend-compare > div {
  min-width: 0;
  padding: 28px 24px;
}

.frontend-compare > div + div {
  border-left: 1px solid var(--line);
}

.frontend-compare > .procedural-frontend {
  background: #fffaf0;
}

.frontend-compare > div > span {
  color: var(--android-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

.frontend-compare h3 {
  margin: 9px 0 18px;
  font-size: 18px;
}

.frontend-compare pre {
  margin: 0 0 20px;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: white;
  font-size: 12px;
  line-height: 1.7;
}

.frontend-compare dl {
  margin: 0;
}

.frontend-compare dl > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft-line);
}

.frontend-compare dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.frontend-compare dd {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.frontend-convergence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  padding: 20px;
  background: var(--subtle);
}

.frontend-convergence > div {
  min-width: 0;
  text-align: center;
}

.frontend-convergence b,
.frontend-convergence small {
  display: block;
}

.frontend-convergence b {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.frontend-convergence small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.frontend-convergence i {
  color: var(--android-dark);
  font-style: normal;
  font-weight: 800;
}

.state-worlds > div {
  padding: 26px;
  border-top: 4px solid #9aa0a6;
  background: var(--subtle);
}

.state-worlds > .remote-world {
  border-color: var(--android-dark);
  background: #f1f9f4;
}

.state-worlds > i {
  align-self: center;
  color: var(--muted);
  font-size: 24px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.state-worlds span,
.value-bridge span,
.document-state-model span,
.runtime-lab-heading span,
.runtime-branch span {
  display: block;
  margin-bottom: 10px;
  color: var(--android-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.state-worlds b {
  display: block;
  font-size: 18px;
  line-height: 1.45;
}

.state-worlds p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.value-bridge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 24px 0 34px;
  padding: 22px;
  border: 1px solid #9ed3b2;
  background: #f1f9f4;
}

.value-bridge > div {
  min-width: 0;
}

.value-bridge > i {
  color: var(--android-dark);
  font-style: normal;
  font-weight: 800;
}

.value-bridge b,
.value-bridge small {
  display: block;
}

.value-bridge b {
  font-size: 15px;
}

.value-bridge small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.state-code-walkthrough {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.state-code-walkthrough li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.state-code-walkthrough li > span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--android-dark);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.state-code-walkthrough b {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.state-code-walkthrough p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.document-state-model {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.document-state-model > div {
  min-width: 0;
  padding: 24px 18px;
}

.document-state-model > div + div {
  border-left: 1px solid var(--line);
}

.document-state-model b,
.document-state-model small {
  display: block;
}

.document-state-model b {
  font-size: 14px;
  line-height: 1.55;
}

.document-state-model small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.runtime-lab {
  overflow: hidden;
  border: 1px solid #3c4043;
  border-radius: 12px;
  background: #202124;
  color: white;
}

.runtime-lab-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid #5f6368;
}

.runtime-lab-heading span {
  color: var(--android);
}

.runtime-lab-heading b {
  font-size: 18px;
}

.runtime-lab-heading > code {
  padding: 10px 12px;
  border-radius: 6px;
  background: #303134;
  color: white;
  font-size: 12px;
}

.runtime-lab-heading strong {
  color: var(--android);
}

.runtime-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.runtime-branch {
  min-width: 0;
  padding: 26px 24px;
  opacity: .34;
  transition: opacity 180ms ease, background 180ms ease;
}

.runtime-branch + .runtime-branch {
  border-left: 1px solid #5f6368;
}

.runtime-branch.is-active {
  background: #123c2b;
  opacity: 1;
}

.runtime-branch b,
.runtime-branch small {
  display: block;
}

.runtime-branch b {
  font-size: 24px;
}

.runtime-branch small {
  margin-top: 8px;
  color: #bdc1c6;
  font-size: 12px;
}

.runtime-controls {
  display: flex;
  gap: 10px;
  padding: 18px 24px 0;
  border-top: 1px solid #5f6368;
}

.runtime-controls button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #9aa0a6;
  border-radius: 5px;
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.runtime-controls button:first-child {
  border-color: var(--android);
  background: var(--android);
  color: var(--ink);
}

.runtime-event {
  margin: 0 !important;
  padding: 16px 24px 22px;
  color: #bdc1c6 !important;
  font-family: "Roboto Mono", monospace;
  font-size: 12px !important;
  line-height: 1.6 !important;
}

@media (max-width: 760px) {
  .frontend-compare,
  .state-worlds,
  .value-bridge,
  .document-state-model {
    grid-template-columns: 1fr;
  }

  .frontend-compare > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .frontend-convergence {
    grid-template-columns: 1fr;
  }

  .frontend-convergence i {
    transform: rotate(90deg);
  }

  .state-worlds > i,
  .value-bridge > i {
    transform: rotate(90deg);
  }

  .document-state-model > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .runtime-lab-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .runtime-branches {
    grid-template-columns: 1fr;
  }

  .runtime-branch + .runtime-branch {
    border-top: 1px solid #5f6368;
    border-left: 0;
  }

  .runtime-controls {
    flex-direction: column;
  }
}
