/* =========================================================
   ReelHunter / pages/search-by-keyword.css
   Page layer: keyword search page, search form, sort dropdown,
   results grid, reel cards, skeletons.
========================================================= */

.card_top .reel-vid{
    pointer-events: none;
}

.card_top {
    cursor: pointer;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity .18s ease, transform .18s ease;
    background: rgba(0, 0, 0, .22);
    z-index: 2;
}

.card_top:hover .play-overlay {
    opacity: 1;
    transform: scale(1);
}

.card_top.is-playing .play-overlay {
    opacity: 0;
    transform: scale(0.95);
}

.reel-progress {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.32);
    overflow: hidden;
    z-index: 5;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: auto;
    cursor: pointer;
}

.reel-progress__fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
}

.card_top.is-playing .reel-progress,
.card_top.is-seeking .reel-progress {
    opacity:1;
    transform:translateY(0);
}

.card_top.is-playing .card_top-items,
.card_top.is-playing .card_top-panel,
.card_top.is-seeking .card_top-items,
.card_top.is-seeking .card_top-panel {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.card_top .card_top-items,
.card_top .card_top-panel {
    opacity: 1;
    transition: opacity .15s ease;
}

/* RESULTS */
.results-shell {
    width: 100%;
}

.results-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.results-head__text {
    min-width: 0;
}

.results-kicker {
    color: #7b8d97;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.results-title {
    color: #31454f;
    font-weight: 800;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -.02em;
}

.results-box {
    width: 100%;
    min-height: 560px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    border: 1px solid #e7eef3;
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 14px 44px rgba(15, 23, 42, 0.05);
}

.results-empty {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 22px;
}

.results-empty__icon {
    width: 136px;
    height: 136px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f7fafc 0%, #edf3f7 100%);
    color: #9aaab5;
    margin-bottom: 22px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.results-empty__icon svg {
    width: 74px;
    height: 74px;
}

.results-empty__title {
    margin: 0 0 10px;
    font-size: 30px;
    line-height: 1.08;
    font-weight: 800;
    color: #334b56;
    letter-spacing: -.02em;
}

.results-empty__text {
    margin: 0;
    max-width: 560px;
    font-size: 16px;
    line-height: 1.6;
    color: #7b8d97;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.reel-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.reel-card__media {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, #f1e1c1 0%, #e8d0aa 100%);
    min-height: 370px;
    aspect-ratio: 9 / 14;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.reel-card__media::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    background: linear-gradient(to top, rgba(0,0,0,.28), rgba(0,0,0,0));
    pointer-events: none;
    z-index: 1;
}

.card_top .reel-vid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.reel-card__actions {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.reel-card__icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0,0,0,.14);
}

.reel-card__icon-btn--light {
    background: rgba(255,255,255,.94);
}

.reel-card__icon-btn--dark {
    background: rgba(17, 17, 17, .60);
}

.reel-card__stats {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(22, 22, 22, .64);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    padding: 10px 12px;
}

.reel-card__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.reel-card__stat-icon {
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.reel-card__stat-value {
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.reel-card__body {
    padding: 14px 4px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reel-card__author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.reel-card__avatar {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, #b42318, #7a1b14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}

.reel-card__username {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
    color: #3344d3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reel-card__desc {
    margin: 0;
    color: #617683;
    font-size: 14px;
    line-height: 1.52;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reel-card__btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 13px 16px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #1b27ff, #3242ff);
    box-shadow: 0 12px 24px rgba(27, 39, 255, .24);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.reel-card__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(27, 39, 255, .28);
}

.reel-card__btn:active {
    transform: translateY(0);
}

.results-skeleton {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.results-skel-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.results-skel-media,
.results-skel-line,
.results-skel-btn,
.results-skel-avatar {
    position: relative;
    overflow: hidden;
    background: #e8edf2;
}

.results-skel-media::after,
.results-skel-line::after,
.results-skel-btn::after,
.results-skel-avatar::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
    animation: resultsShimmer 1.2s infinite;
}

.results-skel-media {
    border-radius: 24px;
    aspect-ratio: 9 / 14;
    min-height: 370px;
}

.results-skel-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-skel-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
}

.results-skel-line {
    height: 14px;
    border-radius: 999px;
}

.results-skel-line.short {
    width: 58%;
}

.results-skel-btn {
    height: 46px;
    border-radius: 14px;
}

@keyframes resultsShimmer {
    100% { transform: translateX(100%); }
}

/* MODAL */
:root{
      --bg:#eef4ff;
      --bg-2:#f7faff;
      --bg-3:#ffffff;

      --panel:rgba(255,255,255,.78);
      --panel-2:rgba(255,255,255,.92);
      --panel-3:#f8fbff;
      --panel-4:#f2f6fc;

      --card:linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,252,255,.90));
      --card-soft:linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,249,253,.88));
      --card-lite:linear-gradient(180deg, rgba(255,255,255,.98), rgba(252,253,255,.96));

      --border:rgba(148,163,184,.18);
      --border-strong:rgba(148,163,184,.28);
      --border-accent:rgba(99,102,241,.22);

      --text:#0f172a;
      --text-soft:#334155;
      --muted:#64748b;
      --muted-2:#94a3b8;

      --primary:#5b5cf0;
      --primary-2:#7c3aed;
      --primary-3:#4f46e5;
      --primary-soft:rgba(91,92,240,.10);

      --success:#16a34a;
      --warning:#f59e0b;
      --danger:#ef4444;

      --radius-xl:32px;
      --radius-lg:24px;
      --radius-md:18px;
      --radius-sm:14px;
      --radius-xs:10px;

      --shadow-xs:0 2px 8px rgba(15,23,42,.05);
      --shadow-sm:0 12px 28px rgba(15,23,42,.08);
      --shadow-md:0 24px 60px rgba(15,23,42,.12);
      --shadow-lg:0 36px 110px rgba(15,23,42,.18);

      --sidebar-glass:rgba(255,255,255,.52);
    --sidebar-glass-2:rgba(255,255,255,.34);
    --sidebar-stroke:rgba(255,255,255,.52);

      --tr:220ms cubic-bezier(.2,.8,.2,1);
      --tr-slow:420ms cubic-bezier(.2,.8,.2,1);
    }

    .demo-wrap{
      padding:48px;
    }

    .card_bottom-bottom{
      border:0;
      cursor:pointer;
      transition:transform var(--tr), box-shadow var(--tr), opacity var(--tr);
      box-shadow:0 18px 42px rgba(79,70,229,.20);
    }

    .card_bottom-bottom:hover{
      transform:translateY(-2px);
      box-shadow:0 24px 54px rgba(79,70,229,.26);
    }

    .reel-modal{
      position:fixed;
      inset:0;
      z-index:9999;
    }

    .reel-modal__backdrop{
      position:absolute;
      inset:0;
      background:
        radial-gradient(circle at 20% 10%, rgba(91,92,240,.18), transparent 26%),
        radial-gradient(circle at 82% 0%, rgba(124,58,237,.14), transparent 22%),
        rgba(15,23,42,.28);
      backdrop-filter:blur(16px) saturate(130%);
      animation:fadeIn .35s ease;
    }

    .reel-modal__dialog{
      position:relative;
      width:min(1520px, 96vw);
      height:min(940px, 95vh);
      margin:2.5vh auto;
      border-radius:30px;
      overflow:hidden;
      border:1px solid rgba(255,255,255,.45);
      background:linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,251,255,.96));
      box-shadow:var(--shadow-lg);
      animation:modalIn .42s cubic-bezier(.2,.9,.2,1);
      isolation:isolate;
    }

    .reel-modal__dialog::before{
      content:"";
      position:absolute;
      inset:0;
      background:
        radial-gradient(circle at top left, rgba(91,92,240,.10), transparent 22%),
        radial-gradient(circle at bottom right, rgba(124,58,237,.06), transparent 20%);
      pointer-events:none;
    }

    .reel-modal__dialog::after{
      content:"";
      position:absolute;
      inset:0;
      border-radius:inherit;
      box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
      pointer-events:none;
    }

    .reel-modal__close{
      position:absolute;
      top:16px;
      right:16px;
      width:44px;
      height:44px;
      border-radius:14px;
      border:1px solid var(--border);
      background:rgba(255,255,255,.78);
      color:var(--text);
      font-size:24px;
      cursor:pointer;
      z-index:30;
      backdrop-filter:blur(10px);
      transition:transform var(--tr), background var(--tr), border-color var(--tr), box-shadow var(--tr);
      box-shadow:var(--shadow-xs);
    }

    .reel-modal__close:hover{
      transform:translateY(-1px);
      background:#fff;
      border-color:var(--border-strong);
      box-shadow:0 16px 32px rgba(15,23,42,.10);
    }

    .rm-layout{
      position:relative;
      z-index:1;
      display:grid;
      grid-template-columns:390px minmax(0, 1fr);
      height:100%;
      min-height:0;
    }

    .rm-left,
    .rm-right{
      min-height:0;
    }

    .rm-left{
      position:relative;
      padding:22px;
      overflow:auto;
      border-right:1px solid rgba(255,255,255,.06);
      background:
        radial-gradient(circle at top left, rgba(91,92,240,.18), transparent 26%),
        linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
    }

    .rm-left::after{
      content:"";
      position:absolute;
      top:0;
      right:0;
      width:1px;
      height:100%;
      background:linear-gradient(180deg, transparent, rgba(255,255,255,.10), transparent);
      pointer-events:none;
    }

    .rm-left-sticky{
      position:sticky;
      top:0;
      display:flex;
      flex-direction:column;
      gap:16px;
    }

    .rm-left-topbar{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
    }

    .rm-eyebrow,
    .rm-top-meta-label,
    .rm-subtitle,
    .rm-kpi__label,
    .rm-meta-pill__label{
      font-size:11px;
      font-weight:800;
      letter-spacing:.12em;
      text-transform:uppercase;
      color:var(--muted);
    }

    .rm-left-topbar__label,
    .rm-block-title,
    .rm-left-caption-label{
      font-size:11px;
      font-weight:800;
      letter-spacing:.12em;
      text-transform:uppercase;
      color:rgba(226,232,240,.70);
    }

    .rm-left-profile-card,
    .rm-left-stats-card,
    .rm-left-caption-card,
    .rm-card,
    .rm-hero-card{
      position:relative;
      overflow:hidden;
      border:1px solid var(--border);
      box-shadow:var(--shadow-sm);
      backdrop-filter:blur(12px);
    }

    .rm-card,
    .rm-hero-card{
      background:var(--card-soft);
    }

    .rm-left-profile-card,
    .rm-left-stats-card,
    .rm-left-caption-card{
      background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
      border:1px solid rgba(255,255,255,.08);
      box-shadow:0 14px 30px rgba(0,0,0,.22);
    }

    .rm-left-profile-card::before,
    .rm-left-stats-card::before,
    .rm-left-caption-card::before,
    .rm-card::before,
    .rm-hero-card::before{
      content:"";
      position:absolute;
      inset:0;
      background:linear-gradient(180deg, rgba(255,255,255,.05), transparent 28%);
      pointer-events:none;
    }

    .rm-video-link-wrap{
      display:block;
      text-decoration:none;
    }

    .rm-left-frame{
      position:relative;
      padding:14px;
      border-radius:28px;
      background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
      border:1px solid rgba(255,255,255,.08);
      box-shadow:0 24px 52px rgba(0,0,0,.28);
      transition:transform var(--tr), box-shadow var(--tr), border-color var(--tr);
      overflow:hidden;
    }

    .rm-left-frame::before{
      content:"";
      position:absolute;
      inset:0;
      background:
        radial-gradient(circle at top left, rgba(91,92,240,.18), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,.05), transparent 28%);
      pointer-events:none;
    }

    .rm-video-link-wrap:hover .rm-left-frame{
      transform:translateY(-2px);
      border-color:rgba(99,102,241,.22);
      box-shadow:0 28px 60px rgba(0,0,0,.34), 0 0 0 4px rgba(91,92,240,.06);
    }

    .rm-reel{
      position:relative;
      border-radius:22px;
      overflow:hidden;
      background:#000;
      aspect-ratio:9/16;
      width:100%;
      box-shadow:0 18px 40px rgba(0,0,0,.22);
    }

    .rm-reel::after{
      content:"";
      position:absolute;
      inset:0;
      background:linear-gradient(180deg, rgba(255,255,255,.05), transparent 20%, transparent 70%, rgba(0,0,0,.12));
      pointer-events:none;
    }

    .rm-reel video{
      width:100%;
      height:100%;
      object-fit:cover;
      display:block;
      background:#000;
    }

    .rm-left-info{
      display:flex;
      flex-direction:column;
      gap:14px;
    }

    .rm-left-profile-card,
    .rm-left-stats-card,
    .rm-left-caption-card{
      padding:16px;
      border-radius:20px;
    }

    .rm-left-profile{
      display:flex;
      align-items:center;
      gap:12px;
    }

    .rm-left-avatar{
      width:50px;
      height:50px;
      flex:0 0 50px;
      border-radius:999px;
      background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,.45), transparent 28%),
        linear-gradient(135deg, #5b5cf0 0%, #7c3aed 55%, #4f46e5 100%);
      box-shadow:inset 0 1px 0 rgba(255,255,255,.28), 0 10px 24px rgba(91,92,240,.22);
    }

    .rm-left-profile-text{
      min-width:0;
    }

    .rm-left-username{
      font-weight:800;
      font-size:18px;
      line-height:1.15;
      letter-spacing:-.025em;
      color:#f8fafc;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .rm-left-date{
      margin-top:4px;
      font-size:12px;
      color:rgba(203,213,225,.72);
    }

    .rm-open-link{
      display:inline-flex;
      align-items:center;
      gap:8px;
      min-height:36px;
      padding:0 13px;
      border-radius:999px;
      text-decoration:none;
      background:rgba(255,255,255,.06);
      border:1px solid rgba(255,255,255,.09);
      color:#f8fafc;
      font-size:12px;
      font-weight:700;
      transition:transform var(--tr), border-color var(--tr), background var(--tr), box-shadow var(--tr), color var(--tr);
      box-shadow:0 8px 20px rgba(0,0,0,.16);
      white-space:nowrap;
    }

    .rm-open-link:hover{
      transform:translateY(-1px);
      background:rgba(255,255,255,.10);
      border-color:rgba(255,255,255,.16);
      color:#c7d2fe;
      box-shadow:0 14px 28px rgba(0,0,0,.24);
    }

    .rm-open-link__icon{
      width:16px;
      height:16px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      flex:0 0 16px;
    }

    .rm-left-stats-grid{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:10px;
      margin-top: 10px;
    }

    .rm-stat{
      display:flex;
      align-items:flex-start;
      gap:10px;
      min-height:76px;
      padding:13px 14px;
      border-radius:18px;
      transition:transform var(--tr), border-color var(--tr), background var(--tr), box-shadow var(--tr);
    }

    .rm-left .rm-stat{
      background:rgba(255,255,255,.05);
      border:1px solid rgba(255,255,255,.07);
    }

    .rm-left .rm-stat:hover{
      transform:translateY(-1px);
      border-color:rgba(99,102,241,.18);
      background:rgba(255,255,255,.08);
      box-shadow:0 14px 26px rgba(0,0,0,.20);
    }

    .rm-stat__icon{
      width:18px;
      height:18px;
      flex:0 0 18px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      margin-top:1px;
    }

    .rm-left .rm-stat__icon{
      color:#818cf8;
    }

    .rm-left .rm-stat__label{
      font-size:11px;
      font-weight:800;
      letter-spacing:.12em;
      text-transform:uppercase;
      color:rgba(226,232,240,.58);
    }

    .rm-left .rm-stat__value{
      font-size:19px;
      line-height:1.1;
      font-weight:800;
      color:#f8fafc;
      letter-spacing:-.03em;
      word-break:break-word;
    }

    .rm-left-caption-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      margin-bottom:10px;
    }

    .rm-left-caption-toggle,
    .rm-link-btn{
      border:0;
      background:transparent;
      font-size:12px;
      font-weight:800;
      cursor:pointer;
      padding:0;
      transition:opacity var(--tr), transform var(--tr), color var(--tr);
    }

    .rm-link-btn{
      color:var(--primary);
    }

    .rm-link-btn:hover{
      opacity:.92;
      color:#4338ca;
      transform:translateY(-1px);
    }

    .rm-left-caption{
      font-size:13px;
      line-height:1.65;
      white-space:pre-wrap;
      color:#cbd5e1;
      word-break:break-word;
      position:relative;
    }

    .rm-left-caption.is-collapsed{
      max-height:92px;
      overflow:hidden;
    }

    .rm-left-caption.is-collapsed::after{
      content:"";
      position:absolute;
      left:0;
      right:0;
      bottom:0;
      height:38px;
      background:linear-gradient(to bottom, rgba(15,23,42,0), rgba(15,23,42,1));
      pointer-events:none;
    }

    .rm-left-caption-toggle{
      color:#a5b4fc;
    }

    .rm-left-caption-toggle:hover{
      opacity:.92;
      color:#c7d2fe;
      transform:translateY(-1px);
    }

    .rm-right{
      position:relative;
      padding:22px;
      overflow-y:auto;
      overflow-x:hidden;
      background:
        radial-gradient(circle at top right, rgba(91,92,240,.05), transparent 22%),
        radial-gradient(circle at 82% 14%, rgba(124,58,237,.04), transparent 18%),
        linear-gradient(180deg, rgba(248,251,255,.82), rgba(245,248,252,.96));
      scrollbar-width:thin;
      scrollbar-color:rgba(148,163,184,.45) transparent;
    }

    .rm-right::-webkit-scrollbar,
    .rm-left::-webkit-scrollbar{
      width:10px;
    }

    .rm-right::-webkit-scrollbar-track,
    .rm-left::-webkit-scrollbar-track{
      background:transparent;
    }

    .rm-right::-webkit-scrollbar-thumb,
    .rm-left::-webkit-scrollbar-thumb{
      background:rgba(148,163,184,.42);
      border-radius:999px;
      border:2px solid transparent;
      background-clip:padding-box;
    }

    .rm-appbar{
      position:sticky;
      top:-22px;
      z-index:8;
      display:flex;
      flex-direction:column;
      gap:14px;
      padding:0 0 16px;
      padding-top:22px;
      margin-bottom:18px;
      background:linear-gradient(180deg, rgba(248,251,255,.95), rgba(248,251,255,.82));
      backdrop-filter:blur(16px) saturate(135%);
      border-bottom:1px solid rgba(148,163,184,.08);
    }

    .rm-appbar__top{
      display:flex;
      justify-content:space-between;
      gap:16px;
      align-items:flex-start;
    }

    .rm-appbar__title{
      margin:6px 0 0;
      font-size:30px;
      line-height:1.02;
      font-weight:900;
      letter-spacing:-.05em;
      color:var(--text);
    }

    .rm-header-actions{
      display:flex;
      margin-right:58px;
      gap:8px;
      justify-content:flex-end;
      flex-wrap:wrap;
      position:relative;
    }

    .rm-toolbar-btn,
    .rm-primary-btn,
    .reel-modal__lock-btn,
    .rm-icon-btn{
      appearance:none;
      border:0;
      cursor:pointer;
      transition:transform var(--tr), box-shadow var(--tr), opacity var(--tr), border-color var(--tr), background var(--tr), color var(--tr);
    }

    .rm-toolbar-btn,
    .rm-icon-btn{
      border:1px solid var(--border);
      background:rgba(255,255,255,.78);
      min-height:42px;
      padding:0 14px;
      border-radius:14px;
      font-weight:800;
      color:var(--text);
      box-shadow:var(--shadow-xs);
      backdrop-filter:blur(10px);
    }

    .rm-icon-btn{
      width:42px;
      padding:0;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      flex:0 0 42px;
    }

    .rm-toolbar-btn:hover,
    .rm-icon-btn:hover{
      transform:translateY(-1px);
      background:#fff;
      border-color:var(--border-strong);
      box-shadow:0 14px 26px rgba(15,23,42,.08);
    }

    .rm-primary-btn,
    .reel-modal__lock-btn{
      position:relative;
      overflow:hidden;
      min-height:42px;
      padding:0 16px;
      border-radius:14px;
      font-weight:800;
      font-size:14px;
      color:#fff;
      background:linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 55%, var(--primary-3) 100%);
      box-shadow:0 18px 38px rgba(91,92,240,.22), inset 0 1px 0 rgba(255,255,255,.18);
    }

    .rm-primary-btn::before,
    .reel-modal__lock-btn::before{
      content:"";
      position:absolute;
      inset:0;
      background:linear-gradient(120deg, transparent 25%, rgba(255,255,255,.18) 50%, transparent 75%);
      transform:translateX(-130%);
      transition:transform .8s ease;
    }

    .rm-primary-btn:hover,
    .reel-modal__lock-btn:hover{
      transform:translateY(-1px);
      box-shadow:0 24px 42px rgba(91,92,240,.28), inset 0 1px 0 rgba(255,255,255,.18);
    }

    .rm-primary-btn:hover::before,
    .reel-modal__lock-btn:hover::before{
      transform:translateX(130%);
    }

    .rm-menu{
      position:relative;
    }

    .rm-menu__dropdown{
      position:absolute;
      top:calc(100% + 8px);
      right:0;
      min-width:180px;
      padding:8px;
      border-radius:16px;
      background:rgba(255,255,255,.96);
      border:1px solid var(--border);
      box-shadow:0 22px 50px rgba(15,23,42,.14);
      z-index:20;
      animation:fadeUp .18s ease;
    }

    .rm-menu__item{
      width:100%;
      border:0;
      background:transparent;
      color:var(--text);
      min-height:40px;
      border-radius:12px;
      padding:0 12px;
      text-align:left;
      font-weight:700;
      cursor:pointer;
      transition:background var(--tr), color var(--tr);
    }

    .rm-menu__item:hover{
      background:rgba(91,92,240,.08);
      color:var(--primary);
    }

    .rm-tabs-wrap{
      display:flex;
      align-items:center;
      justify-content:flex-start;
    }

    .rm-tabs{
      display:inline-flex;
      flex-wrap:wrap;
      gap:8px;
      padding:7px;
      border-radius:18px;
      background:rgba(255,255,255,.70);
      border:1px solid var(--border);
      box-shadow:var(--shadow-xs);
      backdrop-filter:blur(10px);
    }

    .rm-tab{
      border:1px solid transparent;
      background:transparent;
      color:var(--muted);
      min-height:40px;
      padding:0 14px;
      border-radius:13px;
      cursor:pointer;
      font-weight:800;
      font-size:13px;
      transition:transform var(--tr), color var(--tr), background var(--tr), box-shadow var(--tr), border-color var(--tr);
    }

    .rm-tab:hover{
      color:var(--text);
      background:rgba(15,23,42,.04);
    }

    .rm-tab.is-active{
      color:#fff;
      background:linear-gradient(135deg, var(--primary), var(--primary-2));
      border-color:transparent;
      box-shadow:0 12px 24px rgba(91,92,240,.20);
      transform:translateY(-1px);
    }

    .rm-panels{ position:relative; }

    .rm-panel{
      display:none;
      animation:fadeUp .32s ease;
    }

    .rm-panel.is-active{ display:block; }

    .rm-section{ margin-top:18px; }

    .rm-grid-2{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:18px;
    }

    .rm-card{
      padding:20px;
      border-radius:22px;
    }

    .rm-hero-card{
      padding:22px;
      border-radius:24px;
      background:
        radial-gradient(circle at top right, rgba(91,92,240,.08), transparent 30%),
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.94));
    }

    .rm-empty-state__badge,
    .reel-modal__lock-badge{
      display:inline-flex;
      align-items:center;
      min-height:30px;
      padding:0 12px;
      border-radius:999px;
      background:rgba(91,92,240,.10);
      color:#4f46e5;
      font-size:12px;
      font-weight:800;
      margin-bottom:14px;
      border:1px solid rgba(91,92,240,.10);
    }

    .rm-hero-main{
      display:grid;
      grid-template-columns:1fr 280px;
      gap:18px;
      align-items:start;
      margin-bottom:18px;
    }

    .rm-top-meta-item{ margin-bottom:14px; }

    .rm-topic{
      font-weight:900;
      font-size:34px;
      line-height:1.06;
      color:var(--text);
      letter-spacing:-.05em;
      max-width:18ch;
    }

    .rm-meta-line{
      display:flex;
      flex-wrap:wrap;
      gap:10px;
    }

    .rm-meta-pill{
      display:inline-flex;
      align-items:center;
      gap:8px;
      min-height:38px;
      padding:0 12px;
      border-radius:999px;
      background:rgba(255,255,255,.80);
      border:1px solid var(--border);
      color:var(--text);
      font-size:13px;
      font-weight:800;
      box-shadow:var(--shadow-xs);
    }

    .rm-hero-summary-inline{
      margin-top:16px;
      padding:15px 16px;
      border-radius:18px;
      background:rgba(91,92,240,.06);
      border:1px solid rgba(91,92,240,.10);
      color:var(--text-soft);
      line-height:1.68;
      font-size:14px;
    }

    .rm-score-card{
      background:linear-gradient(180deg, #111827 0%, #0f172a 100%);
      color:#fff;
      border-radius:22px;
      padding:18px;
      min-height:100%;
      display:flex;
      flex-direction:column;
      justify-content:flex-start;
      gap:18px;
      box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 22px 44px rgba(15,23,42,.14);
      border:1px solid rgba(255,255,255,.05);
    }

    .rm-score-label{
      font-size:12px;
      text-transform:uppercase;
      letter-spacing:.10em;
      opacity:.72;
      font-weight:800;
    }

    .rm-score-topline{
      display:flex;
      align-items:flex-end;
      justify-content:space-between;
      gap:14px;
    }

    .rm-score-value-wrap{
      display:flex;
      align-items:flex-end;
      gap:6px;
    }

    .rm-score-value{
      font-size:58px;
      line-height:1;
      font-weight:900;
      letter-spacing:-.05em;
      margin:0;
    }

    .rm-score-total{
      font-size:16px;
      line-height:1.2;
      font-weight:700;
      color:rgba(255,255,255,.58);
      padding-bottom:8px;
    }

    .rm-score-badge{
      min-height:32px;
      padding:0 12px;
      border-radius:999px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      font-size:12px;
      font-weight:800;
      background:rgba(255,255,255,.10);
      color:#fff;
      border:1px solid rgba(255,255,255,.10);
      white-space:nowrap;
    }

    .rm-rating-scale{
      display:flex;
      flex-direction:column;
      gap:10px;
    }

    .rm-rating-scale__track{
      position:relative;
      height:14px;
      border-radius:999px;
      background:
        linear-gradient(90deg,
          #ef4444 0%,
          #f59e0b 35%,
          #eab308 55%,
          #22c55e 78%,
          #16a34a 100%);
      overflow:visible;
      box-shadow:
        inset 0 1px 2px rgba(0,0,0,.18),
        0 8px 22px rgba(0,0,0,.16);
    }

    .rm-rating-scale__fill{
      position:absolute;
      left:0;
      top:0;
      bottom:0;
      width:50%;
      border-radius:999px;
      background:linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.04));
      mix-blend-mode:screen;
      pointer-events:none;
    }

    .rm-rating-scale__marker{
      position:absolute;
      top:50%;
      left:50%;
      width:20px;
      height:20px;
      border-radius:999px;
      background:#fff;
      border:4px solid #0f172a;
      transform:translate(-50%, -50%);
      box-shadow:0 6px 18px rgba(0,0,0,.28);
      transition:left .55s cubic-bezier(.2,.8,.2,1);
    }

    .rm-rating-scale__labels{
      display:flex;
      justify-content:space-between;
      gap:12px;
      font-size:11px;
      font-weight:700;
      color:rgba(255,255,255,.68);
    }

    .rm-progress-wrap{
      width:100%;
      margin-top:8px;
    }

    .rm-progress-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin-bottom:8px;
      font-size:12px;
      color:rgba(255,255,255,.74);
      font-weight:700;
    }

    .rm-progress{
      position:relative;
      height:10px;
      border-radius:999px;
      background:rgba(255,255,255,.08);
      overflow:hidden;
      box-shadow:inset 0 1px 2px rgba(0,0,0,.2);
    }

    .rm-progress__bar{
      position:absolute;
      inset:0 auto 0 0;
      width:82%;
      border-radius:999px;
      background:linear-gradient(90deg, var(--primary), var(--primary-2), var(--primary-3));
      box-shadow:0 0 18px rgba(91,92,240,.30);
      transition:width .55s cubic-bezier(.2,.8,.2,1);
    }

    .rm-score-caption{
      font-size:13px;
      line-height:1.45;
      color:rgba(255,255,255,.82);
    }

    .rm-kpis{
      display:grid;
      grid-template-columns:repeat(4, 1fr);
      gap:12px;
      margin-bottom:18px;
    }

    .rm-kpi{
      background:rgba(255,255,255,.72);
      border:1px solid rgba(148,163,184,.12);
      border-radius:18px;
      padding:14px;
      transition:transform var(--tr), box-shadow var(--tr), border-color var(--tr), background var(--tr);
      box-shadow:var(--shadow-xs);
    }

    .rm-kpi:hover{
      transform:translateY(-1px);
      border-color:rgba(91,92,240,.14);
      background:#fff;
      box-shadow:0 14px 28px rgba(15,23,42,.06);
    }

    .rm-kpi__value{
      font-size:19px;
      font-weight:900;
      color:var(--text);
      letter-spacing:-.03em;
    }

    .rm-subgrid{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:18px;
    }

    .rm-chips{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      margin-top: 10px;
    }

    .rm-chip{
      display:inline-flex;
      align-items:center;
      min-height:34px;
      padding:0 12px;
      border-radius:999px;
      font-weight:800;
      font-size:13px;
      border:1px solid rgba(148,163,184,.12);
      background:rgba(255,255,255,.82);
      color:var(--text);
      box-shadow:var(--shadow-xs);
      transition:transform var(--tr), box-shadow var(--tr), background var(--tr);
    }

    .rm-chip:hover{
      transform:translateY(-1px);
      background:#fff;
      box-shadow:0 10px 22px rgba(15,23,42,.06);
    }

    .rm-chip--violet{ background:rgba(109,40,217,.10); border-color:rgba(109,40,217,.14); color:#6b21a8; }
    .rm-chip--green{ background:rgba(34,197,94,.10); border-color:rgba(34,197,94,.14); color:#166534; }
    .rm-chip--amber{ background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.16); color:#92400e; }

    .rm-section-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      margin-bottom:12px;
      flex-wrap:wrap;
    }

    .rm-section-title{
      margin:0 0 12px;
      font-weight:900;
      font-size:19px;
      color:var(--text);
      letter-spacing:-.03em;
    }

    .rm-summary-box,
    .rm-highlight-box,
    .rm-transcript,
    .rm-list-card,
    .rm-timeline-content,
    .rm-mini{
      background:rgba(255,255,255,.72);
      border:1px solid rgba(148,163,184,.12);
      border-radius:18px;
      box-shadow:var(--shadow-xs);
    }

    .rm-summary-box,
    .rm-highlight-box{
      padding:16px 18px;
      color:var(--text-soft);
      line-height:1.68;
      white-space:pre-wrap;
      font-size:14px;
    }

    .rm-highlight-box{
      background:linear-gradient(135deg, rgba(91,92,240,.10), rgba(255,255,255,.82));
      color:#1e293b;
      font-weight:700;
    }

    .rm-transcript{
      padding:16px 18px;
      color:var(--text-soft);
      line-height:1.72;
      font-size:15px;
      white-space:pre-wrap;
      position:relative;
      background:#fff;
    }

    .rm-transcript.is-collapsed{
      max-height:220px;
      overflow:hidden;
    }

    .rm-transcript.is-collapsed::after{
      content:"";
      position:absolute;
      left:0;
      right:0;
      bottom:0;
      height:56px;
      background:linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    }

    .rm-transcript-toolbar{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      flex-wrap:wrap;
      margin-bottom:14px;
    }

    .rm-subtabs{
      display:inline-flex;
      gap:8px;
      padding:6px;
      border-radius:14px;
      background:rgba(241,245,249,.92);
      border:1px solid rgba(148,163,184,.14);
    }

    .rm-subtab{
      border:1px solid transparent;
      background:transparent;
      min-height:36px;
      padding:0 12px;
      border-radius:10px;
      font-weight:800;
      font-size:13px;
      color:var(--muted);
      cursor:pointer;
      transition:all var(--tr);
    }

    .rm-subtab:hover{
      background:rgba(15,23,42,.04);
      color:var(--text);
    }

    .rm-subtab.is-active{
      background:linear-gradient(135deg, var(--primary), var(--primary-2));
      color:#fff;
      box-shadow:0 10px 20px rgba(91,92,240,.18);
    }

    .rm-transcript-actions{
      display:flex;
      align-items:center;
      gap:8px;
      flex-wrap:wrap;
    }

    .rm-timeline{
      display:flex;
      flex-direction:column;
      gap:12px;
    }

    .rm-timeline-item{
      display:grid;
      grid-template-columns:84px 1fr;
      gap:12px;
      align-items:start;
    }

    .rm-time{
      position:relative;
      top:10px;
      font-size:12px;
      font-weight:800;
      color:var(--muted);
    }

    .rm-timeline-content{
      padding:15px 16px;
      transition:transform var(--tr), box-shadow var(--tr), border-color var(--tr), background var(--tr);
    }

    .rm-timeline-content:hover,
    .rm-mini:hover{
      transform:translateY(-1px);
      border-color:rgba(91,92,240,.14);
      background:#fff;
      box-shadow:0 14px 28px rgba(15,23,42,.06);
    }

    .rm-badge{
      display:inline-flex;
      align-items:center;
      height:24px;
      padding:0 10px;
      border-radius:999px;
      font-size:12px;
      font-weight:800;
      background:rgba(91,92,240,.10);
      color:#4f46e5;
      margin-bottom:8px;
      border:1px solid rgba(91,92,240,.10);
    }

    .rm-timeline-title{
      font-weight:900;
      font-size:18px;
      color:var(--text);
      margin-bottom:8px;
      letter-spacing:-.03em;
    }

    .rm-timeline-text{
      color:var(--text-soft);
      line-height:1.56;
    }

    .rm-stat-grid{
      display:grid;
      gap:12px;
    }

    .rm-mini{
      padding:14px 16px;
      transition:transform var(--tr), border-color var(--tr), box-shadow var(--tr), background var(--tr);
      background:rgba(255,255,255,.72);
    }

    .rm-mini-title{
      font-weight:900;
      margin-bottom:8px;
      color:var(--text);
      font-size:15px;
      letter-spacing:-.02em;
    }

    .rm-mini-body{
      color:var(--text-soft);
      white-space:pre-wrap;
      line-height:1.58;
      font-size:14px;
    }

    .rm-list-card{
      padding:16px 18px;
      line-height:1.68;
      color:var(--text-soft);
      font-size:14px;
    }

    #rmRepl,
    #rmTactics{
      white-space:unset;
      display:flex;
      flex-direction:column;
      gap:14px;
    }

    #rmTactics > div,
    #rmRepl > div{
      position:relative;
      padding-left:18px;
    }

    #rmTactics > div::before,
    #rmRepl > div::before{
      content:"";
      position:absolute;
      left:0;
      top:.72em;
      width:7px;
      height:7px;
      border-radius:999px;
      background:linear-gradient(135deg, var(--primary), var(--primary-2));
      box-shadow:0 0 0 4px rgba(91,92,240,.08);
    }

    .reel-modal__lock{
      position:absolute;
      inset:0;
      display:flex;
      align-items:center;
      justify-content:center;
      z-index:12;
      padding:20px;
    }

    .reel-modal__lock::before{
      content:"";
      position:absolute;
      inset:0;
      backdrop-filter:blur(16px) saturate(120%);
      background:linear-gradient(180deg, rgba(248,251,255,.58), rgba(248,251,255,.74));
    }

    .reel-modal__lock-card{
      position:relative;
      width:min(490px, 96%);
      background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.96));
      border-radius:28px;
      padding:28px;
      box-shadow:var(--shadow-lg);
      border:1px solid rgba(255,255,255,.65);
      text-align:center;
      animation:fadeUp .4s ease;
    }

    .reel-modal__lock-title{
      font-weight:900;
      font-size:22px;
      margin-bottom:8px;
      letter-spacing:-.04em;
      color:var(--text);
    }

    .reel-modal__lock-sub{
      color:var(--text-soft);
      margin-bottom:16px;
      line-height:1.65;
      font-size:14px;
    }

    .reel-modal__lock-btn{
      width:100%;
      min-height:48px;
      border-radius:16px;
      font-size:14px;
    }

    .reel-modal__lock-btn:disabled{
      opacity:.65;
      cursor:not-allowed;
    }

    .reel-modal__pill{
      background:rgba(255,255,255,.18);
      padding:2px 8px;
      border-radius:999px;
      margin-left:8px;
    }

    .reel-modal__lock-note{
      margin-top:10px;
      color:var(--danger);
      font-size:13px;
      line-height:1.45;
      min-height:18px;
    }

    .reel-modal__loader{
      position:absolute;
      left:50%;
      top:50%;
      transform:translate(-50%,-50%);
      background:rgba(15,23,42,.96);
      color:#fff;
      padding:12px 16px;
      border-radius:14px;
      z-index:14;
      font-weight:800;
      box-shadow:0 18px 40px rgba(15,23,42,.18);
      letter-spacing:-.01em;
      border:1px solid rgba(255,255,255,.08);
    }

    .reel-modal__loader::before{
      content:"";
      display:inline-block;
      width:14px;
      height:14px;
      margin-right:10px;
      border-radius:999px;
      border:2px solid rgba(255,255,255,.26);
      border-top-color:#fff;
      vertical-align:-2px;
      animation:spin 1s linear infinite;
    }

    .reel-modal__lock[hidden]{
    display:none !important;
  }

    .rm-right.is-locked{
      overflow:hidden !important;
    }

    .rm-skeleton{
      position:absolute;
      inset:0;
      padding:160px 20px 20px;
      background:rgba(248,251,255,.72);
      backdrop-filter:blur(8px);
      z-index:11;
      overflow:hidden;
    }

    .rm-skeleton-card{
      background:rgba(255,255,255,.82);
      border:1px solid rgba(255,255,255,.65);
      border-radius:22px;
      box-shadow:var(--shadow-sm);
      padding:18px;
      margin-bottom:16px;
    }

    .rm-skeleton-grid{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:16px;
    }

    .rm-skel{
      position:relative;
      overflow:hidden;
      border-radius:12px;
      background:linear-gradient(90deg, #e8edf5, #f4f7fb, #e8edf5);
      background-size:200% 100%;
      animation:shimmerBg 1.5s linear infinite;
    }

    .rm-skel::after{
      content:"";
      position:absolute;
      inset:0;
      transform:translateX(-100%);
      background:linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
      animation:shimmer 1.25s infinite;
    }

    .rm-skel--title{
      width:38%;
      height:22px;
      margin-bottom:14px;
    }

    .rm-skel--line{
      height:14px;
      margin-bottom:10px;
    }

    .rm-skel--line.short{
      width:62%;
    }

    .rm-skel--box{
      height:120px;
    }

    .rm-toast{
      position:fixed;
      right:18px;
      bottom:18px;
      z-index:10000;
      background:rgba(15,23,42,.96);
      color:#fff;
      padding:12px 14px;
      border-radius:14px;
      box-shadow:0 18px 40px rgba(15,23,42,.18);
      font-weight:800;
      border:1px solid rgba(255,255,255,.08);
      animation:toastIn .28s ease;
    }

    @keyframes spin{ to{ transform:rotate(360deg);} }
    @keyframes shimmer{ 100%{ transform:translateX(100%);} }
    @keyframes shimmerBg{ 100%{ background-position:-200% 0;} }

    @keyframes fadeIn{
      from{ opacity:0; }
      to{ opacity:1; }
    }

    @keyframes modalIn{
      from{
        opacity:0;
        transform:translateY(18px) scale(.985);
      }
      to{
        opacity:1;
        transform:translateY(0) scale(1);
      }
    }

    @keyframes fadeUp{
      from{
        opacity:0;
        transform:translateY(10px);
      }
      to{
        opacity:1;
        transform:translateY(0);
      }
    }

    @keyframes toastIn{
      from{
        opacity:0;
        transform:translateY(8px);
      }
      to{
        opacity:1;
        transform:translateY(0);
      }
    }

    @media (max-width: 1180px){
      .rm-layout{
        grid-template-columns:350px 1fr;
      }

      .rm-hero-main{
        grid-template-columns:1fr;
      }

      .rm-kpis{
        grid-template-columns:repeat(2, 1fr);
      }

      .rm-grid-2,
      .rm-subgrid,
      .rm-skeleton-grid{
        grid-template-columns:1fr;
      }

      .rm-topic{
        max-width:unset;
      }
    }

    @media (max-width: 980px){
      .reel-modal__dialog{
        width:95vw;
        height:93vh;
        margin:3.5vh auto;
        border-radius:24px;
      }

      .rm-layout{
        grid-template-columns:1fr;
        grid-template-rows:auto minmax(0, 1fr);
      }

      .rm-left{
        padding-bottom:10px;
        overflow:hidden;
        border-right:0;
        border-bottom:1px solid rgba(148,163,184,.10);
      }

      .rm-left-sticky{
        position:static;
      }

      .rm-right{
        padding:16px;
      }

      .rm-reel{
        max-height:38vh;
      }

      .rm-appbar__top{
        flex-direction:column;
        align-items:stretch;
      }

      .rm-header-actions{
        justify-content:flex-start;
        width:100%;
        margin-right:0;
      }

      .rm-appbar__title{
        font-size:24px;
      }

      .rm-topic{
        font-size:26px;
      }

      .rm-timeline-item{
        grid-template-columns:1fr;
        gap:8px;
      }

      .rm-time{
        top:0;
      }

      .rm-skeleton{
        padding:200px 16px 16px;
      }
    }

    @media (max-width: 640px){
      .demo-wrap{
        padding:20px;
      }

      .reel-modal__dialog{
        width:100vw;
        height:100vh;
        margin:0;
        border-radius:0;
      }

      .rm-left,
      .rm-right{
        padding:14px;
      }

      .rm-kpis{
        grid-template-columns:1fr;
      }

      .rm-tabs{
        width:100%;
      }

      .rm-tab{
        flex:1 1 calc(50% - 8px);
        text-align:center;
      }

      .rm-left-stats-grid{
        grid-template-columns:1fr 1fr;
      }

      .rm-appbar{
        top:-14px;
      }

      .reel-modal__close{
        top:12px;
        right:12px;
      }

      .rm-transcript-toolbar{
        align-items:stretch;
      }

      .rm-subtabs,
      .rm-transcript-actions{
        width:100%;
      }

      .rm-transcript-actions{
        justify-content:flex-start;
      }
    }

    @media (prefers-reduced-motion: reduce){
      *,
      *::before,
      *::after{
        animation:none !important;
        transition:none !important;
        scroll-behavior:auto !important;
      }
    }
    
   /* ===============================
   KEYWORD PAGE RIGHT SIDE REDESIGN
   Works with existing JS ids/classes
================================ */

:root{
  --page-bg:#f5f7fa;
  --page-bg-2:#eef2f6;
  --card:#ffffff;
  --border:#e2e8f0;
  --border-strong:#cbd5e1;

  --text:#0f172a;
  --muted:#64748b;
  --muted-2:#8a99a6;

  --primary:#3040ff;
  --primary-2:#7257ff;
  --primary-3:#5a3fff;

  --success:#0f9f6e;
  --danger:#dc2626;
  --warning:#d97706;

  --shadow-sm:0 10px 26px rgba(15,23,42,.04);
  --shadow-md:0 18px 44px rgba(15,23,42,.07);
  --shadow-lg:0 28px 70px rgba(15,23,42,.10);

  --tr:.18s ease;
}

/* Fix sidebar width mismatch */
.workspace-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns: 270px 1fr;
  align-items:start;
  background:
    radial-gradient(circle at top right, rgba(48,64,255,.08), transparent 26%),
    linear-gradient(180deg, #f5f7fa 0%, #eef2f6 100%);
}

/* Right side */
.keyword-main{
  min-width:0;
  padding:24px;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

.keyword-stack{
  display:grid;
  gap:18px;
  max-width:1480px;
  margin:0 auto;
}

.search-card,
.results-card{
  border:1px solid var(--border);
  border-radius:30px;
  background:
    radial-gradient(circle at top right, rgba(48,64,255,.06), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.96));
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}

.search-card__inner{
  padding:28px 30px;
}

.page-eyebrow{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 11px;
  border-radius:999px;
  background:rgba(48,64,255,.08);
  color:#2437d6;
  border:1px solid rgba(48,64,255,.10);
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.search-title{
  margin:14px 0 0;
  font-size:42px;
  line-height:1.02;
  letter-spacing:-.05em;
  font-weight:950;
  color:#0f172a;
  max-width:820px;
}

.search-subtitle{
  margin:12px 0 0;
  color:#64748b;
  font-size:15px;
  line-height:1.65;
  max-width:860px;
}

.search-box{
  margin-top:24px;
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 280px 150px;
  gap:12px !important;
  align-items:end !important;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif !important;
}

.search-field{
  display:grid;
  gap:8px;
}

.search-field__label{
  font-size:12px;
  font-weight:900;
  letter-spacing:.07em;
  text-transform:uppercase;
  color:#6b7e91;
}

.search-input-wrap{
  position:relative;
}

.search-input-icon{
  position:absolute;
  left:16px;
  top:50%;
  transform:translateY(-50%);
  width:20px;
  height:20px;
  color:#7b8ba0;
  pointer-events:none;
}

.search-input-icon svg{
  width:20px;
  height:20px;
  display:block;
}

.keyword-input{
  width:100%;
  min-height:56px;
  border-radius:18px !important;
  border:1px solid #dce5ef !important;
  background:#fff;
  outline:none;
  padding:0 18px 0 48px !important;
  color:#0f172a;
  font-size:16px;
  font-weight:800;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
  transition:border-color var(--tr), box-shadow var(--tr), transform var(--tr);
}

.keyword-input::placeholder{
  color:#94a3b8;
  font-weight:700;
}

.keyword-input:focus{
  border-color:rgba(48,64,255,.32) !important;
  box-shadow:0 0 0 5px rgba(48,64,255,.08);
}

.search-helper-card{
  min-height:56px;
  border-radius:18px;
  border:1px solid #dce5ef;
  background:
    radial-gradient(circle at top right, rgba(48,64,255,.08), transparent 34%),
    linear-gradient(180deg, #fff, #f9fbff);
  padding:10px 14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 10px 22px rgba(15,23,42,.04);
}

.search-helper-card__label{
  font-size:10px;
  line-height:1;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#8a99a6;
}

.search-helper-card__text{
  margin-top:5px;
  font-size:13px;
  line-height:1.25;
  font-weight:900;
  color:#0f172a;
}

.search-btn{
  min-height:56px;
  border:0 !important;
  border-radius:18px !important;
  background:linear-gradient(135deg,var(--primary),var(--primary-2)) !important;
  color:#fff !important;
  font-size:14px;
  font-weight:950;
  cursor:pointer;
  box-shadow:0 16px 34px rgba(48,64,255,.22);
  transition:transform var(--tr), box-shadow var(--tr), opacity var(--tr);
  position:relative;
  overflow:hidden;
  padding:0 18px !important;
}

.search-btn::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(120deg, transparent 25%, rgba(255,255,255,.22) 50%, transparent 75%);
  transform:translateX(-130%);
  transition:transform .8s ease;
}

.search-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 22px 42px rgba(48,64,255,.28);
}

.search-btn:hover::before{
  transform:translateX(130%);
}

.search-btn:disabled{
  opacity:.68;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

.quick-keywords{
  margin-top:16px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.keyword-chip{
  min-height:34px;
  border:1px solid #dce5ef;
  border-radius:999px;
  background:rgba(255,255,255,.78);
  color:#53677a;
  padding:0 12px;
  font-size:13px;
  font-weight:850;
  cursor:pointer;
  transition:transform var(--tr), background var(--tr), border-color var(--tr), color var(--tr);
}

.keyword-chip:hover{
  transform:translateY(-1px);
  background:#fff;
  border-color:rgba(48,64,255,.22);
  color:#2437d6;
}

/* Results layout */
.results-card__header{
  padding:22px 26px 18px;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.68);
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.results-title-wrap{
  min-width:0;
}

.results-kicker{
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#8a99a6;
  margin-bottom:0;
}

.results-title{
  margin:8px 0 0;
  font-size:28px;
  line-height:1.05;
  letter-spacing:-.04em;
  font-weight:950;
  color:#0f172a;
}

.results-subtitle{
  margin:8px 0 0;
  color:#64748b;
  font-size:14px;
  line-height:1.55;
}

.results-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.result-pill{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid #dce5ef;
  background:#fff;
  color:#53677a;
  font-size:13px;
  font-weight:850;
}

.result-pill strong{
  color:#0f172a;
}

.results-card__body{
  padding:24px 26px 28px;
}

/* IMPORTANT: #kwOut keeps JS compatibility */
.results-card #kwOut.results-box{
  width:100%;
  min-height:360px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

.results-card #kwOut.results-box.results-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:15px;
  align-items:start;
}

/* Empty state compatible with old class */
.results-empty{
  min-height:360px;
  display:grid;
  place-items:center;
  text-align:center;
  padding:38px;
  border:1px dashed #cbd5e1;
  border-radius:24px;
  background:rgba(255,255,255,.55);
}

.results-empty__icon{
  width:74px;
  height:74px;
  margin:0 auto 16px;
  border-radius:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, rgba(48,64,255,.10), rgba(114,87,255,.08));
  color:#2437d6;
  box-shadow:0 16px 34px rgba(48,64,255,.10);
}

.results-empty__icon svg{
  width:30px;
  height:30px;
  display:block;
}

.results-empty__title{
  margin:0;
  font-size:24px;
  line-height:1.1;
  font-weight:950;
  letter-spacing:-.04em;
  color:#0f172a;
}

.results-empty__text{
  margin:10px auto 0;
  max-width:540px;
  color:#64748b;
  font-size:14px;
  line-height:1.7;
}

/* Skeleton compatible with your current JS */
.results-skeleton{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:15px;
}

.results-skel-card{
  display:grid;
  gap:12px;
}

.results-skel-media,
.results-skel-line,
.results-skel-btn,
.results-skel-avatar{
  position:relative;
  overflow:hidden;
  background:linear-gradient(90deg,#e6ebf1,#f3f6fa,#e6ebf1);
  background-size:200% 100%;
  animation:shimmerBg 1.4s linear infinite;
}

.results-skel-media{
  min-height:auto;
  aspect-ratio:9/14.6;
  border-radius:22px;
}

.results-skel-line{
  height:14px;
  border-radius:999px;
}

.results-skel-line.short{
  width:70%;
}

.results-skel-btn{
  height:50px;
  border-radius:14px;
}

.results-skel-avatar{
  width:34px;
  height:34px;
  border-radius:999px;
}

.results-skel-author{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Reel cards generated by your current render() */
.results-card .reel-card{
  min-width:0;
  display:flex;
  flex-direction:column;
  animation:reelReveal .45s cubic-bezier(.16,1,.3,1) both;
}

.results-card .reel-card__media{
  position:relative;
  aspect-ratio:9/14.6;
  min-height:auto;
  border-radius:22px;
  overflow:hidden;
  background:
    radial-gradient(circle at top, rgba(48,64,255,.16), transparent 32%),
    linear-gradient(180deg,#121827,#060914);
  box-shadow:0 18px 38px rgba(15,23,42,.16);
  transform:translateZ(0);
  padding:14px;
}

.results-card .reel-card__media::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.25), transparent 22%, transparent 52%, rgba(0,0,0,.46)),
    linear-gradient(90deg, rgba(0,0,0,.16), transparent 30%, rgba(0,0,0,.12));
  pointer-events:none;
  z-index:1;
}

.results-card .card_top .reel-vid{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:22px;
  transition:transform .35s ease;
}

.results-card .reel-card:hover .reel-vid{
  transform:scale(1.035);
}

.results-card .reel-card__actions{
  position:absolute;
  top:14px;
  right:14px;
  z-index:3;
  display:grid;
  gap:8px;
}

.results-card .reel-card__icon-btn{
  width:44px;
  height:44px;
  border:0;
  border-radius:14px;
  background:rgba(15,23,42,.42);
  color:#fff;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:transform var(--tr), background var(--tr);
  box-shadow:none;
}

.results-card .reel-card__icon-btn:hover{
  transform:translateY(-1px) scale(1.03);
  background:rgba(48,64,255,.60);
}

.results-card .reel-card__icon-btn--light,
.results-card .reel-card__icon-btn--dark{
  background:rgba(15,23,42,.42);
}

.results-card .reel-card__stats{
  position:absolute;
  left:14px;
  right:14px;
  bottom:14px;
  z-index:3;
  min-height:48px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  padding:9px 10px;
  border-radius:16px;
  background:rgba(15,23,42,.50);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border:0;
}

.results-card .reel-card__stat{
  min-width:0;
  display:grid;
  place-items:center;
  gap:4px;
  color:#fff;
}

.results-card .reel-card__stat-icon{
  height:auto;
  color:#fff;
}

.results-card .reel-card__stat-icon svg{
  width:17px;
  height:17px;
  display:block;
  opacity:.96;
}

.results-card .reel-card__stat-value{
  font-size:12px;
  line-height:1;
  font-weight:950;
  white-space:nowrap;
  color:#fff;
}

.results-card .reel-card__body{
  padding:12px 2px 0;
  display:flex;
  flex-direction:column;
  gap:0;
}

.results-card .reel-card__author{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  align-items:center;
  gap:9px;
}

.results-card .reel-card__avatar{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:999px;
  background:linear-gradient(135deg,#d9deff,#eef1ff);
  overflow:hidden;
  box-shadow:0 8px 18px rgba(15,23,42,.08);
}

.results-card .reel-card__username{
  min-width:0;
  color:#2437d6;
  font-size:15px;
  line-height:1.1;
  font-weight:950;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.results-card .reel-card__desc{
  margin-top:10px;
  font-size:14px;
  line-height:1.45;
  color:#405166;
  font-weight:750;
  min-height:42px;
  height:42px;
  overflow:hidden;
  display:block;
}

.results-card .reel-card__btn{
  width:100%;
  min-height:50px;
  margin-top:12px;
  border:0;
  border-radius:14px;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  color:#fff;
  font-size:14px;
  font-weight:950;
  cursor:pointer;
  box-shadow:0 14px 28px rgba(48,64,255,.18);
  transition:transform var(--tr), box-shadow var(--tr), opacity var(--tr);
}

.results-card .reel-card__btn:hover{
  transform:translateY(-1px);
  box-shadow:0 20px 36px rgba(48,64,255,.25);
}

/* Keep video controls behavior */
.play-overlay{
  z-index:4;
}

.reel-progress{
  z-index:5;
}

/* Animations */
@keyframes reelReveal{
  from{
    opacity:0;
    transform:translateY(16px) scale(.985);
    filter:blur(6px);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
    filter:blur(0);
  }
}

@keyframes shimmerBg{
  to{ background-position:-200% 0; }
}

/* Responsive */
@media (max-width:1500px){
  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}

@media (max-width:1280px){
  .workspace-shell{
    grid-template-columns:1fr;
  }

  .app-sidebar{
    width:100%;
    min-height:auto;
    position:static;
    border-right:0;
    border-bottom:1px solid #e2e8f0;
  }

  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media (max-width:900px){
  .search-box{
    grid-template-columns:1fr !important;
  }

  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .search-title{
    font-size:34px;
  }
}

@media (max-width:620px){
  .keyword-main{
    padding:14px;
  }

  .search-card__inner,
  .results-card__header,
  .results-card__body{
    padding-left:18px;
    padding-right:18px;
  }

  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:1fr;
  }

  .search-title{
    font-size:30px;
  }

  .results-card .reel-card__media{
    max-height:540px;
  }
}

/* Sort filter */
.search-box{
  grid-template-columns:minmax(0,1fr) 240px 150px !important;
}

.sort-control{
  position:relative;
}

.sort-select{
  width:100%;
  min-height:56px;
  appearance:none;
  -webkit-appearance:none;
  border-radius:18px;
  border:1px solid #dce5ef;
  background:
    radial-gradient(circle at top right, rgba(48,64,255,.08), transparent 34%),
    linear-gradient(180deg, #fff, #f9fbff);
  color:#0f172a;
  outline:none;
  padding:0 46px 0 16px;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 10px 22px rgba(15,23,42,.04);
  transition:border-color var(--tr), box-shadow var(--tr), transform var(--tr);
}

.sort-select:hover{
  transform:translateY(-1px);
  border-color:rgba(48,64,255,.24);
  box-shadow:0 16px 30px rgba(15,23,42,.07);
}

.sort-select:focus{
  border-color:rgba(48,64,255,.34);
  box-shadow:0 0 0 5px rgba(48,64,255,.08), 0 16px 30px rgba(15,23,42,.07);
}

.sort-control__icon{
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%);
  width:22px;
  height:22px;
  color:#64748b;
  pointer-events:none;
}

.sort-control__icon svg{
  width:22px;
  height:22px;
  display:block;
}

@media (max-width:900px){
  .search-box{
    grid-template-columns:1fr !important;
  }
}

/* ===============================
   PREMIUM SORT DROPDOWN
================================ */

.search-card{
  overflow:visible !important;
  position:relative;
  z-index:50;
}

.search-card__inner,
.search-box,
.search-field,
.pretty-sort{
  overflow:visible !important;
}

.results-card{
  position:relative;
  z-index:1;
}

.sort-native{
  position:absolute;
  opacity:0;
  pointer-events:none;
  width:1px;
  height:1px;
}

.pretty-sort{
  position:relative;
  width:100%;
}

.pretty-sort__button{
  width:100%;
  min-height:56px;
  border:1px solid #dce5ef;
  border-radius:18px;
  background:
    radial-gradient(circle at top right, rgba(48,64,255,.08), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  color:#0f172a;
  padding:8px 12px;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 28px;
  align-items:center;
  gap:10px;
  cursor:pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 10px 22px rgba(15,23,42,.04);
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.pretty-sort__button:hover{
  transform:translateY(-1px);
  border-color:rgba(48,64,255,.24);
  box-shadow:0 16px 30px rgba(15,23,42,.07);
}

.pretty-sort.is-open .pretty-sort__button{
  border-color:rgba(48,64,255,.36);
  box-shadow:
    0 0 0 5px rgba(48,64,255,.08),
    0 16px 30px rgba(15,23,42,.08);
}

.pretty-sort__icon{
  width:38px;
  height:38px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, rgba(48,64,255,.12), rgba(114,87,255,.10));
  color:#2437d6;
  font-size:17px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72);
}

.pretty-sort__text{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
}

.pretty-sort__small{
  font-size:10px;
  line-height:1;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#8a99a6;
}

.pretty-sort__text strong{
  max-width:100%;
  font-size:14px;
  line-height:1.15;
  font-weight:950;
  color:#0f172a;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pretty-sort__chevron{
  width:28px;
  height:28px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#64748b;
  transition:
    transform .2s ease,
    background .18s ease,
    color .18s ease;
}

.pretty-sort__chevron svg{
  width:19px;
  height:19px;
  display:block;
}

.pretty-sort.is-open .pretty-sort__chevron{
  transform:rotate(180deg);
  background:#eef2ff;
  color:#2437d6;
}

.pretty-sort__menu{
  position:absolute;
  top:calc(100% + 10px);
  left:0;
  right:0;
  z-index:100;
  padding:8px;
  border-radius:20px;
  border:1px solid rgba(220,229,239,.96);
  background:rgba(255,255,255,.96);
  box-shadow:0 24px 60px rgba(15,23,42,.14);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  transform-origin:top;
  animation:prettySortIn .18s cubic-bezier(.16,1,.3,1) both;
}

.pretty-sort__option{
  width:100%;
  min-height:58px;
  border:0;
  border-radius:15px;
  background:transparent;
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  gap:10px;
  align-items:center;
  text-align:left;
  padding:8px 10px;
  cursor:pointer;
  color:#0f172a;
  transition:
    background .16s ease,
    transform .16s ease,
    box-shadow .16s ease;
}

.pretty-sort__option:hover{
  background:#f4f7ff;
  transform:translateY(-1px);
}

.pretty-sort__option.is-active{
  background:linear-gradient(135deg, rgba(48,64,255,.12), rgba(114,87,255,.08));
  box-shadow:inset 0 0 0 1px rgba(48,64,255,.08);
}

.pretty-sort__option-icon{
  width:36px;
  height:36px;
  border-radius:13px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f1f5f9;
  font-size:16px;
}

.pretty-sort__option.is-active .pretty-sort__option-icon{
  background:#fff;
  color:#2437d6;
  box-shadow:0 8px 18px rgba(48,64,255,.10);
}

.pretty-sort__option strong{
  display:block;
  font-size:13px;
  line-height:1.1;
  font-weight:950;
  color:#122033;
}

.pretty-sort__option small{
  display:block;
  margin-top:4px;
  font-size:12px;
  line-height:1.25;
  color:#7a8ba0;
  font-weight:750;
}

@keyframes prettySortIn{
  from{
    opacity:0;
    transform:translateY(8px) scale(.98);
    filter:blur(4px);
  }

  to{
    opacity:1;
    transform:translateY(0) scale(1);
    filter:blur(0);
  }
}

/* Improved Reel Card Details */

.results-card .reel-card{
  padding:0;
  border-radius:24px;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

.results-card .reel-card:hover{
  transform:translateY(-4px);
  filter:saturate(1.04);
}

.reel-card__badges{
  position:absolute;
  top:14px;
  left:14px;
  z-index:4;
  display:flex;
  align-items:center;
  gap:7px;
  pointer-events:none;
}

.reel-card__badge{
  min-height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border-radius:11px;
  background:rgba(15,23,42,.52);
  color:#fff;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  font-size:12px;
  line-height:1;
  font-weight:950;
  letter-spacing:.01em;
  border:1px solid rgba(255,255,255,.12);
}

.reel-card__badge--muted{
  background:rgba(255,255,255,.16);
  color:rgba(255,255,255,.92);
}

.results-card .reel-card__body{
  padding:13px 2px 0;
}

.results-card .reel-card__author{
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  gap:10px;
  align-items:center;
}

.reel-card__author-main{
  min-width:0;
}

.results-card .reel-card__avatar{
  width:36px;
  height:36px;
  flex:0 0 36px;
  border-radius:999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), transparent 30%),
    linear-gradient(135deg, #3040ff 0%, #7257ff 100%);
  box-shadow:0 8px 18px rgba(48,64,255,.12);
}

.results-card .reel-card__username{
  color:#2437d6;
  font-size:15px;
  line-height:1.1;
  font-weight:950;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.reel-card__meta-row{
  margin-top:4px;
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  color:#8a99a6;
  font-size:12px;
  line-height:1.2;
  font-weight:850;
}

.reel-card__date,
.reel-card__source{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.reel-card__dot{
  width:4px;
  height:4px;
  border-radius:999px;
  background:#cbd5e1;
  flex:0 0 4px;
}

.results-card .reel-card__desc{
  margin-top:11px;
  color:#405166;
  font-size:13px;
  line-height:1.45;
  font-weight:700;
  min-height:40px;
  height:40px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.results-card .reel-card__btn{
  min-height:48px;
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:15px;
  font-weight:950;
  letter-spacing:-.01em;
}

.reel-card__btn-arrow{
  transition:transform .18s ease;
}

.results-card .reel-card__btn:hover .reel-card__btn-arrow{
  transform:translateX(3px);
}

.app-sidebar {
    width:248px;
    min-height:100vh;
    position:sticky;
    top:0;
    padding:16px 12px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    border-right:1px solid rgba(201,211,223,.7);
    background:linear-gradient(180deg, var(--sidebar-glass) 0%, var(--sidebar-glass-2) 100%);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    box-shadow:inset -1px 0 0 rgba(255,255,255,.55), 12px 0 40px rgba(15,23,42,.03);
  }

  .app-sidebar__top { display:flex; flex-direction:column; gap:18px; }

  .app-sidebar__brand {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:74px;
    border-radius:22px;
    text-decoration:none;
    padding:10px;
    background:rgba(255,255,255,.6);
    border:1px solid var(--sidebar-stroke);
    box-shadow:var(--shadow-sm);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
  }

  .app-sidebar__logo {
    max-width:170px;
    width:100%;
    height:auto;
    display:block;
    object-fit:contain;
  }

  .app-sidebar__nav-wrap { display:flex; flex-direction:column; gap:18px; }
  .app-sidebar__section { display:flex; flex-direction:column; gap:8px; }

  .app-sidebar__label {
    padding:0 10px;
    font-size:11px;
    line-height:1;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:#8a99a6;
  }

  .app-sidebar__nav { display:flex; flex-direction:column; gap:5px; }

  .app-sidebar__item {
    position:relative;
    display:flex;
    align-items:center;
    gap:10px;
    min-height:42px;
    padding:0 12px;
    border-radius:14px;
    text-decoration:none;
    color:#516774;
    font-size:14px;
    font-weight:700;
    transition:background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    border:1px solid transparent;
  }

  .app-sidebar__item:hover {
    background:rgba(255,255,255,.62);
    color:#1f2c35;
    box-shadow:0 10px 24px rgba(15,23,42,.05);
    border-color:rgba(255,255,255,.46);
    transform:translateY(-1px);
  }

  .app-sidebar__item.is-active {
    background:linear-gradient(135deg, rgba(97,95,255,.16), rgba(138,99,255,.10));
    color:#2e3eea;
    box-shadow:0 12px 26px rgba(97,95,255,.10), inset 0 0 0 1px rgba(97,95,255,.08);
    border-color:rgba(97,95,255,.14);
  }

  .app-sidebar__item.is-active::before {
    content:"";
    position:absolute;
    left:0;
    top:8px;
    bottom:8px;
    width:4px;
    border-radius:999px;
    background:linear-gradient(180deg, #615fff 0%, #8a63ff 100%);
  }

  .app-sidebar__icon {
    width:18px;
    height:18px;
    flex:0 0 18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:currentColor;
  }

  .app-sidebar__icon svg { width:18px; height:18px; display:block; }

  .app-sidebar__bottom {
    display:flex;
    flex-direction:column;
    gap:12px;
    padding-top:16px;
  }

  .sidebar-card,
  .sidebar-profile {
    border-radius:20px;
    border:1px solid rgba(255,255,255,.58);
    background:rgba(255,255,255,.62);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    box-shadow:var(--shadow-sm);
  }

  .sidebar-card { padding:14px; }

  .sidebar-card__row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:10px;
  }

  .sidebar-card__left { display:flex; align-items:center; gap:8px; min-width:0; }

  .sidebar-card__left-icon {
    width:20px;
    height:20px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#615fff;
  }

  .sidebar-card__left-icon svg { width:18px; height:18px; display:block; }
  .sidebar-card__title { font-size:13px; font-weight:700; color:#536876; white-space:nowrap; }
  .sidebar-card__value { font-size:18px; line-height:1; font-weight:900; color:#0f172a; }

  .sidebar-progress {
    height:8px;
    border-radius:999px;
    background:#e7ecf2;
    overflow:hidden;
  }

  .sidebar-progress__fill {
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg, #615fff 0%, #2f55ff 100%);
  }

  .sidebar-card__meta { margin-top:8px; font-size:12px; color:#8b99a5; }

  .sidebar-card__link {
    display:inline-flex;
    align-items:center;
    gap:6px;
    margin-top:12px;
    text-decoration:none;
    font-size:13px;
    font-weight:800;
    color:#2a3dff;
  }

  .sidebar-profile {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:10px 12px;
  }

  .sidebar-profile__left { display:flex; align-items:center; gap:10px; }

  .sidebar-profile__avatar {
    width:36px;
    height:36px;
    flex:0 0 36px;
    border-radius:999px;
    background:linear-gradient(135deg, #d9deff 0%, #eef1ff 100%);
    color:#2639d8;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:900;
    font-size:14px;
  }

  .sidebar-profile__name {
    font-size:14px;
    line-height:1.2;
    font-weight:800;
    color:#1f2b33;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .sidebar-profile__sub { margin-top:2px; font-size:12px; line-height:1.2; color:#8b99a5; }

  .sidebar-profile__action {
    width:36px;
    height:36px;
    flex:0 0 36px;
    border:0;
    border-radius:12px;
    background:#f4f7fa;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#607481;
    cursor:pointer;
    transition:transform .15s ease, background .15s ease;
  }

  .sidebar-profile__action:hover{ transform:translateY(-1px); background:#eef3f8; }
  .sidebar-profile__action svg { min-height:18px; min-width:18px; }

  /* =========================================================
   KEYWORD SEARCH PAGE RESPONSIVE PATCH
   Insert at the VERY END of the last <style>
========================================================= */

html{
  -webkit-text-size-adjust:100%;
}

body{
  overflow-x:hidden;
}

img,
video{
  max-width:100%;
}

.workspace-shell,
.app-sidebar,
.keyword-main,
.keyword-stack,
.search-card,
.results-card,
.results-box,
.results-grid,
.reel-card,
.reel-modal__dialog,
.rm-layout,
.rm-left,
.rm-right{
  min-width:0;
}

.mobile-appbar,
.mobile-sidebar-backdrop,
.app-sidebar__mobile-close{
  display:none;
}

/* Desktop / large monitor layout */
@media (min-width:1281px){
  .workspace-shell{
    grid-template-columns:270px minmax(0, 1fr) !important;
  }

  .app-sidebar{
    width:270px !important;
    min-height:100vh !important;
    position:sticky !important;
    top:0 !important;
    border-right:1px solid rgba(226,232,240,.86) !important;
    border-bottom:0 !important;
  }

  .keyword-main{
    width:100%;
    padding:24px !important;
  }

  .keyword-stack{
    width:100%;
    max-width:1500px;
    margin-inline:auto;
  }
}

@media (min-width:1600px){
  .workspace-shell{
    grid-template-columns:290px minmax(0, 1fr) !important;
  }

  .app-sidebar{
    width:290px !important;
  }

  .keyword-stack{
    max-width:1640px;
  }

  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  }
}

/* Small laptops: keep sidebar left instead of turning it into a top block */
@media (min-width:1025px) and (max-width:1280px){
  .workspace-shell{
    grid-template-columns:240px minmax(0, 1fr) !important;
  }

  .app-sidebar{
    width:240px !important;
    min-height:100vh !important;
    position:sticky !important;
    top:0 !important;
    border-right:1px solid rgba(226,232,240,.86) !important;
    border-bottom:0 !important;
  }

  .app-sidebar__brand{
    min-height:62px !important;
  }

  .app-sidebar__logo{
    max-width:140px !important;
  }

  .app-sidebar__item{
    min-height:40px !important;
    padding-inline:10px !important;
    font-size:13px !important;
  }

  .sidebar-card{
    padding:12px !important;
  }

  .keyword-main{
    padding:18px !important;
  }

  .keyword-stack{
    max-width:none !important;
  }

  .search-card__inner{
    padding:24px !important;
  }

  .search-title{
    font-size:38px !important;
  }

  .search-box{
    grid-template-columns:minmax(0, 1fr) 240px 145px !important;
  }

  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  }
}

/* =========================================================
   MOBILE SIDEBAR DRAWER
========================================================= */

@media (max-width:1024px){
  body.mobile-nav-open{
    overflow:hidden;
  }

  .workspace-shell{
    display:block !important;
    min-height:100vh;
  }

  .mobile-appbar{
    position:sticky;
    top:0;
    z-index:3000;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:64px;
    padding:10px 14px;
    border-bottom:1px solid rgba(226,232,240,.9);
    background:rgba(255,255,255,.82);
    backdrop-filter:blur(18px) saturate(140%);
    -webkit-backdrop-filter:blur(18px) saturate(140%);
    box-shadow:0 12px 32px rgba(15,23,42,.06);
  }

  .mobile-appbar__brand{
    display:flex;
    align-items:center;
    min-width:0;
    text-decoration:none;
  }

  .mobile-appbar__logo{
    display:block;
    width:auto;
    max-width:132px;
    max-height:34px;
    object-fit:contain;
  }

  .mobile-appbar__right{
    display:flex;
    align-items:center;
    gap:8px;
    flex:0 0 auto;
  }

  .mobile-token-pill{
    min-height:40px;
    padding:6px 12px;
    border-radius:999px;
    display:flex;
    align-items:center;
    gap:8px;
    background:linear-gradient(135deg, rgba(48,64,255,.10), rgba(114,87,255,.08));
    border:1px solid rgba(48,64,255,.14);
    box-shadow:0 8px 20px rgba(48,64,255,.08);
  }

  .mobile-token-pill__label{
    font-size:11px;
    line-height:1;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:#64748b;
  }

  .mobile-token-pill__value{
    min-width:18px;
    font-size:15px;
    line-height:1;
    font-weight:950;
    color:#2437d6;
    text-align:right;
  }

  .mobile-menu-btn{
    width:42px;
    height:42px;
    flex:0 0 42px;
    border:1px solid rgba(226,232,240,.95);
    border-radius:14px;
    background:#fff;
    display:inline-flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(15,23,42,.06);
  }

  .mobile-menu-btn span{
    width:18px;
    height:2px;
    border-radius:999px;
    background:#0f172a;
    display:block;
    transition:transform .18s ease, opacity .18s ease;
  }

  body.mobile-nav-open .mobile-menu-btn span:nth-child(1){
    transform:translateY(6px) rotate(45deg);
  }

  body.mobile-nav-open .mobile-menu-btn span:nth-child(2){
    opacity:0;
  }

  body.mobile-nav-open .mobile-menu-btn span:nth-child(3){
    transform:translateY(-6px) rotate(-45deg);
  }

  .mobile-sidebar-backdrop{
    position:fixed;
    inset:0;
    z-index:3900;
    display:block;
    background:rgba(15,23,42,.34);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
  }

  .mobile-sidebar-backdrop[hidden]{
    display:none !important;
  }

  body.mobile-nav-open .mobile-sidebar-backdrop{
    opacity:1;
    pointer-events:auto;
  }

  .app-sidebar{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    bottom:0 !important;
    z-index:4000 !important;

    width:min(340px, calc(100vw - 28px)) !important;
    height:100dvh !important;
    min-height:100dvh !important;

    padding:14px !important;
    padding-top:54px !important;

    display:flex !important;
    flex-direction:column !important;
    justify-content:flex-start !important;

    border-right:1px solid rgba(226,232,240,.95) !important;
    border-bottom:0 !important;
    border-radius:0 26px 26px 0;

    background:
      radial-gradient(circle at top right, rgba(48,64,255,.12), transparent 28%),
      linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.96)) !important;

    box-shadow:26px 0 70px rgba(15,23,42,.18) !important;
    backdrop-filter:blur(20px) saturate(140%) !important;
    -webkit-backdrop-filter:blur(20px) saturate(140%) !important;

    overflow-y:auto !important;
    transform:translateX(-108%);
    transition:transform .24s cubic-bezier(.16, 1, .3, 1);
  }

  body.mobile-nav-open .app-sidebar{
    transform:translateX(0);
  }

  .app-sidebar__mobile-close{
    position:absolute;
    top:12px;
    right:12px;
    width:36px;
    height:36px;
    border:1px solid rgba(226,232,240,.95);
    border-radius:13px;
    background:#fff;
    color:#0f172a;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:25px;
    line-height:1;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(15,23,42,.06);
  }

  .app-sidebar__top{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:18px !important;
  }

  .app-sidebar__brand{
    min-height:62px !important;
    justify-content:center !important;
    border-radius:20px !important;
  }

  .app-sidebar__logo{
    max-width:150px !important;
  }

  .app-sidebar__nav-wrap{
    display:flex !important;
    flex-direction:column !important;
    gap:18px !important;
    overflow:visible !important;
    padding-bottom:0 !important;
  }

  .app-sidebar__section{
    display:flex !important;
    flex-direction:column !important;
    gap:8px !important;
  }

  .app-sidebar__label{
    display:block !important;
    padding:0 10px !important;
    font-size:11px !important;
  }

  .app-sidebar__nav{
    display:flex !important;
    flex-direction:column !important;
    gap:6px !important;
  }

  .app-sidebar__item{
    min-height:44px !important;
    padding:0 12px !important;
    border-radius:15px !important;
    font-size:14px !important;
    white-space:normal !important;
  }

  .app-sidebar__item.is-active::before{
    left:0 !important;
    top:9px !important;
    bottom:9px !important;
    width:4px !important;
    height:auto !important;
    right:auto !important;
  }

  .app-sidebar__bottom{
    display:flex !important;
    flex-direction:column !important;
    gap:12px !important;
    padding-top:18px !important;
    margin-top:auto !important;
  }

  .app-sidebar .sidebar-card{
    display:block !important;
    padding:14px !important;
    border-radius:20px !important;
  }

  .app-sidebar .sidebar-card__row{
    display:flex !important;
    margin-bottom:10px !important;
  }

  .app-sidebar .sidebar-progress,
  .app-sidebar .sidebar-card__meta,
  .app-sidebar .sidebar-card__link{
    display:block !important;
  }

  .app-sidebar .sidebar-card__link{
    display:inline-flex !important;
  }

  .app-sidebar .sidebar-profile{
    display:flex !important;
    width:100% !important;
    padding:10px 12px !important;
    border-radius:20px !important;
  }
}

/* =========================================================
   SEARCH PAGE CONTENT RESPONSIVE
========================================================= */

@media (max-width:1024px){
  .keyword-main{
    padding:16px !important;
  }

  .keyword-stack{
    max-width:none !important;
    gap:16px;
  }

  .search-card,
  .results-card{
    border-radius:26px;
  }

  .search-card__inner{
    padding:24px !important;
  }

  .search-title{
    font-size:38px !important;
  }

  .search-box{
    grid-template-columns:minmax(0,1fr) 250px !important;
    gap:12px !important;
  }

  .search-btn{
    grid-column:1 / -1;
    width:100%;
  }

  .results-card__header{
    align-items:flex-start;
  }

  .results-actions{
    width:100%;
  }

  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:repeat(3, minmax(0,1fr)) !important;
  }
}

@media (max-width:820px){
  .search-box{
    grid-template-columns:1fr !important;
  }

  .search-field,
  .search-field--sort,
  .pretty-sort,
  .search-btn{
    width:100%;
  }

  .pretty-sort__menu{
    width:100%;
    min-width:100%;
    max-width:100%;
  }

  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
  }

  .results-card .reel-card__media,
  .results-skel-media{
    border-radius:20px;
  }
}

@media (max-width:640px){
  .mobile-appbar{
    min-height:58px;
    padding:8px 10px;
  }

  .mobile-appbar__logo{
    max-width:118px;
    max-height:30px;
  }

  .mobile-token-pill{
    min-height:38px;
    padding:5px 10px;
    gap:6px;
  }

  .mobile-token-pill__label{
    display:none;
  }

  .mobile-token-pill__value{
    font-size:14px;
  }

  .mobile-menu-btn{
    width:40px;
    height:40px;
    flex-basis:40px;
    border-radius:13px;
  }

  .app-sidebar{
    width:min(326px, calc(100vw - 18px)) !important;
    border-radius:0 22px 22px 0;
  }

  .keyword-main{
    padding:10px !important;
  }

  .keyword-stack{
    gap:12px;
  }

  .search-card,
  .results-card{
    border-radius:22px;
  }

  .search-card__inner,
  .results-card__header,
  .results-card__body{
    padding:16px !important;
  }

  .page-eyebrow{
    min-height:28px;
    font-size:10px;
  }

  .search-title{
    font-size:30px !important;
    letter-spacing:-.045em;
  }

  .search-subtitle{
    font-size:14px;
    line-height:1.55;
  }

  .keyword-input,
  .pretty-sort__button,
  .search-btn{
    min-height:52px !important;
    border-radius:16px !important;
  }

  .keyword-input{
    font-size:15px;
  }

  .quick-keywords{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .keyword-chip{
    width:100%;
    min-height:36px;
    justify-content:center;
  }

  .results-title{
    font-size:24px;
  }

  .results-subtitle{
    font-size:13px;
  }

  .results-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .result-pill{
    width:100%;
    justify-content:space-between;
  }

  .results-card #kwOut.results-box.results-grid,
  .results-skeleton{
    grid-template-columns:1fr !important;
  }

  .results-empty{
    min-height:300px;
    padding:28px 16px;
    border-radius:20px;
  }

  .results-empty__icon{
    width:62px;
    height:62px;
    border-radius:20px;
  }

  .results-empty__title{
    font-size:22px;
  }

  .results-empty__text{
    font-size:13px;
  }

  .results-card .reel-card{
    max-width:390px;
    width:100%;
    margin-inline:auto;
  }

  .results-card .reel-card__media,
  .results-skel-media{
    max-height:none !important;
    min-height:0 !important;
    aspect-ratio:9 / 14.4;
  }

  .results-card .reel-card__stats{
    left:10px;
    right:10px;
    bottom:10px;
    gap:5px;
    padding:8px;
  }

  .results-card .reel-card__stat-value{
    font-size:11px;
  }

  .results-card .reel-card__actions{
    top:10px;
    right:10px;
  }

  .results-card .reel-card__icon-btn{
    width:40px;
    height:40px;
  }

  .results-card .reel-card__desc{
    height:auto;
    min-height:0;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
}

@media (max-width:420px){
  .search-title{
    font-size:27px !important;
  }

  .quick-keywords{
    grid-template-columns:1fr;
  }

  .pretty-sort__button{
    grid-template-columns:34px minmax(0,1fr) 24px;
    gap:8px;
  }

  .pretty-sort__icon{
    width:34px;
    height:34px;
  }

  .pretty-sort__option{
    grid-template-columns:34px minmax(0,1fr);
  }
}

/* =========================================================
   REEL MODAL RESPONSIVE FIXES
========================================================= */

.rm-tabs-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

.rm-tabs-wrap::-webkit-scrollbar{
  display:none;
}

.rm-tabs{
  flex-wrap:nowrap;
  min-width:max-content;
}

.rm-tab{
  flex:0 0 auto;
  white-space:nowrap;
}

@media (max-width:980px){
  .reel-modal__dialog{
    width:96vw;
    height:94vh;
    margin:3vh auto;
    border-radius:24px;
  }

  .rm-layout{
    grid-template-columns:1fr !important;
    grid-template-rows:auto minmax(0,1fr);
  }

  .rm-left{
    max-height:42vh;
    overflow:auto;
    border-right:0;
    border-bottom:1px solid rgba(148,163,184,.12);
  }

  .rm-left-sticky{
    position:static;
    display:grid;
    grid-template-columns:minmax(190px,260px) minmax(0,1fr);
    grid-template-areas:
      "top top"
      "video info";
    align-items:start;
    gap:14px;
  }

  .rm-left-topbar{
    grid-area:top;
  }

  .rm-video-link-wrap{
    grid-area:video;
  }

  .rm-left-info{
    grid-area:info;
  }

  .rm-reel{
    max-height:34vh;
  }

  .rm-right{
    padding:16px;
  }

  .rm-appbar{
    top:-16px;
    padding-top:16px;
  }

  .rm-header-actions{
    margin-right:48px;
  }

  .rm-topic{
    max-width:none;
    font-size:clamp(24px, 4vw, 30px);
  }

  .rm-kpis{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .rm-grid-2,
  .rm-subgrid,
  .rm-skeleton-grid{
    grid-template-columns:1fr;
  }

  .rm-timeline-item{
    grid-template-columns:1fr;
  }

  .rm-time{
    top:0;
  }
}

@media (max-width:640px){
  .reel-modal__dialog{
    width:100vw;
    height:100vh;
    margin:0;
    border-radius:0;
  }

  .reel-modal__close{
    top:10px;
    right:10px;
    width:38px;
    height:38px;
    border-radius:12px;
    font-size:22px;
  }

  .rm-left{
    max-height:45vh;
    padding:12px;
  }

  .rm-left-sticky{
    display:flex;
    flex-direction:column;
    gap:12px;
  }

  .rm-left-topbar{
    padding-right:44px;
  }

  .rm-left-frame{
    padding:10px;
    border-radius:22px;
  }

  .rm-reel{
    max-height:30vh;
    border-radius:18px;
  }

  .rm-left-profile-card,
  .rm-left-stats-card,
  .rm-left-caption-card{
    padding:12px;
    border-radius:16px;
  }

  .rm-left-avatar{
    width:40px;
    height:40px;
    flex-basis:40px;
  }

  .rm-left-username{
    font-size:16px;
  }

  .rm-left-stats-grid{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .rm-stat{
    min-height:auto;
    padding:10px;
    border-radius:14px;
  }

  .rm-left .rm-stat__value{
    font-size:15px;
  }

  .rm-right{
    padding:12px;
  }

  .rm-appbar{
    top:-12px;
    padding-top:12px;
    margin-bottom:12px;
  }

  .rm-appbar__title{
    font-size:23px;
    padding-right:44px;
  }

  .rm-header-actions{
    margin-right:0;
    display:grid;
    grid-template-columns:1fr auto;
    width:100%;
  }

  .rm-primary-btn{
    width:100%;
    padding-inline:12px;
    font-size:13px;
  }

  .rm-toolbar-btn{
    min-width:74px;
    padding-inline:12px;
  }

  .rm-card,
  .rm-hero-card{
    padding:16px;
    border-radius:18px;
  }

  .rm-hero-main{
    grid-template-columns:1fr;
    gap:14px;
  }

  .rm-topic{
    font-size:24px;
  }

  .rm-meta-line{
    display:grid;
    grid-template-columns:1fr;
  }

  .rm-meta-pill{
    width:100%;
    justify-content:space-between;
  }

  .rm-score-card{
    border-radius:18px;
    padding:16px;
  }

  .rm-score-value{
    font-size:44px;
  }

  .rm-kpis{
    grid-template-columns:1fr;
    gap:10px;
  }

  .rm-transcript-toolbar{
    align-items:stretch;
  }

  .rm-subtabs{
    width:100%;
    overflow-x:auto;
    justify-content:flex-start;
    scrollbar-width:none;
  }

  .rm-subtabs::-webkit-scrollbar{
    display:none;
  }

  .rm-subtab{
    flex:0 0 auto;
    white-space:nowrap;
  }

  .rm-transcript-actions{
    width:100%;
  }

  .rm-transcript-actions .rm-toolbar-btn{
    width:100%;
  }

  .reel-modal__lock{
    padding:14px;
  }

  .reel-modal__lock-card{
    width:100%;
    border-radius:22px;
    padding:22px;
  }

  .rm-skeleton{
    padding:140px 12px 12px;
  }
}

@media (max-width:420px){
  .rm-left{
    max-height:48vh;
  }

  .rm-left-stats-grid{
    grid-template-columns:1fr;
  }

  .rm-header-actions{
    grid-template-columns:1fr;
  }

  .rm-toolbar-btn{
    width:100%;
  }

  .rm-score-topline{
    align-items:flex-start;
    flex-direction:column;
  }
}

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation:none !important;
    transition:none !important;
    scroll-behavior:auto !important;
  }
}

.app-sidebar__item.is-soon {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.app-sidebar__badge {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;   
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
  white-space: nowrap;
}


.results-card .reel-card__actions {
  z-index: 10;
}

.card_top-items-like {
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.card_top-items-like:hover {
  transform: scale(1.06);
}

.card_top-items-like.is-liked svg path {
  fill: #ff4e7b;
  stroke: #ff4e7b;
}

.card_top-items-like.is-saving {
  pointer-events: none;
  opacity: 0.65;
}

/* =========================================================
   KEYWORD SEARCH — COMPACT REELS COUNT PICKER
   Этот блок должен находиться в самом конце CSS.
========================================================= */


/* =========================================================
   FORM LAYOUT
========================================================= */

.search-box {
  display: grid !important;

  grid-template-columns:
    minmax(220px, 1fr)
    minmax(330px, 360px)
    minmax(195px, 220px)
    145px !important;

  gap: 14px !important;
  align-items: start !important;
}

.search-field--keyword,
.search-field--reels-count,
.search-field--sort,
.search-btn {
  min-width: 0;
  box-sizing: border-box;
}

.search-btn {
  width: 100%;
  margin-top: 24px;
}


/* =========================================================
   QUICK KEYWORDS UNDER KEYWORD INPUT
========================================================= */

.search-field--keyword .quick-keywords {
  width: 100%;
  margin-top: 8px;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.search-field--keyword .keyword-chip {
  width: auto;
  min-width: 0;
  min-height: 28px;

  padding: 0 9px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #dce5ef;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.82);
  color: #617383;

  font-family: inherit;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.search-field--keyword .keyword-chip:hover {
  transform: translateY(-1px);

  border-color: rgba(48, 64, 255, 0.28);

  background: #ffffff;
  color: #2437d6;
}


/* =========================================================
   REELS COUNT FIELD
========================================================= */

.search-field--reels-count {
  width: 100%;

  margin: 0;
  padding: 0;

  border: 0;
  min-inline-size: 0;
}

.search-field--reels-count > .search-field__label {
  display: block;

  margin: 0 0 8px;
  padding: 0;
}


/* =========================================================
   PICKER CONTAINER
========================================================= */

.reels-count-picker {
  width: 100%;
  min-width: 0;
  min-height: 56px;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(112px, 1.15fr);

  gap: 4px;

  padding: 4px;
  box-sizing: border-box;

  border: 1px solid #dce5ef;
  border-radius: 17px;

  background:
    radial-gradient(
      circle at top right,
      rgba(48, 64, 255, 0.07),
      transparent 38%
    ),
    linear-gradient(
      180deg,
      #ffffff,
      #f9fbff
    );

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 9px 20px rgba(15, 23, 42, 0.04);
}


/* =========================================================
   STANDARD / MAXIMUM OPTIONS
========================================================= */

.reels-count-option {
  width: 100%;
  min-width: 0;
  min-height: 48px;

  padding: 6px 7px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;

  border: 1px solid #dbe4ee;
  border-radius: 13px;

  background: rgba(255, 255, 255, 0.76);
  color: #64748b;

  font-family: inherit;
  text-align: center;

  cursor: pointer;

  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    opacity 0.18s ease;
}

.reels-count-option:hover {
  transform: translateY(-1px);

  border-color: rgba(48, 64, 255, 0.32);

  background: #ffffff;
  color: #3040ff;
}

.reels-count-option:focus-visible {
  outline: none;

  border-color: #3040ff;

  box-shadow:
    0 0 0 3px rgba(48, 64, 255, 0.11);
}

.reels-count-option.is-active {
  border-color: transparent;

  background:
    linear-gradient(
      135deg,
      var(--primary),
      var(--primary-2)
    );

  color: #ffffff;

  box-shadow:
    0 8px 18px rgba(48, 64, 255, 0.21),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.reels-count-option.is-unaffordable:not(.is-active) {
  opacity: 0.56;
}

.reels-count-option.is-unaffordable:not(.is-active)::after {
  content: "Low balance";

  margin-top: 1px;

  color: #dc2626;

  font-size: 7px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reels-count-option__line {
  min-width: 0;

  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
}

.reels-count-option__name {
  min-width: 0;

  font-size: 8px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.055em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  opacity: 0.82;
}

.reels-count-option strong {
  flex: 0 0 auto;

  font-size: 15px;
  line-height: 1;
  font-weight: 950;
}

.reels-count-option small {
  display: block;
  max-width: 100%;

  font-size: 8px;
  line-height: 1.1;
  font-weight: 750;
  white-space: nowrap;

  opacity: 0.76;
}


/* =========================================================
   CUSTOM OPTION
========================================================= */

.reels-count-custom {
  width: 100%;
  min-width: 0;
  min-height: 48px;

  padding: 5px 7px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  border: 1px solid #dbe4ee;
  border-radius: 13px;

  background: rgba(255, 255, 255, 0.76);
  color: #64748b;

  cursor: text;

  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.reels-count-custom:hover {
  transform: translateY(-1px);

  border-color: rgba(48, 64, 255, 0.32);

  background: #ffffff;
  color: #3040ff;
}

.reels-count-custom.is-active,
.reels-count-custom:focus-within {
  border-color: #3040ff;

  background: rgba(48, 64, 255, 0.055);
  color: #3040ff;

  box-shadow:
    0 0 0 3px rgba(48, 64, 255, 0.09);
}

.reels-count-custom__label {
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.reels-count-custom__input-wrap {
  width: 100%;
  min-width: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.reels-count-custom__input-wrap input {
  flex: 0 0 54px;

  width: 54px;
  min-width: 54px;
  max-width: 54px;
  height: 24px;

  padding: 0 3px;
  box-sizing: border-box;

  border: 1px solid #d7e0ea;
  border-radius: 8px;
  outline: none;

  background: #ffffff;
  color: #0f172a;

  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  text-align: center;

  appearance: textfield;
  -moz-appearance: textfield;
}

.reels-count-custom__input-wrap input:focus {
  border-color: #3040ff;

  box-shadow:
    0 0 0 2px rgba(48, 64, 255, 0.1);
}

.reels-count-custom__input-wrap input::-webkit-inner-spin-button,
.reels-count-custom__input-wrap input::-webkit-outer-spin-button {
  margin: 0;

  appearance: none;
  -webkit-appearance: none;
}

.reels-count-custom__input-wrap input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.reels-count-custom__unit {
  flex: 0 0 auto;

  color: #64748b;

  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}


/* =========================================================
   HINT
========================================================= */

.reels-count-hint {
  width: 100%;
  min-height: 14px;

  margin-top: 5px;

  color: #7b8d97;

  font-size: 9px;
  line-height: 1.35;
  font-weight: 700;

  overflow-wrap: anywhere;
}

.reels-count-hint.is-valid {
  color: #64748b;
}

.reels-count-hint.is-error {
  color: #dc2626;
}

.reels-count-picker.has-insufficient-balance {
  border-color: rgba(220, 38, 38, 0.32);
}


/* =========================================================
   MEDIUM SCREENS
========================================================= */

@media (max-width: 1350px) {
  .search-box {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(330px, 380px) !important;
  }

  .search-field--keyword {
    grid-column: 1;
  }

  .search-field--reels-count {
    grid-column: 2;
  }

  .search-field--sort {
    grid-column: 1;
  }

  .search-btn {
    grid-column: 2;

    margin-top: 24px;

    flex-direction: row;
    gap: 9px !important;

    padding-inline: 14px !important;
  }

  .search-btn .action-label {
    width: auto;
  }

  .search-btn .action-cost {
    min-height: 25px;
    padding-inline: 8px;
    font-size: 10px;
  }

  .search-btn .action-cost__icon {
    width: 12px !important;
    height: 12px !important;
    flex-basis: 12px;
  }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 760px) {
  .search-box {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }

  .search-field--keyword,
  .search-field--reels-count,
  .search-field--sort,
  .search-btn {
    grid-column: 1;

    width: 100%;
  }

  .search-btn {
    margin-top: 0;
  }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {
  .search-field--keyword .quick-keywords {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .search-field--keyword .keyword-chip {
    width: 100%;
    min-height: 32px;
  }

  .reels-count-picker {
    grid-template-columns: 1fr 1fr;
  }

  .reels-count-custom {
    grid-column: 1 / -1;
  }

  .reels-count-option,
  .reels-count-custom {
    min-height: 50px;
  }

  .reels-count-custom__input-wrap input {
    flex-basis: 64px;

    width: 64px;
    min-width: 64px;
    max-width: 64px;
  }
}

/* =========================================================
   TOKEN COST BADGES
   Search + analysis + script generation
========================================================= */

.search-btn,
.rm-primary-btn,
.reel-modal__lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}

/*
  Buttons already have shine pseudo-elements.
  Keep actual content above them.
*/
.action-label,
.action-cost {
  position: relative;
  z-index: 1;
}

.action-label {
  min-width: 0;
}

/* Shared token pill */
.action-cost {
  flex: 0 0 auto;

  min-height: 27px;
  padding: 0 9px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.15);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12);

  color: #fff;

  font-size: 11px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.01em;

  white-space: nowrap;
  pointer-events: none;
}

.action-cost__icon {
  width: 13px !important;
  height: 13px !important;
  flex: 0 0 13px;
  display: block;
}

/*
  Search has a variable cost, so make the pill
  slightly more compact.
*/
.search-btn .action-cost {
  padding-inline: 8px;
  font-size: 10px;
}

/* Loading state */
.search-btn:disabled,
.rm-primary-btn:disabled,
.reel-modal__lock-btn:disabled {
  cursor: not-allowed;
}

.search-btn:disabled .action-cost,
.rm-primary-btn:disabled .action-cost,
.reel-modal__lock-btn:disabled .action-cost {
  opacity: 0.72;
}

/* Small screens */
@media (max-width: 480px) {
  .search-btn,
  .rm-primary-btn,
  .reel-modal__lock-btn {
    gap: 8px;
  }

  .action-cost {
    min-height: 25px;
    padding-inline: 7px;
    font-size: 10px;
  }

  .search-btn .action-cost {
    font-size: 10px;
  }
}

/* =========================================================
   SEARCH BUTTON — compact token layout
========================================================= */

.search-btn {
  width: 100% !important;
  min-width: 0 !important;

  padding: 6px 10px !important;

  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4px !important;

  white-space: normal !important;
}

/* Main button text */
.search-btn .action-label {
  width: 100%;

  display: block;

  font-size: 13px;
  line-height: 1.05;
  font-weight: 950;

  text-align: center;
  white-space: nowrap;

  overflow: hidden;
  text-overflow: ellipsis;
}

/* Token cost under the button text */
.search-btn .action-cost {
  width: auto;
  max-width: 100%;

  min-height: 20px;

  padding: 0 7px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 4px;

  font-size: 9px;
  line-height: 1;
  font-weight: 850;

  white-space: nowrap;
}

/* Slightly smaller token icon in Search */
.search-btn .action-cost__icon {
  width: 11px !important;
  height: 11px !important;
  flex: 0 0 11px;
}

/* Hide protected page until authentication is confirmed */
#searchByKeywordApp[hidden] {
  display: none !important;
}