/* History-search presentation only. Native search, data and navigation owners are unchanged. */
@media (min-width: 721px) {
  body:has(#message-form[data-composer-theme="neon-space"]) #history-search-modal {
    padding: 16px;
    overflow: auto;
    scrollbar-gutter: stable;
    container-type: inline-size;
    align-items: safe center;
    justify-content: safe center;
    & .history-search-card {
      --hs-width: min(1000px, 100cqw, calc((100dvh - 32px) * 1232 / 1277));
      --hs-unit: calc(var(--hs-width) / 1232);
      position: relative;
      isolation: isolate;
      flex: 0 0 auto;
      display: block;
      width: var(--hs-width);
      height: calc(var(--hs-unit) * 1277);
      max-width: none;
      max-height: none;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      overflow: hidden;
      background: transparent;
      box-shadow: none;
      clip-path: polygon(.9% 8%,6.2% 1.5%,13.5% 1.5%,14.2% 2.2%,82% 2.2%,82.8% 1.7%,93% 1.7%,99.3% 7.2%,99.3% 94%,94% 99.5%,6.5% 99.5%,.9% 94%);
      &::before,&::after { content: "";position: absolute;inset: 0;pointer-events: none; }
      &::before {
        z-index: -2;
        clip-path: polygon(8% 6.7%,92% 6.7%,95.3% 10%,95.3% 91%,92% 95.8%,8% 95.8%,4.7% 91%,4.7% 10%);
        background: linear-gradient(115deg,#001434,#010a27 60%,#090426);
      }
      &::after {
        z-index: -1;
        background: url("assets/history-search/artwork.svg#frame") center/100% 100% no-repeat;
        animation: history-search-frame-breathe 6.8s ease-in-out infinite alternate;
      }
      & > .self-profile-title {
        position: absolute;
        top: calc(var(--hs-unit) * 104);
        left: calc(var(--hs-unit) * 350);
        width: calc(var(--hs-unit) * 535);
        margin: 0;
        padding: 0;
        color: #fcfcff;
        display: flex;
        justify-content: center;
        font: 700 calc(var(--hs-unit) * 52)/1.2 Arial,sans-serif;
        letter-spacing: 0;
        text-align: center;
        text-transform: uppercase;
        white-space: nowrap;
        transform: scaleX(.923);
        text-shadow: calc(var(--hs-unit) * -2) 0 calc(var(--hs-unit) * 6) #008fff,calc(var(--hs-unit) * 2) 0 calc(var(--hs-unit) * 6) #d521ff;
      }
    }
    & #history-search-close {
      position: absolute;
      top: calc(var(--hs-unit) * 99);
      left: calc(var(--hs-unit) * 1076);
      width: calc(var(--hs-unit) * 76);
      height: calc(var(--hs-unit) * 76);
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      border: calc(var(--hs-unit) * 4) solid #ef4be8;
      border-radius: 50%;
      background: radial-gradient(circle,#260d40,#14082c);
      box-shadow: 0 0 calc(var(--hs-unit) * 17) #f327e8aa,inset 0 0 calc(var(--hs-unit) * 10) #db23f044;
      font-size: 0;
      cursor: pointer;
      transition: transform 180ms ease,filter 180ms ease;
      &::before,&::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 20%;
        width: 60%;
        height: calc(var(--hs-unit) * 5);
        border-radius: calc(var(--hs-unit) * 2);
        background: #fbfbff;
        transform: translateY(-50%) rotate(45deg);
        pointer-events: none;
      }
      &::after { transform: translateY(-50%) rotate(-45deg); }
      &:is(:hover,:focus-visible) { transform: scale(1.06);filter: brightness(1.17); }
      &:active { transform: scale(.95);filter: brightness(1.3); }
    }
    & .history-search-card > .self-profile-field {
      position: absolute;
      top: calc(var(--hs-unit) * 164);
      left: calc(var(--hs-unit) * 98);
      width: calc(var(--hs-unit) * 1037);
      height: calc(var(--hs-unit) * 122);
      display: block;
      margin: 0;
      padding: 0;
      & > span {
        display: block;
        margin: 0;
        color: #b5c7fa;
        text-align: center;
        font: 400 clamp(13px,calc(var(--hs-unit) * 28),28px)/1.2 "Segoe UI",sans-serif;
        letter-spacing: 0;
      }
      &::after {
        content: "";
        position: absolute;
        left: calc(var(--hs-unit) * 26);
        top: calc(var(--hs-unit) * 55);
        width: calc(var(--hs-unit) * 62);
        height: calc(var(--hs-unit) * 62);
        background: url("assets/history-search/artwork.svg#search-icon") center/100% 100% no-repeat;
        pointer-events: none;
      }
    }
    & #history-search-input {
      position: absolute;
      top: calc(var(--hs-unit) * 42);
      left: 0;
      width: 100%;
      min-width: 0;
      height: calc(var(--hs-unit) * 80);
      box-sizing: border-box;
      margin: 0;
      padding: 0 calc(var(--hs-unit) * 24) 0 calc(var(--hs-unit) * 104);
      border: calc(var(--hs-unit) * 6) solid transparent;
      border-radius: calc(var(--hs-unit) * 27);
      background: linear-gradient(110deg,#001331,#060b27 65%,#100729) padding-box;
      box-shadow: none;
      color: #f4f3ff;
      font: 400 clamp(14px,calc(var(--hs-unit) * 28),28px)/1.2 "Segoe UI",sans-serif;
      letter-spacing: 0;
      outline: none;
      transition: box-shadow 180ms ease;
      &::placeholder { color: #9c9fc4;opacity: 1; }
      &:focus-visible { box-shadow: inset 0 0 calc(var(--hs-unit) * 10) #1984e333; }
    }
    & #history-search-results {
      position: absolute;
      top: calc(var(--hs-unit) * 314);
      left: calc(var(--hs-unit) * 99);
      width: calc(var(--hs-unit) * 1035);
      height: calc(var(--hs-unit) * 864);
      max-height: none;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      gap: calc(var(--hs-unit) * 13);
      margin: 0;
      padding: calc(var(--hs-unit) * 9) calc(var(--hs-unit) * 15) calc(var(--hs-unit) * 20);
      border: 0;
      border-radius: calc(var(--hs-unit) * 24);
      background: linear-gradient(110deg,#031930,#080b2b 65%,#10082a);
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: thin;
      scrollbar-color: #7455aa transparent;
      list-style: none;
    }
    & .history-search-item {
      position: relative;
      flex: 0 0 auto;
      min-width: 0;
      box-sizing: border-box;
      margin: 0;
      padding: calc(var(--hs-unit) * 14) calc(var(--hs-unit) * 21) calc(var(--hs-unit) * 15);
      border: calc(var(--hs-unit) * 2) solid #477ec9;
      border-radius: calc(var(--hs-unit) * 24);
      background: linear-gradient(115deg,#01162e,#070c26 75%,#0b0c27);
      box-shadow: none;
      text-align: left;
      font-family: Arial,sans-serif;
      cursor: pointer;
      transition: border-color 180ms ease,box-shadow 180ms ease,transform 180ms ease,filter 180ms ease;
      &:hover { border-color: #6cb8ff;box-shadow: inset 0 0 calc(var(--hs-unit) * 12) #1477b944;transform: translateY(-1px);filter: brightness(1.08); }
      &:active { transform: scale(.995);filter: brightness(1.15); }
    }
    & .history-search-item-head { display: flex;align-items: center;gap: calc(var(--hs-unit) * 10);min-width: 0;margin: 0 0 calc(var(--hs-unit) * 4); }
    & .history-search-item-author {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font: 700 clamp(15px,calc(var(--hs-unit) * 30),30px)/1.2 Arial,sans-serif;
      transform: scaleX(.97);
      transform-origin: left center;
    }
    & .history-search-item-time { flex: 0 0 auto;margin-left: auto;color: #a0c3ff;font: 400 clamp(13px,calc(var(--hs-unit) * 24),24px)/1.3 "Segoe UI",sans-serif;white-space: nowrap; }
    & .history-search-item-text {
      min-width: 0;
      margin-left: calc(var(--hs-unit) * 22);
      color: #eef0ff;
      font: 400 clamp(14px,calc(var(--hs-unit) * 23.8),23.8px)/calc(var(--hs-unit) * 32.5) "Segoe UI",sans-serif;
      overflow-wrap: anywhere;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    & #history-search-empty {
      position: absolute;
      top: calc(var(--hs-unit) * 400);
      left: calc(var(--hs-unit) * 125);
      width: calc(var(--hs-unit) * 980);
      margin: 0;
      color: #b5c7fa;
      text-align: center;
      font: 400 clamp(14px,calc(var(--hs-unit) * 26),26px)/1.4 Arial,sans-serif;
    }
    &:is([data-history-search-motion="paused"],[data-history-search-motion="reduced"]) .history-search-card::after { animation-play-state: paused; }
  }
}
@keyframes history-search-frame-breathe { from { opacity: .94;filter: brightness(1); } to { opacity: 1;filter: brightness(1.07); } }
@media (min-width: 721px) and (prefers-reduced-motion: reduce) {
  body:has(#message-form[data-composer-theme="neon-space"]) #history-search-modal {
    & .history-search-card::after { animation: none; }
    & :is(#history-search-close,#history-search-input,.history-search-item) { transition: none; }
    & .history-search-item:hover,& #history-search-close:hover { transform: none; }
  }
}
