
.topbar-actions{display:flex;align-items:center;gap:13px}

.lesson-heading{justify-content:center;text-align:center;margin:0 0 8px}
.lesson-heading h1{
  font-family:"Caveat",cursive;
  font-size:clamp(38px,5vw,54px);
  font-weight:700;
  letter-spacing:0;
  line-height:1.05;
  text-align:center;
  margin:0;
  color:var(--text);
}

.source-row{text-align:center;margin:0 0 19px}

.detail-actions{
  display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:9px;
}

.github-source,.pdf-download{
  min-height:36px;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:8px 14px;
  border:2px dashed var(--line-strong);
  border-radius:var(--sketch-sm);
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  font-family:"Caveat",cursive;
  font-size:19px;
  font-weight:600;
  white-space:nowrap;
  transform:rotate(1deg);
  transition:
    color .25s var(--ease),
    border-color .25s var(--ease),
    background .25s var(--ease),
    transform .25s var(--ease);
}
.github-source:hover,.pdf-download:hover{
  color:var(--accent);
  border-color:var(--accent-line);
  background:var(--accent-soft);
  transform:rotate(-1.5deg) translateY(-2px);
}
.github-source span{color:var(--accent);transition:transform .25s var(--ease)}
.github-source:hover span{transform:translate(3px,-3px) rotate(8deg)}
.pdf-download{
  transform:rotate(-1deg);
}
.pdf-download:hover{transform:rotate(1.5deg) translateY(-2px)}
.pdf-download span{font-size:18px;color:var(--accent)}

.markdown-body img{margin:24px 0;max-width:min(100%,720px)}

.unavailable h1{
  font-family:"Caveat",cursive;
  max-width:600px;
  font-size:clamp(38px,4vw,52px);
  font-weight:700;
  letter-spacing:0;
  line-height:1.05;
}
.unavailable>p{
  max-width:520px;
  color:var(--muted);
  font-family:"Kalam",cursive;
  font-size:14px;
  line-height:1.7;
}

.tp-tag{
  color:var(--accent);
  background:var(--accent-soft);
  border-color:var(--accent-line);
  font-family:"Kalam",cursive;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  padding:2px 10px;
  border:2px dashed var(--accent-line);
  border-radius:var(--sketch-sm);
  transform:rotate(-1.5deg);
  transition:transform .25s var(--ease),background .25s var(--ease);
}
.tp-tag:hover{transform:rotate(1.5deg) scale(1.04);background:rgba(165,242,27,.18)}

.floating-shortcuts{
  position:fixed;z-index:40;
  left:max(18px,env(safe-area-inset-left));
  bottom:max(18px,env(safe-area-inset-bottom));
  display:flex;align-items:center;
}
.floating-shortcuts-items{
  display:flex;align-items:center;gap:8px;
}
.floating-shortcuts-toggle{
  display:none;
  width:50px;height:50px;
  place-items:center;
  padding:0;
  border:2px solid var(--accent-line);
  border-radius:var(--sketch-sm);
  background:var(--accent-soft);
  color:var(--text);
  cursor:pointer;
  box-shadow:3px 4px 0 rgba(0,0,0,.4);
}
.floating-shortcuts-toggle .shortcuts-menu-icon{display:block}
.floating-shortcuts-toggle .shortcuts-close-icon{display:none}
.floating-shortcuts.is-open .floating-shortcuts-toggle .shortcuts-menu-icon{display:none}
.floating-shortcuts.is-open .floating-shortcuts-toggle .shortcuts-close-icon{display:block}
.floating-shortcuts-toggle:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.floating-tps,
.floating-how,
.floating-ide,
.floating-keyboard,
.floating-papers,
.floating-learn,
.floating-quiz,
.floating-chat{
  width:50px;height:50px;
  display:grid;place-items:center;
  border:2px solid var(--line-strong);
  border-radius:var(--sketch-sm);
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  font-family:"Caveat",cursive;
  font-size:18px;font-weight:700;
  letter-spacing:0;
  cursor:pointer;
  box-shadow:3px 4px 0 rgba(0,0,0,.4);
  transition:
    transform .25s var(--ease),
    border-color .25s var(--ease),
    background .25s var(--ease),
    color .25s var(--ease),
    box-shadow .25s var(--ease);
}
.floating-how{font-size:24px;font-weight:600}
.floating-ide{font-family:"Kalam",cursive;font-size:11px;letter-spacing:-.02em;font-weight:700}
.floating-ide svg{display:block;flex:none}
.floating-keyboard svg{display:block;flex:none}
.floating-learn svg{display:block;flex:none}
.floating-papers img{display:block;width:25px;height:25px;object-fit:contain;filter:invert(1)}
.floating-quiz img{display:block;width:25px;height:25px;object-fit:contain;filter:invert(1)}

