/* Khazana v9 round 6: tighter spacing, search beside the greeting, new flashcard face, a review card where the video matches the text,
   and a tab circle whose badge sits outside it. */

/* ---------- spacing ---------- */
.greet { margin: 0 0 10px; align-items: center; }
.greet > div:first-child { flex: none; min-width: 0; }
.greet h1 { white-space: nowrap; }
.greet .srch9 { margin-left: auto; }
.greet p { font-size: 13px; margin-bottom: 1px; }
.home > .w12 + .w12 { margin-top: 22px; }
.w12 .sh, .w12 > header { margin-bottom: 8px; }
.fd9-row { padding-top: 22px; }
@media (min-width: 700px) { .fd9-row { padding-top: 52px; } }

/* ---------- search pill next to the greeting ---------- */
.srch9 { flex: 1 1 0; min-width: 46px; max-width: 340px; height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13.5px; cursor: pointer; overflow: hidden;
  box-shadow: 0 4px 14px rgba(16, 19, 24, .06); animation: srch9-in .7s cubic-bezier(.2, .9, .2, 1) both; transition: transform .12s ease-out, box-shadow .2s; }
.srch9:hover { box-shadow: 0 6px 18px rgba(16, 19, 24, .1); }
.srch9:active { transform: scale(.97); }
.srch9:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.srch9 svg { width: 20px; height: 20px; flex: none; color: var(--ink); }
.srch9-t { display: inline-flex; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; }
.srch9-t span { overflow: hidden; text-overflow: clip; }
.srch9-caret { width: 1.5px; height: 1.1em; margin-left: 1px; background: var(--brand); flex: none; animation: srch9-blink 1s steps(1) infinite; }
@keyframes srch9-in { from { max-width: 46px; opacity: .6; } to { max-width: 340px; opacity: 1; } }
@keyframes srch9-blink { 50% { opacity: 0; } }
@media (max-width: 420px) { .greet h1 { font-size: 21px; } .srch9 { height: 42px; font-size: 12.5px; padding: 0 12px 0 11px; } }
@media (min-width: 960px) { .srch9 { flex: 0 1 340px; height: 50px; font-size: 14.5px; } }
@media (prefers-reduced-motion: reduce) { .srch9 { animation: none; } .srch9-caret { animation: none; } }

/* ---------- flashcards: a bold colour card with the logo up front ---------- */
.dk9 .fc8 .fc8-front.fc8-face { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; column-gap: 12px; row-gap: 4px; padding: 16px;
  color: #fff; border: 0;
  background: radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--c, var(--brand)) 55%, #fff) 0%, transparent 55%),
              linear-gradient(150deg, color-mix(in srgb, var(--c, var(--brand)) 92%, #fff) 0%, color-mix(in srgb, var(--c, var(--brand)) 80%, #000) 100%);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--c, var(--brand)) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.dk9 .fc8-front::before { content: ''; position: absolute; inset: auto -30% -55% auto; width: 75%; aspect-ratio: 1; padding: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 70%); -webkit-mask: none; mask: none; }
.dk9 .fc8-front::after { content: ''; position: absolute; right: 16px; top: 46px; left: auto; width: 74px; height: 74px; border-radius: 50%; border: 10px solid rgba(255, 255, 255, .1); background: none; }
.dk9 .fc8-front .fc8-top { grid-column: 1 / -1; position: relative; z-index: 1; }
.dk9 .fc8-front .fc8-tag { background: rgba(255, 255, 255, .2); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dk9 .fc8-front .fc8-n { color: rgba(255, 255, 255, .8); }
.dk9 .fc8-front .fc8-ic { grid-row: 3 / 5; align-self: end; width: 58px; height: 58px; margin: 0; position: relative; z-index: 1; box-shadow: 0 6px 16px rgba(0, 0, 0, .22); border: 3px solid rgba(255, 255, 255, .9); }
.dk9 .fc8-front b { grid-column: 2; grid-row: 3; align-self: end; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: #fff; position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk9 .fc8-front small { grid-column: 2; grid-row: 4; color: rgba(255, 255, 255, .85); font-size: 12px; position: relative; z-index: 1; }
.dk9 .fc8-front .fc8-hint { grid-column: 1 / -1; grid-row: 2; align-self: center; justify-self: start; margin: 0; padding: 0; font-size: 12px; color: rgba(255, 255, 255, .75); position: relative; z-index: 1; }
.dk9 .fc8-front .fc8-hint::before { content: '↻ '; }
.dk9 .fc8-front .dk9-cn { color: rgba(255, 255, 255, .9); }
.dk9 .fc8-front .dk9-cn b { color: #fff; font-size: 13px; }
.dk9 .fc8-front .dk9-cn { display: none; }
.dk9 .fc8 .fc8-back.fc8-face { padding: 18px; gap: 8px; border: 0; color: var(--ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c, var(--brand)) 14%, var(--surface)), var(--surface) 70%);
  box-shadow: 0 14px 32px rgba(16, 19, 24, .14), inset 0 0 0 1.5px color-mix(in srgb, var(--c, var(--brand)) 35%, transparent); }
.dk9 .fc8-back small { color: var(--c, var(--brand)); font-weight: 750; text-transform: none; letter-spacing: .01em; }
.dk9 .fc8-back b { font-size: 16px; }
.dk9 .fc8.hot .fc8-front { --c: #ea580c; }
.dk9-c:not(.top) .fc8-front { filter: saturate(.85) brightness(.97); }

/* ---------- review: the video and the text share one height ---------- */
.rv { grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.rv > .cv-btn { align-self: start; }
.rv .cover { aspect-ratio: 9 / 16; }
.rv .conf6 { font-size: 11px; }
.rv h3 { font-size: 15.5px; line-height: 1.25; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv .by { font-size: 12px; margin-top: 2px; }
.rv .sum { font-size: 13px; line-height: 1.4; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rv .found { margin-top: 8px; gap: 4px; flex-wrap: wrap; }
@media (max-width: 959px) { .rv .found .mk:nth-of-type(n+3), .rv .found .small { display: none; } .rv .found .mk { max-width: 100%; overflow: hidden; text-overflow: ellipsis; } }
.rv .found .mk { font-size: 11px; white-space: nowrap; }
.rv .chips { margin-top: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
.rv .chips::-webkit-scrollbar { display: none; }
.rv .chips .chip { height: 30px; font-size: 12.5px; flex: none; }
@media (max-width: 400px) { .rv { grid-template-columns: 124px minmax(0, 1fr); gap: 12px; } }
@media (max-width: 370px) { .rv .sum { -webkit-line-clamp: 2; } .rv .conf6 { display: none; } }
@media (min-width: 960px) {
  .rv { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; padding: 18px; }
  .rv h3 { font-size: 21px; } .rv .by { font-size: 13px; } .rv .sum { font-size: 15px; -webkit-line-clamp: 4; }
  .rv .found .mk { font-size: 12px; } .rv .chips { flex-wrap: wrap; overflow: visible; } .rv .chips .chip { height: 34px; font-size: 13.5px; }
}

/* ---------- tab bar: when it shrinks to one circle, Home is big and its badge sits outside ---------- */
@media (max-width: 959px) {
  .nav.min a[aria-current="page"] { overflow: visible; }
  .nav.min a[aria-current="page"] svg { width: 27px; height: 27px; }
  .nav.min a[aria-current="page"] .badge { top: -7px; left: auto; right: -9px; z-index: 2; font-size: 11px; min-width: 19px; height: 19px; line-height: 19px; border-radius: 10px; }
}
