
  :root { --ink: #1D2B44; --muted: #5F6C82; --paper: #F6F3FF; --card: #fff; --line: #E2DDF3; --navy: #23305C; --blue: #3A7BEA; --green: #2EB872; --red: #EF5350; --yellow: #FFC93C; --orange: #FF8A3D; --purple: #8E5BD6;
    --move: #3A7BEA; --loop: #FF9F1C; --until: #E07A00; --if: #8E5BD6; --var: #E5487A; --fn: #12A88A; }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body { font-family: 'Nunito', system-ui, sans-serif; color: var(--ink); background: var(--paper); overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }
  button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
  h1, h2, h3 { font-family: 'Baloo 2', sans-serif; line-height: 1.05; }
  .screen { display: none; height: 100%; }
  .screen.show { display: flex; flex-direction: column; }
  .btn { min-height: 50px; padding: 0 18px; border-radius: 14px; font-weight: 900; font-size: 1.05rem; background: #ECE7FA; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 3px 0 #D3CBEA; }
  .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #D3CBEA; }
  .btn.go { background: var(--green); color: #fff; box-shadow: 0 3px 0 #1F8A54; }
  .btn.pri { background: var(--blue); color: #fff; box-shadow: 0 3px 0 #255CB8; }
  .btn:disabled { opacity: .4; pointer-events: none; }
  .round { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 1.3rem; flex-shrink: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--navy); color: #fff; flex-shrink: 0; }
  .topbar h2 { font-size: 1.45rem; }
  .back { height: 46px; padding: 0 14px; border-radius: 12px; background: rgba(255,255,255,.16); color: #fff; font-weight: 900; }
  .grow { flex: 1; min-width: 0; }

  /* Home */
  #home { overflow-y: auto; background: radial-gradient(circle at 20% 0%, #CFE3FF, transparent 50%), radial-gradient(circle at 90% 20%, #E9D9FF, transparent 50%), var(--paper); }
  .homewrap { max-width: 1080px; margin: 0 auto; padding: 22px; width: 100%; }
  .hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); color: var(--navy); }
  .hero h1 span { color: var(--purple); }
  .hero p { font-weight: 800; color: var(--muted); font-size: 1.12rem; margin-top: 2px; }
  .champpick { margin-left: auto; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 18px; padding: 8px 12px; border: 2px solid var(--line); }
  .champpick img { width: 56px; height: 56px; object-fit: contain; }
  .champpick b { font-family: 'Baloo 2'; font-size: 1.2rem; display: block; }
  .champpick small { color: var(--muted); font-weight: 800; }
  .worlds { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
  .world { border-radius: 24px; padding: 20px; color: #fff; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 210px; box-shadow: 0 8px 22px rgba(35,48,92,.18); position: relative; overflow: hidden; }
  .world:active { transform: translateY(2px); }
  .world .ic { font-size: 2.6rem; }
  .world h2 { font-size: 1.9rem; }
  .world .gr { font-weight: 900; background: rgba(255,255,255,.22); padding: 2px 10px; border-radius: 12px; align-self: flex-start; }
  .world p { font-weight: 800; opacity: .95; }
  .world .meta { margin-top: auto; font-weight: 900; }
  .world.mkcard { background: linear-gradient(135deg, #3B4A7A, #5C6FA8); }
  .homefoot { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
  .homefoot p { color: var(--muted); font-weight: 800; font-size: .9rem; flex: 1; min-width: 240px; }

  /* World screen */
  .listwrap { flex: 1; overflow-y: auto; padding: 18px; }
  .sect { max-width: 1080px; margin: 0 auto 16px; }
  .sect h3 { font-size: 1.35rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
  .sect h3 small { font-family: 'Nunito'; font-size: .9rem; color: var(--muted); font-weight: 800; }
  .stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
  .lvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tile { background: #fff; border-radius: 18px; padding: 12px; border: 2px solid var(--line); text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 108px; position: relative; box-shadow: 0 3px 0 #E2DDF3; }
  .tile:active { transform: translateY(2px); }
  .tile.locked { opacity: .45; pointer-events: none; }
  .tile .n { font-family: 'Baloo 2'; font-weight: 800; color: var(--purple); }
  .tile b { font-size: 1.02rem; line-height: 1.2; }
  .tile .stars { margin-top: auto; font-size: 1.2rem; letter-spacing: 1px; }
  .tile .lock { position: absolute; top: 8px; right: 10px; font-size: 1.1rem; }
  .tile .tag { font-size: .72rem; font-weight: 900; color: #fff; background: var(--red); border-radius: 8px; padding: 1px 6px; align-self: flex-start; }
  .tile.st { min-height: 90px; }

  /* Play screen */
  .play { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr); gap: 10px; padding: 10px; min-height: 0; }
  @media (orientation: portrait), (max-width: 900px) { .play { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1.1fr); } }
  .panel { background: #fff; border-radius: 20px; border: 2px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .goalbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 6px; }
  .goalbar p { flex: 1; font-weight: 800; font-size: 1.08rem; line-height: 1.3; }
  .say { width: 44px; height: 44px; border-radius: 50%; background: #FFE9A8; font-size: 1.2rem; flex-shrink: 0; box-shadow: 0 2px 0 #E8C25A; }
  .boardwrap { flex: 1; position: relative; min-height: 0; }
  #board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
  .msg { margin: 0 12px; min-height: 48px; border-radius: 14px; padding: 10px 12px; font-weight: 800; line-height: 1.35; background: #F1EEFB; }
  .msg.good { background: #E1F7EA; } .msg.bad { background: #FDE8E7; }
  .runbar { display: flex; gap: 8px; padding: 10px 12px 12px; align-items: center; flex-wrap: wrap; }
  .gobtn { height: 60px; padding: 0 26px; border-radius: 18px; background: var(--green); color: #fff; font-family: 'Baloo 2'; font-weight: 800; font-size: 1.55rem; box-shadow: 0 4px 0 #1F8A54; }
  .gobtn.stop { background: var(--orange); box-shadow: 0 4px 0 #C9621C; }
  .rb { height: 52px; min-width: 52px; padding: 0 14px; border-radius: 14px; background: #ECE7FA; font-weight: 900; box-shadow: 0 3px 0 #D3CBEA; display: inline-flex; align-items: center; gap: 6px; }
  .rb.on { background: var(--navy); color: #fff; box-shadow: 0 3px 0 #111A38; }
  .codehead { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; flex-wrap: wrap; }
  .codehead h3 { font-size: 1.2rem; flex: 1; }
  .count { font-weight: 900; color: var(--muted); }
  .tabs { display: flex; gap: 6px; padding: 0 12px 6px; }
  .tab { height: 40px; padding: 0 14px; border-radius: 12px; background: #ECE7FA; font-weight: 900; }
  .tab.on { background: var(--fn); color: #fff; }
  .prog { flex: 1; overflow-y: auto; margin: 0 12px; padding: 8px; border-radius: 14px; background: #F6F4FD; border: 2px dashed #D9D2F0; min-height: 90px; touch-action: pan-y; }
  .toolbox { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px; border-top: 2px solid var(--line); background: #FBFAFF; }
  .toolbox .lbl { width: 100%; font-weight: 900; font-size: .8rem; color: var(--muted); letter-spacing: .5px; }

  /* blocks */
  .blk { border-radius: 12px; color: #fff; font-weight: 900; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; box-shadow: 0 3px 0 rgba(0,0,0,.18); touch-action: none; font-size: 1rem; }
  .blk .ico { font-size: 1.35rem; line-height: 1; }
  .blk.big .ico { font-size: 1.9rem; }
  .blk.mv { background: var(--move); } .blk.lp { background: var(--loop); } .blk.un { background: var(--until); } .blk.cf { background: var(--if); } .blk.vr { background: var(--var); } .blk.fn { background: var(--fn); }
  .toolbox .blk { cursor: grab; }
  .toolbox .blk.big { min-width: 64px; min-height: 60px; justify-content: center; }
  .node { margin: 4px 0; }
  .node > .blk { width: 100%; }
  .node.sel > .blk { outline: 3px solid var(--yellow); outline-offset: 1px; }
  .node.run > .blk { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--green); }
  .node.err > .blk { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--red); }
  .node .x { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; background: rgba(0,0,0,.2); color: #fff; font-size: 1rem; display: none; }
  .node.sel > .blk .x { display: inline-block; }
  .cwrap { border-radius: 12px; }
  .cwrap > .blk { border-radius: 12px 12px 0 0; width: 100%; }
  .cbody { margin-left: 14px; padding: 4px 0 4px 8px; border-left: 6px solid var(--loop); min-height: 30px; }
  .cfoot { height: 12px; border-radius: 0 0 10px 10px; width: 50%; }
  .lp-w .cbody { border-color: var(--loop); } .lp-w .cfoot { background: var(--loop); }
  .un-w .cbody { border-color: var(--until); } .un-w .cfoot { background: var(--until); }
  .cf-w .cbody { border-color: var(--if); } .cf-w .cfoot { background: var(--if); }
  .elselbl { background: var(--if); color: #fff; font-weight: 900; padding: 4px 12px; border-radius: 0 10px 10px 0; display: inline-block; font-size: .9rem; }
  .num { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.25); border-radius: 10px; padding: 2px; }
  .num button { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.3); color: #fff; font-weight: 900; font-size: 1.1rem; }
  .num span { min-width: 22px; text-align: center; font-size: 1.15rem; }
  .pick { background: rgba(255,255,255,.28); border-radius: 10px; padding: 6px 10px; color: #fff; font-weight: 900; }
  .slot { display: flex; align-items: center; gap: 8px; height: 40px; border-radius: 10px; border: 2px dashed #B9AEE0; color: #8A7FB5; font-weight: 900; font-size: .9rem; padding: 0 10px; width: 100%; }
  .slot.cur { border-color: var(--green); color: var(--green); background: #E6F8EE; border-style: solid; }
  .gap { height: 10px; border-radius: 6px; margin: 2px 0; }
  .dragging .gap { height: 26px; background: rgba(46,184,114,.10); border: 2px dashed rgba(46,184,114,.35); }
  .gap.hot, .slot.hot { background: rgba(46,184,114,.35) !important; border-color: var(--green) !important; }
  .ghost { position: fixed; z-index: 60; pointer-events: none; opacity: .9; transform: translate(-50%, -60%) scale(1.05); }
  .prog.kids { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; }
  .prog.kids .node { margin: 3px 0; }
  .prog.kids .node > .blk { width: auto; min-width: 66px; min-height: 62px; justify-content: center; position: relative; }
  .prog.kids .node > .blk .x { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; background: var(--red); border: 2px solid #fff; font-size: .8rem; }
  .prog.kids .gap { width: 6px; height: 62px; margin: 0; }
  .dragging .prog.kids .gap { width: 26px; height: 62px; }
  .prog.kids .slot { width: 66px; height: 62px; justify-content: center; font-size: 1.5rem; padding: 0; }
  .prog.kids .empty { width: 100%; }
  .stepnum { position: absolute; bottom: -2px; left: 4px; font-size: .7rem; opacity: .85; }
  .empty { color: var(--muted); font-weight: 800; padding: 10px; text-align: center; }

  /* result + modals */
  .scrim { position: fixed; inset: 0; background: rgba(20,28,55,.5); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
  .scrim.show { display: flex; }
  .card { background: #fff; border-radius: 26px; width: min(540px, 100%); padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 92%; overflow-y: auto; }
  .card.center { text-align: center; animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
  @keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
  .card h2 { font-size: 2rem; }
  .card p { font-weight: 800; color: #3A4660; line-height: 1.45; margin-top: 8px; font-size: 1.08rem; }
  .bigstars { font-size: 3rem; letter-spacing: 4px; margin-top: 4px; }
  .bigstars .off { filter: grayscale(1); opacity: .25; }
  .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; justify-content: center; }
  .champs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
  .champ { border: 3px solid var(--line); border-radius: 18px; padding: 8px; background: #fff; display: flex; flex-direction: column; align-items: center; font-weight: 900; }
  .champ img { width: 80px; height: 80px; object-fit: contain; }
  .champ.on { border-color: var(--purple); background: #F3ECFF; }
  .champ small { color: var(--muted); }
  #fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }
  .toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: var(--navy); color: #fff; font-weight: 900; padding: 10px 18px; border-radius: 14px; opacity: 0; transition: opacity .2s; z-index: 70; pointer-events: none; max-width: 92%; text-align: center; }
  .toast.show { opacity: 1; }

  /* station */
  .station { flex: 1; overflow-y: auto; padding: 18px; }
  .stwrap { max-width: 760px; margin: 0 auto; }
  .q { font-family: 'Baloo 2'; font-size: 1.6rem; font-weight: 700; line-height: 1.25; display: flex; gap: 10px; align-items: flex-start; }
  .q span { flex: 1; }
  .lesson { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 16px; margin-bottom: 14px; display: flex; gap: 12px; align-items: flex-start; }
  .lesson p { font-weight: 800; font-size: 1.12rem; line-height: 1.5; flex: 1; }
  .quiz { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 16px; }
  .opts { display: grid; gap: 10px; margin-top: 12px; }
  .opt { text-align: left; padding: 12px 14px; border-radius: 16px; border: 3px solid var(--line); background: #fff; font-weight: 900; font-size: 1.15rem; display: flex; gap: 12px; align-items: center; min-height: 60px; }
  .opt .oe { font-size: 1.6rem; min-width: 34px; text-align: center; }
  .opt.right { background: #E1F7EA; border-color: var(--green); } .opt.wrong { background: #FDE8E7; border-color: var(--red); }
  .streak { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-weight: 900; color: var(--muted); }
  .streak i { width: 38px; height: 38px; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center; font-style: normal; color: #fff; }
  .streak i.on { background: var(--green); }
  .explain { margin-top: 12px; background: #FFF4D6; border: 3px solid #F3D27A; border-radius: 16px; padding: 12px; font-weight: 800; line-height: 1.45; display: none; }
  .explain.show { display: block; }
  .mastered { margin-top: 12px; background: #E1F7EA; border: 3px solid var(--green); border-radius: 16px; padding: 12px; font-weight: 900; display: none; text-align: center; }
  .mastered.show { display: block; }

  /* maker */
  .maker { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; padding: 10px; min-height: 0; }
  @media (orientation: portrait), (max-width: 900px) { .maker { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } }
  .paints { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px; }
  .paint { height: 64px; border-radius: 14px; background: #F1EEFB; font-weight: 900; font-size: .78rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 3px solid transparent; }
  .paint .ico { font-size: 1.5rem; }
  .paint.on { border-color: var(--purple); background: #F3ECFF; }
  .mk { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
  .mk label { font-weight: 900; font-size: .85rem; color: var(--muted); }
  .seg { display: flex; gap: 6px; flex-wrap: wrap; }
  .seg button { height: 44px; padding: 0 12px; border-radius: 12px; background: #ECE7FA; font-weight: 900; }
  .seg button.on { background: var(--navy); color: #fff; }
  .slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .slots button { height: 48px; border-radius: 12px; background: #F1EEFB; font-weight: 900; font-size: .85rem; border: 2px solid transparent; }
  .slots button.on { border-color: var(--purple); }
  .slots button.full { background: #E6DCFB; }
  .mknote { font-weight: 800; font-size: .85rem; color: var(--muted); }
  .check { font-weight: 900; padding: 8px 10px; border-radius: 12px; }
  .check.ok { background: #E1F7EA; color: #1F7A4B; } .check.no { background: #FDE8E7; color: #B23B38; }

  /* teacher */
  .keys { font-size: .95rem; }
  .keys h3 { margin: 14px 0 6px; }
  .keys li { list-style: none; padding: 6px 0; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; gap: 10px; }
  .keys li b { min-width: 170px; }
  .keys code { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; background: #F4F1FC; padding: 2px 6px; border-radius: 6px; white-space: pre-wrap; }
  input.pin { font-size: 1.6rem; letter-spacing: 8px; width: 160px; text-align: center; border: 3px solid var(--line); border-radius: 14px; padding: 8px; font-family: inherit; font-weight: 900; -webkit-user-select: text; user-select: text; }
  [hidden] { display: none !important; }
  .blk.pn { background: #0F9AA8; }
  .swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; vertical-align: -3px; margin-right: 4px; }
  .count { white-space: nowrap; }
  .seg.mini { flex-shrink: 0; display: inline-flex; gap: 4px; background: #ECE7FA; border-radius: 12px; padding: 3px; }
  .seg.mini button { height: 40px; padding: 0 10px; border-radius: 10px; font-weight: 900; font-size: .85rem; }
  .seg.mini button.on { background: var(--navy); color: #fff; }
  .capnote { font-size: .92rem !important; color: #8A5A00 !important; background: #FFF4D6; border-radius: 10px; padding: 6px 10px; }
  .pick { display: inline-flex; align-items: center; gap: 4px; }
  .pick svg { background: rgba(255,255,255,.9); border-radius: 6px; }
  .poppick { position: fixed; z-index: 80; background: #fff; border-radius: 16px; box-shadow: 0 14px 40px rgba(20,28,55,.35); padding: 10px; display: grid; gap: 6px; max-width: min(380px, 94vw); max-height: 70vh; overflow-y: auto; border: 2px solid var(--line); }
  .poppick .ptitle { grid-column: 1 / -1; font-weight: 900; color: var(--muted); font-size: .85rem; padding: 2px 4px; }
  .popt { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: #F4F1FC; font-weight: 900; text-align: left; min-height: 52px; border: 2px solid transparent; }
  .popt.on { border-color: var(--purple); background: #EFE6FF; }
  .popt .pv { display: flex; flex-direction: column; line-height: 1.1; } .popt .pv b { font-size: 1.1rem; } .popt .pv small { color: var(--muted); font-size: .75rem; }
  .swatch.big { width: 26px; height: 26px; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
  .rule { font: 900 1.4rem 'Baloo 2', sans-serif; text-align: center; background: #EAF1FF; color: #2E6FD8; border-radius: 14px; padding: 10px; margin-top: 10px; }
  .shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
  .shape { background: #F7F5FD; border-radius: 14px; padding: 8px; text-align: center; font-weight: 800; font-size: .9rem; }
  .shape b { display: block; font-size: 1.15rem; color: #2E6FD8; }
  .turns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .turns div { background: #F7F5FD; border-radius: 12px; padding: 4px 10px 4px 4px; display: flex; align-items: center; gap: 6px; font-weight: 900; }
  .codebig { font: 800 2.1rem ui-monospace, Menlo, monospace; letter-spacing: 3px; text-align: center; background: #1E2235; color: #FFD54F; border-radius: 16px; padding: 14px; margin-top: 12px; -webkit-user-select: all; user-select: all; }
  input.codein { width: 100%; font: 800 1.7rem ui-monospace, Menlo, monospace; letter-spacing: 3px; text-align: center; border: 3px solid var(--line); border-radius: 14px; padding: 10px; margin-top: 12px; text-transform: uppercase; -webkit-user-select: text; user-select: text; }
  .pyarea { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  .edwrap { flex: 1; display: flex; margin: 0 12px; border-radius: 14px; background: #1E2235; overflow: hidden; min-height: 140px; position: relative; }
  .gutter { width: 40px; flex-shrink: 0; padding: 12px 6px 12px 0; text-align: right; color: #6C7395; font: 600 17px/1.55 ui-monospace, Menlo, Consolas, monospace; background: #171A2B; user-select: none; }
  .edin { flex: 1; position: relative; overflow: hidden; }
  .edin pre, .edin textarea { position: absolute; inset: 0; margin: 0; padding: 12px; font: 600 17px/1.55 ui-monospace, Menlo, Consolas, monospace; white-space: pre; tab-size: 4; border: none; outline: none; letter-spacing: 0; }
  .edin pre { color: #E8EAF6; pointer-events: none; overflow: visible; }
  .edin textarea { background: transparent; color: transparent; caret-color: #FFD54F; resize: none; overflow: auto; -webkit-user-select: text; user-select: text; z-index: 2; }
  .edin textarea::selection { background: rgba(255,213,79,.3); }
  .linemark { position: absolute; left: 0; right: 0; display: none; pointer-events: none; z-index: 1; }
  .linemark.run { background: rgba(46,184,114,.28); box-shadow: inset 4px 0 0 #2EB872; }
  .linemark.err { background: rgba(239,83,80,.3); box-shadow: inset 4px 0 0 #EF5350; }
  .h-kw { color: #C792EA; } .h-fn { color: #82AAFF; } .h-num { color: #F78C6C; } .h-str { color: #C3E88D; } .h-com { color: #7F87AA; font-style: italic; }
  .console { margin: 8px 12px 0; border-radius: 12px; background: #11131F; color: #C3E88D; font: 600 15px/1.4 ui-monospace, Menlo, monospace; padding: 6px 10px; min-height: 32px; max-height: 80px; overflow-y: auto; }
  .console:empty::before { content: 'Output from print() shows here'; color: #5C6386; font-style: italic; }
  .snips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; border-top: 2px solid var(--line); background: #FBFAFF; margin-top: 8px; }
  .snips .lbl, .pyblocks .lbl, .pyshow .lbl { width: 100%; font-weight: 900; font-size: .78rem; color: var(--muted); letter-spacing: .5px; font-family: 'Nunito', sans-serif; }
  .snip { background: #1E2235; color: #E8EAF6; border-radius: 10px; padding: 8px 10px; font: 600 15px ui-monospace, Menlo, monospace; min-height: 42px; }
  .edtools { display: flex; gap: 6px; padding: 0 12px 8px; }
  .pyblocks { margin: 8px 12px 0; padding: 8px; border-radius: 12px; background: #F6F4FD; border: 2px dashed #D9D2F0; max-height: 150px; overflow-y: auto; }
  .mini.blk { min-height: 30px; font-size: .82rem; padding: 0 8px; margin: 2px 0; display: flex; width: fit-content; }
  .mini.blk .ico { font-size: 1rem; }
  .minibody { margin-left: 16px; border-left: 4px solid var(--loop); padding-left: 6px; }
  .pyshow { margin: 8px 12px 0; border-radius: 12px; background: #1E2235; color: #E8EAF6; font: 600 14px/1.5 ui-monospace, Menlo, monospace; padding: 8px 0; max-height: 34%; overflow-y: auto; white-space: pre; }
  .pyshow .lbl { color: #8F96BD; padding: 0 10px 4px; }
  .pyshow .pl { padding: 0 10px; } .pyshow .pl.run { background: rgba(46,184,114,.3); } .pyshow .pl.err { background: rgba(239,83,80,.35); }
  .cheat table { width: 100%; border-collapse: collapse; margin-top: 10px; }
  .cheat td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-weight: 700; }
  .cheat td code, .cheat pre { font: 600 15px ui-monospace, Menlo, monospace; background: #1E2235; color: #E8EAF6; border-radius: 8px; padding: 3px 8px; display: inline-block; white-space: pre; }
  .cheat pre { display: block; padding: 8px 10px; margin-top: 4px; }
  .cheat h3 { margin-top: 14px; }
  @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