.floating-tps:hover,
.floating-papers:hover,
.floating-learn:hover,
.floating-quiz:hover,
.floating-how:hover,
.floating-ide:hover,
.floating-keyboard:hover,
.floating-chat:hover{
  transform:rotate(-6deg) translateY(-3px);
  border-color:var(--accent-line);
  background:var(--accent-soft);
  color:var(--accent);
  box-shadow:5px 6px 0 rgba(0,0,0,.4);
}
.floating-shortcuts a:focus-visible,
.floating-papers:focus-visible,
.floating-keyboard:focus-visible,
.floating-chat:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}

.floating-chat{
  position:fixed;z-index:40;
  right:max(18px,env(safe-area-inset-right));
  bottom:max(18px,env(safe-area-inset-bottom));
  padding:0;appearance:none;font:inherit;
  border-color:var(--accent-line);
  background:var(--accent-soft);
}
.floating-chat:hover{
  background:rgba(165,242,27,.18);
  border-color:var(--accent);
}
.floating-chat img{display:block;width:35px;height:35px;object-fit:contain}

.breadcrumbs a[href$="/tps"]{
  color:var(--accent);
  text-decoration:none;
  border-bottom:2px dashed transparent;
  transition:color .2s var(--ease),border-color .2s var(--ease);
}
.breadcrumbs a[href$="/tps"]:hover{
  color:var(--accent-2);
  border-bottom-color:var(--accent-line);
}

@media(max-width:600px){
  .topbar-actions{gap:7px}
  .lesson-heading h1{font-size:38px}
  .source-row{margin-bottom:16px}
  .detail-actions{gap:7px}
  .github-source,.pdf-download{min-height:34px;padding:6px 11px;font-size:17px}
  .github-source span{font-size:15px}
  .pdf-download span{font-size:16px}
  .markdown-body img{max-width:100%}
  .floating-shortcuts{
    left:max(14px,env(safe-area-inset-left));
    bottom:max(14px,env(safe-area-inset-bottom));
  }
  .floating-shortcuts-toggle{
    display:grid;
    position:relative;
    z-index:1;
    width:48px;height:48px;
  }
  .floating-shortcuts-items{
    display:none;
    position:absolute;
    left:0;
    bottom:calc(100% + 12px);
    grid-template-columns:repeat(3,44px);
    gap:8px;
    max-width:calc(100vw - 28px);
    padding:10px;
    border:1px solid var(--line-strong);
    border-radius:var(--sketch-sm);
    background:var(--panel);
    box-shadow:0 8px 28px rgba(0,0,0,.42);
  }
  .floating-shortcuts.is-open .floating-shortcuts-items{display:grid}
  .floating-shortcuts .floating-shortcuts-items a{width:44px;height:44px}
  .floating-shortcuts:not([data-platform="android"]):not([data-platform="desktop"]) .floating-shortcuts-toggle{display:none}
  .floating-shortcuts:not([data-platform="android"]):not([data-platform="desktop"]) .floating-shortcuts-items{
    display:grid;
    position:static;
    grid-template-columns:47px;
    gap:0;
    max-width:none;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }
  .floating-shortcuts:not([data-platform="android"]):not([data-platform="desktop"]) .floating-shortcuts-items .floating-download{
    width:47px;
    height:47px;
  }
  .floating-tps,
  .floating-how,
  .floating-ide,
  .floating-keyboard,
  .floating-learn,
  .floating-quiz,
  .floating-chat{width:47px;height:47px}
  .floating-chat{
    right:max(14px,env(safe-area-inset-right));
    bottom:max(14px,env(safe-area-inset-bottom));
  }
}

