/* Уроки теории 8 класса. */
.g8-lesson { --g8-inset: clamp(24px, 4vw, 40px); --g8: #0b6e64; --g8-2: #0f8f7a; --g8-soft: #e6f6f2; --g8-line: #d5e8e4; --g8-ink: #1a2150; color: var(--g8-ink); font-size: 17px; line-height: 1.65; }
.g8-lesson [hidden] { display: none !important; }
.g8-hero { position: relative; padding: 30px var(--g8-inset) 24px; color: #fff; background: radial-gradient(900px 300px at 100% 0, rgba(92, 193, 250, .45), transparent 70%), linear-gradient(120deg, #141c4f 0%, #27307f 50%, #0f8f7a 100%); overflow: hidden; }
.g8-hero::after { content: '8'; position: absolute; right: 22px; bottom: -46px; font-size: 190px; font-weight: 800; line-height: 1; color: rgba(255, 255, 255, .09); pointer-events: none; }
.g8-over { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.g8-hero h2 { position: relative; z-index: 1; margin: 14px 0 10px; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; color: #fff; }
.g8-hook { position: relative; z-index: 1; margin: 0 0 18px; max-width: 700px; font-size: 19px; line-height: 1.5; color: #e9f1ff; }
.g8-hero nav { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.g8-hero nav button { padding: 7px 14px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.g8-hero nav button:hover, .g8-hero nav button:focus-visible { background: #fff; color: #141c4f; outline: none; }
.g8-main { margin: 24px var(--g8-inset) 8px; padding: 18px 20px; border-radius: 16px; background: var(--g8-soft); border-left: 5px solid var(--g8-2); scroll-margin-top: 90px; }
.g8-main p { margin: 8px 0 0; font-size: 18px; font-weight: 500; }
.g8-tag { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--g8); }
.g8-block { padding: 24px var(--g8-inset) 4px; scroll-margin-top: 90px; }
.g8-block h3 { margin: 0 0 12px; font-size: 20px; color: #141c4f; }
.g8-block h4 { margin: 0 0 6px; font-size: 16px; color: #141c4f; }
.g8-block > p { margin: 0 0 12px; }
.g8-lesson i { color: #23408f; }
.g8-sign { padding: 0 5px; border-radius: 5px; background: #ffe08a; color: #5a3d00; font-weight: 800; font-style: normal; }
.g8-lesson .g8-flow { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.g8-lesson .g8-flow li { position: relative; flex: 1 1 130px; margin: 0; padding: 12px 14px; border: 1px solid var(--g8-line); border-radius: 12px; background: #f6fbfa; font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.g8-flow li span { display: block; margin-bottom: 4px; color: var(--g8-2); font-size: 20px; font-weight: 800; }
.g8-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin-bottom: 12px; }
.g8-cards article { padding: 14px 16px; border-radius: 14px; background: #f5f8ff; border: 1px solid #e1e9f6; }
.g8-cards article p { margin: 0; font-size: 15.5px; line-height: 1.45; }
.g8-eg { margin-top: 8px !important; padding-top: 8px; border-top: 1px dashed #cdd8ee; color: #23408f; font-style: italic; }
.g8-vs { margin-bottom: 12px; border: 1px solid #e1e9f6; border-radius: 14px; overflow: hidden; }
.g8-vs-head, .g8-vs-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g8-vs-head b { padding: 10px 14px; background: #141c4f; color: #fff; font-size: 14px; }
.g8-vs-head b + b { background: #0b6e64; }
.g8-vs-row > div { padding: 10px 14px; border-top: 1px solid #edf2f9; font-size: 15.5px; line-height: 1.45; }
.g8-vs-row > div + div { border-left: 1px solid #edf2f9; background: #f6fbfa; }
.g8-ex { margin: 0 0 12px !important; padding: 0 !important; list-style: none; display: grid; gap: 8px; }
.g8-ex li { margin: 0 !important; padding: 10px 14px; border-radius: 12px; background: #fff8e8; box-shadow: inset 0 0 0 1px #f6e2b3; font-size: 16px; }
.g8-table-wrap { margin-bottom: 12px; overflow-x: auto; }
.g8-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #e1e9f6; border-radius: 14px; overflow: hidden; font-size: 15.5px; line-height: 1.42; }
.g8-table th { padding: 10px 13px; background: #141c4f; color: #fff; text-align: left; font-size: 13px; font-weight: 600; }
.g8-table td { padding: 10px 13px; border-top: 1px solid #edf2f9; vertical-align: top; }
.g8-table tbody tr:nth-child(even) td { background: #f7f9fe; }
.g8-table td:first-child { font-weight: 700; color: #141c4f; }
/* Подчёркивание членов предложения, как в тетради. */
.g8-m { text-decoration: none; padding-bottom: 3px; }
.g8-m-s { border-bottom: 2px solid #1a2150; }
.g8-m-p { border-bottom: 5px double #1a2150; }
.g8-m-d { border-bottom: 2px dashed #b3541e; }
.g8-m-a { text-decoration: underline wavy #0b6e64; text-underline-offset: 4px; }
.g8-m-c { border-bottom: 2px dotted #6a4dff; background-image: linear-gradient(90deg, #6a4dff 55%, transparent 0); background-size: 12px 2px; background-repeat: repeat-x; background-position: 0 100%; border-bottom-color: transparent; }
.g8-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px var(--g8-inset); font-size: 13.5px; color: #4a5378; }
.g8-steps-box { margin: 20px var(--g8-inset) 8px; padding: 18px 20px 8px; border-radius: 16px; background: #eef4ff; }
.g8-steps { margin: 0 !important; padding: 0 !important; list-style: none; counter-reset: g8; }
.g8-steps li { counter-increment: g8; position: relative; margin: 0 !important; padding: 3px 0 14px 44px; }
.g8-steps li::before { content: counter(g8); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #2f8bff, #0052d6); color: #fff; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.g8-traps { display: grid; gap: 10px; }
.g8-trap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.g8-trap p { margin: 0; }
.g8-bad, .g8-good { display: flex; gap: 9px; align-items: flex-start; padding: 10px 13px; border-radius: 12px; }
.g8-bad { background: #fdece9; color: #a33; }
.g8-good { background: #e5f7ef; color: #0b6b47; font-weight: 600; }
.g8-bad > span:first-child, .g8-good > span:first-child { flex: none; width: 21px; height: 21px; margin-top: 2px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.g8-bad > span:first-child { background: #d64533; } .g8-good > span:first-child { background: #17a673; }
.g8-bad i, .g8-good i { color: inherit; }
.g8-why { grid-column: 1 / -1; padding: 0 4px 4px; font-size: 14.5px; color: #5e6b85; }
.g8-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 24px var(--g8-inset) 8px; }
.g8-trick, .g8-fact { padding: 16px 18px; border-radius: 16px; }
.g8-trick { color: #fff; background: linear-gradient(135deg, #6a4dff, #3c2bbd); }
.g8-trick i, .g8-trick b { color: #fff; }
.g8-fact { background: #fff3df; color: #5a3d00; box-shadow: inset 0 0 0 1px #fbe0ad; }
.g8-fact i { color: inherit; }
.g8-trick > b, .g8-fact > b { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.g8-trick p, .g8-fact p { margin: 4px 0 0; font-size: 16px; line-height: 1.5; }
.g8-note { color: #6d7693; font-size: 15px; }
.g8-quiz { display: grid; gap: 8px; margin-bottom: 10px; }
.g8-quiz details { border: 1px solid #dfe6f4; border-radius: 12px; background: #fff; }
.g8-quiz summary { padding: 12px 16px; cursor: pointer; font-weight: 600; }
.g8-quiz summary:focus-visible, .g8-lesson a:focus-visible { outline: 3px solid #397edf; outline-offset: 3px; }
.g8-quiz details[open] { background: #f6fbfa; border-color: var(--g8-line); }
.g8-quiz details > p, .g8-quiz details > article { margin: 0; padding: 0 16px 14px; }
.g8-graph { margin-top: 12px; padding-top: 20px; border-top: 1px solid #e6edf8; }
.g8-graph-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 16px; }
.g8-links { display: flex; flex-direction: column; gap: 8px; }
.g8-links a { padding: 9px 13px; border-radius: 10px; background: #f1f4fd; color: #141c4f; text-decoration: none; font-weight: 600; font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; }
.g8-links a:hover { background: #dfe8ff; }
.g8-links small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6d7693; }
.g8-links p { margin: 0; color: #6d7693; }
.g8-source { margin: 24px var(--g8-inset) 0; padding: 14px 0 6px; border-top: 1px solid #e6edf8; font-size: 13px; line-height: 1.5; color: #625b72; }
@media (max-width: 640px) {
  .g8-lesson { --g8-inset: 18px; }
  .g8-hero { padding: 24px var(--g8-inset); } .g8-hook { font-size: 17px; }
  .g8-hero nav { flex-wrap: wrap; } .g8-hero nav button { min-height: 44px; white-space: normal; }
  .g8-main, .g8-steps-box, .g8-pair, .g8-source, .g8-legend { margin-left: var(--g8-inset); margin-right: var(--g8-inset); }
  .g8-block { padding: 24px var(--g8-inset) 4px; }
  .g8-block.g8-steps-box { padding: 18px 16px 8px; }
  .g8-pair, .g8-trap, .g8-graph-cols { grid-template-columns: 1fr; }
  .g8-vs-head { display: none; } .g8-vs-row { grid-template-columns: 1fr; }
  .g8-vs-row > div + div { border-left: 0; } .g8-vs-row > div:empty { display: none; }
  .g8-vs-row > div::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; color: #7a88a4; text-transform: uppercase; }
  .g8-table, .g8-table tbody, .g8-table tr, .g8-table td { display: block; border: 0; } .g8-table thead { display: none; }
  .g8-table tr { margin-bottom: 10px; padding: 8px 2px; border-radius: 12px; background: #f7f9fe; box-shadow: inset 0 0 0 1px #e6edf8; }
  .g8-table tbody tr:nth-child(even) td { background: transparent; } .g8-table td { padding: 5px 13px; }
  .g8-table td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; color: #7a88a4; text-transform: uppercase; }
}
@media print { .g8-hero nav { display: none !important; } .g8-quiz details > * { display: block !important; } .g8-pair, .g8-trap, .g8-graph-cols { display: block; } }

/* Не наследуем отступы обычных списков и не даём содержимому расширять сетку. */
.g8-lesson { overflow-wrap: anywhere; }
.g8-lesson [id] { scroll-margin-top: 100px; }
.g8-lesson h3, .g8-lesson h4 { line-height: 1.4; }
.g8-cards > *, .g8-trap > *, .g8-pair > *, .g8-graph-cols > *, .g8-bad > span, .g8-good > span { min-width: 0; }
.g8-table { table-layout: fixed; }
.g8-lesson .g8-flow li { min-width: 0; }
.g8-quiz details > .worked-example { margin: 0; box-shadow: none; border: 0; }
