/* Credits (js/credits-log.js): the balance and totals, where the credits went, and the log. App tokens only, so light and
   dark follow app.css. */
#sec-credits .cl{max-width:1080px;display:flex;flex-direction:column;gap:18px}
#sec-credits .cl-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#sec-credits .cl-head h1{display:flex;align-items:center;gap:6px;margin-bottom:0}
/* Buy credits (js/credits-log.js packs): one button a pack, its credits and its price */
#sec-credits .cl-buy .cl-bh h2{display:flex;align-items:center;gap:6px}
#sec-credits .cl-x{margin-left:auto;display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:10px;background:transparent;color:var(--ink2);cursor:pointer}
#sec-credits .cl-x:hover{background:var(--hover)}#sec-credits .cl-x svg{width:18px;height:18px}
#sec-credits .cl-x:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
#sec-credits .cl-test{margin:0;padding:8px 12px;border-radius:10px;background:var(--chip);color:var(--ink2);font-size:13px}
#sec-credits .cl-packs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#sec-credits .cl-pack{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;padding:16px 18px;border:1px solid var(--line2);border-radius:14px;background:var(--surface);color:var(--ink);text-align:left;cursor:pointer;font:inherit}
#sec-credits .cl-pack:hover:not(:disabled){border-color:var(--brand);background:var(--tint)}
#sec-credits .cl-pack:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
#sec-credits .cl-pack:disabled{cursor:default;opacity:.7}
#sec-credits .cl-pack b{font-size:24px;line-height:30px;font-weight:700;font-variant-numeric:tabular-nums}
#sec-credits .cl-pack span{font-size:12.5px;color:var(--ink3)}
#sec-credits .cl-pack em{display:inline-flex;align-items:center;gap:6px;margin-top:10px;font-style:normal;font-size:16px;font-weight:700;color:var(--brand-d);font-variant-numeric:tabular-nums}
#sec-credits .cl-pack em .spin{width:14px;height:14px}
/* the Member plan for a Free trial: its price, its credits and Upgrade; a paying Member's Cancel plan on the plan line */
#sec-credits .cl-plan-up{display:flex;align-items:center;gap:28px;flex-wrap:wrap;padding:16px 18px;border:1px solid color-mix(in oklch,var(--brand-d) 25%,transparent);border-radius:14px;background:var(--tint)}
#sec-credits .cl-plan-up > div{display:flex;flex-direction:column;gap:2px}
#sec-credits .cl-plan-up b{font-size:26px;line-height:32px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
#sec-credits .cl-plan-up span{font-size:12.5px;color:var(--ink3)}
#sec-credits .cl-plan-up .btn{margin-left:auto;height:42px;padding:0 20px}
#sec-credits .cl-plan .btn{margin-left:auto}
#sec-credits .cl-ask{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto;color:var(--ink);font-size:13.5px}
@media (max-width:640px){#sec-credits .cl-plan-up{gap:16px}#sec-credits .cl-plan-up .btn{margin-left:0;width:100%;height:46px}}
#sec-credits .cl-load{padding:40px;display:grid;place-items:center}
#sec-credits .cl-err{color:var(--bad);font-size:13.5px}
/* the totals */
#sec-credits .cl-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#sec-credits .cl-tile{display:flex;flex-direction:column;gap:4px;padding:16px 18px;border:1px solid var(--line);border-radius:14px;background:var(--surface);min-width:0}
#sec-credits .cl-tile.hi{background:var(--tint);border-color:color-mix(in oklch,var(--brand-d) 25%,transparent)}
#sec-credits .cl-tl{display:flex;align-items:center;gap:4px;font-size:12.5px;font-weight:600;color:var(--ink3)}
#sec-credits .cl-tile b{font-size:26px;line-height:32px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#sec-credits .cl-tile small{font-size:12.5px;color:var(--ink3)}
/* cards */
#sec-credits .cl-card{display:flex;flex-direction:column;gap:14px}
#sec-credits .cl-bh{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#sec-credits .cl-bh h2{margin:0}
#sec-credits .cl-per{margin-left:auto;font-size:12.5px;color:var(--ink3);font-weight:500}
#sec-credits .cl-none{color:var(--ink3);font-size:13.5px}
/* where the credits went: one bar a group (one hue: the share of the period's spend) */
#sec-credits .cl-bars{list-style:none;display:grid;gap:4px}
#sec-credits .cl-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;row-gap:6px;column-gap:12px;width:100%;padding:8px 10px;border:0;border-radius:10px;background:transparent;text-align:left;cursor:pointer}
#sec-credits .cl-bar:hover{background:var(--hover)}
#sec-credits .cl-bar:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
#sec-credits .cl-bn{font-size:14px;font-weight:500;color:var(--ink);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#sec-credits .cl-bv{font-size:13px;color:var(--ink2);font-variant-numeric:tabular-nums;white-space:nowrap}
#sec-credits .cl-bv b{color:var(--ink);font-weight:600}
#sec-credits .cl-bv small{color:var(--ink3);margin-left:4px}
#sec-credits .cl-track{grid-column:1/-1;height:8px;border-radius:4px;background:var(--chip);overflow:hidden}
#sec-credits .cl-track i{display:block;height:100%;border-radius:4px;background:var(--brand)}
#sec-credits .cl-adds{display:flex;gap:14px;flex-wrap:wrap;padding-top:12px;border-top:1px solid var(--line);font-size:13px;color:var(--ink2)}
#sec-credits .cl-add b{color:var(--good);font-weight:600;font-variant-numeric:tabular-nums}
/* filters */
#sec-credits .cl-filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
#sec-credits .cl-seg{display:flex;flex-wrap:wrap;gap:6px}
#sec-credits .cl-seg label{position:relative}
#sec-credits .cl-seg input{position:absolute;opacity:0;inset:0;cursor:pointer;margin:0}
#sec-credits .cl-seg span{display:inline-flex;align-items:center;height:32px;padding:0 12px;border:1px solid var(--line2);border-radius:9999px;font-size:13px;font-weight:500;color:var(--ink2);background:var(--surface)}
#sec-credits .cl-seg input:checked + span{background:var(--tint);border-color:color-mix(in oklch,var(--brand-d) 35%,transparent);color:var(--brand-d)}
#sec-credits .cl-seg input:focus-visible + span{outline:2px solid var(--brand);outline-offset:1px}
#sec-credits .cl-kind{width:auto;min-width:220px;height:34px;margin-left:auto}
/* the log */
#sec-credits .cl-day{font-size:12.5px;font-weight:700;color:var(--ink3);text-transform:none;margin:10px 0 2px}
#sec-credits .cl-log > .cl-day:first-child{margin-top:0}
#sec-credits .cl-rows{list-style:none}
#sec-credits .cl-row{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:12px;align-items:start;padding:10px 0;border-bottom:1px solid var(--line)}
#sec-credits .cl-rows .cl-row:last-child{border-bottom:0}
#sec-credits .cl-t{font-size:12.5px;color:var(--ink3);font-variant-numeric:tabular-nums;padding-top:1px}
#sec-credits .cl-w{display:flex;flex-direction:column;gap:2px;min-width:0}
#sec-credits .cl-w b{font-weight:500;color:var(--ink);overflow-wrap:anywhere}
#sec-credits .cl-w small{font-size:12.5px;color:var(--ink2);overflow-wrap:anywhere}
#sec-credits .cl-w em{font-style:normal;font-size:11.5px;color:var(--ink3)}
#sec-credits .cl-c{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;padding-top:1px}
#sec-credits .cl-c.minus{color:var(--bad)}
#sec-credits .cl-c.plus{color:var(--good)}
#sec-credits .cl-more{display:flex;justify-content:center;padding-top:12px}
#sec-credits .cl-empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:28px 12px;text-align:center;color:var(--ink3)}
#sec-credits .cl-empty b{color:var(--ink);font-size:15px}
#sec-credits .cl-i{width:26px;height:26px;color:var(--ink3)}
/* the sidebar's credits figure opens this page */
.me .cr.cr-go{border:0;background:transparent;padding:0;cursor:pointer;text-align:left;font:inherit;font-size:12px;font-weight:600;color:var(--brand-d)}
.me .cr.cr-go:hover{text-decoration:underline;text-underline-offset:3px}
.me .cr.cr-go:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:4px}
@media (max-width:900px){#sec-credits .cl-tiles,#sec-credits .cl-packs{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){
  #sec-credits .cl-tile{padding:12px 14px}#sec-credits .cl-tile b{font-size:22px;line-height:28px}
  #sec-credits .cl-kind{margin-left:0;width:100%;min-width:0}
  #sec-credits .cl-row{grid-template-columns:minmax(0,1fr) auto;row-gap:2px}
  #sec-credits .cl-t{grid-column:1/-1}
}
/* the Pro plan line above the tiles (api/_lib/plans.js) */
#sec-credits .cl-plan{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:12px 16px;border-radius:12px;background:var(--tint);color:var(--ink2);font-size:14px;line-height:20px}
#sec-credits .cl-plan b{color:var(--brand-d);font-weight:700}
/* A phone (Max 2026-10-20: "Make it like real monile app UI"): the page's h1 repeats the top bar, so it goes and its (i) sits
   by the Log heading; the time moves into each row's group line; sticky day headers; filters and buttons 44px */
