/* Programming tutorials (public). Brand: navy #000080, orange #FFA500, white. */
:root { --tn: #000080; --tn-2: #1a1a9e; --to: #FFA500; --to-d: #b86e00; --tline: #e3e5f0; --tsoft: #f5f6fb; --tmuted: #5b5f78; }

.btn-tut { background: var(--tn); border: 1px solid var(--tn); color: #fff; font-weight: 700; }
.btn-tut:hover, .btn-tut:focus-visible { background: var(--tn-2); border-color: var(--tn-2); color: #fff; }
.btn-outline-tut { border: 1px solid var(--tn); color: var(--tn); background: #fff; font-weight: 700; }
.btn-outline-tut:hover, .btn-outline-tut:focus-visible { background: var(--tn); color: #fff; }
.tut-section { padding: 2.2rem 0 3.5rem; }

/* Hero */
.tut-hero { background: var(--g-700); color: #fff; padding: 7.2rem 0 3rem; }
.tut-eyebrow { display: inline-flex; gap: .45rem; align-items: center; font-weight: 800; font-size: .8rem; color: var(--to); }
.tut-hero h1 { color: #fff; font-weight: 800; font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.12; margin: .6rem 0 .8rem; }
.tut-hero h1 em { font-style: normal; color: inherit; }
.tut-hero .lead { color: rgba(255,255,255,.86); max-width: 38rem; }
.tut-search { position: relative; display: flex; gap: .5rem; background: #fff; border-radius: 14px; padding: .35rem; max-width: 36rem; margin-top: 1.3rem; box-shadow: 0 10px 30px rgba(0,0,40,.25); }
.tut-search.light { box-shadow: none; border: 1px solid var(--tline); max-width: none; }
.tut-search > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--tmuted); }
.tut-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: .55rem .5rem .55rem 2.3rem; font-size: 1rem; border-radius: 10px; }
.tut-search input:focus-visible { box-shadow: 0 0 0 3px rgba(255,165,0,.45); }
.tut-hero-stats { display: flex; gap: 1.6rem; margin-top: 1.5rem; flex-wrap: wrap; }
.tut-hero-stats strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--to); }
.tut-hero-stats span { font-size: .8rem; color: rgba(255,255,255,.8); }
.tut-hero-card { background: #fff; color: #1d1f33; border-radius: 18px; padding: 1.4rem; border-top: 5px solid var(--to); box-shadow: 0 18px 40px rgba(0,0,40,.3); }
.tut-hero-card .k { display: block; font-size: .82rem; font-weight: 800; color: var(--to-d); }
.tut-hero-card strong { display: block; font-size: 1.2rem; color: var(--tn); margin: .25rem 0; }
.tut-hero-card small { color: var(--tmuted); display: block; }
.tut-hero-link { display: block; margin-top: .8rem; font-weight: 700; color: var(--tn); font-size: .9rem; }

/* Language cards */
.tut-cat { font-size: 1.15rem; font-weight: 800; color: var(--tn); margin: 1.6rem 0 1rem; }
.tut-cat:first-child { margin-top: 0; }
.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tut-grid.one { grid-template-columns: 1fr; }
.tut-lang { --c: var(--tn); display: flex; align-items: flex-start; gap: .9rem; padding: 1.05rem; background: #fff; border: 1px solid var(--tline); border-radius: 16px; text-decoration: none !important; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.tut-lang:hover, .tut-lang:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,80,.1); border-color: var(--c); }
.tut-lang-ico { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; color: #fff; background: var(--c, #000080); }
.tut-lang-ico.lg { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 18px; box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.tut-lang-ico.sm { width: 28px; height: 28px; font-size: .85rem; border-radius: 8px; }
.tut-lang-body { flex: 1; min-width: 0; }
.tut-lang-body strong { display: block; font-size: 1.05rem; color: #14163a; }
.tut-lang-body small { display: block; color: var(--tmuted); font-size: .86rem; line-height: 1.4; margin-top: .15rem; }
.tut-lang-meta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .55rem; font-size: .78rem; color: var(--tmuted); font-weight: 600; }
.tut-lang-meta i { margin-right: .3rem; }
.tut-lang-meta .ok { color: #157347; }
.tut-lang-go { color: var(--c); margin-top: .3rem; }
.tut-bar { display: block; height: 6px; border-radius: 99px; background: var(--tsoft); margin-top: .6rem; overflow: hidden; }
.tut-bar i { display: block; height: 100%; background: var(--to); border-radius: inherit; }

.tut-list { display: grid; gap: .5rem; }
.tut-list-item { display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem; border: 1px solid var(--tline); border-radius: 12px; background: #fff; color: inherit; text-decoration: none !important; min-width: 0; }
.tut-list-item:hover, .tut-list-item:focus-visible { border-color: var(--tn); }
.tut-list-item strong { flex: 1; min-width: 0; color: #14163a; }
.tut-list-item > i { color: var(--tmuted); }
.tut-list-item .tag, .tut-tag { --c: var(--tn); flex: none; font-size: .72rem; font-weight: 800; padding: .2rem .55rem; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.tut-tag.free { background: #fff3db; color: #8a5300; }
.tut-tag.lock { background: var(--tsoft); color: var(--tmuted); }
.tut-empty { text-align: center; padding: 3rem 1rem; color: var(--tmuted); }
.tut-empty i { font-size: 2.2rem; color: var(--tn); margin-bottom: .6rem; }
.tut-empty.sm { padding: 1.2rem; background: var(--tsoft); border-radius: 12px; }
.tut-card { background: #fff; border: 1px solid var(--tline); border-radius: 16px; padding: 1.3rem; }
.tut-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: .85rem; }
.tut-pill.ok { background: rgba(255,165,0,.95); color: #000050; }

/* Crumbs */
.tut-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .85rem; margin-bottom: .8rem; color: var(--tmuted); }
.tut-crumbs a { color: var(--tn); font-weight: 600; }
.tut-crumbs i { font-size: .6rem; opacity: .6; }

/* Language page */
.tut-lang-hero { --c: var(--tn); background: linear-gradient(135deg, #000060, var(--tn)); color: #fff; padding: 6.6rem 0 2.2rem; position: relative; }
.tut-lang-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--to), var(--c)); }
.tut-lang-hero .tut-crumbs, .tut-lang-hero .tut-crumbs a { color: rgba(255,255,255,.85); }
.tut-lang-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.tut-lang-head h1 { color: #fff; font-weight: 800; margin: 0; font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.tut-lang-head .lead { color: rgba(255,255,255,.85); }
.tut-lang-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.3rem; }
.tut-lang-hero .btn-tut { background: var(--to); border-color: var(--to); color: #000050; }
.tut-lang-hero .btn-outline-tut { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.tut-outline { background: #fff; border: 1px solid var(--tline); border-radius: 16px; padding: .4rem; margin-bottom: 1rem; }
.tut-outline h3 { font-size: .8rem; font-weight: 800; color: var(--to-d); margin: .7rem .8rem .3rem; }
.tut-outline ol { list-style: none; margin: 0; padding: 0; }
.tut-outline a { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 12px; color: inherit; text-decoration: none !important; }
.tut-outline a:hover, .tut-outline a:focus-visible { background: var(--tsoft); }
.tut-outline .num { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--tsoft); color: var(--tn); font-weight: 800; font-size: .85rem; }
.tut-outline a.done .num { background: #157347; color: #fff; }
.tut-outline .t { flex: 1; min-width: 0; font-weight: 700; color: #14163a; }
.tut-outline .t small { display: block; font-weight: 500; color: var(--tmuted); font-size: .82rem; }
.tut-outline a.locked .t { color: #4d5070; }
.tut-outline .meta { display: flex; align-items: center; gap: .45rem; flex: none; }
.tut-outline .min { font-size: .78rem; color: var(--tmuted); white-space: nowrap; }
.tut-side-card ul { list-style: none; padding: 0; margin: 0 0 1rem; font-size: .9rem; }
.tut-side-card li { display: flex; gap: .6rem; margin-bottom: .7rem; color: #33365a; }
.tut-side-card li i { color: var(--to-d); margin-top: .2rem; width: 1rem; }
.tut-prose { line-height: 1.75; color: #22243f; font-size: 1.02rem; }
.tut-prose p:last-child { margin-bottom: 0; }
.tut-prose code { background: #eef0fa; color: #1b1b8f; padding: .1rem .35rem; border-radius: 6px; font-size: .9em; }
.tut-prose a { color: var(--tn); text-decoration: underline; }
.tut-prose blockquote { border-left: 4px solid var(--to); padding-left: 1rem; color: #3b3e5c; }

/* Lesson layout */
.tut-page { --c: var(--tn); padding: 5.6rem 0 3rem; background: #fbfbfe; }
.tut-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 992px) { .tut-layout { grid-template-columns: 270px minmax(0, 1fr); } }
@media (min-width: 1200px) { .tut-layout { grid-template-columns: 270px minmax(0, 1fr) 210px; } }
.tut-aside, .tut-toc { position: sticky; top: 5.5rem; align-self: start; max-height: calc(100vh - 6.5rem); overflow-y: auto; }
.tut-nav-home { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--tn); text-decoration: none !important; padding: .4rem .5rem .8rem; border-bottom: 1px solid var(--tline); margin-bottom: .4rem; }
.tut-nav-topic { font-size: .82rem; font-weight: 800; color: var(--to-d); margin: .9rem .5rem .3rem; }
.tut-nav ul { list-style: none; padding: 0; margin: 0; }
.tut-nav li a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem .6rem; border-radius: 9px; color: #2d3052; text-decoration: none !important; font-size: .9rem; border-left: 3px solid transparent; }
.tut-nav li a:hover, .tut-nav li a:focus-visible { background: var(--tsoft); }
.tut-nav li a.active { background: #eef0ff; border-left-color: var(--to); color: var(--tn); font-weight: 700; }
.tut-nav li a i { font-size: .78rem; color: var(--tmuted); flex: none; }
.tut-nav li a.done i { color: #157347; }
.tut-main { min-width: 0; background: #fff; border: 1px solid var(--tline); border-radius: 20px; padding: clamp(1.1rem, 3vw, 2.4rem); }
.tut-topbar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.tut-topbar .tut-crumbs { margin: 0; }
.tut-lesson-head { margin: .8rem 0 1.4rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--tline); }
.tut-lesson-head h1 { font-weight: 800; color: #10123a; font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.18; }
.tut-lesson-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; font-size: .86rem; color: var(--tmuted); font-weight: 600; }
.tut-lesson-meta i { margin-right: .3rem; }
.tut-actions { margin-left: auto; }
.tut-act { border: 1px solid var(--tline); background: #fff; border-radius: 99px; padding: .3rem .8rem; font-weight: 700; color: var(--tn); font-size: .85rem; }
.tut-act.on { background: #fff3db; border-color: var(--to); color: #7a4600; }
.tut-summary { font-size: 1.08rem; color: #3b3e5c; margin: .9rem 0 0; }

/* Blocks */
.tut-blocks > * + * { margin-top: 1.3rem; }
.tut-h { font-weight: 800; color: var(--tn); scroll-margin-top: 6rem; margin-top: 2rem !important; }
h2.tut-h { font-size: 1.45rem; padding-bottom: .4rem; border-bottom: 2px solid #fff0d1; }
h3.tut-h { font-size: 1.15rem; }
.tut-code { margin: 0; border-radius: 14px; overflow: hidden; background: #0d1033; border: 1px solid #0d1033; }
.tut-code figcaption { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem .55rem .45rem .9rem; background: #171a4a; color: #cfd3ff; font-size: .8rem; font-weight: 700; }
.tut-code .tools { display: flex; gap: .35rem; flex-wrap: wrap; }
.tut-code-btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; border-radius: 8px; padding: .25rem .6rem; font-size: .78rem; font-weight: 700; text-decoration: none !important; }
.tut-code-btn:hover, .tut-code-btn:focus-visible { background: rgba(255,255,255,.12); color: #fff; }
.tut-code-btn.try { background: var(--to); border-color: var(--to); color: #000050; }
.tut-code-btn.try:hover { background: #ffb733; color: #000050; }
.tut-code pre { margin: 0; padding: 1rem 1.1rem; max-height: 540px; overflow: auto; }
.tut-code pre code { font-size: .88rem; line-height: 1.6; background: transparent !important; padding: 0 !important; color: #e8eaff; white-space: pre; }
.tut-output { margin: 0; border: 1px dashed #b8bbd6; border-radius: 12px; background: #f7f8fc; }
.tut-output figcaption { font-size: .82rem; font-weight: 800; color: var(--tmuted); padding: .5rem .9rem 0; }
.tut-output pre { margin: 0; padding: .5rem .9rem .9rem; font-size: .88rem; white-space: pre-wrap; }
.tut-figure { margin: 0; text-align: center; }
.tut-figure img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--tline); }
.tut-figure figcaption, .tut-video figcaption { font-size: .85rem; color: var(--tmuted); margin-top: .45rem; }
.tut-video iframe { border-radius: 12px; border: 0; }
.tut-callout { display: flex; gap: .85rem; padding: .95rem 1.1rem; border-radius: 14px; border: 1px solid; }
.tut-callout > i { font-size: 1.15rem; margin-top: .2rem; }
.tut-callout strong { display: block; margin-bottom: .2rem; }
.tut-callout.note { background: #eef0ff; border-color: #c9ccf5; color: #1d2070; }
.tut-callout.tip { background: #fff6e3; border-color: #ffd58c; color: #5c3900; }
.tut-callout.warning { background: #fff0ee; border-color: #f4bdb6; color: #7a1d12; }
.tut-callout .tut-prose { color: inherit; font-size: .97rem; }
.tut-table table { margin: 0; border: 1px solid var(--tline); }
.tut-table thead th { background: var(--tn); color: #fff; }
.tut-table caption { caption-side: bottom; font-size: .85rem; }
.tut-exercise, .tut-quiz, .tut-challenge { border: 1px solid var(--tline); border-radius: 16px; padding: 1.1rem 1.2rem; background: #fcfcff; }
.tut-exercise h3, .tut-quiz h3 { font-size: 1rem; font-weight: 800; color: var(--tn); }
.tut-exercise > * + *, .tut-challenge > * + * { margin-top: .9rem; }
.tut-solution summary { cursor: pointer; font-weight: 700; color: var(--to-d); margin-bottom: .6rem; }
.tut-quiz .q { font-weight: 700; }
.tut-quiz .opts { display: grid; gap: .45rem; margin-bottom: .8rem; }
.tut-quiz .opt { display: flex; gap: .6rem; align-items: center; border: 1px solid var(--tline); border-radius: 10px; padding: .55rem .75rem; cursor: pointer; background: #fff; }
.tut-quiz .opt:has(input:checked) { border-color: var(--tn); background: #eef0ff; }
.tut-quiz .opt.right { border-color: #198754; background: #e9f7ef; }
.tut-quiz .opt.wrong { border-color: #dc3545; background: #fdecee; }
.tut-quiz .result { margin-top: .7rem; font-weight: 700; }
.tut-quiz .why { margin-top: .4rem; font-size: .93rem; color: #3b3e5c; }
.tut-download { display: flex; gap: .9rem; align-items: center; padding: .9rem 1.1rem; border: 1px solid var(--tline); border-radius: 14px; text-decoration: none !important; color: inherit; background: #fff; }
.tut-download:hover, .tut-download:focus-visible { border-color: var(--tn); }
.tut-download i { font-size: 1.6rem; color: var(--tn); }
.tut-download strong { display: block; color: #14163a; }
.tut-download small { color: var(--tmuted); }
.tut-challenge { border: 2px solid var(--to); background: linear-gradient(180deg, #fffaf0, #fff); }
.tut-challenge .head { display: flex; gap: .8rem; align-items: center; }
.tut-challenge .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--to); color: #000050; font-size: 1.15rem; }
.tut-challenge .k { font-size: .82rem; font-weight: 800; color: var(--to-d); }
.tut-challenge h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--tn); }
.tut-done-box { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--tline); text-align: center; }
.tut-locked { text-align: center; padding: 2.4rem 1.2rem; border: 2px dashed #c9ccf0; border-radius: 18px; background: var(--tsoft); }
.tut-locked .ico { width: 58px; height: 58px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--tn); color: var(--to); font-size: 1.4rem; margin-bottom: .8rem; }
.tut-locked h2 { font-size: 1.25rem; font-weight: 800; color: var(--tn); }
.tut-locked p { color: #3b3e5c; max-width: 34rem; margin-inline: auto; }
.tut-pager { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 2rem; }
.tut-pager a { display: block; border: 1px solid var(--tline); border-radius: 14px; padding: .8rem 1rem; text-decoration: none !important; color: inherit; min-width: 0; }
.tut-pager a:hover, .tut-pager a:focus-visible { border-color: var(--tn); background: var(--tsoft); }
.tut-pager .next { text-align: right; grid-column: 2; }
.tut-pager small { display: block; color: var(--tmuted); font-weight: 700; font-size: .78rem; }
.tut-pager strong { display: block; color: var(--tn); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tut-toc .k { font-size: .82rem; font-weight: 800; color: var(--tmuted); margin-bottom: .5rem; }
.tut-toc ul { list-style: none; padding: 0 0 0 .7rem; margin: 0; border-left: 2px solid var(--tline); }
.tut-toc li { margin-bottom: .4rem; font-size: .85rem; }
.tut-toc li.l3 { padding-left: .7rem; }
.tut-toc a { color: #4a4e70; text-decoration: none; }
.tut-toc a:hover, .tut-toc a.active { color: var(--tn); font-weight: 700; }
.tut-offcanvas { max-width: 86vw; }

/* Unlock / my */
.tut-unlock { text-align: left; }
.tut-unlock .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--tn); color: var(--to); font-size: 1.3rem; margin-bottom: .8rem; }
.tut-code-input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.tut-access-list { list-style: none; padding: 0; margin: 0; }
.tut-access-list li { padding: .7rem 0; border-bottom: 1px solid var(--tline); }
.tut-access-list li:last-child { border-bottom: 0; }
.tut-access-list strong { display: block; color: var(--tn); }
.tut-access-list span { display: block; font-size: .85rem; color: var(--tmuted); }
.tut-access-list li.off { opacity: .65; }
.tut-continue { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 16px; background: var(--tn); color: #fff; text-decoration: none !important; }
.tut-continue .k { grid-column: 1; font-size: .82rem; font-weight: 800; color: var(--to); }
.tut-continue strong { grid-column: 1; font-size: 1.1rem; }
.tut-continue small { grid-column: 1; color: rgba(255,255,255,.8); }
.tut-continue > i { grid-column: 2; grid-row: 1 / span 3; color: var(--to); font-size: 1.3rem; }
@media (max-width: 575.98px) {
  .tut-hero { padding-top: 6rem; }
  .tut-pager { grid-template-columns: 1fr; }
  .tut-pager .next { grid-column: 1; }
  .tut-actions { margin-left: 0; }
  .tut-main { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .tut-lang { transition: none; } .tut-lang:hover { transform: none; } }
