/*!
 * Aurora Premium – theme layer for KingMEDIA
 * Loaded after king-styles.css / night.css. Everything is scoped to .aurora-theme (body class).
 */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  --au-a: #14e2cd;
  --au-b: #7c5cff;
  --au-c: #ff3d9a;
  --au-grad: linear-gradient(135deg, var(--au-a), var(--au-b) 55%, var(--au-c));

  --au-bg: #f6f6fc;
  --au-surface: #ffffff;
  --au-surface-2: #eeeef8;
  --au-text: #14121f;
  --au-muted: #6b6884;
  --au-line: rgba(20, 18, 31, .09);
  --au-glass: rgba(255, 255, 255, .74);
  --au-like: #ff2d6f;
  --au-shadow: 0 1px 2px rgba(20, 18, 31, .04), 0 18px 40px -18px rgba(40, 30, 90, .28);

  --au-radius: 24px;
  --au-spring: cubic-bezier(.2, 1.25, .35, 1);
  --au-ease: cubic-bezier(.2, .8, .2, 1);
  --au-header-h: 64px;
  --au-tab-h: 64px;
  --au-safe-b: env(safe-area-inset-bottom, 0px);
  --au-safe-t: env(safe-area-inset-top, 0px);
}

html.king-night {
  --au-bg: #0b0b10;
  --au-surface: #14141c;
  --au-surface-2: #1e1e2a;
  --au-text: #f4f3ff;
  --au-muted: #9b98b8;
  --au-line: rgba(255, 255, 255, .09);
  --au-glass: rgba(14, 14, 20, .72);
  --au-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 22px 44px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

html[data-accent="sunset"] { --au-a: #ffb347; --au-b: #ff5e62; --au-c: #a44bff; }
html[data-accent="ocean"]  { --au-a: #22d3ee; --au-b: #3b82f6; --au-c: #6366f1; }
html[data-accent="lime"]   { --au-a: #a3e635; --au-b: #10b981; --au-c: #06b6d4; }
html[data-accent="rose"]   { --au-a: #fb7185; --au-b: #f43f5e; --au-c: #c026d3; }
html[data-accent="mono"]   { --au-a: #a1a1aa; --au-b: #71717a; --au-c: #3f3f46; --au-like: #e11d48; }
html.king-night[data-accent="mono"] { --au-a: #e4e4e7; --au-b: #a1a1aa; --au-c: #71717a; }

/* ==========================================================================
   2. Base
   ========================================================================== */

.aurora-theme,
.aurora-theme input,
.aurora-theme textarea,
.aurora-theme select,
.aurora-theme button {
  font-family: "Plus Jakarta Sans", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.aurora-theme {
  background-color: var(--au-bg);
  color: var(--au-text);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-bottom: 0;
}

.aurora-theme a { color: inherit; }
.aurora-theme ::selection { background: color-mix(in srgb, var(--au-b) 35%, transparent); }

/* slow breathing colour field behind everything */
.aurora-theme::before {
  content: "";
  position: fixed;
  inset: -10% -10% auto -10%;
  height: 80vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 45% at 18% 12%, var(--au-a), transparent 70%),
    radial-gradient(38% 45% at 82% 8%, var(--au-c), transparent 70%),
    radial-gradient(45% 50% at 50% 30%, var(--au-b), transparent 72%);
  opacity: .13;
  filter: blur(30px);
  animation: au-breathe 16s ease-in-out infinite alternate;
}
html.king-night .aurora-theme::before { opacity: .2; }

@keyframes au-breathe {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(0, 4%, 0) scale(1.08); }
}

.au-sheet, .au-sheet *,
.au-tabbar, .au-tabbar *,
.au-prompt, .au-prompt *,
.au-toasts, .au-toast,
.au-stories, .au-stories *,
.au-card, .au-card *,
.au-ptr, .au-offline { box-sizing: border-box; }

.au-i {
  width: 1.5em;
  height: 1.5em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  overflow: visible;
}

.au-lock, .au-lock body { overflow: hidden; }

.aurora-theme .king-body-in {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 18px;
}

/* ==========================================================================
   3. Header – glass, hides while scrolling down
   ========================================================================== */

.aurora-theme .king-headerf {
  transition: translate .5s var(--au-spring);
}

.aurora-theme .king-header {
  height: var(--au-header-h);
  background-color: var(--au-glass);
  -webkit-backdrop-filter: saturate(190%) blur(24px);
  backdrop-filter: saturate(190%) blur(24px);
  box-shadow: none;
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}

.au-scrolled .aurora-theme .king-header { border-bottom-color: var(--au-line); }
.au-hide-bars .aurora-theme .king-headerf { translate: 0 -110%; }

.aurora-theme .king-logo a,
.aurora-theme .king-logo { font-weight: 800; letter-spacing: -.02em; }

.aurora-theme .header-right ul { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }

.aurora-theme .header-right ul li span,
.aurora-theme .header-right .reglink,
.aurora-theme .king-rlater,
.aurora-theme .au-studio-btn {
  border: 0;
  background: var(--au-surface-2);
  color: var(--au-text);
  box-shadow: none;
  transition: transform .3s var(--au-spring), background-color .2s;
}

.aurora-theme .header-right ul li span:hover,
.aurora-theme .header-right .reglink:hover { background: var(--au-surface-2); transform: translateY(-1px); }
.aurora-theme .header-right ul li span:active,
.aurora-theme .au-studio-btn:active { transform: scale(.9); }

.aurora-theme .au-studio-li { list-style: none; }
.aurora-theme .au-studio-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.aurora-theme .au-studio-btn .au-i { width: 20px; height: 20px; }

.aurora-theme .king-havatar img,
.aurora-theme .king-havatar .king-avatar { border-radius: 50%; }
.aurora-theme .king-havatar { box-shadow: 0 0 0 2px var(--au-surface), 0 0 0 4px var(--au-b); border-radius: 50%; }

/* drawer + dropdowns */
.aurora-theme .leftmenu { background-color: var(--au-surface); border-radius: 0 28px 28px 0; box-shadow: none; }
.aurora-theme .leftmenu.open { box-shadow: 0 30px 80px rgba(8, 6, 24, .45); }
.aurora-theme .king-search { background: var(--au-glass); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px); border-radius: 0 0 28px 28px; }
.aurora-theme .king-dropdown,
.aurora-theme .king-dropdown2,
.aurora-theme .king-mega-menu { background-color: var(--au-surface); border-radius: 20px; box-shadow: var(--au-shadow); border: 1px solid var(--au-line); }

/* ==========================================================================
   4. Sub navigation pills
   ========================================================================== */

.aurora-theme .king-nav-sub-list {
  background: transparent;
  gap: 8px;
  padding: 4px 2px;
  box-shadow: none;
  max-width: 680px;
  margin: 0 auto 16px;
  scrollbar-width: none;
}
.aurora-theme .king-nav-sub-list::-webkit-scrollbar { display: none; }
.aurora-theme .king-nav-sub-link {
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 700;
  font-size: 13.5px;
  background: var(--au-surface);
  color: var(--au-muted);
  border: 1px solid var(--au-line);
  white-space: nowrap;
  transition: transform .3s var(--au-spring), background-color .2s, color .2s;
}
.aurora-theme .king-nav-sub-link:after { display: none; }
.aurora-theme .king-nav-sub-selected,
.aurora-theme .king-nav-sub-link:hover { background: var(--au-grad); color: #fff; border-color: transparent; }
.aurora-theme .king-nav-sub-link:active { transform: scale(.94); }

/* filters button: a round chip at the end of the pill row instead of an overlay */
.aurora-theme .king-flter {
  position: relative;
  right: auto;
  flex: none;
  margin-left: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0;
  background: var(--au-surface);
  border: 1px solid var(--au-line);
  box-shadow: none;
  color: var(--au-muted);
  transition: transform .3s var(--au-spring);
}
.aurora-theme .king-flter i { font-size: 15px; }
.aurora-theme .king-flter:active { transform: scale(.88); }
.aurora-theme .king-nav-sub-list { max-width: 680px; }

/* the "create" button in the header */
.aurora-theme .header-right .king-submit .kingadd {
  background: var(--au-grad);
  color: #fff;
  box-shadow: 0 8px 18px -8px var(--au-b);
}
.aurora-theme .header-right .king-submit .kingadd:before { display: none; }

/* ==========================================================================
   5. Stories rail
   ========================================================================== */

.au-stories { max-width: 640px; margin: 2px auto 16px; }

.au-stories-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 6px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.au-stories-track::-webkit-scrollbar { display: none; }
.au-stories-track.is-drag { cursor: grabbing; scroll-snap-type: none; }

.au-story {
  flex: 0 0 auto;
  width: 78px;
  text-align: center;
  text-decoration: none;
  color: var(--au-text);
  scroll-snap-align: start;
  transition: transform .35s var(--au-spring);
  user-select: none;
}
.au-story:active { transform: scale(.92); }

.au-ring {
  position: relative;
  display: block;
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--au-line);
  overflow: hidden;
}
.au-ring::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 0deg, var(--au-a), var(--au-b), var(--au-c), var(--au-a));
  opacity: 0;
  animation: au-spin 5s linear infinite;
}
.is-fresh .au-ring::before { opacity: 1; }
.au-ring img,
.au-ring .king-avatar {
  position: relative;
  display: block;
  width: calc(100% - 8px) !important;
  height: calc(100% - 8px) !important;
  margin: 4px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--au-surface-2);
  border: 3px solid var(--au-bg);
  box-sizing: border-box;
}
.au-ring .king-noavatar { display: grid; place-items: center; color: var(--au-muted); }

.au-ring-add { overflow: visible; background: var(--au-line); }
.au-ring-add::before { display: none; }
.au-plus {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--au-grad);
  color: #fff;
  border: 3px solid var(--au-bg);
  box-sizing: content-box;
  font-size: 12px;
}
.au-plus .au-i { width: 14px; height: 14px; stroke-width: 2.6; }

.au-story-name {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--au-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.is-fresh .au-story-name { color: var(--au-text); }

@keyframes au-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   6. Feed
   ========================================================================== */

.aurora-theme .king-part-q-list .container,
.aurora-theme .container.without-side,
.aurora-theme .container.with-side {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: calc(var(--au-tab-h) + 90px);
}

.aurora-theme .grid-sizer { width: 100%; }

.aurora-theme .au-card {
  width: 100%;
  margin: 0;
  padding: 0 0 22px;
  background: none;
  font-size: 15px;
  box-shadow: none;
  /* individual transform properties: Masonry owns `transform` for positioning */
  opacity: 0;
  translate: 0 22px;
  scale: .985;
  transition: opacity .6s var(--au-ease), translate .75s var(--au-spring), scale .75s var(--au-spring);
}
.aurora-theme .au-card.in { opacity: 1; translate: 0 0; scale: 1; }

/* card chrome lives in an inner surface so Masonry gutters stay clean */
.au-card-in { background: var(--au-surface); border-radius: var(--au-radius); box-shadow: var(--au-shadow); overflow: hidden; }
.au-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; }
.au-card-ava .king-avatar,
.au-card-ava img { display: block; width: 40px !important; height: 40px !important; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--au-surface), 0 0 0 4px var(--au-b); background: var(--au-surface-2); }
.au-card-ava .king-noavatar { display: grid; place-items: center; color: var(--au-muted); font-size: 14px; }
.au-card-who { flex: 1; min-width: 0; line-height: 1.25; }
.au-card-name { display: block; font-weight: 700; font-size: 14.5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-card-meta { display: block; font-size: 12px; color: var(--au-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-card-meta > span { margin-right: 6px; }

.au-iconbtn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--au-text);
  cursor: pointer;
  padding: 0;
  transition: transform .3s var(--au-spring), background-color .2s;
}
.au-iconbtn:hover { background: var(--au-surface-2); }
.au-iconbtn:active { transform: scale(.85); }

/* media */
.au-media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(110deg, var(--au-surface-2) 30%, var(--au-surface) 50%, var(--au-surface-2) 70%) 0 0 / 220% 100%;
  animation: au-shimmer 1.6s linear infinite;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.au-media:has(img.loaded), .au-media:has(img[src]) { animation: none; background: var(--au-surface-2); }
.au-media .item-a,
.au-media .post-featured-img { display: block; position: relative; }
.au-media img.item-img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: cover; transition: scale .8s var(--au-ease), opacity .4s; }
.au-media:hover img.item-img { scale: 1.025; }
.au-media:not(:has(img.loaded)) { min-height: 260px; }
.au-media .king-nothumb { display: block; min-height: 240px; background: var(--au-grad); opacity: .85; }

