/* billing: calendar ticks, history stacks, the list lands on the 1st, bad data is held */
.billing { width: 100%; padding: 12px 10px 14px; font-family: var(--sans); }
.billing-top { display: grid; grid-template-columns: 206px minmax(0, 1fr); gap: 10px; }
.billing-cal, .billing-log { background: var(--paper); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 12px 10px; min-width: 0; }

/* calendar */
.billing-ch { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.billing-ch b { font-size: 13px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; }
.billing-ch small { font-size: 9.5px; color: var(--dim); white-space: nowrap; }
.billing-dow, .billing-days { display: grid; grid-template-columns: repeat(7, 1fr); justify-items: center; }
.billing-dow span { font-size: 9px; color: var(--dim); font-family: var(--mono); height: 16px; }
.billing-days { row-gap: 2px; transition: opacity .2s ease, transform .2s ease; }
.billing-days.swap { opacity: 0; transform: translateX(-8px); }
.billing-d { position: relative; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-family: var(--mono); color: var(--ink); transition: background .2s, color .2s, box-shadow .2s; }
.billing-d.past { color: var(--dim); }
.billing-d.now { background: rgba(255,255,255,.12); box-shadow: 0 0 0 1px rgba(255,255,255,.3); color: #fff; }
.billing-d.dot::after { content: ''; position: absolute; bottom: 1px; left: 50%; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: var(--ok); }
.billing-d.dot.bad::after { background: var(--amber); }
.billing-d.first { background: var(--ok); color: #06240F; font-weight: 600; box-shadow: 0 0 0 4px rgba(61,214,140,.2), 0 0 22px rgba(61,214,140,.55); animation: billing-pop .6s var(--ease); }
.billing-d.first.warn { background: var(--amber); color: #2b1d00; box-shadow: 0 0 0 4px rgba(245,185,66,.2), 0 0 22px rgba(245,185,66,.55); }
@keyframes billing-pop { 0% { transform: scale(.5); } 60% { transform: scale(1.2); } 100% { transform: none; } }
.billing-next { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); font-size: 10.5px; color: var(--mute); white-space: nowrap; min-height: 25px; }
.billing-next i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); flex: none; transition: background .3s; }
.billing-next.run i { background: var(--ink); animation: billing-blink .5s ease-in-out infinite alternate; }
.billing-next.ok { color: var(--ok); } .billing-next.ok i { background: var(--ok); }
.billing-next.warn { color: var(--amber); } .billing-next.warn i { background: var(--amber); }
@keyframes billing-blink { to { opacity: .25; } }

/* history log */
.billing-log { display: flex; flex-direction: column; }
.billing-lh { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.billing-lh > b { font-size: 13px; font-weight: 600; letter-spacing: -.015em; }
.billing-lh small { font-size: 9.5px; color: var(--dim); white-space: nowrap; } .billing-lh small b { font-family: var(--mono); font-weight: 500; color: var(--mute); }
.billing-list { position: relative; height: 152px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.billing-e { display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 8px; align-items: center; height: 0; opacity: 0; overflow: hidden; transform: translateY(-6px); border-bottom: 0 solid var(--line-2); transition: height .45s var(--ease), opacity .45s ease, transform .45s var(--ease); }
.billing-e.on { height: 38px; opacity: 1; transform: none; border-bottom-width: 1px; }
.billing-ed { grid-row: 1 / 3; font-family: var(--mono); font-size: 9.5px; color: var(--dim); white-space: nowrap; }
.billing-e > b { font-size: 11.5px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; align-self: end; line-height: 1.2; }
.billing-chg { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--dim); white-space: nowrap; align-self: start; min-width: 0; margin-top: 2px; }
.billing-chg em { font-style: normal; } .billing-chg u { text-decoration: none; opacity: .7; }
.billing-to { color: var(--ok); background: var(--ok-bg); border-radius: 4px; padding: 1px 5px; }
.billing-bad .billing-to { color: var(--amber); background: var(--amber-bg); }

/* finance inbox */
.billing-mail { position: relative; margin-top: 10px; background: #fff; color: #1f1f1f; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 50px -28px #000, 0 0 0 1px rgba(255,255,255,.06); }
.billing-mbar { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; background: #F3F2F1; border-bottom: 1px solid #E1DFDD; }
.billing-mbar svg { width: 16px; height: 16px; flex: none; }
.billing-mbar b { font-size: 11.5px; font-weight: 600; } .billing-mbar small { font-size: 10.5px; color: #777; }
.billing-unread { margin-left: auto; font-size: 9.5px; font-weight: 600; color: #fff; background: #0F6CBD; border-radius: 99px; padding: 2px 7px; opacity: 0; transform: scale(.6); transition: opacity .35s, transform .35s var(--ease); }
.billing-unread.on { opacity: 1; transform: none; }
.billing-mbody { display: grid; grid-template-columns: 172px minmax(0, 1fr); height: 176px; transition: filter .6s, opacity .6s; }
.billing-ml { border-right: 1px solid #E8E6E4; background: #FAF9F8; overflow: hidden; }
.billing-mi { display: grid; grid-template-columns: 3px minmax(0, 1fr) auto; column-gap: 7px; align-items: center; height: 44px; padding-right: 8px; border-bottom: 1px solid #EDEBE9; }
.billing-mi i { align-self: stretch; }
.billing-mi b { display: block; font-size: 10.5px; font-weight: 500; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.billing-mi span { display: block; font-size: 10px; color: #8a8886; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.billing-mi small { font-size: 9px; color: #8a8886; align-self: start; margin-top: 8px; white-space: nowrap; }
.billing-newmail { height: 0; opacity: 0; border-bottom-width: 0; overflow: hidden; background: #E5F1FB; transition: height .5s var(--ease), opacity .4s ease .1s, background .6s; }
.billing-newmail.on { height: 44px; opacity: 1; border-bottom-width: 1px; }
.billing-newmail i { background: #0F6CBD; } .billing-newmail b { font-weight: 700; color: #111; } .billing-newmail span { color: #0F6CBD; font-weight: 600; } .billing-newmail small { color: #0F6CBD; font-weight: 600; }
.billing-newmail.read span, .billing-newmail.read small { color: #605e5c; font-weight: 400; } .billing-newmail.read b { font-weight: 600; }
.billing-pane { position: relative; min-width: 0; }
.billing-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 11px; line-height: 1.5; color: #a19f9d; transition: opacity .3s; }
.billing-mail.open .billing-empty { opacity: 0; }
.billing-msg { position: absolute; inset: 0; padding: 11px 14px 0; opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s var(--ease); }
.billing-mail.open .billing-msg { opacity: 1; transform: none; }
.billing-msg h6 { font-size: 13px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.billing-meta { display: flex; gap: 4px; font-size: 9.5px; color: #777; margin: 2px 0 7px; white-space: nowrap; } .billing-meta b { color: #333; font-weight: 600; } .billing-meta span { margin-left: auto; }
.billing-tbl { border: 1px solid #E1DFDD; border-radius: 6px; overflow: hidden; }
.billing-tr { display: grid; grid-template-columns: 1.15fr 1.1fr .8fr; height: 19px; align-items: center; padding: 0 9px; font-size: 10.5px; border-bottom: 1px solid #EFEDEB; white-space: nowrap; opacity: 0; transform: translateX(-6px); transition: opacity .4s ease, transform .4s var(--ease); transition-delay: calc(.25s + var(--k, 0) * .09s); }
.billing-mail.open .billing-tr { opacity: 1; transform: none; }
.billing-tr span:last-child { text-align: right; font-family: var(--mono); font-size: 10px; }
.billing-th { background: #F3F2F1; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: #777; transition-delay: .1s; }
.billing-th span:last-child { font-family: var(--sans); font-size: 9px; }
.billing-tot { border-bottom: 0; font-weight: 600; background: #F0F8F3; color: #0B5A2E; }

/* held state */
.billing-held { position: absolute; inset: 30px 0 0 0; display: grid; place-items: center; padding: 0 16px; background: rgba(12,12,15,0); pointer-events: none; transition: background .6s ease; }
.billing-mail.hold .billing-held { background: rgba(12,12,15,.74); }
.billing-mail.hold .billing-mbody { filter: grayscale(1); }
.billing-hc { display: flex; align-items: center; gap: 12px; max-width: 400px; padding: 13px 16px 13px 13px; border-radius: 14px; background: #1E1A10; border: 1px solid rgba(245,185,66,.5); box-shadow: 0 0 40px -6px rgba(245,185,66,.45), 0 20px 40px -18px #000; color: var(--ink); opacity: 0; transform: translateY(12px) scale(.96); transition: opacity .5s ease .15s, transform .6s var(--ease) .15s; }
.billing-mail.hold .billing-hc { opacity: 1; transform: none; }
.billing-hc i { width: 38px; height: 38px; border-radius: 11px; background: var(--amber-bg); display: grid; place-items: center; flex: none; }
.billing-hc svg { width: 21px; height: 21px; fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.billing-hc small { display: block; font-size: 9.5px; font-family: var(--mono); color: var(--dim); }
.billing-hc b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.015em; color: var(--amber); margin: 1px 0 2px; }
.billing-hc span { display: block; font-size: 11px; line-height: 1.35; color: var(--mute); }

.billing-out { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; font-size: 14.5px; letter-spacing: -.01em; color: var(--ink); opacity: 0; transform: translateY(8px); transition: opacity .7s var(--ease), transform .7s var(--ease); text-align: center; }
.billing-out.on { opacity: 1; transform: none; }
.billing-out i { width: 20px; height: 20px; border-radius: 50%; background: var(--ok-bg); display: grid; place-items: center; flex: none; }
.billing-out svg { width: 13px; height: 13px; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 600px) {
  .billing { padding: 8px 4px 12px; }
  .billing-top { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .billing-cal { display: grid; grid-template-columns: minmax(0, 1fr); }
  .billing-d { width: 20px; height: 20px; }
  .billing-list { height: 76px; }
  .billing-mbody { grid-template-columns: minmax(0, 1fr); height: 172px; }
  .billing-ml { display: none; }
  .billing-msg { padding: 10px 10px 0; }
  .billing-hc { padding: 11px 12px 11px 10px; gap: 10px; } .billing-hc b { font-size: 12.5px; } .billing-hc span { font-size: 10.5px; }
  .billing-held { padding: 0 10px; }
  .billing-out { font-size: 13.5px; }
}
