:root {
  --c-primary: #d0bcff;
  --c-on-primary: #381e72;
  --c-primary-container: #4f378b;
  --c-primary-container-on: #eaddff;
  --c-secondary: #ccc2dc;
  --c-secondary-on: #332d41;
  --c-secondary-container: #4a4458;
  --c-secondary-container-on: #e8def8;
  --c-tertiary: #efb8c8;
  --c-tertirary-on: #492532;
  --c-tertiary-container: #633b48;
  --c-tertiary-container-on: #ffd8e4;
  --c-error: #f2b8b5;
  --c-error-on: #601410;
  --c-error-container: #8c1d18;
  --c-error-container-on: #f9dedc;
  --c-surface: #141218;
  --c-surface-on: #e6e0e9;
  --c-surface-variant: #49454f;
  --c-surface-variant-on: #cac4d0;
  --c-surface-container-highest: #36343b;
  --c-surface-container-high: #2b2930;
  --c-surface-container: #211f26;
  --c-surface-container-low: #1d1b20;
  --c-surface-container-lowest: #0f0d13;
  --c-surface-inverse: #e6e0e9;
  --c-surface-inverse-on: #322f35;
  --c-surface-tint: #d0bcff;
  --c-outline: #938f99;
  --c-outline-variant: #49454f;

  --sidebar-width: 100%;
  --sidebar-radius: 0 0 0 0;
}

body {
  color: #f6f6f6;
  background-color: #1d1b20;
  font: 90% system-ui;
  margin: 0;

  justify-content: center;
  justify-self: center;
  justify-items: center;

  align-items: center;
  align-content: center;
  align-self: center;

  vertical-align: middle;

  display: flex;
  flex-direction: column;

  height: 100dvh;
  width: 100dvw;

  overflow: hidden;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  -webkit-tap-highlight-color: transparent;
}

::backdrop {
  background-color: var(--c-surface-container-lowest);
}

html {
  height: 100dvh;
  width: 100dvw;
}

img {
  width: 1.5em;
  height: 1.5em;
  filter: invert(100%);
  user-select: none;

  &.tint-light {
    filter: invert(70%) sepia(49%) saturate(1681%) hue-rotate(201deg)
      brightness(111%) contrast(112%);
  }

  &.tint-dark {
    filter: invert(18%) sepia(34%) saturate(2853%) hue-rotate(237deg)
      brightness(90%) contrast(108%);
  }
}

/* LARGE SCREEN */
@media only screen and (min-width: 800px) {
  .main-content > * {
    max-width: 900px;
    width: 70%;
    --max_width: 940px;
  }

  :root {
    --sidebar-width: 25em;
    --sidebar-radius: 0 0.75em 0.75em 0;
  }

  .card {
    padding: 1.25em !important;
    border-radius: 1em !important;
  }

  h1 {
    font-size: 2em;
  }
  h2 {
    font-size: 1.5em;
  }
}

@media only screen and (pointer: coarse) {
  body {
    font: 100% system-ui;
  }
}

a {
  color: #222;
  text-decoration: none;
  /*transition: text-decoration 0.5s, filter 0.5s;*/
  display: inline;
}