@keyframes au-shimmer { to { background-position: -220% 0; } }

.au-badge {
  position: absolute !important;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 5px 11px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(10, 8, 24, .5) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff !important;
  font-size: 11.5px !important;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  letter-spacing: .02em;
}

.king-class-video .au-media .item-a::after,
.king-class-music .au-media .item-a::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: rgba(10, 8, 24, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 6.5v11l9-5.5z'/%3E%3C/svg%3E") 54% 50% / 46% no-repeat;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset;
  transition: transform .4s var(--au-spring);
  pointer-events: none;
}
.king-class-video .au-media:hover .item-a::after,
.king-class-music .au-media:hover .item-a::after { transform: scale(1.12); }

/* the burst heart that appears on double tap */
.au-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 96px;
  height: 96px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  color: #ff2d6f;
  filter: drop-shadow(0 8px 24px rgba(255, 45, 111, .55));
  transform: translate(-50%, -50%) scale(0);
}
.au-burst .au-i { width: 100%; height: 100%; fill: currentColor; stroke: none; }

.au-spark {
  position: absolute;
  z-index: 4;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
}

/* actions */
.au-actions { display: flex; align-items: center; gap: 2px; padding: 6px 10px 0; }
.au-act {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--au-text);
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  font-size: 17px;
  transition: transform .3s var(--au-spring), background-color .2s, color .2s;
}
.au-act:hover { background: var(--au-surface-2); }
.au-act:active { transform: scale(.8); }
.au-act .au-i { width: 26px; height: 26px; transition: fill .25s, stroke .25s, color .25s; }
.au-like.is-on { color: var(--au-like); }
.au-like.is-on .au-i { fill: currentColor; }
.au-spacer { flex: 1; }
.au-save.selected { color: var(--au-b); }
.au-save .fa-bookmark { font-size: 21px; }
.au-save.selected .fa-bookmark { font-weight: 900; }

