/* KASKOW Lab — Alat Teks: menu samping per kategori + panel pengaturan per fungsi. */
.lab { --ltb-ink: var(--lab-acc); }
[data-theme="dark"] .lab { --ltb-ink: color-mix(in srgb, var(--lab-acc) 50%, #fff); }
.ltb { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 18px; align-items: start; }

/* ---------- menu samping ---------- */
.ltb-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 104px); padding: 12px; border-radius: 18px; border: 1px solid var(--lab-line); background: color-mix(in srgb, var(--text) 2%, var(--lab-card)); }
.ltb-search { position: relative; flex: none; }
.ltb-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ltb-search .lab-in { width: 100%; padding-left: 34px; height: 38px; font-size: .84rem; }
.ltb-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.ltb-cat { display: flex; flex-direction: column; gap: 1px; }
.ltb-cat + .ltb-cat { margin-top: 12px; }
.ltb-cat > b { display: flex; align-items: center; gap: 7px; padding: 0 8px 6px; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ltb-cat > b svg { color: var(--lab-acc); }
.ltb-cat button { position: relative; display: block; width: 100%; padding: 8px 10px 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: .85rem; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer; transition: background .14s, color .14s; }
.ltb-cat button:hover { background: color-mix(in srgb, var(--lab-acc) 7%, transparent); }
.ltb-cat button.on { background: color-mix(in srgb, var(--lab-acc) 13%, transparent); color: var(--ltb-ink); font-weight: 750; }
.ltb-cat button.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(var(--lab-acc2), var(--lab-acc)); }
.ltb-none { margin: 10px 8px; font-size: .82rem; color: var(--muted); }
.ltb-rel { flex: none; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--lab-line); }
.ltb-rel b { padding: 0 8px 4px; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ltb-rel a { padding: 5px 8px; border-radius: 8px; font-size: .8rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.ltb-rel a:hover { color: var(--ltb-ink); background: color-mix(in srgb, var(--lab-acc) 6%, transparent); }

/* ---------- area kerja ---------- */
.ltb-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; scroll-margin-top: 80px; }
.ltb-head { display: flex; gap: 14px; align-items: flex-start; }
.ltb-ic { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; color: var(--ltb-ink); background: color-mix(in srgb, var(--lab-acc) 11%, transparent); }
.ltb-head small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ltb-ink); }
.ltb-head h2 { margin: 2px 0 4px; font-size: 1.28rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.ltb-head p { margin: 0; max-width: 70ch; font-size: .87rem; line-height: 1.55; color: var(--muted); }

/* panel pengaturan */
.ltb-opts { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; padding: 16px; border-radius: 16px; border: 1px solid var(--lab-line); background: linear-gradient(180deg, color-mix(in srgb, var(--lab-acc) 4%, var(--lab-card)), var(--lab-card)); }
.ltb-o { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ltb-o > label:not(.lab-sw) { font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ltb-o.wide { flex: 1 1 100%; }
.ltb-o.half { flex: 1 1 260px; }
.ltb-o.half textarea { width: 100%; min-height: 64px; font-family: var(--lab-mono); font-size: .84rem; }
.ltb-o .lab-seg { flex-wrap: wrap; max-width: 100%; align-self: flex-start; }
.ltb-o .lab-sw { min-height: 40px; }
.ltb-o .lab-in[type="number"] { font-variant-numeric: tabular-nums; }

/* bilah bawah */
.ltb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ltb-bar .grow { flex: 1; }
.ltb-note { font-size: .82rem; font-weight: 650; color: var(--ltb-ink); font-variant-numeric: tabular-nums; }
.ltb-bar .lab-btn[disabled] { opacity: .45; pointer-events: none; }
.ltb-noin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 300px; padding: 24px; border-radius: 16px; border: 1.5px dashed color-mix(in srgb, var(--lab-acc) 30%, var(--lab-line)); color: var(--muted); font-size: .88rem; text-align: center; line-height: 1.5; }
.ltb-noin svg { color: var(--lab-acc); }

/* pemilih fungsi (layar sempit) */
.ltb-pick { display: none; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--lab-acc) 35%, var(--lab-line)); background: color-mix(in srgb, var(--lab-acc) 6%, var(--lab-card)); color: var(--text); text-align: left; cursor: pointer; }
.ltb-pick > svg:first-child { color: var(--lab-acc); }
.ltb-pick span { flex: 1; min-width: 0; }
.ltb-pick small { display: block; font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ltb-ink); }
.ltb-pick b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- penghitung ---------- */
.ltb-tally { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.ltb-tc { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--lab-line); background: color-mix(in srgb, var(--text) 2%, var(--lab-card)); }
.ltb-tc > .lab-in { text-align: center; font-weight: 700; border-color: transparent; background: transparent; }
.ltb-tc > .lab-in:hover { border-color: var(--lab-line); }
.ltb-tv { font-size: 3.4rem; font-weight: 850; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.02em; background: linear-gradient(140deg, var(--lab-acc2), var(--lab-acc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ltb-tv.pop { animation: ltb-pop .22s ease-out; }
@keyframes ltb-pop { 40% { transform: scale(1.12); } }
.ltb-tbtn { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.ltb-tbtn .lab-btn.big { justify-content: center; height: 56px; font-size: 1.6rem; font-weight: 800; border-radius: 14px; }
.ltb-tadd { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px; border-radius: 18px; border: 1.5px dashed color-mix(in srgb, var(--lab-acc) 35%, var(--lab-line)); background: transparent; color: var(--ltb-ink); font-weight: 700; font-size: .88rem; cursor: pointer; }
.ltb-tadd:hover { background: color-mix(in srgb, var(--lab-acc) 5%, transparent); }

/* ---------- responsif ---------- */
@media (max-width: 1080px) {
  .ltb { grid-template-columns: minmax(0, 1fr); }
  .ltb-pick { display: flex; }
  .ltb-nav { display: none; position: static; max-height: none; }
  .ltb-nav.open { display: flex; }
  .ltb-nav.open .ltb-list { max-height: 56vh; }
  .ltb-head .ltb-ic { display: none; }
}
@media (max-width: 1180px) and (min-width: 1081px) {
  .ltb-main .lab-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ltb-opts { padding: 12px; gap: 12px 16px; }
  .ltb-o .lab-in:not([type="number"]) { width: 100% !important; }
  .ltb-o:not(.wide):not(.half) { flex: 1 1 100%; }
  .ltb-head h2 { font-size: 1.12rem; }
  .ltb-bar .lab-btn { flex: 1 1 auto; justify-content: center; }
  .ltb-noin { min-height: 160px; }
}
@media (prefers-reduced-motion: reduce) { .ltb-tv.pop { animation: none; } }