@media(prefers-reduced-motion:reduce){
  .github-source,.pdf-download,
  .floating-tps,.floating-how,.floating-ide,.floating-keyboard,.floating-learn,.floating-quiz,.floating-chat,
  .floating-shortcuts-toggle{
    transition-duration:.01ms!important;
  }
}

.course-card.tp-card{
  grid-template-columns:minmax(0,1fr);
  min-height:110px;
}
@media(max-width:600px){
  .course-card.tp-card{
    grid-template-columns:minmax(0,1fr);
    min-height:98px;
  }
}

.course-card-body>h2:first-child{margin-top:0}

.course-card:not(.tp-card) .course-card-body{justify-content:center}
.course-card:not(.tp-card) .course-card-body>h2:first-child{
  align-self:stretch;
  text-align:center;
}

.download-main{
  width:min(100%,680px);
  margin:0 auto;
  flex:1;
  padding:44px 0 72px;
}
.download-topbar{justify-content:center}
.download-back{
  display:inline-flex;
  align-items:center;
  color:var(--muted);
  text-decoration:none;
  font-size:13px;
  transition:color .2s ease;
}
.download-back:hover{color:var(--accent)}
.download-title{
  margin:42px 0 8px;
  color:var(--text);
  font-size:clamp(24px,4vw,32px);
  font-weight:600;
  letter-spacing:-.03em;
}
.download-lead{
  margin:0 0 24px;
  color:var(--muted);
  font-size:14px;
}
.download-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.download-card{
  position:relative;
  display:flex;
  min-height:170px;
  flex-direction:column;
  align-items:flex-start;
  padding:20px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  transition:border-color .2s ease,background .2s ease;
}
.download-card--linux{position:relative}
.download-card:hover{border-color:var(--line-strong);background:var(--panel-2)}
.download-platform-icon{
  width:32px;
  height:32px;
  margin-bottom:16px;
  object-fit:contain;
}
.download-card h2{
  margin:0 0 16px;
  color:var(--text);
  font-size:18px;
  font-weight:600;
}
.download-action{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top:auto;
  padding:0 13px;
  border:1px solid var(--accent-line);
  border-radius:8px;
  background:var(--accent-soft);
  color:var(--accent-2);
  text-decoration:none;
  font-size:13px;
  font-weight:600;
  transition:background .2s ease,border-color .2s ease;
}
.download-action:hover{border-color:var(--accent);background:rgba(165,242,27,.16)}
.download-action.is-disabled{
  cursor:not-allowed;
  opacity:.55;
}
.linux-help-button{
  position:absolute;
  right:14px;
  bottom:14px;
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid var(--line-strong);
  border-radius:50%;
  background:var(--panel-2);
  color:var(--text);
  font:inherit;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
}
.linux-help-button:hover{border-color:var(--accent);color:var(--accent)}
.linux-help-button:focus-visible,.linux-help-close:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.linux-help-dialog{
  width:min(calc(100% - 32px),480px);
  padding:0;
  border:1px solid var(--line-strong);
  border-radius:14px;
  background:var(--panel);
  color:var(--text);
  box-shadow:0 18px 60px rgba(0,0,0,.55);
}
.linux-help-dialog::backdrop{background:rgba(0,0,0,.72)}
.linux-help-dialog-content{position:relative;padding:26px}
.linux-help-dialog-content form{position:absolute;top:12px;right:12px;margin:0}
.linux-help-close{
  width:32px;
  height:32px;
  border:1px solid var(--line-strong);
  border-radius:8px;
  background:transparent;
  color:var(--text);
  font-size:22px;
  cursor:pointer;
}
.linux-help-dialog h2{margin:0 42px 12px 0;font-size:20px}
.linux-help-dialog p{margin:0 0 16px;color:var(--muted);font-size:14px;line-height:1.6}
.linux-help-dialog pre{overflow-x:auto;margin:0;padding:14px;border:1px solid var(--line);border-radius:8px;background:#090b10;color:var(--text);font-size:13px;line-height:1.7}
.download-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:20px 0 28px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
}
.download-socials{display:flex;align-items:center;gap:10px}
.download-socials a{width:40px;height:40px;display:grid;place-items:center;transition:transform .2s}
.download-socials a:hover{transform:translateY(-2px)}
.download-socials img{display:block;width:32px;height:32px;object-fit:contain;filter:invert(1)}
.download-footer a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