.au-stats { display: flex; align-items: center; justify-content: space-between; padding: 2px 18px 0; font-size: 13.5px; }
.au-likes { font-weight: 700; }
.au-views { display: inline-flex; align-items: center; gap: 6px; color: var(--au-muted); font-size: 12.5px; }
.au-views .au-i { width: 16px; height: 16px; }

.au-caption { padding: 4px 18px 0; line-height: 1.5; font-size: 14.5px; word-break: break-word; }
.au-caption-name { font-weight: 800; text-decoration: none; margin-right: 4px; }
.au-caption-title { text-decoration: none; font-weight: 500; }
.au-caption-title:hover { text-decoration: underline; }

.au-viewall { display: block; padding: 4px 18px 0; color: var(--au-muted); font-size: 13px; text-decoration: none; }
.au-card-in > :last-child { padding-bottom: 16px; }

/* ----- grid layout (profile-style tiles) ----- */
html[data-layout="grid"] .aurora-theme .king-part-q-list .container,
html[data-layout="grid"] .aurora-theme .container.without-side,
html[data-layout="grid"] .aurora-theme .container.with-side { max-width: 1040px; }
html[data-layout="grid"] .aurora-theme .grid-sizer { width: 33.3333%; }
html[data-layout="grid"] .aurora-theme .au-card { width: 33.3333%; padding: 3px; }
html[data-layout="grid"] .au-card-head,
html[data-layout="grid"] .au-actions,
html[data-layout="grid"] .au-stats,
html[data-layout="grid"] .au-caption,
html[data-layout="grid"] .au-viewall { display: none; }
html[data-layout="grid"] .au-card-in { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
html[data-layout="grid"] .au-media { aspect-ratio: 1; border-radius: 16px; box-shadow: var(--au-shadow); }
html[data-layout="grid"] .au-media .item-a,
html[data-layout="grid"] .au-media .post-featured-img,
html[data-layout="grid"] .au-media img.item-img { width: 100%; height: 100%; max-height: none; }
html[data-layout="grid"] .au-badge { top: 8px; left: 8px; padding: 3px 8px !important; font-size: 10px !important; }
html[data-layout="grid"] .king-class-video .au-media .item-a::after,
html[data-layout="grid"] .king-class-music .au-media .item-a::after { width: 40px; height: 40px; margin: -20px 0 0 -20px; }

/* ==========================================================================
   7. Mobile tab bar
   ========================================================================== */

.au-tabbar { display: none; }

@media (max-width: 820px) {
  .aurora-theme { padding-bottom: calc(var(--au-tab-h) + 24px + var(--au-safe-b)); }

  .au-tabbar {
    position: fixed;
    left: 50%;
    bottom: calc(12px + var(--au-safe-b));
    z-index: 40;
    translate: -50% 0;
    width: min(440px, calc(100% - 24px));
    height: var(--au-tab-h);
    padding: 6px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: center;
    border-radius: 34px;
    background: var(--au-glass);
    -webkit-backdrop-filter: saturate(200%) blur(26px);
    backdrop-filter: saturate(200%) blur(26px);
    border: 1px solid var(--au-line);
    box-shadow: 0 24px 50px -16px rgba(30, 20, 80, .45), 0 2px 6px rgba(0, 0, 0, .06);
    transition: translate .55s var(--au-spring);
  }

  .au-tab-pill {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    border-radius: 28px;
    background: var(--au-surface-2);
    opacity: 0;
    transition: transform .5s var(--au-spring), width .5s var(--au-spring), opacity .3s;
    pointer-events: none;
  }
  .au-tab-pill.is-ready { opacity: 1; }

  .au-tab {
    position: relative;
    height: 100%;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    color: var(--au-muted);
    border-radius: 28px;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    transition: color .25s, transform .3s var(--au-spring);
  }
  .au-tab .au-i { width: 26px; height: 26px; transition: transform .45s var(--au-spring); }
  .au-tab.is-active { color: var(--au-text); }
  .au-tab.is-active .au-i { transform: translateY(-1px) scale(1.08); stroke-width: 2.2; }
  .au-tab:active .au-i { transform: scale(.82); }

  .au-tab-me img,
  .au-tab-me .king-avatar { width: 28px !important; height: 28px !important; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--au-surface), 0 0 0 3.5px var(--au-line); }
  .au-tab-me.is-active img,
  .au-tab-me.is-active .king-avatar { box-shadow: 0 0 0 2px var(--au-surface), 0 0 0 3.5px var(--au-b); }

  .au-tab-create { color: #fff; }
  .au-create-ico {
    display: grid;
    place-items: center;
    width: 52px;
    height: 44px;
    border-radius: 18px;
    background: var(--au-grad);
    box-shadow: 0 10px 22px -8px var(--au-b), 0 0 0 1px rgba(255, 255, 255, .25) inset;
    transition: transform .45s var(--au-spring);
  }
  .au-tab-create:active .au-create-ico { transform: scale(.88) rotate(90deg); }
  .au-create-ico .au-i { width: 24px; height: 24px; stroke-width: 2.6; }
  .au-tab-create:active .au-i { transform: none; }

  .aurora-theme .king-part-q-list .container,
  .aurora-theme .container.without-side,
  .aurora-theme .container.with-side { padding-bottom: 40px; }

  .aurora-theme .king-header { padding-left: 14px; padding-right: 14px; }
  /* search and create live in the tab bar on phones: keep the header uncluttered */
  .aurora-theme .header-right .search-button,
  .aurora-theme .header-right .king-submit { display: none; }
  .aurora-theme .header-right li:has(> .king-submit) { display: none; }
  .aurora-theme .header-right ul { gap: 8px; }
  html[data-layout="grid"] .aurora-theme .au-card { padding: 2px; }
}

@media (min-width: 821px) {
  .aurora-theme .au-card:hover { translate: 0 -2px; }
}

/* ==========================================================================
   8. Sheets, switches, segments, swatches, buttons
   ========================================================================== */

.au-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(8, 6, 24, .52);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--au-ease);
}
.au-backdrop.is-on { opacity: 1; pointer-events: auto; }

