/* Khazana v9 round 7: top bar from Udit's app, centre + in the tab bar, search that grows out of its button, swipe cards. */

/* ---------- top bar (phone) ---------- */
.appbar { gap: 10px; padding-right: 14px; }
.appbar > .logo { display: none; }
.tb9-hi { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.tb9-mark { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 18px; color: #fff;
  background: radial-gradient(120% 120% at 30% 20%, #8b7bff, #4f46e5 55%, #3730a3); box-shadow: 0 4px 14px rgba(79, 70, 229, .4); }
.tb9-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tb9-tx small { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.tb9-tx b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb9-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.tb9-b { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink); text-decoration: none; cursor: pointer; padding: 0; font: inherit; transition: transform .12s ease-out, background-color .15s; }
.tb9-b:active { transform: scale(.94); }
.tb9-b:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.tb9-b svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tb9-av span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: linear-gradient(145deg, #8b7bff, #4f46e5); }
@media (max-width: 380px) { .tb9-acts { gap: 6px; } .tb9-b { width: 38px; height: 38px; border-radius: 12px; } .tb9-av span { width: 28px; height: 28px; } .tb9-mark { width: 36px; height: 36px; } .tb9-tx b { font-size: 16.5px; } }
@media (max-width: 959px) { .greet { display: none; } .home { margin-top: 4px !important; } }
@media (min-width: 960px) { .greet .tb9-acts { margin-left: auto; } .greet .tb9-b { width: 46px; height: 46px; } }

/* ---------- tab bar: Home, Tools, +, Review, AI ---------- */
@media (max-width: 959px) {
  .nav { right: 12px; width: auto; max-width: none; }
  .nav.min { right: auto; width: 66px; gap: 0; padding: 6px; }
  .nav:not(.min) .add-tab { position: relative; right: auto; bottom: auto; z-index: 1; flex: 0 0 60px; width: 60px; height: 54px; border-radius: 26px; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; }
  .nav:not(.min) .add-tab::before { display: none; }
  .nav:not(.min) .add-tab .plus { width: 50px; height: 50px; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
  .nav.min a[aria-current="page"] { flex: 0 0 54px; width: 54px; height: 54px; border-radius: 50%; padding: 0; margin: 0; }
}

/* ---------- quick save sheet ---------- */
.qs9-l { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 8px; }
.qs9-row { display: flex; gap: 8px; }
.qs9-row .input { flex: 1; min-width: 0; height: 50px; }
.qs9-row .btn { height: 50px; padding: 0 20px; }
.qs9-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.qs9-t { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; padding: 12px 8px; border-radius: 16px;
  border: 1.5px dashed var(--line-2, var(--line)); background: var(--surface-2, var(--surface)); color: var(--ink); text-decoration: none; text-align: center; font: inherit; cursor: pointer; }
.qs9-t svg { width: 24px; height: 24px; color: var(--brand-text, var(--brand)); }
.qs9-t b { font-size: 14px; font-weight: 700; }
.qs9-t small { font-size: 11.5px; color: var(--muted); }
.qs9-t:active { transform: scale(.98); }
.qs9-tip { margin-top: 14px; }

/* ---------- search grows out of the button you tapped and fills the screen ---------- */
.so.on .sbox { animation: so9-grow .38s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes so9-grow { from { clip-path: circle(22px at var(--ox, 90%) var(--oy, 30px)); opacity: .7; } to { clip-path: circle(150% at var(--ox, 90%) var(--oy, 30px)); opacity: 1; } }
@media (min-width: 641px) { .so { padding: 4vh 16px 16px; } .sbox { width: min(900px, 100%); max-height: 90vh; height: 90vh; } }
@media (prefers-reduced-motion: reduce) { .so.on .sbox { animation: none; } }

/* ---------- flashcards: a dark lining so the cards behind show, and swipe labels ---------- */
.dk9 .fc8 .fc8-front.fc8-face { border: 1.5px solid rgba(20, 10, 4, .7); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 12px 28px color-mix(in srgb, var(--c, var(--brand)) 30%, transparent); }
.dk9 .fc8 .fc8-back.fc8-face { border: 1.5px solid rgba(20, 10, 4, .55); }
.dk9:not(.fan) .dk9-c:not(.top) .fc8-front { filter: brightness(calc(1 - var(--k) * .09)) saturate(.9); }
.dk9 { position: relative; }
.dk9::before, .dk9::after { position: absolute; top: 40%; z-index: 120; padding: 8px 14px; border-radius: 12px; font-weight: 800; font-size: 15px; letter-spacing: .02em; pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s; border: 2.5px solid currentColor; background: var(--surface); }
.dk9::before { content: '⏱ 5 min'; left: 4px; color: #ea580c; transform: rotate(-10deg) scale(.9); }
.dk9::after { content: 'Open ↗'; right: 4px; color: #16a34a; transform: rotate(10deg) scale(.9); }
.dk9.sw-l::before { opacity: 1; transform: rotate(-10deg) scale(1); }
.dk9.sw-r::after { opacity: 1; transform: rotate(10deg) scale(1); }
.dk9-sw { font-size: 13px; font-weight: 750; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.dk9-sw.l { color: #c2410c; background: color-mix(in srgb, #ea580c 12%, transparent); }
.dk9-sw.r { color: #15803d; background: color-mix(in srgb, #16a34a 12%, transparent); }
