/* Khazana v9, round 14: Kharcha orange glow, real tool logos, cream back for plain folders, phone flashcard controls. */

/* ---------- Kharcha orange: the main buttons and the add button glow like the expense card ---------- */
.btn.primary, .add-tab .nb, .nav .add-tab > *:first-child, .nb {
  background: var(--g9, var(--brand)) !important; border-color: transparent !important; color: #fff !important;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--g9b, var(--brand)) 32%, transparent);
}
.btn.primary:hover { filter: brightness(1.05); }

/* ---------- real logos on tool rows (Try today, Rising this week, tool lists) ---------- */
.ti { position: relative; overflow: hidden; }
.ti .ti-img { position: absolute; inset: 16%; width: 68%; height: 68%; object-fit: contain; opacity: 0; transition: opacity .2s; }
.ti.has-lg { background: #fff !important; border: 1px solid var(--line); color: transparent !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.ti.has-lg .ti-img { opacity: 1; }
[data-theme="dark"] .ti.has-lg { background: #f4f4f5 !important; }

/* ---------- folders with no colour of their own: a light cream back you can see, same glass front ---------- */
.fd9w.fd9-plain { --c: #b9a68c; }
.fd9-plain .fd9-back { background: linear-gradient(160deg, #efe5d6, #e4d8c6); border-color: #d9cbb6; box-shadow: 0 10px 24px rgba(120, 96, 64, .16); }
.fd9-plain .fd9-back::before { background: #efe5d6; }
.fd9-plain .fd9-front .fd9-ic { color: #8a6f4d; }
[data-theme="dark"] .fd9-plain .fd9-back { background: linear-gradient(160deg, #4a4136, #322b23); border-color: #5b4f40; }
[data-theme="dark"] .fd9-plain .fd9-back::before { background: #4a4136; }
[data-theme="dark"] .fd9-plain .fd9-front .fd9-ic { color: #e6cfae; }

/* ---------- flashcards: the expense-card orange, the chosen theme everywhere ---------- */
.dk9 .fc8.hot .fc8-front { --c: var(--brand) !important; }
.dk9 .fc8 .fc8-front.fc8-face {
  background: radial-gradient(130% 90% at 0% 0%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 55%), var(--g9, var(--brand)) !important;
  border: 1px solid rgba(255, 255, 255, .35) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 14px 30px color-mix(in srgb, var(--g9b, var(--brand)) 34%, transparent) !important;
}
.dk9 .fc8 .fc8-front b { color: #fff; }
.dk9 .fc8 .fc8-front small { color: rgba(255, 255, 255, .86); }
.dk9 .fc8-front .fc8-ic { border-color: rgba(255, 255, 255, .9) !important; }
.dk9::before { color: var(--brand-text) !important; }
.dk9-sw.l { color: var(--brand-text) !important; background: color-mix(in srgb, var(--brand) 12%, transparent) !important; }

/* Quiz me and Make a card: in the middle */
.fc8-cta { justify-content: center; }

/* on a phone: "5 min, Card 1 of 12, Open" on one line, "Skip, Shuffle, Fan out" under it */
@media (max-width: 600px) {
  .dk9-nav { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; align-items: center; gap: 8px 10px; }
  .dk9-nav .dk9-count { min-width: 0; }
}

/* folder row: tool tags stay on at most two short lines, so one folder with long tool names
   no longer makes every folder tall and leaves a gap above "Get started" */
.fd9-row { align-items: start; padding-bottom: 2px; }
.fd9-tags { max-height: none; overflow: visible; padding-bottom: 2px; }
.fd9-tag { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ---------- round 15 ---------- */

/* tab icons move a little, all the time, the selected one a bit more */
.nv15 svg { transform-origin: 50% 60%; }
.nv15-home svg { animation: n15home 3.2s ease-in-out infinite; }
.nv15-review svg { animation: n15rev 3.6s ease-in-out infinite; }
.nv15-vault svg { animation: n15tools 4s ease-in-out infinite; }
.nv15-ask svg { animation: n15star 2.6s ease-in-out infinite; color: var(--brand); }
.nv15[aria-current="page"] svg { animation-duration: 1.8s; }
@keyframes n15home { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-3px); } 90% { transform: translateY(0) scale(1.06, .94); } }
@keyframes n15rev { 0%, 72%, 100% { transform: rotate(0); } 80% { transform: rotate(-8deg); } 88% { transform: rotate(6deg); } }
@keyframes n15tools { 0%, 70%, 100% { transform: rotate(0) scale(1); } 85% { transform: rotate(90deg) scale(.9); } }
@keyframes n15star { 0%, 100% { transform: scale(1) rotate(0); filter: drop-shadow(0 0 0 transparent); } 50% { transform: scale(1.14) rotate(12deg); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--brand) 60%, transparent)); } }
@media (prefers-reduced-motion: reduce) { .nv15 svg { animation: none !important; } }

/* flashcards: the top card in the middle of the deck at every width, the cards under it peek out on both sides */
.dk9:not(.fan) .dk9-c { left: 0; right: 0; margin-left: auto; margin-right: auto; }
.dk9:not(.fan) .dk9-c:not(.top):not(.out-l):not(.out-r) { transform: translateX(calc(var(--k) * 9px * (1 - 2 * mod(var(--k), 2)))) translateY(calc(var(--k) * 5px)) scale(calc(1 - var(--k) * .04)) rotate(calc(var(--k) * 2.2deg * (1 - 2 * mod(var(--k), 2)))); }
@supports not (width: mod(3px, 2px)) {
  .dk9:not(.fan) .dk9-c:not(.top):not(.out-l):not(.out-r):nth-child(odd) { transform: translateX(calc(var(--k) * -9px)) translateY(calc(var(--k) * 5px)) scale(calc(1 - var(--k) * .04)) rotate(calc(var(--k) * -2.2deg)); }
  .dk9:not(.fan) .dk9-c:not(.top):not(.out-l):not(.out-r):nth-child(even) { transform: translateX(calc(var(--k) * 9px)) translateY(calc(var(--k) * 5px)) scale(calc(1 - var(--k) * .04)) rotate(calc(var(--k) * 2.2deg)); }
}
.dk9 { transition: height .25s ease; }

/* under the deck: just "Card 1 of 12" in the middle, then Skip, Shuffle, Fan out in the middle under it */
.dk9-nav .dk9-sw { display: none !important; }
.dk9-nav { display: flex !important; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 8px; text-align: center; }
.dk9-nav .dk9-count { flex: 1 0 100%; order: -1; min-width: 0; text-align: center; }
.dk9 + .dk9-nav, .dk9-nav { margin-left: auto; margin-right: auto; max-width: 520px; }

/* daily brief: the three buttons stay in one row and shrink to fit any width */
.w8 .row:last-child { flex-wrap: nowrap; gap: 8px; }
.w8 .row:last-child > .btn { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; padding-right: 10px; }
.w8 .row:last-child > .btn.primary { flex-grow: 1.4; }
@media (max-width: 380px) { .w8 .row:last-child > .btn { font-size: 12.5px; padding-left: 8px; padding-right: 8px; } .w8 .row:last-child > .btn svg { display: none; } }

/* the hidden-checklist switch in Customize */
.n15-start { margin: 10px 0; }

/* round 16: Daily goal filler, only where the card is stretched beside Review */
.n16-wk { display: none; }
@media (min-width: 1000px) {
  .w5 > .card.pad:has(.week) { display: flex; flex-direction: column; height: calc(100% - 44px); }
  .n16-wk { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line, rgba(0,0,0,.08)); flex: 1; }
  .n16-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .n16-stats > div { background: var(--soft, rgba(0,0,0,.04)); border-radius: 12px; padding: 10px; text-align: center; }
  .n16-stats b { display: block; font-size: 20px; font-weight: 800; }
  .n16-stats small { color: var(--muted, #777); font-size: 12px; }
  .n16-up { margin: 4px 0 0; }
  .n16-picks { display: flex; flex-direction: column; gap: 6px; }
  .n16-pick { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 1px solid var(--line, rgba(0,0,0,.08)); border-radius: 12px; padding: 8px 10px; cursor: pointer; color: inherit; font: inherit; min-width: 0; }
  .n16-pick:hover { border-color: var(--g9a, #f1791e); }
  .n16-pn { display: flex; flex-direction: column; min-width: 0; }
  .n16-pn b, .n16-pn small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .n16-pn small { color: var(--muted, #777); font-size: 12px; }
}