.au-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 60;
  translate: -50% 105%;
  width: min(580px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 22px calc(26px + var(--au-safe-b));
  background: var(--au-surface);
  color: var(--au-text);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -30px 80px -20px rgba(8, 6, 24, .6);
  transition: translate .55s var(--au-spring);
  touch-action: pan-y;
}
.au-sheet[hidden] { display: none; }
.au-sheet.is-open { translate: -50% 0; }
.au-sheet.is-dragging { transition: none; }

@media (min-width: 821px) {
  .au-sheet { bottom: 50%; translate: -50% 60%; opacity: 0; border-radius: 30px; max-height: 80vh; transition: translate .55s var(--au-spring), opacity .3s; }
  .au-sheet.is-open { translate: -50% 50%; opacity: 1; }
}

.au-sheet-grip { width: 44px; height: 5px; border-radius: 99px; background: var(--au-line); margin: 4px auto 14px; cursor: grab; }
.au-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.au-sheet-title { margin: 0 0 14px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.au-sheet-head .au-sheet-title { margin-bottom: 6px; }

.au-create-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.au-create-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 8px 14px;
  border-radius: 22px;
  background: var(--au-surface-2);
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  transition: transform .35s var(--au-spring), background-color .2s;
}
.au-create-item .au-i { width: 30px; height: 30px; color: var(--au-b); }
.au-create-item:hover { background: var(--au-line); }
.au-create-item:active { transform: scale(.92); }

