/* COPA MCQ – Excel Formula Lab */
.xl-top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.xl-cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.xl-cats button { flex: none; display: inline-flex; gap: 8px; align-items: center; padding: 9px 15px; border-radius: 999px; border: 1px solid #dfe6dd; background: #fff; color: var(--ink-2); font: 600 13.5px var(--font-head); cursor: pointer; transition: all .2s; }
.xl-cats button i { color: #107c41; }
.xl-cats button small { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #eef5ef; color: #107c41; }
.xl-cats button:hover { border-color: #107c41; color: #107c41; }
.xl-cats button.on { background: #107c41; border-color: #107c41; color: #fff; box-shadow: 0 8px 18px rgba(16, 124, 65, .3); }
.xl-cats button.on i { color: #fff; } .xl-cats button.on small { background: rgba(255, 255, 255, .22); color: #fff; }
.xl-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.xl-bar .sh-search { flex: 1; max-width: 460px; }
.xl-prog { margin-left: auto; display: inline-flex; gap: 10px; align-items: center; font: 600 13px var(--font-head); color: var(--ink-2); background: #fff; border: 1px solid #e3e9e2; border-radius: 999px; padding: 5px 14px 5px 5px; }
.xl-prog .ring { --p: 0; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(closest-side, #fff 64%, transparent 66%), conic-gradient(#107c41 calc(var(--p) * 1%), #e3efe6 0); }

.xl-wrap { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 18px; align-items: start; }
.xl-list { position: sticky; top: calc(var(--header-h) + 12px); max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto; padding: 10px; border-radius: 20px; background: #fff; border: 1px solid #e3e9e2; box-shadow: 0 8px 22px rgba(15, 35, 30, .05); scrollbar-width: thin; }
.xl-lh { margin: 12px 6px 6px; font: 700 11.5px var(--font-head); letter-spacing: 1px; text-transform: uppercase; color: var(--cc, #107c41); display: flex; gap: 6px; align-items: center; }
.xl-lh:first-child { margin-top: 2px; } .xl-lh small { text-transform: none; letter-spacing: 0; color: var(--ink-3); font-weight: 600; }
.c-basic { --cc: #107c41; } .c-mid { --cc: #1a73e8; } .c-date { --cc: #c2410c; } .c-pdf { --cc: #8e24aa; } .c-test { --cc: #0e7490; }
.xl-li { position: relative; display: block; width: 100%; text-align: left; padding: 8px 30px 8px 12px; margin-bottom: 3px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; transition: background .15s; }
.xl-li b { display: block; font: 700 13.5px var(--font-head); color: var(--ink); }
.xl-li code { display: block; font: 500 11.5px "Roboto Mono", ui-monospace, Consolas, monospace; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl-li .ok { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #16a34a; }
.xl-li:hover { background: #f3f7f4; }
.xl-li.on { background: color-mix(in srgb, var(--cc) 11%, #fff); box-shadow: inset 3px 0 0 var(--cc); }
.xl-li.on b { color: var(--cc); }
.xl-empty { text-align: center; color: var(--ink-3); }

.xl-card { background: #fff; border: 1px solid #e3e9e2; border-radius: 24px; padding: 22px; box-shadow: 0 10px 28px rgba(15, 35, 30, .06); animation: xlIn .3s ease; }
@keyframes xlIn { from { opacity: 0; transform: translateY(8px); } }
.xl-h { position: relative; padding-right: 210px; margin-bottom: 14px; }
.xl-h .cat { display: inline-block; font: 700 11.5px var(--font-head); letter-spacing: .8px; text-transform: uppercase; color: #fff; background: var(--cc); padding: 4px 11px; border-radius: 999px; }
.xl-h h2 { margin: 8px 0 4px; font: 800 clamp(24px, 3vw, 32px) var(--font-head); color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.xl-h .okb { font: 600 12.5px var(--font-head); color: #15803d; background: #e8f8ee; padding: 4px 10px; border-radius: 999px; }
.xl-h p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.xl-acts { position: absolute; right: 0; top: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.xl-syn { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-radius: 16px; background: #0f2a1d; margin-bottom: 16px; }
.xl-syn .lb { font: 700 11px var(--font-head); letter-spacing: 1px; text-transform: uppercase; color: #8fd3a9; }
.xl-syn code { font: 600 16px/1.6 "Roboto Mono", ui-monospace, Consolas, monospace; color: #e6f4ea; word-break: break-all; }
.xl-syn code span { color: color-mix(in srgb, var(--c) 55%, #fff); border-bottom: 3px solid var(--c); padding: 0 1px; }

.xl-grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.xl-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Excel window */
.xw { border-radius: 14px; overflow: hidden; border: 1px solid #c8d6cc; background: #fff; box-shadow: 0 10px 26px rgba(16, 124, 65, .12); }
.xw-title { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: linear-gradient(90deg, #107c41, #185c37); color: #fff; font: 600 13px var(--font-head); }
.xw-logo { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; background: #fff; color: #107c41; font: 900 13px var(--font-head); }
.xw-title b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.xw-dots { display: flex; gap: 6px; } .xw-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.xw-fx { display: flex; align-items: center; gap: 0; border-bottom: 1px solid #d6dde3; background: #f8faf9; }
.xw-nb { width: 64px; flex: none; border: 0; border-right: 1px solid #d6dde3; background: #fff; padding: 8px; font: 600 13px var(--font-head); text-align: center; color: var(--ink); }
.xw-fxl { flex: none; display: flex; align-items: center; gap: 9px; padding: 0 10px; color: #9aa3ad; font-size: 12px; border-right: 1px solid #d6dde3; height: 34px; }
.xw-fxl b { font: italic 700 14px Georgia, serif; color: #5f6b75; }
.xw-fb { flex: 1; min-width: 0; border: 0; padding: 8px 10px; font: 500 14px "Roboto Mono", ui-monospace, Consolas, monospace; color: var(--ink); background: #fff; outline: none; }
.xw-fb:focus { box-shadow: inset 0 -2px 0 #107c41; }
.xw-scroll { overflow: auto; max-height: 420px; outline: none; }
.xw-scroll:focus-visible { box-shadow: inset 0 0 0 2px #107c41; }
.xw-grid { border-collapse: collapse; width: 100%; font-size: 13.5px; table-layout: fixed; min-width: max-content; }
.xw-grid th { position: sticky; top: 0; z-index: 1; background: #f3f5f4; color: #5f6b75; font: 600 12px var(--font-head); border: 1px solid #dde3e0; padding: 4px 6px; min-width: 84px; }
.xw-grid tbody th { position: sticky; left: 0; top: auto; min-width: 36px; width: 36px; text-align: center; }
.xw-grid .xw-corner { min-width: 36px; width: 36px; left: 0; z-index: 2; }
.xw-grid td { position: relative; border: 1px solid #e3e7e5; padding: 0 7px; height: 30px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); cursor: cell; background: #fff; font-family: "Roboto", "Noto Sans Devanagari", Arial, sans-serif; }
.xw-grid td.n { text-align: right; } .xw-grid td.b, .xw-grid td.e { text-align: center; } .xw-grid td.e { color: #d93025; font-weight: 700; }
.xw-grid td.hl { background: color-mix(in srgb, var(--hc) 11%, #fff); box-shadow: inset 0 0 0 1.5px var(--hc); }
.xw-grid td.fx { font-weight: 600; }
.xw-grid td.main { background: #e7f5ec; color: #0b5d30; font-weight: 700; }
.xw-grid td.xc { background: repeating-linear-gradient(45deg, #fff8ec 0 6px, #fff 6px 12px); box-shadow: inset 0 0 0 2px #f59e0b; }
.xw-grid td.xc:empty::after { content: "?"; color: #f59e0b; font-weight: 800; }
.xw-grid td.sel { box-shadow: inset 0 0 0 2.5px #107c41 !important; z-index: 1; }
.xw-grid tr:has(td.sel) th { background: #dcefe3; color: #107c41; }
.xw-foot { display: flex; align-items: center; gap: 10px; padding: 5px 8px; background: #f3f5f4; border-top: 1px solid #dde3e0; font-size: 12px; color: var(--ink-3); }
.xw-sheet { flex: none; padding: 3px 12px; background: #fff; border-radius: 0 0 6px 6px; color: #107c41; font: 700 12px var(--font-head); border-bottom: 2px solid #107c41; }
.xw-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.xl-res { padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #107c41, #1f9d5a); color: #fff; box-shadow: 0 10px 22px rgba(16, 124, 65, .25); }
.xl-res .lb { font-size: 12.5px; opacity: .9; } .xl-res .lb b { font-family: var(--font-head); }
.xl-res .big { font: 800 30px/1.25 var(--font-head); margin: 4px 0 2px; word-break: break-word; }
.xl-res .big.bad { color: #ffd6d2; }
.xl-res p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; background: rgba(255, 255, 255, .14); padding: 8px 10px; border-radius: 10px; }
.xl-res p.err { background: rgba(217, 48, 37, .35); }
.xl-parts { padding: 14px; border-radius: 18px; background: #fbfcfb; border: 1px solid #e7ece8; }
.xl-parts h3, .xl-ex h3 { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; font: 700 15.5px var(--font-head); color: var(--ink); }
.xl-parts h3 i { color: #107c41; }
.xl-parts ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.xl-parts li { padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid #edf0ee; border-left: 4px solid var(--c); }
.xl-parts .ph { display: flex; gap: 8px; align-items: center; }
.xl-parts .ph b { font: 700 13.5px "Roboto Mono", ui-monospace, Consolas, monospace; color: var(--c); }
.xl-parts .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.xl-parts .mn { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.xl-parts .vv { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.6; word-break: break-word; }
.xl-parts .vv code { font: 600 12.5px "Roboto Mono", ui-monospace, Consolas, monospace; color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); padding: 1px 6px; border-radius: 6px; }
.xl-parts .vv i { font-size: 11px; margin: 0 3px; } .xl-parts .vv b { color: var(--ink); }
.xl-try { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #fff8e6; border: 1px solid #fde4ae; }
.xl-try > i { color: #d97706; font-size: 18px; margin-top: 2px; }
.xl-try b { font: 700 13.5px var(--font-head); color: #92400e; } .xl-try p { margin: 2px 0 0; font-size: 13.5px; color: #6b4a12; line-height: 1.55; }

.xl-ex { margin-top: 18px; padding: 18px; border-radius: 20px; background: linear-gradient(135deg, #f3fbf6, #fff 70%); border: 1.5px dashed #9fd6b4; }
.xl-ex .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #f59e0b; color: #fff; font-size: 15px; }
.xl-ex .task { margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: var(--ink); }
.xl-ex .cell { display: inline-block; font-size: 12.5px; color: #b45309; background: #fff3dc; padding: 2px 9px; border-radius: 999px; margin-left: 4px; }
.xl-in { display: flex; gap: 8px; align-items: stretch; }
.xl-in .fx { display: grid; place-items: center; padding: 0 12px; border-radius: 12px; background: #e7f5ec; color: #107c41; font: italic 700 15px Georgia, serif; }
.xl-in input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px; border: 2px solid #cfe3d6; font: 600 15px "Roboto Mono", ui-monospace, Consolas, monospace; color: var(--ink); background: #fff; }
.xl-in input:focus { outline: none; border-color: #107c41; box-shadow: 0 0 0 4px rgba(16, 124, 65, .12); }
.xl-in .btn { flex: none; background: #107c41; border-color: #107c41; }
.xl-fb2 { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; min-height: 26px; }
.xl-fb2 .lnk { border: 0; background: none; color: var(--ink-3); font: 600 13px var(--font-head); cursor: pointer; padding: 0; }
.xl-fb2 .lnk:hover { color: #107c41; }
#xlMsg { font: 600 14px var(--font-head); }
#xlMsg.yes { color: #15803d; animation: xlPop .4s; } #xlMsg.no { color: #d93025; } #xlMsg.hint { color: #b45309; font-family: "Roboto Mono", monospace; font-size: 13px; word-break: break-all; }
@keyframes xlPop { 50% { transform: scale(1.06); } }
.xl-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.xl-nav .btn-primary { background: #107c41; border-color: #107c41; }

.xl-tbl { margin-top: 16px; overflow-x: auto; border-radius: 16px; border: 1px solid #e3e9e2; }
.xl-tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.xl-tbl th { background: #f3f7f4; text-align: left; padding: 10px 12px; font: 700 12.5px var(--font-head); color: var(--ink-2); }
.xl-tbl td { padding: 9px 12px; border-top: 1px solid #edf1ee; vertical-align: top; }
.xl-tbl tbody tr { cursor: pointer; transition: background .15s; } .xl-tbl tbody tr:hover { background: #f7fbf8; } .xl-tbl tbody tr.on { background: #e7f5ec; }
.xl-tbl code { font: 600 12.5px "Roboto Mono", ui-monospace, Consolas, monospace; color: #0b5d30; white-space: nowrap; }
.xl-tbl .r { font: 700 14px var(--font-head); color: var(--ink); white-space: nowrap; } .xl-tbl .r.bad { color: #d93025; }
.xl-tbl .m { color: var(--ink-2); min-width: 220px; } .xl-tbl .m a { color: #107c41; font-weight: 600; white-space: nowrap; }
.xl-note { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 18px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }

@media (max-width: 1180px) { .xl-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .xl-wrap { grid-template-columns: minmax(0, 1fr); }
  .xl-list { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px; border-radius: 16px; }
  .xl-lh { display: none; }
  .xl-li { flex: none; width: auto; max-width: 190px; margin: 0; padding: 8px 12px; background: #f5f8f6; }
  .xl-li code { display: none; } .xl-li .ok { position: static; transform: none; margin-left: 6px; } .xl-li b { display: inline; }
}
@media (max-width: 640px) {
  .xl-card { padding: 14px; border-radius: 20px; }
  .xl-h { padding-right: 0; } .xl-acts { position: static; justify-content: flex-start; margin-top: 10px; }
  .xl-syn code { font-size: 13.5px; }
  .xl-prog { margin-left: 0; }
  .xw-grid th { min-width: 72px; } .xw-grid td { height: 32px; font-size: 13px; }
  .xl-res .big { font-size: 24px; }
  .xl-in { flex-wrap: wrap; } .xl-in .fx { display: none; } .xl-in input { flex-basis: 100%; } .xl-in .btn { width: 100%; justify-content: center; }
  .xl-nav .btn { font-size: 13px; }
}
@media print { .xl-top, .xl-list, .xl-acts, .xl-ex, .xl-nav { display: none !important; } .xl-wrap { display: block; } }
