/* Python, SQL (/cong-cu/lap-trinh). Tệp nạp ở mọi trang → mọi lớp có tiền tố lt-. Ưu tiên màn chiếu 1280–1920px. */
.chinh:has(> .lt) { max-width: 1600px; }
.lt { --lt-ma: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace; --lt-co: 15px; }
.lt.lt--to { --lt-co: 22px; }
.lt:fullscreen { background: var(--bg); padding: 16px clamp(16px, 2.5vw, 36px); overflow: auto; }
.lt [hidden] { display: none !important; }
.lt-an-chu { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lt-dau { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.lt-dau h1 { margin: 0; }
.lt-dau .phu { margin: 2px 0 0; }

.lt-tab { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.lt-tab [role="tab"] { flex: none; min-height: 46px; padding: 8px 22px; border-radius: 999px; border: 1px solid var(--vien); background: var(--the);
  color: var(--chu); font: inherit; font-weight: 700; cursor: pointer; }
.lt-tab [role="tab"]:hover { border-color: var(--c-vien); color: var(--c-dam); }
.lt-tab [role="tab"][aria-selected="true"] { background: var(--c-dam); border-color: var(--c-dam); color: #fff; }

.lt-p { background: var(--the); border: 1px solid var(--vien); border-radius: var(--r); box-shadow: var(--bong); padding: clamp(12px, 1.6vw, 20px); }
.lt-thanh { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 12px; }
.lt-thanh .field { margin: 0; }
.lt-chon { min-width: 220px; flex: 0 1 300px; }
.lt-thanh__nut { margin: 0; }

.lt-khung { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) {
  .lt-khung { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .lt-khung--sql { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
}
.lt-soan, .lt-kq { min-width: 0; }
.lt-ma { border: 1px solid #cfd6d1; border-radius: var(--r-nho); overflow: hidden; background: #fff; }
.lt-ma:focus-within { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.lt-ma .cm-editor { font-size: var(--lt-co); height: clamp(320px, 52vh, 640px); }
.lt-ma--sql .cm-editor { height: clamp(180px, 30vh, 360px); }
.lt-ma .cm-editor.cm-focused { outline: none; }
.lt-ma .cm-scroller { font-family: var(--lt-ma); line-height: 1.5; }
.lt-ma .cm-gutters { background: #f4f6f8; border-right: 1px solid var(--vien); color: #6b7a7c; }
.lt-soan .field__hint { margin: 6px 0 10px; }
.lt-vao { margin: 0; }
.lt-vao textarea { font-family: var(--lt-ma); font-size: var(--lt-co); }

.lt-kq__h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 6px; }
.lt-kq__h h2 { margin: 0; font-size: 1.05rem; }
.lt-ra { margin: 0; min-height: 140px; max-height: clamp(200px, 40vh, 520px); overflow: auto; padding: 12px 14px; border-radius: var(--r-nho);
  background: #0f1f33; color: #e6edf5; font-family: var(--lt-ma); font-size: var(--lt-co); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.lt-ra:empty::before { content: "Bấm Chạy để xem kết quả."; color: #93a4b8; }
.lt-ra__nhap { color: #f0be58; font-weight: 700; }
.lt-nhap { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-nho); background: var(--nhan-nhat); border: 1px solid #f3d49b; }
.lt-nhap label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--nhan-dam); }
.lt-nhap__hang { display: flex; gap: 8px; }
.lt-nhap input { flex: 1; min-width: 0; min-height: 46px; padding: 8px 12px; border: 1px solid #cfd6d1; border-radius: var(--r-nho);
  font-family: var(--lt-ma); font-size: var(--lt-co); background: #fff; }
.lt-loi { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-nho); background: var(--do-nhat); border: 1px solid #f3b9b3; color: #5c1a14; }
.lt-loi p { margin: 0 0 6px; }
.lt-loi__h { font-weight: 800; color: var(--do); }
.lt-loi__goc { display: block; margin: 4px 0 8px; font-family: var(--lt-ma); font-size: .875rem; color: #7a2a22; word-break: break-word; }
.lt-rua { margin-top: 12px; border: 1px solid var(--vien); border-radius: var(--r-nho); background: #fff; overflow: auto; max-width: 100%; }
.lt-rua canvas { display: block; max-width: none; }

/* SQL */
.lt-sql-cau { margin: 12px 0 6px; font-weight: 700; color: var(--c-dam); }
.lt-bang-khung { overflow: auto; max-height: clamp(240px, 45vh, 560px); border: 1px solid var(--vien); border-radius: var(--r-nho); }
.lt-bang { border-collapse: collapse; width: 100%; font-size: calc(var(--lt-co) - 1px); }
.lt-bang th, .lt-bang td { padding: 6px 10px; border-bottom: 1px solid var(--vien); text-align: left; white-space: nowrap; }
.lt-bang th { position: sticky; top: 0; background: var(--c-nhat); color: var(--c-dam); font-weight: 700; }
.lt-bang tbody tr:nth-child(even) { background: #fafbfa; }
.lt-bang__so { text-align: right !important; font-variant-numeric: tabular-nums; }
.lt-bang__rong { color: var(--phu); font-style: italic; }
.lt-cau-truc { border: 1px solid var(--vien); border-radius: var(--r-nho); padding: 12px; background: #fbfcfb; }
.lt-cau-truc h2 { font-size: 1.05rem; margin-bottom: 8px; }
.lt-ct { padding: 8px 0; border-top: 1px solid var(--vien); }
.lt-ct:first-child { border-top: 0; padding-top: 0; }
.lt-ct__h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lt-ct__ten { border: 0; background: none; padding: 4px 0; min-height: 36px; font: inherit; font-weight: 800; color: var(--c-dam); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }
.lt-ct__dem { font-size: .8125rem; color: var(--phu); }
.lt-ct ul { list-style: none; margin: 2px 0 0; padding: 0; }
.lt-ct li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 2px 0; font-size: .9375rem; }
.lt-ct__cot { font-family: var(--lt-ma); }
.lt-ct__kieu { font-size: .8125rem; color: var(--phu); }
.lt-ct .nhan { font-size: .75rem; }

@media (max-width: 640px) {
  .lt-chon { flex: 1 1 100%; min-width: 0; }
  .lt-ma .cm-editor { height: 300px; }
  .lt-thanh__nut .nut { flex: 1 1 auto; }
}
.lt-dau [aria-pressed="true"] { background: var(--c-dam); border-color: var(--c-dam); color: #fff; }