.au-group { margin-top: 10px; }
.au-group h3 { margin: 16px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--au-muted); font-weight: 700; }
.au-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--au-line); }
.au-row:last-child { border-bottom: 0; }
.au-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.au-row-text b { font-weight: 700; font-size: 15px; }
.au-row-text small { color: var(--au-muted); font-size: 12.5px; line-height: 1.4; }
.au-row-col { flex-direction: column; align-items: flex-start; }
.au-row-switch { cursor: pointer; }

.au-switch { position: absolute; opacity: 0; pointer-events: none; }
.au-track {
  position: relative;
  flex: none;
  width: 54px;
  height: 32px;
  border-radius: 99px;
  background: var(--au-surface-2);
  box-shadow: inset 0 0 0 1px var(--au-line);
  transition: background .35s;
}
.au-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  transition: transform .5s var(--au-spring), width .25s var(--au-spring);
}
.au-switch:checked + .au-track { background: var(--au-grad); box-shadow: none; }
.au-switch:checked + .au-track .au-thumb { transform: translateX(22px); }
.au-row-switch:active .au-thumb { width: 33px; }
.au-row-switch:active .au-switch:checked + .au-track .au-thumb { transform: translateX(15px); }
.au-switch:focus-visible + .au-track { outline: 3px solid var(--au-b); outline-offset: 2px; }