.floating-shortcuts .floating-download{
  width:50px;height:50px;
  display:grid;place-items:center;
  border:2px solid var(--line-strong);
  border-radius:var(--sketch-sm);
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  box-shadow:3px 4px 0 rgba(0,0,0,.4);
  transition:
    transform .25s var(--ease),
    border-color .25s var(--ease),
    background .25s var(--ease),
    color .25s var(--ease),
    box-shadow .25s var(--ease);
}
.floating-shortcuts .floating-download:hover{
  transform:rotate(-6deg) translateY(-3px);
  border-color:var(--accent-line);
  background:var(--accent-soft);
  color:var(--accent);
  box-shadow:5px 6px 0 rgba(0,0,0,.4);
}
.floating-shortcuts[data-platform="android"] .floating-download,
.floating-shortcuts[data-platform="desktop"] .floating-download{display:none}
.floating-shortcuts:not([data-platform="android"]):not([data-platform="desktop"]) .floating-shortcuts-items>a:not(.floating-download){display:none}
.floating-shortcuts .floating-download:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.floating-shortcuts .floating-download svg{display:block}

.keyboard-shortcuts-main{width:min(100%,900px)}
.keyboard-shortcuts-intro{
  margin:24px 0 26px;
  color:var(--muted);
  font-family:"Kalam",cursive;
  font-size:15px;
  line-height:1.7;
}
.keyboard-shortcuts-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));
  gap:12px;
}
.keyboard-shortcut-card{
  min-width:0;
  padding:16px;
  border:1px solid var(--line);
  border-radius:var(--sketch-sm);
  background:var(--panel);
  box-shadow:3px 4px 0 rgba(0,0,0,.28);
}
.keyboard-shortcut-card[hidden]{display:none}
.keyboard-shortcut-category{
  display:block;
  margin-bottom:8px;
  color:var(--accent);
  font-family:"Kalam",cursive;
  font-size:12px;
  font-weight:700;
}
.keyboard-shortcut-card h2{
  margin:0 0 8px;
  color:var(--text);
  font-family:"Caveat",cursive;
  font-size:23px;
  font-weight:700;
}
.keyboard-shortcut-card p{
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.65;
}
.keyboard-shortcut-keys{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px;
  margin:0 0 11px;
}
.keyboard-shortcut-keys kbd{
  min-width:28px;
  padding:4px 8px;
  border:1px solid #596273;
  border-bottom-width:3px;
  border-radius:6px;
  background:linear-gradient(180deg,#282e39,#1b2029);
  color:#fff;
  font:600 12px/1.2 Inter,ui-sans-serif,system-ui,sans-serif;
  text-align:center;
  box-shadow:0 2px 0 rgba(0,0,0,.35);
}
.keyboard-shortcut-keys span{color:var(--muted);font-size:11px}

@media(max-width:700px){
  .download-main{width:min(100%,520px);padding-top:28px}
  .download-grid{grid-template-columns:1fr;gap:10px}
  .download-card{min-height:145px;padding:17px}
  .download-footer{align-items:flex-start;flex-direction:column}
  .download-socials{align-self:flex-end}
}

@media(prefers-reduced-motion:reduce){
  .download-action,.download-back,.download-card,
  .floating-shortcuts .floating-download,.download-socials a{
    transition-duration:.01ms!important;
  }
}