@media (prefers-color-scheme: dark) {
  body {
    color: var(--c-surface-on);
    background: var(--c-surface-container-lowest);
  }

  body a {
    color: var(--c-surface-on);
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0.25em;
}

.dotted * {
  outline: #ffff00a0 2px dotted;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-corner {
  width: 0;
  height: 0;
}

::-webkit-scrollbar-thumb {
  background-color: #d0bcff80;
  border-radius: 1em;
}

::-webkit-scrollbar-track-piece:start {
  background: transparent;
}

::-webkit-scrollbar-track-piece:end {
  background: transparent;
}

.disabled {
  display: none !important;
  visibility: hidden !important;
  max-width: 0 !important;
  max-height: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
}

button,
input[type="submit"] {
  border-radius: 1em;
  padding: 1em;
  background-color: #4f378b;
  color: var(--c-primary-container-on);
  outline: none;
  border: none;
  transition: filter 0.25s;
  vertical-align: middle;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;

  user-select: none;

  &.clear {
    background-color: transparent;
    color: var(--c-primary);
    padding: 0.5em;
  }

  &.inverse {
    background-color: var(--c-primary);
    color: var(--c-on-primary);
  }

  &.onsurface {
    background-color: transparent;
    color: var(--c-surface-on);
    padding: 0.5em;
  }

  &:disabled {
    opacity: 0.2;
    cursor: default;
    filter: grayscale(1);
  }

  &:enabled {
    cursor: pointer;
  }

  &:enabled:hover {
    background-color: var(--c-primary-container-on);
    color: var(--c-primary-container);
  }

  &:enabled:active {
    filter: brightness(70%);
  }
}

.title-bar {
  user-select: none;
  background-color: var(--c-surface-container-high);
  width: 100%;
  flex: 2;
  flex-direction: row;
  display: flex;
  vertical-align: middle;
  padding: 0 0.5em 0 0.5em;
  border-radius: 1em;
  padding: 1em;
  margin-bottom: 0.25em;
  /*box-shadow: -1px 6px 21px 6px rgba(0, 0, 0, 0.51);*/

  font-size: clamp(0.5em, 3dvw, 1em);

  div,
  h1,
  a {
    margin: auto;
    text-align: center;
    flex: 100;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  a {
    font-size: 2em;
    font-weight: bolder;
    text-decoration: none;
  }

  > button {
    flex: 1;
    margin: 0 1em 0 1em;
    background-color: transparent !important;
    font-size: 2em;

    > span.material-symbols-rounded {
      font-size: 200%;
      padding: 0 0.05em 0 0.05em;
    }
  }

  img {
    scale: 1.25;
  }
}

.main-content {
  flex: 100;

  max-width: 100%;
  --max_width: 100%;

  overflow-x: hidden;

  display: flex;
  flex-direction: column;

  align-items: center;
  align-content: center;

  vertical-align: top;
  box-sizing: content-box;

  width: 100%;

  > *:last-child {
    margin-bottom: 10dvh !important;
  }
}

#works-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card {
  max-width: 85dvw;

  box-sizing: content-box;

  background-color: var(--c-surface-container);
  color: #e6e0e9;
  border: none;
  border-radius: 1em;
  padding: 1em;
  margin: 1em;
  display: block;

  a {
    display: inline;
  }

  &:not(.import):not(.search) {
    width: calc(var(--max_width) - 4em);
    max-width: calc(var(--max_width) - 4em);
  }
}

.section-title {
  display: flex;
  flex-direction: row;

  > *:first-child {
    flex: 100;
  }

  .title {
    flex: 100;
    text-align: left;
    vertical-align: middle;
    margin-bottom: 0;
  }

  .date {
    text-align: right;
    vertical-align: middle;
    margin-bottom: auto;
    font-size: 1.1em;
  }
}

.title {
  font-size: 1.75em;
  margin-left: 0;
  margin-top: 0;
}

.authors {
  font-size: 1.2em;

  * {
    display: inline;
  }
}

a.author {
  display: inline;
}

.author:not(:last-child)::after {
  content: ",";
  display: inline-block;
  margin-right: 0.25em;
  text-decoration: none !important;
  text-decoration-thickness: 0 !important;
  text-decoration-style: none !important;
}

.fandoms {
  margin-top: 0.25em;
  font-size: 1.1em;
  color: #d3cdd6;
}

a.fandom {
  display: inline;
}

a.fandom:not(:last-child)::after {
  content: ", ";
  display: inline-block;
  margin-right: 0.2em;
  text-decoration: none !important;
  text-decoration-thickness: 0 !important;
  text-decoration-style: none !important;
}

.tag {
  color: white;
  text-decoration: none;
}

.tag:not(:last-child)::after {
  content: ", ";
  display: inline-block;
  margin-right: 0.2em;
  text-decoration: none !important;
  text-decoration-thickness: 0 !important;
  text-decoration-style: none !important;
}

/*
*:not(:last-child) > .tag::after {
  content: ", ";
  margin-right: 0.25em;
}

*:last-child > .tag:not(:last-child):after {
  content: ", ";
  margin-right: 0.25em;
}
*/

.tags {
  max-width: 100%;
  margin: 0.5em;
  padding: 0;

  * {
    display: inline-block;
  }

  > * {
    display: inline-block;
    margin-right: 0.1em;
  }
}

.warnings {
  font-size: 1em;
  display: inline-block;
  margin-right: 0.5em;
}

.warnings a {
  display: inline-block;
}

.relationships {
  font-size: 1em;
  text-decoration: underline;
}

.characters {
  font-size: 1em;
  text-decoration: underline;
}

.freeforms {
  font-size: 0.95em;

  > a {
    color: #aba5ad;
  }
}

.spacer {
  width: 100%;
  margin: 0.5em 0 0.5em 0;
  height: 0.1em;
  background-color: #413d44;
}

.series {
  display: inline;

  > * {
    display: inline;
  }

  .name {
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
    text-decoration: underline;
  }
}

.stats {
  margin-bottom: 0.5em;
  font-size: 0.9em;
  line-height: 1.5;
}

.version-info {
  font-style: italic;
  color: var(--c-secondary);
  font-size: 0.85em;
  opacity: 0.8;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  align-items: center;
  justify-content: center;
  margin-left: 1em;
}

.card-action-button {
  background: none;
  border: none;
  padding: 0.6em;
  cursor: pointer;
  border-radius: 12px;
  transition:
    background 0.2s,
    opacity 0.2s,
    transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-action-button:active {
  transform: scale(0.95);
  filter: brightness(70%);
}

.card-action-button:hover {
  background-color: var(--c-surface-variant) !important;
  opacity: 1 !important;
}

.card-action-button .material-symbols-rounded {
  font-size: 24px; /* Default */
}

.field-label-icon {
  font-size: 0.9em;
  opacity: 0.6;
}

.ao3-button .material-symbols-rounded {
  font-size: 22px;
  opacity: 0.7;
}

.bookmark-button .material-symbols-rounded {
  font-size: 36px;
}

.bookmark-icon {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  transition:
    font-variation-settings 0.2s,
    opacity 0.2s,
    color 0.2s;
  opacity: 0.4;
}

.bookmark-icon.filled {
  font-variation-settings:
    "FILL" 1,
    "wght" 700,
    "GRAD" 0,
    "opsz" 24;
  opacity: 1;
  color: #ffb400;
}

.card-action-button:hover .bookmark-icon:not(.filled) {
  opacity: 0.8;
}

a:not(.static) {
  cursor: pointer;
}

a:not(.static):hover {
  text-decoration: underline;
  filter: brightness(80%);
}

a:not(.static):active {
  filter: brightness(70%);
}

.card.split {
  display: flex;
  flex-direction: row;
  gap: 1em;

  div.left {
    flex: 100;
  }

  div.right {
    flex: 1;
  }

  .middle-content {
    display: flex;
    justify-content: center;
    align-items: center;
    justify-items: center;
    align-content: center;
    vertical-align: middle;
    align-self: center;
    justify-self: center;
  }
}

.info {
  color: #aba5ad;
  margin: 0em;
  font-size: 1.1em;

  &.thin {
    font-weight: 400;
  }

  &.bold {
    font-weight: bold;
  }

  &:empty {
    max-height: 0;
    padding: 0;
    margin: -0.5em;
  }
}

.info-title {
  font-weight: bold;
  margin: 0em 0em 0.5em 0em;
  font-size: 1.5em;
  vertical-align: middle;
  display: flex;
  flex-direction: row;

  > span.material-symbols-rounded {
    flex: 1;
    font-size: 1.25em;
    vertical-align: middle;
    margin: auto;
  }

  > span:first-child {
    flex: 100;
  }
}

blockquote {
  border-left: 0.1em #aba5ad solid;
  margin: 1em;
  padding: 0.001em 1em 0.001em 1em;
}

.popup {
  z-index: 1000;
  display: flex;
  position: absolute;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  justify-items: center;
  align-items: center;
  align-content: center;
  align-self: center;
  vertical-align: middle;
  background-color: #12121288;
}

.card.import {
  border: var(--c-primary-container-on) solid 0.1em;
  width: 400px;
  max-width: 90%;
  box-sizing: border-box;

  font-size: 1.25em;

  h1,
  h2,
  h3,
  h4,
  h5 {
    text-align: left;
    margin: 0.5em;
  }

  p {
    margin: 0.5em;
  }

  button {
    font-size: 1em;
    margin: 0.25em;
  }
}

.card.confirm {
  > img {
    margin-top: 0.25em;
    scale: 1.5;
  }

  .confirm-header {
    margin-top: 0.25em;
    text-align: center;
  }

  .confirm-contents {
    max-height: 16em;
    margin-bottom: 0.5em;

    &:empty {
      overflow: hidden;
      height: 0;
    }

    &:not(:empty) {
      overflow: auto;
    }
  }

  p {
    margin: 0 1em 0 1em;

    &:empty {
      height: 0;
    }
  }
}

.children-block {
  > * {
    display: block;
  }
}

.children-inline {
  > * {
    display: inline;
  }
}

.children-width-100 {
  > * {
    width: 100%;
  }
}

.children-fill {
  display: flex;

  &.equal {
    > * {
      flex: 1;
    }
  }

  &.second {
    > *:nth-child(2) {
      flex: 100;
    }

    > *:not(:nth-child(2)) {
      flex: 1;
    }
  }

  &.first {
    > *:first-child {
      flex: 100;
    }

    > *:not(:first-child) {
      flex: 1;
    }
  }

  &.col {
    flex-direction: column;
    justify-items: center;
  }

  &.row {
    flex-direction: row;
    justify-items: center;
    align-items: center;
  }
}

.card.search {
  z-index: inherit;
  border: var(--c-primary-container-on) solid 0.15em;

  width: 80%;
  height: 80%;

  display: flex;
  flex-direction: column;

  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="date"] {
    width: 100%;
    box-sizing: border-box;
  }

  .contents {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    box-sizing: border-box;
    /*mask:  linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);*/

    &::-webkit-scrollbar {
      width: 0;
    }
    margin-bottom: 1em;
  }

  h2 {
    margin-top: 0.5em;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  img {
    font-size: 0.5em;
  }
}

.semantic-toggle {
  background: transparent !important;
  padding: 0.2em !important;
  margin-left: 0.5em;
  opacity: 0.3;
  transition:
    opacity 0.2s,
    filter 0.2s;
  border-radius: 50% !important;
  width: 2em;
  height: 2em;
}

.semantic-toggle.active {
  opacity: 1;
  filter: drop-shadow(0 0 5px var(--c-primary));
}

.semantic-toggle img {
  width: 1.2em !important;
  height: 1.2em !important;
  filter: invert(80%) sepia(50%) saturate(2000%) hue-rotate(240deg) !important;
}

.semantic-toggle.active img {
  filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%)
    contrast(100%) !important;
  background-color: var(--c-primary);
  border-radius: 50%;
  padding: 2px;
}

div.input-area {
  display: flex !important;
  flex-direction: row;
  gap: 1em;

  justify-items: center;
  align-items: center;

  > *:first-child {
    flex: 100;
  }

  > *:not(:first-child) {
    flex: 1;
  }
}

.card.search-info {
  width: calc(var(--max_width) - 4em);
  max-width: calc(var(--max_width) - 4em);
  border: var(--c-primary-container-on) solid 0.15em;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"] {
  font-size: 1.1em;
  outline: none;
  background-color: #36343b;
  color: var(--c-surface-on);
  border: none;
  border-radius: 0.25em 0.25em 0.1em 0.1em;
  padding: 0.5em;
  border-bottom: #49454f 0.15em solid;

  transition: border 0.1s;

  &:hover {
    border-bottom: var(--c-primary) 0.15em solid;
  }
}

select {
  font-size: 1.1em;
  border-radius: 0.5em;
  padding: 0.5em;
  background-color: var(--c-primary-container);
  color: var(--c-primary-container-on);
  outline: none;
  border: none;
  transition: filter 0.25s;
}

select.inverse {
  background-color: var(--c-primary);
  color: var(--c-on-primary);
}

select.input-like {
  background-color: var(--c-surface-container-highest);
  color: white;
  border: none;
  border-right: 0.5em transparent solid;
  border-radius: 0.25em 0.25em 0.1em 0.1em;
  padding: 0.5em;
  border-bottom: var(--c-surface-variant) 0.15em solid;

  transition: border 0.1s;

  &:hover {
    border-bottom: var(--c-primary) 0.15em solid;
  }
}

select:not(.dont-fill) {
  width: 100%;
}

select:enabled {
  cursor: pointer;
}

select:enabled:not(.input-like):hover {
  filter: brightness(80%);
}

select:enabled:not(.input-like):active {
  filter: brightness(70%);
}

div.label-content {
  display: flex;
  flex-direction: row;

  > *:first-child {
    flex: 1;
    margin-right: 0.5em;
  }

  > *:not(:first-child) {
    flex: 100;
  }
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.recommendation {
  margin: 0.5em 0 0.5em 0;
  background-color: var(--c-surface-container-highest);
  border-radius: 0.25em;
  padding: 0.5em;

  .bit {
    > * {
      display: inline;
    }

    > button {
      margin-left: 0.5em;
      padding: 0.25em;
      border-radius: 2em;
    }

    span {
      font-size: 1em;
      margin: 0;
      padding: 0;
      vertical-align: text-bottom;
    }
  }
}

.recommendation:empty {
  max-height: 0px;
  margin: 0px;
  padding: 0px;
  border: none;
}

.bookmark-button {
  flex: 1;
  background-color: transparent;
  padding: 0.1em;
  font-size: 2em;

  display: flex;
  flex-direction: column;
  justify-content: start;
  padding-top: 0.25em;
  height: fit-content;

  border-radius: 0;

  user-select: none;

  img {
    /*transition: filter .25s;*/
    transition: opacity 0.25s;
    &.off {
      opacity: 75%;
    }
  }
}

.loader {
  width: 10dvh;
  height: 10dvh;
  border: 1dvh solid var(--c-primary-container-on);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.button-go-to-top {
  position: fixed;
  z-index: 10;
  bottom: 1em;
  right: 1em;
  font-size: 1em;
  box-shadow: 0 0 16px #0f0d1385;

  transition: bottom 0.5s ease-in-out;

  &.hidden {
    bottom: -4em;
  }
}

.fadein {
  animation: forwards kf-fadein 0.1s ease-in-out;
}

.fadeout {
  animation: reverse kf-fadein 0.1s ease-in-out;
}

@keyframes kf-fadein {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.popup h3 {
  margin: 1.5em 0 0.5em 0;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  font-weight: bold;
}

.sidebar {
  position: absolute;
  height: 100%;
  width: var(--sidebar-width);
  left: 0;
  background-color: var(--c-surface-container-highest);

  border-radius: var(--sidebar-radius);

  .content {
    padding: 1em;

    > button {
      width: 100%;
      background-color: var(--c-surface-container-highest);
      text-align: left !important;
      font-size: 1.1em;
      color: var(--c-primary);
    }
  }
}

.autocomplete-dropdown {
  position: absolute;
  background-color: var(--c-surface-container-high);
  border: 1px solid var(--c-outline-variant);
  border-radius: 0.5em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  max-height: 200px;
  overflow-y: auto;
  box-sizing: border-box;
}

.autocomplete-item {
  padding: 0.75em 1em;
  cursor: pointer;
  color: var(--c-surface-on);
  font-size: 0.9em;
  border-bottom: 1px solid var(--c-outline-variant);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background-color: var(--c-primary-container);
  color: var(--c-primary-container-on);
}

.badge {
  background: var(--c-surface-variant);
  color: var(--c-surface-variant-on);
  padding: 0.1em 0.5em;
  border-radius: 1em;
  font-size: 0.85em;
  font-weight: bold;
}

.card.outdated {
  outline: 3px solid #ff9800;
  outline-offset: -3px;
  background-color: rgba(255, 152, 0, 0.05);
}

.card.deleted {
  outline: 3px solid #f44336;
  outline-offset: -3px;
  background-color: rgba(244, 67, 54, 0.05);
  opacity: 0.8;
}

.autocomplete-item strong {
  color: var(--c-primary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin: 1em auto;
  width: min(var(--max_width), 85dvw);
  box-sizing: border-box;
}

.p-nums {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  flex-grow: 1;
}

.pagination-controls .page-info {
  font-size: 0.9em;
  opacity: 0.8;
}

.pagination-controls button img {
  width: 1.5em;
  height: 1.5em;
}

.pagination-controls button:disabled {
  opacity: 0.2;
  cursor: default;
}

.p-num {
  min-width: 2.5em;
  height: 2.5em;
  border-radius: 50% !important;
  font-weight: bold;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.p-num.active {
  background-color: var(--c-primary) !important;
  color: white !important;
}

.dots {
  opacity: 0.5;
  font-weight: bold;
}

.rating-badge {
  font-size: 0.65em;
  font-weight: bold;
  padding: 0.25em 0.6em;
  border-radius: 4px;
  background-color: var(--c-primary);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.tag.warnings {
  border-color: #ff9800 !important;
  color: #ff9800 !important;
}

.error-log-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--c-outline-variant);
  border-radius: 8px;
  padding: 1em;
  max-height: 200px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.85em;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 0.5em;
  color: var(--c-error);
}

.error-log-box strong {
  color: var(--c-surface-on);
}

.rating.tag {
  background-color: var(--c-primary-container) !important;
  color: var(--c-primary-container-on) !important;
  font-weight: bold;
}

.category.tag {
  background-color: var(--c-secondary-container) !important;
  color: var(--c-secondary-container-on) !important;
}

.version-info {
  font-size: 0.9em;
  font-style: italic;
  opacity: 0.8;
  margin-top: 8px;
  display: inline-block;
}

.version-info.outdated {
  color: #ff9800;
  font-weight: bold;
  opacity: 1;
}

.version-info.deleted {
  color: var(--c-error);
  font-weight: bold;
  opacity: 1;
}

.menu-card {
  width: min(500px, 95vw) !important;
  height: min(700px, 85vh);
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  background-color: var(--c-surface-container);
  border: 1px solid var(--c-outline-variant);
}

.menu-header {
  display: flex;
  align-items: center;
  padding: 1.25em;
  border-bottom: 1px solid var(--c-outline-variant);
  gap: 1em;
  background-color: var(--c-surface-container-high);
}

.menu-header h2 {
  flex: 1;
  margin: 0;
  font-size: 1.25em;
  font-weight: 600;
}

.menu-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-height: 300px;
}

.menu-content {
  width: 100%;
  padding: 0.5em 0;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  background-color: var(--c-surface-container);
}

.menu-content.animating {
  position: absolute;
  top: 0;
  left: 0;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s;
}

@keyframes slideOutLeft {
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}
@keyframes slideOutRight {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-out-left {
  animation: slideOutLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-out-right {
  animation: slideOutRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-in-right {
  animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-in-left {
  animation: slideInLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger effect */
.menu-content > *:nth-child(1) {
  animation-delay: 0.02s;
}
.menu-content > *:nth-child(2) {
  animation-delay: 0.04s;
}
.menu-content > *:nth-child(3) {
  animation-delay: 0.06s;
}
.menu-content > *:nth-child(4) {
  animation-delay: 0.08s;
}
.menu-content > *:nth-child(5) {
  animation-delay: 0.1s;
}
.menu-content > *:nth-child(6) {
  animation-delay: 0.12s;
}
.menu-content > *:nth-child(7) {
  animation-delay: 0.14s;
}
.menu-content > *:nth-child(8) {
  animation-delay: 0.16s;
}

.menu-item {
  margin: 0 1.25em;
  transition:
    transform 0.1s,
    filter 0.2s;
}

.menu-item:active {
  transform: scale(0.98);
}

.menu-item img {
  width: 22px;
  height: 22px;
}

.menu-item .label {
  flex: 1;
  font-size: 1.05em;
  font-weight: bold;
  text-align: left;
}

.menu-item .chevron {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  margin-right: -0.5em;
  margin-top: -0.25em;
}

.menu-item.danger {
  background-color: var(--c-error-container) !important;
  color: var(--c-error-container-on) !important;
}

.menu-item.danger img {
  filter: none !important;
}

.menu-item > .material-symbols-rounded {
  padding-left: 0.25em;
}

.menu-section-header {
  padding: 1.5em 1.5em 0.5em 2em;
  font-size: 0.85em;
  font-weight: bold;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}
#button-search {
  position: relative;
}

#button-search.drag-over::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--c-surface-container-high);
  color: var(--c-on-surface);
  padding: 0.4em 0.8em;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: var(--shadow-2);
  z-index: 1000;
  pointer-events: none;
  border: 1px solid var(--c-outline-variant);
  animation: kf-fadein 0.2s ease-out;
}

#button-search.already-added.drag-over::after {
  background: var(--c-error-container);
  color: var(--c-on-error-container);
  border-color: var(--c-error);
}

.search-card {
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.search-card.drag-over {
  background-color: var(--c-secondary-container) !important;
  border: 2px dashed var(--c-primary) !important;
}

.search-card.drag-over::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--c-surface-container-high);
  color: var(--c-on-surface);
  padding: 0.4em 0.8em;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: bold;
  box-shadow: var(--shadow-1);
  pointer-events: none;
}

.search-card.already-added.drag-over {
  background-color: var(--c-error-container) !important;
  border-color: var(--c-error) !important;
}

.d-none {
  display: none !important;
}