.au-seg { display: inline-flex; padding: 3px; border-radius: 15px; background: var(--au-surface-2); gap: 2px; flex: none; }
.au-seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--au-muted);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color .25s, color .25s, transform .3s var(--au-spring), box-shadow .25s;
}
.au-seg button .au-i { width: 16px; height: 16px; }
.au-seg button.is-on { background: var(--au-surface); color: var(--au-text); box-shadow: 0 2px 8px rgba(0, 0, 0, .14); }
.au-seg button:active { transform: scale(.94); }

.au-swatches { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 2px 4px; }
.au-swatch {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: transform .4s var(--au-spring), box-shadow .25s;
}
.au-swatch[data-accent="aurora"] { background: linear-gradient(135deg, #14e2cd, #7c5cff 55%, #ff3d9a); }
.au-swatch[data-accent="sunset"] { background: linear-gradient(135deg, #ffb347, #ff5e62 55%, #a44bff); }
.au-swatch[data-accent="ocean"]  { background: linear-gradient(135deg, #22d3ee, #3b82f6 55%, #6366f1); }
.au-swatch[data-accent="lime"]   { background: linear-gradient(135deg, #a3e635, #10b981 55%, #06b6d4); }
.au-swatch[data-accent="rose"]   { background: linear-gradient(135deg, #fb7185, #f43f5e 55%, #c026d3); }
.au-swatch[data-accent="mono"]   { background: linear-gradient(135deg, #a1a1aa, #52525b 55%, #18181b); }
.au-swatch.is-on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--au-surface), 0 0 0 5.5px var(--au-b); }
.au-swatch:active { transform: scale(.9); }

.au-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  background: var(--au-grad);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 22px -10px var(--au-b);
  transition: transform .35s var(--au-spring), opacity .2s, box-shadow .2s;
}
.au-btn:hover { box-shadow: 0 14px 28px -10px var(--au-b); }
.au-btn:active { transform: scale(.94); }
.au-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.au-btn-ghost,
.au-push-toggle.is-on { background: var(--au-surface-2); color: var(--au-text) !important; box-shadow: none; }
.au-push-topics { margin-top: 2px; }
.au-push-topics[hidden],
.au-install-group[hidden] { display: none; }
.au-push-test { margin-top: 12px; width: 100%; }
.au-row-topic { padding: 10px 0; }

/* ==========================================================================
   9. Toasts, prompt, offline bar, progress, pull to refresh
   ========================================================================== */

.au-toasts {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  translate: -50% 0;
  width: min(440px, calc(100% - 28px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
@media (max-width: 820px) { .au-toasts { bottom: calc(var(--au-tab-h) + 32px + var(--au-safe-b)); } }

.au-toast {
  max-width: 100%;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(16, 14, 30, .9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08) inset;
  pointer-events: auto;
  text-align: center;
}
html.king-night .au-toast { background: rgba(244, 243, 255, .94); color: #14121f; box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .7); }
.au-toast.is-link { cursor: pointer; }
.au-toast.is-ok { background: linear-gradient(135deg, #0fb89f, #4f46e5); color: #fff; }
.au-toast.is-error { background: linear-gradient(135deg, #ef4444, #be185d); color: #fff; }
.au-toast.is-warn { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }

.au-prompt {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 70;
  translate: -50% 0;
  width: min(460px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 26px;
  background: var(--au-surface);
  color: var(--au-text);
  box-shadow: 0 30px 70px -20px rgba(30, 20, 90, .6), 0 0 0 1px var(--au-line);
}
@media (max-width: 820px) { .au-prompt { bottom: calc(var(--au-tab-h) + 30px + var(--au-safe-b)); } }
.au-prompt-ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--au-grad); color: #fff; }
.au-prompt-text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.au-prompt-text b { font-size: 14.5px; }
.au-prompt-text small { color: var(--au-muted); font-size: 12px; }
.au-prompt .au-btn { padding: 9px 16px; }

.au-offline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: calc(6px + var(--au-safe-t)) 12px 6px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  translate: 0 -110%;
  transition: translate .45s var(--au-spring);
}
.au-offline.is-on { translate: 0 0; }

.au-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  background: var(--au-grad);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
  pointer-events: none;
}
.au-progress.is-run { opacity: 1; transform: scaleX(.88); transition: transform 9s cubic-bezier(.1, .9, .2, 1); }
.au-progress.is-done { transform: scaleX(1); opacity: 0; transition: transform .2s, opacity .4s .2s; }

.au-ptr {
  position: fixed;
  top: calc(var(--au-safe-t) + 8px);
  left: 50%;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  translate: -50% calc(var(--y, 0px) - 64px);
  opacity: var(--p, 0);
  pointer-events: none;
  transition: translate .35s var(--au-spring), opacity .25s;
}
.au-ptr.is-pulling { transition: none; }
.au-ptr-ring {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(var(--au-b) calc(var(--p, 0) * 360deg), var(--au-line) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
  mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
  rotate: calc(var(--p, 0) * 240deg);
}
.au-ptr.is-loading { opacity: 1; translate: -50% 40px; }
.au-ptr.is-loading .au-ptr-ring { background: conic-gradient(var(--au-a), var(--au-b), var(--au-c), var(--au-a)); animation: au-spin .8s linear infinite; }
.au-ptr-text { font-size: 11.5px; font-weight: 700; color: var(--au-muted); }

/* ==========================================================================
   10. Page polish – question view, forms, buttons, modals
   ========================================================================== */

.aurora-theme .king-q-view,
.aurora-theme .pboxes,
.aurora-theme .maincom,
.aurora-theme .king-widget-wb,
.aurora-theme .share-bar,
.aurora-theme .user-box,
.aurora-theme .king-sidebar,
.aurora-theme .king-related { background-color: var(--au-surface); border-radius: var(--au-radius); box-shadow: var(--au-shadow); }

.aurora-theme .king-video,
.aurora-theme .king-video-in { border-radius: var(--au-radius); overflow: hidden; }
.aurora-theme .pheader h1 { font-weight: 800; letter-spacing: -.025em; }

.aurora-theme .king-form-tall-button,
.aurora-theme input[type="submit"],
.aurora-theme .king-form-light-button {
  border-radius: 999px;
  font-weight: 700;
  transition: transform .3s var(--au-spring), box-shadow .2s, background-color .2s;
}
.aurora-theme .king-form-tall-button:active,
.aurora-theme input[type="submit"]:active { transform: scale(.95); }
.aurora-theme .king-form-tall-button-ask,
.aurora-theme .king-form-tall-button-answer,
.aurora-theme .king-form-tall-button-comment,
.aurora-theme #king-login {
  background: var(--au-grad);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 24px -12px var(--au-b);
}

.aurora-theme input[type="text"],
.aurora-theme input[type="password"],
.aurora-theme input[type="email"],
.aurora-theme textarea,
.aurora-theme .king-form-tall-text,
.aurora-theme .king-form-tall-select,
.aurora-theme .modal-input {
  border-radius: 16px;
  transition: box-shadow .25s, background-color .25s;
}
.aurora-theme input[type="text"]:focus,
.aurora-theme input[type="password"]:focus,
.aurora-theme input[type="email"]:focus,
.aurora-theme textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--au-b) 35%, transparent);
  outline: 0;
}

.aurora-theme .king-modal-content { border-radius: 28px; box-shadow: 0 40px 100px -30px rgba(10, 6, 40, .7); }
.aurora-theme .mfp-content { border-radius: var(--au-radius); }
.aurora-theme .king-tag-link { border-radius: 999px; font-weight: 600; }
.aurora-theme .king-footer { border-radius: 28px 28px 0 0; margin-top: 20px; }

/* ----- the old brand red (#f70047) becomes the accent everywhere ----- */
.aurora-theme .king-form-wide-button,
.aurora-theme .king-form-tall-button,
.aurora-theme #submit-btn,
.aurora-theme .king-form-basic-button,
.aurora-theme .king-form-basic-hover,
.aurora-theme #king-login,
.aurora-theme .img-submit,
.aurora-theme .king-page-selected,
.aurora-theme .king-follow,
.aurora-theme .mcount,
.aurora-theme .ntfy-event-new,
.aurora-theme .mem-button,
.aurora-theme .meme-button,
.aurora-theme .king-unfavorite-button {
  background: var(--au-grad);
  color: #fff;
  border-color: transparent;
}
.aurora-theme .king-form-wide-button,
.aurora-theme .king-form-tall-button,
.aurora-theme #king-login,
.aurora-theme #submit-btn { box-shadow: 0 12px 24px -12px var(--au-b); }

.aurora-theme .king-page-links-item a:hover,
.aurora-theme .king-tag-link:hover,
.aurora-theme .tagcloud a:hover,
.aurora-theme .reglink:hover,
.aurora-theme .king-post-upbtn a:hover,
.aurora-theme .modal-reglink a:hover,
.aurora-theme .inleft .pbutton:hover,
.aurora-theme .tblack:hover,
.aurora-theme .kingp-tabs .addtab:hover,
.aurora-theme .kingp-tabs .addtab.active { background-color: var(--au-b); border-color: var(--au-b); color: #fff; }

.aurora-theme a:hover,
.aurora-theme .king-nav-cat-selected,
.aurora-theme .king-nav-cat-link:hover,
.aurora-theme .king-page-prev,
.aurora-theme .king-page-next,
.aurora-theme .king-notice a,
.aurora-theme .leftmenu-left span a:hover,
.aurora-theme .king-a-list .king-user-link:hover,
.aurora-theme .king-nav-headmenu-list li a:hover { color: var(--au-b); }
.aurora-theme .au-card a:hover,
.aurora-theme .au-story:hover,
.aurora-theme .au-btn:hover,
.aurora-theme .au-tab:hover,
.aurora-theme .au-badge:hover,
.aurora-theme .au-create-item:hover { color: inherit; }
.aurora-theme .au-card .au-badge:hover,
.aurora-theme .au-btn:hover { color: #fff !important; }

.aurora-theme .king-favorite-hover,
.aurora-theme .king-favorite-button:hover { color: var(--au-like); }
.aurora-theme input:focus,
.aurora-theme textarea:focus,
.aurora-theme select:focus { border-color: var(--au-b); }
.aurora-theme .search-toggle:hover { border-color: var(--au-b); color: var(--au-b); }
.aurora-theme .king-form-tall-error { background: linear-gradient(135deg, #ef4444, #be185d); }

/* ==========================================================================
   11. Accessibility & motion preferences
   ========================================================================== */

.aurora-theme a:focus-visible,
.aurora-theme button:focus-visible,
.au-tab:focus-visible { outline: 3px solid var(--au-b); outline-offset: 2px; }

.au-reduce .aurora-theme::before,
.au-reduce .au-ring::before,
.au-reduce .au-media,
.au-reduce .au-ptr.is-loading .au-ptr-ring { animation: none !important; }
.au-reduce .aurora-theme *,
.au-reduce .aurora-theme *::before,
.au-reduce .aurora-theme *::after,
.au-reduce .au-sheet,
.au-reduce .au-tabbar,
.au-reduce .au-toast { transition-duration: .01ms !important; transition-delay: 0s !important; }
.au-reduce .aurora-theme .au-card { opacity: 1; translate: 0 0; scale: 1; }

@media (prefers-reduced-motion: reduce) {
  html:not(.au-motion-on) .aurora-theme::before,
  html:not(.au-motion-on) .au-ring::before,
  html:not(.au-motion-on) .au-media { animation: none; }
}

@media print {
  .au-tabbar, .au-sheet, .au-backdrop, .au-toasts, .au-prompt, .au-stories { display: none !important; }
}