#sec-credits .cl-logtip,#sec-credits .cl-tm{display:none}
@media (max-width:800px),(pointer:coarse) and (max-width:950px){
  /* the h1 repeats the top bar; Buy credits stays, full width */
  #sec-credits .cl-head h1{display:none}
  #sec-credits .cl-head:not(:has(.cl-buyb)){display:none}
  #sec-credits .cl-buyb{width:100%;height:46px}
  #sec-credits .cl-pack{padding:14px 16px;min-height:44px}
  #sec-credits .cl{gap:14px}
  #sec-credits .cl-logtip{display:inline-flex;margin-left:-6px}
  #sec-credits .cl-card{padding:16px;border-radius:16px}
  #sec-credits .cl-bn{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
  #sec-credits .cl-bar{padding:10px 8px;margin:0 -8px;width:calc(100% + 16px);min-height:44px}
  #sec-credits .cl-seg{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;width:100%}
  #sec-credits .cl-seg span{display:flex;width:100%;justify-content:center;height:40px;padding:0 6px;font-size:14px}
  #sec-credits .cl-filters{gap:8px}
  #sec-credits .cl-kind{height:44px;font-size:16px}
  #sec-credits .cl-day{position:sticky;top:var(--mbar-h);z-index:2;margin:0;padding:10px 0 6px;background:var(--surface);font-size:13px}
  #sec-credits .cl-row{grid-template-columns:minmax(0,1fr) auto;padding:12px 0}
  #sec-credits .cl-t{display:none}
  #sec-credits .cl-tm{display:inline}
  #sec-credits .cl-w em{font-size:12px}
  #sec-credits .cl-w small{font-size:13px}
  #sec-credits .cl-c{font-size:15px}
  #sec-credits .cl-more .btn{width:100%;height:46px}
}
/* how far the Member plan's month goes (Max 2026-10-23) */
.cl-goes{margin:10px 0 0;font-size:13px;line-height:19px;color:var(--ink2)}
