
.cp { container: cp / inline-size; --ct-slate: #42495c; --ct-card: #f0f0f0; --ct-node: #faa019; --ct-blue: #00a3ff;
  --ct-gold: #ffc144; --ct-red: #f9595f; --ct-gap: 6px; }
.cp .calc-head { padding-bottom: 10px; }
.calc.cp { overflow: clip; }
.ct-body { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 2px solid var(--frame); }
.ct-win { background: var(--ct-slate); border-bottom: 2px solid #000; padding: 0 10px; min-width: 0; }
.ct-cat { position: relative; container: ctc / inline-size; }
.ct-cat[data-off] { display: none; }
.ct-grid { --cw: calc((100cqi - 8px) / 4); --d: min(62px, calc(var(--cw) * .7)); list-style: none; margin: 0;
  padding: 6px 4px 4px; display: grid; grid-template-columns: repeat(var(--cols), var(--cw)); justify-content: center;
  row-gap: 2px; background: var(--ct-card); border-radius: 16px; }
.ct-c4 { --cols: 4; }
.ct-c3 { --cols: 3; }
.ct-grid > li { min-width: 0; }
.ct-node { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; padding: 8px 0 4px;
  border: 0; border-radius: 12px; background: none; color: #fff; font: inherit; cursor: pointer; touch-action: manipulation; }
@media (hover: hover) { .ct-node:hover { background: rgba(0, 0, 0, .06); } }   
.cp .ct-node:focus-visible { outline: 3px solid var(--btn); outline-offset: -3px; }
.ct-disc { --d0: var(--d, 40px); flex: none; display: grid; place-items: center; box-sizing: border-box;
  width: var(--d0); height: var(--d0); border: 3px solid #000; border-radius: 50%; background: var(--ct-node);
  box-shadow: inset calc(var(--d0) * .07) calc(var(--d0) * -.07) 0 rgba(0, 0, 0, .15); }
.ct-disc img { width: calc(var(--d0) * .72); height: calc(var(--d0) * .72); object-fit: contain; }
.ct-disc.sm { --d0: 40px; border-width: 2px; }
.ct-disc.lg { --d0: 68px; }
.ct-node.is-plan .ct-disc { outline: 3px solid var(--ct-blue); outline-offset: 2px; }
.ct-lv { display: block; height: 22px; margin-top: 5px; font: 400 min(16px, calc(var(--cw) / 4))/22px var(--game); white-space: nowrap;
  -webkit-text-stroke: .2em #000; paint-order: stroke fill; font-variant-numeric: tabular-nums; }
.ct-node.is-plan .ct-lv { color: var(--ct-gold); }
.ct-node.is-warn .ct-lv { color: #ff8a8a; }
.ct-ord { position: absolute; top: 2px; left: calc(50% + var(--d0, var(--d)) / 2 - 12px); box-sizing: border-box;
  min-width: 24px; height: 24px; padding: 0 5px; border: 2px solid #000; border-radius: 12px; background: var(--ct-blue);
  color: #fff; font: 400 15px/20px var(--game); text-align: center; -webkit-text-stroke: .18em #000; paint-order: stroke fill; }
.ct-ord:empty { display: none; }
html[data-cp] :is(.ct-lv, .ct-node .ct-ord, .ct-tab-n) { visibility: hidden; }
.ct-tabs { display: flex; flex-wrap: wrap; gap: 10px 8px; margin: 0 -10px; padding: 12px 10px; }
.ct-tab { position: relative; flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 2px 14px 5px;
  border: 2px solid #000; border-radius: 99px; background: #2b303d; color: #fff; font: 400 16px/1.1 var(--game);
  cursor: pointer; touch-action: manipulation; }
.ct-tab[aria-selected=true] { background: var(--btn); box-shadow: inset 0 -4px 0 var(--lip); -webkit-text-stroke: .14em #000;
  paint-order: stroke fill; }
.cp .ct-tab:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }   
.ct-tab-n { position: absolute; top: -7px; right: -5px; box-sizing: border-box; min-width: 22px; height: 22px; padding: 0 5px;
  border: 2px solid #000; border-radius: 11px; background: var(--ct-gold); color: #000; font: 700 13px/18px var(--font-num);
  text-align: center; -webkit-text-stroke: 0; }
.ct-tab-n:empty { display: none; }
.ct-mini { position: sticky; bottom: 0; z-index: 3; box-sizing: border-box; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; height: 56px; margin: 14px -10px 0; padding: 0 12px 0 10px;
  background: var(--ct-slate); border-top: 2px solid #000; box-shadow: 0 -4px 10px rgba(0, 0, 0, .18); }
.ct-mini .ct-pill { flex: none; margin: 0 0 0 14px; height: 34px; }
.ct-mini .cp-chip { flex: 0 1 auto; min-width: 0; max-width: 9em; white-space: normal; line-height: 1.25; padding: 3px 8px;
  text-wrap: balance; }
html[data-cp] .ct-mini [data-m] { visibility: hidden; }
@media (max-height: 480px) { .ct-mini { position: static; box-shadow: none; } }
.ct-side { min-width: 0; padding: 12px 14px 14px; display: grid; gap: 12px; align-content: start; container: cts / inline-size; }
.ct-sum { display: grid; gap: 10px; }
.ct-tot { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "pill pts" "lab pts";
  gap: 8px 12px; align-items: start; }
.ct-pill { grid-area: pill; position: relative; display: flex; align-items: center; box-sizing: border-box; width: 8.4em;
  max-width: calc(100% - 12px); height: 36px; margin: 4px 0 0 12px; padding: 0 8px 3px 32px; border-radius: 10px;
  background: rgba(0, 0, 0, .86); box-shadow: inset 0 0 0 2px #fff; color: #fff; font: 400 18px/1 var(--game);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-pill img { position: absolute; left: -14px; top: 50%; width: 44px; height: 44px; object-fit: contain; transform: translateY(-50%); }
.ct-tot-l { grid-area: lab; display: grid; gap: 1px; color: var(--muted); font-size: var(--fs-2); line-height: 1.3; min-width: 0; }
.ct-tot-l b { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--ink); }
.cp-or { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; white-space: nowrap; min-height: calc(var(--cp-or, 1) * 1lh); }
.cp-or .ico { width: 16px; height: 16px; }
.ct-pts { grid-area: pts; display: grid; justify-items: end; text-align: right; color: var(--muted); font-size: var(--fs-2);
  max-width: 8.5rem; }
.ct-pts b { display: grid; font: 750 1.45rem/1.15 var(--font-num); font-stretch: 85%; color: var(--big); font-variant-numeric: tabular-nums; }
.ct-pts b::after { content: "99,999,999"; height: 0; visibility: hidden; overflow: hidden; }
.ct-wk .calc-field label { margin-bottom: 4px; }
.cp-l1, .cp-l2 { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; overflow: hidden; display: -webkit-box;
  -webkit-box-orient: vertical; font-variant-numeric: tabular-nums; }
.cp-l1 { min-height: calc(var(--cp-l1) * 1.45em); -webkit-line-clamp: var(--cp-l1); }
.cp-l2 { min-height: calc(var(--cp-l2) * 1.45em); -webkit-line-clamp: var(--cp-l2); font-weight: 600; }
.cp-l1.t-warn { color: var(--warn); font-weight: 600; }
.cp-est { margin-top: -6px; font-size: 13.5px; }
.cp-est summary { cursor: pointer; color: var(--accent); width: max-content; max-width: 100%; min-height: 24px; }
.cp-est-in { display: grid; gap: 10px; margin-top: 8px; }
.cp-k { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.cp-seg { max-width: 100%; box-sizing: border-box; }
.cp-seg button { flex: none; white-space: nowrap; }
.cp-est-out { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; font-weight: 650; }
.cp-est-out .btn-main { min-height: 36px; padding: 4px 14px 8px; font-size: 15px; }
.cp-est .calc-note { color: var(--muted); }
.cp-chip { box-sizing: border-box; min-width: 5.6em; text-align: center; padding: 1px 8px; border-radius: 99px; font-size: 12.5px;
  font-weight: 700; line-height: 1.6; background: var(--code); color: var(--ink); white-space: nowrap; }
.cp-chip:empty { visibility: hidden; }
.cp-chip.t-good { background: var(--good); color: var(--panel); }
.cp-chip.t-warn { background: var(--warn); color: var(--panel); }
:is(.ct-mini, .ct-pop-c) .cp-chip { background: #2b303d; color: #fff; }
:is(.ct-mini, .ct-pop-c) .cp-chip.t-good { background: #097b38; color: #fff; }
:is(.ct-mini, .ct-pop-c) .cp-chip.t-warn { background: #ae4e00; color: #fff; }
.cp-two { display: inline-grid; }
.cp-two > span { grid-area: 1 / 1; text-align: center; }
.cp-two > span + span, .cp-two.is-done > span:first-child, .cp-two.is-undo > span:first-child { visibility: hidden; }
.cp-two.is-done > span + span, .cp-two.is-undo > span + span { visibility: visible; }
.cp-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; }
.cp-acts .calc-reset { min-height: 40px; text-align: left; }
.cp-acts .calc-reset > span { text-align: left; }
.ct-side :is(button, input, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp .cp-seg button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.ct-plan-w { border-top: 1px solid var(--line); padding-top: 12px; }
.ct-plan-h { margin: 0; color: var(--muted); font-size: var(--fs-2); }
.ct-plan { --ct-rh: calc(var(--ct-nl) * 16px + 30px); list-style: none; margin: 8px 0 0; padding: 0; display: grid;
  gap: var(--ct-gap); }
html[data-cp] .ct-plan { min-height: calc(var(--cp-n, 1) * var(--ct-rh) + (var(--cp-n, 1) - 1) * var(--ct-gap)); }
html[data-cp] .ct-plan > .ct-ssr { display: none; }
html[data-cp] .ct-sum [data-o], html[data-cp] .cp-or { visibility: hidden; }
.ct-row { box-sizing: border-box; height: var(--ct-rh); display: grid; grid-template-columns: minmax(0, 1fr);
  border: 2px solid var(--line); border-radius: var(--r-l); background: var(--panel); }
.ct-row.ct-empty { display: flex; align-items: center; justify-content: center; padding: 0 12px; color: var(--muted);
  font-size: var(--fs-3); text-align: center; }
.ct-row-b { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 8px;
  align-items: center; min-width: 0; padding: 4px 8px; border: 0; border-radius: 10px; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
@media (hover: hover) { .ct-row-b:hover .ct-row-n { text-decoration: underline; } }
.ct-row-b .ct-ord { --d0: 40px; top: 3px; left: 34px; min-width: 20px; height: 20px; font-size: 13px; line-height: 16px; }
.ct-row-t { display: grid; min-width: 0; gap: 1px; }
.ct-row-n { min-width: 0; font-size: 13.5px; font-weight: 650; line-height: 16px; overflow: hidden; display: -webkit-box;
  -webkit-box-orient: vertical; -webkit-line-clamp: var(--ct-nl); overflow-wrap: break-word; }
.ct-row-lv { font: 650 13px/17px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-row.is-warn .ct-row-lv { color: var(--warn); }
.ct-row-c { display: grid; justify-items: end; gap: 3px; white-space: nowrap; }
.ct-row-c .cp-chip { min-width: max-content; font-size: 12px; }
.ct-cost { display: inline-flex; align-items: center; gap: 4px; font: 750 15px var(--font-num); font-variant-numeric: tabular-nums; }
.ct-cost .ico { width: 18px; height: 18px; }
.ct-row > .ct-up { display: none; }
.ct-up { width: 40px; height: 40px; border: 2px solid #000; border-radius: 50%; background: #fff; color: #16181d;
  box-shadow: inset 0 -4px 0 #c3c7cf; font: 700 18px/1 var(--font); cursor: pointer; touch-action: manipulation; }
.ct-up[aria-disabled=true] { opacity: .3; cursor: default; }
.cp .ct-up:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ct-pop { width: min(400px, calc(100vw - 24px)); max-width: none; max-height: 100vh; max-height: 100dvh; margin: auto;
  padding: 0 0 30px; border: 0; background: none; color: #fff; overflow: auto; overscroll-behavior: contain; }
.ct-pop::backdrop { background: rgba(0, 0, 0, .62); }
.ct-pop-in { position: relative; padding: 16px 16px 40px; border: 3px solid #000; border-radius: 20px; background: var(--ct-slate);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9); }
.ct-pop-top { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; align-items: start; min-height: 74px; }
.ct-pop-dw { position: relative; display: block; width: 74px; }
.ct-pop-dw .ct-ord { --d0: 68px; top: -4px; }
.ct-pop-t { min-width: 0; padding-top: 2px; }
.ct-pop-n { margin: 0; font: 400 20px/1.2 var(--game); color: #fff; -webkit-text-stroke: .16em #000; paint-order: stroke fill;
  overflow-wrap: break-word; }
.ct-pop-n:focus { outline: none; }
.ct-pop-d { display: grid; margin: 4px 0 0; font-size: 14px; line-height: 1.3; color: #dfe2e8; font-variant-numeric: tabular-nums;
  overflow-wrap: break-word; }
.ct-pop-d > span { grid-area: 1 / 1; min-width: 0; }
.ct-pop-dh { visibility: hidden; }
.ct-pop-d.t-warn .ct-pop-dv, .ct-pop-dh.t-warn { color: var(--ct-gold); font-weight: 650; }
.ct-st { margin-top: 12px; }
.ct-st-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 700; }
.ct-st-h label { color: #fff; }
.ct-st-mx { flex: none; color: #c6cad3; font: 600 14px var(--font-num); }
.ct-st-c { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ct-pop .nbox > input[type=number] { background: #fff; color: #16181d; border-color: #000; }
.ct-max, .ct-max-sp { flex: none; margin-left: auto; min-width: 72px; }
.ct-max { height: 34px; padding: 0 14px 4px; border: 2px solid #000; border-radius: var(--r-s); background: var(--ct-gold);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22); color: #fff; font: 400 18px/1 var(--game); -webkit-text-stroke: .16em #000;
  paint-order: stroke fill; cursor: pointer; touch-action: manipulation; }
.ct-max:active { box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .22); padding-bottom: 1px; }
.cp .ct-pop :is(button, input):focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ct-bar { position: relative; height: 18px; margin-top: 14px; border-radius: 9px; background: #262a33; overflow: hidden;
  box-shadow: inset 0 0 0 2px #fff; }
.ct-bar span { position: absolute; top: 0; bottom: 0; left: 0; }
.ct-bar-a { background: #8a91a3; }
.ct-bar-b { background: var(--ct-blue); }
.ct-pop-c { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cost chip" "pts chip";
  align-items: center; column-gap: 10px; margin-top: 12px; }
.ct-pop-c .ct-cost { grid-area: cost; font-size: 18px; white-space: nowrap; }
.ct-pop-pt { grid-area: pts; color: #c6cad3; font: 600 14px/1.3 var(--font-num); white-space: nowrap; }
.ct-pop-c .cp-chip { grid-area: chip; }
.ct-pop-acts { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin-top: 12px; }
.ct-rm[hidden] { display: inline-flex; visibility: hidden; }
.ct-mv { display: flex; gap: 8px; }
.ct-mv[hidden] { display: flex; visibility: hidden; }
.ct-x { position: absolute; left: 50%; bottom: 0; width: 56px; height: 56px; padding: 0 0 5px; border: 3px solid #000;
  border-radius: 50%; background: var(--ct-red); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .25); color: #fff;
  font: 400 34px/1 var(--game); -webkit-text-stroke: .12em #000; paint-order: stroke fill; transform: translate(-50%, 50%);
  cursor: pointer; }
.cp { --ct-nl: 3; --ct-nln: 4; --ct-nlw: 2; --cp-l1: 2; --cp-l1n: 3; --cp-l1w: 2; --cp-l2: 5; --cp-l2n: 6; --cp-l2w: 3;
  --cp-or: 1; --cp-orn: 2; --cp-orw: 1; }
.cp:lang(ko), .cp:lang(zh) { --cp-l2: 4; --cp-l2n: 5; }
.cp:lang(de), .cp:lang(tr) { --cp-l1: 3; --cp-l2: 6; --cp-l2n: 7; }
.cp:lang(ru) { --cp-l1: 3; --cp-l2n: 7; }
.cp:lang(nl) { --cp-l1: 3; }
.cp:is(:lang(it), :lang(pl)) { --cp-l1: 3; --cp-l2: 6; --cp-l2n: 7; }
.cp:lang(it) { --cp-l2w: 4; }
.cp:lang(pt) { --cp-l1: 3; --cp-l2: 6; --cp-l2n: 7; --cp-l2w: 4; }
.cp:is(:lang(es), :lang(fr)) { --cp-l1: 3; --cp-l2: 7; --cp-l2n: 8; --cp-l2w: 4; }
.cp:not(:lang(en), :lang(ko), :lang(zh)) { --cp-or: 2; }
.cp:lang(pt) { --cp-orn: 3; }
.cp:lang(ko) { --ct-nln: 2; --ct-nl: 2; }
.cp:lang(zh) { --ct-nln: 3; --ct-nl: 2; }
.cp:lang(ja) { --ct-nln: 3; }
.cp:lang(nl) { --ct-nlw: 3; }
.cp:lang(tr) { --ct-nl: 4; --ct-nlw: 3; }
.cp:is(:lang(de), :lang(it)) { --ct-nln: 5; --ct-nl: 4; --ct-nlw: 3; }
.cp:lang(pl) { --ct-nln: 6; --ct-nl: 4; --ct-nlw: 3; }
.cp:is(:lang(fr), :lang(ru)) { --ct-nln: 6; --ct-nl: 5; --ct-nlw: 3; }
.cp:is(:lang(es), :lang(pt)) { --ct-nln: 6; --ct-nl: 6; --ct-nlw: 3; }
@container cts (max-width: 280px) {
  .ct-plan { --ct-nl: var(--ct-nln); }
  .cp-l1 { min-height: calc(var(--cp-l1n) * 1.45em); -webkit-line-clamp: var(--cp-l1n); }
  .cp-l2 { min-height: calc(var(--cp-l2n) * 1.45em); -webkit-line-clamp: var(--cp-l2n); }
  .cp-or { min-height: calc(var(--cp-orn) * 1lh); }
  .ct-row-b { grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 6px; padding: 4px 6px; }
  .ct-row-b .ct-disc.sm { --d0: 34px; }
  .ct-row-b .ct-ord { left: 26px; }
  .ct-row-c .ct-cost { font-size: 13px; }
  .ct-row-c .ct-cost .ico { width: 15px; height: 15px; }
  .ct-row-c .cp-chip { font-size: 11px; padding: 1px 6px; }
  .ct-tot { grid-template-areas: "pill pill" "lab pts"; }
}
@container cp (max-width: 320px) {
  .ct-mini .ct-pill { font-size: 16px; }
}
@container cts (min-width: 380px) {
  .ct-plan { --ct-nl: var(--ct-nlw); }
  .cp-l1 { min-height: calc(var(--cp-l1w) * 1.45em); -webkit-line-clamp: var(--cp-l1w); }
  .cp-l2 { min-height: calc(var(--cp-l2w) * 1.45em); -webkit-line-clamp: var(--cp-l2w); }
  .cp-or { min-height: calc(var(--cp-orw) * 1lh); }
  .ct-row { grid-template-columns: minmax(0, 1fr) 46px; align-items: center; }
  .ct-row > .ct-up { display: block; }
}
@media (pointer: coarse) {
  .ct-up { width: 44px; height: 44px; }
  .ct-row > .ct-up { justify-self: start; }
  .ct-tab { min-height: 44px; }
  .ct-max { height: 44px; padding-bottom: 5px; font-size: 19px; }
  .cp .btn-main, .cp-est-out .btn-main, .cp-seg button { min-height: 44px; }
  .cp-seg button { min-width: 44px; }
  .cp-acts .calc-reset { min-height: 44px; min-width: 44px; margin: 0; padding-left: 0; padding-right: 0; }
  .cp-est summary { min-height: 44px; display: flex; align-items: center; }
}
@container cp (min-width: 760px) {
  .ct-body { grid-template-columns: minmax(0, 11fr) minmax(300px, 9fr); }
  .ct-win { grid-column: 1; grid-row: 1; border-bottom: 0; border-right: 2px solid #000; padding: 0 14px 18px; }
  .ct-side { grid-column: 2; grid-row: 1; align-self: stretch; }
  .ct-sum { position: sticky; top: var(--hdr); z-index: 2; margin-top: -8px; padding: 8px 0 18px; background: var(--panel);
    border-bottom: 1px solid var(--line); container-type: scroll-state; }
  .ct-plan-w { border-top: 0; padding-top: 0; }
  .cp-est { margin-top: 0; }   
  .ct-side > :not(.ct-sum) :is(button, input, summary) { scroll-margin-top: var(--ct-sumh, 0px); }
  .ct-tabs { margin: 0 -14px; padding: 12px 14px; }
  .ct-mini { display: none; }
}
@container scroll-state(stuck: top) {
  .ct-wk::after { content: ""; position: absolute; left: 0; right: 0; top: calc(100% + 1px); height: 10px;
    background: linear-gradient(rgba(0, 0, 0, .22), transparent); pointer-events: none; }
}
@media (forced-colors: active) { .cp-chip, .ct-ord, .ct-tab-n { border: 1px solid CanvasText; } }
